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

ehrhart.h File Reference

Go to the source code of this file.

Functions

void count_points (int pos, Polyhedron *P, Value *context, Value *res)
 PROCEDURES TO COMPUTE ENUMERATION.

void eadd (evalue *e1, evalue *res)
 adds one evalue to evalue 'res.

enodeecopy (enode *e)
void edot (enode *v1, enode *v2, evalue *res)
 computes the inner product of two vectors.

enodenew_enode (enode_type type, int size, int pos)
 EHRHART POLYNOMIAL SYMBOLIC ALGEBRA SYSTEM.

void free_evalue_refs (evalue *e)
 releases all memory referenced by e.

EnumerationPolyhedron_Enumerate (Polyhedron *P, Polyhedron *C, unsigned MAXRAYS, const char **pname)
 Procedure to count points in a parameterized polytope.

void print_enode (FILE *DST, enode *p, const char **pname)
 prints the enode to DST

void print_evalue (FILE *DST, evalue *e, const char **pname)
void reduce_evalue (evalue *e)
void Enumeration_Free (Enumeration *en)
EnumerationEhrhart_Quick_Apx (Matrix *M, Matrix *C, Matrix **Validity_Lattice, unsigned MAXRAYS)
 Computes the approximation of the Ehrhart polynomial of a polyhedron (implicit form -> matrix), treating the non-full-dimensional case.

EnumerationEnumeration_zero (unsigned int nbParms, unsigned int maxRays)
 returns a constant Ehrhart polynomial whose value is zero for any value of the parameters.


Variables

int overflow_warning_flag


Function Documentation

void count_points int  pos,
Polyhedron P,
Value *  context,
Value *  res
 

PROCEDURES TO COMPUTE ENUMERATION.

recursive procedure, recurse for each imbriquation

Parameters:
pos index position of current loop index (1..hdim-1)
P loop domain
context context values for fixed indices
res the number of integer points in this polyhedron

Definition at line 1128 of file ehrhart.c.

References emptyQ, lower_upper_bounds(), polyhedron::next, P_VALUE_FMT, POL_ENSURE_FACETS, POL_ENSURE_VERTICES, Polyhedron, value_add_int, value_addto, value_assign, value_clear, value_increment, value_init, value_le, value_lt, value_notmone_p, value_print, value_set_si, and value_subtract.

Referenced by check_poly(), Enumerate_NoParameters(), and P_Enum().

void eadd evalue e1,
evalue res
 

adds one evalue to evalue 'res.

result = res + e1

Parameters:
e1 an evalue
res 

Definition at line 393 of file ehrhart.c.

References _enode::arr, _evalue::d, ecopy(), enode, evalue, free_evalue_refs(), periodic, polynomial, value_addto, value_clear, value_divexact, value_gcd, value_init, value_multiply, value_notone_p, value_notzero_p, and value_zero_p.

Referenced by edot().

enode* ecopy enode e  ) 
 

Parameters:
e pointer to an evalue
Returns:
description

Definition at line 150 of file ehrhart.c.

References _enode::arr, _evalue::d, enode, new_enode(), _enode::pos, _enode::size, _enode::type, value_assign, value_init, and value_zero_p.

Referenced by Domain_Enumerate(), eadd(), and new_eadd().

void edot enode v1,
enode v2,
evalue res
 

computes the inner product of two vectors.

Result = result (evalue) = v1.v2 (dot product)

Parameters:
v1 an enode (vector)
v2 an enode (vector of constants)
res result (evalue)

Definition at line 509 of file ehrhart.c.

References _enode::arr, _evalue::d, eadd(), emul(), enode, evalue, evector, free_evalue_refs(), _enode::size, _enode::type, value_init, and value_set_si.

Referenced by P_Enum().

Enumeration* Ehrhart_Quick_Apx Matrix M,
Matrix C,
Matrix **  Validity_Lattice,
unsigned  maxRays
 

Computes the approximation of the Ehrhart polynomial of a polyhedron (implicit form -> matrix), treating the non-full-dimensional case.

Parameters:
M a polyhedron under implicit form
C M's context under implicit form
Validity_Lattice a pointer to the parameter's validity lattice
MAXRAYS the needed "working space" for other polylib functions used here
param_name the names of the parameters,

Definition at line 2618 of file ehrhart.c.

References Constraints2Polyhedron(), Ehrhart_Quick_Apx_Full_Dim(), Enumeration, full_dimensionize(), Matrix, Matrix_Free(), maxRays, mpolyhedron_compress_last_vars(), matrix::NbColumns, Polyhedron, Polyhedron_Free(), and show_matrix.

Referenced by Constraints_EhrhartQuickApx(), and main().

void Enumeration_Free Enumeration en  ) 
 

Definition at line 2203 of file ehrhart.c.

References Domain_Free(), Enumeration, _enumeration::EP, free_evalue_refs(), _enumeration::next, and _enumeration::ValidityDomain.

Referenced by main(), and test_Constraints_fullDimensionize().

Enumeration* Enumeration_zero unsigned int  nbParms,
unsigned int  maxRays
 

returns a constant Ehrhart polynomial whose value is zero for any value of the parameters.

Parameters:
nbParms the number of parameters, i.e., the number of arguments to the Ehrhart polynomial

Definition at line 2715 of file ehrhart.c.

References Constraints2Polyhedron(), Enumeration, Matrix, Matrix_Alloc(), Matrix_Free(), maxRays, matrix::p, Polyhedron, Polyhedron_Enumerate(), Polyhedron_Free(), Universe_Polyhedron(), and value_set_si.

Referenced by test_Constraints_fullDimensionize().

void free_evalue_refs evalue e  ) 
 

releases all memory referenced by e.

(recursive)

Parameters:
e pointer to an evalue

Definition at line 122 of file ehrhart.c.

References _evalue::d, enode, evalue, p, value_clear, and value_notzero_p.

Referenced by dehomogenize_evalue(), Domain_Enumerate(), eadd(), edot(), Enumeration_Free(), main(), P_Enum(), and reduce_evalue().

enode* new_enode enode_type  type,
int  size,
int  pos
 

EHRHART POLYNOMIAL SYMBOLIC ALGEBRA SYSTEM.

The newly allocated enode can be freed with a simple free(x)

Parameters:
type : enode type
size : degree+1 for polynomial, period for periodic
pos : 1..nb_param, position of parameter
Returns:
a newly allocated enode

Definition at line 97 of file ehrhart.c.

References _enode::arr, _evalue::d, enode, evalue, _enode::pos, _enode::size, size, _enode::type, value_init, and value_set_si.

Referenced by ecopy(), emul(), Enumerate_NoParameters(), new_eadd(), and P_Enum().

Enumeration* Polyhedron_Enumerate Polyhedron Pi,
Polyhedron C,
unsigned  MAXRAYS,
const char **  param_name
 

Procedure to count points in a parameterized polytope.

Parameters:
Pi Polyhedron to enumerate
C Context Domain
MAXRAYS size of workspace
param_name parameter names (array of strings), may be NULL
Returns:
a list of validity domains + evalues EP

Definition at line 1843 of file ehrhart.c.

References addeliminatedparams_evalue(), assert, CATCH, _Param_Polyhedron::D, _evalue::d, dehomogenize_evalue(), polyhedron::Dimension, _Param_Domain::Domain, Domain_Free(), DomainIntersection(), DomainSimplify(), emptyQ, Enumerate_NoParameters(), Enumeration, _enumeration::EP, _Param_Domain::F, homogenize(), Matrix, Matrix_Free(), MAXRAYS, matrix::NbColumns, polyhedron::NbEq, matrix::NbRows, _Param_Domain::next, _enumeration::next, overflow_error, overflow_warning_flag, P_Enum(), P_VALUE_FMT, Param_Domain, Param_Polyhedron, Param_Polyhedron_Free(), Param_Vertices_Free(), POL_ENSURE_FACETS, POL_ENSURE_VERTICES, POL_ISSET, POL_NO_DUAL, Polyhedron, Polyhedron2Param_SimplifiedDomain(), Polyhedron_Free(), Polyhedron_Preimage(), Polyhedron_Preprocess(), Polyhedron_Preprocess2(), Polyhedron_Print(), Polyhedron_Scan(), PolyhedronIncludes(), Print_Domain(), print_evalue(), reduce_evalue(), Scan_Vertices(), TRY, UNCATCH, Universe_Polyhedron(), _Param_Polyhedron::V, _enumeration::ValidityDomain, value_addto, value_clear, value_init, value_multiply, value_notzero_p, value_print, value_set_si, value_zero_p, and Vector_Set().

Referenced by Domain_Enumerate(), Enumeration_zero(), main(), and test_Constraints_fullDimensionize().

void print_enode FILE *  DST,
enode p,
const char **  pname
 

prints the enode to DST

Parameters:
DST destination file
p pointer to enode to be printed
pname array of strings, name of the parameters

Definition at line 199 of file ehrhart.c.

References enode, evector, p, periodic, polynomial, and print_evalue().

Referenced by P_Enum(), and print_evalue().

void print_evalue FILE *  DST,
evalue e,
const char **  pname
 

Parameters:
DST destination file
e pointer to evalue to be printed
pname array of strings, name of the parameters

Definition at line 175 of file ehrhart.c.

References _evalue::d, evalue, print_enode(), value_notone_p, value_notzero_p, and value_print.

Referenced by compute_poly(), Ehrhart_Quick_Apx_Full_Dim(), Enumerate_NoParameters(), main(), P_Enum(), Polyhedron_Enumerate(), print_enode(), and test_Constraints_fullDimensionize().

void reduce_evalue evalue e  ) 
 

Parameters:
e pointer to an evalue

Definition at line 278 of file ehrhart.c.

References _evalue::d, eequal(), enode, evalue, free_evalue_refs(), p, periodic, polynomial, value_clear, value_notzero_p, value_one_p, and value_zero_p.

Referenced by Ehrhart_Quick_Apx_Full_Dim(), and Polyhedron_Enumerate().


Variable Documentation

int overflow_warning_flag
 

Definition at line 13 of file ehrhart.h.

Referenced by Ehrhart_Quick_Apx_Full_Dim(), Enumerate_NoParameters(), P_Enum(), and Polyhedron_Enumerate().


Generated on Thu Sep 4 15:28:59 2008 for polylib by doxygen 1.3.5