summaryrefslogtreecommitdiff
path: root/test/test_ot.py
diff options
context:
space:
mode:
authorRémi Flamary <remi.flamary@gmail.com>2019-12-02 13:34:05 +0100
committerRémi Flamary <remi.flamary@gmail.com>2019-12-02 13:34:05 +0100
commit84384dd9e5dc78ed5cc867a53bd1de31c05d77fc (patch)
treed0b1b15dcef854f89e62fe40ab93c9aac7b338e6 /test/test_ot.py
parent127adbaf4eef7a6dffbdcd4f930fc6301587f861 (diff)
add test emd2
Diffstat (limited to 'test/test_ot.py')
-rw-r--r--test/test_ot.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/test_ot.py b/test/test_ot.py
index 8602022..507d188 100644
--- a/test/test_ot.py
+++ b/test/test_ot.py
@@ -132,9 +132,12 @@ def test_emd_sparse():
Gs = ot.emd([], [], M, dense=False)
+ ws = ot.emd2([], [], M, dense=False)
+
# check G is the same
np.testing.assert_allclose(G, Gs.todense())
- # check constraints
+ # check value
+ np.testing.assert_allclose(Gs.multiply(M).sum(), ws, rtol=1e-6)
def test_emd2_multi():