00001
00002
00003
00004
00005
00006
00007 #ifndef _polyhedron_H_
00008 #define _polyhedron_H_
00009
00010
00011 #define POL_ENSURE_INEQUALITIES(P) \
00012 if (F_ISSET(P, POL_VALID) && !F_ISSET(P, POL_INEQUALITIES)) \
00013 Polyhedron_Compute_Dual(P);
00014
00015 #define POL_ENSURE_POINTS(P) \
00016 if (F_ISSET(P, POL_VALID) && !F_ISSET(P, POL_POINTS)) \
00017 Polyhedron_Compute_Dual(P);
00018
00019 #define POL_ENSURE_FACETS(P) \
00020 if (F_ISSET(P, POL_VALID) && !F_ISSET(P, POL_FACETS)) \
00021 Polyhedron_Compute_Dual(P);
00022
00023 #define POL_ENSURE_VERTICES(P) \
00024 if (F_ISSET(P, POL_VALID) && !F_ISSET(P, POL_VERTICES)) \
00025 Polyhedron_Compute_Dual(P);
00026
00027 #if defined(__cplusplus)
00028 extern "C" {
00029 #endif
00030
00031 extern void Polyhedron_Compute_Dual(Polyhedron *P);
00032
00033 #if defined(__cplusplus)
00034 }
00035 #endif
00036
00037 #if (defined(__STDC__) || defined(__cplusplus))
00038
00039 #if defined(__cplusplus)
00040 extern "C" {
00041 #endif
00042
00043 Polyhedron *DomainConstraintSimplify(Polyhedron *P, unsigned MaxRays);
00044
00045 extern Polyhedron *AddConstraints(Value *Con,unsigned NbConstraints,
00046 Polyhedron *Pol,unsigned NbMaxRays );
00047 extern Polyhedron *AddPolyToDomain(Polyhedron *Pol,Polyhedron *PolDomain);
00048 extern Polyhedron *AddRays (Value *Ray2,unsigned NbRay2,Polyhedron
00049 *Pol1,unsigned NbMaxRays);
00050 extern Polyhedron *align_context(Polyhedron *Pol,int align_dimension,
00051 int NbMaxRays);
00052 extern Polyhedron *Constraints2Polyhedron(Matrix *Constraints, unsigned
00053 NbMaxRays);
00054 extern Polyhedron *Disjoint_Domain( Polyhedron *Pol, int flag, unsigned
00055 NbMaxRays );
00056 extern Polyhedron *DomainAddConstraints(Polyhedron *Pol,Matrix *Mat,
00057 unsigned NbMaxRays);
00058 extern Polyhedron *DomainAddRays(Polyhedron *Pol,Matrix *Ray,
00059 unsigned NbMaxConstrs);
00060 extern Polyhedron *DomainConvex(Polyhedron *Pol,unsigned NbMaxConstrs);
00061 extern Interval *DomainCost(Polyhedron *Pol,Value *Cost);
00062 extern Polyhedron *DomainDifference(Polyhedron *Pol1,Polyhedron *Pol2,
00063 unsigned NbMaxRays);
00064 extern Polyhedron *DomainImage(Polyhedron *Pol,Matrix *Func,unsigned
00065 NbMaxConstrs);
00066 extern Polyhedron *DomainIntersection(Polyhedron *Pol1,Polyhedron
00067 *Pol2, unsigned NbMaxRays);
00068 extern Polyhedron *DomainPreimage(Polyhedron *Pol,Matrix *Func,
00069 unsigned NbMaxRays);
00070 extern Polyhedron *DomainSimplify(Polyhedron *Pol1, Polyhedron *Pol2,
00071 unsigned NbMaxRays);
00072 extern Polyhedron *Stras_DomainSimplify(Polyhedron *Pol1, Polyhedron *Pol2,
00073 unsigned NbMaxRays);
00074 extern Polyhedron *DomainUnion(Polyhedron *Pol1,Polyhedron *Pol2,
00075 unsigned NbMaxRays);
00076 extern Polyhedron *Domain_Copy(Polyhedron *Pol);
00077 extern void Domain_Free (Polyhedron *Pol);
00078 extern Polyhedron *Empty_Polyhedron(unsigned Dimension);
00079 extern int Gauss(Matrix *Mat,int NbEq,int Dimension);
00080 extern int lower_upper_bounds(int pos,Polyhedron *P,Value *context,
00081 Value *LBp,Value *UBp);
00082 extern Matrix *Polyhedron2Constraints(Polyhedron *Pol);
00083 extern Matrix *Polyhedron2Rays(Polyhedron *Pol);
00084 extern int PolyhedronIncludes(Polyhedron *Pol1,Polyhedron *Pol2);
00085 extern Polyhedron* Polyhedron_Alloc(unsigned Dimension,unsigned
00086 NbConstraints,unsigned NbRays);
00087 extern Polyhedron *Polyhedron_Copy(Polyhedron *Pol);
00088 extern void Polyhedron_Free(Polyhedron *Pol);
00089 extern Polyhedron *Polyhedron_Image(Polyhedron *Pol,Matrix *Func,
00090 unsigned NbMaxConstrs);
00091 extern Polyhedron *Polyhedron_Preimage(Polyhedron *Pol,Matrix *Func,
00092 unsigned NbMaxRays);
00093 extern void Polyhedron_Print(FILE *Dst,char *Format,Polyhedron *Pol);
00094 extern void Polyhedron_PrintConstraints(FILE *Dst,char *Format,
00095 Polyhedron *Pol);
00096 extern Polyhedron *Polyhedron_Scan(Polyhedron *D,Polyhedron *C,
00097 unsigned MAXRAYS);
00098 extern void PolyPrint(Polyhedron *Pol);
00099 extern Polyhedron *Rays2Polyhedron(Matrix *Ray,unsigned NbMaxConstrs);
00100 extern Polyhedron *SubConstraint(Value *Con,Polyhedron *Pol,
00101 unsigned NbMaxRays, int Pass);
00102 extern Polyhedron *Universe_Polyhedron (unsigned Dimension);
00103
00104 #if defined(__cplusplus)
00105 }
00106 #endif
00107
00108 #else
00109
00110 extern Polyhedron *AddConstraints(
00111 );
00112 extern Polyhedron *AddPolyToDomain();
00113 extern Polyhedron *AddRays (
00114 );
00115 extern Polyhedron *align_context(
00116 );
00117 extern Polyhedron *Constraints2Polyhedron(
00118 );
00119 extern Polyhedron *Disjoint_Domain();
00120 extern Polyhedron *DomainAddConstraints(
00121 );
00122 extern Polyhedron *DomainAddRays(
00123 );
00124 extern Polyhedron *DomainConvex();
00125 extern Interval *DomainCost();
00126 extern Polyhedron *DomainDifference(
00127 );
00128 extern Polyhedron *DomainImage(
00129 );
00130 extern Polyhedron *DomainIntersection(
00131 );
00132 extern Polyhedron *DomainPreimage(
00133 );
00134 extern Polyhedron *DomainSimplify(
00135 );
00136 extern Polyhedron *DomainUnion(
00137 );
00138 extern Polyhedron *Domain_Copy();
00139 extern void Domain_Free ();
00140 extern Polyhedron *Empty_Polyhedron();
00141 extern int Gauss();
00142 extern int lower_upper_bounds(
00143 );
00144 extern Matrix *Polyhedron2Constraints();
00145 extern Matrix *Polyhedron2Rays();
00146 extern int PolyhedronIncludes();
00147 extern Polyhedron* Polyhedron_Alloc(
00148 );
00149 extern Polyhedron *Polyhedron_Copy();
00150 extern void Polyhedron_Free();
00151 extern Polyhedron *Polyhedron_Image(
00152 );
00153 extern Polyhedron *Polyhedron_Preimage(
00154 );
00155 extern void Polyhedron_Print();
00156 extern void Polyhedron_PrintConstraints(
00157 );
00158 extern Polyhedron *Polyhedron_Scan(
00159 );
00160 extern void PolyPrint();
00161 extern Polyhedron *Rays2Polyhedron();
00162 extern Polyhedron *SubConstraint(
00163 );
00164 extern Polyhedron *Universe_Polyhedron ();
00165
00166
00167 #endif
00168 #endif