# C++ Language Interface

The core implementation of the Parma Polyhedra Library is written in C++. More...

## Classes

struct | Parma_Polyhedra_Library::Is_Checked< T >
struct | Parma_Polyhedra_Library::Is_Checked< Checked_Number< T, P > >
struct | Parma_Polyhedra_Library::Is_Native_Or_Checked< T >
class | Parma_Polyhedra_Library::Checked_Number< T, Policy >
| A wrapper for numeric types implementing a given policy. More...
class | Parma_Polyhedra_Library::Throwable
| User objects the PPL can throw. More...
struct | Parma_Polyhedra_Library::From_Covering_Box
| A tag class. More...
struct | Parma_Polyhedra_Library::Recycle_Input
| A tag class. More...
class | Parma_Polyhedra_Library::Variable
| A dimension of the vector space. More...
struct | Parma_Polyhedra_Library::Variable::Compare
| Binary predicate defining the total ordering on variables. More...
class | Parma_Polyhedra_Library::Linear_Expression
| A linear expression. More...
class | Parma_Polyhedra_Library::Constraint_System
| A system of constraints. More...
class | Parma_Polyhedra_Library::Constraint_System::const_iterator
| An iterator over a system of constraints. More...
class | Parma_Polyhedra_Library::Constraint
| A linear equality or inequality. More...
class | Parma_Polyhedra_Library::Poly_Con_Relation
| The relation between a polyhedron and a constraint. More...
class | Parma_Polyhedra_Library::Generator_System
| A system of generators. More...
class | Parma_Polyhedra_Library::Generator_System::const_iterator
| An iterator over a system of generators. More...
class | Parma_Polyhedra_Library::Generator
| A line, ray, point or closure point. More...
class | Parma_Polyhedra_Library::Congruence_System
| A system of congruences. More...
class | Parma_Polyhedra_Library::Congruence_System::const_iterator
| An iterator over a system of congruences. More...
class | Parma_Polyhedra_Library::Congruence
| A linear congruence. More...
class | Parma_Polyhedra_Library::Grid_Generator_System
| A system of grid generators. More...
class | Parma_Polyhedra_Library::Grid_Generator_System::const_iterator
| An iterator over a system of grid generators. More...
class | Parma_Polyhedra_Library::Grid_Generator
| A grid line, parameter or grid point. More...
class | Parma_Polyhedra_Library::BHRZ03_Certificate
| The convergence certificate for the BHRZ03 widening operator. More...
struct | Parma_Polyhedra_Library::BHRZ03_Certificate::Compare
| A total ordering on BHRZ03 certificates. More...
class | Parma_Polyhedra_Library::H79_Certificate
| A convergence certificate for the H79 widening operator. More...
struct | Parma_Polyhedra_Library::H79_Certificate::Compare
| A total ordering on H79 certificates. More...
class | Parma_Polyhedra_Library::Poly_Gen_Relation
| The relation between a polyhedron and a generator. More...
class | Parma_Polyhedra_Library::Polyhedron
| The base class for convex polyhedra. More...
class | Parma_Polyhedra_Library::MIP_Problem
| A Mixed Integer (linear) Programming problem. More...
class | Parma_Polyhedra_Library::Grid_Certificate
| The convergence certificate for the Grid widening operator. More...
class | Parma_Polyhedra_Library::C_Polyhedron
| A closed convex polyhedron. More...
class | Parma_Polyhedra_Library::NNC_Polyhedron
| A not necessarily closed convex polyhedron. More...
class | Parma_Polyhedra_Library::Grid
| A grid. More...
class | Parma_Polyhedra_Library::Interval< Boundary, Info >
| A generic, not necessarily closed, possibly restricted interval. More...
class | Parma_Polyhedra_Library::Box< ITV >
| A not necessarily closed, iso-oriented hyperrectangle. More...
class | Parma_Polyhedra_Library::BD_Shape< T >
| A bounded difference shape. More...
class | Parma_Polyhedra_Library::Octagonal_Shape< T >
| An octagonal shape. More...
class | Parma_Polyhedra_Library::Smash_Reduction< D1, D2 >
| This class provides the reduction method for the Smash_Product domain. More...
class | Parma_Polyhedra_Library::Constraints_Reduction< D1, D2 >
| This class provides the reduction method for the Constraints_Product domain. More...
class | Parma_Polyhedra_Library::No_Reduction< D1, D2 >
| This class provides the reduction method for the Direct_Product domain. More...
class | Parma_Polyhedra_Library::Partially_Reduced_Product< D1, D2, R >
| The partially reduced product of two abstractions. More...
class | Parma_Polyhedra_Library::Determinate< PS >
| Wraps a PPL class into a determinate constraint system interface. More...
class | Parma_Polyhedra_Library::Powerset< D >
| The powerset construction on a base-level domain. More...
class | Parma_Polyhedra_Library::Pointset_Powerset< PS >
| The powerset construction instantiated on PPL pointset domains. More...
class | Parma_Polyhedra_Library::GMP_Integer
| Unbounded integers as provided by the GMP library. More...

## Namespaces

namespace | Parma_Polyhedra_Library::IO_Operators
| All input/output operators are confined to this namespace.

namespace | std
| The standard C++ namespace.

## Defines

#define | PPL_VERSION_MAJOR 0
| The major number of the PPL version.
#define | PPL_VERSION_MINOR 10
| The minor number of the PPL version.
#define | PPL_VERSION_REVISION 2
| The revision number of the PPL version.
#define | PPL_VERSION_BETA 0
| The beta number of the PPL version. This is zero for official releases and nonzero for development snapshots.
#define | PPL_VERSION "0.10.2"
| A string containing the PPL version.

## Typedefs

typedef size_t | Parma_Polyhedra_Library::dimension_type
| An unsigned integral type for representing space dimensions.
typedef size_t | Parma_Polyhedra_Library::memory_size_type
| An unsigned integral type for representing memory size in bytes.
typedef PPL_COEFFICIENT_TYPE | Parma_Polyhedra_Library::Coefficient
| An alias for easily naming the type of PPL coefficients.

## Enumerations

enum

Parma_Polyhedra_Library::Result {
Parma_Polyhedra_Library::VC_NORMAL, Parma_Polyhedra_Library::V_LT, Parma_Polyhedra_Library::V_GT, Parma_Polyhedra_Library::V_EQ,
Parma_Polyhedra_Library::V_NE, Parma_Polyhedra_Library::V_LE, Parma_Polyhedra_Library::V_GE, Parma_Polyhedra_Library::V_LGE,
Parma_Polyhedra_Library::VC_MINUS_INFINITY, Parma_Polyhedra_Library::V_NEG_OVERFLOW, Parma_Polyhedra_Library::VC_PLUS_INFINITY, Parma_Polyhedra_Library::V_POS_OVERFLOW,
Parma_Polyhedra_Library::VC_NAN, Parma_Polyhedra_Library::V_CVT_STR_UNK, Parma_Polyhedra_Library::V_DIV_ZERO, Parma_Polyhedra_Library::V_INF_ADD_INF,
Parma_Polyhedra_Library::V_INF_DIV_INF, Parma_Polyhedra_Library::V_INF_MOD, Parma_Polyhedra_Library::V_INF_MUL_ZERO, Parma_Polyhedra_Library::V_INF_SUB_INF,
Parma_Polyhedra_Library::V_MOD_ZERO, Parma_Polyhedra_Library::V_SQRT_NEG, Parma_Polyhedra_Library::V_UNKNOWN_NEG_OVERFLOW, Parma_Polyhedra_Library::V_UNKNOWN_POS_OVERFLOW,
Parma_Polyhedra_Library::V_UNORD_COMP
}

| Possible outcomes of a checked arithmetic computation. More...
enum | Parma_Polyhedra_Library::Rounding_Dir { Parma_Polyhedra_Library::ROUND_DOWN, Parma_Polyhedra_Library::ROUND_UP, Parma_Polyhedra_Library::ROUND_IGNORE , Parma_Polyhedra_Library::ROUND_NOT_NEEDED }
| Rounding directions for arithmetic computations. More...
enum | Parma_Polyhedra_Library::Degenerate_Element { Parma_Polyhedra_Library::UNIVERSE, Parma_Polyhedra_Library::EMPTY }
| Kinds of degenerate abstract elements. More...
enum | Parma_Polyhedra_Library::Relation_Symbol { Parma_Polyhedra_Library::LESS_THAN, Parma_Polyhedra_Library::LESS_OR_EQUAL, Parma_Polyhedra_Library::EQUAL, Parma_Polyhedra_Library::GREATER_OR_EQUAL, Parma_Polyhedra_Library::GREATER_THAN, Parma_Polyhedra_Library::NOT_EQUAL }
| Relation symbols. More...
enum | Parma_Polyhedra_Library::Complexity_Class { Parma_Polyhedra_Library::POLYNOMIAL_COMPLEXITY, Parma_Polyhedra_Library::SIMPLEX_COMPLEXITY, Parma_Polyhedra_Library::ANY_COMPLEXITY }
| Complexity pseudo-classes. More...
enum | Parma_Polyhedra_Library::Optimization_Mode { Parma_Polyhedra_Library::MINIMIZATION, Parma_Polyhedra_Library::MAXIMIZATION }
| Possible optimization modes. More...
enum | Parma_Polyhedra_Library::MIP_Problem_Status { Parma_Polyhedra_Library::UNFEASIBLE_MIP_PROBLEM, Parma_Polyhedra_Library::UNBOUNDED_MIP_PROBLEM, Parma_Polyhedra_Library::OPTIMIZED_MIP_PROBLEM }
| Possible outcomes of the MIP_Problem solver. More...

## Variables

const Throwable *volatile | Parma_Polyhedra_Library::abandon_expensive_computations
| A pointer to an exception object.

## Detailed Description

The core implementation of the Parma Polyhedra Library is written in C++.

See Namespace, Hierarchical and Compound indexes for additional information about each single data type.

## Define Documentation

#define PPL_VERSION_MAJOR 0

The major number of the PPL version.

#define PPL_VERSION_MINOR 10

The minor number of the PPL version.

#define PPL_VERSION_REVISION 2

The revision number of the PPL version.

#define PPL_VERSION "0.10.2"

A string containing the PPL version.

Let `M` and `m` denote the numbers associated to PPL_VERSION_MAJOR and PPL_VERSION_MINOR, respectively. The format of PPL_VERSION is `M "." m` if both PPL_VERSION_REVISION (`r`) and PPL_VERSION_BETA (`b`)are zero, `M "." m "pre" b` if PPL_VERSION_REVISION is zero and PPL_VERSION_BETA is not zero, `M "." m "." r` if PPL_VERSION_REVISION is not zero and PPL_VERSION_BETA is zero, `M "." m "." r "pre" b` if neither PPL_VERSION_REVISION nor PPL_VERSION_BETA are zero.

## Typedef Documentation

typedef size_t Parma_Polyhedra_Library::dimension_type

An unsigned integral type for representing space dimensions.

typedef size_t Parma_Polyhedra_Library::memory_size_type

An unsigned integral type for representing memory size in bytes.

typedef PPL_COEFFICIENT_TYPE Parma_Polyhedra_Library::Coefficient

An alias for easily naming the type of PPL coefficients.

Objects of type Coefficient are used to implement the integral valued coefficients occurring in linear expressions, constraints, generators, intervals, bounding boxes and so on. Depending on the chosen configuration options (see file `README.configure`), a Coefficient may actually be:

- The GMP_Integer type, which in turn is an alias for the `mpz_class` type implemented by the C++ interface of the GMP library (this is the default configuration);
- An instance of the Checked_Number class template: with its default policy (Checked_Number_Default_Policy), this implements overflow detection on top of a native integral type (available template instances include checked integers having 8, 16, 32 or 64 bits); with the Checked_Number_Transparent_Policy, this is a wrapper for native integral types with no overflow detection (available template instances are as above).

## Enumeration Type Documentation

enum Parma_Polyhedra_Library::Result

Possible outcomes of a checked arithmetic computation.

Enumerator:

  VC_NORMAL | Ordinary result class.
  V_LT | The computed result is inexact and rounded up.
  V_GT | The computed result is inexact and rounded down.
  V_EQ | The computed result is exact.
  V_NE | The computed result is inexact.
  V_LE | The computed result may be inexact and rounded up.
  V_GE | The computed result may be inexact and rounded down.
  V_LGE | The computed result may be inexact.
  VC_MINUS_INFINITY | Negative infinity unrepresentable result class.
  V_NEG_OVERFLOW | A negative overflow occurred.
  VC_PLUS_INFINITY | Positive infinity unrepresentable result class.
  V_POS_OVERFLOW | A positive overflow occurred.
  VC_NAN | Not a number result class.
  V_CVT_STR_UNK | Converting from unknown string.
  V_DIV_ZERO | Dividing by zero.
  V_INF_ADD_INF | Adding two infinities having opposite signs.
  V_INF_DIV_INF | Dividing two infinities.
  V_INF_MOD | Taking the modulus of an infinity.
  V_INF_MUL_ZERO | Multiplying an infinity by zero.
  V_INF_SUB_INF | Subtracting two infinities having the same sign.
  V_MOD_ZERO | Computing a remainder modulo zero.
  V_SQRT_NEG | Taking the square root of a negative number.
  V_UNKNOWN_NEG_OVERFLOW | Unknown result due to intermediate negative overflow.
  V_UNKNOWN_POS_OVERFLOW | Unknown result due to intermediate positive overflow.
  V_UNORD_COMP | Unordered comparison.

enum Parma_Polyhedra_Library::Rounding_Dir

Rounding directions for arithmetic computations.

Enumerator:

  ROUND_DOWN | Round toward .
  ROUND_UP | Round toward .
  ROUND_IGNORE | Rounding is delegated to lower level. Result info is evaluated lazily.
  ROUND_NOT_NEEDED | Rounding is not needed: client code must ensure the operation is exact.

enum Parma_Polyhedra_Library::Degenerate_Element

Kinds of degenerate abstract elements.

Enumerator:

  UNIVERSE | The universe element, i.e., the whole vector space.
  EMPTY | The empty element, i.e., the empty set.

enum Parma_Polyhedra_Library::Relation_Symbol

Relation symbols.

Enumerator:

  LESS_THAN | Less than.
  LESS_OR_EQUAL | Less than or equal to.
  EQUAL | Equal to.
  GREATER_OR_EQUAL | Greater than or equal to.
  GREATER_THAN | Greater than.
  NOT_EQUAL | Not equal to.

enum Parma_Polyhedra_Library::Complexity_Class

Complexity pseudo-classes.

Enumerator:

  POLYNOMIAL_COMPLEXITY | Worst-case polynomial complexity.
  SIMPLEX_COMPLEXITY | Worst-case exponential complexity but typically polynomial behavior.
  ANY_COMPLEXITY | Any complexity.

enum Parma_Polyhedra_Library::Optimization_Mode

Possible optimization modes.

Enumerator:

  MINIMIZATION | Minimization is requested.
  MAXIMIZATION | Maximization is requested.

enum Parma_Polyhedra_Library::MIP_Problem_Status

Possible outcomes of the MIP_Problem solver.

Enumerator:

  UNFEASIBLE_MIP_PROBLEM | The problem is unfeasible.
  UNBOUNDED_MIP_PROBLEM | The problem is unbounded.
  OPTIMIZED_MIP_PROBLEM | The problem has an optimal solution.

## Variable Documentation

const Throwable* volatile Parma_Polyhedra_Library::abandon_expensive_computations

A pointer to an exception object.

This pointer, which is initialized to zero, is repeatedly checked along any super-linear (i.e., computationally expensive) computation path in the library. When it is found nonzero the exception it points to is thrown. In other words, making this pointer point to an exception (and leaving it in this state) ensures that the library will return control to the client application, possibly by throwing the given exception, within a time that is a linear function of the size of the representation of the biggest object (powerset of polyhedra, polyhedron, system of constraints or generators) on which the library is operating upon.

Note:
  The only sensible way to assign to this pointer is from within a signal handler or from a parallel thread. For this reason, the library, apart from ensuring that the pointer is initially set to zero, never assigns to it. In particular, it does not zero it again when the exception is thrown: it is the client's responsibility to do so.