In [1]:
using Matching
In [2]:
function mat2vecs{T<:Integer}(prefs::Matrix{T})
return [prefs[1:findfirst(prefs[:, j], 0)-1, j] for j in 1:size(prefs, 2)]
end
Out[2]:
In [3]:
using MyMatching
In [4]:
m_prefs1, f_prefs1 = mat2vecs.(random_prefs(8, 8))
Out[4]:
In [5]:
my_deferred_acceptance(m_prefs1, f_prefs1)
Out[5]:
In [6]:
m_prefs2, f_prefs2 = random_prefs(8, 8)
Out[6]:
In [7]:
my_deferred_acceptance(m_prefs2, f_prefs2)
Out[7]:
In [8]:
Pkg.test("MyMatching")