#include <polylib/polylib.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Go to the source code of this file.
Defines | |
#define | dbg 1 |
| |
#define | TEST(a) |
#define | maxRays 200 |
Functions | |
int | main (int argc, char **argv) |
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. | |
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. | |
void | valuesWithoutElim (Matrix *origParms, unsigned int *elimParms, Matrix **newParms) |
Eliminates certain parameters from a vector of values for parameters. | |
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. | |
int | test_Constraints_fullDimensionize (Matrix *A, Matrix *B, unsigned int nbSamples) |
Tests Constraints_fullDimensionize by comparing the Ehrhart polynomials. | |
Variables | |
const char * | origNames [] |
#define dbg 1 |
Test routines for kernel/compress_parms.c functions
Definition at line 34 of file testCompressParms.c.
Referenced by namesWithoutElim(), and test_Constraints_fullDimensionize().
#define maxRays 200 |
Definition at line 43 of file testCompressParms.c.
Referenced by test_Constraints_fullDimensionize(), test_Constraints_Remove_parm_eqs(), and test_Polyhedron_Remove_parm_eqs().
#define TEST | ( | a | ) |
if (isOk = a) { \ printf(#a" tested ok.\n"); \ } \ else { \ printf(#a" NOT OK\n"); \ }
Definition at line 36 of file testCompressParms.c.
Referenced by main().
int main | ( | int | argc, | |
char ** | argv | |||
) |
Definition at line 48 of file testCompressParms.c.
References Matrix_Free(), Matrix_Read(), TEST, test_Constraints_fullDimensionize(), test_Constraints_Remove_parm_eqs(), and test_Polyhedron_Remove_parm_eqs().
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.
parms | the original parameter names | |
nbParms | the number of original parmaeters | |
elimParms | the array-list of indices of parameters to eliminate (first element set to the number of its elements) | |
newParms | the returned list of parm names. Allocated if set to NULL, reused if not. |
Definition at line 234 of file testCompressParms.c.
References dbg.
Referenced by test_Constraints_fullDimensionize().
Tests Constraints_fullDimensionize by comparing the Ehrhart polynomials.
A | the input set of constraints | |
B | the corresponding context | |
the | number of samples to generate for the test |
Definition at line 273 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().
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 71 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().
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 139 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().
Eliminates certain parameters from a vector of values for parameters.
origParms | the initial vector of values of parameters | |
elimParms | the list of parameters to be eliminated in the vector | |
newParms | the vector of values without the eliminated ones. |
Definition at line 201 of file testCompressParms.c.
References Matrix_Alloc(), matrix::NbColumns, matrix::p, and value_assign.
Referenced by test_Constraints_fullDimensionize().
const char* origNames[] |
{"n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"}
Definition at line 45 of file testCompressParms.c.
Referenced by test_Constraints_fullDimensionize().