polylib 5.22.8
|
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <polylib/polylib.h>
Go to the source code of this file.
Classes | |
struct | SatMatrix |
Macros | |
#define | INT_BITS (sizeof(unsigned) * 8) |
Functions | |
static void | traite_m_face (Polyhedron *, unsigned int *, unsigned int *) |
static void | scan_m_face (int, int, Polyhedron *, unsigned int *) |
Polyhedron * | PDomainIntersection (Polyhedron *Pol1, Polyhedron *Pol2, unsigned NbMaxRays) |
Polyhedron * | PDomainDifference (Polyhedron *Pol1, Polyhedron *Pol2, unsigned NbMaxRays) |
static int | TestRank (Matrix *Mat) |
static SatMatrix * | SMAlloc (int rows, int cols) |
static void | SMPrint (SatMatrix *matrix) |
static void | SMFree (SatMatrix *matrix) |
static Polyhedron * | Add_CEqualities (Polyhedron *D) |
unsigned int * | int_array2bit_vector (unsigned int *array, int n) |
static int | count_sat (unsigned int *mf) |
static int | bit_vector_includes (unsigned int *bv, int len, unsigned int *part) |
static SatMatrix * | Poly2Sat (Polyhedron *Pol, unsigned int **L) |
Param_Polyhedron * | GenParamPolyhedron (Polyhedron *Pol, Matrix *Rays) |
Matrix * | PreElim_Columns (Polyhedron *E, int *p, int *ref, int m) |
Polyhedron * | Elim_Columns (Polyhedron *A, Polyhedron *E, int *p, int *ref) |
static Polyhedron * | Recession_Cone (Polyhedron *P, unsigned nvar, unsigned MaxRays) |
static int | ComputeNPLinesRays (int n, Polyhedron *D1, Matrix **Rays) |
Param_Polyhedron * | Find_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_Polyhedron * | Polyhedron2Param_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) |
Matrix * | VertexCT (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_Polyhedron * | Polyhedron2Param_Domain (Polyhedron *Din, Polyhedron *Cin, int working_space) |
Param_Polyhedron * | Polyhedron2Param_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 | |
static int | m |
static int | m_dim |
static int | n |
static int | ws |
static int | nr |
static Polyhedron * | CEqualities |
static SatMatrix * | Sat |
static unsigned int * | egalite |
static Matrix * | Xi |
static Matrix * | Pi |
static Matrix * | PiTest |
static Matrix * | CTest |
static Matrix * | PiInv |
static Matrix * | RaysDi |
static int | KD |
static int | nbPV |
static Param_Vertices * | PV_Result |
static Param_Domain * | PDomains |
int | cntbit [256] |
#define INT_BITS (sizeof(unsigned) * 8) |
Definition at line 330 of file polyparam.c.
|
static |
Definition at line 306 of file polyparam.c.
References AddConstraints(), CEqualities, polyhedron::Constraint, Domain_Free(), emptyQ, polyhedron::NbConstraints, polyhedron::next, Polyhedron_Copy(), and ws.
Referenced by Polyhedron2Param_Domain(), and traite_m_face().
|
static |
Definition at line 543 of file polyparam.c.
Referenced by scan_m_face().
void Compute_PDomains | ( | Param_Domain * | PD, |
int | nb_domains, | ||
int | working_space | ||
) |
Definition at line 1351 of file polyparam.c.
References _Param_Domain::Domain, Domain_Free(), DomainConvex(), emptyQ, _Param_Domain::F, MSB, polyhedron::NbEq, NEXT, polyhedron::next, _Param_Domain::next, P_VALUE_FMT, PDomainDifference(), PDomainIntersection(), and Polyhedron_Print().
Referenced by Polyhedron2Param_Domain(), and Polyhedron2Param_SimplifiedDomain().
|
static |
Definition at line 1018 of file polyparam.c.
References Matrix_Alloc(), Matrix_Print(), n, polyhedron::NbBid, polyhedron::NbRays, P_VALUE_FMT, Polyhedron_Free(), polyhedron::Ray, Recession_Cone(), value_zero_p, Vector_Copy(), and ws.
Referenced by Find_m_faces().
|
static |
Polyhedron * Elim_Columns | ( | Polyhedron * | A, |
Polyhedron * | E, | ||
int * | p, | ||
int * | ref | ||
) |
Definition at line 939 of file polyparam.c.
References polyhedron::Constraint, Constraints2Polyhedron(), Matrix_Alloc(), Matrix_Free(), Matrix_Print(), matrix::NbColumns, polyhedron::NbEq, matrix::NbRows, matrix::p, P_VALUE_FMT, 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 1052 of file polyparam.c.
References align_context(), CEqualities, ComputeNPLinesRays(), _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_Alloc(), Matrix_Free(), Matrix_Print(), n, polyhedron::NbBid, polyhedron::NbConstraints, polyhedron::NbEq, nbPV, _Param_Polyhedron::nbV, nr, matrix::p, P_VALUE_FMT, PDomains, Pi, PiInv, PiTest, Poly2Sat(), 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 793 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_Alloc(), polyhedron::NbRays, _Param_Polyhedron::nbV, _Param_Vertex::next, _Param_Domain::next, matrix::p, Polyhedron2Constraints(), polyhedron::Ray, _Param_Polyhedron::Rays, 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 332 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 1858 of file polyparam.c.
References _Param_Domain::Domain, Domain_Free(), _Param_Domain::F, and _Param_Domain::next.
Referenced by Param_Polyhedron_Free().
void Param_Polyhedron_Free | ( | Param_Polyhedron * | P | ) |
Definition at line 1875 of file polyparam.c.
References _Param_Polyhedron::Constraints, _Param_Polyhedron::D, Matrix_Free(), Param_Domain_Free(), 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 1892 of file polyparam.c.
References _Param_Polyhedron::D, polyhedron::Dimension, _Param_Domain::Domain, Matrix_Alloc(), Matrix_Free(), matrix::NbRows, _Param_Polyhedron::nbV, _Param_Vertex::next, Vector::p, matrix::p, 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 1563 of file polyparam.c.
References _Param_Vertex::Domain, _Param_Vertex::Facets, Matrix_Free(), _Param_Vertex::next, 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 1730 of file polyparam.c.
References Constraints2Polyhedron(), _Param_Vertex::Domain, Domain_Free(), _Param_Vertex::next, Print_Domain(), Print_Vertex(), and _Param_Vertex::Vertex.
Referenced by main().
Polyhedron * PDomainDifference | ( | Polyhedron * | Pol1, |
Polyhedron * | Pol2, | ||
unsigned | NbMaxRays | ||
) |
Definition at line 84 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_Free(), and SubConstraint().
Referenced by Compute_PDomains().
Polyhedron * PDomainIntersection | ( | Polyhedron * | Pol1, |
Polyhedron * | Pol2, | ||
unsigned | NbMaxRays | ||
) |
Definition at line 41 of file polyparam.c.
References AddConstraints(), AddPolyToDomain(), polyhedron::Constraint, polyhedron::Dimension, polyhedron::NbConstraints, polyhedron::NbEq, polyhedron::next, POL_ENSURE_FACETS, POL_ENSURE_VERTICES, and Polyhedron_Free().
Referenced by Compute_PDomains().
|
static |
Definition at line 736 of file polyparam.c.
References polyhedron::Constraint, polyhedron::Dimension, MSB, polyhedron::NbConstraints, polyhedron::NbRays, NEXT, nr, SatMatrix::p, SatMatrix::p_init, 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 1755 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, POL_ENSURE_FACETS, POL_ENSURE_VERTICES, and Polyhedron_Free().
Referenced by main().
Param_Polyhedron * Polyhedron2Param_SimplifiedDomain | ( | Polyhedron ** | Din, |
Polyhedron * | Cin, | ||
int | working_space, | ||
Polyhedron ** | CEq, | ||
Matrix ** | CT | ||
) |
Definition at line 1804 of file polyparam.c.
References assert, Compute_PDomains(), _Param_Polyhedron::D, polyhedron::Dimension, Find_m_faces(), _Param_Polyhedron::nbV, POL_ENSURE_FACETS, and POL_ENSURE_VERTICES.
Referenced by Ehrhart_Quick_Apx_Full_Dim(), and Polyhedron_Enumerate().
Param_Polyhedron * Polyhedron2Param_Vertices | ( | Polyhedron * | Din, |
Polyhedron * | Cin, | ||
int | working_space | ||
) |
Definition at line 1531 of file polyparam.c.
References Find_m_faces(), _Param_Polyhedron::nbV, POL_ENSURE_FACETS, and POL_ENSURE_VERTICES.
Referenced by main().
Matrix * PreElim_Columns | ( | Polyhedron * | E, |
int * | p, | ||
int * | ref, | ||
int | m | ||
) |
Definition at line 864 of file polyparam.c.
References polyhedron::Constraint, polyhedron::Dimension, m, Matrix_Alloc(), Matrix_Print(), matrix::NbColumns, polyhedron::NbEq, matrix::NbRows, matrix::p, P_VALUE_FMT, 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 1680 of file polyparam.c.
References polyhedron::Constraint, polyhedron::Dimension, polyhedron::NbConstraints, polyhedron::next, POL_ENSURE_FACETS, POL_ENSURE_VERTICES, Print_Domain(), 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(), Polyhedron_Enumerate(), and Print_Domain().
void Print_Vertex | ( | FILE * | DST, |
Matrix * | V, | ||
const char ** | param_names | ||
) |
Definition at line 1583 of file polyparam.c.
References 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().
|
static |
Definition at line 999 of file polyparam.c.
References polyhedron::Constraint, Constraints2Polyhedron(), Matrix_Alloc(), Matrix_Free(), polyhedron::NbConstraints, matrix::p, and Vector_Copy().
Referenced by ComputeNPLinesRays().
|
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, Sat, scan_m_face(), TestRank(), traite_m_face(), and value_assign.
Referenced by Find_m_faces(), and scan_m_face().
|
static |
Definition at line 220 of file polyparam.c.
References assert, SatMatrix::NbColumns, SatMatrix::NbRows, SatMatrix::p, and SatMatrix::p_init.
Referenced by Poly2Sat().
|
static |
|
static |
Definition at line 244 of file polyparam.c.
References matrix::NbColumns, matrix::NbRows, and matrix::p.
Referenced by Find_m_faces().
|
static |
Definition at line 133 of file polyparam.c.
References 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().
|
static |
Definition at line 353 of file polyparam.c.
References Add_CEqualities(), _Param_Vertex::Domain, _Param_Domain::Domain, egalite, _Param_Domain::F, _Param_Vertex::Facets, int_array2bit_vector(), KD, m, MatInverse(), Matrix_Alloc(), Matrix_Print(), MSB, n, matrix::NbColumns, polyhedron::NbConstraints, nbPV, polyhedron::NbRays, matrix::NbRows, NEXT, _Param_Vertex::next, _Param_Domain::next, matrix::p, P_VALUE_FMT, PDomains, Pi, PiInv, PiTest, 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().
Definition at line 1651 of file polyparam.c.
References Matrix_Alloc(), matrix::NbColumns, matrix::NbRows, matrix::p, value_assign, value_notzero_p, and value_set_si.
Referenced by Scan_Vertices().
|
static |
Definition at line 280 of file polyparam.c.
Referenced by Add_CEqualities(), Find_m_faces(), and Polyhedron2Param_Domain().
int cntbit[256] |
Definition at line 509 of file polyparam.c.
Referenced by count_sat().
|
static |
Definition at line 285 of file polyparam.c.
Referenced by Find_m_faces(), and scan_m_face().
|
static |
Definition at line 282 of file polyparam.c.
Referenced by Find_m_faces(), scan_m_face(), and traite_m_face().
|
static |
Definition at line 290 of file polyparam.c.
Referenced by Find_m_faces(), and traite_m_face().
|
static |
Definition at line 274 of file polyparam.c.
Referenced by Chernikova(), compute_enode(), Find_m_faces(), Free_ParamNames(), isfulldim(), IsLattice(), main(), PreElim_Columns(), Read_ParamNames(), scan_m_face(), and traite_m_face().
|
static |
Definition at line 275 of file polyparam.c.
Referenced by Find_m_faces(), and scan_m_face().
|
static |
Definition at line 276 of file polyparam.c.
Referenced by Binomial(), colonne(), ComputeNPLinesRays(), echange_c(), encore(), evalue_div(), Factorial(), Find_m_faces(), GaussSimplify(), hermite(), identite(), int_array2bit_vector(), lower_upper_bounds(), Matrix_Read_InputFile(), moins_c(), nb_bits(), P_Enum(), petit_c(), Polyhedron_Preprocess2(), PolyhedronTSort(), scan_m_face(), smith(), traite_m_face(), transpose(), Vector_Equal(), Vector_Set(), and Vector_Sort().
|
static |
Definition at line 293 of file polyparam.c.
Referenced by Find_m_faces(), main(), and traite_m_face().
|
static |
Definition at line 278 of file polyparam.c.
Referenced by count_sat(), Find_m_faces(), hermite(), left_hermite(), Poly2Sat(), right_hermite(), and scan_m_face().
|
static |
Definition at line 295 of file polyparam.c.
Referenced by Find_m_faces(), and traite_m_face().
|
static |
Definition at line 283 of file polyparam.c.
Referenced by Ehrhart_Quick_Apx_Full_Dim(), Find_m_faces(), Polyhedron_Enumerate(), and traite_m_face().
|
static |
Definition at line 286 of file polyparam.c.
Referenced by Find_m_faces(), and traite_m_face().
|
static |
Definition at line 284 of file polyparam.c.
Referenced by Find_m_faces(), and traite_m_face().
|
static |
Definition at line 294 of file polyparam.c.
Referenced by Find_m_faces(), and traite_m_face().
|
static |
Definition at line 288 of file polyparam.c.
Referenced by Find_m_faces(), and traite_m_face().
|
static |
Definition at line 281 of file polyparam.c.
Referenced by AddConstraints(), AddRays(), addToFilter(), BuildSat(), Chernikova(), Constraints2Polyhedron(), Find_m_faces(), FindSimple(), Poly2Sat(), Rays2Polyhedron(), RaySort(), Remove_Redundants(), SatMatrix_Extend(), scan_m_face(), SimplifyConstraints(), SubConstraint(), and TransformSat().
|
static |
Definition at line 277 of file polyparam.c.
Referenced by Add_CEqualities(), ComputeNPLinesRays(), Elim_Columns(), Find_m_faces(), and traite_m_face().
|
static |
Definition at line 283 of file polyparam.c.
Referenced by Find_m_faces(), and traite_m_face().