summaryrefslogtreecommitdiff
path: root/ot/lp/EMD.h
diff options
context:
space:
mode:
authorGard Spreemann <gspr@nonempty.org>2020-01-20 14:07:53 +0100
committerGard Spreemann <gspr@nonempty.org>2020-01-20 14:07:53 +0100
commitbdfb24ff37ea777d6e266b145047cd4e281ebac3 (patch)
tree00cbac5f3dc25a4ee76164828abd72c1cbab37cc /ot/lp/EMD.h
parentabc441b00f0fe2fa4ef0efc4e1aa67b27cca9a13 (diff)
parent5e70a77fbb2feec513f21c9ef65dcc535329ace6 (diff)
Merge tag '0.6.0' into debian/sid
Diffstat (limited to 'ot/lp/EMD.h')
-rw-r--r--ot/lp/EMD.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/ot/lp/EMD.h b/ot/lp/EMD.h
new file mode 100644
index 0000000..f42e222
--- /dev/null
+++ b/ot/lp/EMD.h
@@ -0,0 +1,35 @@
+/* This file is a c++ wrapper function for computing the transportation cost
+ * between two vectors given a cost matrix.
+ *
+ * It was written by Antoine Rolet (2014) and mainly consists of a wrapper
+ * of the code written by Nicolas Bonneel available on this page
+ * http://people.seas.harvard.edu/~nbonneel/FastTransport/
+ *
+ * It was then modified to make it more amenable to python inline calling
+ *
+ * Please give relevant credit to the original author (Nicolas Bonneel) if
+ * you use this code for a publication.
+ *
+ */
+
+
+#ifndef EMD_H
+#define EMD_H
+
+#include <iostream>
+#include <vector>
+#include "network_simplex_simple.h"
+
+using namespace lemon;
+typedef unsigned int node_id_type;
+
+enum ProblemType {
+ INFEASIBLE,
+ OPTIMAL,
+ UNBOUNDED,
+ MAX_ITER_REACHED
+};
+
+int EMD_wrap(int n1,int n2, double *X, double *Y,double *D, double *G, double* alpha, double* beta, double *cost, int maxIter);
+
+#endif