#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <unistd.h>
#include <assert.h>
#include <polylib/polylib.h>
#include <polylib/homogenization.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. | |
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) |
void | evalue_div (evalue *e, Value n) |
void evalue_div (e, n) divides the evalue e by the integer n recursive function Warning : modifies e | |
Enumeration * | Ehrhart_Quick_Apx_Full_Dim (Polyhedron *Pi, Polyhedron *C, unsigned MAXRAYS, char **param_name) |
Ehrhart_Quick_Apx_Full_Dim(P, C, MAXRAYS, param_names). | |
Enumeration * | Ehrhart_Quick_Apx (Matrix *M, Matrix *C, Matrix **Validity_Lattice, unsigned MAXRAYS, char **param_name) |
Ehrhart_Quick_Apx. | |
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 618 of file ehrhart.c. Referenced by cherche_min(). |
|
Reduce the degree of resulting polynomials.
|
|
Comments.
Definition at line 572 of file ehrhart.c. References aep_evalue(), _evalue::d, enode, evalue, Matrix, matrix::NbColumns, matrix::NbRows, matrix::p, p, value_notzero_p, and _evalue::x. Referenced by Ehrhart_Quick_Apx_Full_Dim(), and Polyhedron_Enumerate(). |
|
local recursive function used in the following ref contains the new position for each old index position
Definition at line 552 of file ehrhart.c. References _evalue::d, enode, evalue, p, value_notzero_p, and _evalue::x. Referenced by addeliminatedparams_evalue(). |
|
Definition at line 619 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 1131 of file ehrhart.c. References count_points(), emptyQ, lower_upper_bounds(), polyhedron::next, P_VALUE_FMT, POL_ENSURE_FACETS, POL_ENSURE_VERTICES, 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_subtract. |
|
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 150 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 244 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(). |
|
Ehrhart_Quick_Apx. computes the approximation of the Ehrhart polynomial of a polyhedron (implicit form -> matrix), treating the non-full-dimensional case.
Definition at line 2656 of file ehrhart.c. References Constraints2Polyhedron(), Ehrhart_Quick_Apx_Full_Dim(), Enumeration, full_dimensionize(), Matrix, Matrix_Free(), MAXRAYS, mpolyhedron_compress_last_vars(), matrix::NbColumns, Polyhedron, Polyhedron_Free(), and show_matrix. Referenced by main(). |
|
|
multiplies two evalues and puts the result in res
Definition at line 351 of file ehrhart.c. References _evalue::d, enode, evalue, Gcd(), new_enode(), p, 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 1719 of file ehrhart.c. References assert, CATCH, count_points(), _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_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 Ehrhart_Quick_Apx_Full_Dim(), and Polyhedron_Enumerate(). |
|
Definition at line 2184 of file ehrhart.c. References Domain_Free(), Enumeration, _enumeration::EP, free_evalue_refs(), _enumeration::next, and _enumeration::ValidityDomain. |
|
void evalue_div (e, n) divides the evalue e by the integer n recursive function Warning : modifies e
Definition at line 2212 of file ehrhart.c. References _evalue::d, evalue, Gcd(), Value, value_clear, value_division, value_init, value_multiply, value_notone_p, value_notzero_p, value_zero_p, and _evalue::x. Referenced by Ehrhart_Quick_Apx_Full_Dim(). |
|
releases all memory referenced by e. (recursive)
Definition at line 122 of file ehrhart.c. References _evalue::d, enode, evalue, free_evalue_refs(), p, 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 97 of file ehrhart.c. References _enode::arr, _evalue::d, enode, evalue, _enode::pos, _enode::size, 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 1049 of file ehrhart.c. References AddConstraints(), polyhedron::Constraint, polyhedron::Dimension, Gcd(), Matrix, Matrix_Alloc(), Matrix_Free(), MAXRAYS, polyhedron::NbConstraints, matrix::p, p, matrix::p_Init, Polyhedron, size, Value, value_absolute, value_addmul, 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 1232 of file ehrhart.c. References _enode::arr, count_points(), _evalue::d, edot(), enode, evector, free_evalue_refs(), 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_subtract, VALUE_TO_INT, value_zero_p, and _evalue::x. Referenced by Ehrhart_Quick_Apx_Full_Dim(), and Polyhedron_Enumerate(). |
|
Procedure to count points in a parameterized polytope.
Definition at line 1838 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, _enumeration::EP, homogenize(), Matrix, Matrix_Free(), MAXRAYS, matrix::NbColumns, polyhedron::NbEq, matrix::NbRows, _Param_Domain::next, _enumeration::next, overflow_error, overflow_warning_flag, P_Enum(), P_VALUE_FMT, Param_Domain, Param_Polyhedron, POL_ENSURE_FACETS, POL_ENSURE_VERTICES, POL_NO_DUAL, Polyhedron, Polyhedron2Param_SimplifiedDomain(), Polyhedron_Free(), Polyhedron_Preimage(), Polyhedron_Preprocess(), Polyhedron_Preprocess2(), Polyhedron_Print(), Polyhedron_Scan(), PolyhedronIncludes(), Print_Domain(), print_evalue(), reduce_evalue(), Scan_Vertices(), TRY, UNCATCH, Universe_Polyhedron(), _enumeration::ValidityDomain, Value, value_addto, value_clear, value_init, value_multiply, value_notzero_p, value_print, value_set_si, value_zero_p, Vector_Set(), and _evalue::x. |
|
This procedure finds the smallest parallelepiped of size 'size[i]' for every dimension i, contained in polyhedron D. If this is not possible, NULL is returned
Definition at line 727 of file ehrhart.c. References assert, 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(), size, Universe_Polyhedron(), Value, value_addmul, value_addto, value_clear, value_init, value_ne, value_neg_p, value_oppose, value_print, value_set_si, value_sub_int, value_zero_p, and Vector_Copy(). Referenced by Ehrhart_Quick_Apx_Full_Dim(), and 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 887 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, size, 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_subtract, and value_zero_p. Referenced by Ehrhart_Quick_Apx_Full_Dim(), and Polyhedron_Enumerate(). |
|
prints the enode to DST
Definition at line 199 of file ehrhart.c. References enode, evector, p, periodic, polynomial, and print_evalue(). |
|
Definition at line 175 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 278 of file ehrhart.c. References _evalue::d, eequal(), enode, evalue, free_evalue_refs(), p, periodic, polynomial, reduce_evalue(), value_clear, value_notzero_p, value_one_p, value_zero_p, and _evalue::x. |
|
Definition at line 1642 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 81 of file ehrhart.c. Referenced by Ehrhart_Quick_Apx_Full_Dim(), Enumerate_NoParameters(), P_Enum(), and Polyhedron_Enumerate(). |