polylib: polyhedron.h Source File

- Main Page
- Classes
- Files

- File List
- File Members

# polyhedron.h

Go to the documentation of this file.

    00001 /*
    00002     This file is part of PolyLib.
    00003
    00004     PolyLib is free software: you can redistribute it and/or modify
    00005     it under the terms of the GNU General Public License as published by
    00006     the Free Software Foundation, either version 3 of the License, or
    00007     (at your option) any later version.
    00008
    00009     PolyLib is distributed in the hope that it will be useful,
    00010     but WITHOUT ANY WARRANTY; without even the implied warranty of
    00011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    00012     GNU General Public License for more details.
    00013
    00014     You should have received a copy of the GNU General Public License
    00015     along with PolyLib.  If not, see <http://www.gnu.org/licenses/>.
    00016 */
    00017
    00018 #ifndef _polyhedron_H_
    00019 #define _polyhedron_H_
    00020
    00021 /* Make sure the Constraint member is valid */
    00022 #define POL_ENSURE_INEQUALITIES(P)                                              \
    00023         if (F_ISSET(P, POL_VALID) && !F_ISSET(P, POL_INEQUALITIES))             \
    00024             Polyhedron_Compute_Dual(P);
    00025 /* Make sure the Ray member is valid */
    00026 #define POL_ENSURE_POINTS(P)                                                    \
    00027         if (F_ISSET(P, POL_VALID) && !F_ISSET(P, POL_POINTS))                   \
    00028             Polyhedron_Compute_Dual(P);
    00029 /* Make sure the Constraint member is valid and non-redundant */
    00030 #define POL_ENSURE_FACETS(P)                                                    \
    00031         if (F_ISSET(P, POL_VALID) && !F_ISSET(P, POL_FACETS))                   \
    00032             Polyhedron_Compute_Dual(P);
    00033 /* Make sure the Ray member is valid and non-redundant */
    00034 #define POL_ENSURE_VERTICES(P)                                                  \
    00035         if (F_ISSET(P, POL_VALID) && !F_ISSET(P, POL_VERTICES))                 \
    00036             Polyhedron_Compute_Dual(P);
    00037
    00038 #if defined(__cplusplus)
    00039 extern "C" {
    00040 #endif
    00041
    00042 extern void Polyhedron_Compute_Dual(Polyhedron *P);
    00043
    00044 Polyhedron *DomainConstraintSimplify(Polyhedron *P, unsigned MaxRays);
    00045
    00046 extern Polyhedron *AddConstraints(Value *Con,unsigned NbConstraints,
    00047                                    Polyhedron *Pol,unsigned NbMaxRays );
    00048 extern Polyhedron *AddPolyToDomain(Polyhedron *Pol,Polyhedron *PolDomain);
    00049 extern Polyhedron *AddRays (Value *Ray2,unsigned NbRay2,Polyhedron
    00050                             *Pol1,unsigned NbMaxRays);
    00051 extern Polyhedron *align_context(Polyhedron *Pol,int align_dimension,
    00052                                   int NbMaxRays);
    00053 extern Polyhedron *Constraints2Polyhedron(Matrix *Constraints, unsigned
    00054                                           NbMaxRays);
    00055 extern Polyhedron *Disjoint_Domain( Polyhedron *Pol, int flag, unsigned
    00056                NbMaxRays );
    00057 extern Polyhedron *DomainAddConstraints(Polyhedron *Pol,Matrix *Mat,
    00058                                         unsigned NbMaxRays);
    00059 extern Polyhedron *DomainAddRays(Polyhedron *Pol,Matrix *Ray,
    00060                                  unsigned NbMaxConstrs);
    00061 extern Polyhedron *DomainConvex(Polyhedron *Pol,unsigned NbMaxConstrs);
    00062 extern Interval *DomainCost(Polyhedron *Pol,Value *Cost);
    00063 extern Polyhedron *DomainDifference(Polyhedron *Pol1,Polyhedron *Pol2,
    00064                                     unsigned NbMaxRays);
    00065 extern Polyhedron *DomainImage(Polyhedron *Pol,Matrix *Func,unsigned
    00066                                NbMaxConstrs);
    00067 extern Polyhedron *DomainIntersection(Polyhedron *Pol1,Polyhedron
    00068                                       *Pol2, unsigned NbMaxRays);
    00069 extern Polyhedron *DomainPreimage(Polyhedron *Pol,Matrix *Func,
    00070                                   unsigned NbMaxRays);
    00071 extern Polyhedron *DomainSimplify(Polyhedron *Pol1, Polyhedron *Pol2,
    00072                                   unsigned NbMaxRays);
    00073 extern Polyhedron *Stras_DomainSimplify(Polyhedron *Pol1, Polyhedron *Pol2,
    00074                                         unsigned NbMaxRays);
    00075 extern Polyhedron *DomainUnion(Polyhedron *Pol1,Polyhedron *Pol2,
    00076                                unsigned NbMaxRays);
    00077 extern Polyhedron *Domain_Copy(Polyhedron *Pol);
    00078 extern void Domain_Free (Polyhedron *Pol);
    00079 extern void Domain_PrintConstraints(FILE *Dst, const char *Format,
    00080                                     Polyhedron *Pol);
    00081 extern Polyhedron *Empty_Polyhedron(unsigned Dimension);
    00082 extern int Gauss(Matrix *Mat,int NbEq,int Dimension);
    00083 extern int lower_upper_bounds(int pos,Polyhedron *P,Value *context,
    00084                               Value *LBp,Value *UBp);
    00085 extern Matrix *Polyhedron2Constraints(Polyhedron *Pol);
    00086 extern Matrix *Polyhedron2Rays(Polyhedron *Pol);
    00087 extern int PolyhedronIncludes(Polyhedron *Pol1,Polyhedron *Pol2);
    00088 extern Polyhedron* Polyhedron_Alloc(unsigned Dimension,unsigned
    00089                                     NbConstraints,unsigned NbRays);
    00090 extern Polyhedron *Polyhedron_Copy(Polyhedron *Pol);
    00091 extern void Polyhedron_Free(Polyhedron *Pol);
    00092 extern Polyhedron *Polyhedron_Image(Polyhedron *Pol,Matrix *Func,
    00093                                     unsigned NbMaxConstrs);
    00094 extern Polyhedron *Polyhedron_Preimage(Polyhedron *Pol,Matrix *Func,
    00095                                        unsigned NbMaxRays);
    00096 extern void Polyhedron_Print(FILE *Dst, const char *Format, const Polyhedron *Pol);
    00097 extern void Polyhedron_PrintConstraints(FILE *Dst, const char *Format,
    00098                 Polyhedron *Pol);
    00099 extern Polyhedron *Polyhedron_Scan(Polyhedron *D,Polyhedron *C,
    00100                                    unsigned MAXRAYS);
    00101 extern void PolyPrint(Polyhedron *Pol);
    00102 extern Polyhedron *Rays2Polyhedron(Matrix *Ray,unsigned NbMaxConstrs);
    00103 extern Polyhedron *SubConstraint(Value *Con,Polyhedron *Pol,
    00104                                  unsigned NbMaxRays, int Pass);
    00105 extern Polyhedron *Universe_Polyhedron (unsigned Dimension);
    00106
    00107 #if defined(__cplusplus)
    00108 }
    00109 #endif
    00110
    00111 #endif /* _polyhedron_H_ */