blob: 9e2b18e33c574742d72b95b583b199acca04eeed [file] [log] [blame]
Austin Schuh405fa6c2015-09-06 18:13:55 -070012012-04-30 (April 30, 2015)
2-----------------------------------------------
3C-Library cddlib (version 0.94h) README FILE
4-----------------------------------------------
51. The C-library cddlib is a C implementation of the Double Description
6Method of Motzkin et al. for generating all vertices (i.e. extreme points)
7and extreme rays of a general convex polyhedron in R^d given by a system
8of linear inequalities:
9
10 P = { x=(x1, ..., xd)^T : b - A x >= 0 }
11
12where A is a given m x d real matrix, b is a given m-vector
13and 0 is the m-vector of all zeros.
14
15The program can be used for the reverse operation (i.e. convex hull
16computation). This means that one can move back and forth between
17an inequality representation and a generator (i.e. vertex and ray)
18representation of a polyhedron with cdd. Also, cdd can solve a linear
19programming problem, i.e. a problem of maximizing and minimizing
20a linear function over P.
21
22The version 0.94 is the seventh release of libcdd. New functions
23added in this release include dd_MatrixCanonicalize,
24dd_FindRelativeInterior and dd_ExistsRestrictedFace. These
25functions are LP-based and should be reasonably efficient.
26The sample programs such as redcheck.c, testlp1.c and allfaces.c
27show how these functions can be used to remove redundancies,
28to compute the dimension and all faces of an H-polyhedron.
29
30In addition to the new functionalities, many small bugs have
31been fixed. For example, the mishandling of empty H-polyhedra
32has been fixed for the representation conversion.
33
34If you find some problems or bugs, please kindly report them to
35fukuda@ifor.math.ethz.ch. Please read README.whatsnew for the changes
36over the last release.
37
38The documentation (cddlibman.tex) is still incomplete but contains
39descriptions of the most important functions. Please look at the examples,
40testcdd*.c, testlp*.c, simplecdd.c, lcdd.c, redcheck,c for how
41the library functions can be used in user's C-codes.
42
432. One convenient feature of cddlib is the ability
44to handle essentially any data. More precisely, it can
45generate an H-representation of a V-polyhedron which is not
46full-dimensional, and it can generate a V-representation
47of an H-polyhedron which has no extreme points.
48
493. A little caution is in order. Many people have seen
50numerical problems when the floating version of cddlib
51is used. As we all know, floating-point computation
52might not give a correct answer, especially when an input
53data is very sensitive to a small perturbation. When
54some strange behavior is observed, it is always wise
55to create a rational approximation of the input
56(for example, one can replace 0.3333333 with 1/3)
57and to compute it with cddlib compiled with gmp rational
58to see what a correct behavior should be. Whenever the time
59is not important, it is safer to use gmp rational arithmetic.
60
61If you need speedy computation with floating-point arithmetic,
62you might want to "play with" the constant "dd_almostzero" defined
63in cdd.h:
64
65 #define dd_almostzero 1.0E-6
66
67This number is used to recognize whether a number is zero:
68a number whose absolute value is smaller
69than dd_almostzero is considered zero, and nonzero otherwise.
70You might want to change this to modify the behavior of cddlib.
71Another thing one can do is scaling. If the values in one column of
72an input is of smaller magnitude than those in another column,
73scale one so that they become comparable.
74
754. The cddlib package is in "tar"ed and "gzip"ed format with name
76cddlib-***.tar.gz, where *** is the version number. The standard
77download site for the package is
78
79 web site : http://www.ifor.math.ethz.ch/~fukuda/cdd_home/index.html
80 file name: cddlib-***.tar.gz
81
82In order to unpack the package in a standard unix environment, type
83
84 % tar xvfz cddlib-***.tar.gz
85
86where *** must be replaced by the appropriate version number, and
87% is a unix prompt.
88
89For compilation of libcdd, go to the cddlib top directorycddlib
90and follow the general instruction of autoconf. In generic
91unix/linux environment, use "./configure" and "make".
92To enforce a certain compiler to be used, specify it as
93
94 CXX=g++ ./configure
95
96The default compiler is gcc.
97Note that one must install GMP-4.* (or higher) first.
98
99For compilation of MathLink programs,
100you need a binary "mprep", MathLink library "libML.a" and include file
101"mathlink.h" which come with Mathematica. I have tested for Mathematica 4.1
102and 3.* on MacOSX and Linux. This part is not "autoconf"igured
103and thus one needs to edit Makefile in the src-mathlink and src-mathlink2 subdirectories.
104
105To install the library in public directory of unix environment,
106just type "make install". The default installation directory
107is /usr/local. If you want to select other places, use
108"./configure --prefix=<DIRNAME>" to configure with your favorite
109<DIRNAME>.
110
111One might have to make the files publicly readable by chmod.
112Once the files are properly installed, any user can use compile
113one's own code (e.g. testcdd1.c) and link it with libcdd by
114
115 % gcc -I/usr/local/include -L/usr/local/lib testcdd1.c -lcdd
116
117or (with GMP rational arithmetic)
118
119 % gcc -I/usr/local/include -L/usr/local/lib -DGMPRATIONAL testcdd1.c -lcddgmp -lgmp
120
121
1225. cddlib comes with a MathLink version of cddlib that can be
123called from Mathematica (tested for Mathematica 2.2, 3.0, 4.1, 5.1).
124A few Mathematica notebooks are included to explain how one can
125use this program "cddmathlink" from Mathematica
126to manipulate polytopes. Please check the files,
127cddml-notbook.ma, cddml-PolytopeSkeleton.ma, cddml-DietProblem.ma,
128and cddml-Zonotope.ma, in the mma subdirectory. I could
129compile cddmathlink.c for Macintosh and Windows. Please use
130gcc instead of g++ to compile cddlib. I have put
131binaries for different platforms in
132http://www.cs.mcgill.ca/~fukuda/download/cdd/cddlibml_binary/ .
133
134
1356. The library cddlib is free software, but if cddlib turns out to be useful,
136please kindly send me (at the address below) a note or a paper mentioning
137what purpose and how cdd has been used for. The most powerful support
138for free software development is user's appreciation.
139
140For more information, contact
141
142Komei Fukuda <fukuda@math.ethz.ch>
143Institute of Theoretical Computer Science
144ETH Zentrum, CH-8092 Zurich, Switzerland
145Tel +41-1-632-4023, Fax +41-1-632-1063
146http://www.ifor.math.ethz.ch/staff/fukuda/
147
148// END of README
149