CAPD DynSys Library  5.2.0
capd::cxsc::Interval Class Reference

CAPD interface for interval library cxsc. More...

#include <capd/cxsc/Interval.h>

Public Types

typedef ::cxsc::interval BaseInterval
 
typedef double BoundType
 
typedef capd::intervals::IntervalError< BoundTypeIntervalError
 

Public Member Functions

 Interval ()
 
 Interval (const Interval &A_iv)
 copying constructor More...
 
 Interval (const BoundType &A_scalar)
 constructor from any class that can be coverted to BoundType More...
 
 Interval (const BoundType &A_left, const BoundType &A_right)
 constructor from any class that can be coverted to BoundType More...
 
 Interval (const BaseInterval &interval)
 
 Interval (const char left[], const char right[])
 
 Interval (const std::string &left, const std::string &right)
 
BaseIntervalgetBaseInterval ()
 returns reference to base (cxsc) interval More...
 
const BaseIntervalgetBaseInterval () const
 returns const reference to base (cxsc) interval More...
 
BoundType inf () const
 < returns the left end of the interval More...
 
BoundType sup () const
 < returns the right end of the interval More...
 
BoundType leftBound () const
 < returns the left end of the interval More...
 
BoundType rightBound () const
 < returns the right end of the interval More...
 
void setLeftBound (const BoundType &A_left)
 
void setRightBound (const BoundType &A_right)
 
Interval left () const
 < returns interval containing left end More...
 
Interval right () const
 < returns interval containing right end More...
 
template<typename T_Scalar >
bool contains (const T_Scalar &A_X) const
 < checks if interval contains given point X More...
 
bool contains (const Interval &A_iv) const
 < checks if interval contains given interval iv More...
 
template<typename T_Scalar >
bool containsInInterior (const T_Scalar &A_X) const
 < checks if interval contains in interior given point X More...
 
bool containsInInterior (const Interval &A_iv) const
 < checks if interval contains in interior given interval iv More...
 
bool subset (const Interval &A_iv) const
 < checks if interval is subset of iv More...
 
bool subsetInterior (const Interval &A_iv) const
 < checks if interval is subset of interior of iv More...
 
BoundType midPoint () const
 < returns middle point of interval More...
 
Interval mid () const
 < returns middle point of interval More...
 
Interval abs () const
 <Returns the interval of absolute values of this interval, i.e. More...
 
void split (Interval &A_rMid, Interval &A_rRemainder) const
 Splits interval into the form mid + remainder, where mid - is middle point. More...
 
void split (BoundType &A_rMid, Interval &A_rRemainder) const
 
void split (Interval &r)
 
Intervaloperator= (const Interval &A_iv)
 
Intervaloperator= (const BoundType &A_x)
 
Intervaloperator+= (const Interval &A_iv)
 
Intervaloperator-= (const Interval &A_iv)
 
Intervaloperator*= (const Interval &A_iv)
 
Intervaloperator/= (const Interval &A_iv)
 

Static Public Member Functions

static Interval pi ()
 returns pi constant More...
 
static Interval euler ()
 returns euler constant More...
 

Protected Types

typedef ::cxsc::real Real
 

Protected Member Functions

 Interval (const Real &A_scalar)
 
 Interval (const Real &left, const Real &right)
 

Protected Attributes

BaseInterval m_interval
 

Friends

BoundType leftBound (const Interval &x)
 
BoundType rightBound (const Interval &x)
 
BoundType inf (const Interval &x)
 
BoundType sup (const Interval &x)
 
Interval left (const Interval &x)
 
Interval right (const Interval &x)
 
bool subset (const Interval &A_iv1, const Interval &A_iv2)
 
bool subsetInterior (const Interval &A_iv1, const Interval &A_iv2)
 
bool operator== (const Interval &A_iv1, const Interval &A_iv2)
 
bool operator<= (const Interval &A_iv1, const Interval &A_iv2)
 
bool operator>= (const Interval &A_iv1, const Interval &A_iv2)
 
bool operator< (const Interval &A_iv1, const Interval &A_iv2)
 
bool operator> (const Interval &A_iv1, const Interval &A_iv2)
 
bool operator!= (const Interval &A_iv1, const Interval &A_iv2)
 
bool operator== (const Interval &A_iVal1, const BoundType &A_Val2)
 operator == (interval, scalar) More...
 
bool operator== (const BoundType &A_Val1, const Interval &A_iVal2)
 operator == (scalar, interval) More...
 
bool operator!= (const Interval &A_iVal1, const BoundType &A_Val2)
 operator != (interval, scalar) More...
 
bool operator!= (const BoundType &A_Val1, const Interval &A_iVal2)
 operator != (scalar, interval) More...
 
bool operator> (const Interval &A_iVal1, const BoundType &A_Val2)
 operator > (interval, scalar) More...
 
bool operator> (const BoundType &A_Val1, const Interval &A_iVal2)
 operator > (scalar, interval) More...
 
bool operator>= (const Interval &A_iVal1, const BoundType &A_Val2)
 operator >= (interval, scalar) More...
 
bool operator>= (const BoundType &A_Val1, const Interval &A_iVal2)
 operator >= (scalar, interval) More...
 
bool operator< (const Interval &A_iVal1, const BoundType &A_Val2)
 operator < (interval, scalar) More...
 
bool operator< (const BoundType &A_Val1, const Interval &A_iVal2)
 operator < (scalar, interval) More...
 
bool operator<= (const Interval &A_iVal1, const BoundType &A_Val2)
 operator <= (interval, scalar) More...
 
bool operator<= (const BoundType &A_Val1, const Interval &A_iVal2)
 operator <= (scalar, interval) More...
 
Interval operator- (const Interval &A_iv)
 
Interval operator+ (const Interval &A_iv1, const Interval &A_iv2)
 
Interval operator- (const Interval &A_iv1, const Interval &A_iv2)
 
Interval operator* (const Interval &A_iv1, const Interval &A_iv2)
 
Interval operator/ (const Interval &A_iv1, const Interval &A_iv2)
 
Interval operator^ (const Interval &A_iv1, int i)
 
Interval operator+ (const Interval &A_iVal, const BoundType &A_x)
 operator + (interval, scalar) More...
 
Interval operator+ (const BoundType &A_x, const Interval &A_iVal)
 operator + (scalar, interval) More...
 
Interval operator- (const Interval &A_iVal, const BoundType &A_x)
 operator - (interval, scalar) More...
 
Interval operator- (const BoundType &A_x, const Interval &A_iVal)
 operator - (scalar, interval) More...
 
Interval operator* (const Interval &A_iVal, const BoundType &A_x)
 operator * (interval, scalar) More...
 
Interval operator* (const BoundType &A_x, const Interval &A_iVal)
 operator * (scalar, interval) More...
 
Interval operator/ (const Interval &A_iVal, const BoundType &A_x)
 operator / (scalar, interval) More...
 
Interval operator/ (const BoundType &A_x, const Interval &A_iVal)
 operator / (interval, scalar) More...
 
std::ostream & operator<< (std::ostream &s, const Interval &A_iv)
 
std::istream & operator>> (std::istream &s, Interval &A_iv)
 
Interval diam (const Interval &ix)
 
BoundType width (const Interval &ix)
 
Interval mid (const Interval &A_iv)
 
bool intersection (const Interval &A_iv1, const Interval &A_iv2, Interval &A_rIntersection)
 Intersection of two intervals. More...
 
Interval intervalHull (const Interval &ix, const Interval &iy)
 returns an interval containing ix and iy More...
 
void split (Interval &A_iv, Interval &A_rMid, BoundType &A_diam)
 
void split (Interval &A_rIv, BoundType &A_diam)
 
bool isSingular (const Interval &A_x)
 
Interval power (const Interval &x, int n)
 
Interval power (const Interval &a, const Interval &b)
 
Interval sqrt (const Interval &x)
 
Interval sin (const Interval &x)
 
Interval cos (const Interval &x)
 
Interval tan (const Interval &x)
 
Interval cot (const Interval &x)
 
Interval atan (const Interval &x)
 
Interval asin (const Interval &x)
 
Interval acos (const Interval &x)
 
Interval sinh (const Interval &x)
 
Interval cosh (const Interval &x)
 
Interval tanh (const Interval &x)
 
Interval coth (const Interval &x)
 
Interval exp (const Interval &x)
 
Interval log (const Interval &x)
 
Interval sqr (const Interval &x)
 
Interval nonnegativePart (const Interval &iv)
 returns nonnegative part of interval More...
 
Interval ball (const Interval &iv, const Interval &r)
 Ball with center iv and radius r. More...
 
Interval ball (const Interval &iv, const BoundType &r)
 Ball with center iv and radius r. More...
 
Interval solveAffineInclusion (const Interval &a, const Interval &p, const Interval &c)
 solves inclusion a+[0,t]*p\subset c for t More...
 
Interval solveAffineInclusion (const Interval &a, const Interval &p, const Interval &c, int &dir)
 solves inclusion a+[0,t]*p\subset c for t More...
 

Detailed Description

CAPD interface for interval library cxsc.

It works as an adapter for the other CAPD routines. It has exactly the same interface as native CAPD interval and it just calls the corresponding functions from the cxsc.

To prevent misusing and enable easy interchange of a different interval implementation the cxsc interval T is not a base class of the Interval class and can be accesed only by getBaseInterval() method.

Member Typedef Documentation

◆ BaseInterval

typedef ::cxsc::interval capd::cxsc::Interval::BaseInterval

◆ BoundType

◆ IntervalError

◆ Real

typedef ::cxsc::real capd::cxsc::Interval::Real
protected

Constructor & Destructor Documentation

◆ Interval() [1/9]

capd::cxsc::Interval::Interval ( const Real A_scalar)
inlineprotected

◆ Interval() [2/9]

capd::cxsc::Interval::Interval ( const Real left,
const Real right 
)
inlineprotected

◆ Interval() [3/9]

capd::cxsc::Interval::Interval ( )
inline

◆ Interval() [4/9]

capd::cxsc::Interval::Interval ( const Interval A_iv)
inline

copying constructor

◆ Interval() [5/9]

capd::cxsc::Interval::Interval ( const BoundType A_scalar)
inline

constructor from any class that can be coverted to BoundType

◆ Interval() [6/9]

capd::cxsc::Interval::Interval ( const BoundType A_left,
const BoundType A_right 
)
inline

constructor from any class that can be coverted to BoundType

◆ Interval() [7/9]

capd::cxsc::Interval::Interval ( const BaseInterval interval)
inline

◆ Interval() [8/9]

capd::cxsc::Interval::Interval ( const char  left[],
const char  right[] 
)
inline

◆ Interval() [9/9]

capd::cxsc::Interval::Interval ( const std::string &  left,
const std::string &  right 
)
inline

Member Function Documentation

◆ abs()

Interval capd::cxsc::Interval::abs ( ) const
inline

<Returns the interval of absolute values of this interval, i.e.

◆ contains() [1/2]

bool capd::cxsc::Interval::contains ( const Interval A_iv) const
inline

< checks if interval contains given interval iv

◆ contains() [2/2]

template<typename T_Scalar >
bool capd::cxsc::Interval::contains ( const T_Scalar &  A_X) const
inline

< checks if interval contains given point X

◆ containsInInterior() [1/2]

bool capd::cxsc::Interval::containsInInterior ( const Interval A_iv) const
inline

< checks if interval contains in interior given interval iv

◆ containsInInterior() [2/2]

template<typename T_Scalar >
bool capd::cxsc::Interval::containsInInterior ( const T_Scalar &  A_X) const
inline

< checks if interval contains in interior given point X

◆ euler()

Interval capd::cxsc::Interval::euler ( )
inlinestatic

returns euler constant

◆ getBaseInterval() [1/2]

BaseInterval& capd::cxsc::Interval::getBaseInterval ( )
inline

returns reference to base (cxsc) interval

◆ getBaseInterval() [2/2]

const BaseInterval& capd::cxsc::Interval::getBaseInterval ( ) const
inline

returns const reference to base (cxsc) interval

◆ inf()

BoundType capd::cxsc::Interval::inf ( ) const
inline

< returns the left end of the interval

◆ left()

Interval capd::cxsc::Interval::left ( ) const
inline

< returns interval containing left end

◆ leftBound()

BoundType capd::cxsc::Interval::leftBound ( ) const
inline

< returns the left end of the interval

◆ mid()

Interval capd::cxsc::Interval::mid ( ) const
inline

< returns middle point of interval

◆ midPoint()

BoundType capd::cxsc::Interval::midPoint ( ) const
inline

< returns middle point of interval

◆ operator*=()

Interval& capd::cxsc::Interval::operator*= ( const Interval A_iv)
inline

◆ operator+=()

Interval& capd::cxsc::Interval::operator+= ( const Interval A_iv)
inline

◆ operator-=()

Interval& capd::cxsc::Interval::operator-= ( const Interval A_iv)
inline

◆ operator/=()

Interval& capd::cxsc::Interval::operator/= ( const Interval A_iv)
inline

◆ operator=() [1/2]

Interval& capd::cxsc::Interval::operator= ( const BoundType A_x)
inline

◆ operator=() [2/2]

Interval& capd::cxsc::Interval::operator= ( const Interval A_iv)
inline

◆ pi()

Interval capd::cxsc::Interval::pi ( )
inlinestatic

returns pi constant

◆ right()

Interval capd::cxsc::Interval::right ( ) const
inline

< returns interval containing right end

◆ rightBound()

BoundType capd::cxsc::Interval::rightBound ( ) const
inline

< returns the right end of the interval

◆ setLeftBound()

void capd::cxsc::Interval::setLeftBound ( const BoundType A_left)
inline

◆ setRightBound()

void capd::cxsc::Interval::setRightBound ( const BoundType A_right)
inline

◆ split() [1/3]

void capd::cxsc::Interval::split ( BoundType A_rMid,
Interval A_rRemainder 
) const
inline

◆ split() [2/3]

void capd::cxsc::Interval::split ( Interval A_rMid,
Interval A_rRemainder 
) const
inline

Splits interval into the form mid + remainder, where mid - is middle point.

◆ split() [3/3]

void capd::cxsc::Interval::split ( Interval r)
inline

◆ subset()

bool capd::cxsc::Interval::subset ( const Interval A_iv) const
inline

< checks if interval is subset of iv

◆ subsetInterior()

bool capd::cxsc::Interval::subsetInterior ( const Interval A_iv) const
inline

< checks if interval is subset of interior of iv

◆ sup()

BoundType capd::cxsc::Interval::sup ( ) const
inline

< returns the right end of the interval

Friends And Related Function Documentation

◆ acos

Interval acos ( const Interval x)
friend

◆ asin

Interval asin ( const Interval x)
friend

◆ atan

Interval atan ( const Interval x)
friend

◆ ball [1/2]

Interval ball ( const Interval iv,
const BoundType r 
)
friend

Ball with center iv and radius r.

◆ ball [2/2]

Interval ball ( const Interval iv,
const Interval r 
)
friend

Ball with center iv and radius r.

◆ cos

Interval cos ( const Interval x)
friend

◆ cosh

Interval cosh ( const Interval x)
friend

◆ cot

Interval cot ( const Interval x)
friend

◆ coth

Interval coth ( const Interval x)
friend

◆ diam

Interval diam ( const Interval ix)
friend

◆ exp

Interval exp ( const Interval x)
friend

◆ inf

BoundType inf ( const Interval x)
friend
Parameters
xreturns the left end of the interval

◆ intersection

bool intersection ( const Interval A_iv1,
const Interval A_iv2,
Interval A_rIntersection 
)
friend

Intersection of two intervals.

◆ intervalHull

Interval intervalHull ( const Interval ix,
const Interval iy 
)
friend

returns an interval containing ix and iy

◆ isSingular

bool isSingular ( const Interval A_x)
friend

◆ left

Interval left ( const Interval x)
friend
Parameters
xreturns interval containing left end

◆ leftBound

BoundType leftBound ( const Interval x)
friend
Parameters
xreturns the left end of the interval

◆ log

Interval log ( const Interval x)
friend

◆ mid

Interval mid ( const Interval A_iv)
friend

◆ nonnegativePart

Interval nonnegativePart ( const Interval iv)
friend

returns nonnegative part of interval

Remarks
if nonnegative part is empty throws exception

◆ operator!= [1/3]

bool operator!= ( const BoundType A_Val1,
const Interval A_iVal2 
)
friend

operator != (scalar, interval)

◆ operator!= [2/3]

bool operator!= ( const Interval A_iv1,
const Interval A_iv2 
)
friend

◆ operator!= [3/3]

bool operator!= ( const Interval A_iVal1,
const BoundType A_Val2 
)
friend

operator != (interval, scalar)

◆ operator* [1/3]

Interval operator* ( const BoundType A_x,
const Interval A_iVal 
)
friend

operator * (scalar, interval)

◆ operator* [2/3]

Interval operator* ( const Interval A_iv1,
const Interval A_iv2 
)
friend

◆ operator* [3/3]

Interval operator* ( const Interval A_iVal,
const BoundType A_x 
)
friend

operator * (interval, scalar)

◆ operator+ [1/3]

Interval operator+ ( const BoundType A_x,
const Interval A_iVal 
)
friend

operator + (scalar, interval)

◆ operator+ [2/3]

Interval operator+ ( const Interval A_iv1,
const Interval A_iv2 
)
friend

◆ operator+ [3/3]

Interval operator+ ( const Interval A_iVal,
const BoundType A_x 
)
friend

operator + (interval, scalar)

◆ operator- [1/4]

Interval operator- ( const BoundType A_x,
const Interval A_iVal 
)
friend

operator - (scalar, interval)

◆ operator- [2/4]

Interval operator- ( const Interval A_iv)
friend

◆ operator- [3/4]

Interval operator- ( const Interval A_iv1,
const Interval A_iv2 
)
friend

◆ operator- [4/4]

Interval operator- ( const Interval A_iVal,
const BoundType A_x 
)
friend

operator - (interval, scalar)

◆ operator/ [1/3]

Interval operator/ ( const BoundType A_x,
const Interval A_iVal 
)
friend

operator / (interval, scalar)

◆ operator/ [2/3]

Interval operator/ ( const Interval A_iv1,
const Interval A_iv2 
)
friend

◆ operator/ [3/3]

Interval operator/ ( const Interval A_iVal,
const BoundType A_x 
)
friend

operator / (scalar, interval)

◆ operator< [1/3]

bool operator< ( const BoundType A_Val1,
const Interval A_iVal2 
)
friend

operator < (scalar, interval)

◆ operator< [2/3]

bool operator< ( const Interval A_iv1,
const Interval A_iv2 
)
friend

◆ operator< [3/3]

bool operator< ( const Interval A_iVal1,
const BoundType A_Val2 
)
friend

operator < (interval, scalar)

◆ operator<<

std::ostream& operator<< ( std::ostream &  s,
const Interval A_iv 
)
friend

◆ operator<= [1/3]

bool operator<= ( const BoundType A_Val1,
const Interval A_iVal2 
)
friend

operator <= (scalar, interval)

◆ operator<= [2/3]

bool operator<= ( const Interval A_iv1,
const Interval A_iv2 
)
friend

◆ operator<= [3/3]

bool operator<= ( const Interval A_iVal1,
const BoundType A_Val2 
)
friend

operator <= (interval, scalar)

◆ operator== [1/3]

bool operator== ( const BoundType A_Val1,
const Interval A_iVal2 
)
friend

operator == (scalar, interval)

◆ operator== [2/3]

bool operator== ( const Interval A_iv1,
const Interval A_iv2 
)
friend

◆ operator== [3/3]

bool operator== ( const Interval A_iVal1,
const BoundType A_Val2 
)
friend

operator == (interval, scalar)

◆ operator> [1/3]

bool operator> ( const BoundType A_Val1,
const Interval A_iVal2 
)
friend

operator > (scalar, interval)

◆ operator> [2/3]

bool operator> ( const Interval A_iv1,
const Interval A_iv2 
)
friend

◆ operator> [3/3]

bool operator> ( const Interval A_iVal1,
const BoundType A_Val2 
)
friend

operator > (interval, scalar)

◆ operator>= [1/3]

bool operator>= ( const BoundType A_Val1,
const Interval A_iVal2 
)
friend

operator >= (scalar, interval)

◆ operator>= [2/3]

bool operator>= ( const Interval A_iv1,
const Interval A_iv2 
)
friend

◆ operator>= [3/3]

bool operator>= ( const Interval A_iVal1,
const BoundType A_Val2 
)
friend

operator >= (interval, scalar)

◆ operator>>

std::istream& operator>> ( std::istream &  s,
Interval A_iv 
)
friend

◆ operator^

Interval operator^ ( const Interval A_iv1,
int  i 
)
friend

◆ power [1/2]

Interval power ( const Interval a,
const Interval b 
)
friend

◆ power [2/2]

Interval power ( const Interval x,
int  n 
)
friend

◆ right

Interval right ( const Interval x)
friend
Parameters
xreturns interval containing right end

◆ rightBound

BoundType rightBound ( const Interval x)
friend
Parameters
xreturns the right end of the interval

◆ sin

Interval sin ( const Interval x)
friend

◆ sinh

Interval sinh ( const Interval x)
friend

◆ solveAffineInclusion [1/2]

Interval solveAffineInclusion ( const Interval a,
const Interval p,
const Interval c 
)
friend

solves inclusion a+[0,t]*p\subset c for t

◆ solveAffineInclusion [2/2]

Interval solveAffineInclusion ( const Interval a,
const Interval p,
const Interval c,
int dir 
)
friend

solves inclusion a+[0,t]*p\subset c for t

◆ split [1/2]

void split ( Interval A_iv,
Interval A_rMid,
BoundType A_diam 
)
friend

TODO : correct to not switch rounding

◆ split [2/2]

void split ( Interval A_rIv,
BoundType A_diam 
)
friend

◆ sqr

Interval sqr ( const Interval x)
friend

◆ sqrt

Interval sqrt ( const Interval x)
friend

◆ subset

bool subset ( const Interval A_iv1,
const Interval A_iv2 
)
friend

◆ subsetInterior

bool subsetInterior ( const Interval A_iv1,
const Interval A_iv2 
)
friend

◆ sup

BoundType sup ( const Interval x)
friend
Parameters
xreturns the right end of the interval

◆ tan

Interval tan ( const Interval x)
friend

◆ tanh

Interval tanh ( const Interval x)
friend

◆ width

BoundType width ( const Interval ix)
friend

Member Data Documentation

◆ m_interval

BaseInterval capd::cxsc::Interval::m_interval
protected