Main Page | Class List | File List | Class Members | File Members

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.

Defines

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


#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 Documentation

#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.

Referenced by namesWithoutElim(), and test_Constraints_fullDimensionize().

#define maxRays   200
 

Definition at line 26 of file testCompressParms.c.

Referenced by Constraints_EhrhartQuickApx(), dehomogenize_enumeration(), dehomogenize_polyhedron(), Ehrhart_Quick_Apx(), Enumeration_zero(), Polyhedron_Remove_parm_eqs(), test_Constraints_fullDimensionize(), test_Constraints_Remove_parm_eqs(), and test_Polyhedron_Remove_parm_eqs().

#define TEST  ) 
 

Value:

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

Definition at line 19 of file testCompressParms.c.

Referenced by main().


Function Documentation

int main int  argc,
char **  argv
 

Definition at line 31 of file testCompressParms.c.

References Matrix, 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.

Parameters:
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.
Returns:
the number of names in the returned list.

Definition at line 217 of file testCompressParms.c.

References dbg.

Referenced by test_Constraints_fullDimensionize().

int test_Constraints_fullDimensionize Matrix A,
Matrix B,
unsigned int  nbSamples
 

Tests Constraints_fullDimensionize by comparing the Ehrhart polynomials.

Parameters:
A the input set of constraints
B the corresponding context
the number 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 256 of file testCompressParms.c.

References compute_poly(), Constraints2Polyhedron(), Constraints_fullDimensionize(), dbg, Enumeration, Enumeration_Free(), Enumeration_zero(), _enumeration::EP, Inner_Product(), Lattice_extractSubLattice(), MatInverse(), Matrix, Matrix_Alloc(), Matrix_Copy(), Matrix_Free(), maxRays, namesWithoutElim(), matrix::NbColumns, matrix::NbRows, origNames, matrix::p, P_VALUE_FMT, Polyhedron, 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().

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 54 of file testCompressParms.c.

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

Referenced by main().

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 122 of file testCompressParms.c.

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

Referenced by main().

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

Eliminates certain parameters from a vector of values for parameters.

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 184 of file testCompressParms.c.

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

Referenced by test_Constraints_fullDimensionize().


Variable Documentation

const char* origNames[]
 

Initial value:

        {"n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"}

Definition at line 28 of file testCompressParms.c.

Referenced by test_Constraints_fullDimensionize().


Generated on Thu Sep 4 15:29:00 2008 for polylib by doxygen 1.3.5