C Language Interface

Some details about the C Interface. More...

Version Checking

#define PPL_VERSION_MAJOR   0
 The major number of the PPL version.
#define PPL_VERSION_MINOR   9
 The minor number of the PPL version.
#define PPL_VERSION_REVISION   0
 The revision number of the PPL version.
#define PPL_VERSION_BETA   0
 The beta number of the PPL version. This is zero for official releases and nonzero for development snapshots.
#define PPL_VERSION   "0.9"
 A string containing the PPL version.
int ppl_version_major (void)
 Returns the major number of the PPL version.
int ppl_version_minor (void)
 Returns the minor number of the PPL version.
int ppl_version_revision (void)
 Returns the revision number of the PPL version.
int ppl_version_beta (void)
 Returns the beta number of the PPL version.
int ppl_version (const char **p)
 Writes to *p a pointer to a character string containing the PPL version.
int ppl_banner (const char **p)
 Writes to *p a pointer to a character string containing the PPL banner.

Simple I/O Functions

typedef const char * ppl_io_variable_output_function_type (ppl_dimension_type var)
 The type of output functions used for printing variables.
int ppl_io_print_variable (ppl_dimension_type var)
 Pretty-prints var to stdout.
int ppl_io_fprint_variable (FILE *stream, ppl_dimension_type var)
 Pretty-prints var to the given output stream.
int ppl_io_set_variable_output_function (ppl_io_variable_output_function_type *p)
 Sets the output function to be used for printing variables to p.
int ppl_io_get_variable_output_function (ppl_io_variable_output_function_type **pp)
 Writes a pointer to the current variable output function to pp.

Initialization, Error Handling and Auxiliary Functions

int ppl_max_space_dimension (ppl_dimension_type *m)
 Writes to m the maximum space dimension this library can handle.
int ppl_not_a_dimension (ppl_dimension_type *m)
 Writes to m a value that does not designate a valid dimension.
int ppl_initialize (void)
 Initializes the Parma Polyhedra Library. This function must be called before any other function.
int ppl_finalize (void)
 Finalizes the Parma Polyhedra Library. This function must be called after any other function.
int ppl_set_error_handler (void(*h)(enum ppl_enum_error_code code, const char *description))
 Installs the user-defined error handler pointed at by h.

Functions Related to Coefficients

int ppl_new_Coefficient (ppl_Coefficient_t *pc)
 Creates a new coefficient with value 0 and writes a handle for the newly created coefficient at address pc.
int ppl_new_Coefficient_from_mpz_t (ppl_Coefficient_t *pc, mpz_t z)
 Creates a new coefficient with the value given by the GMP integer z and writes a handle for the newly created coefficient at address pc.
int ppl_new_Coefficient_from_Coefficient (ppl_Coefficient_t *pc, ppl_const_Coefficient_t c)
 Builds a coefficient that is a copy of c; writes a handle for the newly created coefficient at address pc.
int ppl_assign_Coefficient_from_mpz_t (ppl_Coefficient_t dst, mpz_t z)
 Assign to dst the value given by the GMP integer z.
int ppl_assign_Coefficient_from_Coefficient (ppl_Coefficient_t dst, ppl_const_Coefficient_t src)
 Assigns a copy of the coefficient src to dst.
int ppl_delete_Coefficient (ppl_const_Coefficient_t c)
 Invalidates the handle c: this makes sure the corresponding resources will eventually be released.
int ppl_Coefficient_to_mpz_t (ppl_const_Coefficient_t c, mpz_t z)
 Sets the value of the GMP integer z to the value of c.
int ppl_Coefficient_OK (ppl_const_Coefficient_t c)
 Returns a positive integer if c is well formed, i.e., if it satisfies all its implementation invariants; returns 0 and perhaps makes some noise if c is broken. Useful for debugging purposes.
int ppl_Coefficient_is_bounded (void)
 Returns a positive integer if coefficients are bounded; returns 0 otherwise.
int ppl_Coefficient_min (mpz_t min)
 Returns a positive integer if coefficients are bounded, in which case min is set to their minimum value; returns 0 otherwise.
int ppl_Coefficient_max (mpz_t max)
 Returns a positive integer if coefficients are bounded, in which case max is set to their maximum value; returns 0 otherwise.

Functions Related to Linear Expressions

int ppl_new_Linear_Expression (ppl_Linear_Expression_t *ple)
 Creates a new linear expression corresponding to the constant 0 in a zero-dimensional space; writes a handle for the new linear expression at address ple.
int ppl_new_Linear_Expression_with_dimension (ppl_Linear_Expression_t *ple, ppl_dimension_type d)
 Creates a new linear expression corresponding to the constant 0 in a d-dimensional space; writes a handle for the new linear expression at address ple.
int ppl_new_Linear_Expression_from_Linear_Expression (ppl_Linear_Expression_t *ple, ppl_const_Linear_Expression_t le)
 Builds a linear expression that is a copy of le; writes a handle for the newly created linear expression at address ple.
int ppl_new_Linear_Expression_from_Constraint (ppl_Linear_Expression_t *ple, ppl_const_Constraint_t c)
 Builds a linear expression corresponding to constraint c; writes a handle for the newly created linear expression at address ple.
int ppl_new_Linear_Expression_from_Generator (ppl_Linear_Expression_t *ple, ppl_const_Generator_t g)
 Builds a linear expression corresponding to generator g; writes a handle for the newly created linear expression at address ple.
int ppl_delete_Linear_Expression (ppl_const_Linear_Expression_t le)
 Invalidates the handle le: this makes sure the corresponding resources will eventually be released.
int ppl_assign_Linear_Expression_from_Linear_Expression (ppl_Linear_Expression_t dst, ppl_const_Linear_Expression_t src)
 Assigns a copy of the linear expression src to dst.
int ppl_Linear_Expression_add_to_coefficient (ppl_Linear_Expression_t le, ppl_dimension_type var, ppl_const_Coefficient_t n)
 Adds n to the coefficient of variable var in the linear expression le. The space dimension is set to be the maximum between var + 1 and the old space dimension.
int ppl_Linear_Expression_add_to_inhomogeneous (ppl_Linear_Expression_t le, ppl_const_Coefficient_t n)
 Adds n to the inhomogeneous term of the linear expression le.
int ppl_add_Linear_Expression_to_Linear_Expression (ppl_Linear_Expression_t dst, ppl_const_Linear_Expression_t src)
 Adds the linear expression src to dst.
int ppl_subtract_Linear_Expression_from_Linear_Expression (ppl_Linear_Expression_t dst, ppl_const_Linear_Expression_t src)
 Subtracts the linear expression src from dst.
int ppl_multiply_Linear_Expression_by_Coefficient (ppl_Linear_Expression_t le, ppl_const_Coefficient_t n)
 Multiply the linear expression dst by n.
int ppl_Linear_Expression_space_dimension (ppl_const_Linear_Expression_t le, ppl_dimension_type *m)
 Writes to m the space dimension of le.
int ppl_Linear_Expression_coefficient (ppl_const_Linear_Expression_t le, ppl_dimension_type var, ppl_Coefficient_t n)
 Copies into n the coefficient of variable var in the linear expression le.
int ppl_Linear_Expression_inhomogeneous_term (ppl_const_Linear_Expression_t le, ppl_Coefficient_t n)
 Copies into n the inhomogeneous term of linear expression le.
int ppl_Linear_Expression_OK (ppl_const_Linear_Expression_t le)
 Returns a positive integer if le is well formed, i.e., if it satisfies all its implementation invariants; returns 0 and perhaps makes some noise if le is broken. Useful for debugging purposes.

Functions Related to Constraints

int ppl_new_Constraint (ppl_Constraint_t *pc, ppl_const_Linear_Expression_t le, enum ppl_enum_Constraint_Type rel)
 Creates the new constraint `le rel 0' and writes a handle for it at address pc. The space dimension of the new constraint is equal to the space dimension of le.
int ppl_new_Constraint_zero_dim_false (ppl_Constraint_t *pc)
 Creates the unsatisfiable (zero-dimension space) constraint $0 = 1$ and writes a handle for it at address pc.
int ppl_new_Constraint_zero_dim_positivity (ppl_Constraint_t *pc)
 Creates the true (zero-dimension space) constraint $0 \leq 1$, also known as positivity constraint. A handle for the newly created constraint is written at address pc.
int ppl_new_Constraint_from_Constraint (ppl_Constraint_t *pc, ppl_const_Constraint_t c)
 Builds a constraint that is a copy of c; writes a handle for the newly created constraint at address pc.
int ppl_delete_Constraint (ppl_const_Constraint_t c)
 Invalidates the handle c: this makes sure the corresponding resources will eventually be released.
int ppl_assign_Constraint_from_Constraint (ppl_Constraint_t dst, ppl_const_Constraint_t src)
 Assigns a copy of the constraint src to dst.
int ppl_Constraint_space_dimension (ppl_const_Constraint_t c, ppl_dimension_type *m)
 Writes to m the space dimension of c.
int ppl_Constraint_type (ppl_const_Constraint_t c)
 Returns the type of constraint c.
int ppl_Constraint_coefficient (ppl_const_Constraint_t c, ppl_dimension_type var, ppl_Coefficient_t n)
 Copies into n the coefficient of variable var in constraint c.
int ppl_Constraint_inhomogeneous_term (ppl_const_Constraint_t c, ppl_Coefficient_t n)
 Copies into n the inhomogeneous term of constraint c.
int ppl_Constraint_OK (ppl_const_Constraint_t c)
 Returns a positive integer if c is well formed, i.e., if it satisfies all its implementation invariants; returns 0 and perhaps makes some noise if c is broken. Useful for debugging purposes.

Functions Related to Constraint Systems

int ppl_new_Constraint_System (ppl_Constraint_System_t *pcs)
 Builds an empty system of constraints and writes a handle to it at address pcs.
int ppl_new_Constraint_System_zero_dim_empty (ppl_Constraint_System_t *pcs)
 Builds a zero-dimensional, unsatisfiable constraint system and writes a handle to it at address pcs.
int ppl_new_Constraint_System_from_Constraint (ppl_Constraint_System_t *pcs, ppl_const_Constraint_t c)
 Builds the singleton constraint system containing only a copy of constraint c; writes a handle for the newly created system at address pcs.
int ppl_new_Constraint_System_from_Constraint_System (ppl_Constraint_System_t *pcs, ppl_const_Constraint_System_t cs)
 Builds a constraint system that is a copy of cs; writes a handle for the newly created system at address pcs.
int ppl_delete_Constraint_System (ppl_const_Constraint_System_t cs)
 Invalidates the handle cs: this makes sure the corresponding resources will eventually be released.
int ppl_assign_Constraint_System_from_Constraint_System (ppl_Constraint_System_t dst, ppl_const_Constraint_System_t src)
 Assigns a copy of the constraint system src to dst.
int ppl_Constraint_System_space_dimension (ppl_const_Constraint_System_t cs, ppl_dimension_type *m)
 Writes to m the dimension of the vector space enclosing cs.
int ppl_Constraint_System_has_strict_inequalities (ppl_const_Constraint_System_t cs)
 Returns a positive integer if cs contains any (non-trivial) strict inequality; returns 0 otherwise.
int ppl_Constraint_System_clear (ppl_Constraint_System_t cs)
 Removes all the constraints from the constraint system cs and sets its space dimension to 0.
int ppl_Constraint_System_insert_Constraint (ppl_Constraint_System_t cs, ppl_const_Constraint_t c)
 Inserts a copy of the constraint c into cs; the space dimension is increased, if necessary.
int ppl_Constraint_System_OK (ppl_const_Constraint_System_t c)
 Returns a positive integer if cs is well formed, i.e., if it satisfies all its implementation invariants; returns 0 and perhaps makes some noise if cs is broken. Useful for debugging purposes.
int ppl_new_Constraint_System_const_iterator (ppl_Constraint_System_const_iterator_t *pcit)
 Builds a new `const iterator' and writes a handle to it at address pcit.
int ppl_new_Constraint_System_const_iterator_from_Constraint_System_const_iterator (ppl_Constraint_System_const_iterator_t *pcit, ppl_const_Constraint_System_const_iterator_t cit)
 Builds a const iterator that is a copy of cit; writes an handle for the newly created const iterator at address pcit.
int ppl_delete_Constraint_System_const_iterator (ppl_const_Constraint_System_const_iterator_t cit)
 Invalidates the handle cit: this makes sure the corresponding resources will eventually be released.
int ppl_assign_Constraint_System_const_iterator_from_Constraint_System_const_iterator (ppl_Constraint_System_const_iterator_t dst, ppl_const_Constraint_System_const_iterator_t src)
 Assigns a copy of the const iterator src to dst.
int ppl_Constraint_System_begin (ppl_const_Constraint_System_t cs, ppl_Constraint_System_const_iterator_t cit)
 Assigns to cit a const iterator "pointing" to the beginning of the constraint system cs.
int ppl_Constraint_System_end (ppl_const_Constraint_System_t cs, ppl_Constraint_System_const_iterator_t cit)
 Assigns to cit a const iterator "pointing" past the end of the constraint system cs.
int ppl_Constraint_System_const_iterator_dereference (ppl_const_Constraint_System_const_iterator_t cit, ppl_const_Constraint_t *pc)
 Dereference cit writing a const handle to the resulting constraint at address pc.
int ppl_Constraint_System_const_iterator_increment (ppl_Constraint_System_const_iterator_t cit)
 Increment cit so that it "points" to the next constraint.
int ppl_Constraint_System_const_iterator_equal_test (ppl_const_Constraint_System_const_iterator_t x, ppl_const_Constraint_System_const_iterator_t y)
 Returns a positive integer if the iterators corresponding to x and y are equal; returns 0 if they are different.

Functions Related to Generators

int ppl_new_Generator (ppl_Generator_t *pg, ppl_const_Linear_Expression_t le, enum ppl_enum_Generator_Type t, ppl_const_Coefficient_t d)
 Creates a new generator of direction le and type t. If the generator to be created is a point or a closure point, the divisor d is applied to le. For other types of generators d is simply disregarded. A handle for the new generator is written at address pg. The space dimension of the new generator is equal to the space dimension of le.
int ppl_new_Generator_zero_dim_point (ppl_Generator_t *pg)
 Creates the point that is the origin of the zero-dimensional space $\Rset^0$. Writes a handle for the new generator at address pg.
int ppl_new_Generator_zero_dim_closure_point (ppl_Generator_t *pg)
 Creates, as a closure point, the point that is the origin of the zero-dimensional space $\Rset^0$. Writes a handle for the new generator at address pg.
int ppl_new_Generator_from_Generator (ppl_Generator_t *pg, ppl_const_Generator_t g)
 Builds a generator that is a copy of g; writes a handle for the newly created generator at address pg.
int ppl_delete_Generator (ppl_const_Generator_t g)
 Invalidates the handle g: this makes sure the corresponding resources will eventually be released.
int ppl_assign_Generator_from_Generator (ppl_Generator_t dst, ppl_const_Generator_t src)
 Assigns a copy of the generator src to dst.
int ppl_Generator_space_dimension (ppl_const_Generator_t g, ppl_dimension_type *m)
 Writes to m the space dimension of g.
int ppl_Generator_type (ppl_const_Generator_t g)
 Returns the type of generator g.
int ppl_Generator_coefficient (ppl_const_Generator_t g, ppl_dimension_type var, ppl_Coefficient_t n)
 Copies into n the coefficient of variable var in generator g.
int ppl_Generator_divisor (ppl_const_Generator_t g, ppl_Coefficient_t n)
 If g is a point or a closure point assigns its divisor to n.
int ppl_Generator_OK (ppl_const_Generator_t g)
 Returns a positive integer if g is well formed, i.e., if it satisfies all its implementation invariants; returns 0 and perhaps makes some noise if g is broken. Useful for debugging purposes.

Functions Related to Generator Systems

int ppl_new_Generator_System (ppl_Generator_System_t *pgs)
 Builds an empty system of generators and writes a handle to it at address pgs.
int ppl_new_Generator_System_from_Generator (ppl_Generator_System_t *pgs, ppl_const_Generator_t g)
 Builds the singleton generator system containing only a copy of generator g; writes a handle for the newly created system at address pgs.
int ppl_new_Generator_System_from_Generator_System (ppl_Generator_System_t *pgs, ppl_const_Generator_System_t gs)
 Builds a generator system that is a copy of gs; writes a handle for the newly created system at address pgs.
int ppl_delete_Generator_System (ppl_const_Generator_System_t gs)
 Invalidates the handle gs: this makes sure the corresponding resources will eventually be released.
int ppl_assign_Generator_System_from_Generator_System (ppl_Generator_System_t dst, ppl_const_Generator_System_t src)
 Assigns a copy of the generator system src to dst.
int ppl_Generator_System_space_dimension (ppl_const_Generator_System_t gs, ppl_dimension_type *m)
 Writes to m the dimension of the vector space enclosing gs.
int ppl_Generator_System_clear (ppl_Generator_System_t gs)
 Removes all the generators from the generator system gs and sets its space dimension to 0.
int ppl_Generator_System_insert_Generator (ppl_Generator_System_t gs, ppl_const_Generator_t g)
 Inserts a copy of the generator g into gs; the space dimension is increased, if necessary.
int ppl_Generator_System_OK (ppl_const_Generator_System_t c)
 Returns a positive integer if gs is well formed, i.e., if it satisfies all its implementation invariants; returns 0 and perhaps makes some noise if gs is broken. Useful for debugging purposes.
int ppl_new_Generator_System_const_iterator (ppl_Generator_System_const_iterator_t *pgit)
 Builds a new `const iterator' and writes a handle to it at address pgit.
int ppl_new_Generator_System_const_iterator_from_Generator_System_const_iterator (ppl_Generator_System_const_iterator_t *pgit, ppl_const_Generator_System_const_iterator_t git)
 Builds a const iterator that is a copy of git; writes an handle for the newly created const iterator at address pgit.
int ppl_delete_Generator_System_const_iterator (ppl_const_Generator_System_const_iterator_t git)
 Invalidates the handle git: this makes sure the corresponding resources will eventually be released.
int ppl_assign_Generator_System_const_iterator_from_Generator_System_const_iterator (ppl_Generator_System_const_iterator_t dst, ppl_const_Generator_System_const_iterator_t src)
 Assigns a copy of the const iterator src to dst.
int ppl_Generator_System_begin (ppl_const_Generator_System_t gs, ppl_Generator_System_const_iterator_t git)
 Assigns to git a const iterator "pointing" to the beginning of the generator system gs.
int ppl_Generator_System_end (ppl_const_Generator_System_t gs, ppl_Generator_System_const_iterator_t git)
 Assigns to git a const iterator "pointing" past the end of the generator system gs.
int ppl_Generator_System_const_iterator_dereference (ppl_const_Generator_System_const_iterator_t git, ppl_const_Generator_t *pg)
 Dereference git writing a const handle to the resulting generator at address pg.
int ppl_Generator_System_const_iterator_increment (ppl_Generator_System_const_iterator_t git)
 Increment git so that it "points" to the next generator.
int ppl_Generator_System_const_iterator_equal_test (ppl_const_Generator_System_const_iterator_t x, ppl_const_Generator_System_const_iterator_t y)
 Returns a positive integer if the iterators corresponding to x and y are equal; returns 0 if they are different.

Functions Related to Polyhedra

int ppl_new_C_Polyhedron_from_dimension (ppl_Polyhedron_t *pph, ppl_dimension_type d)
 Builds a universe C polyhedron of dimension d and writes an handle to it at address pph.
int ppl_new_NNC_Polyhedron_from_dimension (ppl_Polyhedron_t *pph, ppl_dimension_type d)
 Builds a universe NNC polyhedron of dimension d and writes an handle to it at address pph.
int ppl_new_C_Polyhedron_empty_from_dimension (ppl_Polyhedron_t *pph, ppl_dimension_type d)
 Builds an empty C polyhedron of space dimension d and writes an handle to it at address pph.
int ppl_new_NNC_Polyhedron_empty_from_dimension (ppl_Polyhedron_t *pph, ppl_dimension_type d)
 Builds an empty NNC polyhedron of space dimension d and writes an handle to it at address pph.
int ppl_new_C_Polyhedron_from_C_Polyhedron (ppl_Polyhedron_t *pph, ppl_const_Polyhedron_t ph)
 Builds a C polyhedron that is a copy of ph; writes a handle for the newly created polyhedron at address pph.
int ppl_new_C_Polyhedron_from_NNC_Polyhedron (ppl_Polyhedron_t *pph, ppl_const_Polyhedron_t ph)
 Builds a C polyhedron that is a copy of of the NNC polyhedron ph; writes a handle for the newly created polyhedron at address pph.
int ppl_new_NNC_Polyhedron_from_C_Polyhedron (ppl_Polyhedron_t *pph, ppl_const_Polyhedron_t ph)
 Builds an NNC polyhedron that is a copy of the C polyhedron ph; writes a handle for the newly created polyhedron at address pph.
int ppl_new_NNC_Polyhedron_from_NNC_Polyhedron (ppl_Polyhedron_t *pph, ppl_const_Polyhedron_t ph)
 Builds an NNC polyhedron that is a copy of ph; writes a handle for the newly created polyhedron at address pph.
int ppl_new_C_Polyhedron_from_Constraint_System (ppl_Polyhedron_t *pph, ppl_const_Constraint_System_t cs)
 Builds a new C polyhedron from the system of constraints cs and writes a handle for the newly created polyhedron at address pph.
int ppl_new_C_Polyhedron_recycle_Constraint_System (ppl_Polyhedron_t *pph, ppl_Constraint_System_t cs)
 Builds a new C polyhedron recycling the system of constraints cs and writes a handle for the newly created polyhedron at address pph.
int ppl_new_NNC_Polyhedron_from_Constraint_System (ppl_Polyhedron_t *pph, ppl_const_Constraint_System_t cs)
 Builds a new NNC polyhedron from the system of constraints cs and writes a handle for the newly created polyhedron at address pph.
int ppl_new_NNC_Polyhedron_recycle_Constraint_System (ppl_Polyhedron_t *pph, ppl_Constraint_System_t cs)
 Builds a new NNC polyhedron recycling the system of constraints cs and writes a handle for the newly created polyhedron at address pph.
int ppl_new_C_Polyhedron_from_Generator_System (ppl_Polyhedron_t *pph, ppl_const_Generator_System_t gs)
 Builds a new C polyhedron from the system of generators gs and writes a handle for the newly created polyhedron at address pph.
int ppl_new_C_Polyhedron_recycle_Generator_System (ppl_Polyhedron_t *pph, ppl_Generator_System_t gs)
 Builds a new C polyhedron recycling the system of generators gs and writes a handle for the newly created polyhedron at address pph.
int ppl_new_NNC_Polyhedron_from_Generator_System (ppl_Polyhedron_t *pph, ppl_const_Generator_System_t gs)
 Builds a new NNC polyhedron from the system of generators gs and writes a handle for the newly created polyhedron at address pph.
int ppl_new_NNC_Polyhedron_recycle_Generator_System (ppl_Polyhedron_t *pph, ppl_Generator_System_t gs)
 Builds a new NNC polyhedron recycling the system of generators gs and writes a handle for the newly created polyhedron at address pph.
int ppl_new_C_Polyhedron_from_bounding_box (ppl_Polyhedron_t *pph, ppl_dimension_type(*space_dimension)(void), int(*is_empty)(void), int(*get_lower_bound)(ppl_dimension_type k, int closed, ppl_Coefficient_t n, ppl_Coefficient_t d), int(*get_upper_bound)(ppl_dimension_type k, int closed, ppl_Coefficient_t n, ppl_Coefficient_t d))
 Builds a new C polyhedron corresponding to an interval-based bounding box, writing a handle for the newly created polyhedron at address pph.
int ppl_new_NNC_Polyhedron_from_bounding_box (ppl_Polyhedron_t *pph, ppl_dimension_type(*space_dimension)(void), int(*is_empty)(void), int(*get_lower_bound)(ppl_dimension_type k, int closed, ppl_Coefficient_t n, ppl_Coefficient_t d), int(*get_upper_bound)(ppl_dimension_type k, int closed, ppl_Coefficient_t n, ppl_Coefficient_t d))
 Builds a new NNC polyhedron corresponding to an interval-based bounding box, writing a handle for the newly created polyhedron at address pph.
int ppl_assign_C_Polyhedron_from_C_Polyhedron (ppl_Polyhedron_t dst, ppl_const_Polyhedron_t src)
 Assigns a copy of the C polyhedron src to the C polyhedron dst.
int ppl_assign_NNC_Polyhedron_from_NNC_Polyhedron (ppl_Polyhedron_t dst, ppl_const_Polyhedron_t src)
 Assigns a copy of the NNC polyhedron src to the NNC polyhedron dst.
int ppl_delete_Polyhedron (ppl_const_Polyhedron_t ph)
 Invalidates the handle ph: this makes sure the corresponding resources will eventually be released.
int ppl_Polyhedron_space_dimension (ppl_const_Polyhedron_t ph, ppl_dimension_type *m)
 Writes to m the dimension of the vector space enclosing ph.
int ppl_Polyhedron_affine_dimension (ppl_const_Polyhedron_t ph)
 Writes to m the affine dimension of ph (not to be confused with the dimension of its enclosing vector space) or 0, if ph is empty.
int ppl_Polyhedron_constraints (ppl_const_Polyhedron_t ph, ppl_const_Constraint_System_t *pcs)
 Writes a const handle to the constraint system defining the polyhedron ph at address pcs.
int ppl_Polyhedron_minimized_constraints (ppl_const_Polyhedron_t ph, ppl_const_Constraint_System_t *pcs)
 Writes a const handle to the minimized constraint system defining the polyhedron ph at address pcs.
int ppl_Polyhedron_generators (ppl_const_Polyhedron_t ph, ppl_const_Generator_System_t *pgs)
 Writes a const handle to the generator system defining the polyhedron ph at address pgs.
int ppl_Polyhedron_minimized_generators (ppl_const_Polyhedron_t ph, ppl_const_Generator_System_t *pgs)
 Writes a const handle to the minimized generator system defining the polyhedron ph at address pgs.
int ppl_Polyhedron_relation_with_Constraint (ppl_const_Polyhedron_t ph, ppl_const_Constraint_t c)
 Checks the relation between the polyhedron ph and the constraint c.
int ppl_Polyhedron_relation_with_Generator (ppl_const_Polyhedron_t ph, ppl_const_Generator_t g)
 Checks the relation between the polyhedron ph and the generator g.
int ppl_Polyhedron_shrink_bounding_box (ppl_const_Polyhedron_t ph, unsigned int complexity, void(*set_empty)(void), void(*raise_lower_bound)(ppl_dimension_type k, int closed, ppl_const_Coefficient_t n, ppl_const_Coefficient_t d), void(*lower_upper_bound)(ppl_dimension_type k, int closed, ppl_const_Coefficient_t n, ppl_const_Coefficient_t d))
 Use ph to shrink a generic, interval-based bounding box. The bounding box is abstractly provided by means of the parameters.
int ppl_Polyhedron_is_empty (ppl_const_Polyhedron_t ph)
 Returns a positive integer if ph is empty; returns 0 if ph is not empty.
int ppl_Polyhedron_is_universe (ppl_const_Polyhedron_t ph)
 Returns a positive integer if ph is a universe polyhedron; returns 0 if it is not.
int ppl_Polyhedron_is_bounded (ppl_const_Polyhedron_t ph)
 Returns a positive integer if ph is bounded; returns 0 if ph is unbounded.
int ppl_Polyhedron_bounds_from_above (ppl_const_Polyhedron_t ph, ppl_const_Linear_Expression_t le)
 Returns a positive integer if le is bounded from above in ph; returns 0 otherwise.
int ppl_Polyhedron_bounds_from_below (ppl_const_Polyhedron_t ph, ppl_const_Linear_Expression_t le)
 Returns a positive integer if le is bounded from below in ph; returns 0 otherwise.
int ppl_Polyhedron_maximize (ppl_const_Polyhedron_t ph, ppl_const_Linear_Expression_t le, ppl_Coefficient_t sup_n, ppl_Coefficient_t sup_d, int *pmaximum, ppl_Generator_t point)
 Returns a positive integer if ph is not empty and le is bounded from above in ph, in which case the supremum value and a point where le reaches it are computed.
int ppl_Polyhedron_minimize (ppl_const_Polyhedron_t ph, ppl_const_Linear_Expression_t le, ppl_Coefficient_t inf_n, ppl_Coefficient_t inf_d, int *pminimum, ppl_Generator_t point)
 Returns a positive integer if ph is not empty and le is bounded from below in ph, in which case the infimum value and a point where le reaches it are computed.
int ppl_Polyhedron_is_topologically_closed (ppl_const_Polyhedron_t ph)
 Returns a positive integer if ph is topologically closed; returns 0 if ph is not topologically closed.
int ppl_Polyhedron_contains_Polyhedron (ppl_const_Polyhedron_t x, ppl_const_Polyhedron_t y)
 Returns a positive integer if x contains or is equal to y; returns 0 if it does not.
int ppl_Polyhedron_strictly_contains_Polyhedron (ppl_const_Polyhedron_t x, ppl_const_Polyhedron_t y)
 Returns a positive integer if x strictly contains y; returns 0 if it does not.
int ppl_Polyhedron_is_disjoint_from_Polyhedron (ppl_const_Polyhedron_t x, ppl_const_Polyhedron_t y)
 Returns a positive integer if x and y are disjoint; returns 0 if they are not.
int ppl_Polyhedron_equals_Polyhedron (ppl_const_Polyhedron_t x, ppl_const_Polyhedron_t y)
 Returns a positive integer if x and y are the same polyhedron; returns 0 if they are different.
int ppl_Polyhedron_OK (ppl_const_Polyhedron_t ph)
 Returns a positive integer if ph is well formed, i.e., if it satisfies all its implementation invariants; returns 0 and perhaps makes some noise if ph is broken. Useful for debugging purposes.
int ppl_Polyhedron_add_constraint (ppl_Polyhedron_t ph, ppl_const_Constraint_t c)
 Adds a copy of the constraint c to the system of constraints of ph.
int ppl_Polyhedron_add_constraint_and_minimize (ppl_Polyhedron_t ph, ppl_const_Constraint_t c)
 Adds a copy of the constraint c to the system of constraints of ph. Returns a positive integer if the resulting polyhedron is non-empty; returns 0 if it is empty. Upon successful return, ph is guaranteed to be minimized.
int ppl_Polyhedron_add_generator (ppl_Polyhedron_t ph, ppl_const_Generator_t g)
 Adds a copy of the generator g to the system of generators of ph.
int ppl_Polyhedron_add_generator_and_minimize (ppl_Polyhedron_t ph, ppl_const_Generator_t g)
 Adds a copy of the generator g to the system of generators of ph. Returns a positive integer if the resulting polyhedron is non-empty; returns 0 if it is empty. Upon successful return, ph is guaranteed to be minimized.
int ppl_Polyhedron_add_constraints (ppl_Polyhedron_t ph, ppl_const_Constraint_System_t cs)
 Adds a copy of the system of constraints cs to the system of constraints of ph.
int ppl_Polyhedron_add_constraints_and_minimize (ppl_Polyhedron_t ph, ppl_const_Constraint_System_t cs)
 Adds a copy of the system of constraints cs to the system of constraints of ph. Returns a positive integer if the resulting polyhedron is non-empty; returns 0 if it is empty. Upon successful return, ph is guaranteed to be minimized.
int ppl_Polyhedron_add_generators (ppl_Polyhedron_t ph, ppl_const_Generator_System_t gs)
 Adds a copy of the system of generators gs to the system of generators of ph.
int ppl_Polyhedron_add_generators_and_minimize (ppl_Polyhedron_t ph, ppl_const_Generator_System_t gs)
 Adds a copy of the system of generators gs to the system of generators of ph. Returns a positive integer if the resulting polyhedron is non-empty; returns 0 if it is empty. Upon successful return, ph is guaranteed to be minimized.
int ppl_Polyhedron_add_recycled_constraints (ppl_Polyhedron_t ph, ppl_Constraint_System_t cs)
 Adds the system of constraints cs to the system of constraints of ph.
int ppl_Polyhedron_add_recycled_constraints_and_minimize (ppl_Polyhedron_t ph, ppl_Constraint_System_t cs)
 Adds the system of constraints cs to the system of constraints of ph. Returns a positive integer if the resulting polyhedron is non-empty; returns 0 if it is empty. Upon successful return, ph is guaranteed to be minimized.
int ppl_Polyhedron_add_recycled_generators (ppl_Polyhedron_t ph, ppl_Generator_System_t gs)
 Adds the system of generators gs to the system of generators of ph.
int ppl_Polyhedron_add_recycled_generators_and_minimize (ppl_Polyhedron_t ph, ppl_Generator_System_t gs)
 Adds the system of generators gs to the system of generators of ph. Returns a positive integer if the resulting polyhedron is non-empty; returns 0 if it is empty. Upon successful return, ph is guaranteed to be minimized.
int ppl_Polyhedron_intersection_assign (ppl_Polyhedron_t x, ppl_const_Polyhedron_t y)
 Intersects x with polyhedron y and assigns the result to x.
int ppl_Polyhedron_intersection_assign_and_minimize (ppl_Polyhedron_t x, ppl_const_Polyhedron_t y)
 Intersects x with polyhedron y and assigns the result to x. Returns a positive integer if the resulting polyhedron is non-empty; returns 0 if it is empty. Upon successful return, x is also guaranteed to be minimized.
int ppl_Polyhedron_poly_hull_assign (ppl_Polyhedron_t x, ppl_const_Polyhedron_t y)
 Assigns to x the poly-hull of x and y.
int ppl_Polyhedron_poly_hull_assign_and_minimize (ppl_Polyhedron_t x, ppl_const_Polyhedron_t y)
 Assigns to x the poly-hull of x and y. Returns a positive integer if the resulting polyhedron is non-empty; returns 0 if it is empty. Upon successful return, x is also guaranteed to be minimized.
int ppl_Polyhedron_poly_difference_assign (ppl_Polyhedron_t x, ppl_const_Polyhedron_t y)
 Assigns to x the poly-difference of x and y.
int ppl_Polyhedron_affine_image (ppl_Polyhedron_t ph, ppl_dimension_type var, ppl_const_Linear_Expression_t le, ppl_const_Coefficient_t d)
 Transforms the polyhedron ph, assigning an affine expression to the specified variable.
int ppl_Polyhedron_affine_preimage (ppl_Polyhedron_t ph, ppl_dimension_type var, ppl_const_Linear_Expression_t le, ppl_const_Coefficient_t d)
 Transforms the polyhedron ph, substituting an affine expression to the specified variable.
int ppl_Polyhedron_bounded_affine_image (ppl_Polyhedron_t ph, ppl_dimension_type var, ppl_const_Linear_Expression_t lb, ppl_const_Linear_Expression_t ub, ppl_const_Coefficient_t d)
 Assigns to ph the image of ph with respect to the generalized affine transfer relation $\frac{\mathrm{lb}}{\mathrm{d}} \leq \mathrm{var}' \leq \frac{\mathrm{ub}}{\mathrm{d}}$.
int ppl_Polyhedron_bounded_affine_preimage (ppl_Polyhedron_t ph, ppl_dimension_type var, ppl_const_Linear_Expression_t lb, ppl_const_Linear_Expression_t ub, ppl_const_Coefficient_t d)
 Assigns to ph the preimage of ph with respect to the generalized affine transfer relation $\frac{\mathrm{lb}}{\mathrm{d}} \leq \mathrm{var}' \leq \frac{\mathrm{ub}}{\mathrm{d}}$.
int ppl_Polyhedron_generalized_affine_image (ppl_Polyhedron_t ph, ppl_dimension_type var, enum ppl_enum_Constraint_Type relsym, ppl_const_Linear_Expression_t le, ppl_const_Coefficient_t d)
 Assigns to ph the image of ph with respect to the generalized affine transfer relation $\mathrm{var}' \relsym \frac{\mathrm{le}}{\mathrm{d}}$, where $\mathord{\relsym}$ is the relation symbol encoded by relsym.
int ppl_Polyhedron_generalized_affine_preimage (ppl_Polyhedron_t ph, ppl_dimension_type var, enum ppl_enum_Constraint_Type relsym, ppl_const_Linear_Expression_t le, ppl_const_Coefficient_t d)
 Assigns to ph the preimage of ph with respect to the generalized affine transfer relation $\mathrm{var}' \relsym \frac{\mathrm{le}}{\mathrm{d}}$, where $\mathord{\relsym}$ is the relation symbol encoded by relsym.
int ppl_Polyhedron_generalized_affine_image_lhs_rhs (ppl_Polyhedron_t ph, ppl_const_Linear_Expression_t lhs, enum ppl_enum_Constraint_Type relsym, ppl_const_Linear_Expression_t rhs)
 Assigns to ph the image of ph with respect to the generalized affine transfer relation $\mathrm{lhs}' \relsym \mathrm{rhs}$, where $\mathord{\relsym}$ is the relation symbol encoded by relsym.
int ppl_Polyhedron_generalized_affine_preimage_lhs_rhs (ppl_Polyhedron_t ph, ppl_const_Linear_Expression_t lhs, enum ppl_enum_Constraint_Type relsym, ppl_const_Linear_Expression_t rhs)
 Assigns to ph the preimage of ph with respect to the generalized affine transfer relation $\mathrm{lhs}' \relsym \mathrm{rhs}$, where $\mathord{\relsym}$ is the relation symbol encoded by relsym.
int ppl_Polyhedron_time_elapse_assign (ppl_Polyhedron_t x, ppl_const_Polyhedron_t y)
 Assigns to x the time-elapse between the polyhedra x and y.
int ppl_Polyhedron_BHRZ03_widening_assign_with_tokens (ppl_Polyhedron_t x, ppl_const_Polyhedron_t y, unsigned *tp)
 If the polyhedron y is contained in (or equal to) the polyhedron x, assigns to x the BHRZ03-widening of x and y. If tp is not the null pointer, the widening with tokens delay technique is applied with *tp available tokens.
int ppl_Polyhedron_BHRZ03_widening_assign (ppl_Polyhedron_t x, ppl_const_Polyhedron_t y)
 If the polyhedron y is contained in (or equal to) the polyhedron x, assigns to x the BHRZ03-widening of x and y.
int ppl_Polyhedron_limited_BHRZ03_extrapolation_assign_with_tokens (ppl_Polyhedron_t x, ppl_const_Polyhedron_t y, ppl_const_Constraint_System_t cs, unsigned *tp)
 If the polyhedron y is contained in (or equal to) the polyhedron x, assigns to x the BHRZ03-widening of x and y intersected with the constraints in cs that are satisfied by all the points of x. If tp is not the null pointer, the widening with tokens delay technique is applied with *tp available tokens.
int ppl_Polyhedron_limited_BHRZ03_extrapolation_assign (ppl_Polyhedron_t x, ppl_const_Polyhedron_t y, ppl_const_Constraint_System_t cs)
 If the polyhedron y is contained in (or equal to) the polyhedron x, assigns to x the BHRZ03-widening of x and y intersected with the constraints in cs that are satisfied by all the points of x.
int ppl_Polyhedron_bounded_BHRZ03_extrapolation_assign_with_tokens (ppl_Polyhedron_t x, ppl_const_Polyhedron_t y, ppl_const_Constraint_System_t cs, unsigned *tp)
 If the polyhedron y is contained in (or equal to) the polyhedron x, assigns to x the BHRZ03-widening of x and y intersected with the constraints in cs that are satisfied by all the points of x, further intersected with all the constraints of the form $\pm v \leq r$ and $\pm v < r$, with $r \in \Qset$, that are satisfied by all the points of x. If tp is not the null pointer, the widening with tokens delay technique is applied with *tp available tokens.
int ppl_Polyhedron_bounded_BHRZ03_extrapolation_assign (ppl_Polyhedron_t x, ppl_const_Polyhedron_t y, ppl_const_Constraint_System_t cs)
 If the polyhedron y is contained in (or equal to) the polyhedron x, assigns to x the BHRZ03-widening of x and y intersected with the constraints in cs that are satisfied by all the points of x, further intersected with all the constraints of the form $\pm v \leq r$ and $\pm v < r$, with $r \in \Qset$, that are satisfied by all the points of x.
int ppl_Polyhedron_H79_widening_assign_with_tokens (ppl_Polyhedron_t x, ppl_const_Polyhedron_t y, unsigned *tp)
 If the polyhedron y is contained in (or equal to) the polyhedron x, assigns to x the H79-widening of x and y. If tp is not the null pointer, the widening with tokens delay technique is applied with *tp available tokens.
int ppl_Polyhedron_H79_widening_assign (ppl_Polyhedron_t x, ppl_const_Polyhedron_t y)
 If the polyhedron y is contained in (or equal to) the polyhedron x, assigns to x the H79-widening of x and y.
int ppl_Polyhedron_limited_H79_extrapolation_assign_with_tokens (ppl_Polyhedron_t x, ppl_const_Polyhedron_t y, ppl_const_Constraint_System_t cs, unsigned *tp)
 If the polyhedron y is contained in (or equal to) the polyhedron x, assigns to x the H79-widening of x and y intersected with the constraints in cs that are satisfied by all the points of x. If tp is not the null pointer, the widening with tokens delay technique is applied with *tp available tokens.
int ppl_Polyhedron_limited_H79_extrapolation_assign (ppl_Polyhedron_t x, ppl_const_Polyhedron_t y, ppl_const_Constraint_System_t cs)
 If the polyhedron y is contained in (or equal to) the polyhedron x, assigns to x the H79-widening of x and y intersected with the constraints in cs that are satisfied by all the points of x.
int ppl_Polyhedron_bounded_H79_extrapolation_assign_with_tokens (ppl_Polyhedron_t x, ppl_const_Polyhedron_t y, ppl_const_Constraint_System_t cs, unsigned *tp)
 If the polyhedron y is contained in (or equal to) the polyhedron x, assigns to x the H79-widening of x and y intersected with the constraints in cs that are satisfied by all the points of x, further intersected with all the constraints of the form $\pm v \leq r$ and $\pm v < r$, with $r \in \Qset$, that are satisfied by all the points of x. If tp is not the null pointer, the widening with tokens delay technique is applied with *tp available tokens.
int ppl_Polyhedron_bounded_H79_extrapolation_assign (ppl_Polyhedron_t x, ppl_const_Polyhedron_t y, ppl_const_Constraint_System_t cs)
 If the polyhedron y is contained in (or equal to) the polyhedron x, assigns to x the H79-widening of x and y intersected with the constraints in cs that are satisfied by all the points of x, further intersected with all the constraints of the form $\pm v \leq r$ and $\pm v < r$, with $r \in \Qset$, that are satisfied by all the points of x.
int ppl_Polyhedron_topological_closure_assign (ppl_Polyhedron_t ph)
 Assigns to ph its topological closure.
int ppl_Polyhedron_add_space_dimensions_and_embed (ppl_Polyhedron_t ph, ppl_dimension_type d)
 Adds d new dimensions to the space enclosing the polyhedron ph and to ph itself.
int ppl_Polyhedron_add_space_dimensions_and_project (ppl_Polyhedron_t ph, ppl_dimension_type d)
 Adds d new dimensions to the space enclosing the polyhedron ph.
int ppl_Polyhedron_concatenate_assign (ppl_Polyhedron_t x, ppl_const_Polyhedron_t y)
 Seeing a polyhedron as a set of tuples (its points), assigns to x all the tuples that can be obtained by concatenating, in the order given, a tuple of x with a tuple of y.
int ppl_Polyhedron_remove_space_dimensions (ppl_Polyhedron_t ph, ppl_dimension_type ds[], size_t n)
 Removes from the vector space enclosing ph the space dimensions that are specified in first n positions of the array ds. The presence of duplicates in ds is a waste but an innocuous one.
int ppl_Polyhedron_remove_higher_space_dimensions (ppl_Polyhedron_t ph, ppl_dimension_type d)
 Removes the higher dimensions from the vector space enclosing ph so that, upon successful return, the new space dimension is d.
int ppl_Polyhedron_map_space_dimensions (ppl_Polyhedron_t ph, ppl_dimension_type maps[], size_t n)
 Remaps the dimensions of the vector space according to a partial function. This function is specified by means of the maps array, which has n entries.
int ppl_Polyhedron_expand_space_dimension (ppl_Polyhedron_t ph, ppl_dimension_type d, ppl_dimension_type m)
 Expands the $d$-th dimension of the vector space enclosing ph to m new space dimensions.
int ppl_Polyhedron_fold_space_dimensions (ppl_Polyhedron_t ph, ppl_dimension_type ds[], size_t n, ppl_dimension_type d)
 Modifies ph by folding the space dimensions contained in the first n positions of the array ds into dimension d. The presence of duplicates in ds is a waste but an innocuous one.

Functions Related to LP Problems

int ppl_new_LP_Problem_trivial (ppl_LP_Problem_t *plp)
 Builds a trivial LP problem and writes a handle to it at address plp.
int ppl_new_LP_Problem (ppl_LP_Problem_t *plp, ppl_const_Constraint_System_t cs, ppl_const_Linear_Expression_t le, int m)
 Builds an LP problem having feasible region cs, objective function le and optimization mode m; writes a handle to it at address plp.
int ppl_new_LP_Problem_from_LP_Problem (ppl_LP_Problem_t *plp, ppl_const_LP_Problem_t lp)
 Builds an LP problem that is a copy of lp; writes a handle for the newly created system at address plp.
int ppl_delete_LP_Problem (ppl_const_LP_Problem_t lp)
 Invalidates the handle lp: this makes sure the corresponding resources will eventually be released.
int ppl_assign_LP_Problem_from_LP_Problem (ppl_LP_Problem_t dst, ppl_const_LP_Problem_t src)
 Assigns a copy of the LP problem src to dst.
int ppl_LP_Problem_space_dimension (ppl_const_LP_Problem_t lp, ppl_dimension_type *m)
 Writes to m the dimension of the vector space enclosing lp.
int ppl_LP_Problem_constraints (ppl_const_LP_Problem_t lp, ppl_const_Constraint_System_t *pcs)
 Writes a const handle to the constraint system defining the feasible region of the LP problem lp at address pcs.
int ppl_LP_Problem_objective_function (ppl_const_LP_Problem_t lp, ppl_const_Linear_Expression_t *ple)
 Writes a const handle to the linear expression defining the objective function of the LP problem lp at address ple.
int ppl_LP_Problem_optimization_mode (ppl_const_LP_Problem_t lp)
 Returns the optimization mode of the LP problem lp.
int ppl_LP_Problem_clear (ppl_LP_Problem_t lp)
 Resets the LP problem to be a trivial problem of space dimension 0.
int ppl_LP_Problem_add_constraint (ppl_LP_Problem_t lp, ppl_const_Constraint_t c)
 Modifies the feasible region of the LP problem lp by adding a copy of the constraint c; the space dimension is increased, if necessary.
int ppl_LP_Problem_add_constraints (ppl_LP_Problem_t lp, ppl_const_Constraint_System_t cs)
 Modifies the feasible region of the LP problem lp by adding a copy of the constraints in cs; the space dimension is increased, if necessary.
int ppl_LP_Problem_set_objective_function (ppl_LP_Problem_t lp, ppl_const_Linear_Expression_t le)
 Sets the objective function of the LP problem lp to a copy of le.
int ppl_LP_Problem_set_optimization_mode (ppl_LP_Problem_t lp, int mode)
 Sets the optimization mode of the LP problem lp to mode.
int ppl_LP_Problem_is_satisfiable (ppl_const_LP_Problem_t lp)
 Returns a positive integer if lp is satisfiable; returns 0 otherwise.
int ppl_LP_Problem_solve (ppl_const_LP_Problem_t lp)
 Solves the LP problem lp, returning an exit status.
int ppl_LP_Problem_evaluate_objective_function (ppl_const_LP_Problem_t lp, ppl_const_Generator_t g, ppl_Coefficient_t num, ppl_Coefficient_t den)
 Evaluates the objective function of lp on point g.
int ppl_LP_Problem_feasible_point (ppl_const_LP_Problem_t lp, ppl_const_Generator_t *pg)
 Writes a const handle to a feasible point for the LP problem lp at address pg.
int ppl_LP_Problem_optimizing_point (ppl_const_LP_Problem_t lp, ppl_const_Generator_t *pg)
 Writes a const handle to an optimizing point for the LP problem lp at address pg.
int ppl_LP_Problem_optimal_value (ppl_const_LP_Problem_t lp, ppl_Coefficient_t num, ppl_Coefficient_t den)
 Returns the optimal value for lp.
int ppl_LP_Problem_OK (ppl_const_LP_Problem_t lp)
 Returns a positive integer if lp is well formed, i.e., if it satisfies all its implementation invariants; returns 0 and perhaps makes some noise if lp is broken. Useful for debugging purposes.

Typedefs

typedef size_t ppl_dimension_type
 An unsigned integral type for representing space dimensions.
typedef ppl_Coefficient_tag * ppl_Coefficient_t
 Opaque pointer.
typedef ppl_Coefficient_tag
const * 
ppl_const_Coefficient_t
 Opaque pointer to const object.
typedef ppl_Linear_Expression_tag * ppl_Linear_Expression_t
 Opaque pointer.
typedef ppl_Linear_Expression_tag
const * 
ppl_const_Linear_Expression_t
 Opaque pointer to const object.
typedef ppl_Constraint_tag * ppl_Constraint_t
 Opaque pointer.
typedef ppl_Constraint_tag
const * 
ppl_const_Constraint_t
 Opaque pointer to const object.
typedef ppl_Constraint_System_tag * ppl_Constraint_System_t
 Opaque pointer.
typedef ppl_Constraint_System_tag
const * 
ppl_const_Constraint_System_t
 Opaque pointer to const object.
typedef ppl_Constraint_System_const_iterator_tag * ppl_Constraint_System_const_iterator_t
 Opaque pointer.
typedef ppl_Constraint_System_const_iterator_tag
const * 
ppl_const_Constraint_System_const_iterator_t
 Opaque pointer to const object.
typedef ppl_Generator_tag * ppl_Generator_t
 Opaque pointer.
typedef ppl_Generator_tag
const * 
ppl_const_Generator_t
 Opaque pointer to const object.
typedef ppl_Generator_System_tag * ppl_Generator_System_t
 Opaque pointer.
typedef ppl_Generator_System_tag
const * 
ppl_const_Generator_System_t
 Opaque pointer to const object.
typedef ppl_Generator_System_const_iterator_tag * ppl_Generator_System_const_iterator_t
 Opaque pointer.
typedef ppl_Generator_System_const_iterator_tag
const * 
ppl_const_Generator_System_const_iterator_t
 Opaque pointer to const object.
typedef ppl_Polyhedron_tag * ppl_Polyhedron_t
 Opaque pointer.
typedef ppl_Polyhedron_tag
const * 
ppl_const_Polyhedron_t
 Opaque pointer to const object.
typedef ppl_LP_Problem_tag * ppl_LP_Problem_t
 Opaque pointer.
typedef ppl_LP_Problem_tag
const * 
ppl_const_LP_Problem_t
 Opaque pointer to const object.

Enumerations

enum  ppl_enum_error_code {
  PPL_ERROR_OUT_OF_MEMORY, PPL_ERROR_INVALID_ARGUMENT, PPL_ERROR_DOMAIN_ERROR, PPL_ERROR_LENGTH_ERROR,
  PPL_ARITHMETIC_OVERFLOW, PPL_STDIO_ERROR, PPL_ERROR_INTERNAL_ERROR, PPL_ERROR_UNKNOWN_STANDARD_EXCEPTION,
  PPL_ERROR_UNEXPECTED_ERROR
}
 Defines the error codes that any function may return. More...
enum  ppl_enum_Constraint_Type {
  PPL_CONSTRAINT_TYPE_LESS_THAN, PPL_CONSTRAINT_TYPE_LESS_THAN_OR_EQUAL, PPL_CONSTRAINT_TYPE_EQUAL, PPL_CONSTRAINT_TYPE_GREATER_THAN_OR_EQUAL,
  PPL_CONSTRAINT_TYPE_GREATER_THAN
}
 Describes the relations represented by a constraint. More...
enum  ppl_enum_Generator_Type { PPL_GENERATOR_TYPE_LINE, PPL_GENERATOR_TYPE_RAY, PPL_GENERATOR_TYPE_POINT, PPL_GENERATOR_TYPE_CLOSURE_POINT }
 Describes the different kinds of generators. More...

Variables

unsigned int PPL_COMPLEXITY_CLASS_POLYNOMIAL
 Code of the worst-case polynomial complexity class.
unsigned int PPL_COMPLEXITY_CLASS_SIMPLEX
 Code of the worst-case exponential but typically polynomial complexity class.
unsigned int PPL_COMPLEXITY_CLASS_ANY
 Code of the universal complexity class.
int PPL_LP_PROBLEM_STATUS_UNFEASIBLE
 Code of the "unfeasible LP problem" status.
int PPL_LP_PROBLEM_STATUS_UNBOUNDED
 Code of the "unbounded LP problem" status.
int PPL_LP_PROBLEM_STATUS_OPTIMIZED
 Code of the "optimized LP problem" status.
int PPL_LP_PROBLEM_MAXIMIZATION
 Code of the "maximization" optimization mode.
int PPL_LP_PROBLEM_MINIMIZATION
 Code of the "minimization" optimization mode.
unsigned int PPL_POLY_CON_RELATION_IS_DISJOINT
 Individual bit saying that the polyhedron and the set of points satisfying the constraint are disjoint.
unsigned int PPL_POLY_CON_RELATION_STRICTLY_INTERSECTS
 Individual bit saying that the polyhedron intersects the set of points satisfying the constraint, but it is not included in it.
unsigned int PPL_POLY_CON_RELATION_IS_INCLUDED
 Individual bit saying that the polyhedron is included in the set of points satisfying the constraint.
unsigned int PPL_POLY_CON_RELATION_SATURATES
 Individual bit saying that the polyhedron is included in the set of points saturating the constraint.
unsigned int PPL_POLY_GEN_RELATION_SUBSUMES
 Individual bit saying that adding the generator would not change the polyhedron.

Detailed Description

Some details about the C Interface.

All the declarations needed for using the PPL's C interface (preprocessor symbols, data types, variables and functions) are collected in the header file ppl_c.h. This file, which is designed to work with pre-ANSI and ANSI C compilers as well as C99 and C++ compilers, should be included, either directly or via some other header file, with the directive

#include <ppl_c.h>
If this directive does not work, then your compiler is unable to find the file ppl_c.h. So check that the library is installed (if it is not installed, you may want to make install, perhaps with root privileges) in the right place (if not you may want to reconfigure the library using the appropriate pathname for the --prefix option); and that your compiler knows where it is installed (if not you should add the path to the directory where ppl_c.h is located to the compiler's include file search path; this is usually done with the -I option).

The name space of the PPL's C interface is PPL_* for preprocessor symbols, enumeration values and variables; and ppl_* for data types and function names. The interface systematically uses opaque data types (generic pointers that completely hide the internal representations from the client code) and provides all required access functions. By using just the interface, the client code can exploit all the functionalities of the library yet avoid directly manipulating the library's data structures. The advantages are that (1) applications do not depend on the internals of the library (these may change from release to release), and (2) the interface invariants can be thoroughly checked (by the access functions).

The PPL's C interface is initialized by means of the ppl_initialize function. This function must be called before using any other interface of the library. The application can release the resources allocated by the library by calling the ppl_finalize function. After this function is called no other interface of the library may be used until the interface is re-initialized using ppl_initialize.

Any application using the PPL should make sure that only the intended version(s) of the library are ever used. The version used can be checked at compile-time thanks to the macros PPL_VERSION_MAJOR, PPL_VERSION_MINOR, PPL_VERSION_REVISION and PPL_VERSION_BETA, which give, respectively major, minor, revision and beta numbers of the PPL version. This is an example of their use:

#if PPL_VERSION_MAJOR == 0 && PPL_VERSION_MINOR < 6
# error "PPL version 0.6 or following is required"
#endif
Compile-time checking, however, is not normally enough, particularly in an environment where there is dynamic linking. Run-time checking can be performed by means of the functions ppl_version_major, ppl_version_minor, ppl_version_revision, and ppl_version_beta. The PPL's C interface also provides functions ppl_version, returning character string containing the full version number, and ppl_banner, returning a string that, in addition, provides (pointers to) other useful information for the library user.

All programs using the PPL's C interface must link with the following libraries: libppl_c (PPL's C interface), libppl (PPL's core), libgmpxx (GMP's C++ interface), and libgmp (GMP's library core). On most Unix-like systems, this is done by adding -lppl_c, -lppl, -lgmpxx, and -lgmp to the compiler's or linker's command line. For example:

gcc myprogram.o -lppl_c -lppl -lgmpxx -lgmp
If this does not work, it means that your compiler/linker is not finding the libraries where it expects. Again, this could be because you forgot to install the library or you installed it in a non-standard location. In the latter case you will need to use the appropriate options (usually -L) and, if you use shared libraries, some sort of run-time path selection mechanisms. Consult your compiler's documentation for details. Notice that the PPL is built using Libtool and an application can exploit this fact to significantly simplify the linking phase. See Libtool's documentation for details. Those working under Linux can find a lot of useful information on how to use program libraries (including static, shared, and dynamically loaded libraries) in the Program Library HOWTO.

For examples on how to use the functions provided by the C interface, you are referred to the directory demos/ppl_lpsol/ in the source distribution. It contains a Linear Programming solver written in C. In order to use this solver you will need to install GLPK (the GNU Linear Programming Kit): this is used to read linear programs in MPS format.


Define Documentation

#define PPL_VERSION   "0.9"

A string containing the PPL version.

Let M and m denote the numbers associated to PPL_VERSION_MAJOR and PPL_VERSION_MINOR, respectively. The format of PPL_VERSION is M "." m if both PPL_VERSION_REVISION (r) and PPL_VERSION_BETA (b)are zero, M "." m "pre" b if PPL_VERSION_REVISION is zero and PPL_VERSION_BETA is not zero, M "." m "." r if PPL_VERSION_REVISION is not zero and PPL_VERSION_BETA is zero, M "." m "." r "pre" b if neither PPL_VERSION_REVISION nor PPL_VERSION_BETA are zero.


Typedef Documentation

typedef const char* ppl_io_variable_output_function_type(ppl_dimension_type var)

The type of output functions used for printing variables.

An output function for variables must write a textual representation for var to a character buffer, null-terminate it, and return a pointer to the beginning of the buffer. In case the operation fails, 0 should be returned and perhaps errno should be set in a meaningful way. The library does nothing with the buffer, besides printing its contents.


Enumeration Type Documentation

enum ppl_enum_error_code

Defines the error codes that any function may return.

Enumerator:
PPL_ERROR_OUT_OF_MEMORY  The virtual memory available to the process has been exhausted.
PPL_ERROR_INVALID_ARGUMENT  A function has been invoked with an invalid argument.
PPL_ERROR_DOMAIN_ERROR  A function has been invoked outside its domain of definition.
PPL_ERROR_LENGTH_ERROR  The construction of an object that would exceed its maximum permitted size was attempted.
PPL_ARITHMETIC_OVERFLOW  An arithmetic overflow occurred and the computation was consequently interrupted. This can only happen in library's incarnations using bounded integers as coefficients.
PPL_STDIO_ERROR  An error occurred during a C input/output operation. A more precise indication of what went wrong is available via errno.
PPL_ERROR_INTERNAL_ERROR  An internal error that was diagnosed by the PPL itself. This indicates a bug in the PPL.
PPL_ERROR_UNKNOWN_STANDARD_EXCEPTION  A standard exception has been raised by the C++ run-time environment. This indicates a bug in the PPL.
PPL_ERROR_UNEXPECTED_ERROR  A totally unknown, totally unexpected error happened. This indicates a bug in the PPL.

enum ppl_enum_Constraint_Type

Describes the relations represented by a constraint.

Enumerator:
PPL_CONSTRAINT_TYPE_LESS_THAN  The constraint is of the form $e < 0$.
PPL_CONSTRAINT_TYPE_LESS_THAN_OR_EQUAL  The constraint is of the form $e \leq 0$.
PPL_CONSTRAINT_TYPE_EQUAL  The constraint is of the form $e = 0$.
PPL_CONSTRAINT_TYPE_GREATER_THAN_OR_EQUAL  The constraint is of the form $e \geq 0$.
PPL_CONSTRAINT_TYPE_GREATER_THAN  The constraint is of the form $e > 0$.

enum ppl_enum_Generator_Type

Describes the different kinds of generators.

Enumerator:
PPL_GENERATOR_TYPE_LINE  The generator is a line.
PPL_GENERATOR_TYPE_RAY  The generator is a ray.
PPL_GENERATOR_TYPE_POINT  The generator is a point.
PPL_GENERATOR_TYPE_CLOSURE_POINT  The generator is a closure point.


Function Documentation

int ppl_banner ( const char **  p  ) 

Writes to *p a pointer to a character string containing the PPL banner.

The banner provides information about the PPL version, the licensing, the lack of any warranty whatsoever, the C++ compiler used to build the library, where to report bugs and where to look for further information.

int ppl_initialize ( void   ) 

Initializes the Parma Polyhedra Library. This function must be called before any other function.

Returns:
PPL_ERROR_INVALID_ARGUMENT if the library was already initialized.

int ppl_finalize ( void   ) 

Finalizes the Parma Polyhedra Library. This function must be called after any other function.

Returns:
PPL_ERROR_INVALID_ARGUMENT if the library was already finalized.

int ppl_set_error_handler ( void(*)(enum ppl_enum_error_code code, const char *description)  h  ) 

Installs the user-defined error handler pointed at by h.

The error handler takes an error code and a textual description that gives further information about the actual error. The C string containing the textual description is read-only and its existence is not guaranteed after the handler has returned.

int ppl_new_C_Polyhedron_from_Constraint_System ( ppl_Polyhedron_t pph,
ppl_const_Constraint_System_t  cs 
)

Builds a new C polyhedron from the system of constraints cs and writes a handle for the newly created polyhedron at address pph.

The new polyhedron will inherit the space dimension of cs.

int ppl_new_C_Polyhedron_recycle_Constraint_System ( ppl_Polyhedron_t pph,
ppl_Constraint_System_t  cs 
)

Builds a new C polyhedron recycling the system of constraints cs and writes a handle for the newly created polyhedron at address pph.

Since cs will be the system of constraints of the new polyhedron, the space dimension is also inherited.

Warning:
This function modifies the constraint system referenced by cs: upon return, no assumption can be made on its value.

int ppl_new_NNC_Polyhedron_from_Constraint_System ( ppl_Polyhedron_t pph,
ppl_const_Constraint_System_t  cs 
)

Builds a new NNC polyhedron from the system of constraints cs and writes a handle for the newly created polyhedron at address pph.

The new polyhedron will inherit the space dimension of cs.

int ppl_new_NNC_Polyhedron_recycle_Constraint_System ( ppl_Polyhedron_t pph,
ppl_Constraint_System_t  cs 
)

Builds a new NNC polyhedron recycling the system of constraints cs and writes a handle for the newly created polyhedron at address pph.

Since cs will be the system of constraints of the new polyhedron, the space dimension is also inherited.

Warning:
This function modifies the constraint system referenced by cs: upon return, no assumption can be made on its value.

int ppl_new_C_Polyhedron_from_Generator_System ( ppl_Polyhedron_t pph,
ppl_const_Generator_System_t  gs 
)

Builds a new C polyhedron from the system of generators gs and writes a handle for the newly created polyhedron at address pph.

The new polyhedron will inherit the space dimension of gs.

int ppl_new_C_Polyhedron_recycle_Generator_System ( ppl_Polyhedron_t pph,
ppl_Generator_System_t  gs 
)

Builds a new C polyhedron recycling the system of generators gs and writes a handle for the newly created polyhedron at address pph.

Since gs will be the system of generators of the new polyhedron, the space dimension is also inherited.

Warning:
This function modifies the generator system referenced by gs: upon return, no assumption can be made on its value.

int ppl_new_NNC_Polyhedron_from_Generator_System ( ppl_Polyhedron_t pph,
ppl_const_Generator_System_t  gs 
)

Builds a new NNC polyhedron from the system of generators gs and writes a handle for the newly created polyhedron at address pph.

The new polyhedron will inherit the space dimension of gs.

int ppl_new_NNC_Polyhedron_recycle_Generator_System ( ppl_Polyhedron_t pph,
ppl_Generator_System_t  gs 
)

Builds a new NNC polyhedron recycling the system of generators gs and writes a handle for the newly created polyhedron at address pph.

Since gs will be the system of generators of the new polyhedron, the space dimension is also inherited.

Warning:
This function modifies the generator system referenced by gs: upon return, no assumption can be made on its value.

int ppl_new_C_Polyhedron_from_bounding_box ( ppl_Polyhedron_t pph,
ppl_dimension_type(*)(void)  space_dimension,
int(*)(void)  is_empty,
int(*)(ppl_dimension_type k, int closed, ppl_Coefficient_t n, ppl_Coefficient_t d)  get_lower_bound,
int(*)(ppl_dimension_type k, int closed, ppl_Coefficient_t n, ppl_Coefficient_t d)  get_upper_bound 
)

Builds a new C polyhedron corresponding to an interval-based bounding box, writing a handle for the newly created polyhedron at address pph.

If an interval of the bounding box is provided with any finite but open bound, then the polyhedron is not built and the value PPL_ERROR_INVALID_ARGUMENT is returned. The bounding box is accessed by using the following functions, passed as arguments:

      ppl_dimension_type space_dimension()
returns the dimension of the vector space enclosing the polyhedron represented by the bounding box.
      int is_empty()
returns 0 if and only if the bounding box describes a non-empty set. The function is_empty() will always be called before the other functions. However, if is_empty() does not return 0, none of the functions below will be called.
      int get_lower_bound(ppl_dimension_type k, int closed,
                          ppl_Coefficient_t n, ppl_Coefficient_t d)
Let $I$ the interval corresponding to the k-th space dimension. If $I$ is not bounded from below, simply return 0. Otherwise, set closed, n and d as follows: closed is set to 0 if the lower boundary of $I$ is open and is set to a value different from zero otherwise; n and d are assigned the integers $n$ and $d$ such that the canonical fraction $n/d$ corresponds to the greatest lower bound of $I$. The fraction $n/d$ is in canonical form if and only if $n$ and $d$ have no common factors and $d$ is positive, $0/1$ being the unique representation for zero.
      int get_upper_bound(ppl_dimension_type k, int closed,
                          ppl_Coefficient_t n, ppl_Coefficient_t d)
Let $I$ the interval corresponding to the k-th space dimension. If $I$ is not bounded from above, simply return 0. Otherwise, set closed, n and d as follows: closed is set to 0 if the upper boundary of $I$ is open and is set to a value different from 0 otherwise; n and d are assigned the integers $n$ and $d$ such that the canonical fraction $n/d$ corresponds to the least upper bound of $I$.

int ppl_new_NNC_Polyhedron_from_bounding_box ( ppl_Polyhedron_t pph,
ppl_dimension_type(*)(void)  space_dimension,
int(*)(void)  is_empty,
int(*)(ppl_dimension_type k, int closed, ppl_Coefficient_t n, ppl_Coefficient_t d)  get_lower_bound,
int(*)(ppl_dimension_type k, int closed, ppl_Coefficient_t n, ppl_Coefficient_t d)  get_upper_bound 
)

Builds a new NNC polyhedron corresponding to an interval-based bounding box, writing a handle for the newly created polyhedron at address pph.

The bounding box is accessed by using the following functions, passed as arguments:

      ppl_dimension_type space_dimension()
returns the dimension of the vector space enclosing the polyhedron represented by the bounding box.
      int is_empty()
returns 0 if and only if the bounding box describes a non-empty set. The function is_empty() will always be called before the other functions. However, if is_empty() does not return 0, none of the functions below will be called.
      int get_lower_bound(ppl_dimension_type k, int closed,
                          ppl_Coefficient_t n, ppl_Coefficient_t d)
Let $I$ the interval corresponding to the k-th space dimension. If $I$ is not bounded from below, simply return 0. Otherwise, set closed, n and d as follows: closed is set to 0 if the lower boundary of $I$ is open and is set to a value different from zero otherwise; n and d are assigned the integers $n$ and $d$ such that the canonical fraction $n/d$ corresponds to the greatest lower bound of $I$. The fraction $n/d$ is in canonical form if and only if $n$ and $d$ have no common factors and $d$ is positive, $0/1$ being the unique representation for zero.
      int get_upper_bound(ppl_dimension_type k, int closed,
                          ppl_Coefficient_t n, ppl_Coefficient_t d)
Let $I$ the interval corresponding to the k-th space dimension. If $I$ is not bounded from above, simply return 0. Otherwise, set closed, n and d as follows: closed is set to 0 if the upper boundary of $I$ is open and is set to a value different from 0 otherwise; n and d are assigned the integers $n$ and $d$ such that the canonical fraction $n/d$ corresponds to the least upper bound of $I$.

int ppl_Polyhedron_relation_with_Constraint ( ppl_const_Polyhedron_t  ph,
ppl_const_Constraint_t  c 
)

Checks the relation between the polyhedron ph and the constraint c.

If successful, returns a non-negative integer that is obtained as the bitwise or of the bits (chosen among PPL_POLY_CON_RELATION_IS_DISJOINT PPL_POLY_CON_RELATION_STRICTLY_INTERSECTS, PPL_POLY_CON_RELATION_IS_INCLUDED, and PPL_POLY_CON_RELATION_SATURATES) that describe the relation between ph and c.

int ppl_Polyhedron_relation_with_Generator ( ppl_const_Polyhedron_t  ph,
ppl_const_Generator_t  g 
)

Checks the relation between the polyhedron ph and the generator g.

If successful, returns a non-negative integer that is obtained as the bitwise or of the bits (only PPL_POLY_GEN_RELATION_SUBSUMES, at present) that describe the relation between ph and g.

int ppl_Polyhedron_shrink_bounding_box ( ppl_const_Polyhedron_t  ph,
unsigned int  complexity,
void(*)(void)  set_empty,
void(*)(ppl_dimension_type k, int closed, ppl_const_Coefficient_t n, ppl_const_Coefficient_t d)  raise_lower_bound,
void(*)(ppl_dimension_type k, int closed, ppl_const_Coefficient_t n, ppl_const_Coefficient_t d)  lower_upper_bound 
)

Use ph to shrink a generic, interval-based bounding box. The bounding box is abstractly provided by means of the parameters.

Parameters:
ph The polyhedron that is used to shrink the bounding box;
complexity The code of the complexity class of the algorithm to be used. Must be one of PPL_COMPLEXITY_CLASS_POLYNOMIAL, PPL_COMPLEXITY_CLASS_SIMPLEX, or PPL_COMPLEXITY_CLASS_ANY;
set_empty A pointer to a void function with no arguments that causes the bounding box to become empty, i.e., to represent the empty set;
raise_lower_bound A pointer to a void function with arguments (ppl_dimension_type k, int closed, ppl_const_Coefficient_t n, ppl_const_Coefficient_t d) that intersects the interval corresponding to the k-th space dimension with $[n/d, +\infty)$ if closed is non-zero, with $(n/d, +\infty)$ if closed is zero. The fraction $n/d$ is in canonical form, that is, $n$ and $d$ have no common factors and $d$ is positive, $0/1$ being the unique representation for zero;
lower_upper_bound a pointer to a void function with argument (ppl_dimension_type k, int closed, ppl_const_Coefficient_t n, ppl_const_Coefficient_t d) that intersects the interval corresponding to the k-th space dimension with $(-\infty, n/d]$ if closed is non-zero, with $(-\infty, n/d)$ if closed is zero. The fraction $n/d$ is in canonical form.

int ppl_Polyhedron_maximize ( ppl_const_Polyhedron_t  ph,
ppl_const_Linear_Expression_t  le,
ppl_Coefficient_t  sup_n,
ppl_Coefficient_t  sup_d,
int *  pmaximum,
ppl_Generator_t  point 
)

Returns a positive integer if ph is not empty and le is bounded from above in ph, in which case the supremum value and a point where le reaches it are computed.

Parameters:
ph The polyhedron constraining le;
le The linear expression to be maximized subject to ph;
sup_n Will be assigned the numerator of the supremum value;
sup_d Will be assigned the denominator of the supremum value;
pmaximum Will store 1 in this location if the supremum is also the maximum, will store 0 otherwise;
point Will be assigned the point or closure point where le reaches the extremum value.
If ph is empty or le is not bounded from above, 0 will be returned and sup_n, sup_d, *pmaximum and point will be left untouched.

int ppl_Polyhedron_minimize ( ppl_const_Polyhedron_t  ph,
ppl_const_Linear_Expression_t  le,
ppl_Coefficient_t  inf_n,
ppl_Coefficient_t  inf_d,
int *  pminimum,
ppl_Generator_t  point 
)

Returns a positive integer if ph is not empty and le is bounded from below in ph, in which case the infimum value and a point where le reaches it are computed.

Parameters:
ph The polyhedron constraining le;
le The linear expression to be minimized subject to ph;
inf_n Will be assigned the numerator of the infimum value;
inf_d Will be assigned the denominator of the infimum value;
pminimum Will store 1 in this location if the infimum is also the minimum, will store 0 otherwise;
point Will be assigned the point or closure point where le reaches the extremum value.
If ph is empty or le is not bounded from below, 0 will be returned and sup_n, sup_d, *pmaximum and point will be left untouched.

int ppl_Polyhedron_equals_Polyhedron ( ppl_const_Polyhedron_t  x,
ppl_const_Polyhedron_t  y 
)

Returns a positive integer if x and y are the same polyhedron; returns 0 if they are different.

Note that x and y may be topology- and/or dimension-incompatible polyhedra: in those cases, the value 0 is returned.

int ppl_Polyhedron_add_recycled_constraints ( ppl_Polyhedron_t  ph,
ppl_Constraint_System_t  cs 
)

Adds the system of constraints cs to the system of constraints of ph.

Warning:
This function modifies the constraint system referenced by cs: upon return, no assumption can be made on its value.

int ppl_Polyhedron_add_recycled_constraints_and_minimize ( ppl_Polyhedron_t  ph,
ppl_Constraint_System_t  cs 
)

Adds the system of constraints cs to the system of constraints of ph. Returns a positive integer if the resulting polyhedron is non-empty; returns 0 if it is empty. Upon successful return, ph is guaranteed to be minimized.

Warning:
This function modifies the constraint system referenced by cs: upon return, no assumption can be made on its value.

int ppl_Polyhedron_add_recycled_generators ( ppl_Polyhedron_t  ph,
ppl_Generator_System_t  gs 
)

Adds the system of generators gs to the system of generators of ph.

Warning:
This function modifies the generator system referenced by gs: upon return, no assumption can be made on its value.

int ppl_Polyhedron_add_recycled_generators_and_minimize ( ppl_Polyhedron_t  ph,
ppl_Generator_System_t  gs 
)

Adds the system of generators gs to the system of generators of ph. Returns a positive integer if the resulting polyhedron is non-empty; returns 0 if it is empty. Upon successful return, ph is guaranteed to be minimized.

Warning:
This function modifies the generator system referenced by gs: upon return, no assumption can be made on its value.

int ppl_Polyhedron_affine_image ( ppl_Polyhedron_t  ph,
ppl_dimension_type  var,
ppl_const_Linear_Expression_t  le,
ppl_const_Coefficient_t  d 
)

Transforms the polyhedron ph, assigning an affine expression to the specified variable.

Parameters:
ph The polyhedron that is transformed;
var The variable to which the affine expression is assigned;
le The numerator of the affine expression;
d The denominator of the affine expression.

int ppl_Polyhedron_affine_preimage ( ppl_Polyhedron_t  ph,
ppl_dimension_type  var,
ppl_const_Linear_Expression_t  le,
ppl_const_Coefficient_t  d 
)

Transforms the polyhedron ph, substituting an affine expression to the specified variable.

Parameters:
ph The polyhedron that is transformed;
var The variable to which the affine expression is substituted;
le The numerator of the affine expression;
d The denominator of the affine expression.

int ppl_Polyhedron_bounded_affine_image ( ppl_Polyhedron_t  ph,
ppl_dimension_type  var,
ppl_const_Linear_Expression_t  lb,
ppl_const_Linear_Expression_t  ub,
ppl_const_Coefficient_t  d 
)

Assigns to ph the image of ph with respect to the generalized affine transfer relation $\frac{\mathrm{lb}}{\mathrm{d}} \leq \mathrm{var}' \leq \frac{\mathrm{ub}}{\mathrm{d}}$.

Parameters:
ph The polyhedron that is transformed;
var The variable bounded by the generalized affine transfer relation;
lb The numerator of the lower bounding affine expression;
ub The numerator of the upper bounding affine expression;
d The (common) denominator of the lower and upper bounding affine expressions.

int ppl_Polyhedron_bounded_affine_preimage ( ppl_Polyhedron_t  ph,
ppl_dimension_type  var,
ppl_const_Linear_Expression_t  lb,
ppl_const_Linear_Expression_t  ub,
ppl_const_Coefficient_t  d 
)

Assigns to ph the preimage of ph with respect to the generalized affine transfer relation $\frac{\mathrm{lb}}{\mathrm{d}} \leq \mathrm{var}' \leq \frac{\mathrm{ub}}{\mathrm{d}}$.

Parameters:
ph The polyhedron that is transformed;
var The variable bounded by the generalized affine transfer relation;
lb The numerator of the lower bounding affine expression;
ub The numerator of the upper bounding affine expression;
d The (common) denominator of the lower and upper bounding affine expressions.

int ppl_Polyhedron_generalized_affine_image ( ppl_Polyhedron_t  ph,
ppl_dimension_type  var,
enum ppl_enum_Constraint_Type  relsym,
ppl_const_Linear_Expression_t  le,
ppl_const_Coefficient_t  d 
)

Assigns to ph the image of ph with respect to the generalized affine transfer relation $\mathrm{var}' \relsym \frac{\mathrm{le}}{\mathrm{d}}$, where $\mathord{\relsym}$ is the relation symbol encoded by relsym.

Parameters:
ph The polyhedron that is transformed;
var The left hand side variable of the generalized affine transfer relation;
relsym The relation symbol;
le The numerator of the right hand side affine expression;
d The denominator of the right hand side affine expression.

int ppl_Polyhedron_generalized_affine_preimage ( ppl_Polyhedron_t  ph,
ppl_dimension_type  var,
enum ppl_enum_Constraint_Type  relsym,
ppl_const_Linear_Expression_t  le,
ppl_const_Coefficient_t  d 
)

Assigns to ph the preimage of ph with respect to the generalized affine transfer relation $\mathrm{var}' \relsym \frac{\mathrm{le}}{\mathrm{d}}$, where $\mathord{\relsym}$ is the relation symbol encoded by relsym.

Parameters:
ph The polyhedron that is transformed;
var The left hand side variable of the generalized affine transfer relation;
relsym The relation symbol;
le The numerator of the right hand side affine expression;
d The denominator of the right hand side affine expression.

int ppl_Polyhedron_generalized_affine_image_lhs_rhs ( ppl_Polyhedron_t  ph,
ppl_const_Linear_Expression_t  lhs,
enum ppl_enum_Constraint_Type  relsym,
ppl_const_Linear_Expression_t  rhs 
)

Assigns to ph the image of ph with respect to the generalized affine transfer relation $\mathrm{lhs}' \relsym \mathrm{rhs}$, where $\mathord{\relsym}$ is the relation symbol encoded by relsym.

Parameters:
ph The polyhedron that is transformed;
lhs The left hand side affine expression;
relsym The relation symbol;
rhs The right hand side affine expression.

int ppl_Polyhedron_generalized_affine_preimage_lhs_rhs ( ppl_Polyhedron_t  ph,
ppl_const_Linear_Expression_t  lhs,
enum ppl_enum_Constraint_Type  relsym,
ppl_const_Linear_Expression_t  rhs 
)

Assigns to ph the preimage of ph with respect to the generalized affine transfer relation $\mathrm{lhs}' \relsym \mathrm{rhs}$, where $\mathord{\relsym}$ is the relation symbol encoded by relsym.

Parameters:
ph The polyhedron that is transformed;
lhs The left hand side affine expression;
relsym The relation symbol;
rhs The right hand side affine expression.

int ppl_Polyhedron_map_space_dimensions ( ppl_Polyhedron_t  ph,
ppl_dimension_type  maps[],
size_t  n 
)

Remaps the dimensions of the vector space according to a partial function. This function is specified by means of the maps array, which has n entries.

The partial function is defined on dimension i if i < n and maps[i] != ppl_not_a_dimension; otherwise it is undefined on dimension i. If the function is defined on dimension i, then dimension i is mapped onto dimension maps[i].

The result is undefined if maps does not encode a partial function with the properties described in the specification of the mapping operator.

int ppl_LP_Problem_solve ( ppl_const_LP_Problem_t  lp  ) 

Solves the LP problem lp, returning an exit status.

Returns:
PPL_LP_PROBLEM_STATUS_UNFEASIBLE if the LP problem is not satisfiable; PPL_LP_PROBLEM_STATUS_UNBOUNDED if the LP problem is satisfiable but there is no finite bound to the value of the objective function; PPL_LP_PROBLEM_STATUS_OPTIMIZED if the LP problem admits an optimal solution.

int ppl_LP_Problem_evaluate_objective_function ( ppl_const_LP_Problem_t  lp,
ppl_const_Generator_t  g,
ppl_Coefficient_t  num,
ppl_Coefficient_t  den 
)

Evaluates the objective function of lp on point g.

Parameters:
lp The LP problem defining the objective function;
g The generator on which the objective function will be evaluated;
num Will be assigned the numerator of the objective function value;
den Will be assigned the denominator of the objective function value;

int ppl_LP_Problem_optimal_value ( ppl_const_LP_Problem_t  lp,
ppl_Coefficient_t  num,
ppl_Coefficient_t  den 
)

Returns the optimal value for lp.

Parameters:
lp The LP problem;
num Will be assigned the numerator of the optimal value;
den Will be assigned the denominator of the optimal value.


Generated on Sun Mar 12 09:14:30 2006 for PPL by  doxygen 1.4.6-20060227