carl  24.04
Computer ARithmetic Library
Interval.h File Reference
#include <carl-arith/core/Sign.h>
#include <carl-arith/core/Variable.h>
#include <carl-arith/numbers/numbers.h>
#include <carl-common/util/hash.h>
#include <carl-common/meta/platform.h>
#include <carl-common/meta/SFINAE.h>
#include "BoundType.h"
#include "policies/checking.h"
#include "policies/rounding.h"
#include <boost/numeric/interval.hpp>
#include <boost/numeric/interval/interval.hpp>
#include "Sampling.h"
#include <cassert>
#include <cmath>
#include <limits>
#include <list>
#include <map>
#include <sstream>
#include "typetraits.h"
#include "operators.h"
#include "Interval.tpp"
#include "Conversion.h"
Include dependency graph for Interval.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  carl::is_interval_type< carl::Interval< Number > >
 
struct  carl::is_interval_type< const carl::Interval< Number > >
 
struct  carl::policies< Number, Interval >
 Struct which holds the rounding and checking policies required for boost interval. More...
 
struct  carl::policies< double, Interval >
 Template specialization for rounding and checking policies for native double. More...
 
struct  carl::LowerBound< Number >
 
struct  carl::UpperBound< Number >
 
class  carl::Interval< Number >
 The class which contains the interval arithmetic including trigonometric functions. More...
 
struct  carl::is_number_type< Interval< T > >
 
struct  std::hash< carl::Interval< Number > >
 Specialization of std::hash for an interval. More...
 

Namespaces

 carl
 carl is the main namespace for the library.
 

Macros

#define BOUNDS_OK(lower, lowerBoundType, upper, upperBoundType)   (lowerBoundType == BoundType::INFTY || upperBoundType == BoundType::INFTY || lower <= upper)
 Macro to perform a quick check on the passed interval bounds. More...
 
#define IS_EMPTY(lower, lowerBoundType, upper, upperBoundType)   (((lowerBoundType == BoundType::STRICT && upperBoundType != BoundType::INFTY) || (lowerBoundType != BoundType::INFTY && upperBoundType == BoundType::STRICT)) && lower == upper)
 Macro to perform a quick check for emptiness of the interval. More...
 
#define IS_UNBOUNDED(lower, lowerBoundType, upper, upperBoundType)   (lowerBoundType == BoundType::INFTY && upperBoundType == BoundType::INFTY)
 Macro to perform a quick check if the interval is unbounded. More...
 

Functions

template<typename Number >
std::ostream & carl::operator<< (std::ostream &os, const LowerBound< Number > &lb)
 
template<typename Number >
std::ostream & carl::operator<< (std::ostream &os, const UpperBound< Number > &lb)
 
template<typename Number >
bool carl::is_integer (const Interval< Number > &n)
 
template<typename Number >
bool carl::is_zero (const Interval< Number > &i)
 Check if this interval is a point-interval containing 0. More...
 
template<typename Number >
bool carl::is_one (const Interval< Number > &i)
 Check if this interval is a point-interval containing 1. More...
 
template<typename Number >
Interval< Number > carl::div (const Interval< Number > &_lhs, const Interval< Number > &_rhs)
 Implements the division which assumes that there is no remainder. More...
 
template<typename Number >
Interval< Number > carl::quotient (const Interval< Number > &_lhs, const Interval< Number > &_rhs)
 Implements the division with remainder. More...
 
template<typename Integer , typename Number >
Integer carl::to_int (const Interval< Number > &_floatInterval)
 Casts the Interval to an arbitrary integer type which has a constructor for a native int. More...
 
template<typename Number >
Interval< Number > carl::abs (const Interval< Number > &_in)
 Method which returns the absolute value of the passed number. More...
 
template<typename Number >
Interval< Number > carl::floor (const Interval< Number > &_in)
 Method which returns the next smaller integer of this number or the number itself, if it is already an integer. More...
 
template<typename Number >
Interval< Number > carl::ceil (const Interval< Number > &_in)
 Method which returns the next larger integer of the passed number or the number itself, if it is already an integer. More...
 

Macro Definition Documentation

◆ BOUNDS_OK

#define BOUNDS_OK (   lower,
  lowerBoundType,
  upper,
  upperBoundType 
)    (lowerBoundType == BoundType::INFTY || upperBoundType == BoundType::INFTY || lower <= upper)

Macro to perform a quick check on the passed interval bounds.

Definition at line 147 of file Interval.h.

◆ IS_EMPTY

#define IS_EMPTY (   lower,
  lowerBoundType,
  upper,
  upperBoundType 
)    (((lowerBoundType == BoundType::STRICT && upperBoundType != BoundType::INFTY) || (lowerBoundType != BoundType::INFTY && upperBoundType == BoundType::STRICT)) && lower == upper)

Macro to perform a quick check for emptiness of the interval.

Definition at line 151 of file Interval.h.

◆ IS_UNBOUNDED

#define IS_UNBOUNDED (   lower,
  lowerBoundType,
  upper,
  upperBoundType 
)    (lowerBoundType == BoundType::INFTY && upperBoundType == BoundType::INFTY)

Macro to perform a quick check if the interval is unbounded.

Definition at line 155 of file Interval.h.