ZonoOpt v2.0.1
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Friends | List of all members
ZonoOpt::Interval Struct Reference

Interval class. More...

#include <Intervals.hpp>

Inheritance diagram for ZonoOpt::Interval:
Inheritance graph
[legend]
Collaboration diagram for ZonoOpt::Interval:
Collaboration graph
[legend]

Public Member Functions

 Interval ()
 default constructor
 
 Interval (zono_float y_min, zono_float y_max)
 Interval constructor.
 
Intervalclone () const
 Clone Interval object.
 
zono_floatget_y_min ()
 get reference to lower bound
 
zono_floatget_y_max ()
 get reference to upper bound
 
const zono_floatget_y_min () const
 get const reference to lower bound
 
const zono_floatget_y_max () const
 get const reference to upper bound
 
Interval operator+ (const Interval &other) const
 interval addition
 
Interval operator- (const Interval &other) const
 interval subtraction
 
Interval operator* (const Interval &other) const
 interval multiplication
 
Interval operator* (zono_float alpha) const
 interval multiplication with scalar
 
Interval inv () const
 interval inverse
 
Interval operator/ (const Interval &other) const
 interval division
 
Interval intersect (const Interval &other) const
 interval intersection
 
zono_float center () const
 get center of interval
 
IntervalView as_view ()
 IntervalView interface for Interval.
 
std::string print () const
 print method for 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 exp () const
 compute interval containing exp(x) for all x in interval
 
- Public Member Functions inherited from ZonoOpt::IntervalBase< Interval >
zono_floaty_min ()
 Returns reference to interval lower bound.
 
const zono_floaty_min () const
 Returns const reference to interval lower bound.
 
zono_floaty_max ()
 Returns reference to interval upper bound.
 
const zono_floaty_max () const
 Returns const reference to interval upper bound.
 
void set (const zono_float min, const zono_float max)
 Sets interval bounds.
 
void add_assign (const Interval &x1, const Interval &x2)
 sets interval to x1 + x2
 
void subtract_assign (const Interval &x1, const Interval &x2)
 sets interval to x1 - x2
 
void multiply_assign (const Interval &x1, const Interval &x2)
 sets interval to x1 * x2
 
void multiply_assign (const Interval &x1, zono_float alpha)
 sets interval to alpha * x1
 
void inverse ()
 sets interval to its inverse
 
void divide_assign (const Interval &x1, const Interval &x2)
 sets interval to x1 / x2
 
void intersect_assign (const Interval &x1, const Interval &x2)
 sets interval to intersection of x1 and x2
 
bool is_empty () const
 checks whether interval is empty
 
bool contains (zono_float y) 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)
 
zono_float width () const
 get width of interval (ub - lb)
 
void sin_assign (const Interval &x)
 compute interval containing sin(x) over x
 
void cos_assign (const Interval &x)
 compute interval containing cos(x) over x
 
void tan_assign (const Interval &x)
 compute interval containing tan(x) over x
 
void arcsin_assign (const Interval &x)
 compute interval containing arcsin(x) over x
 
void arccos_assign (const Interval &x)
 compute interval containing arccos(x) over x
 
void arctan_assign (const Interval &x)
 compute interval containing arctan(x) over x
 
void exp_assign (const Interval &x)
 compute interval containing exp(x) over x
 

Public Attributes

zono_float lb
 lower bound
 
zono_float ub
 upper bound
 

Friends

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

Detailed Description

Interval class.

Implements interface from IntervalBase. This class owns its lower and upper bounds.

Constructor & Destructor Documentation

◆ Interval() [1/2]

ZonoOpt::Interval::Interval ( )
inline

default constructor

◆ Interval() [2/2]

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

Interval constructor.

Parameters
y_minlower bound
y_maxupper bound

Member Function Documentation

◆ arccos()

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

compute interval containing arccos(x) for all x in interval

Returns
interval containing arccos(x)

◆ arcsin()

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

compute interval containing arcsin(x) for all x in interval

Returns
interval containing arcsin(x)

◆ arctan()

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

compute interval containing arctan(x) for all x in interval

Returns
interval containing arctan(x)

◆ as_view()

IntervalView ZonoOpt::Interval::as_view ( )
inline

IntervalView interface for Interval.

Returns
IntervalView of this

◆ 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

◆ cos()

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

compute interval containing cos(x) for all x in interval

Returns
interval containing cos(x)

◆ exp()

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

compute interval containing exp(x) for all x in interval

Returns
interval containing exp(x)

◆ get_y_max() [1/2]

zono_float & ZonoOpt::Interval::get_y_max ( )
inline

get reference to upper bound

Returns
reference to upper bound

◆ get_y_max() [2/2]

const zono_float & ZonoOpt::Interval::get_y_max ( ) const
inline

get const reference to upper bound

Returns
reference to upper bound

◆ get_y_min() [1/2]

zono_float & ZonoOpt::Interval::get_y_min ( )
inline

get reference to lower bound

Returns
reference to lower bound

◆ get_y_min() [2/2]

const zono_float & ZonoOpt::Interval::get_y_min ( ) const
inline

get const reference to lower bound

Returns
reference to lower bound

◆ 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
inverse of this

◆ operator*() [1/2]

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

interval multiplication

Parameters
otherother interval
Returns
this * other

◆ operator*() [2/2]

interval multiplication with scalar

Parameters
alphascalar
Returns
alpha * this

◆ operator+()

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

interval addition

Parameters
otherother interval
Returns
this + other

◆ operator-()

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

interval subtraction

Parameters
otherother interval
Returns
this - other

◆ operator/()

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

interval division

Parameters
otherother interval
Returns
this / other

◆ print()

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

print method for Interval

Returns
string representation of interval

◆ sin()

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

compute interval containing sin(x) for all x in interval

Returns
interval containing sin(x)

◆ tan()

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

compute interval containing tan(x) for all x in interval

Returns
interval containing tan(x)

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

Member Data Documentation

◆ lb

zono_float ZonoOpt::Interval::lb

lower bound

◆ ub

zono_float ZonoOpt::Interval::ub

upper bound


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