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