Every convex polyhedron P has two representations, one as the intersection of finite halfspaces and the other as Minkowski sum of the convex hull of finite points and the nonnegative hull of finite directions. These are called H-representation and V-representation, respectively.
CddInterface is a gap interface with the C package Cddlib which among other things can translate between H,V- representations of a polyhedron P and solve linear programming problems over P, i.e. a problem of maximizing and minimizing a linear function over P. A list of all available operations can be found in the manual.pdf.
Make sure you can update "configure" scripts by installing autoconf
:
sudo apt-get update
sudo apt-get install autoconf
You also need the package libgmp-dev
:
sudo apt-get install libgmp-dev
Moreover, you may need the package libtool
:
sudo apt-get install libtool
sudo apt-get install libcdd-dev
./autogen.sh
./configure --with-gaproot=path/to/gaproot
make
where the path/to/gaproot
is the path to the folder where you installed and compiled Gap
and
which contains the file sysinfo.gap
. The default value is ../..
.
For a simplified installation, try the following command in the main CddInterface directory
./install.sh path/to/gaproot
If that does not work, try the following:
Go inside the CddInterface directory and download some release of cddlib and extract it. For example the release 0.94m:
wget https://github.com/cddlib/cddlib/releases/download/0.94m/cddlib-0.94m.tar.gz
tar xvf cddlib-0.94m.tar.gz
ln -sf $(pwd)/cddlib-0.94m $(pwd)/current_cddlib
After that, compile cddlib via
cd current_cddlib
mkdir build
./bootstrap
./configure --prefix=$(pwd)/build
make
make install
Cdd should now be installed in the build
directory. After that, go back to the CddInterface main folder
and install CddInterface with the following commands
./autogen.sh
./configure --with-gaproot=path/to/gaproot --with-cddlib=$(pwd)/current_cddlib/build
make
After that, you should be able to load CddInterface.
To create the documentation:
gap makedoc.g
To run the test files
gap tst/testall.g
The package can be updated using the following commands
git pull
make
With docker app you can run an image of the newest version of gap && CddInterface via the command
docker run -it kamalsaleh/gap_packages
If you want to experiment online with the package you can use notebook.ipynb
vie the binder link below.
Of course you are welcome to e-mail me if there are any questions, remarks, suggestions ;)
Kamal Saleh e-mail: saleh@mathematik.uni-siegen.de
CddInterface is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.