#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <unistd.h>
#include <assert.h>
#include <polylib/polylib.h>
Go to the source code of this file.
Defines | |
#define | EPRINT_ALL_VALIDITY_CONSTRAINTS |
define this to print all constraints on the validity domains if not defined, only new constraints (not in validity domain given by the user) are printed | |
#define | REDUCE_DEGREE |
Reduce the degree of resulting polynomials. | |
#define | ALL_OVERFLOW_WARNINGS |
define this to print one warning message per domain overflow these overflows should no longer happen since version 4.20 | |
#define | MAXITER 100 |
This procedure finds an integer point contained in polyhedron D / first checks for positive values, then for negative values returns TRUE on success. | |
Functions | |
enode * | new_enode (enode_type type, int size, int pos) |
EHRHART POLYNOMIAL SYMBOLIC ALGEBRA SYSTEM. | |
void | free_evalue_refs (evalue *e) |
releases all memory referenced by e. | |
enode * | ecopy (enode *e) |
void | print_evalue (FILE *DST, evalue *e, char **pname) |
void | print_enode (FILE *DST, enode *p, char **pname) |
prints the enode to DST | |
int | eequal (evalue *e1, evalue *e2) |
void | reduce_evalue (evalue *e) |
void | emul (evalue *e1, evalue *e2, evalue *res) |
multiplies two evalues and puts the result in res | |
void | eadd (evalue *e1, evalue *res) |
adds one evalue to evalue 'res. | |
void | edot (enode *v1, enode *v2, evalue *res) |
computes the inner product of two vectors. | |
void | aep_evalue (evalue *e, int *ref) |
local recursive function used in the following ref contains the new position for each old index position | |
void | addeliminatedparams_evalue (evalue *e, Matrix *CT) |
Comments. | |
int | cherche_min (Value *min, Polyhedron *D, int pos) |
Polyhedron * | Polyhedron_Preprocess (Polyhedron *D, Value *size, unsigned MAXRAYS) |
This procedure finds the smallest parallelepiped of size 'size[i]' for every dimension i, contained in polyhedron D If this is not possible, an empty polyhedron is returned. | |
Polyhedron * | Polyhedron_Preprocess2 (Polyhedron *D, Value *size, Value *lcm, unsigned MAXRAYS) |
This procedure finds an hypercube of size 'size', containing polyhedron D increases size and lcm if necessary (and not "too big") If this is not possible, an empty polyhedron is returned. | |
Polyhedron * | old_Polyhedron_Preprocess (Polyhedron *D, Value size, unsigned MAXRAYS) |
This procedure adds additional constraints to D so that as each parameter is scanned, it will have a minimum of 'size' points If this is not possible, an empty polyhedron is returned. | |
void | count_points (int pos, Polyhedron *P, Value *context, Value *res) |
PROCEDURES TO COMPUTE ENUMERATION. | |
enode * | P_Enum (Polyhedron *L, Polyhedron *LQ, Value *context, int pos, int nb_param, int dim, Value *lcm, char **param_name) |
void | Scan_Vertices (Param_Polyhedron *PP, Param_Domain *Q, Matrix *CT, Value *lcm, int nbp, char **param_name) |
Enumeration * | Enumerate_NoParameters (Polyhedron *P, Polyhedron *C, Matrix *CT, Polyhedron *CEq, unsigned MAXRAYS, char **param_name) |
Procedure to count points in a non-parameterized polytope. | |
Enumeration * | Polyhedron_Enumerate (Polyhedron *Pi, Polyhedron *C, unsigned MAXRAYS, char **param_name) |
Procedure to count points in a parameterized polytope. | |
void | Enumeration_Free (Enumeration *en) |
Variables | |
int | overflow_warning_flag = 1 |
|
define this to print one warning message per domain overflow these overflows should no longer happen since version 4.20
|
|
define this to print all constraints on the validity domains if not defined, only new constraints (not in validity domain given by the user) are printed
|
|
This procedure finds an integer point contained in polyhedron D / first checks for positive values, then for negative values returns TRUE on success. Result is in min. returns FALSE if no integer point is found This is the maximum number of iterations for a given parameter to find a integer point inside the context. Kind of weird. cherche_min should
Definition at line 619 of file ehrhart.c. Referenced by cherche_min(). |
|
Reduce the degree of resulting polynomials.
|
|
Comments.
Definition at line 573 of file ehrhart.c. References aep_evalue(), _evalue::d, enode, evalue, Matrix, matrix::NbColumns, matrix::NbRows, matrix::p, value_notzero_p, and _evalue::x. Referenced by Polyhedron_Enumerate(). |
|
local recursive function used in the following ref contains the new position for each old index position
Definition at line 553 of file ehrhart.c. References _enode::arr, _evalue::d, enode, evalue, _enode::pos, _enode::size, value_notzero_p, and _evalue::x. Referenced by addeliminatedparams_evalue(). |
|
Definition at line 620 of file ehrhart.c. References polyhedron::Dimension, LB_INFINITY, lower_upper_bounds(), MAXITER, min, polyhedron::next, P_VALUE_FMT, Polyhedron, UB_INFINITY, Value, value_assign, value_clear, value_decrement, value_ge, value_increment, value_init, value_le, value_neg_p, value_pos_p, value_print, and value_set_si. Referenced by Polyhedron_Preprocess(). |
|
PROCEDURES TO COMPUTE ENUMERATION. recursive procedure, recurse for each imbriquation
Definition at line 1128 of file ehrhart.c. References count_points(), emptyQ, lower_upper_bounds(), polyhedron::next, P_VALUE_FMT, Polyhedron, Value, value_add_int, value_addto, value_assign, value_clear, value_increment, value_init, value_le, value_lt, value_notmone_p, value_print, value_set_si, and value_substract. |
|
adds one evalue to evalue 'res. result = res + e1
Definition at line 393 of file ehrhart.c. References _enode::arr, _evalue::d, eadd(), ecopy(), enode, evalue, free_evalue_refs(), Gcd(), periodic, polynomial, Value, value_addto, value_clear, value_division, value_init, value_multiply, value_notone_p, value_notzero_p, value_zero_p, and _evalue::x. |
|
Definition at line 149 of file ehrhart.c. References _enode::arr, _evalue::d, ecopy(), enode, new_enode(), _enode::pos, _enode::size, _enode::type, value_assign, value_init, value_zero_p, and _evalue::x. |
|
computes the inner product of two vectors. Result = result (evalue) = v1.v2 (dot product)
Definition at line 509 of file ehrhart.c. References _enode::arr, _evalue::d, eadd(), emul(), enode, evalue, evector, free_evalue_refs(), _enode::size, _enode::type, value_init, value_set_si, and _evalue::x. |
|
Definition at line 242 of file ehrhart.c. References _enode::arr, _evalue::d, enode, evalue, _enode::pos, _enode::size, _enode::type, value_ne, value_notzero_p, and _evalue::x. Referenced by reduce_evalue(). |
|
multiplies two evalues and puts the result in res
Definition at line 351 of file ehrhart.c. References _enode::arr, _evalue::d, enode, evalue, Gcd(), new_enode(), _enode::pos, _enode::size, _enode::type, Value, value_clear, value_division, value_init, value_multiply, value_notone_p, value_notzero_p, value_set_si, value_zero_p, and _evalue::x. Referenced by edot(). |
|
Procedure to count points in a non-parameterized polytope.
Definition at line 1708 of file ehrhart.c. References assert, CATCH, _evalue::d, polyhedron::Dimension, Domain_Free(), DomainIntersection(), emptyQ, Enumeration, _enumeration::EP, Matrix, MAXRAYS, polyhedron::NbRays, new_enode(), _enumeration::next, overflow_error, overflow_warning_flag, P_Enum(), P_VALUE_FMT, Polyhedron, Polyhedron_Free(), Polyhedron_Preimage(), Polyhedron_Print(), Polyhedron_Scan(), polynomial, Print_Domain(), print_evalue(), polyhedron::Ray, TRY, UNCATCH, Universe_Polyhedron(), _enumeration::ValidityDomain, Value, value_clear, value_init, value_notone_p, value_print, value_set_si, value_zero_p, Vector_Set(), and _evalue::x. Referenced by Polyhedron_Enumerate(). |
|
Definition at line 2145 of file ehrhart.c. References Enumeration, _enumeration::EP, free_evalue_refs(), _enumeration::next, Polyhedron_Free(), and _enumeration::ValidityDomain. |
|
releases all memory referenced by e. (recursive)
Definition at line 121 of file ehrhart.c. References _enode::arr, _evalue::d, enode, evalue, free_evalue_refs(), _enode::size, value_clear, value_notzero_p, and _evalue::x. |
|
EHRHART POLYNOMIAL SYMBOLIC ALGEBRA SYSTEM. The newly allocated enode can be freed with a simple free(x)
Definition at line 96 of file ehrhart.c. References _enode::arr, _evalue::d, enode, evalue, _enode::pos, _enode::size, _enode::type, value_init, value_set_si, and _evalue::x. |
|
This procedure adds additional constraints to D so that as each parameter is scanned, it will have a minimum of 'size' points If this is not possible, an empty polyhedron is returned.
Definition at line 1047 of file ehrhart.c. References AddConstraints(), polyhedron::Constraint, polyhedron::Dimension, Gcd(), Matrix, Matrix_Alloc(), Matrix_Free(), MAXRAYS, polyhedron::NbConstraints, matrix::p, matrix::p_Init, Polyhedron, Value, value_absolute, value_addto, value_assign, value_clear, value_division, value_init, value_multiply, value_negz_p, value_notzero_p, value_oppose, value_posz_p, value_set_si, Vector_Combine(), and Vector_Normalize(). |
|
Definition at line 1226 of file ehrhart.c. References _enode::arr, count_points(), _evalue::d, edot(), enode, evector, Gauss(), Gcd(), LB_INFINITY, lower_upper_bounds(), Matrix, Matrix_Alloc(), Matrix_Free(), Matrix_Print(), new_enode(), polyhedron::next, overflow_warning_flag, matrix::p, P_VALUE_FMT, periodic, Polyhedron, polynomial, print_enode(), print_evalue(), UB_INFINITY, Value, value_add_int, value_addto, value_assign, value_clear, value_division, VALUE_FMT, value_gt, value_increment, value_init, value_lt, value_modulus, value_multiply, value_neg_p, value_notzero_p, value_pos_p, value_print, value_set_si, value_sub_int, value_substract, VALUE_TO_INT, value_zero_p, and _evalue::x. Referenced by Enumerate_NoParameters(), and Polyhedron_Enumerate(). |
|
|
This procedure finds the smallest parallelepiped of size 'size[i]' for every dimension i, contained in polyhedron D If this is not possible, an empty polyhedron is returned.
Definition at line 728 of file ehrhart.c. References cherche_min(), polyhedron::Constraint, Constraints2Polyhedron(), polyhedron::Dimension, Domain_Free(), emptyQ, Matrix, Matrix_Alloc(), Matrix_Free(), Matrix_Print(), MAXRAYS, min, polyhedron::NbConstraints, matrix::NbRows, matrix::p, P_VALUE_FMT, Polyhedron, Polyhedron_Free(), Polyhedron_Print(), Polyhedron_Scan(), Universe_Polyhedron(), Value, value_addto, value_clear, value_init, value_multiply, value_ne, value_neg_p, value_oppose, value_print, value_set_si, value_sub_int, value_zero_p, and Vector_Copy(). Referenced by Polyhedron_Enumerate(). |
|
This procedure finds an hypercube of size 'size', containing polyhedron D increases size and lcm if necessary (and not "too big") If this is not possible, an empty polyhedron is returned.
Definition at line 885 of file ehrhart.c. References Constraints2Polyhedron(), polyhedron::Dimension, Matrix, Matrix_Alloc(), Matrix_Free(), Matrix_Print(), MAXRAYS, polyhedron::NbRays, matrix::p, P_VALUE_FMT, Polyhedron, polyhedron::Ray, s, Value, value_add_int, value_addto, value_assign, value_clear, value_division, VALUE_FMT, value_gt, value_init, value_le, value_lt, value_multiply, value_oppose, value_print, value_set_si, value_sub_int, value_substract, and value_zero_p. Referenced by Polyhedron_Enumerate(). |
|
prints the enode to DST
Definition at line 197 of file ehrhart.c. References _enode::arr, enode, evector, periodic, polynomial, _enode::pos, print_evalue(), _enode::size, and _enode::type. |
|
Definition at line 173 of file ehrhart.c. References _evalue::d, evalue, print_enode(), VALUE_FMT, value_notone_p, value_notzero_p, value_print, and _evalue::x. |
|
Definition at line 276 of file ehrhart.c. References _enode::arr, _evalue::d, eequal(), enode, evalue, free_evalue_refs(), periodic, polynomial, reduce_evalue(), _enode::size, _enode::type, value_clear, value_notzero_p, value_one_p, value_zero_p, and _evalue::x. |
|
Definition at line 1631 of file ehrhart.c. References _Param_Domain::F, Gcd(), Matrix, Matrix_Free(), MSB, _Param_Polyhedron::nbV, NEXT, Param_Domain, Param_Polyhedron, Param_Vertices, Print_Vertex(), _Param_Polyhedron::V, Value, value_assign, value_clear, value_division, value_init, value_multiply, value_notone_p, value_notzero_p, value_set_si, and VertexCT(). Referenced by Polyhedron_Enumerate(). |
|
Definition at line 80 of file ehrhart.c. Referenced by Enumerate_NoParameters(), P_Enum(), and Polyhedron_Enumerate(). |