| 1 | /* This file is a c++ wrapper function for computing the transportation cost |
| 2 | * between two vectors given a cost matrix. |
| 3 | * |
| 4 | * It was written by Antoine Rolet (2014) and mainly consists of a wrapper |
| 5 | * of the code written by Nicolas Bonneel available on this page |
| 6 | * http://people.seas.harvard.edu/~nbonneel/FastTransport/ |
| 7 | * |
| 8 | * It was then modified to make it more amenable to python inline calling |
| 9 | * |
| 10 | * Please give relevant credit to the original author (Nicolas Bonneel) if |
| 11 | * you use this code for a publication. |
| 12 | * |
| 13 | */ |
| 14 | |
| 15 | |
| 16 | #ifndef EMD_H |
| 17 | #define EMD_H |
| 18 | |
| 19 | #include <iostream> |
| 20 | #include <vector> |
| 21 | #include <cstdint> |
| 22 | |
| 23 | typedef unsigned int node_id_type; |
| 24 | |
| 25 | enum ProblemType { |
| 26 | INFEASIBLE, |
| 27 | OPTIMAL, |
| 28 | UNBOUNDED, |
| 29 | MAX_ITER_REACHED |
| 30 | }; |
| 31 | |
| 32 | int EMD_wrap(int n1,int n2, double *X, double *Y,double *D, double *G, double* alpha, double* beta, double *cost, uint64_t maxIter); |
| 33 | int EMD_wrap_omp(int n1,int n2, double *X, double *Y,double *D, double *G, double* alpha, double* beta, double *cost, uint64_t maxIter, int numThreads); |
| 34 | |
| 35 | |
| 36 | |
| 37 | #endif |