Modify Johannes LAPJV implementation to be used with sparse structure.

And possible with rectangular cost matrices
Not tested in depth.
Signed-off-by: Jean-Yves Tinevez <jean-yves.tinevez@pasteur.fr>