polylib: testCompressParms.c File Reference

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

Value:

    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().

## Function Documentation

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.

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 234 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 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().

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 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().

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 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().

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

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

Referenced by test_Constraints_fullDimensionize().