Skip to content

C++ and Python tools for balanced and unbalanced semi-discrete optimal transport (SDOT) in 2d.

License

Notifications You must be signed in to change notification settings

MeasureTransport/sdot2d

Repository files navigation

Semi-Discrete Optimal Transport in 2d

SDOTCentroidal Laguerre

Build Status

Installation:

  1. Install Dependencies:
conda install -c conda-forge cgal cmake
  1. Clone sdot2d and dependent repositories
git clone --recurse-submodules git@github.com:mparno/sdot2d.git
  1. Run CMake to configure sdot2d
cd sdot2d
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=<Some/Install/Dir> ..

where you should replace <Some/Install/Dir> with the location where you want to install the SDOT2d library, for example ~/Installations/SDOT_INSTALL.

You can also tell CMake where to look for GTest using the following command instead:

cmake -DCMAKE_INSTALL_PREFIX=<Some/Install/Dir> -DSDOT_GTEST_DIR=<gtest/install/dir> ..

The gtest/install/dir should be the folder that contains the include and lib folders where GTest has been installed.

  1. Build SDOT (including optional tests)
make -j4 install
  1. (Optional) Run the tests
make test

or, to run just the unit tests

./RunUnitTests
  1. Add the SDOT paths to your environment variables:

OSX:

export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:<Some/Install/Dir>/lib
export PYTHONPATH=$PYTHONPATH:<Some/Install/Dir>/lib:<Some/Install/Dir>/lib/python/

Linux:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:<Some/Install/Dir>/lib
export PYTHONPATH=$PYTHONPATH:<Some/Install/Dir>/lib:<Some/Install/Dir>/lib/python/

Examples:

Try running the random points in a rectangle example

cd sdot2d/examples/python
python RandomRectangle.py

About

C++ and Python tools for balanced and unbalanced semi-discrete optimal transport (SDOT) in 2d.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published