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 48 of file SundanceIntVec.hpp.


Constructor & Destructor Documentation

Sundance::IntVec::IntVec (  )  [inline]

Definition at line 52 of file SundanceIntVec.hpp.

Referenced by getPartitions().

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

Definition at line 54 of file SundanceIntVec.hpp.

Sundance::IntVec::IntVec ( int  n  ) 

Definition at line 9 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 61 of file SundanceIntVec.cpp.

References data_, and size().

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

int Sundance::IntVec::factorial (  )  const

Return the factorial of this vector, as defined by CS

Definition at line 34 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 113 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 71 of file SundanceIntVec.cpp.

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

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

Definition at line 26 of file SundanceIntVec.cpp.

References data_, and size().

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

Definition at line 15 of file SundanceIntVec.cpp.

References data_, and size().

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

Definition at line 91 of file SundanceIntVec.cpp.

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

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

Definition at line 81 of file SundanceIntVec.cpp.

References data_, and size().

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

Definition at line 65 of file SundanceIntVec.hpp.

References data_.

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

Definition at line 62 of file SundanceIntVec.hpp.

References data_.

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

Definition at line 47 of file SundanceIntVec.cpp.

References data_, and size().

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

Implements Playa::Printable.

Definition at line 107 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 107 of file SundanceIntVec.hpp.

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

Definition at line 113 of file SundanceIntVec.hpp.

References print().


Member Data Documentation

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

Site Contact