GaleShapleyPairing class.
Macros:
Enumerations:
None.
Typedefs:
None.
Struct CapyGaleShapleyPairing :
Struct CapyGaleShapleyPairing's properties:
None.
Struct CapyGaleShapleyPairing's methods:
Destructor
Find the best pairing for elements in two sets A and B of same size according to the Gale-Shapley algorithm.
Input argument(s):
weightA: matrix representing the pairing preferences of elements in set A.The value of the i-th row and j-th column is equal to the preference of the i-th element in set A to be paired with the j-th element in set B. The higher the stronger the preference.
weightB: matrix representing the pairing preferences of elements in set B.The value of the i-th row and j-th column is equal to the preference of the i-th element in set B to be paired with the j-th element in set A. The higher the stronger the preference.
Output and side effect(s):
Return an array of indices describing the pairing. The i-th element j of the array indicates the i-th element in the set A is paired with the the j-th element in the set B. Note that the pairing is biased toward preferences of set A.
Functions:
Create a CapyGaleShapleyPairing
Output and side effect(s):
Return a CapyGaleShapleyPairing
Allocate memory for a new CapyGaleShapleyPairing and create it
Output and side effect(s):
Return a CapyGaleShapleyPairing
Exception(s):
May raise CapyExc_MallocFailed.
Free the memory used by a CapyGaleShapleyPairing* and reset '*that' to NULL
Input argument(s):
that: a pointer to the CapyGaleShapleyPairing to free