Main Page | Class List | File List | Class Members | File Members

polyparam.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <polylib/polylib.h>

Go to the source code of this file.

Classes

struct  SatMatrix

Defines

#define INT_BITS   (sizeof(unsigned) * 8)

Functions

void traite_m_face (Polyhedron *, unsigned int *, unsigned int *)
void scan_m_face (int, int, Polyhedron *, unsigned int *)
PolyhedronPDomainIntersection (Polyhedron *Pol1, Polyhedron *Pol2, unsigned NbMaxRays)
PolyhedronPDomainDifference (Polyhedron *Pol1, Polyhedron *Pol2, unsigned NbMaxRays)
int TestRank (Matrix *Mat)
SatMatrixSMAlloc (int rows, int cols)
void SMPrint (SatMatrix *matrix)
void SMFree (SatMatrix *matrix)
PolyhedronAdd_CEqualities (Polyhedron *D)
unsigned int * int_array2bit_vector (unsigned int *array, int n)
int count_sat (unsigned int *mf)
int bit_vector_includes (unsigned int *bv, int len, unsigned int *part)
SatMatrixPoly2Sat (Polyhedron *Pol, unsigned int **L)
Param_PolyhedronGenParamPolyhedron (Polyhedron *Pol, Matrix *Rays)
MatrixPreElim_Columns (Polyhedron *E, int *p, int *ref, int m)
PolyhedronElim_Columns (Polyhedron *A, Polyhedron *E, int *p, int *ref)
PolyhedronRecession_Cone (Polyhedron *P, unsigned nvar, unsigned MaxRays)
int ComputeNPLinesRays (int n, Polyhedron *D1, Matrix **Rays)
Param_PolyhedronFind_m_faces (Polyhedron **Di, Polyhedron *C, int keep_dom, int working_space, Polyhedron **CEq, Matrix **CT)
void Compute_PDomains (Param_Domain *PD, int nb_domains, int working_space)
Param_PolyhedronPolyhedron2Param_Vertices (Polyhedron *Din, Polyhedron *Cin, int working_space)
void Param_Vertices_Free (Param_Vertices *PV)
void Print_Vertex (FILE *DST, Matrix *V, const char **param_names)
MatrixVertexCT (Matrix *V, Matrix *CT)
void Print_Domain (FILE *DST, Polyhedron *D, const char **pname)
void Param_Vertices_Print (FILE *DST, Param_Vertices *PV, const char **param_names)
Param_PolyhedronPolyhedron2Param_Domain (Polyhedron *Din, Polyhedron *Cin, int working_space)
Param_PolyhedronPolyhedron2Param_SimplifiedDomain (Polyhedron **Din, Polyhedron *Cin, int working_space, Polyhedron **CEq, Matrix **CT)
void Param_Domain_Free (Param_Domain *PD)
void Param_Polyhedron_Free (Param_Polyhedron *P)
void Param_Polyhedron_Scale_Integer (Param_Polyhedron *PP, Polyhedron **P, Value *det, unsigned MaxRays)

Variables

int m
int m_dim
int n
int ws
int nr
PolyhedronCEqualities
SatMatrixSat
unsigned int * egalite
MatrixXi
MatrixPi
MatrixPiTest
MatrixCTest
MatrixPiInv
MatrixRaysDi
int KD
int nbPV
Param_VerticesPV_Result
Param_DomainPDomains
int cntbit [256]


Define Documentation

#define INT_BITS   (sizeof(unsigned) * 8)
 

Definition at line 322 of file polyparam.c.

Referenced by int_array2bit_vector().


Function Documentation

Polyhedron* Add_CEqualities Polyhedron D  )  [static]
 

Definition at line 297 of file polyparam.c.

References AddConstraints(), CEqualities, polyhedron::Constraint, Domain_Free(), emptyQ, polyhedron::NbConstraints, polyhedron::next, Polyhedron, Polyhedron_Copy(), and ws.

Referenced by Polyhedron2Param_Domain(), and traite_m_face().

int bit_vector_includes unsigned int *  bv,
int  len,
unsigned int *  part
[static]
 

Definition at line 542 of file polyparam.c.

Referenced by scan_m_face().

void Compute_PDomains Param_Domain PD,
int  nb_domains,
int  working_space
 

Definition at line 1349 of file polyparam.c.

References _Param_Domain::Domain, Domain_Free(), DomainConvex(), emptyQ, _Param_Domain::F, MSB, polyhedron::NbEq, _Param_Domain::next, NEXT, P_VALUE_FMT, Param_Domain, PDomainDifference(), PDomainIntersection(), Polyhedron, and Polyhedron_Print().

Referenced by Polyhedron2Param_Domain(), and Polyhedron2Param_SimplifiedDomain().

int ComputeNPLinesRays int  n,
Polyhedron D1,
Matrix **  Rays
[static]
 

Definition at line 1016 of file polyparam.c.

References Matrix, Matrix_Alloc(), Matrix_Print(), n, polyhedron::NbBid, polyhedron::NbRays, P_VALUE_FMT, Polyhedron, Polyhedron_Free(), polyhedron::Ray, Recession_Cone(), value_zero_p, Vector_Copy(), and ws.

Referenced by Find_m_faces().

int count_sat unsigned int *  mf  )  [static]
 

Definition at line 525 of file polyparam.c.

References cntbit, and nr.

Referenced by scan_m_face().

Polyhedron* Elim_Columns Polyhedron A,
Polyhedron E,
int *  p,
int *  ref
 

Definition at line 938 of file polyparam.c.

References polyhedron::Constraint, Constraints2Polyhedron(), Matrix, Matrix_Alloc(), Matrix_Free(), Matrix_Print(), matrix::NbColumns, polyhedron::NbEq, matrix::NbRows, p, matrix::p, P_VALUE_FMT, Polyhedron, Polyhedron2Constraints(), Polyhedron_Print(), value_assign, value_clear, value_init, value_multiply, value_notzero_p, value_subtract, and ws.

Referenced by Find_m_faces().

Param_Polyhedron* Find_m_faces Polyhedron **  Di,
Polyhedron C,
int  keep_dom,
int  working_space,
Polyhedron **  CEq,
Matrix **  CT
 

Definition at line 1051 of file polyparam.c.

References align_context(), CEqualities, ComputeNPLinesRays(), polyhedron::Constraint, _Param_Polyhedron::Constraints, Constraints2Polyhedron(), CTest, _Param_Polyhedron::D, polyhedron::Dimension, Domain_Free(), DomainAddRays(), DomainIntersection(), DomainSimplify(), egalite, Elim_Columns(), emptyQ, GenParamPolyhedron(), KD, m, m_dim, Matrix, Matrix_Alloc(), Matrix_Free(), Matrix_Print(), n, polyhedron::NbBid, polyhedron::NbConstraints, polyhedron::NbEq, nbPV, polyhedron::NbRays, _Param_Polyhedron::nbV, nr, matrix::p, p, P_VALUE_FMT, Param_Polyhedron, PDomains, Pi, PiInv, PiTest, Poly2Sat(), Polyhedron, Polyhedron2Constraints(), Polyhedron_Free(), Polyhedron_Print(), PreElim_Columns(), PV_Result, _Param_Polyhedron::Rays, RaysDi, Sat, scan_m_face(), SMFree(), SMPrint(), Universe_Polyhedron(), _Param_Polyhedron::V, value_assign, value_notzero_p, value_set_si, Vector_Copy(), ws, and Xi.

Referenced by Polyhedron2Param_Domain(), Polyhedron2Param_SimplifiedDomain(), and Polyhedron2Param_Vertices().

Param_Polyhedron* GenParamPolyhedron Polyhedron Pol,
Matrix Rays
 

Definition at line 792 of file polyparam.c.

References _Param_Polyhedron::Constraints, _Param_Polyhedron::D, polyhedron::Dimension, _Param_Vertex::Domain, _Param_Domain::Domain, _Param_Domain::F, _Param_Vertex::Facets, Matrix, Matrix_Alloc(), polyhedron::NbRays, _Param_Polyhedron::nbV, _Param_Vertex::next, _Param_Domain::next, matrix::p, Param_Domain, Param_Polyhedron, Param_Vertices, Polyhedron, Polyhedron2Constraints(), polyhedron::Ray, _Param_Polyhedron::Rays, size, Universe_Polyhedron(), _Param_Polyhedron::V, value_assign, value_notone_p, value_set_si, value_zero_p, and _Param_Vertex::Vertex.

Referenced by Find_m_faces().

unsigned int* int_array2bit_vector unsigned int *  array,
int  n
 

Definition at line 324 of file polyparam.c.

References assert, INT_BITS, MSB, n, and NEXT.

Referenced by traite_m_face().

void Param_Domain_Free Param_Domain PD  ) 
 

Definition at line 1846 of file polyparam.c.

References _Param_Domain::Domain, Domain_Free(), _Param_Domain::F, _Param_Domain::next, and Param_Domain.

Referenced by Param_Polyhedron_Free().

void Param_Polyhedron_Free Param_Polyhedron P  ) 
 

Definition at line 1863 of file polyparam.c.

References _Param_Polyhedron::Constraints, _Param_Polyhedron::D, Matrix_Free(), Param_Domain_Free(), Param_Polyhedron, Param_Vertices_Free(), _Param_Polyhedron::Rays, and _Param_Polyhedron::V.

Referenced by main(), and Polyhedron_Enumerate().

void Param_Polyhedron_Scale_Integer Param_Polyhedron PP,
Polyhedron **  P,
Value *  det,
unsigned  MaxRays
 

Definition at line 1879 of file polyparam.c.

References _Param_Polyhedron::D, polyhedron::Dimension, _Param_Domain::Domain, Matrix, Matrix_Alloc(), Matrix_Free(), matrix::NbRows, _Param_Polyhedron::nbV, _Param_Vertex::next, Vector::p, matrix::p, Param_Polyhedron, Param_Vertices, Polyhedron, Polyhedron_Preimage(), _Param_Polyhedron::V, value_assign, value_clear, value_division, value_init, value_lcm, value_multiply, value_set_si, Vector_Alloc(), Vector_Free(), Vector_Normalize(), Vector_Scale(), and _Param_Vertex::Vertex.

Referenced by Ehrhart_Quick_Apx_Full_Dim().

void Param_Vertices_Free Param_Vertices PV  ) 
 

Definition at line 1560 of file polyparam.c.

References _Param_Vertex::Domain, _Param_Vertex::Facets, Matrix_Free(), _Param_Vertex::next, Param_Vertices, and _Param_Vertex::Vertex.

Referenced by Param_Polyhedron_Free(), and Polyhedron_Enumerate().

void Param_Vertices_Print FILE *  DST,
Param_Vertices PV,
const char **  param_names
 

Definition at line 1729 of file polyparam.c.

References Constraints2Polyhedron(), _Param_Vertex::Domain, Domain_Free(), _Param_Vertex::next, Param_Vertices, Polyhedron, Print_Domain(), Print_Vertex(), and _Param_Vertex::Vertex.

Referenced by main().

Polyhedron* PDomainDifference Polyhedron Pol1,
Polyhedron Pol2,
unsigned  NbMaxRays
 

Definition at line 86 of file polyparam.c.

References AddPolyToDomain(), polyhedron::Constraint, polyhedron::Dimension, Domain_Free(), emptyQ, polyhedron::NbConstraints, polyhedron::NbEq, polyhedron::next, POL_ENSURE_FACETS, POL_ENSURE_VERTICES, Polyhedron, Polyhedron_Free(), and SubConstraint().

Referenced by Compute_PDomains().

Polyhedron* PDomainIntersection Polyhedron Pol1,
Polyhedron Pol2,
unsigned  NbMaxRays
 

Definition at line 45 of file polyparam.c.

References AddConstraints(), AddPolyToDomain(), polyhedron::Constraint, polyhedron::Dimension, polyhedron::NbConstraints, polyhedron::NbEq, polyhedron::next, POL_ENSURE_FACETS, POL_ENSURE_VERTICES, Polyhedron, and Polyhedron_Free().

Referenced by Compute_PDomains().

SatMatrix* Poly2Sat Polyhedron Pol,
unsigned int **  L
[static]
 

Definition at line 739 of file polyparam.c.

References polyhedron::Constraint, polyhedron::Dimension, MSB, polyhedron::NbConstraints, polyhedron::NbRays, NEXT, nr, SatMatrix::p, SatMatrix::p_init, Polyhedron, polyhedron::Ray, Sat, SMAlloc(), value_addto, value_clear, value_init, value_multiply, value_set_si, and value_zero_p.

Referenced by Find_m_faces().

Param_Polyhedron* Polyhedron2Param_Domain Polyhedron Din,
Polyhedron Cin,
int  working_space
 

Definition at line 1754 of file polyparam.c.

References Add_CEqualities(), CEqualities, Compute_PDomains(), _Param_Polyhedron::D, polyhedron::Dimension, _Param_Domain::Domain, emptyQ, Find_m_faces(), _Param_Polyhedron::nbV, _Param_Domain::next, Param_Domain, Param_Polyhedron, POL_ENSURE_FACETS, POL_ENSURE_VERTICES, Polyhedron, and Polyhedron_Free().

Referenced by main().

Param_Polyhedron* Polyhedron2Param_SimplifiedDomain Polyhedron **  Din,
Polyhedron Cin,
int  working_space,
Polyhedron **  CEq,
Matrix **  CT
 

Definition at line 1799 of file polyparam.c.

References assert, Compute_PDomains(), _Param_Polyhedron::D, polyhedron::Dimension, Find_m_faces(), Matrix, _Param_Polyhedron::nbV, Param_Polyhedron, POL_ENSURE_FACETS, POL_ENSURE_VERTICES, and Polyhedron.

Referenced by Ehrhart_Quick_Apx_Full_Dim(), and Polyhedron_Enumerate().

Param_Polyhedron* Polyhedron2Param_Vertices Polyhedron Din,
Polyhedron Cin,
int  working_space
 

Definition at line 1529 of file polyparam.c.

References Find_m_faces(), _Param_Polyhedron::nbV, Param_Polyhedron, POL_ENSURE_FACETS, POL_ENSURE_VERTICES, and Polyhedron.

Referenced by main().

Matrix* PreElim_Columns Polyhedron E,
int *  p,
int *  ref,
int  m
 

Definition at line 865 of file polyparam.c.

References polyhedron::Constraint, polyhedron::Dimension, m, Matrix, Matrix_Alloc(), Matrix_Print(), matrix::NbColumns, polyhedron::NbEq, matrix::NbRows, matrix::p, p, P_VALUE_FMT, Polyhedron, Polyhedron_Print(), value_notzero_p, value_set_si, and value_zero_p.

Referenced by Find_m_faces().

void Print_Domain FILE *  DST,
Polyhedron D,
const char **  pname
 

Definition at line 1676 of file polyparam.c.

References polyhedron::Constraint, polyhedron::Dimension, polyhedron::NbConstraints, polyhedron::next, POL_ENSURE_FACETS, POL_ENSURE_VERTICES, Polyhedron, value_mone_p, value_notzero_p, value_one_p, value_pos_p, and value_print.

Referenced by compute_poly(), Ehrhart_Quick_Apx_Full_Dim(), Enumerate_NoParameters(), main(), Param_Vertices_Print(), and Polyhedron_Enumerate().

void Print_Vertex FILE *  DST,
Matrix V,
const char **  param_names
 

Definition at line 1577 of file polyparam.c.

References Matrix, matrix::NbColumns, matrix::NbRows, matrix::p, value_clear, value_divexact, value_gcd, value_init, value_mone_p, value_notone_p, value_notzero_p, value_posz_p, and value_print.

Referenced by main(), Param_Vertices_Print(), and Scan_Vertices().

Polyhedron* Recession_Cone Polyhedron P,
unsigned  nvar,
unsigned  MaxRays
[static]
 

Definition at line 997 of file polyparam.c.

References polyhedron::Constraint, Constraints2Polyhedron(), Matrix, Matrix_Alloc(), Matrix_Free(), polyhedron::NbConstraints, matrix::p, Polyhedron, and Vector_Copy().

Referenced by ComputeNPLinesRays().

void scan_m_face int  ,
int  ,
Polyhedron ,
unsigned int * 
[static]
 

Definition at line 598 of file polyparam.c.

References bit_vector_includes(), polyhedron::Constraint, count_sat(), CTest, polyhedron::Dimension, egalite, m, m_dim, Matrix_Print(), n, matrix::NbColumns, polyhedron::NbConstraints, nr, matrix::p, SatMatrix::p, P_VALUE_FMT, Polyhedron, Sat, TestRank(), traite_m_face(), and value_assign.

Referenced by Find_m_faces().

SatMatrix* SMAlloc int  rows,
int  cols
[static]
 

Definition at line 212 of file polyparam.c.

References assert, SatMatrix::NbColumns, SatMatrix::NbRows, SatMatrix::p, p, and SatMatrix::p_init.

Referenced by BuildSat(), Constraints2Polyhedron(), FindSimple(), Poly2Sat(), Rays2Polyhedron(), and TransformSat().

void SMFree SatMatrix matrix  )  [static]
 

Definition at line 251 of file polyparam.c.

References SatMatrix::p, and SatMatrix::p_init.

Referenced by AddConstraints(), AddRays(), BuildSat(), Constraints2Polyhedron(), Find_m_faces(), FindSimple(), Rays2Polyhedron(), SimplifyConstraints(), and SubConstraint().

void SMPrint SatMatrix matrix  )  [static]
 

Definition at line 235 of file polyparam.c.

References SatMatrix::NbColumns, SatMatrix::NbRows, SatMatrix::p, and p.

Referenced by Chernikova(), Constraints2Polyhedron(), Find_m_faces(), and Rays2Polyhedron().

int TestRank Matrix Mat  )  [static]
 

Definition at line 134 of file polyparam.c.

References Matrix, matrix::NbColumns, matrix::NbRows, matrix::p, value_assign, value_clear, value_division, value_gcd, value_init, value_multiply, value_notzero_p, value_subtract, and value_zero_p.

Referenced by scan_m_face(), and traite_m_face().

void traite_m_face Polyhedron ,
unsigned int *  ,
unsigned int * 
[static]
 

Definition at line 346 of file polyparam.c.

References Add_CEqualities(), _Param_Domain::Domain, _Param_Vertex::Domain, egalite, _Param_Domain::F, _Param_Vertex::Facets, int_array2bit_vector(), KD, m, MatInverse(), Matrix, Matrix_Alloc(), Matrix_Print(), MSB, n, matrix::NbColumns, polyhedron::NbConstraints, nbPV, polyhedron::NbRays, matrix::NbRows, _Param_Domain::next, _Param_Vertex::next, NEXT, matrix::p, P_VALUE_FMT, Param_Domain, Param_Vertices, PDomains, Pi, PiInv, PiTest, Polyhedron, Polyhedron2Constraints(), Polyhedron_Free(), Polyhedron_Print(), PV_Result, rat_prodmat(), polyhedron::Ray, Rays2Polyhedron(), RaysDi, TestRank(), value_assign, Vector_Copy(), _Param_Vertex::Vertex, ws, and Xi.

Referenced by scan_m_face().

Matrix* VertexCT Matrix V,
Matrix CT
 

Definition at line 1646 of file polyparam.c.

References Matrix, Matrix_Alloc(), matrix::NbColumns, matrix::NbRows, matrix::p, value_assign, value_notzero_p, and value_set_si.

Referenced by Scan_Vertices().


Variable Documentation

Polyhedron* CEqualities [static]
 

Definition at line 271 of file polyparam.c.

Referenced by Add_CEqualities(), Find_m_faces(), and Polyhedron2Param_Domain().

int cntbit[256]
 

Initial value:

 {                              
0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4,
1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,
1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,
2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,

1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,
2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,

1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,
2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,

2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,
3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,
4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8 }

Definition at line 504 of file polyparam.c.

Referenced by count_sat().

Matrix* CTest [static]
 

Definition at line 276 of file polyparam.c.

Referenced by Find_m_faces(), and scan_m_face().

unsigned int* egalite [static]
 

Definition at line 273 of file polyparam.c.

Referenced by Find_m_faces(), scan_m_face(), and traite_m_face().

int KD [static]
 

Definition at line 281 of file polyparam.c.

Referenced by Find_m_faces(), and traite_m_face().

int m [static]
 

Definition at line 265 of file polyparam.c.

Referenced by Find_m_faces(), PreElim_Columns(), scan_m_face(), and traite_m_face().

int m_dim [static]
 

Definition at line 266 of file polyparam.c.

Referenced by Find_m_faces(), and scan_m_face().

int n [static]
 

Definition at line 267 of file polyparam.c.

Referenced by ComputeNPLinesRays(), Find_m_faces(), int_array2bit_vector(), scan_m_face(), and traite_m_face().

int nbPV [static]
 

Definition at line 284 of file polyparam.c.

Referenced by Find_m_faces(), and traite_m_face().

int nr [static]
 

Definition at line 269 of file polyparam.c.

Referenced by count_sat(), Find_m_faces(), Poly2Sat(), and scan_m_face().

Param_Domain* PDomains [static]
 

Definition at line 286 of file polyparam.c.

Referenced by Find_m_faces(), and traite_m_face().

Matrix * Pi [static]
 

Definition at line 274 of file polyparam.c.

Referenced by Find_m_faces(), and traite_m_face().

Matrix* PiInv [static]
 

Definition at line 277 of file polyparam.c.

Referenced by Find_m_faces(), and traite_m_face().

Matrix* PiTest [static]
 

Definition at line 275 of file polyparam.c.

Referenced by Find_m_faces(), and traite_m_face().

Param_Vertices* PV_Result [static]
 

Definition at line 285 of file polyparam.c.

Referenced by Find_m_faces(), and traite_m_face().

Matrix* RaysDi [static]
 

Definition at line 279 of file polyparam.c.

Referenced by Find_m_faces(), and traite_m_face().

SatMatrix* Sat [static]
 

Definition at line 272 of file polyparam.c.

Referenced by Find_m_faces(), Poly2Sat(), and scan_m_face().

int ws [static]
 

Definition at line 268 of file polyparam.c.

Referenced by Add_CEqualities(), ComputeNPLinesRays(), Elim_Columns(), Find_m_faces(), and traite_m_face().

Matrix* Xi [static]
 

Definition at line 274 of file polyparam.c.

Referenced by Find_m_faces(), and traite_m_face().


Generated on Thu Sep 4 15:29:00 2008 for polylib by doxygen 1.3.5