R and C++ functions to perform exact and approximate optimal transport. All C++ methods can be linked to other R packages via their header files.
This R package performs the computation of approximate and exact optimal transport distances through a variety of algorithms. We also provide header files in C++ to allow other packages to use these methods.
To install this package, download or clone this repository and install with devtools::install("approxOT") or install directly
from Github using devtools::install_github. Alternatively, a version is available from CRAN.
The package currently supports the following algorithms to calculate optimal transport distances
Algorithms 1--3 are exact algorithms. Algorithms 4+ are approximate
As of version 1.3 of the package, OpenMP threading is supported for the Sinkhorn algorithm. If OpenMP is supported, the number of threads defaults to half the number of processors. To set the number of threads your self, do:
# set number of threads to n
approxOT_threads(n)
options()# set number of threads to n
options(approxOT.threads = n)
To see the current number of threads, do:
approxOT_threads()
Note the empty argument to approxOT_threads
Eric Dunipace
GPL 3