20#define CANONICAL_DEBUG 1
21#define INTERSECTION_DEBUG 1
22#define DIFFERENCE_DEBUG 1
23#define LBLDIFF_DEBUG 1
26#define SIMPLIFY_DEBUG 1
27#define SIMPLIFY2_DEBUG 1
81 "the Lattice and the Polyhedron are not compatible to form a LBL");
84 if(Domain &&
emptyQ(Domain)) {
88 A = malloc(
sizeof(
LBL));
90 errormsg1(
"LBLAlloc",
"outofmem",
"Out of Memory");
176 for(tmp = A; tmp->
next; tmp = tmp->
next)
193 A = malloc(
sizeof(
LBL));
195 errormsg1(
"EmptyLBL",
"outofmem",
"Out of Memory");
200 for(
int j = 0 ; j < dimension; j++) {
222 A = malloc(
sizeof(
LBL));
224 errormsg1(
"EmptyLBL",
"outofmem",
"Out of Memory");
244 for( ; A; A = A->
next) {
247 for(tmpB = B; tmpB; tmpB = tmpB->
next) {
289 for(
LBL *tmp = diff; tmp; tmp = tmp->
next) {
309 fprintf(fp,
"LBL: Dimension %d\n", A->
Lat->
NbRows - 1);
311 fprintf(fp,
"\n<empty>\n");
314 fprintf(fp,
"\nLATTICE:\n");
327 fprintf(fp,
"\n<empty>\n");
333 fprintf(fp,
"\nUNION ");
366 LBL *Result = NULL, *tempA, *tempB;
369 errormsg1(
"LBLIntersection",
"dimincomp",
370 "incompatible dimensions between domains");
374 for (tempA = A; tempA; tempA = tempA->
next) {
375 for (tempB = B; tempB; tempB = tempB->
next) {
408 LBL *inter, *res = NULL;
411 fprintf(stderr,
"-----Entering LBLDiff-----\n");
412 fprintf(stderr,
"---- A = ");
414 fprintf(stderr,
"---- B = ");
426 "incompatible dimensions between domains");
447 for (
LBL *tmpi = inter; tmpi; tmpi = tmpi->
next) {
479 for (
LBL *temp = A; temp; temp = temp->
next) {
501 for (
LBL *temp = A; temp; temp = temp->
next) {
537 Polyhedron *PInter, *ImageA, *ImageB, *PreImage;
539 #ifdef INTERSECTION_DEBUG
540 fprintf(stderr,
"-- Entering sLBLIntersection\nA = ");
542 fprintf(stderr,
"B = ");
552 #ifdef INTERSECTION_DEBUG
553 fprintf(stderr,
"Empty Lattice intersection, result = <empty>\n");
554 fprintf(stderr,
"-- exit sLBLIntersection\n");
558 #ifdef INTERSECTION_DEBUG
574 #ifdef INTERSECTION_DEBUG
582 Result =
LBLAlloc(LInter, PreImage);
588 #ifdef INTERSECTION_DEBUG
589 fprintf(stderr,
"Z-polyhedra, simplified intersection = ");
591 fprintf(stderr,
"empty\n");
594 fprintf(stderr,
"-- exit sLBLIntersection\n");
604 int extra_max_rows = 0, extra_B_row = A->
Lat->
NbRows - 1;
605 Matrix *newL = NULL, *extra;
615 for(
int i = 0; i < newL->
NbRows; i++) {
634 #ifdef INTERSECTION_DEBUG
635 fprintf(stderr,
"AP_aligned = ");
642 if(A->
Lat->
NbRows + BP->NbConstraints > extra_max_rows) {
643 extra_max_rows = A->
Lat->
NbRows + BP->NbConstraints;
646 extra =
Matrix_Alloc(extra_max_rows, AP_aligned->Dimension + 2);
647 Vector_Set(extra->p[0], 0, extra->NbRows * extra->NbColumns);
649 for(
int row = 0; row < extra_B_row; row++) {
663 for(
int con = 0; con < BP->NbConstraints; con++) {
665 Vector_Copy(BP->Constraint[con], extra->p[extra_B_row + con],
668 value_assign(extra->p[extra_B_row + con][extra->NbColumns-1],
669 BP->Constraint[con][BP->Dimension+1]);
671 extra->NbRows = extra_B_row + BP->NbConstraints;
672 #ifdef INTERSECTION_DEBUG
673 fprintf(stderr,
"extra = ");
679 #ifdef INTERSECTION_DEBUG
680 fprintf(stderr,
"Adding P = ");
700 #ifdef INTERSECTION_DEBUG
701 fprintf(stderr,
"Manual built intersection = ");
703 fprintf(stderr,
"-- exit sLBLIntersection\n");
780 fprintf(stderr,
"A lattice equal to Id = ");
797 fprintf(stderr,
"LINKING: holes(A) = ");
799 fprintf(stderr,
" with comp = ");
805 compEnd = compEnd->
next;
806 compEnd->
next = holes;
811 fprintf(stderr,
"comp(A) = ");
823 fprintf(stderr,
"\n-- Entering sLBLComplement. A = ");
832 fprintf(stderr,
"STEP 1: Adding hull complement polyhedron: ");
835 if (!
emptyQ(comp_hullA)) {
845 if(hullA && !
emptyQ(hullA))
849 fprintf(stderr,
"\nSTEP 2: LatDiff =\n");
856 fprintf(stderr,
"Considering Lat diff: ");
859 Ztmp = malloc(
sizeof(
LBL));
868 fprintf(stderr,
"Adding: ");
890 fprintf(stderr,
"\nSTEP 3 adding holes = ");
894 if(holes && !
emptyQ(holes))
909 fprintf(stderr,
"\n-- sLBLComplement final result (normalized) = ");
926 for(
LBL *tmp = A->
next; tmp && Result; tmp = tmp->
next) {
1145 errormsg1(
"sLBLImage",
"dimincomp",
"Incompatible dimensions");
1197 errormsg1(
"sLBLPreimage",
"dimincomp",
"incompatible dimensions");
1216 for(
int i = 0; i < newL->
NbRows; i++) {
1217 for(
int j = 0; j < newL->
NbColumns; j++) {
1218 if(j == i && i != newL->
NbRows-1) {
1237 for(
int i = 0; i < Con->
NbRows; i++) {
1239 for(
int j = 0; j < dp-1; j++) {
1246 for(
int i = 0; i < Con->
NbRows; i++) {
1247 for(
int j = 0; j < d-1; j++) {
1454 for(
int i=0; i<P->
NbEq; i++) {
1470 for(
int i=0; i<P->
NbEq && i<Eq->
NbRows; i++) {
1487 #ifdef CANONICAL_DEBUG
1488 fprintf(stderr,
"Checking for equalites in P\n");
1505 new = malloc(
sizeof(
LBL));
1507 errormsg1(
"sLBLHomogenize_equalities",
"outofmem",
"Out of Memory");
1531 #ifdef CANONICAL_DEBUG
1532 fprintf(stderr,
"Unified equalites in A->P!\n - First A->P = ");
1534 fprintf(stderr,
" - A Next ->P = ");
1552 Matrix *eq_hermite = NULL, *ker = NULL;
1553 #ifdef CANONICAL_DEBUG
1554 fprintf(stderr,
"P has equalities\n");
1555 fprintf(stderr,
"Equality matrix (including constants): ");
1569 for(
int i = 0; i < ker->NbRows; i++) {
1570 for(
int j = 0; j < ker->NbColumns - A->
P->
NbEq; j++) {
1575 ker->NbColumns = ker->NbColumns - A->
P->
NbEq;
1576 #ifdef CANONICAL_DEBUG
1577 fprintf(stderr,
"ker of Eq: ");
1585 #ifdef CANONICAL_DEBUG
1586 fprintf(stderr,
"Matrix H: ");
1617 #ifdef CANONICAL_DEBUG
1618 fprintf(stderr,
"New Lat: ");
1620 fprintf(stderr,
"New P: ");
1645 int pos_constrained = 0,
1646 neg_constrained = 0,
1650 #ifdef CANONICAL_DEBUG
1651 fprintf(stderr,
"Entering dark_source. dimension: %d\n", dim);
1652 fprintf(stderr,
"Polyhedron: ");
1677 if(eq_constrained > 0 || pos_constrained == 0 || neg_constrained == 0) {
1686 if(pos_constrained < neg_constrained) {
1705 extra->
p[nb_extra][dim+1]);
1729 extra->
p[nb_extra][dim+1]);
1737 #ifdef CANONICAL_DEBUG
1738 fprintf(stderr,
"Adding constraints: ");
1762 const int rest = P->
Dimension - eliminate;
1767 #ifdef CANONICAL_DEBUG
1768 fprintf(stderr,
"Entering exact shadow -dimension %d- of:", eliminate);
1785 for(
int c = 0; c < tmp->NbConstraints; c++) {
1787 Vector_Copy(tmp->Constraint[c]+0, tmp->Constraint[c]-c, eliminate + 1);
1788 Vector_Copy(tmp->Constraint[c]+eliminate+2, tmp->Constraint[c]-c+eliminate+1, rest);
1789 tmp->Constraint[c] -= c;
1793 for(
int r = 0; r < tmp->NbRays; r++) {
1795 Vector_Copy(tmp->Ray[r]+0, tmp->Ray[r]-r, eliminate + 1);
1796 Vector_Copy(tmp->Ray[r]+eliminate+2, tmp->Ray[r]-r+eliminate+1, rest);
1802 for(
int r = 0; r < tmp->NbRays; r++) {
1804 for(i = 0; i <= tmp->Dimension; i++) {
1808 if(i == tmp->Dimension + 1) {
1810 Vector_Copy(tmp->Ray[r+1], tmp->Ray[r], (tmp->NbRays - r - 1) * (tmp->Dimension + 2));
1816 #ifdef CANONICAL_DEBUG
1817 fprintf(stderr,
"projected result P = ");
1901 fprintf(stderr,
"*** generating polyhedron for vertex ***: ");
1944 return(
GenPoly(dimrest, val));
1948 fprintf(stderr,
"Enter Scan_Rest, position = %2d.", position);
1949 fprintf(stderr,
"val = (");
1950 for(
int i=0; i <= R->
Dimension + 1; i++) {
1952 if(i == dimrest || i == 0 || i == R->
Dimension)
1953 fprintf(stderr,
"::");
1955 fprintf(stderr,
")\n");
1960 if(position <= dimrest) {
1963 errormsg1(
"Scan_RestAP",
"infinite",
"trying to scan infinity!");
1988 return(
GenPoly(dimrest, val));
2031 for(num_lr = 0; num_lr < D->
NbRays; num_lr++) {
2043 for(
int v = num_lr; v < D->
NbRays; v++) {
2048 for(
int l = 0; l < num_lr; l++) {
2050 D->
Ray[v][dim + 1], dim + 1);
2084 Polyhedron *tmp, *U0, *not_a_hole = NULL, *holes;
2089 fprintf(stderr,
"\n-- Entering compute holes. A = ");
2096 for(
int z = 0; z < nbzeros; z++) {
2110 fprintf(stderr,
"\nDark = ");
2112 fprintf(stderr,
"Exact = ");
2135 if(!rest ||
emptyQ(rest)) {
2140 fprintf(stderr,
"Rest = (Exact - Dark) = ");
2170 rest_AP = bounded_rest;
2171 for(
int d = R->Dimension + 1; d <= A->P->Dimension; d++) {
2173 if(rest_AP != bounded_rest)
2180 if(rest_AP != bounded_rest)
2186 nextI = inter->
next;
2198 fprintf(stderr,
"------- Calling Scan_Rest -------\n");
2199 fprintf(stderr,
" scanR = ");
2219 fprintf(stderr,
"got not holes = ");
2221 fprintf(stderr,
"------- End Scan_Rest -------\n");
2225 if(bounded_rest != R) {
2230 if(new_not_a_hole) {
2232 for(num_lr = 0; num_lr < R->NbRays; num_lr++) {
2239 Vector_Copy(R->Ray[0], lines_rays->
p[0], num_lr * (R->Dimension + 2));
2242 new_not_a_hole = tmp;
2246 fprintf(stderr,
"not holes was unbounded, new_not_a_hole = ");
2251 if(new_not_a_hole) {
2255 end->
next = not_a_hole;
2256 not_a_hole = new_not_a_hole;
2265 fprintf(stderr,
"------- end loop on rest -------\n");
2266 fprintf(stderr,
"not holes in (exact-dark) = ");
2276 if(!holes ||
emptyQ(holes)) {
2278 fprintf(stderr,
"sLBLCompute_holes returning: <NULL>\n");
2285 fprintf(stderr,
"------- end sLBLCompute_holes -------\n");
2286 fprintf(stderr,
"returning holes = ");
2304 #ifdef CANONICAL_DEBUG
2305 fprintf(stderr,
"Entering sLBL_Simplify_Zero_Dimensions\n");
2309 for (
int col = A->
Lat->
NbColumns-2 ; col >= 0; col--) {
2342 #ifdef CANONICAL_DEBUG
2343 fprintf(stderr,
"Exact == Dark. Removing column %d of Lat\n", col);
2360 #ifdef CANONICAL_DEBUG
2361 fprintf(stderr,
"Exact != Dark. Keeping column %d of Lat\n", col);
2373 #ifdef CANONICAL_DEBUG
2374 fprintf(stderr,
"Exiting sLBL_Simplify_Zero_Dimensions\n");
2393 #ifdef CANONICAL_DEBUG
2394 fprintf(stderr,
"A is not HNF\n");
2413 #ifdef CANONICAL_DEBUG
2414 fprintf(stderr,
"New Lat (HNF): ");
2416 fprintf(stderr,
"U = ");
2426 #ifdef CANONICAL_DEBUG
2427 fprintf(stderr,
"New P: ");
2433 #ifdef CANONICAL_DEBUG
2434 fprintf(stderr,
"A is HNF.\n");
2446 LBL *current, *previous;
2447 #ifdef CANONICAL_DEBUG
2448 fprintf(stderr,
"Entering Remove_Empty\n");
2458 if(!current->
P ||
emptyQ(current->
P)) {
2460 #ifdef CANONICAL_DEBUG
2461 fprintf(stderr,
"Found empty sLBL, relinking previous to next\n");
2467 current = previous->
next;
2472 current = current->
next;
2480 #ifdef CANONICAL_DEBUG
2481 fprintf(stderr,
"Found empty sLBL at head, replacing head with next\n");
2507 #ifdef CANONICAL_DEBUG
2508 fprintf(stderr,
"Exit Remove_Empty, A = ");
2525 #ifdef SIMPLIFY_DEBUG2
2526 fprintf(stderr,
" Entering polyhedron_int_solution: position = %d, val = [",
2528 for(
int p=1 ; p<=position; p++)
2530 fprintf(stderr,
"]\n");
2540 #ifdef SIMPLIFY_DEBUG2
2541 fprintf(stderr,
" polyhedron_int_solution: lower_upper_bounds not zero\n");
2544 fprintf(stderr,
"polyhedron_int_solution: infinite lower/upper bound\n");
2550 #ifdef SIMPLIFY_DEBUG2
2551 fprintf(stderr,
" polyhedron_int_solution: LB/UB = ");
2554 fprintf(stderr,
"\n");
2589 #ifdef SIMPLIFY_DEBUG
2590 fprintf(stderr,
"--- Entering Domain_Remove_Integer_Empty\n");
2608 #ifdef SIMPLIFY_DEBUG
2609 fprintf(stderr,
"Checking integer emptyness of: ");
2615 for(ray = 0; ray < D->
NbRays; ray++) {
2620 int_solution_found =
True;
2627 if(!int_solution_found) {
2640 #ifdef SIMPLIFY_DEBUG
2641 fprintf(stderr,
" scan = ");
2654 if(int_solution_found) {
2669 if(int_solution_found) {
2673 #ifdef SIMPLIFY_DEBUG
2674 fprintf(stderr,
"-> not empty\n");
2680 #ifdef SIMPLIFY_DEBUG
2681 fprintf(stderr,
"-> empty\n");
2693 #ifdef SIMPLIFY_DEBUG
2694 fprintf(stderr,
"--- Exit Domain_Remove_Integer_Empty with result = ");
2716 #ifdef SIMPLIFY2_DEBUG
2717 fprintf(stderr,
"Entering domain_insert_dim. move = %d\n", move);
2723 new->NbBid = p->NbBid + 1;
2724 new->NbEq = p->NbEq;
2725 new->flags = p->flags;
2727 for(
int c = 0; c < p->NbConstraints; c++) {
2729 Vector_Copy(p->Constraint[c], new->Constraint[c], p->Dimension + 1);
2732 p->Constraint[c][p->Dimension + 1]);
2734 value_assign(new->Constraint[c][new->Dimension], p->Constraint[c][move]);
2738 Vector_Set(new->Ray[0], 0, new->Dimension + 2);
2741 for(
int r = 0; r < p->NbRays; r++) {
2743 Vector_Copy(p->Ray[r], new->Ray[r+1], p->Dimension + 1);
2746 p->Ray[r][p->Dimension + 1]);
2748 value_assign(new->Ray[r+1][new->Dimension], p->Ray[r][move]);
2755 #ifdef SIMPLIFY2_DEBUG
2866 int nb_added_dims = 0;
2868 #ifdef SIMPLIFY2_DEBUG
2869 fprintf(stderr,
"Entering sLBLMake_lattice_equal_to\n");
2872 for(
int col = 0; col < ref->
NbColumns - 1; col++) {
2877 for(row = 0; row < ref->
NbRows ; row++) {
2894 for(
int r = 0; r < L->
NbRows; r++) {
2908 for(c = 0; c <= col ; c++) {
2945 new_equality->
p[0][col+1]);
2955 new_equality->
p[0][new_equality->
NbColumns-1],
2957 #ifdef SIMPLIFY2_DEBUG
2958 fprintf(stderr,
"Adding equality: ");
2978 for(
int r = 0; r < Lat->
NbRows; r++) {
2995 #ifdef SIMPLIFY2_DEBUG
2996 fprintf(stderr,
"New Lat: ");
3003 #ifdef SIMPLIFY2_DEBUG
3004 fprintf(stderr,
"Exit sLBLMake_lattice_equal_to. A = ");
3029 #ifdef CANONICAL_DEBUG
3030 fprintf(stderr,
"Entering sLBLCanonical\n");
3031 fprintf(stderr,
"--------- Input Lat: ");
3033 fprintf(stderr,
"--------- Input P: ");
3041 errormsg1(
"sLBLCanonical",
"dimincomp",
"incompatible dimensions");
3119 #ifdef CANONICAL_DEBUG
3120 fprintf(stderr,
"Entering CanonicalLBL.\nA =");
3125 for(
LBL *tmp = A; tmp; tmp = tmp->
next) {
3132 #ifdef CANONICAL_DEBUG
3133 fprintf(stderr,
"sLBLCanonical and RemoveEmpty done.\nA =");
3139 for(; A; A = A->
next)
3141 LBL *previous = A, *current = A->
next;
3155 current = previous->
next;
3160 current = current->
next;
3186 fprintf(stderr,
"-- in LBL2ZDomain - Not holes = ");
3194 Result =
LBLAlloc(newL, not_holes);
3216 for(
LBL *Z = A; Z; Z = Z->
next)
3238 #ifdef SIMPLIFY2_DEBUG
3242 for(
LBL *tmp = A; tmp; tmp = tmp->
next) {
3302 for(
LBL *tmp = A; tmp; tmp = tmp->
next) {
3303 LBL *current = tmp->
next, *prec = tmp;
3321 L = tmp->Lat; P = tmp->P;
3322 tmp->Lat = current->
Lat; tmp->P = current->
P;
3323 current->
Lat = L; current->
P = P;
3326 #ifdef SIMPLIFY2_DEBUG
3327 fprintf(stderr,
"merging current = ");
3329 fprintf(stderr,
"[included in] tmp = ");
3345 int current_nbzero, tmp_nbzero;
3352 for(
int i = 0; i < tmp_nbzero; i++) {
3360 for(
int i = 0; i < current_nbzero; i++) {
3377 tmp->Lat->NbColumns + current_nbzero);
3378 for(
int r = 0; r < newL->
NbRows; r++) {
3380 Vector_Copy(tmp->Lat->p[r], newL->
p[r], tmp->Lat->NbColumns - 1);
3382 Vector_Set(newL->
p[r] + tmp->Lat->NbColumns - 1, 0, current_nbzero);
3385 tmp->Lat->p[r][tmp->Lat->NbColumns - 1]);
3389 #ifdef SIMPLIFY2_DEBUG
3390 fprintf(stderr,
"[new merged] tmp = ");
3397 prec->next = current->
next;
3399 current = prec->
next;
3404 current = current->
next;
3413 for(
LBL *tmp = A; tmp; tmp = tmp->
next) {
3459 #ifdef SIMPLIFY2_DEBUG
3460 fprintf(stderr,
"\n Exit LBLSimplify. A (before simplify) = ");
3466 #ifndef SIMPLIFY2_DEBUG
3496 for(
LBL *tmpA = A->
next; tmpA; tmpA = tmpA->
next) {
3497 LBL *next, *inter, *diffA, *diffB, *newres;
LatticeUnion * LatticeDifference(Matrix *A, Matrix *B)
void Matrix_Move_Homogeneous_Dim_First(Matrix *A)
int LatCountZeroCols(Matrix *M)
Bool isSameLatticeSpace(Matrix *A, Matrix *B)
Matrix * LatticeIntersection(Matrix *A, Matrix *B)
Bool isEqualLattice(Matrix *A, Matrix *B)
void AffineHermite(Matrix *A, Matrix **H, Matrix **U)
Bool isNormalLattice(Matrix *A)
Bool isEmptyLattice(Matrix *A)
Bool LatticeIncluded(Matrix *A, Matrix *B)
void PrintLatticeUnion(FILE *fp, char *format, LatticeUnion *Head)
void Matrix_Move_Homogeneous_Dim_Last(Matrix *A)
Matrix * RemoveColumn(Matrix *M, int Columnnumber)
Matrix * Matrix_Copy(Matrix const *Src)
Matrix * RemoveNColumns(Matrix *M, int FirstColumnnumber, int NumColumns)
void LBLSimplifyEmpty(LBL *A)
static Polyhedron * sLBLCompute_holes(LBL *A, Polyhedron **pExact)
static Polyhedron * Domain_Remove_Integer_Empty(Polyhedron *D)
void CanonicalLBL(LBL *A)
static void sLBLCanonical(LBL *A)
static LBL * sLBLComplement2(LBL *A)
LBL * LBLImage(LBL *A, Matrix *Func)
static Polyhedron * domain_project(Polyhedron *P, int eliminate)
static Matrix * get_equalities(Polyhedron *P)
static Bool polyhedron_int_solution(Polyhedron *scan, Value *val, int position)
static LBL * sLBLCopy(LBL *A)
static LBL * sLBLPreimage(LBL *, Matrix *)
static LBL * sLBLImage(LBL *, Matrix *)
LBL * LBLPreimage(LBL *A, Matrix *Func)
LBL * LBL2ZDomain(LBL *A)
Polyhedron * Scan_RestAP(Polyhedron *R, Value *val, int position, int dimrest)
static Polyhedron * bound_polyhedron(Polyhedron *D)
static LBL * LBLConcatenate(LBL *A, LBL *B)
static LBL * sLBL2ZDomain(LBL *A)
LBL * LBLUnion(LBL *A, LBL *B)
Polyhedron * GenPoly(int dim, Value *val)
static Matrix * sLBLHomogenize_equalities(LBL *A)
static void sLBLSimplify_equalities(LBL *A, Matrix *Equalities)
LBL * LBLDisjointUnion(LBL *A)
static void sLBLPrint(FILE *fp, const char *format, LBL *A)
static Polyhedron * domain_dark_shadow(Polyhedron *P, int dim)
LBL * LBLComplement(LBL *A)
static void LBL_Remove_Empty(LBL *A)
static Bool LBL_simple_inclusion_check(LBL *A, LBL *B)
LBL * UniverseLBL(int dimension)
void LBLPrint(FILE *fp, const char *format, LBL *A)
static void sLBLFree(LBL *L)
static void sLBL_Simplify_Zero_Dimensions(LBL *A)
LBL * LBLDifference(LBL *A, LBL *B)
static Polyhedron * domain_insert_dim(Polyhedron *D, int move)
static void sLBL_Lat_Normalize(LBL *A)
Bool LBLIncluded(LBL *A, LBL *B)
LBL * EmptyLBL(int dimension)
static Bool same_equalities(Matrix *Eq, Polyhedron *P)
static LBL * sLBLComplement(LBL *A)
static LBL * sLBLIntersection(LBL *, LBL *)
LBL * LBLIntersection(LBL *A, LBL *B)
LBL * LBLAlloc(Matrix *Lat, Polyhedron *Domain)
static void sLBLMake_lattice_equal_to(LBL *A, Matrix *ref)
static Polyhedron * polyhedron_dark_source(Polyhedron *P, int dim)
#define value_oppose(ref, val)
#define value_notzero_p(val)
#define value_notone_p(val)
#define value_substract(ref, val1, val2)
#define value_add_int(ref, val, vint)
#define value_zero_p(val)
#define value_assign(v1, v2)
#define value_increment(ref, val)
#define value_set_si(val, i)
#define value_notmone_p(val)
#define value_print(Dst, fmt, val)
#define value_addto(ref, val1, val2)
void errormsg1(const char *f, const char *msgname, const char *msg)
void Matrix_Product(Matrix *Mat1, Matrix *Mat2, Matrix *Mat3)
Matrix * Matrix_Alloc(unsigned NbRows, unsigned NbColumns)
int Matrix_Inverse(Matrix *Mat, Matrix *MatInv)
void Matrix_Print(FILE *Dst, const char *Format, Matrix *Mat)
void left_hermite(Matrix *A, Matrix **Hp, Matrix **Qp, Matrix **Up)
void Matrix_Free(Matrix *Mat)
Matrix * Identity_Matrix(unsigned int dim)
void Matrix_identity(unsigned int dim, Matrix **I)
returns the dim-dimensional identity matrix.
Polyhedron * DomainAddRays(Polyhedron *Pol, Matrix *Ray, unsigned NbMaxConstrs)
Add rays pointed by 'Ray' to each and every polyhedron in the polyhedral domain 'Pol'.
Polyhedron * align_context(Polyhedron *Pol, int align_dimension, int NbMaxRays)
Polyhedron * Disjoint_Domain(Polyhedron *P, int flag, unsigned NbMaxRays)
Polyhedron * DomainAddConstraints(Polyhedron *Pol, Matrix *Mat, unsigned NbMaxRays)
void Polyhedron_Free(Polyhedron *Pol)
Polyhedron * DomainConstraintSimplify(Polyhedron *P, unsigned MaxRays)
Polyhedron * Polyhedron_Scan(Polyhedron *D, Polyhedron *C, unsigned NbMaxRays)
Polyhedron * DomainDifference(Polyhedron *Pol1, Polyhedron *Pol2, unsigned NbMaxRays)
Polyhedron * AddPolyToDomain(Polyhedron *Pol, Polyhedron *PolDomain)
Polyhedron * DomainIntersection(Polyhedron *Pol1, Polyhedron *Pol2, unsigned NbMaxRays)
Polyhedron * Domain_Copy(Polyhedron *Pol)
Polyhedron * DomainPreimage(Polyhedron *Pol, Matrix *Func, unsigned NbMaxRays)
Polyhedron * Universe_Polyhedron(unsigned Dimension)
Polyhedron * Rays2Polyhedron(Matrix *Ray, unsigned NbMaxConstrs)
Given a matrix of rays 'Ray', create and return a polyhedron.
Polyhedron * DomainUnion(Polyhedron *Pol1, Polyhedron *Pol2, unsigned NbMaxRays)
int lower_upper_bounds(int pos, Polyhedron *P, Value *context, Value *LBp, Value *UBp)
Polyhedron * DomainImage(Polyhedron *Pol, Matrix *Func, unsigned NbMaxConstrs)
Polyhedron * Polyhedron_Alloc(unsigned Dimension, unsigned NbConstraints, unsigned NbRays)
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)
struct lattice_union * next
void Vector_Free(Vector *vector)
void Vector_Set(Value *p, int n, unsigned length)
void Vector_Combine(Value *p1, Value *p2, Value *p3, Value lambda, Value mu, unsigned length)
Vector * Vector_Alloc(unsigned length)
void Vector_Copy(Value *p1, Value *p2, unsigned length)
void Vector_Oppose(Value *p1, Value *p2, unsigned len)