Public Member Functions | Private Attributes | Related Functions
Sundance::IntVec Class Reference
Inheritance diagram for Sundance::IntVec:
Playa::Printable

List of all members.

Public Member Functions

 IntVec ()
 IntVec (const Array< int > &d)
 IntVec (int n)
int size () const
int operator[] (int i) const
int & operator[] (int i)
IntVec operator+ (const IntVec &other) const
IntVec operator* (int alpha) const
int factorial () const
int pow (const IntVec &other) const
int abs () const
int norm () const
bool operator== (const IntVec &other) const
bool operator< (const IntVec &other) const
void print (std::ostream &os) const
void getPartitions (int M, Array< Array< IntVec > > &parts) const

Private Attributes

Array< int > data_

Related Functions

(Note that these are not member functions.)

IntVec operator* (int a, const IntVec &x)
std::ostream & operator<< (std::ostream &os, const IntVec &v)

Detailed Description

An integer vector class for use in the generalized chain rule of Constantine and Savits (1996). See the paper by CS for definitions of the various operations.

Definition at line 59 of file SundanceIntVec.hpp.


Constructor & Destructor Documentation

Definition at line 63 of file SundanceIntVec.hpp.

Referenced by getPartitions().

Sundance::IntVec::IntVec ( const Array< int > &  d) [inline]

Definition at line 65 of file SundanceIntVec.hpp.

Definition at line 51 of file SundanceIntVec.cpp.

References data_.


Member Function Documentation

int Sundance::IntVec::abs ( ) const

Return the sum of elements in this vector

Definition at line 103 of file SundanceIntVec.cpp.

References data_, and size().

Referenced by getPartitions(), norm(), and operator<().

Return the factorial of this vector, as defined by CS

Definition at line 76 of file SundanceIntVec.cpp.

References data_, and size().

void Sundance::IntVec::getPartitions ( int  M,
Array< Array< IntVec > > &  parts 
) const

Get the length-M partitions of this vector. These are all list of exactly M vectors $ v_i$ such that

\[ \sum_{i=1}^M v_i = this. \]

Definition at line 155 of file SundanceIntVec.cpp.

References abs(), data_, IntVec(), Sundance::nextNum(), Sundance::restrictedCompositions(), and size().

Referenced by Sundance::pSet().

int Sundance::IntVec::norm ( ) const

Return the infinity norm of this vector

Definition at line 113 of file SundanceIntVec.cpp.

References abs(), data_, and size().

IntVec Sundance::IntVec::operator* ( int  alpha) const

Definition at line 68 of file SundanceIntVec.cpp.

References data_, and size().

IntVec Sundance::IntVec::operator+ ( const IntVec other) const

Definition at line 57 of file SundanceIntVec.cpp.

References data_, and size().

bool Sundance::IntVec::operator< ( const IntVec other) const

Definition at line 133 of file SundanceIntVec.cpp.

References abs(), data_, and size().

bool Sundance::IntVec::operator== ( const IntVec other) const

Definition at line 123 of file SundanceIntVec.cpp.

References data_, and size().

int Sundance::IntVec::operator[] ( int  i) const [inline]

Definition at line 73 of file SundanceIntVec.hpp.

References data_.

int& Sundance::IntVec::operator[] ( int  i) [inline]

Definition at line 76 of file SundanceIntVec.hpp.

References data_.

int Sundance::IntVec::pow ( const IntVec other) const

Definition at line 89 of file SundanceIntVec.cpp.

References data_, and size().

void Sundance::IntVec::print ( std::ostream &  os) const [virtual]

Implements Playa::Printable.

Definition at line 149 of file SundanceIntVec.cpp.

References data_.

Referenced by operator<<().

int Sundance::IntVec::size ( ) const [inline]

Friends And Related Function Documentation

IntVec operator* ( int  a,
const IntVec x 
) [related]

Definition at line 118 of file SundanceIntVec.hpp.

std::ostream & operator<< ( std::ostream &  os,
const IntVec v 
) [related]

Definition at line 124 of file SundanceIntVec.hpp.

References print().


Member Data Documentation

Array<int> Sundance::IntVec::data_ [private]

Site Contact