# Parma_Polyhedra_Library::Interval< Boundary, Info > Class Template Reference
[C++ Language Interface]

A generic, not necessarily closed, possibly restricted interval. More...

`#include <ppl.hh>`

Inherits Parma_Polyhedra_Library::Interval_Base.

List of all members.

## Public Member Functions

void | swap (Interval &y)
| Swaps `*this` with `y`.
void | topological_closure_assign ()
| Assigns to `*this` its topological closure.
memory_size_type | total_memory_in_bytes () const
| Returns the total size in bytes of the memory occupied by `*this`.
memory_size_type | external_memory_in_bytes () const
| Returns the size in bytes of the memory managed by `*this`.
| Interval (const char *s)
| Builds the smallest interval containing the number whose textual representation is contained in `s`.
template<typename From >
Enable_If< Is_Singleton< From > ::value||Is_Interval< From > ::value, I_Result >::type | difference_assign (const From &x)
| Assigns to `*this` the smallest interval containing the set-theoretic difference of `*this` and `x`.
template<typename From1 , typename From2 >
Enable_If<((Is_Singleton < From1 >::value||Is_Interval < From1 >::value)&&(Is_Singleton < From2 >::value||Is_Interval < From2 >::value)), I_Result > ::type | difference_assign (const From1 &x, const From2 &y)
| Assigns to `*this` the smallest interval containing the set-theoretic difference of `x` and `y`.
template<typename From >
Enable_If< Is_Singleton< From > ::value||Is_Interval< From > ::value, I_Result >::type | lower_approximation_difference_assign (const From &x)
| Assigns to `*this` the largest interval contained in the set-theoretic difference of `*this` and `x`.
template<typename From >
Enable_If< Is_Interval< From > ::value, bool >::type | simplify_using_context_assign (const From &y)
| Assigns to `*this` a meet-preserving simplification of `*this` with respect to `y`.
template<typename From >
Enable_If< Is_Interval< From > ::value, void >::type | empty_intersection_assign (const From &y)
| Assigns to `*this` an interval having empty intersection with `y`. The assigned interval should be as large as possible.
template<typename From >
Enable_If< Is_Singleton< From > ::value||Is_Interval< From > ::value, I_Result >::type | refine_existential (Relation_Symbol rel, const From &x)
| Refines `to` according to the existential relation `rel` with `x`.
template<typename From >
Enable_If< Is_Singleton< From > ::value||Is_Interval< From > ::value, I_Result >::type | refine_universal (Relation_Symbol rel, const From &x)
| Refines `to` so that it satisfies the universal relation `rel` with `x`.
template<typename From1 , typename From2 >
Enable_If<((Is_Singleton < From1 >::value||Is_Interval < From1 >::value)&&(Is_Singleton < From2 >::value||Is_Interval < From2 >::value)), I_Result > ::type | mul_assign (const From1 &x, const From2 &y)
template<typename From1 , typename From2 >
Enable_If<((Is_Singleton < From1 >::value||Is_Interval < From1 >::value)&&(Is_Singleton < From2 >::value||Is_Interval < From2 >::value)), I_Result > ::type | div_assign (const From1 &x, const From2 &y)

## Related Functions

(Note that these are not member functions.)
template<typename Boundary , typename Info >
void | swap (Parma_Polyhedra_Library::Interval< Boundary, Info > &x, Parma_Polyhedra_Library::Interval< Boundary, Info > &y)

## Detailed Description

### template<typename Boundary, typename Info>
class Parma_Polyhedra_Library::Interval< Boundary, Info >

A generic, not necessarily closed, possibly restricted interval.

The class template type parameter `Boundary` represents the type of the interval boundaries, and can be chosen, among other possibilities, within one of the following number families:

- a bounded precision native integer type (that is, from `signed char` to `long long` and from `int8_t` to `int64_t`);
- a bounded precision floating point type (`float`, `double` or `long double`);
- an unbounded integer or rational type, as provided by the C++ interface of GMP (`mpz_class` or `mpq_class`).

The class template type parameter `Info` allows to control a number of features of the class, among which:

- the ability to support open as well as closed boundaries;
- the ability to represent empty intervals in addition to nonempty ones;
- the ability to represent intervals of extended number families that contain positive and negative infinities;
- the ability to support (independently from the type of the boundaries) plain intervals of real numbers and intervals subject to generic restrictions (e.g., intervals of integer numbers).

## Member Function Documentation

template<typename Boundary , typename Info >
template<typename From >

Enable_If< Is_Interval< From >::value, bool >::type Parma_Polyhedra_Library::Interval< Boundary, Info >::simplify_using_context_assign | ( | const From & | y | ) | `[inline]`

Assigns to `*this` a meet-preserving simplification of `*this` with respect to `y`.

Returns:
  `false` if and only if the meet of `*this` and `y` is empty.

template<typename Boundary , typename Info >
template<typename From >

Enable_If< Is_Interval< From >::value, void >::type Parma_Polyhedra_Library::Interval< Boundary, Info >::empty_intersection_assign | ( | const From & | y | ) | `[inline]`

Assigns to `*this` an interval having empty intersection with `y`. The assigned interval should be as large as possible.

Note:
  Depending on interval restrictions, there could be many maximal intervals all inconsistent with respect to `y`.

template<typename To_Boundary , typename To_Info >
template<typename From >

Enable_If< Is_Singleton< From >::value||Is_Interval< From >::value, I_Result >::type Parma_Polyhedra_Library::Interval< To_Boundary, To_Info >::refine_existential | ( | Relation_Symbol | rel,
|  | const From & | x |
| ) |  |  | `[inline]`

Refines `to` according to the existential relation `rel` with `x`.

The `to` interval is restricted to become, upon successful exit, the smallest interval of its type that contains the set

Returns:
  ???

template<typename To_Boundary , typename To_Info >
template<typename From >

Enable_If< Is_Singleton< From >::value||Is_Interval< From >::value, I_Result >::type Parma_Polyhedra_Library::Interval< To_Boundary, To_Info >::refine_universal | ( | Relation_Symbol | rel,
|  | const From & | x |
| ) |  |  | `[inline]`

Refines `to` so that it satisfies the universal relation `rel` with `x`.

The `to` interval is restricted to become, upon successful exit, the smallest interval of its type that contains the set

Returns:
  ???

template<typename To_Boundary , typename To_Info >
template<typename From1 , typename From2 >

Enable_If<((Is_Singleton< From1 >::value||Is_Interval< From1 >::value)&&(Is_Singleton< From2 >::value||Is_Interval< From2 >::value)), I_Result >::type Parma_Polyhedra_Library::Interval< To_Boundary, To_Info >::mul_assign | ( | const From1 & | x,
|  | const From2 & | y |
| ) |  |  | `[inline]`

+---------+-----------+-----------+-----------------+ | * | yl > 0 | yu < 0 | yl < 0, yu > 0 | +---------+-----------+-----------+-----------------+ | xl > 0 |xl*yl,xu*yu|xu*yl,xl*yu| xu*yl,xu*yu | +---------+-----------+-----------+-----------------+ | xu < 0 |xl*yu,xu*yl|xu*yu,xl*yl| xl*yu,xl*yl | +---------+-----------+-----------+-----------------+ |xl<0 xu>0|xl*yu,xu*yu|xu*yl,xl*yl|min(xl*yu,xu*yl),| | | | |max(xl*yl,xu*yu) | +---------+-----------+-----------+-----------------+

template<typename To_Boundary , typename To_Info >
template<typename From1 , typename From2 >

Enable_If<((Is_Singleton< From1 >::value||Is_Interval< From1 >::value)&&(Is_Singleton< From2 >::value||Is_Interval< From2 >::value)), I_Result >::type Parma_Polyhedra_Library::Interval< To_Boundary, To_Info >::div_assign | ( | const From1 & | x,
|  | const From2 & | y |
| ) |  |  | `[inline]`

+-----------+-----------+-----------+ | / | yu < 0 | yl > 0 | +-----------+-----------+-----------+ | xu<=0 |xu/yl,xl/yu|xl/yl,xu/yu| +-----------+-----------+-----------+ |xl<=0 xu>=0|xu/yu,xl/yu|xl/yl,xu/yl| +-----------+-----------+-----------+ | xl>=0 |xu/yu,xl/yl|xl/yu,xu/yl| +-----------+-----------+-----------+

## Friends And Related Function Documentation

template<typename Boundary , typename Info >

void swap | ( | Parma_Polyhedra_Library::Interval< Boundary, Info > & | x,
|  | Parma_Polyhedra_Library::Interval< Boundary, Info > & | y |
| ) |  |  | `[related]`

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

- ppl.hh