# Parma_Polyhedra_Library::C_Polyhedron Class Reference
[C++ Language Interface]

A closed convex polyhedron. More...

`#include <ppl.hh>`

Inherits Parma_Polyhedra_Library::Polyhedron.

List of all members.

## Public Member Functions

| C_Polyhedron (dimension_type num_dimensions=0, Degenerate_Element kind=UNIVERSE)
| Builds either the universe or the empty C polyhedron.
| C_Polyhedron (const Constraint_System &cs)
| Builds a C polyhedron from a system of constraints.
| C_Polyhedron (Constraint_System &cs, Recycle_Input dummy)
| Builds a C polyhedron recycling a system of constraints.
| C_Polyhedron (const Generator_System &gs)
| Builds a C polyhedron from a system of generators.
| C_Polyhedron (Generator_System &gs, Recycle_Input dummy)
| Builds a C polyhedron recycling a system of generators.
| C_Polyhedron (const Congruence_System &cgs)
| Builds a C polyhedron from a system of congruences.
| C_Polyhedron (Congruence_System &cgs, Recycle_Input dummy)
| Builds a C polyhedron recycling a system of congruences.
| C_Polyhedron (const NNC_Polyhedron &y, Complexity_Class complexity=ANY_COMPLEXITY)
| Builds a C polyhedron representing the topological closure of the NNC polyhedron `y`.
template<typename Interval >
| C_Polyhedron (const Box< Interval > &box, Complexity_Class complexity=ANY_COMPLEXITY)
| Builds a C polyhedron out of a box.
template<typename U >
| C_Polyhedron (const BD_Shape< U > &bd, Complexity_Class complexity=ANY_COMPLEXITY)
| Builds a C polyhedron out of a BD shape.
template<typename U >
| C_Polyhedron (const Octagonal_Shape< U > &os, Complexity_Class complexity=ANY_COMPLEXITY)
| Builds a C polyhedron out of an octagonal shape.
| C_Polyhedron (const Grid &grid, Complexity_Class complexity=ANY_COMPLEXITY)
| Builds a C polyhedron out of a grid.
| C_Polyhedron (const C_Polyhedron &y, Complexity_Class complexity=ANY_COMPLEXITY)
| Ordinary copy-constructor.
C_Polyhedron & | operator= (const C_Polyhedron &y)
| The assignment operator. (`*this` and `y` can be dimension-incompatible.).
C_Polyhedron & | operator= (const NNC_Polyhedron &y)
| Assigns to `*this` the topological closure of the NNC polyhedron `y`.
| ~C_Polyhedron ()
| Destructor.
bool | poly_hull_assign_if_exact (const C_Polyhedron &y)
| If the poly-hull of `*this` and `y` is exact it is assigned to `*this` and `true` is returned, otherwise `false` is returned.
bool | upper_bound_assign_if_exact (const C_Polyhedron &y)
| Same as poly_hull_assign_if_exact(y).

## Detailed Description

A closed convex polyhedron.

An object of the class C_Polyhedron represents a topologically closed convex polyhedron in the vector space .

When building a closed polyhedron starting from a system of constraints, an exception is thrown if the system contains a strict inequality constraint. Similarly, an exception is thrown when building a closed polyhedron starting from a system of generators containing a closure point.

Note:
  Such an exception will be obtained even if the system of constraints (resp., generators) actually defines a topologically closed subset of the vector space, i.e., even if all the strict inequalities (resp., closure points) in the system happen to be redundant with respect to the system obtained by removing all the strict inequality constraints (resp., all the closure points). In contrast, when building a closed polyhedron starting from an object of the class NNC_Polyhedron, the precise topological closure test will be performed.

## Constructor & Destructor Documentation

Parma_Polyhedra_Library::C_Polyhedron::C_Polyhedron | ( | dimension_type | num_dimensions = `0`,
|  | Degenerate_Element | kind = `UNIVERSE` |
| ) |  |  | `[inline, explicit]`

Builds either the universe or the empty C polyhedron.

Parameters:

  | num_dimensions | The number of dimensions of the vector space enclosing the C polyhedron;
  | kind | Specifies whether a universe or an empty C polyhedron should be built.

Exceptions:

  | std::length_error | Thrown if `num_dimensions` exceeds the maximum allowed space dimension.

Both parameters are optional: by default, a 0-dimension space universe C polyhedron is built.

Parma_Polyhedra_Library::C_Polyhedron::C_Polyhedron | ( | const Constraint_System & | cs | ) | `[inline, explicit]`

Builds a C polyhedron from a system of constraints.

The polyhedron inherits the space dimension of the constraint system.

Parameters:

  | cs | The system of constraints defining the polyhedron.

Exceptions:

  | std::invalid_argument | Thrown if the system of constraints contains strict inequalities.

Parma_Polyhedra_Library::C_Polyhedron::C_Polyhedron | ( | Constraint_System & | cs,
|  | Recycle_Input | dummy |
| ) |  |  | `[inline]`

Builds a C polyhedron recycling a system of constraints.

The polyhedron inherits the space dimension of the constraint system.

Parameters:

  | cs | The system of constraints defining the polyhedron. It is not declared `const` because its data-structures may be recycled to build the polyhedron.
  | dummy | A dummy tag to syntactically differentiate this one from the other constructors.

Exceptions:

  | std::invalid_argument | Thrown if the system of constraints contains strict inequalities.

Parma_Polyhedra_Library::C_Polyhedron::C_Polyhedron | ( | const Generator_System & | gs | ) | `[inline, explicit]`

Builds a C polyhedron from a system of generators.

The polyhedron inherits the space dimension of the generator system.

Parameters:

  | gs | The system of generators defining the polyhedron.

Exceptions:

  | std::invalid_argument | Thrown if the system of generators is not empty but has no points, or if it contains closure points.

Parma_Polyhedra_Library::C_Polyhedron::C_Polyhedron | ( | Generator_System & | gs,
|  | Recycle_Input | dummy |
| ) |  |  | `[inline]`

Builds a C polyhedron recycling a system of generators.

The polyhedron inherits the space dimension of the generator system.

Parameters:

  | gs | The system of generators defining the polyhedron. It is not declared `const` because its data-structures may be recycled to build the polyhedron.
  | dummy | A dummy tag to syntactically differentiate this one from the other constructors.

Exceptions:

  | std::invalid_argument | Thrown if the system of generators is not empty but has no points, or if it contains closure points.

Parma_Polyhedra_Library::C_Polyhedron::C_Polyhedron | ( | const Congruence_System & | cgs | ) | `[explicit]`

Builds a C polyhedron from a system of congruences.

The polyhedron inherits the space dimension of the congruence system.

Parameters:

  | cgs | The system of congruences defining the polyhedron.

Parma_Polyhedra_Library::C_Polyhedron::C_Polyhedron | ( | Congruence_System & | cgs,
|  | Recycle_Input | dummy |
| ) |  |  |

Builds a C polyhedron recycling a system of congruences.

The polyhedron inherits the space dimension of the congruence system.

Parameters:

  | cgs | The system of congruences defining the polyhedron. It is not declared `const` because its data-structures may be recycled to build the polyhedron.
  | dummy | A dummy tag to syntactically differentiate this one from the other constructors.

Parma_Polyhedra_Library::C_Polyhedron::C_Polyhedron | ( | const NNC_Polyhedron & | y,
|  | Complexity_Class | complexity = `ANY_COMPLEXITY` |
| ) |  |  | `[explicit]`

Builds a C polyhedron representing the topological closure of the NNC polyhedron `y`.

Parameters:

  | y | The NNC polyhedron to be used;
  | complexity | This argument is ignored.

template<typename Interval >

Parma_Polyhedra_Library::C_Polyhedron::C_Polyhedron | ( | const Box< Interval > & | box,
|  | Complexity_Class | complexity = `ANY_COMPLEXITY` |
| ) |  |  | `[inline, explicit]`

Builds a C polyhedron out of a box.

The polyhedron inherits the space dimension of the box and is the most precise that includes the box. The algorithm used has polynomial complexity.

Parameters:

  | box | The box representing the polyhedron to be approximated;
  | complexity | This argument is ignored.

Exceptions:

  | std::length_error | Thrown if the space dimension of `box` exceeds the maximum allowed space dimension.

template<typename U >

Parma_Polyhedra_Library::C_Polyhedron::C_Polyhedron | ( | const BD_Shape< U > & | bd,
|  | Complexity_Class | complexity = `ANY_COMPLEXITY` |
| ) |  |  | `[inline, explicit]`

Builds a C polyhedron out of a BD shape.

The polyhedron inherits the space dimension of the BDS and is the most precise that includes the BDS.

Parameters:

  | bd | The BDS used to build the polyhedron.
  | complexity | This argument is ignored as the algorithm used has polynomial complexity.

template<typename U >

Parma_Polyhedra_Library::C_Polyhedron::C_Polyhedron | ( | const Octagonal_Shape< U > & | os,
|  | Complexity_Class | complexity = `ANY_COMPLEXITY` |
| ) |  |  | `[inline, explicit]`

Builds a C polyhedron out of an octagonal shape.

The polyhedron inherits the space dimension of the octagonal shape and is the most precise that includes the octagonal shape.

Parameters:

  | os | The octagonal shape used to build the polyhedron.
  | complexity | This argument is ignored as the algorithm used has polynomial complexity.

Parma_Polyhedra_Library::C_Polyhedron::C_Polyhedron | ( | const Grid & | grid,
|  | Complexity_Class | complexity = `ANY_COMPLEXITY` |
| ) |  |  | `[explicit]`

Builds a C polyhedron out of a grid.

The polyhedron inherits the space dimension of the grid and is the most precise that includes the grid.

Parameters:

  | grid | The grid used to build the polyhedron.
  | complexity | This argument is ignored as the algorithm used has polynomial complexity.

Parma_Polyhedra_Library::C_Polyhedron::C_Polyhedron | ( | const C_Polyhedron & | y,
|  | Complexity_Class | complexity = `ANY_COMPLEXITY` |
| ) |  |  | `[inline]`

Ordinary copy-constructor.

The complexity argument is ignored.

## Member Function Documentation

bool Parma_Polyhedra_Library::C_Polyhedron::poly_hull_assign_if_exact | ( | const C_Polyhedron & | y | ) |

If the poly-hull of `*this` and `y` is exact it is assigned to `*this` and `true` is returned, otherwise `false` is returned.

Exceptions:

  | std::invalid_argument | Thrown if `*this` and `y` are dimension-incompatible.

The documentation for this class was generated from the following file:

- ppl.hh