summaryrefslogtreecommitdiff
path: root/ot/lp/EMD_wrapper.cpp
diff options
context:
space:
mode:
authorarolet <antoine.rolet@gmail.com>2017-07-21 12:12:48 +0900
committerarolet <antoine.rolet@gmail.com>2017-07-21 12:12:48 +0900
commit88c62c39a9623e8b58ebb776a9deddc96b43b4a0 (patch)
tree74506ee862dd8469488a0421c944d53884319465 /ot/lp/EMD_wrapper.cpp
parentdc3bbd4134f0e2b80e0fe72368bdcf9966f434dc (diff)
Added dual variables computations
Diffstat (limited to 'ot/lp/EMD_wrapper.cpp')
-rw-r--r--ot/lp/EMD_wrapper.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/ot/lp/EMD_wrapper.cpp b/ot/lp/EMD_wrapper.cpp
index cc13230..6bda6a7 100644
--- a/ot/lp/EMD_wrapper.cpp
+++ b/ot/lp/EMD_wrapper.cpp
@@ -15,8 +15,8 @@
#include "EMD.h"
-void EMD_wrap(int n1, int n2, double *X, double *Y,
- double *D, double *G, double *cost, int max_iter) {
+void EMD_wrap(int n1, int n2, double *X, double *Y, double *D, double *G,
+ double* alpha, double* beta, double *cost, int max_iter) {
// beware M and C anre strored in row major C style!!!
int n, m, i,cur;
@@ -99,6 +99,8 @@ void EMD_wrap(int n1, int n2, double *X, double *Y,
int i = di.source(a);
int j = di.target(a);
*(G+indI[i]*n2+indJ[j-n]) = net.flow(a);
+ *(alpha + indI[i]) = net.potential(i);
+ *(beta + indJ[j-n]) = net.potential(j);
}
};