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

IntervalView class. More...

#include <Intervals.hpp>

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

Public Member Functions

 IntervalView (zono_float *y_min, zono_float *y_max)
 constructor for IntervalView
 
template<typename Derived >
IntervalViewoperator= (const IntervalBase< Derived > &other)
 Assignment operator.
 
Interval to_interval () const
 convert to Interval class
 
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
 
- Public Member Functions inherited from ZonoOpt::IntervalBase< IntervalView >
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 IntervalView &x1, const IntervalView &x2)
 sets interval to x1 + x2
 
void subtract_assign (const IntervalView &x1, const IntervalView &x2)
 sets interval to x1 - x2
 
void multiply_assign (const IntervalView &x1, const IntervalView &x2)
 sets interval to x1 * x2
 
void multiply_assign (const IntervalView &x1, zono_float alpha)
 sets interval to alpha * x1
 
void inverse ()
 sets interval to its inverse
 
void divide_assign (const IntervalView &x1, const IntervalView &x2)
 sets interval to x1 / x2
 
void intersect_assign (const IntervalView &x1, const IntervalView &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 IntervalView &x)
 compute interval containing sin(x) over x
 
void cos_assign (const IntervalView &x)
 compute interval containing cos(x) over x
 
void tan_assign (const IntervalView &x)
 compute interval containing tan(x) over x
 
void arcsin_assign (const IntervalView &x)
 compute interval containing arcsin(x) over x
 
void arccos_assign (const IntervalView &x)
 compute interval containing arccos(x) over x
 
void arctan_assign (const IntervalView &x)
 compute interval containing arctan(x) over x
 
void exp_assign (const IntervalView &x)
 compute interval containing exp(x) over x
 

Public Attributes

zono_floatlb_ptr = nullptr
 pointer to lower bound
 
zono_floatub_ptr = nullptr
 pointer to upper bound
 

Detailed Description

IntervalView class.

Implements interface from IntervalBase. This class does not own its lower and upper bounds.

Constructor & Destructor Documentation

◆ IntervalView()

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

constructor for IntervalView

Parameters
y_minlower bound pointer
y_maxupper bound pointer

Member Function Documentation

◆ get_y_max() [1/2]

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

get reference to upper bound

Returns
reference to upper bound

◆ get_y_max() [2/2]

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

get const reference to upper bound

Returns
reference to upper bound

◆ get_y_min() [1/2]

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

get reference to lower bound

Returns
reference to lower bound

◆ get_y_min() [2/2]

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

get const reference to lower bound

Returns
reference to lower bound

◆ operator=()

Assignment operator.

Template Parameters
Derivedeither Interval or IntervalView
Parameters
otherother interval
Returns
this = other

◆ to_interval()

Interval ZonoOpt::IntervalView::to_interval ( ) const
inline

convert to Interval class

Returns
interval as Interval

Member Data Documentation

◆ lb_ptr

zono_float* ZonoOpt::IntervalView::lb_ptr = nullptr

pointer to lower bound

◆ ub_ptr

zono_float* ZonoOpt::IntervalView::ub_ptr = nullptr

pointer to upper bound


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