#include <partition.h>
Public Types | |
| typedef unsigned long | argument_type |
| Required to make Partition an adaptable unary function object. | |
| typedef unsigned long | result_type |
| Required to make Partition an adaptable unary function object. | |
Public Member Functions | |
| Partition () | |
| Partition (unsigned long n) | |
| The trivial partition of [0,n[ into a single class. | |
| Partition (std::vector< unsigned long > &) | |
| Constructs a partition from the class vector f. | |
| Partition (std::vector< unsigned long > &, tags::UnnormalizedTag) | |
| Like the previous one, but uses the actual values of f to number the classes. | |
| ~Partition () | |
| void | swap (Partition &) |
| unsigned long | operator() (unsigned long j) const |
| bool | operator== (const Partition &other) const |
| unsigned long | classCount () const |
| Returns the number of classes in the partition. | |
| unsigned long | classRep (unsigned long c) const |
| Returns the number of an element belong to class # c. | |
| unsigned long | classSize (unsigned long) const |
| Counts the number of elements in class #c. | |
| unsigned long | size () const |
| Number of elements of the underlying set of the partition. | |
| void | addToClass (unsigned long c, unsigned long j) |
| Adds value j to class #c. | |
| void | clear () |
| Clears all entries of d_classRep. | |
| void | newClass (unsigned long c) |
| Starts a new class at location j. | |
| void | resize (unsigned long n) |
| Resizes the class to be a partition of [0,n[. | |
Private Attributes | |
| std::vector< unsigned long > | d_class |
| The number d_class[j] labels the class containing the value j. | |
| std::vector< unsigned long > | d_classRep |
| The value d_classRep[i] is some element of class #i. | |
The partition is represented by a vector d_class of n unsigned longs, mapping values to a number in [0,s[ characterizing the class (where s is the number of classes), and by a vector d_classRep of s unsigned longs that inversely gives a representative element for each class.
The class is equipped with members allowing it to be used as an unary function object ; this objects behaves as the map d_class.
Main application is to the Fiber class: in that case n=2^m, with m at most RANK_MAX; then elements of [0,n[ are interpreted as elements of a vector space (Z/2Z)^m. Typical partitions are into the orbits of a Weyl group acting on this vector space (such partitions are computed by makeOrbits).
Definition at line 69 of file partition.h.
|
|
Required to make Partition an adaptable unary function object. Alternatively we could have got this by deriving the Parition class from std::unary_function<unsigned long,unsigned long> Definition at line 93 of file partition.h. |
|
|
Required to make Partition an adaptable unary function object. Alternatively we could have got this by deriving the Parition class from std::unary_function<unsigned long,unsigned long> Definition at line 101 of file partition.h. |
|
|
Definition at line 104 of file partition.h. |
|
|
The trivial partition of [0,n[ into a single class.
Definition at line 109 of file partition.h. |
|
|
Constructs a partition from the class vector f. The partition is defined by values i and j belonging to the same class if and only if f[i]==f[j]. Note that f can have values in any range, but the Partition will label its classes consecutively from 0. Definition at line 45 of file partition.cpp. References addToClass(), and newClass(). |
|
||||||||||||
|
Like the previous one, but uses the actual values of f to number the classes. NOTE: it is required that the range of |f| be of the form [0,a[ (without holes). The vector |d_classRep| is dimensioned to the _number_ of (distinct) values in the image of |f|, but indexed by those values themselves, which will overflow the vector bounds if there were any holes in the range of |f|. Definition at line 74 of file partition.cpp. References d_classRep. |
|
|
Definition at line 115 of file partition.h. |
|
||||||||||||
|
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. Definition at line 161 of file partition.h. Referenced by atlas::graph::OrientedGraph::cells(), atlas::partition::makeOrbits(), and Partition(). |
|
|
Returns the number of classes in the partition.
Definition at line 132 of file partition.h. References size(). Referenced by atlas::graph::OrientedGraph::cells(), atlas::cartanclass::Fiber::makeRealFormPartition(), atlas::cartanclass::CartanClass::numRealFormClasses(), atlas::cartanclass::Fiber::numRealForms(), and atlas::cartanset::CartanClassSet::updateStatus(). |
|
|
|
Counts the number of elements in class #c. NOTE: Straightforward implementation. Successively computing |classSize| for all classes would cost more time then necessary. Definition at line 131 of file partition.cpp. Referenced by atlas::cartanset::CartanClassSet::dualFiberSize(), atlas::cartanset::CartanClassSet::fiberSize(), and atlas::cartanclass::CartanClass::isMostSplit(). |
|
|
Clears all entries of d_classRep.
Definition at line 170 of file partition.h. Referenced by atlas::partition::makeOrbits(). |
|
|
Starts a new class at location j. Previous classes are labelled 0 through d_classRep.size()-1, so the new class is labelled d_classRep.size(). The location j is added to the end of d_classRep, as the representative of this new class. Definition at line 114 of file partition.cpp. References d_class, and d_classRep. Referenced by atlas::graph::OrientedGraph::cells(), atlas::partition::makeOrbits(), and Partition(). |
|
|
Definition at line 121 of file partition.h. |
|
|
Definition at line 125 of file partition.h. References d_class. |
|
|
Resizes the class to be a partition of [0,n[.
Definition at line 179 of file partition.h. Referenced by atlas::graph::OrientedGraph::cells(), and atlas::partition::makeOrbits(). |
|
|
Number of elements of the underlying set of the partition.
Definition at line 148 of file partition.h. Referenced by atlas::kgb::KGBHelp::backtrack_seed(), atlas::graph::OrientedGraph::cells(), classCount(), atlas::interpreter::fiber_part_wrapper(), atlas::cartanclass::Fiber::makeRealFormPartition(), and atlas::interpreter::print_gradings_wrapper(). |
|
|
Definition at line 105 of file partition.cpp. References d_class, and d_classRep. Referenced by atlas::graph::OrientedGraph::cells(), and atlas::cartanclass::Fiber::swap(). |
|
|
The number d_class[j] labels the class containing the value j.
Definition at line 76 of file partition.h. Referenced by newClass(), operator==(), and swap(). |
|
|
The value d_classRep[i] is some element of class #i.
Definition at line 81 of file partition.h. Referenced by newClass(), Partition(), and swap(). |
1.3.9.1