omc::Tuple Class Reference
List of all members.
Public Member Functions |
| Tuple (size_t, size_t) |
| Tuple (size_t, const std::string &) |
| Tuple (size_t, const std::vector< index_t > &) |
| Tuple () |
| Tuple (const Tuple &) |
bool | next () |
index_t & | operator[] (index_t) |
index_t | operator[] (index_t) const |
bool | operator== (const Tuple &) |
bool | operator!= (const Tuple &) |
size_t | size () const |
int | order () const |
Static Public Attributes |
static const int | norder = 0 |
Protected Attributes |
size_t | m_numElements |
std::vector< index_t > | m_Element |
Friends |
std::ostream & | operator<< (std::ostream &, const Tuple &) |
Constructor & Destructor Documentation
omc::Tuple::Tuple |
( |
size_t |
r, |
|
|
size_t |
n | |
|
) |
| | |
Constructor: construct the smallest r-tuple of {0,1,...,n-1} by default or an all-zero r-tuple.
omc::Tuple::Tuple |
( |
size_t |
n, |
|
|
const std::string & |
s | |
|
) |
| | |
Constructor: constructing a tuple from a string. Note: in this case it is assumed there are no more than 9 elements.
omc::Tuple::Tuple |
( |
size_t |
n, |
|
|
const std::vector< index_t > & |
Element | |
|
) |
| | |
Constructor: constructing a tuple from a vector.
omc::Tuple::Tuple |
( |
|
) |
[inline] |
omc::Tuple::Tuple |
( |
const Tuple & |
T |
) |
[inline] |
Member Function Documentation
bool omc::Tuple::next |
( |
|
) |
[inline] |
Operator ++: get the next tuple in lexicographical order. Return false if there is no more tupel after it.
bool omc::Tuple::operator!= |
( |
const Tuple & |
t |
) |
[inline] |
bool omc::Tuple::operator== |
( |
const Tuple & |
t |
) |
[inline] |
index_t omc::Tuple::operator[] |
( |
index_t |
i |
) |
const [inline] |
index_t & omc::Tuple::operator[] |
( |
index_t |
i |
) |
[inline] |
Operator [] : accesor to a specified element in the tuple.
int omc::Tuple::order |
( |
|
) |
const |
Get the order of the current tuple in the lexicographical ordering. Note: The smallest tuple "01...r" has order 1. Returns: 1) Tuple::noder - if the tuple has duplicate elements in it. 2) non-negative order - if the tuple can be converted to the normalized one using an even permuation. 3) negative order - if the tuple can be converted to the normalized one using an odd permutation.
size_t omc::Tuple::size |
( |
|
) |
const [inline] |
The documentation for this class was generated from the following files: