Parma_Polyhedra_Library::Interfaces::C::Array_Partial_Function_Wrapper Class Reference

A class to wrap an array of fixed length into a partial function interface suitable for the map_space_dimension() methods. More...

#include <ppl_c_implementation_common.defs.hh>

List of all members.

Public Member Functions

 Array_Partial_Function_Wrapper (dimension_type *v, size_t n)
 Construct a partial function wrapping the first n positions of v.
bool has_empty_codomain () const
 Returns true if and only if the represented partial function has an empty codomain (i.e., it is always undefined).
dimension_type max_in_codomain () const
 Returns the maximum value that belongs to the codomain of the partial function.
bool maps (dimension_type i, dimension_type &j) const
 Assigns to j the value associated to i by *this, if any.

Private Attributes

dimension_typevec
 Holds the vector implementing the map.
size_t vec_size
 Holds the size of vec.
dimension_type max_in_codomain_
 Cache for computing the maximum dimension in the codomain.
int empty

Detailed Description

A class to wrap an array of fixed length into a partial function interface suitable for the map_space_dimension() methods.

Definition at line 60 of file ppl_c_implementation_common.defs.hh.


Constructor & Destructor Documentation

Parma_Polyhedra_Library::Interfaces::C::Array_Partial_Function_Wrapper::Array_Partial_Function_Wrapper ( dimension_type v,
size_t  n 
) [inline]

Construct a partial function wrapping the first n positions of v.

Definition at line 167 of file ppl_c_implementation_common.inlines.hh.


Member Function Documentation

bool Parma_Polyhedra_Library::Interfaces::C::Array_Partial_Function_Wrapper::has_empty_codomain (  )  const [inline]

Returns true if and only if the represented partial function has an empty codomain (i.e., it is always undefined).

Definition at line 172 of file ppl_c_implementation_common.inlines.hh.

References empty, Parma_Polyhedra_Library::not_a_dimension(), vec, and vec_size.

bool Parma_Polyhedra_Library::Interfaces::C::Array_Partial_Function_Wrapper::maps ( dimension_type  i,
dimension_type j 
) const [inline]

Assigns to j the value associated to i by *this, if any.

Let $f$ be the function represented by *this and $k$ be the value of i. If $f$ is defined in $k$, then $f(k)$ is assigned to j and true is returned. If $f$ is undefined in $k$, then false is returned.

Definition at line 199 of file ppl_c_implementation_common.inlines.hh.

References Parma_Polyhedra_Library::not_a_dimension(), vec, and vec_size.

dimension_type Parma_Polyhedra_Library::Interfaces::C::Array_Partial_Function_Wrapper::max_in_codomain (  )  const [inline]

Returns the maximum value that belongs to the codomain of the partial function.

Definition at line 185 of file ppl_c_implementation_common.inlines.hh.

References max_in_codomain_, Parma_Polyhedra_Library::not_a_dimension(), vec, and vec_size.


Member Data Documentation

Cache for computing emptiness: -1 if we still don't know, 0 if not empty, 1 if empty.

Definition at line 103 of file ppl_c_implementation_common.defs.hh.

Referenced by has_empty_codomain().

Cache for computing the maximum dimension in the codomain.

Definition at line 99 of file ppl_c_implementation_common.defs.hh.

Referenced by max_in_codomain().

Holds the vector implementing the map.

Definition at line 93 of file ppl_c_implementation_common.defs.hh.

Referenced by has_empty_codomain(), maps(), and max_in_codomain().

Holds the size of vec.

Definition at line 96 of file ppl_c_implementation_common.defs.hh.

Referenced by has_empty_codomain(), maps(), and max_in_codomain().


The documentation for this class was generated from the following files:
Generated on Sun Feb 27 16:22:50 2011 for PPL C Language Interface by  doxygen 1.6.3