45 fprintf(stderr,
"\nInZPolyAlloc - The Lattice and the Polyhedron");
46 fprintf(stderr,
" are not compatible to form a ZPolyhedra\n");
50 fprintf(stderr,
"\nZPolAlloc: Lattice not Full Dimensional\n");
55 fprintf(stderr,
"ZPolAlloc : Out of Memory\n");
79 if (Head->
next != NULL)
105 if (Head->
next != NULL)
162 for (i = A->
P; i != NULL; i = i->
next) {
196 for (; temp != NULL; temp = temp->
next) {
219 for (temp = Head; temp != NULL; temp = temp->
next) {
225 fprintf(stderr,
"\n In AddZPolytoZDomain: Out of memory\n");
253 fp = fopen(
"_debug",
"a");
254 fprintf(fp,
"\nEntered EMPTYZPOLYHEDRON\n");
294 fp = fopen(
"_debug",
"a");
295 fprintf(fp,
"\nEntered ZPOLYHEDRONINCLUDES\n");
322 fp1 = fopen(
"_debug",
"a");
323 fprintf(fp1,
"\nEntered ZDOMAINPRINT\n");
328 if (A->
next != NULL) {
329 fprintf(fp,
"\nUNIONED with\n");
341 fprintf(fp,
"\nZPOLYHEDRON: Dimension %d \n", A->
Lat->
NbRows - 1);
342 fprintf(fp,
"\nLATTICE: \n");
359 fp = fopen(
"_debug",
"a");
360 fprintf(fp,
"\nEntered ZDOMAINUNION\n");
364 for (temp = A; temp != NULL; temp = temp->
next)
366 for (temp = B; temp != NULL; temp = temp->
next)
377 ZPolyhedron *Result = NULL, *tempA = NULL, *tempB = NULL;
381 fp = fopen(
"_debug",
"a");
382 fprintf(fp,
"\nEntered ZDOMAININTERSECTION\n");
386 for (tempA = A; tempA != NULL; tempA = tempA->
next)
387 for (tempB = B; tempB != NULL; tempB = tempB->
next) {
414 ZPolyhedron *Result = NULL, *tempA = NULL, *tempB = NULL;
419 fp = fopen(
"_debug",
"a");
420 fprintf(fp,
"\nEntered ZDOMAINDIFFERENCE\n");
425 fprintf(stderr,
"In ZDomainDifference : the input ZDomains ");
426 fprintf(stderr,
"do not have compatible dimensions\n");
427 fprintf(stderr,
"ZDomainDifference not performed\n");
431 for (tempA = A; tempA != NULL; tempA = tempA->
next) {
435 for (tempB = B; tempB != NULL; tempB = tempB->
next) {
438 for (i = temp; i != NULL; i = i->
next) {
440 for (j = res; j != NULL; j = j->
next)
446 for (i = templist; i != NULL; i = i->
next)
450 for (i = temp; i != NULL; i = i->
next)
472 fp = fopen(
"_debug",
"a");
473 fprintf(fp,
"\nEntered ZDOMAINIMAGE\n");
477 for (temp = A; temp != NULL; temp = temp->
next) {
500 fp = fopen(
"_debug",
"a");
501 fprintf(fp,
"\nEntered ZDOMAINPREIMAGE\n");
506 fprintf(stderr,
"\nError : In ZDomainPreimage, ");
507 fprintf(stderr,
"Incompatible dimensions of ZPolyhedron ");
508 fprintf(stderr,
"and the Function \n");
511 for (temp = A; temp != NULL; temp = temp->
next) {
531 Polyhedron *PInter, *ImageA, *ImageB, *PreImage;
535 fp = fopen(
"_debug",
"a");
536 fprintf(fp,
"\nEntered ZPOLYHEDRONINTERSECTION\n");
576 Polyhedron *DomDiff, *DomInter, *PreImage, *ImageA, *ImageB;
581 fp = fopen(
"_debug",
"a");
582 fprintf(fp,
"\nEntered ZPOLYHEDRONDIFFERENCE\n");
619 while (LatDiff != NULL) {
628 LatDiff = LatDiff->
next;
657 fp = fopen(
"_debug",
"a");
658 fprintf(fp,
"\nEntered ZPOLYHEDRONIMAGE\n");
664 fprintf(stderr,
"In ZPolImage - The Function, is not compatible with the "
709 fp = fopen(
"_debug",
"a");
710 fprintf(fp,
"\nEntered ZPOLYHEDRONPREIMAGE\n");
715 fprintf(stderr,
"\nIn ZPolyhedronPreimage: Error, The dimensions of the ");
716 fprintf(stderr,
"function are not compatible with that of the Zpolyhedron");
745 Matrix *B1 = NULL, *B2 = NULL, *T1, *B2inv;
749 Matrix *H, *U, *temp, *Hprime, *Uprime, *T2;
753 fp = fopen(
"_debug",
"a");
754 fprintf(fp,
"\nEntered CANONICALFORM\n");
769 fprintf(stderr,
"In CNF : Something wrong with the Input Zpolyhedra \n");
786 for (i = 0; i < l1; i++)
793 for (i = 0; i < l1; i++) {
802 for (i = 0; i < l1; i++) {
846 fp = fopen(
"_debug",
"a");
847 fprintf(fp,
"\nEntered INTEGRALISELATTICE\n");
878 fprintf(stderr,
"\nError in ZDomainSimplify - ZDomHead = NULL\n");
881 if (ZDom->
next == NULL)
891 for (Curr = Head; Curr != NULL; Curr = Curr->
next) {
926 }
while (Ztmp != NULL);
928 for (Curr = Head; Curr != NULL; Curr = Curr->
next)
931 for (Curr = Head; Curr != NULL; Curr = Curr->
next) {
933 for (L = Curr->
LatUni; L != NULL; L = L->
next) {
945 while (Curr != NULL) {
958 Lattice *B1 = NULL, *B2 = NULL, *newB1 = NULL, *newB2 = NULL;
959 Matrix *U = NULL, *M1 = NULL, *M2 = NULL, *M1Inverse = NULL,
961 Matrix *Vinv, *V, *temp, *DiagMatrix;
970 fp = fopen(
"_debug",
"a");
971 fprintf(fp,
"\nEntered SplitZpolyhedron \n");
978 "\n SplitZpolyhedron : The Input Matrix B is not a proper Lattice \n");
984 "\nSplitZpolyhedron : The Lattice in Zpolyhedron and B have ");
985 fprintf(stderr,
"incompatible dimensions \n");
1028 tempHead->next = NULL;
Lattice * EmptyLattice(int dimension)
Bool IsLattice(Matrix *m)
void AffineHermite(Lattice *A, Lattice **H, Matrix **U)
LatticeUnion * LatticeDifference(Lattice *A, Lattice *B)
Method :
Bool isEmptyLattice(Lattice *A)
Lattice * ChangeLatticeDimension(Lattice *A, int dimension)
LatticeUnion * Lattice2LatticeUnion(Lattice *X, Lattice *Y)
Lattice * LatticeIntersection(Lattice *X, Lattice *Y)
Bool isfulldim(Matrix *m)
Bool LatticeIncludes(Lattice *A, Lattice *B)
LatticeUnion * LatticeSimplify(LatticeUnion *latlist)
Lattice * LatticePreimage(Lattice *L, Matrix *G)
void LatticeUnion_Free(LatticeUnion *Head)
Bool sameLattice(Lattice *A, Lattice *B)
int FindHermiteBasisofDomain(Polyhedron *A, Matrix **B)
Lattice * LatticeImage(Lattice *A, Matrix *M)
Matrix * Identity(unsigned size)
Matrix * Matrix_Copy(Matrix const *Src)
static ZPolyhedron * ZPolyhedronDifference(ZPolyhedron *, ZPolyhedron *)
static void ZPolyhedron_Free(ZPolyhedron *Zpol)
static ZPolyhedron * ZPolyhedronPreimage(ZPolyhedron *, Matrix *)
ZPolyhedron * ZDomainIntersection(ZPolyhedron *A, ZPolyhedron *B)
static ZPolyhedron * AddZPoly2ZDomain(ZPolyhedron *Zpol, ZPolyhedron *Result)
static ZPolyhedron * ZPolyhedronIntersection(ZPolyhedron *, ZPolyhedron *)
ZPolyhedron * ZDomainSimplify(ZPolyhedron *ZDom)
Bool ZDomainIncludes(ZPolyhedron *A, ZPolyhedron *B)
void ZDomain_Free(ZPolyhedron *Head)
ZPolyhedron * SplitZpolyhedron(ZPolyhedron *ZPol, Lattice *B)
ZPolyhedron * ZDomainDifference(ZPolyhedron *A, ZPolyhedron *B)
static ZPolyhedron * ZPolyhedron_Copy(ZPolyhedron *A)
void ZDomainPrint(FILE *fp, const char *format, ZPolyhedron *A)
ZPolyhedron * ZPolyhedron_Alloc(Lattice *Lat, Polyhedron *Poly)
static ZPolyhedron * ZPolyhedronImage(ZPolyhedron *, Matrix *)
ZPolyhedron * ZDomain_Copy(ZPolyhedron *Head)
Bool isEmptyZPolyhedron(ZPolyhedron *Zpol)
ZPolyhedron * IntegraliseLattice(ZPolyhedron *A)
static void ZPolyhedronPrint(FILE *fp, const char *format, ZPolyhedron *A)
ZPolyhedron * EmptyZPolyhedron(int dimension)
ZPolyhedron * ZDomainImage(ZPolyhedron *A, Matrix *Func)
struct forsimplify ForSimplify
static ZPolyhedron * AddZPolytoZDomain(ZPolyhedron *A, ZPolyhedron *Head)
ZPolyhedron * ZDomainPreimage(ZPolyhedron *A, Matrix *Func)
ZPolyhedron * ZDomainUnion(ZPolyhedron *A, ZPolyhedron *B)
void CanonicalForm(ZPolyhedron *Zpol, ZPolyhedron **Result, Matrix **Basis)
Bool ZPolyhedronIncludes(ZPolyhedron *A, ZPolyhedron *B)
#define value_assign(v1, v2)
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 Matrix_Free(Matrix *Mat)
void Polyhedron_Free(Polyhedron *Pol)
Polyhedron * Empty_Polyhedron(unsigned Dimension)
Polyhedron * DomainDifference(Polyhedron *Pol1, Polyhedron *Pol2, unsigned NbMaxRays)
Polyhedron * DomainIntersection(Polyhedron *Pol1, Polyhedron *Pol2, unsigned NbMaxRays)
Return the intersection of two polyhedral domains 'Pol1' and 'Pol2'.
Polyhedron * Domain_Copy(Polyhedron *Pol)
Polyhedron * DomainPreimage(Polyhedron *Pol, Matrix *Func, unsigned NbMaxRays)
Polyhedron * DomainUnion(Polyhedron *Pol1, Polyhedron *Pol2, unsigned NbMaxRays)
Polyhedron * DomainImage(Polyhedron *Pol, Matrix *Func, unsigned NbMaxConstrs)
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)
struct LatticeUnion * next
struct ZPolyhedron * next
struct forsimplify * next