|
| GSimpleAssignment (std::size_t aSize, std::size_t bSize) |
| Create an assignment between two sets of the given sizes that assigns everything to -1. More...
|
|
| GSimpleAssignment (std::size_t bSize, const std::vector< int > &bfA) |
| Create an assignment between two sets of the given sizes that assigns everything according to the array bForA. More...
|
|
virtual | ~GSimpleAssignment () |
| A do-nothing destructor needed since there may be subclasses. More...
|
|
virtual void | assign (unsigned memberOfA, unsigned memberOfB) |
| Create an assignment between the two members, setting any previously corresponding members to unassigned. More...
|
|
virtual int | inverse (unsigned memberOfB) const |
| Return the number of the member of set A corresponding to the memberOfB element in set B or -1 if there is no corresponding member. More...
|
|
virtual int | operator() (unsigned memberOfA) const |
| Return the number of the member of set B corresponding to the memberOfA element in set A or -1 if there is no corresponding member. More...
|
|
virtual bool | operator< (const GSimpleAssignment &other) const |
| Return true iff *this, expressed as the input to setBForA with sizeB prepended is lexiographically less than other. More...
|
|
virtual bool | operator== (const GSimpleAssignment &other) const |
| Return true if *this and other represent the same assignments among the same sized sets. More...
|
|
virtual void | setBForA (const std::vector< int > &bfA) |
| Set the assignment to the one expressed in the vector bForA. More...
|
|
virtual std::size_t | sizeA () const |
| Return the number of elements in the A set of this GAssignment. More...
|
|
virtual std::size_t | sizeB () const |
| Return the number of elements in the B set of this GAssignment. More...
|
|
virtual void | swapAAndB () |
| Swaps the A and B set. The assignments stay the same. More...
|
|
virtual void | unassignA (unsigned memberOfA) |
| Remove any assignment for the given member of A. More...
|
|
virtual void | unassignB (unsigned memberOfB) |
| Remove any assignment for the given member of B. More...
|
|
virtual | ~GAssignment () |
| A do-nothing destructor needed since there will be subclasses. More...
|
|
virtual bool GClasses::GSimpleAssignment::operator== |
( |
const GSimpleAssignment & |
other | ) |
const |
|
inlinevirtual |
Return true if *this and other represent the same assignments among the same sized sets.
If A is the same size as set A for other and B is the same size as B for other and the members with identical indices are assigned to one another and the unassigned members also have identical indices, then the two assignment objects are equal.
In other words, returns true if and only if sizeA(), sizeB(), operator()(unsigned) and inverse()(unsigned) give identical results on both *this and other for all valid input values.
- Parameters
-
- Returns
- true if the assignments are the same, false otherwise. See main description for details.
virtual void GClasses::GSimpleAssignment::setBForA |
( |
const std::vector< int > & |
bfA | ) |
|
|
inlinevirtual |
Set the assignment to the one expressed in the vector bForA.
Given a vector bForA for which bForA[i] is the index of the member of set B that corresponds to the i-th member of set A or is -1 if there is no corresponding element, make the assignments in this object identical.
It is assumed that this operation will not change the sizes of the sets referred to by this assignment. That is, -1 <= bForA[i] and bForA[i] < sizeB() and bForA.size() == sizeA()
- Parameters
-
bForA | bForA[i] gives the assignment for element i in set A. It is the index of the corresponding element of set B or -1 if there is no corresponding element. |