Main   Namespaces   Classes   Hierarchy   Annotated   Files   Compound   Global   Pages  

SortedSequence Class Reference

#include <SortedSequence.hpp>

List of all members.

Public Member Functions

 SortedSequence ()
 Creates an empty sorted sequence.
 SortedSequence (int max, int num)
 Creates a seq with max values max, and num indices.
 SortedSequence (int max, const std::vector< int > &seq)
 Creates a sequence with max value max and current indices seq; seq must be strictly increasing.
bool finished () const
 Returns true if no more valid sequences.
int & operator[] (int n)
 Returns a reference to the nth index.
void operator++ ()
 Updates indices to next valid sorted sequence.
std::vector< int > & indices ()
 Returns the indices as a vector of integers.

Private Attributes

int m_max
std::vector< int > m_seq

Detailed Description

Definition at line 20 of file SortedSequence.hpp.


Constructor & Destructor Documentation

SortedSequence::SortedSequence (  )  [inline]

Creates an empty sorted sequence.

Definition at line 54 of file SortedSequence.hpp.

SortedSequence::SortedSequence ( int  max,
int  num 
) [inline]

Creates a seq with max values max, and num indices.

Definition at line 59 of file SortedSequence.hpp.

References m_max, and m_seq.

SortedSequence::SortedSequence ( int  max,
const std::vector< int > &  seq 
) [inline]

Creates a sequence with max value max and current indices seq; seq must be strictly increasing.

Definition at line 73 of file SortedSequence.hpp.


Member Function Documentation

bool SortedSequence::finished (  )  const [inline]

Returns true if no more valid sequences.

Definition at line 78 of file SortedSequence.hpp.

References m_max, and m_seq.

std::vector< int > & SortedSequence::indices (  )  [inline]

Returns the indices as a vector of integers.

Definition at line 89 of file SortedSequence.hpp.

References m_seq.

void SortedSequence::operator++ (  )  [inline]

Updates indices to next valid sorted sequence.

Definition at line 94 of file SortedSequence.hpp.

References m_max, and m_seq.

int & SortedSequence::operator[] ( int  n  )  [inline]

Returns a reference to the nth index.

If these value is changed to make the sequence not strictly increasing, further output is undefined.

Definition at line 83 of file SortedSequence.hpp.

References m_seq.


Member Data Documentation

int SortedSequence::m_max [private]

Definition at line 49 of file SortedSequence.hpp.

Referenced by finished(), operator++(), and SortedSequence().

std::vector<int> SortedSequence::m_seq [private]

Definition at line 50 of file SortedSequence.hpp.

Referenced by finished(), indices(), operator++(), operator[](), and SortedSequence().


The documentation for this class was generated from the following file:


6 Jan 2011 Doxygen 1.6.3