polylib 5.22.8
testCompressParms.c File Reference
#include <polylib/polylib.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

Go to the source code of this file.

Macros

#define dbg   1
 
#define TEST(a)
 
#define maxRays   200
 

Functions

int test_Constraints_Remove_parm_eqs (Matrix *A, Matrix *B)
 extracts the equalities involving the parameters only, try to introduce them back and compare the two polyhedra. More...
 
int test_Polyhedron_Remove_parm_eqs (Matrix *A, Matrix *B)
 extracts the equalities holding on the parameters only, try to introduce them back and compare the two polyhedra. More...
 
int test_Constraints_fullDimensionize (Matrix *A, Matrix *B, unsigned int nbSamples)
 Tests Constraints_fullDimensionize by comparing the Ehrhart polynomials. More...
 
int main (int argc, char **argv)
 
void valuesWithoutElim (Matrix *origParms, unsigned int *elimParms, Matrix **newParms)
 Eliminates certain parameters from a vector of values for parameters. More...
 
unsigned int namesWithoutElim (const char **parms, unsigned nbParms, unsigned int *elimParms, const char ***newParms)
 takes a list of parameter names, a list ofparameters to eliminate, and returns the list of parameters without the eliminated ones. More...
 

Variables

const char * origNames []
 

Macro Definition Documentation

◆ dbg

#define dbg   1
Id
testCompressParms.c,v 1.4 2006/09/18 03:09:03 meister Exp

Test routines for kernel/compress_parms.c functions

Author
B. Meister, 3/2006

Definition at line 17 of file testCompressParms.c.

◆ maxRays

#define maxRays   200

Definition at line 26 of file testCompressParms.c.

◆ TEST

#define TEST (   a)
Value:
if ((isOk = (a))) { \
printf(#a" tested ok.\n"); \
} \
else { \
printf(#a" NOT OK\n"); \
}

Definition at line 19 of file testCompressParms.c.

Function Documentation

◆ main()

◆ namesWithoutElim()

unsigned int namesWithoutElim ( const char **  parms,
unsigned  nbParms,
unsigned int *  elimParms,
const char ***  newParms 
)

takes a list of parameter names, a list ofparameters to eliminate, and returns the list of parameters without the eliminated ones.

Parameters
parmsthe original parameter names
nbParmsthe number of original parmaeters
elimParmsthe array-list of indices of parameters to eliminate (first element set to the number of its elements)
newParmsthe returned list of parm names. Allocated if set to NULL, reused if not.
Returns
the number of names in the returned list.

Definition at line 222 of file testCompressParms.c.

References dbg.

Referenced by test_Constraints_fullDimensionize().

◆ test_Constraints_fullDimensionize()

int test_Constraints_fullDimensionize ( Matrix A,
Matrix B,
unsigned int  nbSamples 
)

Tests Constraints_fullDimensionize by comparing the Ehrhart polynomials.

Parameters
Athe input set of constraints
Bthe corresponding context
thenumber of samples to generate for the test
Returns
1 if the Ehrhart polynomial had the same value for the full-dimensional and non-full-dimensional sets of constraints, for their corresponding sample parameters values.

Definition at line 261 of file testCompressParms.c.

References compute_poly(), Constraints2Polyhedron(), Constraints_fullDimensionize(), dbg, Enumeration_Free(), Enumeration_zero(), _enumeration::EP, Inner_Product(), Lattice_extractSubLattice(), MatInverse(), Matrix_Alloc(), Matrix_Copy(), Matrix_Free(), maxRays, namesWithoutElim(), matrix::NbColumns, matrix::NbRows, origNames, matrix::p, P_VALUE_FMT, Polyhedron_Enumerate(), Polyhedron_Free(), print_evalue(), show_matrix, value_addto, value_clear, value_eq, value_init, value_pdivision, value_print, value_set_si, value_subtract, value_zero_p, and valuesWithoutElim().

Referenced by main().

◆ test_Constraints_Remove_parm_eqs()

int test_Constraints_Remove_parm_eqs ( Matrix A,
Matrix B 
)

extracts the equalities involving the parameters only, try to introduce them back and compare the two polyhedra.

Reads a polyhedron and a context.

Definition at line 59 of file testCompressParms.c.

References align_context(), Constraints2Polyhedron(), Constraints_Remove_parm_eqs(), polyhedron::Dimension, DomainIntersection(), Matrix_Copy(), Matrix_Free(), maxRays, Polyhedron_Free(), PolyhedronIncludes(), and show_matrix.

Referenced by main().

◆ test_Polyhedron_Remove_parm_eqs()

int test_Polyhedron_Remove_parm_eqs ( Matrix A,
Matrix B 
)

extracts the equalities holding on the parameters only, try to introduce them back and compare the two polyhedra.

Reads a polyhedron and a context.

Definition at line 127 of file testCompressParms.c.

References align_context(), Constraints2Polyhedron(), polyhedron::Dimension, DomainIntersection(), Matrix_Copy(), Matrix_Free(), maxRays, Polyhedron_Free(), Polyhedron_Remove_parm_eqs(), and PolyhedronIncludes().

Referenced by main().

◆ valuesWithoutElim()

void valuesWithoutElim ( Matrix origParms,
unsigned int *  elimParms,
Matrix **  newParms 
)

Eliminates certain parameters from a vector of values for parameters.

Parameters
origParmsthe initial vector of values of parameters
elimParmsthe list of parameters to be eliminated in the vector
newParmsthe vector of values without the eliminated ones.

Definition at line 189 of file testCompressParms.c.

References Matrix_Alloc(), matrix::NbColumns, matrix::p, and value_assign.

Referenced by test_Constraints_fullDimensionize().

Variable Documentation

◆ origNames

const char* origNames[]
Initial value:
=
{"n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"}

Definition at line 33 of file testCompressParms.c.

Referenced by test_Constraints_fullDimensionize().