GClasses
|
An abstract base class defining an assignment between two sets.
An assignment is a mapping M between two sets A and B. If a and b are elements of A and B respectively, then the following properties hold:
More specifically, an assignment is a graph-theoretic matching on a bipartite graph.
Practically, this is implemented by denoting the members of the two sets with non-negative integers. Undefined mappings are just given as mapping to -1. sizeA() and sizeB() give the number of elements in each set. The members of A are then denoted as 0..sizeA()-1 and the members of B as the integers 0..sizeB()-1
operator()(int) gives the mapping from A->B (as in
)
inverse(int) gives the mapping from B->A (as in
)
#include <GAssignment.h>
Public Member Functions | |
virtual | ~GAssignment () |
A do-nothing destructor needed since there will be subclasses. More... | |
virtual int | inverse (unsigned memberOfB) const =0 |
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 =0 |
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 std::size_t | sizeA () const =0 |
Return the number of elements in the A set of this GAssignment. More... | |
virtual std::size_t | sizeB () const =0 |
Return the number of elements in the B set of this GAssignment. More... | |
|
inlinevirtual |
A do-nothing destructor needed since there will be subclasses.
|
pure virtual |
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.
memberOfB | the number of the member of set B whose assignment is desired |
Implemented in GClasses::GSimpleAssignment.
|
pure virtual |
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.
memberOfA | the number of the member of set A whose assignment is desired |
Implemented in GClasses::GSimpleAssignment.
|
pure virtual |
Return the number of elements in the A set of this GAssignment.
See the class comment for more information.
Implemented in GClasses::GSimpleAssignment.
|
pure virtual |
Return the number of elements in the B set of this GAssignment.
See the class comment for more information.
Implemented in GClasses::GSimpleAssignment.