atlas  0.6
Classes | Public Types | Public Member Functions | Private Attributes | List of all members
atlas::partition::Partition Class Reference

#include <partition.h>

Classes

class  Comp
 

Public Types

typedef PartitionIterator iterator
 

Public Member Functions

 Partition ()
 
 Partition (unsigned long n)
 Undefined partition of [0,n[ with no classes yet (use |add_class|) More...
 
 Partition (std::vector< unsigned long > &)
 
 Partition (std::vector< unsigned long > &, tags::UnnormalizedTag)
 Counts the number of elements in class #c. More...
 
 ~Partition ()
 
void swap (Partition &)
 
unsigned long class_of (unsigned long j) const
 
bool operator== (const Partition &other) const
 
unsigned long classCount () const
 
unsigned long classRep (unsigned long c) const
 
unsigned long classSize (unsigned long) const
 Counts the number of elements in class #c. More...
 
unsigned long size () const
 
Comp comparer () const
 
void addToClass (unsigned long c, unsigned long j)
 Adds value j to class #c. More...
 
void clear ()
 Clears all entries of d_classRep. More...
 
unsigned long new_class (unsigned long c)
 
void resize (unsigned long n)
 Resizes the class to be a partition of [0,n[. More...
 

Private Attributes

std::vector< unsigned long > d_class
 
std::vector< unsigned long > d_classRep
 

Member Typedef Documentation

Constructor & Destructor Documentation

atlas::partition::Partition::Partition ( )
inline
atlas::partition::Partition::Partition ( unsigned long  n)
inlineexplicit

Undefined partition of [0,n[ with no classes yet (use |add_class|)

atlas::partition::Partition::Partition ( std::vector< unsigned long > &  f)
explicit
atlas::partition::Partition::Partition ( std::vector< unsigned long > &  f,
tags::UnnormalizedTag   
)

Counts the number of elements in class #c.

NOTE: Straightforward implementation. Successively computing |classSize| for all classes would cost more time then necessary.

atlas::partition::Partition::~Partition ( )
inline

Member Function Documentation

void atlas::partition::Partition::addToClass ( unsigned long  c,
unsigned long  j 
)
inline

Adds value j to class #c.

Assumes that class #c is already non-empty; that is, that j is not the first element of the class. For the first element of a class, use newClass(j) instead.

unsigned long atlas::partition::Partition::class_of ( unsigned long  j) const
inline
unsigned long atlas::partition::Partition::classCount ( ) const
inline
unsigned long atlas::partition::Partition::classRep ( unsigned long  c) const
inline
unsigned long atlas::partition::Partition::classSize ( unsigned long  c) const

Counts the number of elements in class #c.

NOTE: Straightforward implementation. Successively computing |classSize| for all classes with this method would cost more time then necessary.

void atlas::partition::Partition::clear ( )
inline

Clears all entries of d_classRep.

Comp atlas::partition::Partition::comparer ( ) const
inline
unsigned long atlas::partition::Partition::new_class ( unsigned long  c)
bool atlas::partition::Partition::operator== ( const Partition other) const
inline
void atlas::partition::Partition::resize ( unsigned long  n)
inline

Resizes the class to be a partition of [0,n[.

unsigned long atlas::partition::Partition::size ( ) const
inline
void atlas::partition::Partition::swap ( Partition other)

Member Data Documentation

std::vector<unsigned long> atlas::partition::Partition::d_class
private
std::vector<unsigned long> atlas::partition::Partition::d_classRep
private

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