| cpp_wrapper_galeshapley {matchingR} | R Documentation |
C++ wrapper for Gale-Shapley Algorithm
Description
This function provides an R wrapper for the C++ backend. Users should not
call this function directly and instead use
galeShapley.marriageMarket or
galeShapley.collegeAdmissions.
Usage
cpp_wrapper_galeshapley(proposerPref, reviewerUtils)
Arguments
proposerPref |
is a matrix with the preference order of the proposing
side of the market. If there are |
reviewerUtils |
is a matrix with cardinal utilities of the courted side
of the market. If there are |
Value
A list with elements that specify who is matched to whom. Suppose
there are n proposers and m reviewers. The list contains
the following items:
proposalsis a vector of lengthnwhoseith element contains the number of the reviewer that proposeriis matched to using C++ indexing. Proposers that remain unmatched will be listed as being matched tom.engagementsis a vector of lengthmwhosejth element contains the number of the proposer that reviewerjis matched to using C++ indexing. Reviwers that remain unmatched will be listed as being matched ton.