#include <stdlib.h>
#include <polylib/polylib.h>
Go to the source code of this file.
Defines | |
#define | dbgCompParm 0 |
debug flags (2 levels) | |
#define | dbgCompParmMore 0 |
#define | dbgStart(a) |
#define | dbgEnd(a) |
Functions | |
Matrix * | int_ker (Matrix *M) |
given a full-row-rank nxm matrix M(made of row-vectors), computes the basis K (made of n-m column-vectors) of the integer kernel of M so we have: M.K = 0 | |
void | linearInter (Matrix *A, Matrix *B, Matrix **I, Matrix **Lb) |
Computes the intersection of two linear lattices, whose base vectors are respectively represented in A and B. | |
void | Equalities_integerSolution (Matrix *Eqs, Matrix **I) |
Given a system of non-redundant equalities, looks if it has an integer solution in the combined space, and if yes, returns one solution. | |
void | Equalities_validityLattice (Matrix *Eqs, int a, Matrix **vl) |
Computes the validity lattice of a set of equalities. | |
void | Constraints_removeElimCols (Matrix *M, unsigned int nbVars, unsigned int *elimParms, Matrix **newM) |
Eliminates the columns corresponding to a list of eliminated parameters. | |
void | Constraints_fullDimensionize (Matrix **M, Matrix **C, Matrix **VL, Matrix **Eqs, Matrix **ParmEqs, unsigned int **elimVars, unsigned int **elimParms, int maxRays) |
Eliminates all the equalities in a set of constraints and returns the set of constraints defining a full-dimensional polyhedron, such that there is a bijection between integer points of the original polyhedron and these of the resulting (projected) polyhedron). | |
void | Lattice_extractSubLattice (Matrix *lat, unsigned int k, Matrix **subLat) |
Given a matrix that defines a full-dimensional affine lattice, returns the affine sub-lattice spanned in the k first dimensions. | |
Matrix * | affine_periods (Matrix *M, Matrix *d) |
Computes the overall period of the variables I for (MI) mod |d|, where M is a matrix and |d| a vector. | |
void | Equalities_intModBasis (Matrix *B, Matrix *C, Matrix *d, Matrix **imb) |
Given an integer matrix B with m rows and integer m-vectors C and d, computes the basis of the integer solutions to (BN+C) mod d = 0 (1). | |
Matrix * | int_mod_basis (Matrix *B, Matrix *C, Matrix *d) |
kept here for backwards compatiblity. | |
Matrix * | compress_parms (Matrix *E, int nbParms) |
Given a parameterized constraints matrix with m equalities, computes the compression matrix G such that there is an integer solution in the variables space for each value of N', with N = G N' (N are the "nb_parms" parameters). | |
Matrix * | Constraints_Remove_parm_eqs (Matrix **M1, Matrix **Ctxt1, int renderSpace, unsigned int **elimParms) |
Removes the equalities that involve only parameters, by eliminating some parameters in the polyhedron's constraints and in the context. | |
Polyhedron * | Polyhedron_Remove_parm_eqs (Polyhedron **P, Polyhedron **C, int renderSpace, unsigned int **elimParms, int maxRays) |
Removes equalities involving only parameters, but starting from a Polyhedron and its context. | |
Matrix * | full_dimensionize (Matrix const *M, int nbParms, Matrix **validityLattice) |
Given a matrix with m parameterized equations, compress the nb_parms parameters and n-m variables so that m variables are integer, and transform the variable space into a n-m space by eliminating the m variables (using the equalities) the variables to be eliminated are chosen automatically by the function. |
|
debug flags (2 levels)
Definition at line 21 of file compress_parms.c. Referenced by Constraints_fullDimensionize(), Equalities_integerSolution(), Equalities_validityLattice(), full_dimensionize(), int_ker(), and linearInter(). |
|
Definition at line 22 of file compress_parms.c. Referenced by Constraints_fullDimensionize(), Equalities_integerSolution(), int_ker(), and Lattice_extractSubLattice(). |
|
Value: if (dbgCompParmMore) { printf(" -- end "); \ printf(#a); \ printf(" --\n"); } \ while(0) Definition at line 28 of file compress_parms.c. Referenced by Lattice_extractSubLattice(). |
|
Value: if (dbgCompParmMore) { printf(" -- begin "); \ printf(#a); \ printf(" --\n"); } \ while(0) Definition at line 24 of file compress_parms.c. Referenced by Lattice_extractSubLattice(). |
|
Computes the overall period of the variables I for (MI) mod |d|, where M is a matrix and |d| a vector. Produce a diagonal matrix S = (s_k) where s_k is the overall period of i_k
Definition at line 531 of file compress_parms.c. References Matrix, Matrix_Alloc(), matrix::NbColumns, matrix::NbRows, matrix::p, value_assign, value_clear, value_divexact, value_gcd, value_init, value_lcm, and value_set_si. |
|
Given a parameterized constraints matrix with m equalities, computes the compression matrix G such that there is an integer solution in the variables space for each value of N', with N = G N' (N are the "nb_parms" parameters).
Definition at line 613 of file compress_parms.c. References Equalities_validityLattice(), Matrix, and matrix::NbColumns. Referenced by full_dimensionize(). |
|
Eliminates all the equalities in a set of constraints and returns the set of constraints defining a full-dimensional polyhedron, such that there is a bijection between integer points of the original polyhedron and these of the resulting (projected) polyhedron). If VL is set to NULL, this funciton allocates it. Else, it assumes that (*VL) points to a matrix of the right size. The following things are done:
Definition at line 369 of file compress_parms.c. References assert, Constraints_compressLastVars, Constraints_eliminateFirstVars, Constraints_permute(), Constraints_removeElimCols(), Constraints_removeParmEqs, dbgCompParm, dbgCompParmMore, Equalities_validityLattice(), find_a_permutation(), Matrix, Matrix_Alloc(), Matrix_Free(), Matrix_identity(), matrix::NbColumns, matrix::NbRows, matrix::p, show_matrix, split_constraints(), value_assign, and value_set_si. Referenced by test_Constraints_fullDimensionize(). |
|
Removes the equalities that involve only parameters, by eliminating some parameters in the polyhedron's constraints and in the context. Updates M and Ctxt.
Definition at line 632 of file compress_parms.c. References eliminate_var_with_constr(), First_Non_Zero(), Matrix, Matrix_Alloc(), Matrix_Free(), matrix::NbColumns, matrix::NbRows, matrix::p, show_matrix, value_cmp_si, value_notzero_p, value_set_si, value_zero_p, and Vector_Copy(). Referenced by Constraints_EhrhartQuickApx(), Polyhedron_Remove_parm_eqs(), and test_Constraints_Remove_parm_eqs(). |
|
Eliminates the columns corresponding to a list of eliminated parameters.
Definition at line 318 of file compress_parms.c. References assert, Matrix, Matrix_Alloc(), Matrix_clone(), matrix::NbColumns, matrix::NbRows, matrix::p, value_assign, and Vector_Copy(). Referenced by Constraints_fullDimensionize(). |
|
Given a system of non-redundant equalities, looks if it has an integer solution in the combined space, and if yes, returns one solution. pre-condition: the equalities are full-row rank (without the constant part)
Definition at line 164 of file compress_parms.c. References dbgCompParm, dbgCompParmMore, ensureMatrix, left_hermite(), MatInverse(), Matrix, Matrix_Alloc(), Matrix_Free(), Matrix_oppose(), Matrix_Product(), Matrix_subMatrix(), matrix::NbColumns, matrix::NbRows, matrix::p, show_matrix, value_clear, value_init, value_notzero_p, value_pdivision, value_pmodulus, and value_set_si. Referenced by Equalities_validityLattice(). |
|
Given an integer matrix B with m rows and integer m-vectors C and d, computes the basis of the integer solutions to (BN+C) mod d = 0 (1). This is an affine lattice (G): (N 1)^T= G(N' 1)^T, forall N' in Z^b. If there is no solution, returns NULL.
Definition at line 575 of file compress_parms.c. References Equalities_validityLattice(), Matrix, Matrix_Alloc(), Matrix_copySubMatrix(), Matrix_Free(), matrix::NbColumns, matrix::NbRows, matrix::p, and value_assign. Referenced by int_mod_basis(). |
|
Computes the validity lattice of a set of equalities.
I.e., the lattice induced on the last
Definition at line 254 of file compress_parms.c. References dbgCompParm, ensureMatrix, Equalities_integerSolution(), left_hermite(), linearInter(), Matrix, Matrix_copySubMatrix(), Matrix_Free(), Matrix_subMatrix(), matrix::NbColumns, matrix::NbRows, matrix::p, show_matrix, value_assign, value_set_si, and Vector_Set(). Referenced by compress_parms(), Constraints_fullDimensionize(), and Equalities_intModBasis(). |
|
Given a matrix with m parameterized equations, compress the nb_parms parameters and n-m variables so that m variables are integer, and transform the variable space into a n-m space by eliminating the m variables (using the equalities) the variables to be eliminated are chosen automatically by the function. Deprecated. Try to use Constraints_fullDimensionize instead.
Definition at line 887 of file compress_parms.c. References compress_parms(), dbgCompParm, find_a_permutation(), Identity_Matrix(), Matrix, Matrix_Alloc(), Matrix_Free(), mpolyhedron_compress_last_vars(), mpolyhedron_eliminate_first_variables(), mpolyhedron_permute(), matrix::NbColumns, matrix::NbRows, matrix::p, show_matrix, split_constraints(), value_assign, and value_set_si. Referenced by Ehrhart_Quick_Apx(). |
|
given a full-row-rank nxm matrix M(made of row-vectors), computes the basis K (made of n-m column-vectors) of the integer kernel of M so we have: M.K = 0
Definition at line 39 of file compress_parms.c. References dbgCompParm, dbgCompParmMore, left_hermite(), Matrix, Matrix_Alloc(), Matrix_Free(), Matrix_subMatrix(), matrix::NbColumns, matrix::NbRows, matrix::p, right_hermite(), show_matrix, and Vector_IsZero(). |
|
kept here for backwards compatiblity. Wrapper to Equalities_intModBasis() Definition at line 597 of file compress_parms.c. References Equalities_intModBasis(), and Matrix. |
|
Given a matrix that defines a full-dimensional affine lattice, returns the affine sub-lattice spanned in the k first dimensions. Useful for instance when you only look for the parameters' validity lattice.
Definition at line 482 of file compress_parms.c. References assert, dbgCompParmMore, dbgEnd, dbgStart, Lattice_extractSubLattice(), left_hermite(), Matrix, Matrix_Alloc(), Matrix_Copy(), Matrix_copySubMatrix(), Matrix_Free(), Matrix_subMatrix(), matrix::NbColumns, matrix::NbRows, show_matrix, and value_set_si. Referenced by Lattice_extractSubLattice(), and test_Constraints_fullDimensionize(). |
|
Computes the intersection of two linear lattices, whose base vectors are respectively represented in A and B. If I and/or Lb is set to NULL, then the matrix is allocated. Else, the matrix is assumed to be allocated already. I and Lb are rk x rk, where rk is the rank of A (or B).
Definition at line 102 of file compress_parms.c. References assert, dbgCompParm, left_hermite(), Matrix, Matrix_Alloc(), Matrix_copySubMatrix(), Matrix_Free(), Matrix_subMatrix(), matrix::NbColumns, matrix::NbRows, matrix::p, show_matrix, value_set_si, and value_zero_p. Referenced by Equalities_validityLattice(). |
|
Removes equalities involving only parameters, but starting from a Polyhedron and its context.
Definition at line 839 of file compress_parms.c. References Constraints2Polyhedron(), Constraints_Remove_parm_eqs(), F_ISSET, FL_INIT, Matrix, Matrix_Free(), maxRays, matrix::NbRows, POL_INEQUALITIES, POL_NO_DUAL, POL_VALID, Polyhedron, Polyhedron2Constraints(), and Polyhedron_Free(). Referenced by test_Polyhedron_Remove_parm_eqs(). |