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) |
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.
| 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_.
| int Sundance::IntVec::abs | ( | ) | const |
Return the sum of elements in this vector
Definition at line 61 of file SundanceIntVec.cpp.
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.
| 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
such that
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.
| IntVec Sundance::IntVec::operator* | ( | int | alpha | ) | const |
Definition at line 26 of file SundanceIntVec.cpp.
Definition at line 15 of file SundanceIntVec.cpp.
| bool Sundance::IntVec::operator< | ( | const IntVec & | other | ) | const |
Definition at line 91 of file SundanceIntVec.cpp.
| bool Sundance::IntVec::operator== | ( | const IntVec & | other | ) | const |
Definition at line 81 of file SundanceIntVec.cpp.
| int Sundance::IntVec::operator[] | ( | int | i | ) | const [inline] |
Definition at line 62 of file SundanceIntVec.hpp.
References data_.
| int& Sundance::IntVec::operator[] | ( | int | i | ) | [inline] |
Definition at line 65 of file SundanceIntVec.hpp.
References data_.
| int Sundance::IntVec::pow | ( | const IntVec & | other | ) | const |
Definition at line 47 of file SundanceIntVec.cpp.
| 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] |
Definition at line 59 of file SundanceIntVec.hpp.
References data_.
Referenced by abs(), factorial(), getPartitions(), norm(), operator*(), operator+(), operator<(), operator==(), pow(), and Sundance::weightedOrderedPartitions().
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().
Array<int> Sundance::IntVec::data_ [private] |
Definition at line 101 of file SundanceIntVec.hpp.
Referenced by abs(), factorial(), getPartitions(), IntVec(), norm(), operator*(), operator+(), operator<(), operator==(), operator[](), pow(), print(), and size().