課題2

高橋 雅士         コードはこちら(https://github.com/masashitshit/MyMatching.jl/blob/master/src/MyMatching.jl)


In [1]:
using MyMatching

wikipediaの例です


In [2]:
m_prefs = [[1, 2, 3, 4], [3, 2, 1, 4], [1, 2, 4, 3], [3, 1,  4, 2]]
f_prefs = [[1, 2, 3, 4], [2, 1, 4, 3], [2, 3, 1, 4], [1, 4, 3, 2]]


Out[2]:
4-element Array{Array{Int64,1},1}:
 [1,2,3,4]
 [2,1,4,3]
 [2,3,1,4]
 [1,4,3,2]

In [3]:
matching(m_prefs,f_prefs)


Out[3]:
([1,3,2,4],[1,3,2,4])

テストしてみます


In [4]:
Pkg.test("MyMatching")


INFO: Testing MyMatching
INFO: MyMatching tests passed

(やっと)passしました!