- # v is reference, v_p is v after permutation
- # distances[i,j] = distance between i-th component of v and j-th component of v_p
- # "in rows : reference; in columns: after permutation"
- # "permutation" contains order on v to match v_p as closely as possible
- distances = sapply(v_p, function(elt) ( abs(elt - v) ) )
- assignment = .hungarianAlgorithm(distances)
- expect_equal(assignment, permutation)
- }
- }
+ # v is reference, v_p is v after permutation
+ # distances[i,j] = distance between i-th component of v and j-th component of v_p
+ # "in rows : reference; in columns: after permutation"
+ # "permutation" contains order on v to match v_p as closely as possible
+ distances = sapply(v_p, function(elt) ( abs(elt - v) ) )
+ assignment = .hungarianAlgorithm(distances)
+ expect_equal(assignment, permutation)
+ }
+ }