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 . | |
#define | PPL_DECLARE_PRINT_FUNCTIONS(Type) |
Version Checking | |
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. | |
#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. | |
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 ![]() pc . | |
int | ppl_new_Constraint_zero_dim_positivity (ppl_Constraint_t *pc) |
Creates the true (zero-dimension space) constraint ![]() 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 ![]() 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 ![]() 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_zero_dim_univ (ppl_Generator_System_t *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 ![]() | |
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 ![]() | |
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 ![]() ![]() 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 ![]() ![]() 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 ![]() ![]() 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 ![]() ![]() 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 ![]() ![]() ![]() 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 ![]() ![]() ![]() 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 ![]() ![]() ![]() 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 ![]() ![]() ![]() 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 ![]() 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. | |
Defines | |
#define | PPL_PROTO(protos) () |
#define | PPL_TYPE_DECLARATION(Type) /*! \brief Opaque pointer. */ typedef struct ppl_ ## Type ## _tag* ppl_ ## Type ## _t; /*! \brief Opaque pointer to const object. */ typedef struct ppl_ ## Type ## _tag const* ppl_const_ ## Type ## _t |
Typedefs | |
typedef size_t | ppl_dimension_type |
An unsigned integral type for representing space dimensions. | |
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... | |
Functions | |
PPL_TYPE_DECLARATION (Coefficient) | |
PPL_TYPE_DECLARATION (Linear_Expression) | |
PPL_TYPE_DECLARATION (Constraint) | |
PPL_TYPE_DECLARATION (Constraint_System) | |
PPL_TYPE_DECLARATION (Constraint_System_const_iterator) | |
PPL_TYPE_DECLARATION (Generator) | |
PPL_TYPE_DECLARATION (Generator_System) | |
PPL_TYPE_DECLARATION (Generator_System_const_iterator) | |
PPL_TYPE_DECLARATION (Polyhedron) | |
PPL_TYPE_DECLARATION (LP_Problem) | |
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. |
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>
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
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
-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 PPL_TYPE_DECLARATION | ( | Type | ) | /*! \brief Opaque pointer. */ typedef struct ppl_ ## Type ## _tag* ppl_ ## Type ## _t; /*! \brief Opaque pointer to const object. */ typedef struct ppl_ ## Type ## _tag const* ppl_const_ ## Type ## _t |
#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.
#define PPL_VERSION_BETA 0 |
#define PPL_VERSION_MAJOR 0 |
#define PPL_VERSION_MINOR 9 |
#define PPL_VERSION_REVISION 0 |
typedef size_t ppl_dimension_type |
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.
Describes the relations represented by a constraint.
Definition at line 579 of file ppl_c.h.
00579 { 00581 PPL_CONSTRAINT_TYPE_LESS_THAN, 00583 PPL_CONSTRAINT_TYPE_LESS_THAN_OR_EQUAL, 00585 PPL_CONSTRAINT_TYPE_EQUAL, 00587 PPL_CONSTRAINT_TYPE_GREATER_THAN_OR_EQUAL, 00589 PPL_CONSTRAINT_TYPE_GREATER_THAN 00590 };
enum ppl_enum_error_code |
Defines the error codes that any function may return.
Definition at line 159 of file ppl_c.h.
00159 { 00162 PPL_ERROR_OUT_OF_MEMORY = -2, 00165 PPL_ERROR_INVALID_ARGUMENT = -3, 00168 PPL_ERROR_DOMAIN_ERROR = -4, 00172 PPL_ERROR_LENGTH_ERROR = -5, 00177 PPL_ARITHMETIC_OVERFLOW = -6, 00182 PPL_STDIO_ERROR = -7, 00186 PPL_ERROR_INTERNAL_ERROR = -8, 00190 PPL_ERROR_UNKNOWN_STANDARD_EXCEPTION = -9, 00194 PPL_ERROR_UNEXPECTED_ERROR = -10 00195 };
Describes the different kinds of generators.
Definition at line 851 of file ppl_c.h.
00851 { 00853 PPL_GENERATOR_TYPE_LINE, 00855 PPL_GENERATOR_TYPE_RAY, 00857 PPL_GENERATOR_TYPE_POINT, 00859 PPL_GENERATOR_TYPE_CLOSURE_POINT 00860 };
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
.
Definition at line 480 of file ppl_c.cc.
00480 { 00481 Linear_Expression& ddst = *to_nonconst(dst); 00482 const Linear_Expression& ssrc = *to_const(src); 00483 ddst += ssrc; 00484 return 0; 00485 } 00486 CATCH_ALL
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
.
Definition at line 1386 of file ppl_c.cc.
01387 { 01388 const C_Polyhedron& ssrc 01389 = *static_cast<const C_Polyhedron*>(to_const(src)); 01390 C_Polyhedron& ddst = *static_cast<C_Polyhedron*>(to_nonconst(dst)); 01391 ddst = ssrc; 01392 return 0; 01393 } 01394 CATCH_ALL
int ppl_assign_Coefficient_from_Coefficient | ( | ppl_Coefficient_t | dst, | |
ppl_const_Coefficient_t | src | |||
) |
Assigns a copy of the coefficient src
to dst
.
Definition at line 367 of file ppl_c.cc.
00368 { 00369 const Coefficient& ssrc = *to_const(src); 00370 Coefficient& ddst = *to_nonconst(dst); 00371 ddst = ssrc; 00372 return 0; 00373 } 00374 CATCH_ALL
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
.
Definition at line 359 of file ppl_c.cc.
References reinterpret_mpz_class().
00359 { 00360 Coefficient& ddst = *to_nonconst(dst); 00361 ddst = reinterpret_mpz_class(z); 00362 return 0; 00363 } 00364 CATCH_ALL
int ppl_assign_Constraint_from_Constraint | ( | ppl_Constraint_t | dst, | |
ppl_const_Constraint_t | src | |||
) |
Assigns a copy of the constraint src
to dst
.
Definition at line 606 of file ppl_c.cc.
00607 { 00608 const Constraint& ssrc = *to_const(src); 00609 Constraint& ddst = *to_nonconst(dst); 00610 ddst = ssrc; 00611 return 0; 00612 } 00613 CATCH_ALL
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
.
Definition at line 794 of file ppl_c.cc.
00795 { 00796 const Constraint_System::const_iterator& ssrc = *to_const(src); 00797 Constraint_System::const_iterator& ddst = *to_nonconst(dst); 00798 ddst = ssrc; 00799 return 0; 00800 } 00801 CATCH_ALL
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
.
Definition at line 718 of file ppl_c.cc.
00718 { 00719 const Constraint_System& ssrc = *to_const(src); 00720 Constraint_System& ddst = *to_nonconst(dst); 00721 ddst = ssrc; 00722 return 0; 00723 } 00724 CATCH_ALL
int ppl_assign_Generator_from_Generator | ( | ppl_Generator_t | dst, | |
ppl_const_Generator_t | src | |||
) |
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
.
Definition at line 1094 of file ppl_c.cc.
01095 { 01096 const Generator_System::const_iterator& ssrc = *to_const(src); 01097 Generator_System::const_iterator& ddst = *to_nonconst(dst); 01098 ddst = ssrc; 01099 return 0; 01100 } 01101 CATCH_ALL
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
.
Definition at line 1027 of file ppl_c.cc.
01027 { 01028 const Generator_System& ssrc = *to_const(src); 01029 Generator_System& ddst = *to_nonconst(dst); 01030 ddst = ssrc; 01031 return 0; 01032 } 01033 CATCH_ALL
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
.
Definition at line 449 of file ppl_c.cc.
00449 { 00450 const Linear_Expression& ssrc = *to_const(src); 00451 Linear_Expression& ddst = *to_nonconst(dst); 00452 ddst = ssrc; 00453 return 0; 00454 } 00455 CATCH_ALL
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
.
Definition at line 2306 of file ppl_c.cc.
02307 { 02308 const LP_Problem& ssrc = *to_const(src); 02309 LP_Problem& ddst = *to_nonconst(dst); 02310 ddst = ssrc; 02311 return 0; 02312 } 02313 CATCH_ALL
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
.
Definition at line 1397 of file ppl_c.cc.
01398 { 01399 const NNC_Polyhedron& ssrc 01400 = *static_cast<const NNC_Polyhedron*>(to_const(src)); 01401 NNC_Polyhedron& ddst = *static_cast<NNC_Polyhedron*>(to_nonconst(dst)); 01402 ddst = ssrc; 01403 return 0; 01404 } 01405 CATCH_ALL
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.
Definition at line 278 of file ppl_c.cc.
References Parma_Polyhedra_Library::banner().
Referenced by init(), and ppl_sicstus_init().
int ppl_Coefficient_is_bounded | ( | void | ) |
Returns a positive integer if coefficients are bounded; returns 0 otherwise.
Definition at line 383 of file ppl_c.cc.
References CATCH_ALL, and PROLOG_SUCCESS.
Referenced by init(), and ppl_sicstus_init().
00383 { 00384 return std::numeric_limits<Coefficient>::is_bounded ? 1 : 0; 00385 } 00386 CATCH_ALL
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.
Definition at line 402 of file ppl_c.cc.
References Parma_Polyhedra_Library::assign_r(), and reinterpret_mpz_class().
Referenced by init(), and ppl_sicstus_init().
00402 { 00403 if (std::numeric_limits<Coefficient>::is_bounded) { 00404 assign_r(reinterpret_mpz_class(max), 00405 std::numeric_limits<Coefficient>::max(), 00406 ROUND_NOT_NEEDED); 00407 return 1; 00408 } 00409 else 00410 return 0; 00411 } 00412 CATCH_ALL
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.
Definition at line 389 of file ppl_c.cc.
References Parma_Polyhedra_Library::assign_r(), and reinterpret_mpz_class().
Referenced by init(), and ppl_sicstus_init().
00389 { 00390 if (std::numeric_limits<Coefficient>::is_bounded) { 00391 assign_r(reinterpret_mpz_class(min), 00392 std::numeric_limits<Coefficient>::min(), 00393 ROUND_NOT_NEEDED); 00394 return 1; 00395 } 00396 else 00397 return 0; 00398 } 00399 CATCH_ALL
int ppl_Coefficient_OK | ( | ppl_const_Coefficient_t | c | ) |
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
.
Definition at line 345 of file ppl_c.cc.
References Parma_Polyhedra_Library::assign_r(), and reinterpret_mpz_class().
00345 { 00346 assign_r(reinterpret_mpz_class(z), *to_const(c), ROUND_NOT_NEEDED); 00347 return 0; 00348 } 00349 CATCH_ALL
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
.
Definition at line 639 of file ppl_c.cc.
References Parma_Polyhedra_Library::Constraint::coefficient().
00641 { 00642 const Constraint& cc = *to_const(c); 00643 Coefficient& nn = *to_nonconst(n); 00644 nn = cc.coefficient(Variable(var)); 00645 return 0; 00646 } 00647 CATCH_ALL
int ppl_Constraint_inhomogeneous_term | ( | ppl_const_Constraint_t | c, | |
ppl_Coefficient_t | n | |||
) |
Copies into n
the inhomogeneous term of constraint c
.
Definition at line 650 of file ppl_c.cc.
References Parma_Polyhedra_Library::Constraint::inhomogeneous_term().
00651 { 00652 const Constraint& cc = *to_const(c); 00653 Coefficient& nn = *to_nonconst(n); 00654 nn = cc.inhomogeneous_term(); 00655 return 0; 00656 } 00657 CATCH_ALL
int ppl_Constraint_OK | ( | ppl_const_Constraint_t | c | ) |
int ppl_Constraint_space_dimension | ( | ppl_const_Constraint_t | c, | |
ppl_dimension_type * | m | |||
) |
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
.
Definition at line 804 of file ppl_c.cc.
References Parma_Polyhedra_Library::Constraint_System::begin().
00805 { 00806 const Constraint_System& ccs = *to_const(cs); 00807 Constraint_System::const_iterator& ccit = *to_nonconst(cit); 00808 ccit = ccs.begin(); 00809 return 0; 00810 } 00811 CATCH_ALL
int ppl_Constraint_System_clear | ( | ppl_Constraint_System_t | 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
.
Definition at line 825 of file ppl_c.cc.
00826 { 00827 const Constraint_System::const_iterator& ccit = *to_const(cit); 00828 const Constraint& c = *ccit; 00829 *pc = to_const(&c); 00830 return 0; 00831 } 00832 CATCH_ALL
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.
Definition at line 845 of file ppl_c.cc.
00846 { 00847 const Constraint_System::const_iterator& xx = *to_const(x); 00848 const Constraint_System::const_iterator& yy = *to_const(y); 00849 return (xx == yy) ? 1 : 0; 00850 } 00851 CATCH_ALL
int ppl_Constraint_System_const_iterator_increment | ( | ppl_Constraint_System_const_iterator_t | cit | ) |
Increment cit
so that it "points" to the next constraint.
Definition at line 836 of file ppl_c.cc.
00836 { 00837 Constraint_System::const_iterator& ccit = *to_nonconst(cit); 00838 ++ccit; 00839 return 0; 00840 } 00841 CATCH_ALL
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
.
Definition at line 814 of file ppl_c.cc.
References Parma_Polyhedra_Library::Constraint_System::end().
00815 { 00816 const Constraint_System& ccs = *to_const(cs); 00817 Constraint_System::const_iterator& ccit = *to_nonconst(cit); 00818 ccit = ccs.end(); 00819 return 0; 00820 } 00821 CATCH_ALL
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.
Definition at line 736 of file ppl_c.cc.
References Parma_Polyhedra_Library::Constraint_System::has_strict_inequalities().
00736 { 00737 const Constraint_System& ccs = *to_const(cs); 00738 return ccs.has_strict_inequalities() ? 1 : 0; 00739 } 00740 CATCH_ALL
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.
Definition at line 750 of file ppl_c.cc.
References Parma_Polyhedra_Library::Constraint_System::insert().
00751 { 00752 const Constraint& cc = *to_const(c); 00753 Constraint_System& ccs = *to_nonconst(cs); 00754 ccs.insert(cc); 00755 return 0; 00756 } 00757 CATCH_ALL
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.
Definition at line 760 of file ppl_c.cc.
00760 { 00761 return to_const(cs)->OK() ? 1 : 0; 00762 } 00763 CATCH_ALL
int ppl_Constraint_System_space_dimension | ( | ppl_const_Constraint_System_t | cs, | |
ppl_dimension_type * | m | |||
) |
int ppl_Constraint_type | ( | ppl_const_Constraint_t | c | ) |
Returns the type of constraint c
.
Definition at line 624 of file ppl_c.cc.
References PPL_CONSTRAINT_TYPE_EQUAL, PPL_CONSTRAINT_TYPE_GREATER_THAN, and PPL_CONSTRAINT_TYPE_GREATER_THAN_OR_EQUAL.
00624 { 00625 switch (to_const(c)->type()) { 00626 case Constraint::EQUALITY: 00627 return PPL_CONSTRAINT_TYPE_EQUAL; 00628 case Constraint::NONSTRICT_INEQUALITY: 00629 return PPL_CONSTRAINT_TYPE_GREATER_THAN_OR_EQUAL; 00630 case Constraint::STRICT_INEQUALITY: 00631 return PPL_CONSTRAINT_TYPE_GREATER_THAN; 00632 default: 00633 throw std::runtime_error("ppl_Constraint_type()"); 00634 } 00635 } 00636 CATCH_ALL
int ppl_delete_Coefficient | ( | ppl_const_Coefficient_t | c | ) |
int ppl_delete_Constraint | ( | ppl_const_Constraint_t | c | ) |
int ppl_delete_Constraint_System | ( | ppl_const_Constraint_System_t | cs | ) |
int ppl_delete_Constraint_System_const_iterator | ( | ppl_const_Constraint_System_const_iterator_t | cit | ) |
int ppl_delete_Generator | ( | ppl_const_Generator_t | g | ) |
int ppl_delete_Generator_System | ( | ppl_const_Generator_System_t | gs | ) |
int ppl_delete_Generator_System_const_iterator | ( | ppl_const_Generator_System_const_iterator_t | git | ) |
int ppl_delete_Linear_Expression | ( | ppl_const_Linear_Expression_t | le | ) |
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.
Definition at line 2299 of file ppl_c.cc.
Referenced by init(), and ppl_sicstus_init().
02299 { 02300 delete to_const(lp); 02301 return 0; 02302 } 02303 CATCH_ALL
int ppl_delete_Polyhedron | ( | ppl_const_Polyhedron_t | ph | ) |
Invalidates the handle ph:
this makes sure the corresponding resources will eventually be released.
Definition at line 1379 of file ppl_c.cc.
Referenced by init(), and ppl_sicstus_init().
01379 { 01380 delete to_const(ph); 01381 return 0; 01382 } 01383 CATCH_ALL
int ppl_finalize | ( | void | ) |
Finalizes the Parma Polyhedra Library. This function must be called after any other function.
PPL_ERROR_INVALID_ARGUMENT
if the library was already finalized. Definition at line 229 of file ppl_c.cc.
References CATCH_ALL, init_object_ptr, PPL_ERROR_INVALID_ARGUMENT, ppl_Prolog_sysdep_deinit(), Prolog_interface_initialized, PROLOG_SUCCESS, reset_timeout(), and saved_cxx_Variable_output_function.
Referenced by init(), ppl_sicstus_deinit(), ppl_sicstus_init(), and uninstall().
00229 { 00230 if (init_object_ptr == 0) 00231 // Not initialized or already finalized: error. 00232 return PPL_ERROR_INVALID_ARGUMENT; 00233 00234 delete init_object_ptr; 00235 init_object_ptr = 0; 00236 00237 Variable::set_output_function(saved_cxx_Variable_output_function); 00238 00239 return 0; 00240 } 00241 CATCH_ALL
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
.
Definition at line 950 of file ppl_c.cc.
References Parma_Polyhedra_Library::Generator::coefficient().
00952 { 00953 const Generator& gg = *to_const(g); 00954 Coefficient& nn = *to_nonconst(n); 00955 nn = gg.coefficient(Variable(var)); 00956 return 0; 00957 } 00958 CATCH_ALL
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
.
Definition at line 961 of file ppl_c.cc.
References Parma_Polyhedra_Library::Generator::divisor().
00962 { 00963 const Generator& gg = *to_const(g); 00964 Coefficient& nn = *to_nonconst(n); 00965 nn = gg.divisor(); 00966 return 0; 00967 } 00968 CATCH_ALL
int ppl_Generator_OK | ( | ppl_const_Generator_t | g | ) |
int ppl_Generator_space_dimension | ( | ppl_const_Generator_t | g, | |
ppl_dimension_type * | m | |||
) |
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
.
Definition at line 1104 of file ppl_c.cc.
References Parma_Polyhedra_Library::Generator_System::begin().
01105 { 01106 const Generator_System& ggs = *to_const(gs); 01107 Generator_System::const_iterator& ggit = *to_nonconst(git); 01108 ggit = ggs.begin(); 01109 return 0; 01110 } 01111 CATCH_ALL
int ppl_Generator_System_clear | ( | ppl_Generator_System_t | 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
.
Definition at line 1125 of file ppl_c.cc.
01126 { 01127 const Generator_System::const_iterator& ggit = *to_const(git); 01128 const Generator& c = *ggit; 01129 *pg = to_const(&c); 01130 return 0; 01131 } 01132 CATCH_ALL
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.
Definition at line 1145 of file ppl_c.cc.
01146 { 01147 const Generator_System::const_iterator& xx = *to_const(x); 01148 const Generator_System::const_iterator& yy = *to_const(y); 01149 return (xx == yy) ? 1 : 0; 01150 } 01151 CATCH_ALL
int ppl_Generator_System_const_iterator_increment | ( | ppl_Generator_System_const_iterator_t | git | ) |
Increment git
so that it "points" to the next generator.
Definition at line 1136 of file ppl_c.cc.
01136 { 01137 Generator_System::const_iterator& ggit = *to_nonconst(git); 01138 ++ggit; 01139 return 0; 01140 } 01141 CATCH_ALL
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
.
Definition at line 1114 of file ppl_c.cc.
References Parma_Polyhedra_Library::Generator_System::end().
01115 { 01116 const Generator_System& ggs = *to_const(gs); 01117 Generator_System::const_iterator& ggit = *to_nonconst(git); 01118 ggit = ggs.end(); 01119 return 0; 01120 } 01121 CATCH_ALL
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.
Definition at line 1051 of file ppl_c.cc.
References Parma_Polyhedra_Library::Generator_System::insert().
01052 { 01053 const Generator& gg = *to_const(g); 01054 Generator_System& ggs = *to_nonconst(gs); 01055 ggs.insert(gg); 01056 return 0; 01057 } 01058 CATCH_ALL
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.
Definition at line 1061 of file ppl_c.cc.
01061 { 01062 return to_const(gs)->OK() ? 1 : 0; 01063 } 01064 CATCH_ALL
int ppl_Generator_System_space_dimension | ( | ppl_const_Generator_System_t | gs, | |
ppl_dimension_type * | m | |||
) |
int ppl_Generator_type | ( | ppl_const_Generator_t | g | ) |
Returns the type of generator g
.
Definition at line 933 of file ppl_c.cc.
References PPL_GENERATOR_TYPE_CLOSURE_POINT, PPL_GENERATOR_TYPE_LINE, PPL_GENERATOR_TYPE_POINT, and PPL_GENERATOR_TYPE_RAY.
00933 { 00934 switch (to_const(g)->type()) { 00935 case Generator::LINE: 00936 return PPL_GENERATOR_TYPE_LINE; 00937 case Generator::RAY: 00938 return PPL_GENERATOR_TYPE_RAY; 00939 case Generator::POINT: 00940 return PPL_GENERATOR_TYPE_POINT; 00941 case Generator::CLOSURE_POINT: 00942 return PPL_GENERATOR_TYPE_CLOSURE_POINT; 00943 default: 00944 throw std::runtime_error("ppl_Generator_type()"); 00945 } 00946 } 00947 CATCH_ALL
int ppl_initialize | ( | void | ) |
Initializes the Parma Polyhedra Library. This function must be called before any other function.
PPL_ERROR_INVALID_ARGUMENT
if the library was already initialized. Definition at line 190 of file ppl_c.cc.
References Parma_Polyhedra_Library::ANY_COMPLEXITY, c_variable_default_output_function(), c_variable_output_function, CATCH_ALL, cxx_Variable_output_function(), init_object_ptr, Parma_Polyhedra_Library::MAXIMIZATION, Parma_Polyhedra_Library::MINIMIZATION, name, Parma_Polyhedra_Library::OPTIMIZED_LP_PROBLEM, Parma_Polyhedra_Library::POLYNOMIAL_COMPLEXITY, PPL_ERROR_INVALID_ARGUMENT, ppl_Prolog_sysdep_init(), Prolog_atom_from_string(), prolog_atoms, Prolog_interface_initialized, PROLOG_SUCCESS, saved_cxx_Variable_output_function, Parma_Polyhedra_Library::SIMPLEX_COMPLEXITY, Parma_Polyhedra_Library::UNBOUNDED_LP_PROBLEM, and Parma_Polyhedra_Library::UNFEASIBLE_LP_PROBLEM.
Referenced by init(), install(), and ppl_sicstus_init().
00190 { 00191 if (init_object_ptr != 0) 00192 // Already initialized: error. 00193 return PPL_ERROR_INVALID_ARGUMENT; 00194 00195 init_object_ptr = new Init(); 00196 00197 PPL_POLY_CON_RELATION_IS_DISJOINT 00198 = Poly_Con_Relation::is_disjoint().get_flags(); 00199 PPL_POLY_CON_RELATION_STRICTLY_INTERSECTS 00200 = Poly_Con_Relation::strictly_intersects().get_flags(); 00201 PPL_POLY_CON_RELATION_IS_INCLUDED 00202 = Poly_Con_Relation::is_included().get_flags(); 00203 PPL_POLY_CON_RELATION_SATURATES 00204 = Poly_Con_Relation::saturates().get_flags(); 00205 00206 PPL_POLY_GEN_RELATION_SUBSUMES 00207 = Poly_Gen_Relation::subsumes().get_flags(); 00208 00209 PPL_COMPLEXITY_CLASS_POLYNOMIAL = POLYNOMIAL_COMPLEXITY; 00210 PPL_COMPLEXITY_CLASS_SIMPLEX = SIMPLEX_COMPLEXITY; 00211 PPL_COMPLEXITY_CLASS_ANY = ANY_COMPLEXITY; 00212 00213 PPL_LP_PROBLEM_STATUS_UNFEASIBLE = UNFEASIBLE_LP_PROBLEM; 00214 PPL_LP_PROBLEM_STATUS_UNBOUNDED = UNBOUNDED_LP_PROBLEM; 00215 PPL_LP_PROBLEM_STATUS_OPTIMIZED = OPTIMIZED_LP_PROBLEM; 00216 00217 PPL_LP_PROBLEM_MINIMIZATION = MINIMIZATION; 00218 PPL_LP_PROBLEM_MAXIMIZATION = MAXIMIZATION; 00219 00220 c_variable_output_function = c_variable_default_output_function; 00221 saved_cxx_Variable_output_function = Variable::get_output_function(); 00222 Variable::set_output_function(cxx_Variable_output_function); 00223 00224 return 0; 00225 } 00226 CATCH_ALL
int ppl_io_fprint_variable | ( | FILE * | stream, | |
ppl_dimension_type | var | |||
) |
Pretty-prints var
to the given output stream
.
Definition at line 2465 of file ppl_c.cc.
References c_variable_output_function, and PPL_STDIO_ERROR.
02465 { 02466 const char* b = c_variable_output_function(var); 02467 if (b == 0 || fputs(b, stream) < 0) 02468 return PPL_STDIO_ERROR; 02469 return 0; 02470 } 02471 CATCH_ALL
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
.
Definition at line 2519 of file ppl_c.cc.
References c_variable_output_function.
02520 { 02521 *pp = c_variable_output_function; 02522 return 0; 02523 } 02524 CATCH_ALL
int ppl_io_print_variable | ( | ppl_dimension_type | var | ) |
Pretty-prints var
to stdout
.
Definition at line 2456 of file ppl_c.cc.
References c_variable_output_function, and PPL_STDIO_ERROR.
02456 { 02457 const char* b = c_variable_output_function(var); 02458 if (b == 0 || puts(b) < 0) 02459 return PPL_STDIO_ERROR; 02460 return 0; 02461 } 02462 CATCH_ALL
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
.
Definition at line 2511 of file ppl_c.cc.
References c_variable_output_function.
02512 { 02513 c_variable_output_function = p; 02514 return 0; 02515 } 02516 CATCH_ALL
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.
Definition at line 458 of file ppl_c.cc.
00460 { 00461 Linear_Expression& lle = *to_nonconst(le); 00462 const Coefficient& nn = *to_const(n); 00463 lle += nn * Variable(var); 00464 return 0; 00465 } 00466 CATCH_ALL
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
.
Definition at line 469 of file ppl_c.cc.
00470 { 00471 Linear_Expression& lle = *to_nonconst(le); 00472 const Coefficient& nn = *to_const(n); 00473 lle += nn; 00474 return 0; 00475 } 00476 CATCH_ALL
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
.
Definition at line 517 of file ppl_c.cc.
References Parma_Polyhedra_Library::Linear_Expression::coefficient().
00519 { 00520 const Linear_Expression& lle = *to_const(le); 00521 Coefficient& nn = *to_nonconst(n); 00522 nn = lle.coefficient(Variable(var)); 00523 return 0; 00524 } 00525 CATCH_ALL
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
.
Definition at line 528 of file ppl_c.cc.
References Parma_Polyhedra_Library::Linear_Expression::inhomogeneous_term().
00529 { 00530 const Linear_Expression& lle = *to_const(le); 00531 Coefficient& nn = *to_nonconst(n); 00532 nn = lle.inhomogeneous_term(); 00533 return 0; 00534 } 00535 CATCH_ALL
int ppl_Linear_Expression_OK | ( | ppl_const_Linear_Expression_t | le | ) |
int ppl_Linear_Expression_space_dimension | ( | ppl_const_Linear_Expression_t | le, | |
ppl_dimension_type * | m | |||
) |
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.
Definition at line 2355 of file ppl_c.cc.
References Parma_Polyhedra_Library::LP_Problem::add_constraint().
Referenced by init(), and ppl_sicstus_init().
02356 { 02357 const Constraint& cc = *to_const(c); 02358 LP_Problem& llp = *to_nonconst(lp); 02359 llp.add_constraint(cc); 02360 return 0; 02361 } 02362 CATCH_ALL
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.
Definition at line 2365 of file ppl_c.cc.
References Parma_Polyhedra_Library::LP_Problem::add_constraints().
Referenced by init(), and ppl_sicstus_init().
02366 { 02367 const Constraint_System& ccs = *to_const(cs); 02368 LP_Problem& llp = *to_nonconst(lp); 02369 llp.add_constraints(ccs); 02370 return 0; 02371 } 02372 CATCH_ALL
int ppl_LP_Problem_clear | ( | ppl_LP_Problem_t | lp | ) |
Resets the LP problem to be a trivial problem of space dimension 0.
Definition at line 2348 of file ppl_c.cc.
Referenced by init(), and ppl_sicstus_init().
02348 { 02349 to_nonconst(lp)->clear(); 02350 return 0; 02351 } 02352 CATCH_ALL
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
.
Definition at line 2324 of file ppl_c.cc.
Referenced by init(), and ppl_sicstus_init().
02325 { 02326 const Constraint_System& cs = to_const(lp)->constraints(); 02327 *pcs = to_const(&cs); 02328 return 0; 02329 } 02330 CATCH_ALL
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
.
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; |
Definition at line 2407 of file ppl_c.cc.
References Parma_Polyhedra_Library::LP_Problem::evaluate_objective_function().
Referenced by init(), and ppl_sicstus_init().
02410 { 02411 const LP_Problem& llp = *to_const(lp); 02412 const Generator& gg = *to_const(g); 02413 Coefficient& nnum = *to_nonconst(num); 02414 Coefficient& dden = *to_nonconst(den); 02415 llp.evaluate_objective_function(gg, nnum, dden); 02416 return 0; 02417 } 02418 CATCH_ALL
int ppl_LP_Problem_feasible_point | ( | ppl_const_LP_Problem_t | lp, | |
ppl_const_Generator_t * | pg | |||
) |
int ppl_LP_Problem_is_satisfiable | ( | ppl_const_LP_Problem_t | lp | ) |
Returns a positive integer if lp
is satisfiable; returns 0 otherwise.
Definition at line 2395 of file ppl_c.cc.
Referenced by init(), and ppl_sicstus_init().
02395 { 02396 return to_const(lp)->is_satisfiable() ? 1 : 0; 02397 } 02398 CATCH_ALL
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
.
Definition at line 2333 of file ppl_c.cc.
Referenced by init(), and ppl_sicstus_init().
02334 { 02335 const Linear_Expression& le = to_const(lp)->objective_function(); 02336 *ple = to_const(&le); 02337 return 0; 02338 } 02339 CATCH_ALL
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.
Definition at line 2450 of file ppl_c.cc.
Referenced by init(), and ppl_sicstus_init().
02450 { 02451 return to_const(lp)->OK() ? 1 : 0; 02452 } 02453 CATCH_ALL
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
.
lp | The LP problem; | |
num | Will be assigned the numerator of the optimal value; | |
den | Will be assigned the denominator of the optimal value. |
Definition at line 2439 of file ppl_c.cc.
Referenced by init(), and ppl_sicstus_init().
02441 { 02442 Coefficient& nnum = *to_nonconst(num); 02443 Coefficient& dden = *to_nonconst(den); 02444 to_const(lp)->optimal_value(nnum, dden); 02445 return 0; 02446 } 02447 CATCH_ALL
int ppl_LP_Problem_optimization_mode | ( | ppl_const_LP_Problem_t | lp | ) |
Returns the optimization mode of the LP problem lp
.
Definition at line 2342 of file ppl_c.cc.
Referenced by init(), and ppl_sicstus_init().
02342 { 02343 return to_const(lp)->optimization_mode(); 02344 } 02345 CATCH_ALL
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
.
Definition at line 2430 of file ppl_c.cc.
Referenced by init(), and ppl_sicstus_init().
02431 { 02432 const Generator& g = to_const(lp)->optimizing_point(); 02433 *pg = to_const(&g); 02434 return 0; 02435 } 02436 CATCH_ALL
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
.
Definition at line 2375 of file ppl_c.cc.
References Parma_Polyhedra_Library::LP_Problem::set_objective_function().
Referenced by init(), and ppl_sicstus_init().
02376 { 02377 const Linear_Expression& lle = *to_const(le); 02378 LP_Problem& llp = *to_nonconst(lp); 02379 llp.set_objective_function(lle); 02380 return 0; 02381 } 02382 CATCH_ALL
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
.
Definition at line 2385 of file ppl_c.cc.
References Parma_Polyhedra_Library::MAXIMIZATION, Parma_Polyhedra_Library::MINIMIZATION, and Parma_Polyhedra_Library::LP_Problem::set_optimization_mode().
Referenced by init(), and ppl_sicstus_init().
02385 { 02386 LP_Problem& llp = *to_nonconst(lp); 02387 Optimization_Mode m = (mode == PPL_LP_PROBLEM_MINIMIZATION) 02388 ? MINIMIZATION : MAXIMIZATION; 02389 llp.set_optimization_mode(m); 02390 return 0; 02391 } 02392 CATCH_ALL
int ppl_LP_Problem_solve | ( | ppl_const_LP_Problem_t | lp | ) |
Solves the LP problem lp
, returning an exit status.
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. Definition at line 2401 of file ppl_c.cc.
Referenced by init(), and ppl_sicstus_init().
02401 { 02402 return to_const(lp)->solve(); 02403 } 02404 CATCH_ALL
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
.
Definition at line 2316 of file ppl_c.cc.
Referenced by init(), and ppl_sicstus_init().
02317 { 02318 *m = to_const(lp)->space_dimension(); 02319 return 0; 02320 } 02321 CATCH_ALL
int ppl_max_space_dimension | ( | ppl_dimension_type * | m | ) |
Writes to m
the maximum space dimension this library can handle.
Definition at line 285 of file ppl_c.cc.
Referenced by init(), and ppl_sicstus_init().
00285 { 00286 *m = max_space_dimension(); 00287 return 0; 00288 } 00289 CATCH_ALL
int ppl_multiply_Linear_Expression_by_Coefficient | ( | ppl_Linear_Expression_t | le, | |
ppl_const_Coefficient_t | n | |||
) |
Multiply the linear expression dst
by n
.
Definition at line 499 of file ppl_c.cc.
00500 { 00501 Linear_Expression& lle = *to_nonconst(le); 00502 const Coefficient& nn = *to_const(n); 00503 lle *= nn; 00504 return 0; 00505 } 00506 CATCH_ALL
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
.
Definition at line 1171 of file ppl_c.cc.
References Parma_Polyhedra_Library::EMPTY.
01172 { 01173 *pph = to_nonconst(new C_Polyhedron(d, EMPTY)); 01174 return 0; 01175 } 01176 CATCH_ALL
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()
int is_empty()
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)
k
-th space dimension. If closed
, n
and d
as follows: closed
is set to 0 if the lower boundary of n
and d
are assigned the integers int get_upper_bound(ppl_dimension_type k, int closed, ppl_Coefficient_t n, ppl_Coefficient_t d)
k
-th space dimension. If closed
, n
and d
as follows: closed
is set to 0 if the upper boundary of n
and d
are assigned the integers Definition at line 1344 of file ppl_c.cc.
Referenced by init(), and ppl_sicstus_init().
01352 { 01353 C_Build_Box cbbox(space_dimension, is_empty, 01354 get_lower_bound, get_upper_bound); 01355 *pph = to_nonconst(new C_Polyhedron(cbbox, From_Bounding_Box())); 01356 return 0; 01357 } 01358 CATCH_ALL
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
.
Definition at line 1187 of file ppl_c.cc.
Referenced by init(), and ppl_sicstus_init().
01188 { 01189 const C_Polyhedron& phh = *static_cast<const C_Polyhedron*>(to_const(ph)); 01190 *pph = to_nonconst(new C_Polyhedron(phh)); 01191 return 0; 01192 } 01193 CATCH_ALL
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
.
Definition at line 1226 of file ppl_c.cc.
01226 { 01227 const Constraint_System& ccs = *to_const(cs); 01228 *pph = to_nonconst(new C_Polyhedron(ccs)); 01229 return 0; 01230 } 01231 CATCH_ALL
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
.
Definition at line 1155 of file ppl_c.cc.
References Parma_Polyhedra_Library::UNIVERSE.
01156 { 01157 *pph = to_nonconst(new C_Polyhedron(d, UNIVERSE)); 01158 return 0; 01159 } 01160 CATCH_ALL
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
.
Definition at line 1262 of file ppl_c.cc.
01262 { 01263 const Generator_System& ggs = *to_const(gs); 01264 *pph = to_nonconst(new C_Polyhedron(ggs)); 01265 return 0; 01266 } 01267 CATCH_ALL
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
.
Definition at line 1196 of file ppl_c.cc.
Referenced by init(), and ppl_sicstus_init().
01197 { 01198 const NNC_Polyhedron& phh 01199 = *static_cast<const NNC_Polyhedron*>(to_const(ph)); 01200 *pph = to_nonconst(new C_Polyhedron(phh)); 01201 return 0; 01202 } 01203 CATCH_ALL
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.
cs:
upon return, no assumption can be made on its value. Definition at line 1235 of file ppl_c.cc.
01235 { 01236 Constraint_System& ccs = *to_nonconst(cs); 01237 *pph = to_nonconst(new C_Polyhedron(ccs)); 01238 return 0; 01239 } 01240 CATCH_ALL
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.
gs:
upon return, no assumption can be made on its value. Definition at line 1270 of file ppl_c.cc.
01271 { 01272 Generator_System& ggs = *to_nonconst(gs); 01273 *pph = to_nonconst(new C_Polyhedron(ggs)); 01274 return 0; 01275 } 01276 CATCH_ALL
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
.
Definition at line 322 of file ppl_c.cc.
00322 { 00323 *pc = to_nonconst(new Coefficient(0)); 00324 return 0; 00325 } 00326 CATCH_ALL
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
.
Definition at line 336 of file ppl_c.cc.
00337 { 00338 const Coefficient& cc = *to_const(c); 00339 *pc = to_nonconst(new Coefficient(cc)); 00340 return 0; 00341 } 00342 CATCH_ALL
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
.
Definition at line 329 of file ppl_c.cc.
References reinterpret_mpz_class().
00329 { 00330 *pc = to_nonconst(new Coefficient(reinterpret_mpz_class(z))); 00331 return 0; 00332 } 00333 CATCH_ALL
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
.
Definition at line 545 of file ppl_c.cc.
References PPL_CONSTRAINT_TYPE_EQUAL, PPL_CONSTRAINT_TYPE_GREATER_THAN, PPL_CONSTRAINT_TYPE_GREATER_THAN_OR_EQUAL, PPL_CONSTRAINT_TYPE_LESS_THAN, and PPL_CONSTRAINT_TYPE_LESS_THAN_OR_EQUAL.
00547 { 00548 Constraint* ppc; 00549 const Linear_Expression& lle = *to_const(le); 00550 switch (t) { 00551 case PPL_CONSTRAINT_TYPE_EQUAL: 00552 ppc = new Constraint(lle == 0); 00553 break; 00554 case PPL_CONSTRAINT_TYPE_GREATER_THAN_OR_EQUAL: 00555 ppc = new Constraint(lle >= 0); 00556 break; 00557 case PPL_CONSTRAINT_TYPE_GREATER_THAN: 00558 ppc = new Constraint(lle > 0); 00559 break; 00560 case PPL_CONSTRAINT_TYPE_LESS_THAN_OR_EQUAL: 00561 ppc = new Constraint(lle <= 0); 00562 break; 00563 case PPL_CONSTRAINT_TYPE_LESS_THAN: 00564 ppc = new Constraint(lle < 0); 00565 break; 00566 default: 00567 throw std::invalid_argument("ppl_new_Constraint(pc, le, t): " 00568 "t invalid"); 00569 } 00570 *pc = to_nonconst(ppc); 00571 return 0; 00572 } 00573 CATCH_ALL
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
.
Definition at line 590 of file ppl_c.cc.
00591 { 00592 const Constraint& cc = *to_const(c); 00593 *pc = to_nonconst(new Constraint(cc)); 00594 return 0; 00595 } 00596 CATCH_ALL
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
.
Definition at line 676 of file ppl_c.cc.
00676 { 00677 *pcs = to_nonconst(new Constraint_System()); 00678 return 0; 00679 } 00680 CATCH_ALL
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
.
Definition at line 768 of file ppl_c.cc.
00768 { 00769 *pcit = to_nonconst(new Constraint_System::const_iterator()); 00770 return 0; 00771 } 00772 CATCH_ALL
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
.
Definition at line 776 of file ppl_c.cc.
00777 { 00778 *pcit = to_nonconst(new Constraint_System::const_iterator(*to_const(cit))); 00779 return 0; 00780 } 00781 CATCH_ALL
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
.
Definition at line 692 of file ppl_c.cc.
00693 { 00694 const Constraint& cc = *to_const(c); 00695 *pcs = to_nonconst(new Constraint_System(cc)); 00696 return 0; 00697 } 00698 CATCH_ALL
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
.
Definition at line 702 of file ppl_c.cc.
00702 { 00703 const Constraint_System& ccs = *to_const(cs); 00704 *pcs = to_nonconst(new Constraint_System(ccs)); 00705 return 0; 00706 } 00707 CATCH_ALL
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
.
Definition at line 683 of file ppl_c.cc.
00683 { 00684 *pcs = to_nonconst(new 00685 Constraint_System(Constraint_System::zero_dim_empty())); 00686 return 0; 00687 } 00688 CATCH_ALL
int ppl_new_Constraint_zero_dim_false | ( | ppl_Constraint_t * | pc | ) |
Creates the unsatisfiable (zero-dimension space) constraint and writes a handle for it at address
pc
.
Definition at line 576 of file ppl_c.cc.
00576 { 00577 *pc = to_nonconst(new Constraint(Constraint::zero_dim_false())); 00578 return 0; 00579 } 00580 CATCH_ALL
int ppl_new_Constraint_zero_dim_positivity | ( | ppl_Constraint_t * | pc | ) |
Creates the true (zero-dimension space) constraint , also known as positivity constraint. A handle for the newly created constraint is written at address
pc
.
Definition at line 583 of file ppl_c.cc.
00583 { 00584 *pc = to_nonconst(new Constraint(Constraint::zero_dim_positivity())); 00585 return 0; 00586 } 00587 CATCH_ALL
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
.
Definition at line 855 of file ppl_c.cc.
References PPL_GENERATOR_TYPE_CLOSURE_POINT, PPL_GENERATOR_TYPE_LINE, PPL_GENERATOR_TYPE_POINT, and PPL_GENERATOR_TYPE_RAY.
00858 { 00859 Generator* ppg; 00860 const Linear_Expression& lle = *to_const(le); 00861 const Coefficient& dd = *to_const(d); 00862 switch (t) { 00863 case PPL_GENERATOR_TYPE_POINT: 00864 ppg = new Generator(Generator::point(lle, dd)); 00865 break; 00866 case PPL_GENERATOR_TYPE_CLOSURE_POINT: 00867 ppg = new Generator(Generator::closure_point(lle, dd)); 00868 break; 00869 case PPL_GENERATOR_TYPE_RAY: 00870 ppg = new Generator(Generator::ray(lle)); 00871 break; 00872 case PPL_GENERATOR_TYPE_LINE: 00873 ppg = new Generator(Generator::line(lle)); 00874 break; 00875 default: 00876 throw std::invalid_argument("ppl_new_Generator(pg, le, t, d): " 00877 "t invalid"); 00878 } 00879 *pg = to_nonconst(ppg); 00880 return 0; 00881 } 00882 CATCH_ALL
int ppl_new_Generator_from_Generator | ( | ppl_Generator_t * | pg, | |
ppl_const_Generator_t | g | |||
) |
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
.
Definition at line 987 of file ppl_c.cc.
00987 { 00988 *pgs = to_nonconst(new Generator_System()); 00989 return 0; 00990 } 00991 CATCH_ALL
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
.
Definition at line 1069 of file ppl_c.cc.
01069 { 01070 *pgit = to_nonconst(new Generator_System::const_iterator()); 01071 return 0; 01072 } 01073 CATCH_ALL
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
.
Definition at line 1077 of file ppl_c.cc.
01078 { 01079 *pgit = to_nonconst(new Generator_System::const_iterator(*to_const(git))); 01080 return 0; 01081 } 01082 CATCH_ALL
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
.
Definition at line 1001 of file ppl_c.cc.
01002 { 01003 const Generator& gg = *to_const(g); 01004 *pgs = to_nonconst(new Generator_System(gg)); 01005 return 0; 01006 } 01007 CATCH_ALL
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
.
Definition at line 1011 of file ppl_c.cc.
01011 { 01012 const Generator_System& ggs = *to_const(gs); 01013 *pgs = to_nonconst(new Generator_System(ggs)); 01014 return 0; 01015 } 01016 CATCH_ALL
int ppl_new_Generator_System_zero_dim_univ | ( | ppl_Generator_System_t * | pgs | ) |
Definition at line 994 of file ppl_c.cc.
References zero_dim_univ.
00994 { 00995 *pgs = to_nonconst(new Generator_System(Generator_System::zero_dim_univ())); 00996 return 0; 00997 } 00998 CATCH_ALL
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 . Writes a handle for the new generator at address
pg
.
Definition at line 892 of file ppl_c.cc.
00892 { 00893 *pg = to_nonconst(new Generator(Generator::zero_dim_closure_point())); 00894 return 0; 00895 } 00896 CATCH_ALL
int ppl_new_Generator_zero_dim_point | ( | ppl_Generator_t * | pg | ) |
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
.
Definition at line 415 of file ppl_c.cc.
References Parma_Polyhedra_Library::Linear_Expression::Linear_Expression().
00415 { 00416 *ple = to_nonconst(new Linear_Expression()); 00417 return 0; 00418 } 00419 CATCH_ALL
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
.
Definition at line 666 of file ppl_c.cc.
References Parma_Polyhedra_Library::Linear_Expression::Linear_Expression().
00667 { 00668 const Constraint& cc = *to_const(c); 00669 *ple = to_nonconst(new Linear_Expression(cc)); 00670 return 0; 00671 } 00672 CATCH_ALL
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
.
Definition at line 977 of file ppl_c.cc.
References Parma_Polyhedra_Library::Linear_Expression::Linear_Expression().
00978 { 00979 const Generator& gg = *to_const(g); 00980 *ple = to_nonconst(new Linear_Expression(gg)); 00981 return 0; 00982 } 00983 CATCH_ALL
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
.
Definition at line 433 of file ppl_c.cc.
References Parma_Polyhedra_Library::Linear_Expression::Linear_Expression().
00433 { 00434 const Linear_Expression& lle = *to_const(le); 00435 *ple = to_nonconst(new Linear_Expression(lle)); 00436 return 0; 00437 } 00438 CATCH_ALL
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
.
Definition at line 422 of file ppl_c.cc.
References Parma_Polyhedra_Library::Linear_Expression::Linear_Expression().
00423 { 00424 *ple = to_nonconst(d == 0 00425 ? new Linear_Expression(0) 00426 : new Linear_Expression(0*Variable(d-1))); 00427 return 0; 00428 } 00429 CATCH_ALL
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
.
Definition at line 2278 of file ppl_c.cc.
References Parma_Polyhedra_Library::MAXIMIZATION, and Parma_Polyhedra_Library::MINIMIZATION.
Referenced by init(), and ppl_sicstus_init().
02279 { 02280 const Constraint_System& ccs = *to_const(cs); 02281 const Linear_Expression& lle = *to_const(le); 02282 Optimization_Mode mm = (m == PPL_LP_PROBLEM_MINIMIZATION) 02283 ? MINIMIZATION : MAXIMIZATION; 02284 *plp = to_nonconst(new LP_Problem(ccs, lle, mm)); 02285 return 0; 02286 } 02287 CATCH_ALL
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
.
Definition at line 2290 of file ppl_c.cc.
Referenced by init(), and ppl_sicstus_init().
02291 { 02292 const LP_Problem& llp = *to_const(lp); 02293 *plp = to_nonconst(new LP_Problem(llp)); 02294 return 0; 02295 } 02296 CATCH_ALL
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
.
Definition at line 2271 of file ppl_c.cc.
Referenced by init(), and ppl_sicstus_init().
02271 { 02272 *plp = to_nonconst(new LP_Problem()); 02273 return 0; 02274 } 02275 CATCH_ALL
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
.
Definition at line 1179 of file ppl_c.cc.
References Parma_Polyhedra_Library::EMPTY.
01180 { 01181 *pph = to_nonconst(new NNC_Polyhedron(d, EMPTY)); 01182 return 0; 01183 } 01184 CATCH_ALL
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()
int is_empty()
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)
k
-th space dimension. If closed
, n
and d
as follows: closed
is set to 0 if the lower boundary of n
and d
are assigned the integers int get_upper_bound(ppl_dimension_type k, int closed, ppl_Coefficient_t n, ppl_Coefficient_t d)
k
-th space dimension. If closed
, n
and d
as follows: closed
is set to 0 if the upper boundary of n
and d
are assigned the integers Definition at line 1362 of file ppl_c.cc.
Referenced by init(), and ppl_sicstus_init().
01370 { 01371 C_Build_Box cbbox(space_dimension, is_empty, 01372 get_lower_bound, get_upper_bound); 01373 *pph = to_nonconst(new NNC_Polyhedron(cbbox, From_Bounding_Box())); 01374 return 0; 01375 } 01376 CATCH_ALL
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
.
Definition at line 1206 of file ppl_c.cc.
Referenced by init(), and ppl_sicstus_init().
01207 { 01208 const C_Polyhedron& phh = *static_cast<const C_Polyhedron*>(to_const(ph)); 01209 *pph = to_nonconst(new NNC_Polyhedron(phh)); 01210 return 0; 01211 } 01212 CATCH_ALL
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
.
Definition at line 1244 of file ppl_c.cc.
01244 { 01245 const Constraint_System& ccs = *to_const(cs); 01246 *pph = to_nonconst(new NNC_Polyhedron(ccs)); 01247 return 0; 01248 } 01249 CATCH_ALL
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
.
Definition at line 1163 of file ppl_c.cc.
References Parma_Polyhedra_Library::UNIVERSE.
01164 { 01165 *pph = to_nonconst(new NNC_Polyhedron(d, UNIVERSE)); 01166 return 0; 01167 } 01168 CATCH_ALL
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
.
Definition at line 1280 of file ppl_c.cc.
01280 { 01281 const Generator_System& ggs = *to_const(gs); 01282 *pph = to_nonconst(new C_Polyhedron(ggs)); 01283 return 0; 01284 } 01285 CATCH_ALL
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
.
Definition at line 1215 of file ppl_c.cc.
Referenced by init(), and ppl_sicstus_init().
01216 { 01217 const NNC_Polyhedron& phh 01218 = *static_cast<const NNC_Polyhedron*>(to_const(ph)); 01219 *pph = to_nonconst(new NNC_Polyhedron(phh)); 01220 return 0; 01221 } 01222 CATCH_ALL
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.
cs:
upon return, no assumption can be made on its value. Definition at line 1253 of file ppl_c.cc.
01253 { 01254 Constraint_System& ccs = *to_nonconst(cs); 01255 *pph = to_nonconst(new NNC_Polyhedron(ccs)); 01256 return 0; 01257 } 01258 CATCH_ALL
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.
gs:
upon return, no assumption can be made on its value. Definition at line 1289 of file ppl_c.cc.
01289 { 01290 Generator_System& ggs = *to_nonconst(gs); 01291 *pph = to_nonconst(new C_Polyhedron(ggs)); 01292 return 0; 01293 } 01294 CATCH_ALL
int ppl_not_a_dimension | ( | ppl_dimension_type * | m | ) |
Writes to m
a value that does not designate a valid dimension.
Definition at line 292 of file ppl_c.cc.
References Parma_Polyhedra_Library::not_a_dimension().
00292 { 00293 *m = not_a_dimension(); 00294 return 0; 00295 } 00296 CATCH_ALL
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
.
Definition at line 1664 of file ppl_c.cc.
References Parma_Polyhedra_Library::Polyhedron::add_constraint().
Referenced by init(), and ppl_sicstus_init().
01665 { 01666 Polyhedron& pph = *to_nonconst(ph); 01667 const Constraint& cc = *to_const(c); 01668 pph.add_constraint(cc); 01669 return 0; 01670 } 01671 CATCH_ALL
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.
Definition at line 1674 of file ppl_c.cc.
References Parma_Polyhedra_Library::Polyhedron::add_constraint_and_minimize().
Referenced by init(), and ppl_sicstus_init().
01675 { 01676 Polyhedron& pph = *to_nonconst(ph); 01677 const Constraint& cc = *to_const(c); 01678 pph.add_constraint_and_minimize(cc); 01679 return 0; 01680 } 01681 CATCH_ALL
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
.
Definition at line 1704 of file ppl_c.cc.
References Parma_Polyhedra_Library::Polyhedron::add_constraints().
Referenced by init(), and ppl_sicstus_init().
01705 { 01706 Polyhedron& pph = *to_nonconst(ph); 01707 const Constraint_System& ccs = *to_const(cs); 01708 pph.add_constraints(ccs); 01709 return 0; 01710 } 01711 CATCH_ALL
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.
Definition at line 1715 of file ppl_c.cc.
References Parma_Polyhedra_Library::Polyhedron::add_constraints_and_minimize().
Referenced by init(), and ppl_sicstus_init().
01715 { 01716 Polyhedron& pph = *to_nonconst(ph); 01717 const Constraint_System& ccs = *to_const(cs); 01718 return pph.add_constraints_and_minimize(ccs) ? 1 : 0; 01719 } 01720 CATCH_ALL
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
.
Definition at line 1684 of file ppl_c.cc.
References Parma_Polyhedra_Library::Polyhedron::add_generator().
Referenced by init(), and ppl_sicstus_init().
01685 { 01686 Polyhedron& pph = *to_nonconst(ph); 01687 const Generator& gg = *to_const(g); 01688 pph.add_generator(gg); 01689 return 0; 01690 } 01691 CATCH_ALL
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.
Definition at line 1694 of file ppl_c.cc.
References Parma_Polyhedra_Library::Polyhedron::add_generator_and_minimize().
Referenced by init(), and ppl_sicstus_init().
01695 { 01696 Polyhedron& pph = *to_nonconst(ph); 01697 const Generator& gg = *to_const(g); 01698 pph.add_generator_and_minimize(gg); 01699 return 0; 01700 } 01701 CATCH_ALL
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
.
Definition at line 1723 of file ppl_c.cc.
References Parma_Polyhedra_Library::Polyhedron::add_generators().
Referenced by init(), and ppl_sicstus_init().
01724 { 01725 Polyhedron& pph = *to_nonconst(ph); 01726 const Generator_System& ggs = *to_const(gs); 01727 pph.add_generators(ggs); 01728 return 0; 01729 } 01730 CATCH_ALL
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.
Definition at line 1734 of file ppl_c.cc.
References Parma_Polyhedra_Library::Polyhedron::add_generators_and_minimize().
Referenced by init(), and ppl_sicstus_init().
01734 { 01735 Polyhedron& pph = *to_nonconst(ph); 01736 const Generator_System& ggs = *to_const(gs); 01737 return pph.add_generators_and_minimize(ggs) ? 1 : 0; 01738 } 01739 CATCH_ALL
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
.
cs:
upon return, no assumption can be made on its value. Definition at line 1742 of file ppl_c.cc.
References Parma_Polyhedra_Library::Polyhedron::add_recycled_constraints().
01743 { 01744 Polyhedron& pph = *to_nonconst(ph); 01745 Constraint_System& ccs = *to_nonconst(cs); 01746 pph.add_recycled_constraints(ccs); 01747 return 0; 01748 } 01749 CATCH_ALL
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.
cs:
upon return, no assumption can be made on its value. Definition at line 1753 of file ppl_c.cc.
References Parma_Polyhedra_Library::Polyhedron::add_recycled_constraints_and_minimize().
01753 { 01754 Polyhedron& pph = *to_nonconst(ph); 01755 Constraint_System& ccs = *to_nonconst(cs); 01756 return pph.add_recycled_constraints_and_minimize(ccs) ? 1 : 0; 01757 } 01758 CATCH_ALL
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
.
gs:
upon return, no assumption can be made on its value. Definition at line 1761 of file ppl_c.cc.
References Parma_Polyhedra_Library::Polyhedron::add_recycled_generators().
01762 { 01763 Polyhedron& pph = *to_nonconst(ph); 01764 Generator_System& ggs = *to_nonconst(gs); 01765 pph.add_recycled_generators(ggs); 01766 return 0; 01767 } 01768 CATCH_ALL
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.
gs:
upon return, no assumption can be made on its value. Definition at line 1771 of file ppl_c.cc.
References Parma_Polyhedra_Library::Polyhedron::add_recycled_generators_and_minimize().
01773 { 01774 Polyhedron& pph = *to_nonconst(ph); 01775 Generator_System& ggs = *to_nonconst(gs); 01776 return pph.add_recycled_generators_and_minimize(ggs) ? 1 : 0; 01777 } 01778 CATCH_ALL
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.
Definition at line 1781 of file ppl_c.cc.
References Parma_Polyhedra_Library::Polyhedron::add_space_dimensions_and_embed().
Referenced by init(), and ppl_sicstus_init().
01782 { 01783 Polyhedron& pph = *to_nonconst(ph); 01784 pph.add_space_dimensions_and_embed(d); 01785 return 0; 01786 } 01787 CATCH_ALL
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
.
Definition at line 1790 of file ppl_c.cc.
References Parma_Polyhedra_Library::Polyhedron::add_space_dimensions_and_project().
Referenced by init(), and ppl_sicstus_init().
01791 { 01792 Polyhedron& pph = *to_nonconst(ph); 01793 pph.add_space_dimensions_and_project(d); 01794 return 0; 01795 } 01796 CATCH_ALL
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.
Referenced by init(), and ppl_sicstus_init().
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.
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. |
Definition at line 1916 of file ppl_c.cc.
References Parma_Polyhedra_Library::Polyhedron::affine_image().
Referenced by init(), and ppl_sicstus_init().
01919 { 01920 Polyhedron& pph = *to_nonconst(ph); 01921 const Linear_Expression& lle = *to_const(le); 01922 const Coefficient& dd = *to_const(d); 01923 pph.affine_image(Variable(var), lle, dd); 01924 return 0; 01925 } 01926 CATCH_ALL
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.
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. |
Definition at line 1929 of file ppl_c.cc.
References Parma_Polyhedra_Library::Polyhedron::affine_preimage().
Referenced by init(), and ppl_sicstus_init().
01932 { 01933 Polyhedron& pph = *to_nonconst(ph); 01934 const Linear_Expression& lle = *to_const(le); 01935 const Coefficient& dd = *to_const(d); 01936 pph.affine_preimage(Variable(var), lle, dd); 01937 return 0; 01938 } 01939 CATCH_ALL
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
.
Definition at line 1493 of file ppl_c.cc.
References ppl_Polyhedron_BHRZ03_widening_assign_with_tokens().
Referenced by init(), and ppl_sicstus_init().
01494 { 01495 return ppl_Polyhedron_BHRZ03_widening_assign_with_tokens(x, y, 0); 01496 } 01497 CATCH_ALL
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.
Definition at line 1482 of file ppl_c.cc.
References Parma_Polyhedra_Library::Polyhedron::BHRZ03_widening_assign().
Referenced by init(), ppl_Polyhedron_BHRZ03_widening_assign(), and ppl_sicstus_init().
01484 { 01485 Polyhedron& xx = *to_nonconst(x); 01486 const Polyhedron& yy = *to_const(y); 01487 xx.BHRZ03_widening_assign(yy, tp); 01488 return 0; 01489 } 01490 CATCH_ALL
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 .
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. |
Definition at line 1942 of file ppl_c.cc.
References Parma_Polyhedra_Library::Polyhedron::bounded_affine_image().
Referenced by init(), and ppl_sicstus_init().
01946 { 01947 Polyhedron& pph = *to_nonconst(ph); 01948 const Linear_Expression& llb = *to_const(lb); 01949 const Linear_Expression& uub = *to_const(ub); 01950 const Coefficient& dd = *to_const(d); 01951 pph.bounded_affine_image(Variable(var), llb, uub, dd); 01952 return 0; 01953 } 01954 CATCH_ALL
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 .
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. |
Definition at line 1957 of file ppl_c.cc.
References Parma_Polyhedra_Library::Polyhedron::bounded_affine_preimage().
Referenced by init(), and ppl_sicstus_init().
01961 { 01962 Polyhedron& pph = *to_nonconst(ph); 01963 const Linear_Expression& llb = *to_const(lb); 01964 const Linear_Expression& uub = *to_const(ub); 01965 const Coefficient& dd = *to_const(d); 01966 pph.bounded_affine_preimage(Variable(var), llb, uub, dd); 01967 return 0; 01968 } 01969 CATCH_ALL
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 and
, with
, that are satisfied by all the points of
x
.
Definition at line 1539 of file ppl_c.cc.
References ppl_Polyhedron_bounded_BHRZ03_extrapolation_assign_with_tokens().
Referenced by init(), and ppl_sicstus_init().
01541 { 01542 return ppl_Polyhedron_bounded_BHRZ03_extrapolation_assign_with_tokens(x, y, 01543 cs, 0); 01544 } 01545 CATCH_ALL
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 and
, with
, 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.
Definition at line 1525 of file ppl_c.cc.
References Parma_Polyhedra_Library::Polyhedron::bounded_BHRZ03_extrapolation_assign().
Referenced by init(), ppl_Polyhedron_bounded_BHRZ03_extrapolation_assign(), and ppl_sicstus_init().
01528 { 01529 Polyhedron& xx = *to_nonconst(x); 01530 const Polyhedron& yy = *to_const(y); 01531 const Constraint_System& ccs = *to_const(cs); 01532 xx.bounded_BHRZ03_extrapolation_assign(yy, ccs, tp); 01533 return 0; 01534 } 01535 CATCH_ALL
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 and
, with
, that are satisfied by all the points of
x
.
Definition at line 1605 of file ppl_c.cc.
References ppl_Polyhedron_bounded_H79_extrapolation_assign_with_tokens().
Referenced by init(), and ppl_sicstus_init().
01607 { 01608 return ppl_Polyhedron_bounded_H79_extrapolation_assign_with_tokens(x, y, 01609 cs, 0); 01610 } 01611 CATCH_ALL
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 and
, with
, 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.
Definition at line 1591 of file ppl_c.cc.
References Parma_Polyhedra_Library::Polyhedron::bounded_H79_extrapolation_assign().
Referenced by init(), ppl_Polyhedron_bounded_H79_extrapolation_assign(), and ppl_sicstus_init().
01594 { 01595 Polyhedron& xx = *to_nonconst(x); 01596 const Polyhedron& yy = *to_const(y); 01597 const Constraint_System& ccs = *to_const(cs); 01598 xx.bounded_H79_extrapolation_assign(yy, ccs, tp); 01599 return 0; 01600 } 01601 CATCH_ALL
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.
Definition at line 2156 of file ppl_c.cc.
References Parma_Polyhedra_Library::Polyhedron::bounds_from_above().
Referenced by init(), and ppl_sicstus_init().
02157 { 02158 const Polyhedron& pph = *to_const(ph); 02159 const Linear_Expression& lle = *to_const(le); 02160 return pph.bounds_from_above(lle) ? 1 : 0; 02161 } 02162 CATCH_ALL
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.
Definition at line 2165 of file ppl_c.cc.
References Parma_Polyhedra_Library::Polyhedron::bounds_from_below().
Referenced by init(), and ppl_sicstus_init().
02166 { 02167 const Polyhedron& pph = *to_const(ph); 02168 const Linear_Expression& lle = *to_const(le); 02169 return pph.bounds_from_below(lle) ? 1 : 0; 02170 } 02171 CATCH_ALL
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
.
Definition at line 1443 of file ppl_c.cc.
References Parma_Polyhedra_Library::Polyhedron::concatenate_assign().
Referenced by init(), and ppl_sicstus_init().
01444 { 01445 Polyhedron& xx = *to_nonconst(x); 01446 const Polyhedron& yy = *to_const(y); 01447 xx.concatenate_assign(yy); 01448 return 0; 01449 } 01450 CATCH_ALL
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
.
Definition at line 1624 of file ppl_c.cc.
References Parma_Polyhedra_Library::Polyhedron::constraints().
01625 { 01626 const Polyhedron& pph = *to_const(ph); 01627 const Constraint_System& cs = pph.constraints(); 01628 *pcs = to_const(&cs); 01629 return 0; 01630 } 01631 CATCH_ALL
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.
Definition at line 2229 of file ppl_c.cc.
References Parma_Polyhedra_Library::Polyhedron::contains().
Referenced by init(), and ppl_sicstus_init().
02230 { 02231 const Polyhedron& xx = *to_const(x); 02232 const Polyhedron& yy = *to_const(y); 02233 return xx.contains(yy) ? 1 : 0; 02234 } 02235 CATCH_ALL
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.
Definition at line 2256 of file ppl_c.cc.
Referenced by init(), and ppl_sicstus_init().
02257 { 02258 const Polyhedron& xx = *to_const(x); 02259 const Polyhedron& yy = *to_const(y); 02260 return (xx == yy) ? 1 : 0; 02261 } 02262 CATCH_ALL
int ppl_Polyhedron_expand_space_dimension | ( | ppl_Polyhedron_t | ph, | |
ppl_dimension_type | d, | |||
ppl_dimension_type | m | |||
) |
Expands the -th dimension of the vector space enclosing
ph
to m
new space dimensions.
Definition at line 1892 of file ppl_c.cc.
References Parma_Polyhedra_Library::Polyhedron::expand_space_dimension().
Referenced by init(), and ppl_sicstus_init().
01894 { 01895 Polyhedron& pph = *to_nonconst(ph); 01896 pph.expand_space_dimension(Variable(d), m); 01897 return 0; 01898 } 01899 CATCH_ALL
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.
Definition at line 1902 of file ppl_c.cc.
References Parma_Polyhedra_Library::Polyhedron::fold_space_dimensions().
Referenced by init(), and ppl_sicstus_init().
01905 { 01906 Polyhedron& pph = *to_nonconst(ph); 01907 Variables_Set to_be_folded; 01908 for (ppl_dimension_type i = n; i-- > 0; ) 01909 to_be_folded.insert(Variable(ds[i])); 01910 pph.fold_space_dimensions(to_be_folded, Variable(d)); 01911 return 0; 01912 } 01913 CATCH_ALL
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 , where
is the relation symbol encoded by
relsym
.
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. |
Definition at line 1994 of file ppl_c.cc.
References Parma_Polyhedra_Library::Polyhedron::generalized_affine_image(), and relation_symbol().
Referenced by init(), and ppl_sicstus_init().
01998 { 01999 Polyhedron& pph = *to_nonconst(ph); 02000 const Linear_Expression& lle = *to_const(le); 02001 const Coefficient& dd = *to_const(d); 02002 pph.generalized_affine_image(Variable(var), relation_symbol(relsym), lle, 02003 dd); 02004 return 0; 02005 } 02006 CATCH_ALL
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 , where
is the relation symbol encoded by
relsym
.
ph | The polyhedron that is transformed; | |
lhs | The left hand side affine expression; | |
relsym | The relation symbol; | |
rhs | The right hand side affine expression. |
Definition at line 2026 of file ppl_c.cc.
References Parma_Polyhedra_Library::Polyhedron::generalized_affine_image(), and relation_symbol().
Referenced by init(), and ppl_sicstus_init().
02029 { 02030 Polyhedron& pph = *to_nonconst(ph); 02031 const Linear_Expression& llhs = *to_const(lhs); 02032 const Linear_Expression& rrhs = *to_const(rhs); 02033 pph.generalized_affine_image(llhs, relation_symbol(relsym), rrhs); 02034 return 0; 02035 } 02036 CATCH_ALL
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 , where
is the relation symbol encoded by
relsym
.
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. |
Definition at line 2010 of file ppl_c.cc.
References Parma_Polyhedra_Library::Polyhedron::generalized_affine_preimage(), and relation_symbol().
Referenced by init(), and ppl_sicstus_init().
02014 { 02015 Polyhedron& pph = *to_nonconst(ph); 02016 const Linear_Expression& lle = *to_const(le); 02017 const Coefficient& dd = *to_const(d); 02018 pph.generalized_affine_preimage(Variable(var), relation_symbol(relsym), lle, 02019 dd); 02020 return 0; 02021 } 02022 CATCH_ALL
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 , where
is the relation symbol encoded by
relsym
.
ph | The polyhedron that is transformed; | |
lhs | The left hand side affine expression; | |
relsym | The relation symbol; | |
rhs | The right hand side affine expression. |
Definition at line 2040 of file ppl_c.cc.
References Parma_Polyhedra_Library::Polyhedron::generalized_affine_preimage(), and relation_symbol().
Referenced by init(), and ppl_sicstus_init().
02043 { 02044 Polyhedron& pph = *to_nonconst(ph); 02045 const Linear_Expression& llhs = *to_const(lhs); 02046 const Linear_Expression& rrhs = *to_const(rhs); 02047 pph.generalized_affine_preimage(llhs, relation_symbol(relsym), rrhs); 02048 return 0; 02049 } 02050 CATCH_ALL
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
.
Definition at line 1644 of file ppl_c.cc.
References Parma_Polyhedra_Library::Polyhedron::generators().
01645 { 01646 const Polyhedron& pph = *to_const(ph); 01647 const Generator_System& gs = pph.generators(); 01648 *pgs = to_const(&gs); 01649 return 0; 01650 } 01651 CATCH_ALL
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
.
Definition at line 1559 of file ppl_c.cc.
References ppl_Polyhedron_H79_widening_assign_with_tokens().
Referenced by init(), and ppl_sicstus_init().
01560 { 01561 return ppl_Polyhedron_H79_widening_assign_with_tokens(x, y, 0); 01562 } 01563 CATCH_ALL
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.
Definition at line 1548 of file ppl_c.cc.
References Parma_Polyhedra_Library::Polyhedron::H79_widening_assign().
Referenced by init(), ppl_Polyhedron_H79_widening_assign(), and ppl_sicstus_init().
01550 { 01551 Polyhedron& xx = *to_nonconst(x); 01552 const Polyhedron& yy = *to_const(y); 01553 xx.H79_widening_assign(yy, tp); 01554 return 0; 01555 } 01556 CATCH_ALL
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
.
Definition at line 1424 of file ppl_c.cc.
References Parma_Polyhedra_Library::Polyhedron::intersection_assign().
Referenced by init(), and ppl_sicstus_init().
01425 { 01426 Polyhedron& xx = *to_nonconst(x); 01427 const Polyhedron& yy = *to_const(y); 01428 xx.intersection_assign(yy); 01429 return 0; 01430 } 01431 CATCH_ALL
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.
Definition at line 1434 of file ppl_c.cc.
References Parma_Polyhedra_Library::Polyhedron::intersection_assign_and_minimize().
Referenced by init(), and ppl_sicstus_init().
01435 { 01436 Polyhedron& xx = *to_nonconst(x); 01437 const Polyhedron& yy = *to_const(y); 01438 return xx.intersection_assign_and_minimize(yy) ? 1 : 0; 01439 } 01440 CATCH_ALL
int ppl_Polyhedron_is_bounded | ( | ppl_const_Polyhedron_t | ph | ) |
Returns a positive integer if ph
is bounded; returns 0 if ph
is unbounded.
Definition at line 2149 of file ppl_c.cc.
References Parma_Polyhedra_Library::Polyhedron::is_bounded().
Referenced by init(), and ppl_sicstus_init().
02149 { 02150 const Polyhedron& pph = *to_const(ph); 02151 return pph.is_bounded() ? 1 : 0; 02152 } 02153 CATCH_ALL
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.
Definition at line 2247 of file ppl_c.cc.
References Parma_Polyhedra_Library::Polyhedron::is_disjoint_from().
Referenced by init(), and ppl_sicstus_init().
02248 { 02249 const Polyhedron& xx = *to_const(x); 02250 const Polyhedron& yy = *to_const(y); 02251 return xx.is_disjoint_from(yy) ? 1 : 0; 02252 } 02253 CATCH_ALL
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.
Definition at line 2135 of file ppl_c.cc.
References Parma_Polyhedra_Library::Polyhedron::is_empty().
Referenced by init(), and ppl_sicstus_init().
02135 { 02136 const Polyhedron& pph = *to_const(ph); 02137 return pph.is_empty() ? 1 : 0; 02138 } 02139 CATCH_ALL
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.
Definition at line 2214 of file ppl_c.cc.
References Parma_Polyhedra_Library::Polyhedron::is_topologically_closed().
Referenced by init(), and ppl_sicstus_init().
02214 { 02215 const Polyhedron& pph = *to_const(ph); 02216 return pph.is_topologically_closed() ? 1 : 0; 02217 } 02218 CATCH_ALL
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.
Definition at line 2142 of file ppl_c.cc.
References Parma_Polyhedra_Library::Polyhedron::is_universe().
Referenced by init(), and ppl_sicstus_init().
02142 { 02143 const Polyhedron& pph = *to_const(ph); 02144 return pph.is_universe() ? 1 : 0; 02145 } 02146 CATCH_ALL
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
.
Definition at line 1515 of file ppl_c.cc.
References ppl_Polyhedron_limited_BHRZ03_extrapolation_assign_with_tokens().
Referenced by init(), and ppl_sicstus_init().
01517 { 01518 return ppl_Polyhedron_limited_BHRZ03_extrapolation_assign_with_tokens(x, y, 01519 cs, 0); 01520 } 01521 CATCH_ALL
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.
Definition at line 1501 of file ppl_c.cc.
References Parma_Polyhedra_Library::Polyhedron::limited_BHRZ03_extrapolation_assign().
Referenced by init(), ppl_Polyhedron_limited_BHRZ03_extrapolation_assign(), and ppl_sicstus_init().
01504 { 01505 Polyhedron& xx = *to_nonconst(x); 01506 const Polyhedron& yy = *to_const(y); 01507 const Constraint_System& ccs = *to_const(cs); 01508 xx.limited_BHRZ03_extrapolation_assign(yy, ccs, tp); 01509 return 0; 01510 } 01511 CATCH_ALL
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
.
Definition at line 1581 of file ppl_c.cc.
References ppl_Polyhedron_limited_H79_extrapolation_assign_with_tokens().
Referenced by init(), and ppl_sicstus_init().
01583 { 01584 return ppl_Polyhedron_limited_H79_extrapolation_assign_with_tokens(x, y, 01585 cs, 0); 01586 } 01587 CATCH_ALL
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.
Definition at line 1567 of file ppl_c.cc.
References Parma_Polyhedra_Library::Polyhedron::limited_H79_extrapolation_assign().
Referenced by init(), ppl_Polyhedron_limited_H79_extrapolation_assign(), and ppl_sicstus_init().
01570 { 01571 Polyhedron& xx = *to_nonconst(x); 01572 const Polyhedron& yy = *to_const(y); 01573 const Constraint_System& ccs = *to_const(cs); 01574 xx.limited_H79_extrapolation_assign(yy, ccs, tp); 01575 return 0; 01576 } 01577 CATCH_ALL
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.
Definition at line 1881 of file ppl_c.cc.
References Parma_Polyhedra_Library::Polyhedron::map_space_dimensions().
Referenced by init(), and ppl_sicstus_init().
01883 { 01884 Polyhedron& pph = *to_nonconst(ph); 01885 PIFunc pifunc(maps, n); 01886 pph.map_space_dimensions(pifunc); 01887 return 0; 01888 } 01889 CATCH_ALL
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.
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. |
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.
Definition at line 2174 of file ppl_c.cc.
References Parma_Polyhedra_Library::Polyhedron::maximize().
Referenced by init(), and ppl_sicstus_init().
02179 { 02180 const Polyhedron& pph = *to_const(ph); 02181 const Linear_Expression& lle = *to_const(le); 02182 Coefficient& ssup_n = *to_nonconst(sup_n); 02183 Coefficient& ssup_d = *to_nonconst(sup_d); 02184 Generator& ppoint = *to_nonconst(point); 02185 bool maximum; 02186 bool ok = pph.maximize(lle, ssup_n, ssup_d, maximum, ppoint); 02187 if (ok) 02188 *pmaximum = maximum ? 1 : 0; 02189 return ok ? 1 : 0; 02190 } 02191 CATCH_ALL
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.
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. |
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.
Definition at line 2194 of file ppl_c.cc.
References Parma_Polyhedra_Library::Polyhedron::minimize().
Referenced by init(), and ppl_sicstus_init().
02199 { 02200 const Polyhedron& pph = *to_const(ph); 02201 const Linear_Expression& lle = *to_const(le); 02202 Coefficient& iinf_n = *to_nonconst(inf_n); 02203 Coefficient& iinf_d = *to_nonconst(inf_d); 02204 Generator& ppoint = *to_nonconst(point); 02205 bool minimum; 02206 bool ok = pph.minimize(lle, iinf_n, iinf_d, minimum, ppoint); 02207 if (ok) 02208 *pminimum = minimum ? 1 : 0; 02209 return ok ? 1 : 0; 02210 } 02211 CATCH_ALL
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
.
Definition at line 1634 of file ppl_c.cc.
References Parma_Polyhedra_Library::Polyhedron::minimized_constraints().
01635 { 01636 const Polyhedron& pph = *to_const(ph); 01637 const Constraint_System& cs = pph.minimized_constraints(); 01638 *pcs = to_const(&cs); 01639 return 0; 01640 } 01641 CATCH_ALL
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
.
Definition at line 1654 of file ppl_c.cc.
References Parma_Polyhedra_Library::Polyhedron::minimized_generators().
01655 { 01656 const Polyhedron& pph = *to_const(ph); 01657 const Generator_System& gs = pph.minimized_generators(); 01658 *pgs = to_const(&gs); 01659 return 0; 01660 } 01661 CATCH_ALL
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.
Definition at line 2265 of file ppl_c.cc.
Referenced by init(), and ppl_sicstus_init().
02265 { 02266 return to_const(ph)->OK() ? 1 : 0; 02267 } 02268 CATCH_ALL
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
.
Definition at line 1472 of file ppl_c.cc.
References Parma_Polyhedra_Library::Polyhedron::poly_difference_assign().
Referenced by init(), and ppl_sicstus_init().
01473 { 01474 Polyhedron& xx = *to_nonconst(x); 01475 const Polyhedron& yy = *to_const(y); 01476 xx.poly_difference_assign(yy); 01477 return 0; 01478 } 01479 CATCH_ALL
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
.
Definition at line 1453 of file ppl_c.cc.
References Parma_Polyhedra_Library::Polyhedron::poly_hull_assign().
Referenced by init(), and ppl_sicstus_init().
01454 { 01455 Polyhedron& xx = *to_nonconst(x); 01456 const Polyhedron& yy = *to_const(y); 01457 xx.poly_hull_assign(yy); 01458 return 0; 01459 } 01460 CATCH_ALL
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.
Definition at line 1463 of file ppl_c.cc.
References Parma_Polyhedra_Library::Polyhedron::poly_hull_assign_and_minimize().
Referenced by init(), and ppl_sicstus_init().
01464 { 01465 Polyhedron& xx = *to_nonconst(x); 01466 const Polyhedron& yy = *to_const(y); 01467 return xx.poly_hull_assign_and_minimize(yy) ? 1 : 0; 01468 } 01469 CATCH_ALL
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
.
Definition at line 2117 of file ppl_c.cc.
References Parma_Polyhedra_Library::Poly_Con_Relation::get_flags(), and Parma_Polyhedra_Library::Polyhedron::relation_with().
02118 { 02119 const Polyhedron& pph = *to_const(ph); 02120 const Constraint& cc = *to_const(c); 02121 return pph.relation_with(cc).get_flags(); 02122 } 02123 CATCH_ALL
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
.
Definition at line 2126 of file ppl_c.cc.
References Parma_Polyhedra_Library::Poly_Con_Relation::get_flags(), and Parma_Polyhedra_Library::Polyhedron::relation_with().
02127 { 02128 const Polyhedron& pph = *to_const(ph); 02129 const Generator& gg = *to_const(g); 02130 return pph.relation_with(gg).get_flags(); 02131 } 02132 CATCH_ALL
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
.
Definition at line 1812 of file ppl_c.cc.
References Parma_Polyhedra_Library::Polyhedron::remove_higher_space_dimensions().
Referenced by init(), and ppl_sicstus_init().
01813 { 01814 Polyhedron& pph = *to_nonconst(ph); 01815 pph.remove_higher_space_dimensions(d); 01816 return 0; 01817 } 01818 CATCH_ALL
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.
Definition at line 1799 of file ppl_c.cc.
References Parma_Polyhedra_Library::Polyhedron::remove_space_dimensions().
Referenced by init(), and ppl_sicstus_init().
01801 { 01802 Polyhedron& pph = *to_nonconst(ph); 01803 Variables_Set to_be_removed; 01804 for (ppl_dimension_type i = n; i-- > 0; ) 01805 to_be_removed.insert(Variable(ds[i])); 01806 pph.remove_space_dimensions(to_be_removed); 01807 return 0; 01808 } 01809 CATCH_ALL
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.
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 ![]() closed is non-zero, with ![]() closed is zero. The fraction ![]() ![]() ![]() ![]() ![]() | |
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 ![]() closed is non-zero, with ![]() closed is zero. The fraction ![]() |
Definition at line 2095 of file ppl_c.cc.
References Parma_Polyhedra_Library::ANY_COMPLEXITY, Parma_Polyhedra_Library::POLYNOMIAL_COMPLEXITY, PPL_ERROR_INVALID_ARGUMENT, Parma_Polyhedra_Library::Polyhedron::shrink_bounding_box(), and Parma_Polyhedra_Library::SIMPLEX_COMPLEXITY.
02103 { 02104 if (complexity != POLYNOMIAL_COMPLEXITY 02105 && complexity != SIMPLEX_COMPLEXITY 02106 && complexity != ANY_COMPLEXITY) 02107 return PPL_ERROR_INVALID_ARGUMENT; 02108 02109 const Polyhedron& pph = *to_const(ph); 02110 C_Shrink_Box csbox(set_empty, raise_lower_bound, lower_upper_bound); 02111 pph.shrink_bounding_box(csbox, Complexity_Class(complexity)); 02112 return 0; 02113 } 02114 CATCH_ALL
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
.
Definition at line 1408 of file ppl_c.cc.
Referenced by init(), and ppl_sicstus_init().
01409 { 01410 *m = to_const(ph)->space_dimension(); 01411 return 0; 01412 } 01413 CATCH_ALL
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.
Definition at line 2238 of file ppl_c.cc.
References Parma_Polyhedra_Library::Polyhedron::strictly_contains().
Referenced by init(), and ppl_sicstus_init().
02239 { 02240 const Polyhedron& xx = *to_const(x); 02241 const Polyhedron& yy = *to_const(y); 02242 return xx.strictly_contains(yy) ? 1 : 0; 02243 } 02244 CATCH_ALL
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
.
Definition at line 1614 of file ppl_c.cc.
References Parma_Polyhedra_Library::Polyhedron::time_elapse_assign().
Referenced by init(), and ppl_sicstus_init().
01615 { 01616 Polyhedron& xx = *to_nonconst(x); 01617 const Polyhedron& yy = *to_const(y); 01618 xx.time_elapse_assign(yy); 01619 return 0; 01620 } 01621 CATCH_ALL
int ppl_Polyhedron_topological_closure_assign | ( | ppl_Polyhedron_t | ph | ) |
Assigns to ph
its topological closure.
Definition at line 2221 of file ppl_c.cc.
References Parma_Polyhedra_Library::Polyhedron::topological_closure_assign().
Referenced by init(), and ppl_sicstus_init().
02221 { 02222 Polyhedron& pph = *to_nonconst(ph); 02223 pph.topological_closure_assign(); 02224 return 0; 02225 } 02226 CATCH_ALL
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_subtract_Linear_Expression_from_Linear_Expression | ( | ppl_Linear_Expression_t | dst, | |
ppl_const_Linear_Expression_t | src | |||
) |
Subtracts the linear expression src
from dst
.
Definition at line 490 of file ppl_c.cc.
00490 { 00491 Linear_Expression& ddst = *to_nonconst(dst); 00492 const Linear_Expression& ssrc = *to_const(src); 00493 ddst -= ssrc; 00494 return 0; 00495 } 00496 CATCH_ALL
PPL_TYPE_DECLARATION | ( | LP_Problem | ) |
PPL_TYPE_DECLARATION | ( | Polyhedron | ) |
PPL_TYPE_DECLARATION | ( | Generator_System_const_iterator | ) |
PPL_TYPE_DECLARATION | ( | Generator_System | ) |
PPL_TYPE_DECLARATION | ( | Generator | ) |
PPL_TYPE_DECLARATION | ( | Constraint_System_const_iterator | ) |
PPL_TYPE_DECLARATION | ( | Constraint_System | ) |
PPL_TYPE_DECLARATION | ( | Constraint | ) |
PPL_TYPE_DECLARATION | ( | Linear_Expression | ) |
PPL_TYPE_DECLARATION | ( | Coefficient | ) |
int ppl_version | ( | const char ** | p | ) |
Writes to *p
a pointer to a character string containing the PPL version.
Definition at line 268 of file ppl_c.cc.
References Parma_Polyhedra_Library::version().
Referenced by init(), and ppl_sicstus_init().
00268 { 00269 // Note: use explicit qualification to avoid clashes on, e.g., 00270 // Solaris 2.9, where `version' is the name of an enum defined in 00271 // math.h. 00272 *p = Parma_Polyhedra_Library::version(); 00273 return 0; 00274 } 00275 CATCH_ALL
int ppl_version_beta | ( | void | ) |
Returns the beta number of the PPL version.
Definition at line 262 of file ppl_c.cc.
References Parma_Polyhedra_Library::version_beta().
Referenced by init(), and ppl_sicstus_init().
00262 { 00263 return version_beta(); 00264 } 00265 CATCH_ALL
int ppl_version_major | ( | void | ) |
Returns the major number of the PPL version.
Definition at line 244 of file ppl_c.cc.
References Parma_Polyhedra_Library::version_major().
Referenced by init(), and ppl_sicstus_init().
00244 { 00245 return version_major(); 00246 } 00247 CATCH_ALL
int ppl_version_minor | ( | void | ) |
Returns the minor number of the PPL version.
Definition at line 250 of file ppl_c.cc.
References Parma_Polyhedra_Library::version_minor().
Referenced by init(), and ppl_sicstus_init().
00250 { 00251 return version_minor(); 00252 } 00253 CATCH_ALL
int ppl_version_revision | ( | void | ) |
Returns the revision number of the PPL version.
Definition at line 256 of file ppl_c.cc.
References Parma_Polyhedra_Library::version_revision().
Referenced by init(), and ppl_sicstus_init().
00256 { 00257 return version_revision(); 00258 } 00259 CATCH_ALL
unsigned int PPL_COMPLEXITY_CLASS_ANY |
unsigned int PPL_COMPLEXITY_CLASS_POLYNOMIAL |
unsigned int PPL_COMPLEXITY_CLASS_SIMPLEX |
unsigned int PPL_POLY_CON_RELATION_IS_DISJOINT |
unsigned int PPL_POLY_CON_RELATION_IS_INCLUDED |
unsigned int PPL_POLY_CON_RELATION_SATURATES |
unsigned int PPL_POLY_CON_RELATION_STRICTLY_INTERSECTS |
unsigned int PPL_POLY_GEN_RELATION_SUBSUMES |