hrldcpr / pyLAPJV

Jonker-Volgenant / LAPJV algorithm for the linear assignment problem, in Python
51 stars 10 forks source link

Returning very large arrays #1

Open kylemcdonald opened 8 years ago

kylemcdonald commented 8 years ago

I'm seeing very large arrays being returned, with all the data after the initial "correct" data looking like old memory:

import numpy as np
import LAPJV
n = 8
cost = np.random.uniform(low=0, high=100000, size=(n, n))
%time min_cost,row_assigns,col_assigns,row_dual_vars,col_dual_vars = LAPJV.lap(cost)
print row_assigns.shape
print row_assigns[:(2*n)]

Output:

CPU times: user 12 µs, sys: 7 µs, total: 19 µs
Wall time: 16 µs
(988661682962169864,)
[          3           4           6           0           2           5
           1           7 -1556947360 -1487184053   227174464           1
   227235536           1  2045669697  1795533007]
kylemcdonald commented 7 years ago

For what it's worth, there's another wrapper for lapjv that doesn't have this problem https://github.com/gatagat/lapjv