polylib 5.22.8
|
Go to the source code of this file.
Functions | |
void | count_points (int pos, Polyhedron *P, Value *context, Value *res) |
PROCEDURES TO COMPUTE ENUMERATION. More... | |
void | eadd (evalue *e1, evalue *res) |
adds one evalue to evalue 'res. More... | |
enode * | ecopy (enode *e) |
void | edot (enode *v1, enode *v2, evalue *res) |
computes the inner product of two vectors. More... | |
enode * | new_enode (enode_type type, int size, int pos) |
EHRHART POLYNOMIAL SYMBOLIC ALGEBRA SYSTEM. More... | |
void | free_evalue_refs (evalue *e) |
releases all memory referenced by e. More... | |
Enumeration * | Polyhedron_Enumerate (Polyhedron *P, Polyhedron *C, unsigned MAXRAYS, const char **pname) |
Procedure to count points in a parameterized polytope. More... | |
void | print_enode (FILE *DST, enode *p, const char **pname) |
prints the enode to DST More... | |
void | print_evalue (FILE *DST, evalue *e, const char **pname) |
void | reduce_evalue (evalue *e) |
void | Enumeration_Free (Enumeration *en) |
Enumeration * | Ehrhart_Quick_Apx (Matrix *M, Matrix *C, Matrix **Validity_Lattice, unsigned MAXRAYS) |
Computes the approximation of the Ehrhart polynomial of a polyhedron (implicit form -> matrix), treating the non-full-dimensional case. More... | |
Enumeration * | Enumeration_zero (unsigned int nbParms, unsigned int maxRays) |
returns a constant Ehrhart polynomial whose value is zero for any value of the parameters. More... | |
Variables | |
int | overflow_warning_flag |
void count_points | ( | int | pos, |
Polyhedron * | P, | ||
Value * | context, | ||
Value * | res | ||
) |
PROCEDURES TO COMPUTE ENUMERATION.
recursive procedure, recurse for each imbriquation
pos | index position of current loop index (1..hdim-1) |
P | loop domain |
context | context values for fixed indices |
res | the number of integer points in this polyhedron |
Definition at line 1154 of file ehrhart.c.
References count_points(), emptyQ, lower_upper_bounds(), polyhedron::next, P_VALUE_FMT, POL_ENSURE_FACETS, POL_ENSURE_VERTICES, 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_subtract.
Referenced by check_poly(), count_points(), Enumerate_NoParameters(), and P_Enum().
adds one evalue to evalue 'res.
result = res + e1
e1 | an evalue |
res |
Definition at line 385 of file ehrhart.c.
References _enode::arr, _evalue::d, eadd(), ecopy(), free_evalue_refs(), periodic, polynomial, value_addto, value_clear, value_divexact, value_gcd, value_init, value_multiply, value_notone_p, value_notzero_p, value_zero_p, and _evalue::x.
e | pointer to an evalue |
Definition at line 144 of file ehrhart.c.
References _enode::arr, _evalue::d, ecopy(), new_enode(), _enode::pos, _enode::size, _enode::type, value_assign, value_init, value_zero_p, and _evalue::x.
Referenced by Domain_Enumerate(), eadd(), ecopy(), and new_eadd().
computes the inner product of two vectors.
Result = result (evalue) = v1.v2 (dot product)
v1 | an enode (vector) |
v2 | an enode (vector of constants) |
res | result (evalue) |
Definition at line 514 of file ehrhart.c.
References _enode::arr, _evalue::d, eadd(), emul(), evector, free_evalue_refs(), _enode::size, _enode::type, value_init, value_set_si, and _evalue::x.
Referenced by P_Enum().
Enumeration * Ehrhart_Quick_Apx | ( | Matrix * | M, |
Matrix * | C, | ||
Matrix ** | Validity_Lattice, | ||
unsigned | maxRays | ||
) |
Computes the approximation of the Ehrhart polynomial of a polyhedron (implicit form -> matrix), treating the non-full-dimensional case.
M | a polyhedron under implicit form |
C | M's context under implicit form |
Validity_Lattice | a pointer to the parameter's validity lattice |
MAXRAYS | the needed "working space" for other polylib functions used here |
param_name | the names of the parameters, |
Definition at line 2627 of file ehrhart.c.
References Constraints2Polyhedron(), Ehrhart_Quick_Apx_Full_Dim(), full_dimensionize(), Matrix_Free(), maxRays, mpolyhedron_compress_last_vars(), matrix::NbColumns, Polyhedron_Free(), and show_matrix.
Referenced by Constraints_EhrhartQuickApx(), and main().
void Enumeration_Free | ( | Enumeration * | en | ) |
Definition at line 2225 of file ehrhart.c.
References Domain_Free(), _enumeration::EP, free_evalue_refs(), _enumeration::next, and _enumeration::ValidityDomain.
Referenced by main(), and test_Constraints_fullDimensionize().
Enumeration * Enumeration_zero | ( | unsigned int | nbParms, |
unsigned int | maxRays | ||
) |
returns a constant Ehrhart polynomial whose value is zero for any value of the parameters.
nbParms | the number of parameters, i.e., the number of arguments to the Ehrhart polynomial |
Definition at line 2719 of file ehrhart.c.
References Constraints2Polyhedron(), Matrix_Alloc(), Matrix_Free(), maxRays, matrix::p, Polyhedron_Enumerate(), Polyhedron_Free(), Universe_Polyhedron(), and value_set_si.
Referenced by test_Constraints_fullDimensionize().
void free_evalue_refs | ( | evalue * | e | ) |
releases all memory referenced by e.
(recursive)
e | pointer to an evalue |
Definition at line 115 of file ehrhart.c.
References _enode::arr, _evalue::d, free_evalue_refs(), _enode::size, value_clear, value_notzero_p, and _evalue::x.
Referenced by dehomogenize_evalue(), Domain_Enumerate(), eadd(), edot(), Enumeration_Free(), free_evalue_refs(), main(), P_Enum(), and reduce_evalue().
enode * new_enode | ( | enode_type | type, |
int | size, | ||
int | pos | ||
) |
EHRHART POLYNOMIAL SYMBOLIC ALGEBRA SYSTEM.
The newly allocated enode can be freed with a simple free(x)
type | : enode type |
size | : degree+1 for polynomial, period for periodic |
pos | : 1..nb_param, position of parameter |
Definition at line 90 of file ehrhart.c.
References _enode::arr, _evalue::d, _enode::pos, _enode::size, _enode::type, value_init, value_set_si, and _evalue::x.
Referenced by ecopy(), emul(), Enumerate_NoParameters(), new_eadd(), and P_Enum().
Enumeration * Polyhedron_Enumerate | ( | Polyhedron * | Pi, |
Polyhedron * | C, | ||
unsigned | MAXRAYS, | ||
const char ** | param_name | ||
) |
Procedure to count points in a parameterized polytope.
Pi | Polyhedron to enumerate |
C | Context Domain |
MAXRAYS | size of workspace |
param_name | parameter names (array of strings), may be NULL |
Definition at line 1870 of file ehrhart.c.
References addeliminatedparams_evalue(), assert, CATCH, _Param_Polyhedron::D, _evalue::d, dehomogenize_evalue(), polyhedron::Dimension, _Param_Domain::Domain, Domain_Free(), DomainIntersection(), DomainSimplify(), emptyQ, Enumerate_NoParameters(), _enumeration::EP, _Param_Domain::F, homogenize(), Matrix_Free(), MAXRAYS, polyhedron::NbBid, matrix::NbColumns, polyhedron::NbEq, polyhedron::NbRays, matrix::NbRows, _Param_Domain::next, _enumeration::next, overflow_error, overflow_warning_flag, P_Enum(), P_VALUE_FMT, Param_Polyhedron_Free(), Param_Vertices_Free(), Pi, POL_ENSURE_FACETS, POL_ENSURE_VERTICES, POL_ISSET, POL_NO_DUAL, Polyhedron2Param_SimplifiedDomain(), Polyhedron_Free(), Polyhedron_Preimage(), Polyhedron_Preprocess(), Polyhedron_Preprocess2(), Polyhedron_Print(), Polyhedron_Scan(), PolyhedronIncludes(), Print_Domain(), print_evalue(), polyhedron::Ray, reduce_evalue(), Scan_Vertices(), TRY, UNCATCH, Universe_Polyhedron(), _Param_Polyhedron::V, _enumeration::ValidityDomain, value_addto, value_clear, value_init, value_multiply, value_notzero_p, value_print, value_set_si, value_zero_p, Vector_Set(), and _evalue::x.
Referenced by Domain_Enumerate(), Enumeration_zero(), main(), and test_Constraints_fullDimensionize().
void print_enode | ( | FILE * | DST, |
enode * | p, | ||
const char ** | pname | ||
) |
prints the enode to DST
DST | destination file |
p | pointer to enode to be printed |
pname | array of strings, name of the parameters |
Definition at line 190 of file ehrhart.c.
References _enode::arr, evector, periodic, polynomial, _enode::pos, print_evalue(), _enode::size, and _enode::type.
Referenced by P_Enum(), and print_evalue().
void print_evalue | ( | FILE * | DST, |
evalue * | e, | ||
const char ** | pname | ||
) |
DST | destination file |
e | pointer to evalue to be printed |
pname | array of strings, name of the parameters |
Definition at line 169 of file ehrhart.c.
References _evalue::d, print_enode(), value_notone_p, value_notzero_p, value_print, and _evalue::x.
Referenced by compute_poly(), Ehrhart_Quick_Apx_Full_Dim(), Enumerate_NoParameters(), main(), P_Enum(), Polyhedron_Enumerate(), print_enode(), and test_Constraints_fullDimensionize().
void reduce_evalue | ( | evalue * | e | ) |
e | pointer to an evalue |
Definition at line 271 of file ehrhart.c.
References _enode::arr, _evalue::d, eequal(), 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.
Referenced by Ehrhart_Quick_Apx_Full_Dim(), Polyhedron_Enumerate(), and reduce_evalue().
|
extern |
Definition at line 74 of file ehrhart.c.
Referenced by Ehrhart_Quick_Apx_Full_Dim(), Enumerate_NoParameters(), P_Enum(), and Polyhedron_Enumerate().