polylib 5.22.8
compress_parms.h
Go to the documentation of this file.
1/**
2 * @author B. Meister 12/2003-2006
3 * LSIIT -ICPS
4 * UMR 7005 CNRS
5 * Louis Pasteur University (ULP), Strasbourg, France
6 */
7#ifndef __BM_COMPRESS_PARMS_H__
8#define __BM_COMPRESS_PARMS_H__
9
10#include "matrix_addon.h"
11#include "matrix_permutations.h"
12#include <assert.h>
13
14/* ----- functions applying on equalities ----- */
15
16/**
17 * Given a system of non-redundant equalities, looks if it has an integer
18 * solution in the combined space, and if yes, returns one solution.
19 */
21
22/**
23 * Computes the validity lattice of a set of equalities. I.e., the lattice
24 * induced on the last <tt>b</tt> variables by the equalities involving the
25 * first <tt>a</tt> integer existential variables.
26 */
27void Equalities_validityLattice(Matrix *Eqs, int a, Matrix **vl);
28
29/**
30 * Given an integer matrix B with m rows and integer m-vectors C and d,
31 * computes the basis of the integer solutions to (BN+C) mod d = 0 (1).
32 * This is an affine lattice (G): (N 1)^T= G(N' 1)^T, forall N' in Z^b.
33 * If there is no solution, returns NULL.
34 */
35void Equalities_intModBasis(Matrix *B, Matrix *C, Matrix *d, Matrix **imb);
36
37/* ----- functions applying on constraints ----- */
38
39/**
40 * Eliminates all the equalities in a set of constraints and returns the set of
41 * constraints defining a full-dimensional polyhedron, such that there is a
42 * bijection between integer points of the original polyhedron and these of the
43 * resulting (projected) polyhedron).
44 */
46 Matrix **Eqs, Matrix **ParmEqs,
47 unsigned int **elimVars,
48 unsigned int **elimParms, int maxRays);
49
50/* extracts equalities involving only parameters */
51#define Constraints_removeParmEqs(a, b, c, d) \
52 Constraints_Remove_parm_eqs(a, b, c, d)
53Matrix *Constraints_Remove_parm_eqs(Matrix **M, Matrix **Ctxt, int renderSpace,
54 unsigned int **elimParms);
55
56/**
57 * Eliminates the columns corresponding to a list of eliminated parameters.
58 */
59void Constraints_removeElimCols(Matrix *M, unsigned int nbVars,
60 unsigned int *elimParms, Matrix **newM);
61
62/* ----- function applying on a lattice ----- */
63
64/**
65 * Given a matrix that defines a full-dimensional affine lattice, returns the
66 * affine sub-lattice spanned in the k first dimensions.
67 * Useful for instance when you only look for the parameters' validity lattice.
68 */
69void Lattice_extractSubLattice(Matrix *lat, unsigned int k, Matrix **subLat);
70
71/* ----- functions applying on a polyhedron ----- */
72
74 int renderSpace,
75 unsigned int **elimParms, int maxRays);
76#define Polyhedron_removeParmEqs(a, b, c, d, e) \
77 Polyhedron_Remove_parm_eqs(a, b, c, d, e)
78
79/* ----- functions kept for backwards compatibility ----- */
80
81/**
82 * given a full-row-rank nxm matrix M(made of row-vectors),
83 * computes the basis K (made of n-m column-vectors) of the integer kernel of M
84 * so we have: M.K = 0
85 */
87
88/* given a matrix of m parameterized equations, compress the parameters and
89 transform the variable space into a n-m space. */
90Matrix *full_dimensionize(Matrix const *M, int nb_parms,
91 Matrix **Validity_Lattice);
92
93/* Compute the overall period of the variables I for (MI) mod |d|,
94 where M is a matrix and |d| a vector
95 Produce a diagonal matrix S = (s_k) where s_k is the overall period of i_k */
97
98/* given a matrix B' with m rows and m-vectors C' and d, computes the
99 basis of the integer solutions to (B'N+C') mod d = 0.
100returns NULL if there is no integer solution */
102
103/* given a parameterized constraints matrix with m equalities, computes the
104 compression matrix C such that there is an integer solution in the variables
105 space for each value of N', with N = Cmp N' (N are the original parameters) */
106Matrix *compress_parms(Matrix *E, int nb_parms);
107
108#endif /* __BM_COMPRESS_PARMS_H__ */
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 intege...
Matrix * int_mod_basis(Matrix *Bp, Matrix *Cp, Matrix *d)
kept here for backwards compatiblity.
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 f...
void Constraints_removeElimCols(Matrix *M, unsigned int nbVars, unsigned int *elimParms, Matrix **newM)
Eliminates the columns corresponding to a list of eliminated parameters.
Matrix * compress_parms(Matrix *E, int nb_parms)
Given a parameterized constraints matrix with m equalities, computes the compression matrix G such th...
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_integerSolution(Matrix *Eqs, Matrix **sol)
Given a system of non-redundant equalities, looks if it has an integer solution in the combined space...
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...
Matrix * full_dimensionize(Matrix const *M, int nb_parms, Matrix **Validity_Lattice)
Given a matrix with m parameterized equations, compress the nb_parms parameters and n-m variables so ...
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-vec...
Matrix * Constraints_Remove_parm_eqs(Matrix **M, Matrix **Ctxt, int renderSpace, unsigned int **elimParms)
Removes the equalities that involve only parameters, by eliminating some parameters in the polyhedron...
void Equalities_validityLattice(Matrix *Eqs, int a, Matrix **vl)
Computes the validity lattice of a set of equalities.
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.
Definition: types.h:75
#define maxRays