ZonoOpt v2.1.0
Loading...
Searching...
No Matches
Public Member Functions | Friends | List of all members
ZonoOpt::Interval Class Reference

Interval class. More...

#include <Intervals.hpp>

Public Member Functions

 Interval ()
 Default constructor.
 
 Interval (const zono_float y_min, const zono_float y_max)
 Interval constructor.
 
Intervalclone () const
 Clone Interval object.
 
zono_float lb () const
 Get lower bound.
 
zono_float ub () const
 Get upper bound.
 
Interval operator+ (const Interval &other) const
 Interval addition.
 
Interval operator+ (const zono_float alpha) const
 Interval addition with scalar.
 
Interval operator- (const Interval &other) const
 Interval subtraction.
 
Interval operator- (const zono_float alpha) const
 Interval subtraction with scalar.
 
Interval operator* (const Interval &other) const
 Interval multiplication.
 
Interval operator* (const zono_float alpha) const
 Interval multiplication with scalar.
 
Interval operator/ (const Interval &other) const
 Interval division.
 
Interval operator/ (const zono_float alpha) const
 Interval division with scalar.
 
Interval inv () const
 Interval inverse.
 
Interval intersect (const Interval &other) const
 Interval intersection.
 
bool contains (const zono_float x) const
 Checks whether interval contains a value.
 
bool is_single_valued () const
 Checks whether interval is single-valued (i.e., width is 0 within numerical tolerance)
 
bool is_empty () const
 Checks whether interval is empty.
 
zono_float center () const
 Get center of interval.
 
zono_float width () const
 Get width of interval.
 
Interval radius () const
 Get radius of interval.
 
Interval abs () const
 Get absolute value of interval.
 
Interval sqrt () const
 Get square root of interval.
 
Interval pow (const int n) const
 Interval power.
 
Interval nth_root (const int n) const
 Interval nth root.
 
Interval exp () const
 Compute interval containing exp(x) for all x in interval.
 
Interval log () const
 Compute interval containing log(x) (base e) for all x in interval.
 
Interval sin () const
 Compute interval containing sin(x) for all x in interval.
 
Interval cos () const
 Compute interval containing cos(x) for all x in interval.
 
Interval tan () const
 Compute interval containing tan(x) for all x in interval.
 
Interval arcsin () const
 Compute interval containing arcsin(x) for all x in interval.
 
Interval arccos () const
 Compute interval containing arccos(x) for all x in interval.
 
Interval arctan () const
 Compute interval containing arctan(x) for all x in interval.
 
Interval sinh () const
 Compute interval containing sinh(x) for all x in interval.
 
Interval cosh () const
 Compute interval containing cosh(x) for all x in interval.
 
Interval tanh () const
 Compute interval containing tanh(x) for all x in interval.
 
Interval arcsinh () const
 Compute interval containing arcsinh(x) for all x in interval.
 
Interval arccosh () const
 Compute interval containing arccosh(x) for all x in interval.
 
Interval arctanh () const
 Compute interval containing arctanh(x) for all x in interval.
 
std::string print () const
 Print method for interval.
 

Friends

std::ostream & operator<< (std::ostream &os, const Interval &interval)
 Print to ostream.
 

Detailed Description

Interval class.

Wraps boost::numeric::interval

Constructor & Destructor Documentation

◆ Interval() [1/2]

ZonoOpt::Interval::Interval ( )
inline

Default constructor.

◆ Interval() [2/2]

ZonoOpt::Interval::Interval ( const zono_float  y_min,
const zono_float  y_max 
)
inline

Interval constructor.

Parameters
y_minlower bound
y_maxupper bound

Member Function Documentation

◆ abs()

Interval ZonoOpt::Interval::abs ( ) const
inline

Get absolute value of interval.

Returns
enclosure of abs(this)

◆ arccos()

Interval ZonoOpt::Interval::arccos ( ) const
inline

Compute interval containing arccos(x) for all x in interval.

Returns
enclosure of arccos(x)

◆ arccosh()

Interval ZonoOpt::Interval::arccosh ( ) const
inline

Compute interval containing arccosh(x) for all x in interval.

Returns
enclosure of arccosh(x)

◆ arcsin()

Interval ZonoOpt::Interval::arcsin ( ) const
inline

Compute interval containing arcsin(x) for all x in interval.

Returns
enclosure of arcsin(x)

◆ arcsinh()

Interval ZonoOpt::Interval::arcsinh ( ) const
inline

Compute interval containing arcsinh(x) for all x in interval.

Returns
enclosure of arcsinh(x)

◆ arctan()

Interval ZonoOpt::Interval::arctan ( ) const
inline

Compute interval containing arctan(x) for all x in interval.

Returns
enclosure of arctan(x)

◆ arctanh()

Interval ZonoOpt::Interval::arctanh ( ) const
inline

Compute interval containing arctanh(x) for all x in interval.

Returns
enclosure of arctanh(x)

◆ center()

zono_float ZonoOpt::Interval::center ( ) const
inline

Get center of interval.

Returns
center of interval

◆ clone()

Interval * ZonoOpt::Interval::clone ( ) const
inline

Clone Interval object.

Returns
clone of object

◆ contains()

bool ZonoOpt::Interval::contains ( const zono_float  x) const
inline

Checks whether interval contains a value.

Parameters
xscalar value
Returns
flag indicating if interval contains x

◆ cos()

Interval ZonoOpt::Interval::cos ( ) const
inline

Compute interval containing cos(x) for all x in interval.

Returns
enclosure of cos(x)

◆ cosh()

Interval ZonoOpt::Interval::cosh ( ) const
inline

Compute interval containing cosh(x) for all x in interval.

Returns
enclosure of cosh(x)

◆ exp()

Interval ZonoOpt::Interval::exp ( ) const
inline

Compute interval containing exp(x) for all x in interval.

Returns
enclosure of exp(x)

◆ intersect()

Interval ZonoOpt::Interval::intersect ( const Interval other) const
inline

Interval intersection.

Parameters
otherother interval
Returns
intersection of this and other

◆ inv()

Interval ZonoOpt::Interval::inv ( ) const
inline

Interval inverse.

Returns
enclosure of inverse

◆ is_empty()

bool ZonoOpt::Interval::is_empty ( ) const
inline

Checks whether interval is empty.

Returns
flag indicating if interval is empty

◆ is_single_valued()

bool ZonoOpt::Interval::is_single_valued ( ) const
inline

Checks whether interval is single-valued (i.e., width is 0 within numerical tolerance)

Returns
flag indicating if interval is single-value

◆ lb()

zono_float ZonoOpt::Interval::lb ( ) const
inline

Get lower bound.

Returns
lower bound

◆ log()

Interval ZonoOpt::Interval::log ( ) const
inline

Compute interval containing log(x) (base e) for all x in interval.

Returns
enclosure of log(x)

◆ nth_root()

Interval ZonoOpt::Interval::nth_root ( const int  n) const
inline

Interval nth root.

Parameters
nnth root
Returns
enclosure of root_n(this)

◆ operator*() [1/2]

Interval ZonoOpt::Interval::operator* ( const Interval other) const
inline

Interval multiplication.

Parameters
otherother interval
Returns
enclosure of this * other

◆ operator*() [2/2]

Interval ZonoOpt::Interval::operator* ( const zono_float  alpha) const
inline

Interval multiplication with scalar.

Parameters
alphascalar
Returns
enclosure of this * alpha

◆ operator+() [1/2]

Interval ZonoOpt::Interval::operator+ ( const Interval other) const
inline

Interval addition.

Parameters
otherother interval
Returns
enclosure of this + other

◆ operator+() [2/2]

Interval ZonoOpt::Interval::operator+ ( const zono_float  alpha) const
inline

Interval addition with scalar.

Parameters
alphascalar
Returns
enclosure of this + alpha

◆ operator-() [1/2]

Interval ZonoOpt::Interval::operator- ( const Interval other) const
inline

Interval subtraction.

Parameters
otherother interval
Returns
enclosure of this - other

◆ operator-() [2/2]

Interval ZonoOpt::Interval::operator- ( const zono_float  alpha) const
inline

Interval subtraction with scalar.

Parameters
alphascalar
Returns
enclosure of this - alpha

◆ operator/() [1/2]

Interval ZonoOpt::Interval::operator/ ( const Interval other) const
inline

Interval division.

Parameters
otherother interval
Returns
enclosure of this / other

◆ operator/() [2/2]

Interval ZonoOpt::Interval::operator/ ( const zono_float  alpha) const
inline

Interval division with scalar.

Parameters
alphascalar
Returns
enclosure of this / alpha

◆ pow()

Interval ZonoOpt::Interval::pow ( const int  n) const
inline

Interval power.

Parameters
npower
Returns
enclosure of this^n

◆ print()

std::string ZonoOpt::Interval::print ( ) const
inline

Print method for interval.

Returns
string representation of interval

◆ radius()

Interval ZonoOpt::Interval::radius ( ) const
inline

Get radius of interval.

Returns
radius of interval

Returns interval centered at zero with width equal to the width of the original interval

◆ sin()

Interval ZonoOpt::Interval::sin ( ) const
inline

Compute interval containing sin(x) for all x in interval.

Returns
enclosure of sin(x)

◆ sinh()

Interval ZonoOpt::Interval::sinh ( ) const
inline

Compute interval containing sinh(x) for all x in interval.

Returns
enclosure of sinh(x)

◆ sqrt()

Interval ZonoOpt::Interval::sqrt ( ) const
inline

Get square root of interval.

Returns
enclosure of sqrt(this)

◆ tan()

Interval ZonoOpt::Interval::tan ( ) const
inline

Compute interval containing tan(x) for all x in interval.

Returns
enclosure of tan(x)

◆ tanh()

Interval ZonoOpt::Interval::tanh ( ) const
inline

Compute interval containing tanh(x) for all x in interval.

Returns
enclosure of tanh(x)

◆ ub()

zono_float ZonoOpt::Interval::ub ( ) const
inline

Get upper bound.

Returns
upper bound

◆ width()

zono_float ZonoOpt::Interval::width ( ) const
inline

Get width of interval.

Returns
width of interval

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  os,
const Interval interval 
)
friend

Print to ostream.

Parameters
os
interval
Returns
ostream reference

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