47#define EPRINT_ALL_VALIDITY_CONSTRAINTS
70#define ALL_OVERFLOW_WARNINGS
96 fprintf(stderr,
"Allocating enode of size 0 !\n");
103 for (i = 0; i < size; i++) {
131 for (i = 0; i < p->
size; i++) {
150 for (i = 0; i < e->
size; ++i) {
194 fprintf(DST,
"NULL");
199 for (i = 0; i < p->
size; i++) {
201 if (i != (p->
size - 1))
204 fprintf(DST,
" }\n");
207 for (i = p->
size - 1; i >= 0; i--) {
210 fprintf(DST,
" * %s + ", pname[p->
pos - 1]);
212 fprintf(DST,
" * %s^%d + ", pname[p->
pos - 1], i);
214 fprintf(DST,
" )\n");
217 for (i = 0; i < p->
size; i++) {
219 if (i != (p->
size - 1))
222 fprintf(DST,
" ]_%s", pname[p->
pos - 1]);
260 for (i = 0; i < p1->
size; i++)
282 for (i = 0; i < p->
size; i++)
288 for (i = 1; i <= (p->
size) / 2; i++) {
289 if ((p->
size % i) == 0) {
292 for (j = 0; j < i; j++)
293 for (k = j + i; k < e->
x.p->size; k += i)
298 for (j = i; j < p->
size; j++)
317 for (i = p->
size - 1; i >= 1; i--) {
351 fprintf(stderr,
"emul: ?expecting constant value\n");
370 for (i = 0; i < p->
size; i++) {
371 emul(&p->
arr[i], e2, &(res->
x.p->arr[i]));
414 eadd(e1, &res->
x.p->arr[0]);
422 for (i = 0; i < res->
x.p->size; i++) {
423 eadd(e1, &res->
x.p->arr[i]);
430 fprintf(stderr,
"eadd: cannot add const with vector\n");
437 fprintf(stderr,
"eadd: cannot add evalue to const\n");
443 if ((e1->
x.p->type != res->
x.p->type) || (e1->
x.p->pos != res->
x.p->pos)) {
444 fprintf(stderr,
"eadd: ?cannot add, incompatible types\n");
450 if (e1->
x.p->size == res->
x.p->size) {
451 for (i = 0; i < res->
x.p->size; i++) {
452 eadd(&e1->
x.p->arr[i], &res->
x.p->arr[i]);
467 if (e1->
x.p->size > res->
x.p->size) {
470 for (i = 0; i < res->
x.p->size; ++i) {
471 eadd(&res->
x.p->arr[i], &tmp->
arr[i]);
476 for (i = 0; i < e1->
x.p->size; i++) {
477 eadd(&e1->
x.p->arr[i], &res->
x.p->arr[i]);
485 fprintf(stderr,
"eadd: ?addition of different sized periodic nos\n");
491 fprintf(stderr,
"eadd: ?cannot add vectors of different length\n");
520 fprintf(stderr,
"edot: ?expecting vectors\n");
524 fprintf(stderr,
"edot: ? vector lengths do not agree\n");
537 for (i = 1; i < v1->
size; i++) {
568 for (i = 0; i < p->
size; i++)
572 p->
pos = ref[p->
pos - 1] + 1;
589 ref = (
int *)malloc(
sizeof(
int) * (CT->
NbRows - 1));
590 for (i = 0; i < CT->
NbRows - 1; i++)
640 fprintf(stderr,
"Entering Cherche min --> \n");
641 fprintf(stderr,
"LowerUpperBounds :\n");
642 fprintf(stderr,
"pos = %d\n", pos);
643 fprintf(stderr,
"current min = (");
648 fprintf(stderr,
", ");
652 fprintf(stderr,
")\n");
658 fprintf(stderr,
"flag = %d\n", flag);
659 fprintf(stderr,
"binf = ");
661 fprintf(stderr,
"\n");
662 fprintf(stderr,
"bsup = ");
664 fprintf(stderr,
"\n");
746 if (MAXRAYS < 2 * D->NbConstraints)
756 fprintf(stderr,
"M for PreProcess : ");
758 fprintf(stderr,
"\nsize == ");
759 for (i = 0; i < d; i++)
761 fprintf(stderr,
"\n");
767 fprintf(stderr,
"Polyhedron_Preprocess: ");
769 "an equality was found where I did expect an inequality.\n");
770 fprintf(stderr,
"Trying to continue...\n");
774 for (j = 1; j <= d; j++)
785 fprintf(stderr,
"M used to find min : ");
798 min = (Value *)malloc(
sizeof(Value) * (d + 2));
799 for (i = 0; i <= d; i++) {
811 for (i = 0; i <= (d + 1); i++) {
813 fprintf(stderr,
" ,");
815 fprintf(stderr,
"\n");
817 fprintf(stderr,
"\n");
821 for (i = 0; i <= (d + 1); i++)
828 fprintf(stderr,
"min = ( ");
830 for (i = 2; i <= d; i++) {
831 fprintf(stderr,
", ");
834 fprintf(stderr,
")\n");
839 for (i = 0; i < d; i++) {
843 for (j = 1; j <= d; j++)
850 for (j = 1; j <= d; j++)
858 fprintf(stderr,
"PolyhedronPreprocess: constraints H = ");
866 fprintf(stderr,
"\n");
870 for (i = 0; i <= (d + 1); i++)
912 fprintf(stderr,
"\nPreProcess2 : starting\n");
913 fprintf(stderr,
"lcm = ");
916 fprintf(stderr,
", size = ");
919 fprintf(stderr,
"\n");
929 for (r = 1; r < D->
NbRays; r++) {
949 for (r = 1; r < D->
NbRays; r++) {
970 fprintf(stderr,
"size on dimension %d\n", i);
971 fprintf(stderr,
"lcm = ");
974 fprintf(stderr,
", size = ");
977 fprintf(stderr,
"\n");
978 fprintf(stderr,
"required size (s) = ");
980 fprintf(stderr,
"\n");
1004 fprintf(stderr,
"new size = ");
1007 fprintf(stderr,
", new lcm = ");
1010 fprintf(stderr,
"\n");
1016 fprintf(stderr,
"Failed on dimension %d.\n", i);
1036 fprintf(stderr,
"PreProcess2 : c =");
1064 Value a, a1, b, b1, g, aa;
1065 Value abs_a, abs_b, size_copy;
1066 int dim, con, newi, needed;
1087 for (p = 1; p <= dim; p++) {
1088 for (ub = 0; ub < con; ub++) {
1092 for (lb = 0; lb < con; lb++) {
1101 for (p1 = 1; p1 < p; p1++) {
1175 fprintf(stderr,
"count_points: ? infinite domain\n");
1187 fprintf(stderr,
"(");
1188 for (i = 1; i < pos; i++) {
1190 fprintf(stderr,
",");
1193 fprintf(stderr,
")\n");
1241 fprintf(stderr,
"%d\n", CNT);
1266 int nb_param,
int dim, Value *lcm,
1267 const char **param_name) {
1269 int hdim, i, j, rank, flag;
1270 Value
n, g, nLB, nUB, nlcm, noff, nexp, k1, nm, hdv, k, lcm_copy;
1275 fprintf(stderr,
"-------------------- begin P_Enum -------------------\n");
1276 fprintf(stderr,
"Calling P_Enum with pos = %d\n", pos);
1299 hdim = dim - nb_param + 1;
1340 fprintf(stderr,
"*************** n **********\n");
1342 fprintf(stderr,
"\n");
1350 fprintf(stderr,
"\n*************** n ************\n");
1361 i = VALUE_TO_INT(tmp);
1364 i = VALUE_TO_INT(tmp);
1370 fprintf(stderr,
"\n*************** n ************\n");
1378 fprintf(stdout,
"Parameter #%d: LB=", pos);
1380 fprintf(stdout,
" UB=");
1382 fprintf(stdout,
" lcm=");
1384 fprintf(stdout,
" degree reduced to %d\n", hdim - 1);
1393 for (i = 0; i < hdim; i++) {
1395 l = VALUE_TO_INT(lcm_copy);
1405 for (j = 0; j < hdim; ++j)
1430 fprintf(stderr,
"Finding ");
1432 fprintf(stderr,
"-th elements of periodic coefficients\n");
1446#ifdef ALL_OVERFLOW_WARNINGS
1448 fprintf(stdout,
"Domain Overflow: Parameter #%d:", pos);
1449 fprintf(stdout,
"nLB=");
1451 fprintf(stdout,
" n=");
1453 fprintf(stdout,
" nUB=");
1455 fprintf(stdout,
"\n");
1460 fprintf(stdout,
"\nWARNING: Parameter Domain Overflow.");
1461 fprintf(stdout,
" Result may be incorrect on this domain.\n");
1471 fprintf(stderr,
"%s = ", param_name[pos - 1]);
1473 fprintf(stderr,
" (hdim=%d, lcm[%d]=", hdim, pos - 1);
1475 fprintf(stderr,
")\n");
1477 fprintf(stderr,
"P%d = ", pos);
1479 fprintf(stderr,
" (hdim=%d, lcm[%d]=", hdim, pos - 1);
1481 fprintf(stderr,
")\n");
1486 if (pos == nb_param) {
1489 fprintf(stderr,
"Yes\n");
1499 for (j = 1; j < pos; j++)
1501 fprintf(stdout,
"E(");
1502 for (j = 1; j < nb_param; j++) {
1503 value_print(stdout, VALUE_FMT, context[dim - nb_param + j]);
1504 fprintf(stdout,
",");
1507 fprintf(stdout,
") = ");
1509 fprintf(stdout,
" =");
1515 B->
arr[i].
x.p =
P_Enum(L, LQ->
next, context, pos + 1, nb_param, dim,
1520 for (j = 1; j < pos; j++)
1522 fprintf(stdout,
"E(");
1523 for (j = 1; j <= pos; j++) {
1524 value_print(stdout, VALUE_FMT, context[dim - nb_param + j]);
1525 fprintf(stdout,
",");
1527 for (j = pos + 1; j < nb_param; j++)
1528 fprintf(stdout,
"%s,", param_name[j]);
1529 fprintf(stdout,
"%s) = ", param_name[j]);
1531 fprintf(stdout,
" =");
1541 for (j = 1; j <= hdim; j++) {
1546 fprintf(stdout,
" + ");
1548 fprintf(stdout,
" c%d", j);
1554 fprintf(stdout,
"\n");
1562 fprintf(stderr,
"P_Enum: ?expecting i==hdim\n");
1566 fprintf(stderr,
"B (enode) =\n");
1569 fprintf(stderr,
"A (Before Gauss) =\n");
1574 rank =
Gauss(A, hdim, 2 * hdim);
1577 fprintf(stderr,
"A (After Gauss) =\n");
1583 fprintf(stderr,
"P_Enum: ?expecting rank==hdim\n");
1594 for (i = 0; i < rank; i++) {
1597 for (j = 0; j < rank; j++) {
1598 value_gcd(g, A->
p[i][i + 1], A->
p[i][j + 1 + hdim]);
1607 fprintf(stderr,
"C (enode) =\n");
1613 edot(B, C, &(res->
arr[i].
x.p->arr[VALUE_TO_INT(k1)]));
1617 fprintf(stderr,
"B.C (evalue)=\n");
1620 fprintf(stderr,
"\n");
1624 for (j = 0; j < rank; ++j)
1630 for (i = 0; i < hdim; ++i) {
1639 fprintf(stderr,
"res (enode) =\n");
1642 fprintf(stderr,
"-------------------- end P_Enum -----------------------\n");
1680 Value *lcm,
int nbp,
const char **param_name) {
1682 int i, j, ix, l, np;
1692 for (np = 0; np < nbp; np++)
1696 fprintf(stdout,
"Vertices:\n");
1698 for (i = 0, ix = 0, bx =
MSB, V = PP->
V; V && i < PP->nbV; i++, V = V->
next) {
1699 if (Q->
F[ix] & bx) {
1708 fprintf(stdout,
"\n");
1752 const char **param_name) {
1761 context = (Value *)malloc((hdim + 1) *
sizeof(Value));
1762 for (j = 0; j <= hdim; j++)
1773 fprintf(stderr,
"L = \n");
1788 fprintf(stdout,
"---------------------------------------\n");
1789 fprintf(stdout,
"Domain:\n");
1793 printf(
"Vertices:\n");
1794 for (r = 0; r < P->
NbRays; ++r) {
1825 fprintf(stderr,
"Enumerate: arithmetic overflow error.\n");
1826 fprintf(stderr,
"You should rebuild PolyLib using GNU-MP"
1827 " or increasing the size of integers.\n");
1850 fprintf(stdout,
"\nEhrhart Polynomial:\n");
1852 fprintf(stdout,
"\n");
1855 for (j = 0; j <= hdim; j++)
1871 unsigned MAXRAYS,
const char **param_name) {
1872 Polyhedron *L, *CQ, *CQ2, *LQ, *U, *CEq, *rVD, *P, *Ph = NULL;
1876 int i, hdim, dim, nb_param, np;
1877 Value *lcm, *m1, hdv;
1893 fprintf(stderr,
"C = \n");
1895 fprintf(stderr,
"P = \n");
1904 if (nb_param == 0) {
1908 if (nb_param == dim) {
1917 fprintf(stdout,
"---------------------------------------\n");
1918 fprintf(stdout,
"Domain:\n");
1920 fprintf(stdout,
"\nEhrhart Polynomial:\n");
1922 fprintf(stdout,
"\n");
1929 fprintf(stdout,
"\nEhrhart Polynomial:\nNULL\n");
1941 if (nb_param == 0) {
1949 lcm = (Value *)malloc((nb_param + 1) *
sizeof(Value));
1950 m1 = (Value *)malloc((nb_param + 1) *
sizeof(Value));
1952 for (np = 0; np < nb_param + 1; np++) {
1958 for (Q = PP->
D; Q; Q = Q->
next) {
1967 if (!rVD ||
emptyQ(rVD) ||
1984 fprintf(stdout,
"---------------------------------------\n");
1985 fprintf(stdout,
"Domain:\n");
1987#ifdef EPRINT_ALL_VALIDITY_CONSTRAINTS
2005 fprintf(stderr,
"Denominator = ");
2006 for (np = 0; np < nb_param; np++)
2008 fprintf(stderr,
" and hdim == %d \n", hdim);
2012 fprintf(stderr,
"CQ = \n");
2020 for (np = 0; np < nb_param + 1; np++) {
2028 fprintf(stderr,
"m1 == ");
2029 for (np = 0; np < nb_param; np++)
2031 fprintf(stderr,
"\n");
2035 fprintf(stderr,
"Enumerate: arithmetic overflow error.\n");
2042 fprintf(stderr,
"After preprocess, CQ2 = ");
2055 fprintf(stderr,
"Trying to call Polyhedron_Preprocess2 : CQ = \n");
2060 for (r = 0; r < CQ->
NbRays; r++) {
2076 fprintf(stderr,
"Homogenize.\n");
2084 for (np = 0; np < nb_param + 1; np++)
2089 if (!CQ2 ||
emptyQ(CQ2)) {
2091 fprintf(stderr,
"Degenerate.\n");
2093 fprintf(stdout,
"Degenerate Domain. Can not continue.\n");
2101 fprintf(stderr,
"CQ2 = \n");
2104 fprintf(stderr,
"CQ does not include CQ2 !\n");
2106 fprintf(stderr,
"CQ includes CQ2.\n");
2108 fprintf(stderr,
"CQ2 is *not* included in validity domain !\n");
2110 fprintf(stderr,
"CQ2 is included in validity domain.\n");
2127 fprintf(stderr,
"L = \n");
2129 fprintf(stderr,
"LQ = \n");
2133 fprintf(stdout,
"\nSystem of Equations:\n");
2140 context = (Value *)malloc((hdim + 1 + hom) *
sizeof(Value));
2141 for (i = 0; i <= (hdim + hom); i++)
2149 fprintf(stderr,
"Enumerate: arithmetic overflow error.\n");
2150 fprintf(stderr,
"You should rebuild PolyLib using GNU-MP "
2151 "or increasing the size of integers.\n");
2156 res->
EP.
x.p =
P_Enum(L, LQ, context, 1, nb_param + hom, dim + hom, lcm,
2163 for (i = 0; i <= (hdim + hom); i++)
2171 fprintf(stdout,
"\nEhrhart Polynomial (before simplification):\n");
2185 fprintf(stdout,
"\nEhrhart Polynomial:\n");
2187 fprintf(stdout,
"\n");
2196 for (np = 0; np < nb_param + 1; np++) {
2252 for (i = 0; i < e->
x.p->size; i++) {
2284 const char **param_name) {
2285 Polyhedron *L, *CQ, *CQ2, *LQ, *U, *CEq, *rVD, *P;
2289 int i, j, hdim, dim, nb_param, np;
2290 Value *lcm, *m1, hdv;
2293 Value expansion_det;
2305 fprintf(stderr,
"C = \n");
2307 fprintf(stderr,
"P = \n");
2316 if (nb_param == 0) {
2322 printf(
"Enumerating polyhedron : \n");
2329 fprintf(stdout,
"\nEhrhart Polynomial:\nNULL\n");
2341 if (nb_param == 0) {
2354 lcm = (Value *)malloc(nb_param *
sizeof(Value));
2355 m1 = (Value *)malloc(nb_param *
sizeof(Value));
2357 for (np = 0; np < nb_param; np++) {
2384 for (i = 0; i < nb_param; i++)
2387 for (Q = PP->
D; Q; Q = Q->
next) {
2395 if (!rVD ||
emptyQ(rVD) ||
2411 fprintf(stdout,
"---------------------------------------\n");
2412 fprintf(stdout,
"Domain:\n");
2414#ifdef EPRINT_ALL_VALIDITY_CONSTRAINTS
2429 fprintf(stderr,
"Denominator = ");
2430 for (np = 0; np < nb_param; np++)
2432 fprintf(stderr,
" and hdim == %d \n", hdim);
2436 fprintf(stderr,
"CQ = \n");
2444 for (np = 0; np < nb_param; np++) {
2452 fprintf(stderr,
"m1 == ");
2453 for (np = 0; np < nb_param; np++)
2455 fprintf(stderr,
"\n");
2459 fprintf(stderr,
"Enumerate: arithmetic overflow error.\n");
2466 fprintf(stderr,
"After preprocess, CQ2 = ");
2479 fprintf(stderr,
"Trying to call Polyhedron_Preprocess2 : CQ = \n");
2484 for (r = 0; r < CQ->
NbRays; r++) {
2496 if (!CQ2 ||
emptyQ(CQ2)) {
2498 fprintf(stderr,
"Degenerate.\n");
2500 fprintf(stdout,
"Degenerate Domain. Can not continue.\n");
2508 fprintf(stderr,
"CQ2 = \n");
2511 fprintf(stderr,
"CQ does not include CQ2 !\n");
2513 fprintf(stderr,
"CQ includes CQ2.\n");
2515 fprintf(stderr,
"CQ2 is *not* included in validity domain !\n");
2517 fprintf(stderr,
"CQ2 is included in validity domain.\n");
2534 fprintf(stderr,
"L = \n");
2536 fprintf(stderr,
"LQ = \n");
2540 fprintf(stdout,
"\nSystem of Equations:\n");
2547 context = (Value *)malloc((hdim + 1) *
sizeof(Value));
2548 for (i = 0; i <= (hdim); i++)
2556 fprintf(stderr,
"Enumerate: arithmetic overflow error.\n");
2557 fprintf(stderr,
"You should rebuild PolyLib using GNU-MP "
2558 "or increasing the size of integers.\n");
2563 res->
EP.
x.p =
P_Enum(L, LQ, context, 1, nb_param, dim, lcm, param_name);
2567 for (i = 0; i <= (hdim); i++)
2575 fprintf(stdout,
"\nEhrhart Polynomial (before simplification):\n");
2580 fprintf(stdout,
"\nEhrhart Polynomial (before division):\n");
2595 fprintf(stdout,
"\nEhrhart Polynomial:\n");
2597 fprintf(stdout,
"\n");
2608 for (np = 0; np < nb_param; np++) {
2670 Matrix **validityLattice,
2672 unsigned int **elimParms,
2699 unsigned int const *elimParms,
2700 unsigned int nbParms) {
2701 int i = 0, j = 0, k;
2702 int newParmNb = nbParms - elimParms[0];
2703 const char **newParmNames = (
const char **)malloc(newParmNb *
sizeof(
char *));
2704 for (k = 1; k <= elimParms[0]; k++) {
2705 while (i != elimParms[k]) {
2706 newParmNames[i - k + 1] = parmNames[i];
2710 return newParmNames;
Matrix * Matrix_Copy(Matrix const *Src)
#define value_oppose(ref, val)
#define value_sub_int(ref, val, vint)
#define value_notzero_p(val)
#define value_divexact(ref, val1, val2)
#define value_gcd(ref, val1, val2)
#define value_notone_p(val)
#define value_negz_p(val)
#define value_absolute(ref, val)
#define value_add_int(ref, val, vint)
#define value_decrement(ref, val)
#define value_zero_p(val)
#define value_assign(v1, v2)
#define value_increment(ref, val)
#define value_set_si(val, i)
#define value_addmul(ref, val1, val2)
#define value_notmone_p(val)
#define value_division(ref, val1, val2)
#define value_multiply(ref, val1, val2)
#define value_print(Dst, fmt, val)
#define value_modulus(ref, val1, val2)
#define value_subtract(ref, val1, val2)
#define value_addto(ref, val1, val2)
#define value_posz_p(val)
Matrix * Constraints_Remove_parm_eqs(Matrix **M1, Matrix **Ctxt1, int renderSpace, unsigned int **elimParms)
Removes the equalities that involve only parameters, by eliminating some parameters in the polyhedron...
Matrix * full_dimensionize(Matrix const *M, int nbParms, Matrix **validityLattice)
Given a matrix with m parameterized equations, compress the nb_parms parameters and n-m variables so ...
static int eequal(evalue *e1, evalue *e2)
Enumeration * Constraints_EhrhartQuickApx(Matrix const *M, Matrix const *C, Matrix **validityLattice, Matrix **parmEqualities, unsigned int **elimParms, unsigned maxRays)
Computes the approximation of the Ehrhart polynomial of a polyhedron (implicit form -> matrix),...
Polyhedron * old_Polyhedron_Preprocess(Polyhedron *D, Value size, unsigned MAXRAYS)
This procedure adds additional constraints to D so that as each parameter is scanned,...
void edot(enode *v1, enode *v2, evalue *res)
computes the inner product of two vectors.
void evalue_div(evalue *e, Value n)
Divides the evalue e by the integer n recursive function Warning : modifies e.
Enumeration * Enumerate_NoParameters(Polyhedron *P, Polyhedron *C, Matrix *CT, Polyhedron *CEq, unsigned MAXRAYS, const char **param_name)
Procedure to count points in a non-parameterized polytope.
Enumeration * Polyhedron_Enumerate(Polyhedron *Pi, Polyhedron *C, unsigned MAXRAYS, const char **param_name)
Procedure to count points in a parameterized polytope.
Enumeration * Enumeration_zero(unsigned int nbParms, unsigned int maxRays)
returns a constant Ehrhart polynomial whose value is zero for any value of the parameters.
static void emul(evalue *e1, evalue *e2, evalue *res)
multiplies two evalues and puts the result in res
const char ** parmsWithoutElim(char const **parmNames, unsigned int const *elimParms, unsigned int nbParms)
Returns the array of parameter names after some of them have been eliminated.
enode * new_enode(enode_type type, int size, int pos)
EHRHART POLYNOMIAL SYMBOLIC ALGEBRA SYSTEM.
void eadd(evalue *e1, evalue *res)
adds one evalue to evalue 'res.
int cherche_min(Value *min, Polyhedron *D, int pos)
static void aep_evalue(evalue *e, int *ref)
local recursive function used in the following ref contains the new position for each old index posit...
Polyhedron * Polyhedron_Preprocess(Polyhedron *D, Value *size, unsigned MAXRAYS)
This procedure finds the smallest parallelepiped of size 'size[i]' for every dimension i,...
void print_enode(FILE *DST, enode *p, const char **pname)
prints the enode to DST
Enumeration * Ehrhart_Quick_Apx_Full_Dim(Polyhedron *Pi, Polyhedron *C, unsigned MAXRAYS, const char **param_name)
Ehrhart_Quick_Apx_Full_Dim(P, C, MAXRAYS, param_names)
void free_evalue_refs(evalue *e)
releases all memory referenced by e.
void print_evalue(FILE *DST, evalue *e, const char **pname)
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 n...
#define MAXITER
This procedure finds an integer point contained in polyhedron D / first checks for positive values,...
static enode * P_Enum(Polyhedron *L, Polyhedron *LQ, Value *context, int pos, int nb_param, int dim, Value *lcm, const char **param_name)
static void addeliminatedparams_evalue(evalue *e, Matrix *CT)
Comments.
int overflow_warning_flag
void count_points(int pos, Polyhedron *P, Value *context, Value *res)
PROCEDURES TO COMPUTE ENUMERATION.
void reduce_evalue(evalue *e)
void Enumeration_Free(Enumeration *en)
static void Scan_Vertices(Param_Polyhedron *PP, Param_Domain *Q, Matrix *CT, Value *lcm, int nbp, const char **param_name)
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),...
unsigned int overflow_error
Polyhedron * homogenize(Polyhedron *P, unsigned MAXRAYS)
homogenization.h – Bavo Nootaert
void dehomogenize_evalue(evalue *ep, int nb_param)
dehomogenize an evalue.
Matrix * Matrix_Alloc(unsigned NbRows, unsigned NbColumns)
void Matrix_Print(FILE *Dst, const char *Format, Matrix *Mat)
void Matrix_Free(Matrix *Mat)
void mpolyhedron_compress_last_vars(Matrix *M, Matrix *compression)
compress the last vars/pars of the polyhedron M expressed as a polylib matrix
#define show_matrix(M)
Polylib matrix addons Mainly, deals with polyhedra represented in implicit form (set of constraints).
int PolyhedronIncludes(Polyhedron *Pol1, Polyhedron *Pol2)
void Polyhedron_Free(Polyhedron *Pol)
int Gauss(Matrix *Mat, int NbEq, int Dimension)
Polyhedron * Polyhedron_Scan(Polyhedron *D, Polyhedron *C, unsigned NbMaxRays)
Polyhedron * Polyhedron_Preimage(Polyhedron *Pol, Matrix *Func, unsigned NbMaxRays)
Polyhedron * DomainIntersection(Polyhedron *Pol1, Polyhedron *Pol2, unsigned NbMaxRays)
Return the intersection of two polyhedral domains 'Pol1' and 'Pol2'.
Polyhedron * DomainSimplify(Polyhedron *Pol1, Polyhedron *Pol2, unsigned NbMaxRays)
Polyhedron * Universe_Polyhedron(unsigned Dimension)
int lower_upper_bounds(int pos, Polyhedron *P, Value *context, Value *LBp, Value *UBp)
Polyhedron * Constraints2Polyhedron(Matrix *Constraints, unsigned NbMaxRays)
Given a matrix of constraints ('Constraints'), construct and return a polyhedron.
Polyhedron * AddConstraints(Value *Con, unsigned NbConstraints, Polyhedron *Pol, unsigned NbMaxRays)
void Polyhedron_Print(FILE *Dst, const char *Format, const Polyhedron *Pol)
void Domain_Free(Polyhedron *Pol)
#define POL_ENSURE_VERTICES(P)
#define POL_ENSURE_FACETS(P)
void Param_Vertices_Free(Param_Vertices *PV)
void Param_Polyhedron_Free(Param_Polyhedron *P)
void Param_Polyhedron_Scale_Integer(Param_Polyhedron *PP, Polyhedron **P, Value *det, unsigned MaxRays)
Matrix * VertexCT(Matrix *V, Matrix *CT)
Param_Polyhedron * Polyhedron2Param_SimplifiedDomain(Polyhedron **Din, Polyhedron *Cin, int working_space, Polyhedron **CEq, Matrix **CT)
void Print_Vertex(FILE *DST, Matrix *V, const char **param_names)
void Print_Domain(FILE *DST, Polyhedron *D, const char **pname)
struct _Param_Domain * next
struct _Param_Vertex * next
Polyhedron * ValidityDomain
struct _enumeration * next
#define POL_ISSET(flags, f)
void Vector_Set(Value *p, int n, unsigned length)
void Vector_Combine(Value *p1, Value *p2, Value *p3, Value lambda, Value mu, unsigned length)
void Vector_Normalize(Value *p, unsigned length)
void Vector_Copy(Value *p1, Value *p2, unsigned length)