12static int ppcm1(
int a,
int b);
38 for (l = 0; l < R->
NbRows; ++l) {
44 for (j = l + 1; j < R->
NbRows; ++j)
49 for (j = 0; j < l; ++j)
58 for (l = 0; l < R->
NbRows; ++l)
65 for (u = 0; u < dimbase; ++u) {
70 for (i = R->
NbRows - 1; i > l; --i)
73 for (i = l - 1; i >= 0; --i)
82 for (c = l; c > i; --c) {
91 for (i = 0; i < R->
NbRows; ++i)
101 for (i = 0; i < R->
NbRows; ++i)
201 for (j = l; j < R->
NbRows; ++j)
207 for (j = 0; j < l; ++j) {
265 for (i = piv + 1; i < R->
NbColumns; i++) {
317 for (i = 0; i < res->
x.p->size; i++) {
326 fprintf(stderr,
"eadd: cannot add const with vector\n");
352 if ((e1->
x.p->type != res->
x.p->type)) {
377 }
else if (e1->
x.p->pos != res->
x.p->pos) {
381 if (res->
x.p->type ==
393 for (i = 0; i < res->
x.p->size; i++) {
405 if (e1->
x.p->size == res->
x.p->size) {
407 for (i = 0; i < res->
x.p->size; i++) {
408 new_eadd(&e1->
x.p->arr[i], &res->
x.p->arr[i]);
422 if (e1->
x.p->size > res->
x.p->size) {
425 for (i = 0; i < res->
x.p->size; ++i) {
433 for (i = 0; i < e1->
x.p->size; i++) {
434 new_eadd(&e1->
x.p->arr[i], &res->
x.p->arr[i]);
460 for (i = 0; i < p; i++) {
466 ne->
x.p->arr[i].x.p =
ecopy(res->
x.p->arr[i % y].x.p);
469 for (i = 0; i < p; i++) {
470 new_eadd(&e1->
x.p->arr[i % x], &ne->
x.p->arr[i]);
480 fprintf(stderr,
"eadd: ?cannot add vectors of different length\n");
497 p = *(Mat->
p + (Mat->
NbRows - 1));
501 for (i = 0; i < Mat->
NbRows - 1; i++) {
519 for (i = 0; i < length; i++) {
530 t = (a * b) /
pgcd1(a, b);
546 for (k = 0; k < length; k++) {
552 for (i = 1; i < Mat->
NbRows; i++) {
553 for (k = 0; k < length; k++) {
558 for (j = 0; j < i; j++) {
559 for (k = 0; k < length; k++) {
568 for (k = 0; k < length; k++) {
577 for (k = 0; k < length; k++) {
583 for (k = 0; k < length; k++) {
612 for (ren1 = *Ures; ren1; ren1 = ren1->
next) {
614 for (ren2 = *Ures; ren2; ren2 = ren2->
next) {
632 for (en = e; en; en = en->
next) {
645 for (e1 = en->
next; e1; e1 = e1->
next) {
654 for (p = Poldisj; p; p = p->
next) {
676 Enumeration *e, *pr, *en, *en1, *en2, *tmp, *res, *sen;
679 for (d = D; d; d = d->
next) {
689 printf(
"##############################################################\n");
690 printf(
"\n###### DISJOINT UNION ######\n\n");
692 printf(
"##############################################################\n");
695 for (lp1 = lp; lp1; lp1 = lp1->
next) {
702 for (e = en; e; e = enext) {
723 fprintf(stdout,
"Empty Polun\n");
728 while (Polun->
next != NULL) {
737 for (en1 = Polun->
pt; en1; en1 = enext) {
739 for (en2 = (Polun->
next)->pt; en2; en2 = en2->
next) {
769 for (en2 = (Polun->
next)->pt; en2; en2 = enext) {
801 const char **par_name) {
804 Matrix *TCopy, *Tred, *d1, *d;
816 fprintf(stdout,
" Error: in reading input domain \n");
821 "\n ################ INPUT POLYHEDRON #######################\n\n");
827 printf(
"\n $$$$$$$$$$$$$ THE DOMAIN IMAGE $$$$$$$$$$$$$\n\n");
840 printf(
"\n ################## INPUT REDUCED TRANSFORMATION MATRIX "
841 "##################\n");
846 for (i = 0; i < Tred->
NbRows; i++) {
851 for (i = Tred->
NbRows; i < Tred->NbColumns; i++) {
869 printf(
" Ker(A)=0 implys directly Enumeration on input "
881 fprintf(stdout,
" \n Error: incompatible dimension \n");
886 fprintf(stdout,
" \n Error: Can not compute integral points : More then "
887 "vector in ker(A)! \n");
892 " \n Ker(A)=1 implys adding constraints befor Enumeration\n");
897 for (k = 0; k < d1->
NbRows; k++) {
905 for (k = 0; k <= D->
Dimension - 1; k++) {
949 "##################################################################");
950 printf(
"\n ****** THE RESULT OF ADDING CONSTRAINTS TO THE INPUT "
951 "POLYHEDRON ****** \n");
Matrix * Transpose(Matrix *A)
Matrix * Matrix_Copy(Matrix const *Src)
#define value_mone_p(val)
#define value_oppose(ref, val)
#define value_notzero_p(val)
#define value_divexact(ref, val1, val2)
#define value_gcd(ref, val1, val2)
#define value_notone_p(val)
#define value_lcm(ref, val1, val2)
#define value_decrement(ref, val)
#define value_zero_p(val)
#define value_assign(v1, v2)
#define value_set_si(val, i)
#define value_addmul(ref, val1, val2)
#define value_multiply(ref, val1, val2)
#define value_subtract(ref, val1, val2)
#define value_addto(ref, val1, val2)
Enumeration * Polyhedron_Enumerate(Polyhedron *Pi, Polyhedron *C, unsigned MAXRAYS, const char **param_name)
Procedure to count points in a parameterized polytope.
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.
void new_eadd(evalue *e1, evalue *res)
void AffConstraints(Polyhedron *Poldisj)
Matrix * CalcBase(Matrix *R)
void Scalar_product(Value *p1, Value *p2, unsigned length, Value *r)
static int existepivot(Matrix *R, int l)
int Degenerate(Enumeration *en)
static void Soustraire_ligne(Matrix *R, int l1, int l2, int piv)
Polyhedron * DMUnion(Enumeration *en, unsigned MR)
int IncludeInRes(Polyhedron *p, Enumeration *e, unsigned MR)
static int ppcm1(int a, int b)
Enumeration * Polyhedron_Image_Enumerate(Polyhedron *D, Polyhedron *C, Matrix *T, unsigned MAXRAYS, const char **par_name)
Enumeration * Domain_Enumerate(Polyhedron *D, Polyhedron *C, unsigned MAXRAYS, const char **pn)
static void swap_line(Matrix *R, int l1, int l2)
void Remove_RedundantDomains(Enumeration **Ures)
Matrix * Reduce_Matrix(Matrix *Mat)
void Remove_Element(Enumeration *en, Enumeration **re, Enumeration *prev)
struct _Polyhedron_union Polyhedron_union
Matrix * Orthogonal_Base(Matrix *Mat)
Matrix * Matrix_Alloc(unsigned NbRows, unsigned NbColumns)
void Matrix_Print(FILE *Dst, const char *Format, Matrix *Mat)
void Matrix_Free(Matrix *Mat)
int PolyhedronIncludes(Polyhedron *Pol1, Polyhedron *Pol2)
Polyhedron * Disjoint_Domain(Polyhedron *P, int flag, unsigned NbMaxRays)
void Polyhedron_PrintConstraints(FILE *Dst, const char *Format, Polyhedron *Pol)
void Polyhedron_Free(Polyhedron *Pol)
Polyhedron * DomainDifference(Polyhedron *Pol1, Polyhedron *Pol2, unsigned NbMaxRays)
Polyhedron * AddPolyToDomain(Polyhedron *Pol, Polyhedron *PolDomain)
Polyhedron * DomainIntersection(Polyhedron *Pol1, Polyhedron *Pol2, unsigned NbMaxRays)
Return the intersection of two polyhedral domains 'Pol1' and 'Pol2'.
Polyhedron * Polyhedron_Copy(Polyhedron *Pol)
Polyhedron * DomainUnion(Polyhedron *Pol1, Polyhedron *Pol2, unsigned NbMaxRays)
Polyhedron * DomainImage(Polyhedron *Pol, Matrix *Func, unsigned NbMaxConstrs)
Polyhedron * AddConstraints(Value *Con, unsigned NbConstraints, Polyhedron *Pol, unsigned NbMaxRays)
void Domain_Free(Polyhedron *Pol)
#define POL_ENSURE_VERTICES(P)
#define POL_ENSURE_FACETS(P)
struct _Polyhedron_union * next
Polyhedron * ValidityDomain
struct _enumeration * next
void Vector_Free(Vector *vector)
void Vector_Gcd(Value *p, unsigned length, Value *min)
void Vector_AntiScale(Value *p1, Value *p2, Value lambda, unsigned length)
Vector * Vector_Alloc(unsigned length)