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 void Domain_PrintConstraints(FILE *Dst,char *Format,Polyhedron *Pol);
00079 extern Polyhedron *Empty_Polyhedron(unsigned Dimension);
00080 extern int Gauss(Matrix *Mat,int NbEq,int Dimension);
00081 extern int lower_upper_bounds(int pos,Polyhedron *P,Value *context,
00082 Value *LBp,Value *UBp);
00083 extern Matrix *Polyhedron2Constraints(Polyhedron *Pol);
00084 extern Matrix *Polyhedron2Rays(Polyhedron *Pol);
00085 extern int PolyhedronIncludes(Polyhedron *Pol1,Polyhedron *Pol2);
00086 extern Polyhedron* Polyhedron_Alloc(unsigned Dimension,unsigned
00087 NbConstraints,unsigned NbRays);
00088 extern Polyhedron *Polyhedron_Copy(Polyhedron *Pol);
00089 extern void Polyhedron_Free(Polyhedron *Pol);
00090 extern Polyhedron *Polyhedron_Image(Polyhedron *Pol,Matrix *Func,
00091 unsigned NbMaxConstrs);
00092 extern Polyhedron *Polyhedron_Preimage(Polyhedron *Pol,Matrix *Func,
00093 unsigned NbMaxRays);
00094 extern void Polyhedron_Print(FILE *Dst,char *Format,Polyhedron *Pol);
00095 extern void Polyhedron_PrintConstraints(FILE *Dst,char *Format,
00096 Polyhedron *Pol);
00097 extern Polyhedron *Polyhedron_Scan(Polyhedron *D,Polyhedron *C,
00098 unsigned MAXRAYS);
00099 extern void PolyPrint(Polyhedron *Pol);
00100 extern Polyhedron *Rays2Polyhedron(Matrix *Ray,unsigned NbMaxConstrs);
00101 extern Polyhedron *SubConstraint(Value *Con,Polyhedron *Pol,
00102 unsigned NbMaxRays, int Pass);
00103 extern Polyhedron *Universe_Polyhedron (unsigned Dimension);
00104
00105 #if defined(__cplusplus)
00106 }
00107 #endif
00108
00109 #else
00110
00111 extern Polyhedron *AddConstraints(
00112 );
00113 extern Polyhedron *AddPolyToDomain();
00114 extern Polyhedron *AddRays (
00115 );
00116 extern Polyhedron *align_context(
00117 );
00118 extern Polyhedron *Constraints2Polyhedron(
00119 );
00120 extern Polyhedron *Disjoint_Domain();
00121 extern Polyhedron *DomainAddConstraints(
00122 );
00123 extern Polyhedron *DomainAddRays(
00124 );
00125 extern Polyhedron *DomainConvex();
00126 extern Interval *DomainCost();
00127 extern Polyhedron *DomainDifference(
00128 );
00129 extern Polyhedron *DomainImage(
00130 );
00131 extern Polyhedron *DomainIntersection(
00132 );
00133 extern Polyhedron *DomainPreimage(
00134 );
00135 extern Polyhedron *DomainSimplify(
00136 );
00137 extern Polyhedron *DomainUnion(
00138 );
00139 extern Polyhedron *Domain_Copy();
00140 extern void Domain_Free ();
00141 extern void Domain_PrintConstraints();
00142 extern Polyhedron *Empty_Polyhedron();
00143 extern int Gauss();
00144 extern int lower_upper_bounds(
00145 );
00146 extern Matrix *Polyhedron2Constraints();
00147 extern Matrix *Polyhedron2Rays();
00148 extern int PolyhedronIncludes();
00149 extern Polyhedron* Polyhedron_Alloc(
00150 );
00151 extern Polyhedron *Polyhedron_Copy();
00152 extern void Polyhedron_Free();
00153 extern Polyhedron *Polyhedron_Image(
00154 );
00155 extern Polyhedron *Polyhedron_Preimage(
00156 );
00157 extern void Polyhedron_Print();
00158 extern void Polyhedron_PrintConstraints(
00159 );
00160 extern Polyhedron *Polyhedron_Scan(
00161 );
00162 extern void PolyPrint();
00163 extern Polyhedron *Rays2Polyhedron();
00164 extern Polyhedron *SubConstraint(
00165 );
00166 extern Polyhedron *Universe_Polyhedron ();
00167
00168
00169 #endif
00170 #endif