blob: c55b8d6310b455a8a00fa1556f050c5a6b282618 [file] [log] [blame]
Austin Schuh405fa6c2015-09-06 18:13:55 -07001% The name of this file: cddlibman.tex
2% written by by Komei Fukuda
3% created March 15, 1999
4% modified February 7, 2008
5%
6\documentclass[11pt]{article}
7\usepackage{html,amsmath,amssymb}
8\renewcommand{\baselinestretch}{1}
9\renewcommand{\arraystretch}{1}
10\setlength{\oddsidemargin}{0mm}
11\setlength{\textwidth}{165mm}
12\setlength{\topmargin}{-15mm}
13\setlength{\textheight}{232mm}
14%\setlength{\headsep}{0in}
15%\setlength{\headheight}{0pt}
16\pagestyle{plain}
17
18\newcommand {\0} {{\bf 0}}
19\newcommand{\R}{{\Bbb R}}
20
21\begin{document}
22\title{cddlib Reference Manual}
23\author{Komei Fukuda\\
24Institute for Operations Research\\
25and Institute of Theoretical Computer Science\\
26ETH Zentrum, CH-8092 Zurich, Switzerland\\
27}
28\date{ (cddlib ver. 0.94, manual ver. February 7, 2008)}
29
30\maketitle
31
32\tableofcontents
33
34\begin{abstract}
35This is a reference manual for cddlib-094.
36The manual describes the library functions and data types implemented
37in the cddlib C-library which is to perform fundamental polyhedral
38computations such as representation conversions and linear programming
39in both floating-point and GMP rational exact arithmetic.
40Please read the accompanying README file and test programs to
41complement the manual.
42
43The new functions added in this version include {\tt dd\_MatrixCanonicalize}
44to find a non-redundant proper H- or V-representation,
45{\tt dd\_FindRelativeInterior} to find a relative interior point
46of an H-polyhedron, and {\tt dd\_ExistsRestrictedFace} (Farkas-type
47alternative theorem verifier)
48to check the existence of a point satisfying a specified system
49of linear inequalities possibly including multiple strict inequalities.
50
51The new functions are particularly important for the development of
52related software packages MinkSum (by Ch. Weibel) and Gfan
53(by Anders Jensen),
54
55\end{abstract}
56
57\section{Introduction} \label{INTRODUCTION}
58
59The program cddlib is an efficient implementation \cite{fp-ddmr-96} of
60the double description Method~\cite{mrtt-ddm-53}
61for generating all vertices (i.e. extreme points)
62and extreme rays of a general
63convex polyhedron given by
64a system of linear inequalities:
65\[
66 P = \{ x=(x_1, x_2, \ldots, x_d)^T \in R^{d}: b - A x \ge 0 \}
67\]
68where $A$ is a given $m \times d$ real matrix and
69$b$ is a given real $m$-vector. In the mathematical
70language, the computation is the transformation
71of an {\em H-representation\/} of a convex polytope
72to an {\em V-representation}.
73
74cddlib is a C-library version of the previously released C-code cdd/cdd+.
75In order to make this library version, a large part of the cdd source
76(Version 0.61) has been rewritten.
77This library version is more flexible since it can be called from other programs in C/C++.
78Unlike cdd/cdd+, cddlib can handle any general input and is more general.
79Furtthermore, additional functions have been written to extend its functionality.
80
81One useful feature of cddlib/cdd/cdd+ is its capability
82of handling the dual (reverse) problem without any transformation
83of data. The dual transformation problem of a V-representation
84to a minimal H-representation and is often called the
85{\em (convex) hull problem\/}. More explicitly,
86is to obtain a linear inequality representation
87of a convex polyhedron given as the Minkowski sum of
88the convex hull of a finite set of points and the nonnegative
89hull of a finite set of points in $R^{d}$:
90\[
91P = conv(v_1,\ldots,v_n) + nonneg(r_{n+1},\ldots,r_{n+s}),
92\]
93where
94 the {\em Minkowski sum of two subsets $S$ and $T$} of $R^{d}$ is defined
95as
96\[
97S + T = \{ s + t \; | s \in S \mbox{ and } t \in T \}.
98\]
99As we see in this manual, the computation can be done
100in straightforward manner. Unlike the earlier versions of
101cdd/cdd+ that assume certain regularity conditions for input,
102cddlib is designed to do a correct transformation for any general input.
103The user must be aware of the fact that in certain cases the
104transformation is not unique and there are polyhedra with
105infinitely many representations. For example, a line
106segment (1-dimensional polytope) in $R^3$ has infinitely
107many minimal H-representations, and a halfspace in the same space
108has infinitely many minimal V-representations. cddlib generates
109merely one minimal representation.
110
111cddlib comes with an LP code to solve the general
112linear programming (LP) problem to maximize (or minimize) a linear
113function over polyhedron $P$. It is useful mainly for solving
114dense LP's with large $m$ (say, up to few hundred thousands) and small $d$
115(say, up to 100). It implements a revised dual simplex method that
116updates $(d+1)\times (d+1)$ matrix for a pivot operation.
117
118The program cddlib has an I/O routines that read and write files in
119{\em Polyhedra format\/} which was defined by David Avis and
120the author in 1993, and has been updated in 1997 and 1999.
121The program called lrs and lrslib \cite{a-lrshome-01} developed by David Avis is
122a C-implementation of the reverse search algorithm~\cite{af-pachv-92}
123for the same enumeration purpose, and it conforms to Polyhedra format as well.
124Hopefully, this compatibility of the two programs
125enables users to use both programs for the same input files
126and to choose whichever is useful for their purposes.
127From our experiences with relatively large problems,
128the two methods are both useful and perhaps complementary
129to each other. In general, the program cddlib tends to be
130efficient for highly degenerate inputs and the program rs
131tends to be efficient for nondegenerate or slightly
132degenerate problems.
133
134Although the program can be used for nondegenerate inputs,
135it might not be very efficient. For nondegenerate inputs,
136other available programs, such as the reverse search code lrs or
137qhull (developed by the Geometry Center),
138might be more efficient. See Section~\ref{CODES}
139for pointers to these codes.
140The paper \cite{abs-hgach-97} contains many interesting results on polyhedral
141computation and experimental results on cdd+, lrs, qhull and porta.
142
143This program can be distributed freely under the GNU GENERAL PUBLIC LICENSE.
144Please read the file COPYING carefully before using.
145
146I will not take any responsibility of any problems you might have
147with this program. But I will be glad to receive bug reports or suggestions
148at the e-mail addresses above. If cddlib turns out to be useful,
149please kindly inform me of what purposes cdd has been used for.
150I will be happy to include a list of applications in future
151distribution if I receive enough replies.
152The most powerful support for free software development
153is user's appreciation and collaboration.
154
155\section{Polyhedra H- and V-Formats (Version 1999)} \label{FORMAT}
156\bigskip
157Every convex polyhedron has two representations, one as
158the intersection of finite halfspaces and the other
159as Minkowski sum of the convex hull of finite points
160and the nonnegative hull of finite directions. These are
161called H-representation and V-representation, respectively.
162
163Naturally there are two basic Polyhedra formats,
164H-format for H-representation and V-format for
165V-representation. These two formats are designed
166to be almost indistinguishable, and in fact, one can
167almost pretend one for the other. There is some asymmetry
168arising from the asymmetry of two representations.
169
170First we start with the H-representation.
171Let $A$ be an $m \times d$ matrix, and let $b$ be a column $m$-vector.
172The Polyhedra format ({\em H-format} ) of
173the system $\; b - A x \ge \0\;$ of $m$ inequalities in $d$ variables
174$x =(x_1, x_2, \ldots, x_d)^T$ is
175
176\begin{tabular}{ccl}
177\\ \hline
178\multicolumn{3}{l} {various comments}\\
179\multicolumn{3}{l} {{\bf H-representation}}\\
180\multicolumn{3}{l} {{\bf (linearity $t\;$ $i_1\;$ $i_2\;$ $\ldots$ $\;i_t$)}}\\
181\multicolumn{3}{l} {{\bf begin}}\\
182 $m$ & $d+1$ & numbertype\\
183 $b$ & $-A$ \\
184\multicolumn{3}{l} {{\bf end}}\\
185\multicolumn{3}{l} {various options} \\ \hline
186\end{tabular}
187
188\bigskip
189\noindent
190where numbertype can be one of integer, rational or real.
191When rational type is selected, each component
192of $b$ and $A$ can be specified by the usual integer expression
193or by the rational expression ``$p / q$'' or ``$-p / q$'' where
194$p$ and $q$ are arbitrary long positive integers (see the example
195input file rational.ine). In the 1997 format,
196we introduced ``H-representation'' which must appear
197before ``begin''.
198There was one restriction in the old polyhedra format
199(before 1997): the last $d$ rows must determine
200a vertex of $P$. This is obsolete now.
201
202In the new 1999 format, we added the possibility of specifying {\bf linearity\/}.
203This means that
204for H-representation, some of the input rows can be specified as {\bf equalities}:
205$b_{i_j} - A_{i_j} x = 0 \;$ for all $j=1,2, \ldots, t$.
206The linearity line may be omitted if there are no equalities.
207
208Option lines can be used to control computation of a specific program.
209In particular both cdd and lrs use the option lines to represent
210a linear objective function. See the attached LP files, samplelp*.ine.
211
212\bigskip
213Next we define Polyhedra {\em V-format}. Let $P$ be
214represented by $n$ gerating points and $s$ generating directions (rays) as
215$P = conv(v_1,\ldots,v_n) + nonneg(r_{n+1},\ldots,r_{n+s})$.
216Then the Polyhedra V-format for $P$ is
217
218\begin{tabular}{cll}
219\\ \hline
220\multicolumn{3}{l} {various comments}\\
221\multicolumn{3}{l} {{\bf V-representation}}\\
222\multicolumn{3}{l} {({\bf linearity $t\;$ $i_1\;$ $i_2\;$ $\ldots$ $\;i_t$ })}\\
223\multicolumn{3}{l} {{\bf begin}}\\
224 $n+s$ & $d+1$ & numbertype\\
225 $1$ & $v_1$ & \\
226 $\vdots$ & $\vdots$ & \\
227 $1$ & $v_n$ & \\
228 $0$ & $r_{n+1}$ & \\
229 $\vdots$ & $\vdots$ & \\
230 $0$ & $r_{n+s}$ & \\
231\multicolumn{3}{l} {{\bf end}}\\
232\multicolumn{3}{l} {various options} \\ \hline
233\end{tabular}
234
235\bigskip
236\noindent
237Here we do not require that
238vertices and rays are listed
239separately; they can appear mixed in arbitrary
240order.
241
242Linearity for V-representation specifies a subset of generators
243whose coefficients are relaxed
244to be {\bf free}: for all $j=1,2, \ldots, t$, the $k=i_j$th generator ($v_{k}$ or $r_k$ whichever is the $i_j$th generator) is a free generator.
245This means for each such a ray $r_k$,
246the line generated by $r_k$ is in the polyhedron,
247and for each such a vertex $v_k$, its coefficient is no longer nonnegative
248but still the coefficients for all $v_i$'s must sum up to one.
249It is highly unlikely that one needs to
250use linearity for vertex generators, and it is defined mostly
251for formality.
252
253When the representation statement, either ``H-representation''
254or ``V-representation'', is omitted, the former
255``H-representation'' is assumed.
256
257It is strongly suggested to use the following rule for naming
258H-format files and V-format files:
259\begin{description}
260\item[(a)] use the filename extension ``.ine'' for H-files (where ine stands for inequalities), and
261\item[(b)] use the filename extension ``.ext'' for V-files (where ext stands for extreme points/rays).
262\end{description}
263
264
265\section{Basic Object Types (Structures) in cddlib} \label{DATASTR}
266
267Here are the types (defined in cddtypes.h) that are
268important for the cddlib user. The most important one,
269{\tt dd\_MatrixType},
270is to store a Polyhedra data in a straightforward manner.
271Once the user sets up a (pointer to) {\tt dd\_MatrixType} data,
272he/she can load the data to an internal data type ({\tt dd\_PolyhedraType})
273by using functions described in the next section, and apply
274the double descrition method to get another representation.
275As an option {\tt dd\_MatrixType} can save a linear objective function
276to be used by a linear programming solver.
277
278The two dimensional array data in the structure {\tt dd\_MatrixType} is
279{\tt dd\_Amatrix} whose components are of type {\tt mytype\/}.
280The type mytype is set to be either the rational type {\tt mpq\_t} of
281the GNU MP Library or the C double array of size $1$.
282This abstract type allows us to write a single program that can
283be compiled with the two or more different arithmetics, see example
284programs such as simplecdd.c, testlp*.c and testcdd*.c
285in the {\tt src} and {\tt src-gmp} subdirectories of the source
286distribution.
287
288There is another data type that is used very often, {\tt dd\_SetFamilyType}.
289This is to store a family of subsets of a finite set. Such a family
290can represent the incidence relations between the set of extreme
291points and the set of facets of a polyhedron. Also, it can represent a
292graph structure by listing the set of vertices adjacent to each vertex (i.e.
293the adjacency list). To implement {\tt dd\_SetFamilyType},
294we use a separate set library called {\tt setoper}, that
295handles the basic set operations, This library is briefly introduced in
296Section~\ref{SetFunctions}.
297
298
299\begin{verbatim}
300
301#define dd_FALSE 0
302#define dd_TRUE 1
303
304typedef long dd_rowrange;
305typedef long dd_colrange;
306typedef long dd_bigrange;
307
308typedef set_type dd_rowset; /* set_type defined in setoper.h */
309typedef set_type dd_colset;
310typedef long *dd_rowindex;
311typedef int *dd_rowflag;
312typedef long *dd_colindex;
313typedef mytype **dd_Amatrix; /* mytype is either GMP mpq_t or 1-dim double array. */
314typedef mytype *dd_Arow;
315typedef set_type *dd_SetVector;
316
317typedef enum {
318 dd_Real, dd_Rational, dd_Integer, dd_Unknown
319} dd_NumberType;
320
321typedef enum {
322 dd_Inequality, dd_Generator, dd_Unspecified
323} dd_RepresentationType;
324
325typedef enum {
326 dd_MaxIndex, dd_MinIndex, dd_MinCutoff, dd_MaxCutoff, dd_MixCutoff,
327 dd_LexMin, dd_LexMax, dd_RandomRow
328} dd_RowOrderType;
329
330typedef enum {
331 dd_InProgress, dd_AllFound, dd_RegionEmpty
332} dd_CompStatusType;
333
334typedef enum {
335 dd_DimensionTooLarge, dd_ImproperInputFormat,
336 dd_NegativeMatrixSize, dd_EmptyVrepresentation,
337 dd_IFileNotFound, dd_OFileNotOpen, dd_NoLPObjective,
338 dd_NoRealNumberSupport, dd_NoError
339} dd_ErrorType;
340
341typedef enum {
342 dd_LPnone=0, dd_LPmax, dd_LPmin
343} dd_LPObjectiveType;
344
345typedef enum {
346 dd_LPSundecided, dd_Optimal, dd_Inconsistent, dd_DualInconsistent,
347 dd_StrucInconsistent, dd_StrucDualInconsistent,
348 dd_Unbounded, dd_DualUnbounded
349} dd_LPStatusType;
350
351typedef struct matrixdata *dd_MatrixPtr;
352typedef struct matrixdata {
353 dd_rowrange rowsize;
354 dd_rowset linset;
355 /* a subset of rows of linearity (ie, generators of
356 linearity space for V-representation, and equations
357 for H-representation. */
358 dd_colrange colsize;
359 dd_RepresentationType representation;
360 dd_NumberType numbtype;
361 dd_Amatrix matrix;
362 dd_LPObjectiveType objective;
363 dd_Arow rowvec;
364} dd_MatrixType;
365
366typedef struct setfamily *dd_SetFamilyPtr;
367typedef struct setfamily {
368 dd_bigrange famsize;
369 dd_bigrange setsize;
370 dd_SetVector set;
371} dd_SetFamilyType;
372
373typedef struct lpsolution *dd_LPSolutionPtr;
374typedef struct lpsolution {
375 dd_DataFileType filename;
376 dd_LPObjectiveType objective;
377 dd_LPSolverType solver;
378 dd_rowrange m;
379 dd_colrange d;
380 dd_NumberType numbtype;
381
382 dd_LPStatusType LPS; /* the current solution status */
383 mytype optvalue; /* optimal value */
384 dd_Arow sol; /* primal solution */
385 dd_Arow dsol; /* dual solution */
386 dd_colindex nbindex; /* current basis represented by nonbasic indices */
387 dd_rowrange re; /* row index as a certificate in the case of inconsistency */
388 dd_colrange se; /* col index as a certificate in the case of dual inconsistency */
389 long pivots[5];
390 /* pivots[0]=setup (to find a basis), pivots[1]=PhaseI or Criss-Cross,
391 pivots[2]=Phase II, pivots[3]=Anticycling, pivots[4]=GMP postopt */
392 long total_pivots;
393} dd_LPSolutionType;
394
395\end{verbatim}
396
397\section{Library Functions} \label{LIBRARY}
398
399Here we list some of the most important library functions/procedures.
400We use the following convention:
401{\tt poly} is of type {\tt dd\_PolyhedraPtr},
402{\tt matrix}, {\tt matrix1} and {\tt matrix2} are of type {\tt dd\_MatrixPtr},
403{\tt matrixP}, of type {\tt dd\_MatrixPtr*},
404{\tt err} is of type {\tt dd\_ErrorType*},
405{\tt ifile} and {\tt ofile} are of type {\tt char*},
406{\tt A} is of type {\tt dd\_Amatrix},
407{\tt point} and {\tt vector} are of type {\tt dd\_Arow},
408{\tt d} is of type {\tt dd\_colrange},
409{\tt m} and {\tt i} are of type {\tt dd\_rowrange},
410{\tt x} is of type {\tt mytype},
411{\tt a} is of type {\tt signed long integer},
412{\tt b} is of type {\tt double},
413{\tt set} is of type {\tt set\_type}.
414 Also,
415{\tt setfam} is of type {\tt dd\_SetFamilyPtr},
416{\tt lp} is of type {\tt dd\_LPPtr},
417{\tt lps} is of type {\tt dd\_LPSolutionPtr},
418{\tt solver} is of type {\tt dd\_LPSolverType},
419{\tt roworder} is of type {\tt dd\_RowOrderType}.
420
421
422\subsection{Library Initialization} \label{Initialization}
423
424\begin{description}
425
426\item[{\tt void dd\_set\_global\_constants(void)}]:\\
427This is to set the global constants such as {\tt dd\_zero},
428{\tt dd\_purezero} and
429{\tt dd\_one} for sign recognition and basic arithmetic
430operations. {Every program to use cddlib must call this function}
431before doing any computation. Just call this once.
432 See Section \ref{constants} for the definitions of
433constants.
434
435\item[{\tt void dd\_free\_global\_constants(void)}]:\\
436This is to free the global constants. This should be called
437when one does not use cddlib functions anymore.
438\end{description}
439
440\subsection{Core Functions} \label{CoreLibrary}
441
442There are two types of core functions in cddlib. The first type
443runs the double description (DD) algorithm and does a representation
444conversion of a specified polyhedron. The standard header
445for this type is {\tt dd\_DD*}. The second type solves
446one or more linear programs with no special headers.
447Both types of computations are nontrivial
448and the users (especially for the DD algorithm) must
449know that there is a serous limit in the sizes of problems
450that can be practically solved.
451Please check *.ext and *.ine files that come with cddlib to get
452ideas of tractable problems.
453
454In addition to previously defined objects, the symbol {\tt roworder} is
455of {\tt dd\_RowOrderType}. The symbol {\tt matrixP} is
456a pointer to {\bf dd\_MatrixType}.
457the arguments {\tt impl\_lin} and {\tt redset} are both a pointer
458to {\tt dd\_rowset} type, and {\tt newpos} is a pointer to
459{\tt dd\_rowindex} type.
460
461
462\begin{description}
463\item[{\tt dd\_PolyhedraPtr dd\_DDMatrix2Poly(matrix, err)}]:\\
464Store the representation given by {\tt matrix} in a polyhedra data, and
465generate the second representation of {\tt *poly}. It returns
466a pointer to the data. {\tt *err}
467returns {\tt dd\_NoError} if the computation terminates normally. Otherwise,
468it returns a value according to the error occured.
469
470\item[{\tt dd\_PolyhedraPtr dd\_DDMatrix2Poly2(matrix, roworder, err)}]:\\
471This is the same function as {\tt dd\_DDMatrix2Poly} except that the insertion
472order is specified by the user. The argument {\tt roworder} is of {\tt dd\_RowOrderType}
473and takes one of the values:
474 {\tt dd\_MaxIndex}, {\tt dd\_MinIndex}, {\tt dd\_MinCutoff}, {\tt dd\_MaxCutoff}, {\tt dd\_MixCutoff},
475 {\tt dd\_LexMin}, {\tt dd\_LexMax}, {\tt dd\_RandomRow}. In general, {\tt dd\_LexMin} is
476the best choice which is in fact chosen in {\tt dd\_DDMatrix2Poly}. If you know that
477the input is already sorted in the order you like, use {\tt dd\_MinIndex} or {\tt dd\_MaxIndex}.
478If the input contains many redundant rows (say more than $80\%$ redundant),
479you might want to try {\tt dd\_MaxCutoff} which might result in much faster termination,
480see \cite{abs-hgach-97,fp-ddmr-96}
481
482\item[{\tt boolean dd\_DDInputAppend(poly, matrix, err)}]:\\
483Modify the input representation in {\tt *poly}
484by appending the matrix of {\tt *matrix}, and compute
485the second representation. The number of columns in
486{\tt *matrix} must be equal to the input representation.
487
488\item[{\tt boolean dd\_LPSolve(lp, solver, err)}]:\\
489Solve {\tt lp} by the algorithm {\tt solver} and save
490the solututions in {\tt *lp}. Unlike the earlier versions
491(dplex, cdd+), it can deal with equations and totally zero right
492hand sides. It is recommended that {\tt solver} is
493{\tt dd\_DualSimplex}, the revised dual simplex method
494that updates a $d\times d$ dual basis matrix in each pivot (where
495$d$ is the column size of lp).
496
497The revised dual simplex method is ideal for dense LPs in small number of variables
498(i.e. small column size, typically less than $100$)
499and many inequality constraints (i.e. large row size, can be a few ten thousands).
500If your LP has many variables but only few constraints, solve the dual LP by
501this function.
502
503When it is compiled for GMP rational
504arithmetic, it first tries to solve an LP with C double
505floating-point arithmetic and verifies whether the output
506basis is correct with GMP. If so, the correct solution is
507computed with GMP. Otherwise, it (re)solves the LP
508from scratch with GMP. This is newly implemented
509in the version 093. The original (non-crossover) version of
510the same function is still available as {\tt boolean dd\_LPSolve0}.
511
512\item[{\tt dd\_boolean dd\_Redundant(matrix, i, point, err)}]:\\
513Check whether $i$th data in {\tt matrix} is redundant for the representation.
514If it is nonredundant, it returns a certificate. For H-representation,
515it is a {\tt point} in $R^d$ which satisfies
516all inequalities except for the $i$th inequality. If $i$ is a linearity,
517it does nothing and always returns {\tt dd\_FALSE}.
518
519\item[{\tt dd\_rowset dd\_RedundantRows(matrix, err)}]:\\
520Returns a maximal set of row indices such that the associated rows
521can be eliminated without changing the polyhedron.
522The function works for both V- and H-representations.
523
524\item[{\tt dd\_boolean dd\_SRedundant(matrix, i, point, err)}]:\\
525Check whether $i$th data in {\tt matrix} is strongly redundant for the representation.
526If $i$ is a linearity, it does nothing and always returns {\tt dd\_FALSE}.
527Here, $i$th inequality in H-representation is {\em strongly redundant\/} if it is redundant
528and there is no point in the polyhedron satisfying the inequality with equality.
529In V-representation, $i$th point is {\em strongly redundant\/} if it is redundant
530and it is in the relative interior of the polyhedron. If it is not strongly redundant, it returns a certificate.
531
532\item[{\tt dd\_boolean dd\_ImplicitLinearity(matrix, i, err)}]:\\
533Check whether $i$th row
534in the input is forced to be linearity (equality
535for H-representation).
536If $i$ is linearity itself,
537it does nothing and always returns {\tt dd\_FALSE}.
538
539\item[{\tt dd\_rowset dd\_ImplicitLinearityRows(matrix, err)}]:\\
540Returns the set of indices of rows that are
541implicitly linearity. It simply calls the library function
542{\tt dd\_ImplicitLinearity} for each inequality and collects
543the row indices for which the answer is {\tt dd\_TRUE}.
544
545\item[{\tt dd\_boolean dd\_MatrixCanonicalize(matrixP, impl\_lin, redset, newpos, err)}]:\\
546 The input is a pointer {\tt matrixP} to a matrix and the function
547modifies the matrix by putting a maximally linear independent linearities (basis)
548at the top of the matrix, and removing all redundant data.
549All implicit linearities and all (removed) redundant rows
550in the original matrix will be returned in the corresponding row sets.
551The new positions of the original rows are returned by
552the array {\tt newpos}.
553
554The cardinality of the new linearity set {\tt (*matrixP)->linset} is the codimension
555of the polyhedron if it is H-polyhedron, and is the dimension of linearity space
556if it is V-polyhedron.
557
558Note that the present version should not be called a canonicalization
559because it may generate two different representations of the same
560polyhedron. In the future, this function is expected to be correctly
561implemented.
562
563\item[{\tt dd\_boolean dd\_MatrixCanonicalizeLinearity(matrixP, impl\_linset, newpos. err)}]:\\
564It does only the first half of {\tt dd\_boolean dd\_MatrixCanonicalize}, namely, it detects all
565implicit linearities and puts a maximally independent linearities
566at the top of the matrix. For example, this function can be
567used to detect the dimension of an H-polyhedron.
568
569\item[{\tt dd\_boolean dd\_MatrixRedundancyRemove(matrixP, redset, newpos, err)}]:\\
570It does essentially the second half of {\tt dd\_boolean dd\_MatrixCanonicalize},
571namely, it detects all
572redundancies. This function should be used after {\tt dd\_MatrixCanonicalizeLinearity}
573has been called.
574
575
576\item[{\tt dd\_boolean dd\_FindRelativeInterior(matrix, impl\_lin, lin\_basis, lps, err)}]:\\
577Computes a point in the relative interior of an H-polyhedron given by matrix, by solving
578an LP. The point will be returned by {\tt lps}.
579See the sample program allfaces.c that generates all nonempty faces of an H-polyhedron and
580a relative interior point for each face. The former returns all implicit linearity rows (implicit equations)
581and the latter returns a basis of the union of linearity rows and implicit linearity rows.
582This means that the cardinality of {\tt *lin\_basis} is the codimension of the polyhedron.
583
584
585\item[{\tt dd\_boolean dd\_ExistsRestrictedFace(matrix, R, S, err)}]:\\
586Returns the answer to the Farkas' type decision problem as to whether there is a point
587in the polyhedron given by matrix satisfying all constraints in {\tt R} with
588equality and all constraints in {\tt S} with strict inequality. More precisely,
589it is the linear feasibility problem:
590\[
591\begin{array}{llllll}
592\exists\mbox{?} &x &\mbox{ satisfying } & b_r - A_r x &= 0, \; \forall r \in R\cup L \\
593 & & & b_s - A_s x &> 0, \; \forall s \in S \\
594 & & & b_t - A_t x &\ge 0, \; \forall t \in T,
595\end{array}
596\]
597where $L$ is the set of linearity rows of {\tt matrix}, and $T$ represents
598the set of rows that are not in $R\cup L \cup S$.
599Both {\tt R} and {\tt S} are of {\tt dd\_rowset} type. The set $S$ is
600supposed to be disjoint from both $R$ and $L$.
601If it is not the case, the set $S$ will be considered as $S \setminus (R \cup L)$.
602
603This function ignores {\tt matrix->representation}, and thus even if it is
604set to {\tt dd\_Generator} or {\tt dd\_Unspecified}, it treats the matrix
605as if it were inequality representation.
606
607\item[{\tt dd\_boolean dd\_ExistsRestrictedFace2(matrix, R, S, lps, err)}]:\\
608It is the same as the function {\tt dd\_ExistsRestrictedFace} except that
609it returns also a certificate for the answer. The certificate is a solution
610to the bounded LP:
611\[
612\begin{array}{lllllll}
613\mbox{(P)} &\max z &\mbox{ subject to } & b_r - A_r x & & = 0, \; \forall r \in R\cup L \\
614 & & & b_s - A_s x &-z &\ge 0, \; \forall s \in S \\
615 & & & b_t - A_t x & &\ge 0, \; \forall t \in T \\
616 & & & 1 & -z&\ge 0,
617\end{array}
618\]
619where $L$ is the set of linearity rows of {\tt matrix}, and $T$ represents
620the set of rows that are not in $R\cup L \cup S$.
621The answer for the decision problem is YES if and only if the LP attains
622an optimal and the optimal value is positive. The dual solution (either
623an optimal solution or a dual unbounded direction) can be considered
624as a certificate for the NO answer, if the answer is NO.
625
626This function ignores {\tt matrix->representation}, and thus even if it is
627set to {\tt dd\_Generator} or {\tt dd\_Unspecified}, it treats the matrix
628as if it were inequality representation.
629
630\item[{\tt dd\_SetFamilyPtr dd\_Matrix2Adjacency(matrix, err)}]:\\
631Computes the adjacency list of input rows using
632the LP solver and without running the representation conversion. When
633the input is H-representation, it gives the facet graph of the polyhedron.
634For V-representation, it gives the (vertex) graph of the polyhedron.
635It is required that the input matrix is a minimal representation.
636Run redundancy removal functions before calling this function,
637see the sample code adjacency.c.
638
639
640\item[{\tt dd\_SetFamilyPtr dd\_Matrix2WeakAdjacency(matrix, err)}]:\\
641Computes the weak adjacency list of input rows using
642the LP solver and without running the representation conversion. When
643the input is H-representation, it gives the graph where its nodes are the facets
644two nodes are adjacent if and only if the associated facets have
645some intersection.
646For V-representation, it gives the graph where its nodes are the vertices
647and two nodes are adjacent if and only if the associated vertices
648are on a common facet.
649It is required that the input matrix is a minimal representation.
650Run redundancy removal functions before calling this function,
651see the sample code adjacency.c.
652
653\item[{\tt dd\_MatrixPtr dd\_FourierElimination(matrix, err)}]:\\
654Eliminate the last variable from a system of linear inequalities
655given by matrix by using the Fourier's Elimination. If the
656input matrix is V-representation, {\tt *err} returns
657{\tt dd\_NotAvailForV}. This function does not
658remove redundancy and one might want to call
659redundancy removal functions afterwards. See the sample code fourier.c.
660
661\item[{\tt dd\_MatrixPtr dd\_BlockElimination(matrix, set, err)}]:\\
662Eliminate a set of variables from a system of linear inequalities
663given by matrix by using the extreme rays of the dual linear system.
664See comments in the code cddproj.c for details. This might be
665a faster way to eliminate variables than the repeated FourierElimination when
666the number of variables to eliminate is large.
667If the input matrix is V-representation, {\tt *err} returns {\tt dd\_NotAvailForV}.
668This function does not remove redundancy and one might want to call
669redundancy removal functions afterwards. See the sample code projection.c.
670
671
672\item[{\tt dd\_rowrange dd\_RayShooting(matrix, point, vector)}]:\\
673Finds the index of a halfspace first left by the ray starting from
674{\tt point} toward the direction {\tt vector}. It resolves
675tie by a lexicographic perturbation. Those inequalities violated
676by {\tt point} will be simply ignored.
677
678\end{description}
679
680
681\subsection{Data Manipulations} \label{DataLibrary}
682
683\subsubsection{Number Assignments}
684For number assignments, one cannot use such expressions as {\tt x=(mytype)a}.
685This is because cddlib uses an abstract number type ({\tt mytype})
686so that it can compute with various
687number types such as C double and GMP rational.
688User can easily add a new number type by redefining
689arithmetic operations in cddmp.h and cddmp.c.
690
691\begin{description}
692
693
694\item[{\tt void dd\_init(x)}]:\\
695This is to initialize a {\tt mytype} variable {\tt x} and to set it
696to zero. This initialization has to be called before
697any {\tt mytype} variable to be used.
698
699\item[{\tt void dd\_clear(x)}]:\\
700This is to free the space allocated to a {\tt mytype} variable {\tt x}.
701
702\item[{\tt void dd\_set\_si(x, a)}]:\\
703This is to set a {\tt mytype} variable {\tt x} to the
704value of signed long integer {\tt a}.
705
706\item[{\tt void dd\_set\_si2(x, a, b)}]:\\
707This is to set a {\tt mytype} variable {\tt x} to the
708value of the rational expression {\tt a/b}, where
709{\tt a} is signed long and {\tt b} is unsigned long
710integers.
711
712\item[{\tt void dd\_set\_d(x, b)}]:\\
713This is to set a {\tt mytype} variable {\tt x} to the
714value of double {\tt b}. This is available only
715when the library is compiled without {\tt -DGMPRATIONAL}
716compiler option.
717
718\end{description}
719
720
721\subsubsection{Arithmetic Operations for {\tt mytype} Numbers}
722
723Below {\tt x}, {\tt y}, {\tt z} are of type {\tt mytype}.
724
725\begin{description}
726
727\item[{\tt void dd\_add(x, y, z)}]:\\
728Set {\tt x} to be the sum of {\tt y} and {\tt z}.
729
730\item[{\tt void dd\_sub(x, y, z)}]:\\
731Set {\tt x} to be the substraction of {\tt z} from {\tt y}.
732
733\item[{\tt void dd\_mul(x, y, z)}]:\\
734Set {\tt x} to be the multiplication of {\tt y} and {\tt z}.
735
736\item[{\tt void dd\_div(x, y, z)}]:\\
737Set {\tt x} to be the division of {\tt y} over {\tt z}.
738
739\item[{\tt void dd\_inv(x, y)}]:\\
740Set {\tt x} to be the reciplocal of {\tt y}.
741
742\end{description}
743
744
745\subsubsection{Predefined Constants} \label{constants}
746
747There are several {\tt mytype} constants defined when {\tt dd\_set\_global\_constants(void)} is called.
748Some constants depend on the double constant {\tt dd\_almostzero} which is normally set to $10^{-7}$ in cdd.h.
749This value can be modified depending on how numerically delicate your problems are but an extra
750caution should be taken.
751
752\begin{description}
753
754\item[{\tt mytype dd\_purezero}]:\\
755This represents the mathematical zero $0$.
756
757\item[{\tt mytype dd\_zero}]:\\
758This represents the largest positive number which should be considered to be zero. In the GMPRATIONAL
759mode, it is equal to {\tt dd\_purezero}. In the C double mode, it is set to the value of {\tt dd\_almostzero}.
760
761\item[{\tt mytype dd\_minuszero}]:\\
762The negative of {\tt dd\_zero}.
763
764\item[{\tt mytype dd\_one}]:\\
765This represents the mathematical one $1$.
766
767
768\end{description}
769
770\subsubsection{Sign Evaluation and Comparison for {\tt mytype} Numbers}
771
772Below {\tt x}, {\tt y}, {\tt z} are of type {\tt mytype}.
773
774\begin{description}
775
776\item[{\tt dd\_boolean dd\_Positive(x)}]:\\
777Returns {\tt dd\_TRUE} if {\tt x} is considered positive, and {\tt dd\_FALSE} otherwise.
778In the GMPRATIONAL mode, the positivity recognition is exact. In the C double mode,
779this means the value is strictly larger than {\tt dd\_zero}.
780
781{\tt dd\_boolean dd\_Negative(x)} works similarly.
782
783\item[{\tt dd\_boolean dd\_Nonpositive(x)}]:\\
784Returns the negation of {\tt dd\_Positive(x)}. {\tt dd\_Nonnegative(x)} works similarly.
785
786\item[{\tt dd\_boolean dd\_EqualToZero(x)}]:\\
787Returns {\tt dd\_TRUE} if {\tt x} is considered zero, and {\tt dd\_FALSE} otherwise.
788In the GMPRATIONAL mode, the zero recognition is exact. In the C double mode,
789this means the value is inbetween {\tt dd\_minuszero} and {\tt dd\_zero}
790inclusive.
791
792\item[{\tt dd\_boolean dd\_Larger(x, y)}]:\\
793Returns {\tt dd\_TRUE} if {\tt x} is strictly larger than {\tt y}, and {\tt dd\_FALSE} otherwise.
794This is implemented as {dd\_Positive(z)} where {\tt z} is the subtraction of {\tt y}
795from {\tt x}.
796{\tt dd\_Smaller(x, y)} works similarly.
797
798\item[{\tt dd\_boolean dd\_Equal(x, y)}]:\\
799Returns {\tt dd\_TRUE} if {\tt x} is considered equal to {\tt y}, and {\tt dd\_FALSE} otherwise.
800This is implemented as {dd\_EqualToZero(z)} where {\tt z} is the subtraction of {\tt y}
801from {\tt x}.
802\end{description}
803
804
805
806\subsubsection{Polyhedra Data Manipulation}
807\begin{description}
808
809\item[{\tt dd\_MatrixPtr dd\_PolyFile2Matrix (f, err)}]:\\
810Read a Polyhedra data from stream {\tt f} and store it in {\tt matrixdata}
811and return a pointer to the data.
812
813\item[{\tt dd\_MatrixPtr dd\_CopyInequalities(poly)}]:\\
814Copy the inequality representation pointed by poly to {\tt matrixdata}
815and return {\tt dd\_MatrixPtr}.
816
817\item[{\tt dd\_MatrixPtr dd\_CopyGenerators(poly)}]:\\
818Copy the generator representation pointed by poly to {\tt matrixdata}
819and return {\tt dd\_MatrixPtr}.
820
821\item[{\tt dd\_SetFamilyPtr dd\_CopyIncidence(poly)}]:\\
822Copy the incidence representation of the computed representation
823pointed by poly to {\tt setfamily}
824and return {\tt dd\_SetFamilyPtr}. The computed representation is
825{\tt Inequality} if the input is {\tt Generator}, and the vice visa.
826
827\item[{\tt dd\_SetFamilyPtr dd\_CopyAdjacency(poly)}]:\\
828Copy the adjacency representation of the computed representation
829pointed by poly to {\tt setfamily}
830and return {\tt dd\_SetFamilyPtr}. The computed representation is
831{\tt Inequality} if the input is {\tt Generator}, and the vice visa.
832
833\item[{\tt dd\_SetFamilyPtr dd\_CopyInputIncidence(poly)}]:\\
834Copy the incidence representation of the input representation
835pointed by poly to {\tt setfamily}
836and return {\tt d\_SetFamilyPtr}.
837
838\item[{\tt dd\_SetFamilyPtr dd\_CopyInputAdjacency(poly)}]:\\
839Copy the adjacency representation of the input representation
840pointed by poly to {\tt setfamily}
841and return {\tt d\_SetFamilyPtr}.
842
843\item[{\tt void dd\_FreePolyhedra(poly)}]:\\
844Free memory allocated to {\tt poly}.
845
846\end{description}
847
848\subsubsection{LP Data Manipulation}
849\begin{description}
850
851\item[{\tt dd\_LPPtr dd\_MakeLPforInteriorFinding(lp)}]:\\
852Set up an LP to find an interior point of the feasible region of {\tt lp}
853and return a pointer to the LP. The new LP has one new variable
854$x_{d+1}$ and one more constraint:
855$\max x_{d+1}$ subject to $b - A x - x_{d+1} \ge 0$ and $x_{d+1} \le K$,
856where $K$ is a positive constant.
857
858\item[{\tt dd\_LPPtr dd\_Matrix2LP(matrix, err)}]:\\
859Load {\tt matrix} to {\tt lpdata} and return a pointer to the data.
860
861\item[{\tt dd\_LPSolutionPtr dd\_CopyLPSolution(lp)}]:\\
862Load the solutions of {\tt lp} to {\tt lpsolution} and
863return a pointer to the data. This replaces the old name
864{\tt dd\_LPSolutionLoad(lp)}.
865
866\item[{\tt void dd\_FreeLPData(lp)}]:\\
867Free memory allocated as an LP data pointed by {\tt lp}.
868
869\item[{\tt void dd\_FreeLPSolution(lps)}]:\\
870Free memory allocated as an LP solution data pointed by {\tt lps}.
871
872\end{description}
873
874\subsubsection{Matrix Manipulation}
875\begin{description}
876
877\item[{\tt dd\_MatrixPtr dd\_CopyMatrix(matrix)}]:\\
878Make a copy of matrixdata pointed by {\tt matrix} and return
879a pointer to the copy.
880
881\item[{\tt dd\_MatrixPtr dd\_AppendMatrix(matrix1, matrix2)}]:\\
882Make a matrixdata by copying {\tt *matrix1} and appending
883the matrix in {\tt *matrix2} and return
884a pointer to the data. The colsize must be equal in
885the two input matrices. It returns a {\tt NULL} pointer
886if the input matrices are not appropriate.
887Its {\tt rowsize} is set to
888the sum of the rowsizes of {\tt matrix1} and {\tt matrix2}.
889 The new matrixdata inherits everything else
890(i.e. numbertype, representation, etc)
891from the first matrix.
892
893\item[{\tt int dd\_MatrixAppendTo(\& matrix1, matrix2)}]:\\
894Same as {\tt dd\_AppendMatrix} except that the first matrix
895is modified to take the result.
896
897\item[{\tt int dd\_MatrixRowRemove(\& matrix, i)}]:\\
898Remove the $i$th row of {\tt matrix}.
899
900\item[{\tt dd\_MatrixPtr dd\_MatrixSubmatrix(matrix, set)}]:\\
901Generate the submatrix of {\tt matrix} by removing the
902rows indexed by {\tt set} and return a matrixdata pointer.
903
904\item[{\tt dd\_SetFamilyPtr dd\_Matrix2Adjacency(matrix, err)}]:\\
905Return the adjacency list of the representation given by {\tt matrix}.
906The computation is done by the built-in LP solver. The representation
907should be free of redundancy when this function is called.
908See the function {\tt dd\_rowset dd\_RedundantRows}
909and the example program adjacency.c.
910
911\end{description}
912
913\subsection{Input/Output Functions} \label{IOLibrary}
914
915\begin{description}
916
917\item[{\tt dd\_MatrixPtr dd\_PolyFile2Matrix (f, err)}]:\\
918Read a Polyhedra data from stream {\tt f} and store it in {\tt matrixdata}
919and return a pointer to the data.
920
921\item[{\tt boolean dd\_DDFile2File(ifile, ofile, err)}]:\\
922Compute the representation conversion for a polyhedron given
923by a Polyhedra file ifile, and write the other representation
924in a Polyhedra file ofile. {\tt *err}
925returns {\tt dd\_NoError} if the computation terminates normally. Otherwise,
926it returns a value according to the error occured.
927
928\item[{\tt void dd\_WriteMatrix(f, matrix)}]:\\
929Write {\tt matrix} to stream {\tt f}.
930
931\item[{\tt void dd\_WriteNumber(f, x)}]:\\
932Write {\tt x} to stream {\tt f}. If {\tt x} is of GMP mpq\_t rational $p/q$,
933the output is $p/q$. If it is of C double, it is formated as a double float
934with a decimal point.
935
936\item[{\tt void dd\_WritePolyFile(f, poly)}]:\\
937Write {tt poly} to stream {\tt f} in Polyhedra format.
938
939\item[{\tt void dd\_WriteErrorMessages(f, err)}]:\\
940Write error messages given by {\tt err} to stream {\tt f}.
941
942\item[{\tt void dd\_WriteSetFamily(f, setfam)}]:\\
943Write the set family pointed by {\tt setfam} to stream {\tt f}.
944For each set, it outputs its index, its cardinality,
945a colon ``:'' and a ordered list of its elements.
946
947\item[{\tt void dd\_WriteSetFamilyCompressed(f, setfam)}]:\\
948Write the set family pointed by {\tt setfam} to stream {\tt f}.
949For each set, it outputs its index, its cardinality or the
950negative of the cardinality, a colon ``:''
951 and the elements in the set or its complements whichever is smaller.
952Whenever it outputs the complements, the cardinality is negated
953so that there is no ambiguity.
954This will be considered standard for
955outputing incidence (*.icd, *ecd) and adjacency
956(*.iad, *.ead) data in cddlib. But there is some minor incompatibility
957with cdd/cdd+ standalone codes.
958
959\item[{\tt void dd\_WriteProgramDescription(f)}]:\\
960Write the cddlib version information to stream {\tt f}.
961
962\item[{\tt void dd\_WriteDDTimes(f, poly)}]:\\
963Write the representation conversion time information on {\tt poly}
964 to stream {\tt f}.
965
966\end{description}
967
968\subsection{Obsolete Functions} \label{ObsoleteFunctions}
969\begin{description}
970\item[{\tt boolean dd\_DoubleDescription(poly, err)}]:
971(removed in Version 0.90c)\\
972The new function
973{\tt dd\_DDMatrix2Poly(matrix, err)} (see Section~\ref{CoreLibrary})
974replaces (and actually combines) both this and
975{\tt dd\_Matrix2Poly(matrix, err)}.
976
977\item[{\tt dd\_PolyhedraPtr dd\_Matrix2Poly(matrix, err)}]:
978(removed in Version 0.90c)\\
979See above for the reason for removal.
980
981\item[{\tt dd\_LPSolutionPtr dd\_LPSolutionLoad(lp)}]:
982(renamed in Version 0.90c)\\
983This function is now called {\tt dd\_CopyLPSolution(lp)}.
984
985\end{description}
986
987
988\subsection{Set Functions in {\tt setoper} library} \label{SetFunctions}
989
990The cddlib comes with a simple set operation library {\tt setoper}. The key
991type defined is {\tt set\_type}. A set is represented by a fixed length
992binary strings. Thus, the maximum length of a set must be declared when
993it is initialized.
994
995Below the symbols {\tt a}, {\tt b}, {\tt c} are
996of type {\tt set\_type}. The symbols {\tt aP} is a
997pointer to type {\tt set\_type}, and {\tt s}, {\tt t} are of type {\tt long}.
998Here are some of the functions defined. See {\tt setoper.h} for a
999complete listing.
1000
1001\begin{description}
1002
1003\item[{\tt void set\_initialize(aP, s)}]:\\
1004Allocate a {\tt set\_type} space of maximum cardinality {\tt s}
1005 and make it pointed by {\tt aP}. The set is initialized as empty set.
1006
1007\item[{\tt void set\_free(a)}]:\\
1008Free the {\tt set\_type} space allocated for {\tt a}.
1009
1010\item[{\tt void set\_copy(a, b))}]:\\
1011Set {\tt a} to be {\tt b}. The set {\tt a} must be pre-initialized
1012with the same maximum cardinality as that of {\tt b}.
1013
1014\item[{\tt void set\_addelem(a, t))}]:\\
1015Add an element {\tt t} to a set {\tt a}. The set {\tt a} stays unchanged
1016if it contains the element {\tt t}.
1017
1018\item[{\tt long set\_card(a))}]:\\
1019Return the cardinality of set {\tt a}.
1020
1021\item[{\tt int set\_member(t, a))}]:\\
1022Return $1$ if {\tt t} is a member of set {\tt a}, and $0$ otherwise.
1023
1024
1025\item[{\tt void set\_write(a))}]:\\
1026Print out the elements of set {\tt a} to {\tt stdout}. The function {\tt void set\_fwrite(f, a))} output
1027to stream {\tt f}.
1028
1029\end{description}
1030
1031\section{An Extension of the CDD Library in GMP mode} \label{GMPLIB}
1032
1033Starting from the version 093, the GMP version of cddlib, {\tt libcddgmp.a}, contains
1034all cdd library functions in two arithmetics. All functions with the standard prefix {\tt dd\_}
1035are computed with the GMP rational arithmetic as before. The same fuctions with
1036the new prefix {\tt ddf\_} are now added to the library {\tt libcddgmp.a} that are based
1037on the C double floating-point arithmetic. Thus these functions are equivalent to
1038 {\tt libcdd.a} functions, except that all functions and variable types are with prefix {\tt ddf\_} and
1039the variable type {\tt mytype} is replaced by {\tt myfloat}.
1040
1041In this sense, {\tt libcdd.a} is a proper subset of {\tt libcddgmp.a} and in principle one can
1042do everything with {\tt libcddgmp.a}. See how the new {\tt dd\_LPSolve} is written in
1043cddlp.c.
1044
1045
1046\section{Examples} \label{EXAMPLES}
1047
1048See example codes such as testcdd*.c , testlp*.c, redcheck.c, adjacency.c, allfaces,c
1049and simplecdd.c
1050in the {\tt src} and {\tt src-gmp} subdirectories of the source
1051distribution.
1052
1053\section{Numerical Accuracy} \label{accuracy}
1054 A little caution is in order. Many people have observed
1055numerical problems of cddlib when the floating version of cddlib
1056is used. As we all know, floating-point computation
1057might not give a correct answer, especially when an input
1058data is very sensitive to a small perturbation. When
1059some strange behavior is observed, it is always wise
1060to create a rationalization of the input
1061(for example, one can replace 0.3333333 with 1/3)
1062and to compute it with cddlib compiled with gmp rational
1063to see what a correct behavior should be. Whenever the time
1064is not important, it is safer to use gmp rational arithmetic.
1065
1066If you need speedy computation with floating-point arithmetic,
1067you might want to ``play with'' the constant {\tt dd\_almostzero}
1068defined in cdd.h:
1069
1070\begin{verbatim}
1071 #define dd_almostzero 1.0E-7
1072\end{verbatim}
1073\noindent
1074This number is used to recognize whether a number is zero:
1075a number whose absolute value is smaller
1076than {\tt dd\_almostzero} is considered zero, and nonzero otherwise.
1077You can change this to modify the behavior of cddlib. One might
1078consider the default setting is rather large for double
1079precision arithmetic. This is because cddlib is made
1080to deal with highly degenerate data and it works better
1081to treat a relatively large ``epsilon'' as zero.
1082
1083Another thing one can do is scaling. If the values in one column of
1084an input is of smaller magnitude than those in another column,
1085scale one so that they become comparable.
1086
1087\section{Other Useful Codes} \label{CODES}
1088There are several other useful codes available for vertex enumeration and/or
1089convex hull computation such as lrs, qhull, porta and irisa-polylib.
1090The pointers to these codes are available at
1091\begin{enumerate}
1092\item lrs by D. Avis \cite{a-lrshome-01} (C implementation of the reverse search algorithm
1093\cite{af-pachv-92}).
1094
1095\item qhull by C.B. Barber \cite{bdh-qach-03} (C implementation of
1096the beneath-beyond method, see \cite{e-acg-87,m-cg-94},
1097which is the dual of the dd method).
1098
1099\item porta by T. Christof and A. L{\"o}bel \cite{cl-porta-97} (C implementation
1100of the Fourier-Motzkin elimination).
1101
1102\item IRISA polyhedral library by D.K. Wilde
1103\cite{w-ldpo-93b} (C implementation
1104of a variation of the dd algorithm).
1105
1106\item PPL: the Parma Polyhedra Library \cite{b-pplhome} by R. Bagnara (C++ implementation of
1107a variation of the dd algorithm).
1108
1109\item {\tt pd} by A. Marzetta \cite{m-pdcip-97} (C implementation of the primal-dual algorithm
1110\cite{bfm-pdmvf-97}).
1111
1112 \item Geometry Center Software List by N. Amenta \cite{a-dcg}.
1113
1114 \item Computational Geometry Pages by J. Erickson \cite{e-cgp}.
1115
1116 \item Linear Programming FAQ by R. Fourer and J. Gregory \cite{fg-lpfaq}.
1117
1118 \item ZIB Berlin polyhedral software list:\\
1119 \htmladdnormallink{ftp://elib.zib-berlin.de/pub/mathprog/polyth/index.html}
1120{ftp://elib.zib-berlin.de/pub/mathprog/polyth/index.html}.
1121
1122
1123\item Polyhedral Computation FAQ \cite{f-pcfaq-98}.
1124\end{enumerate}
1125
1126\section{Codes Using Cddlib} \label{USERCODES}
1127
1128There are quite a few nice programs using some functions of cddlib.
1129Here are some of them.
1130
1131
1132\begin{enumerate}
1133
1134\item {\tt LattE} \cite{dhhhty-latte-05} computes the number of lattice points
1135in a convex polytope.
1136
1137\item {\tt Minksum} \cite{w-msv-05} is a program to compute the V-representation
1138(i.e. the set of vertices) of the Minkowski addition of several convex polytopes
1139given by their V-representation in $\R^d$. It is an implementation in C++ language
1140of the reverse search algorithm \cite{f-fzctmacp-04} whose time complexity is
1141polynomially bounded by the sizes of input and output.
1142
1143\item {\tt Gfan} \cite{j-gvum-05} is a program to list all reduced Gr\"obner
1144bases of a general polynomial ideal given by a set of generating polynomials
1145in $n$-variables. It is an implementation in C++ language
1146of the reverse search algorithm \cite{fjt-cgf-05}.
1147
1148
1149\item {\tt TOPCOM} \cite{r-topcom-05} computes the combinatorial structure
1150(the oriented matroid) of a point configuration and enumerates all triangulations
1151of a point set. It detects the regularlity of a triangulation using cddlib.
1152
1153\end{enumerate}
1154
1155
1156\section*{Acknowledgements.}
1157I am grateful to Tom Liebling who
1158provided me with an ideal opportunity to visit EPFL
1159for the academic year 1993-1994. Later, Hans-Jakob L\"uthi (ETHZ) and
1160Emo Welzl (ETHZ) joined to support the
1161the development of cdd codes (cdd, cdd+, cddlib).
1162Without their generous and continuing support, the present form of
1163this program would not have existed.
1164
1165There are many other people who helped me to improve cdd, in particular,
1166I am indebted to David Avis,
1167Alexander Bockmayr, David Bremner, Henry Crapo, Istvan Csabai,
1168Francois Margot, Marc Pfetsch, Alain Prodon, J\"org Rambau, Dima Pasechnik,
1169Shawn Rusaw, Matthew Saltzman, Masanori Sato, Anders Jensen,
1170Ruriko Yoshida, Charles Geyer, Michal Kvasnica, Sven Verdoolaege
1171 (listed in arbitrary order) and those listed
1172in the HISTORY file.
1173
1174\bibliographystyle{plain}
1175
1176\bibliography{fukuda1,fukuda2}
1177
1178\end{document}
1179
1180