Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

cpp_wrapper_irving

Computes a stable roommate matching


Description

This is the C++ wrapper for the stable roommate problem. Users should not call this function directly, but instead use roommate.

Usage

cpp_wrapper_irving(pref)

Arguments

pref

is a matrix with the preference order of each individual in the market. If there are n individuals, then this matrix will be of dimension n-1 by n. The i,jth element refers to j's ith most favorite partner. Preference orders must be specified using C++ indexing (starting at 0). The matrix pref must be of dimension n-1 by n.

Value

A vector of length n corresponding to the matchings that were formed (using C++ indexing). E.g. if the 4th element of this vector is 0 then individual 4 was matched with individual 1. If no stable matching exists, then this function returns a vector of zeros. @export


matchingR

Matching Algorithms in R and C++

v1.3.2
GPL (>= 2)
Authors
Jan Tilly, Nick Janetos
Initial release
2020-12-14

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.