ZonoOpt v2.0.1
Loading...
Searching...
No Matches
Public Member Functions | List of all members
ZonoOpt::IntervalBase< Derived > Struct Template Reference

Base class for Interval and IntervalView. More...

#include <Intervals.hpp>

Public Member Functions

zono_floaty_min ()
 Returns reference to interval lower bound.
 
zono_floaty_max ()
 Returns reference to interval upper bound.
 
const zono_floaty_min () const
 Returns const reference to interval lower 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 Derived &x1, const Derived &x2)
 sets interval to x1 + x2
 
void subtract_assign (const Derived &x1, const Derived &x2)
 sets interval to x1 - x2
 
void multiply_assign (const Derived &x1, const Derived &x2)
 sets interval to x1 * x2
 
void multiply_assign (const Derived &x1, zono_float alpha)
 sets interval to alpha * x1
 
void inverse ()
 sets interval to its inverse
 
void divide_assign (const Derived &x1, const Derived &x2)
 sets interval to x1 / x2
 
void intersect_assign (const Derived &x1, const Derived &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 Derived &x)
 compute interval containing sin(x) over x
 
void cos_assign (const Derived &x)
 compute interval containing cos(x) over x
 
void tan_assign (const Derived &x)
 compute interval containing tan(x) over x
 
void arcsin_assign (const Derived &x)
 compute interval containing arcsin(x) over x
 
void arccos_assign (const Derived &x)
 compute interval containing arccos(x) over x
 
void arctan_assign (const Derived &x)
 compute interval containing arctan(x) over x
 
void exp_assign (const Derived &x)
 compute interval containing exp(x) over x
 

Detailed Description

template<typename Derived>
struct ZonoOpt::IntervalBase< Derived >

Base class for Interval and IntervalView.

This class defines the interface for Interval and IntervalView using the CRTP.

Member Function Documentation

◆ add_assign()

template<typename Derived >
void ZonoOpt::IntervalBase< Derived >::add_assign ( const Derived x1,
const Derived x2 
)
inline

sets interval to x1 + x2

Parameters
x1interval
x2interval

◆ arccos_assign()

template<typename Derived >
void ZonoOpt::IntervalBase< Derived >::arccos_assign ( const Derived x)
inline

compute interval containing arccos(x) over x

Parameters
xinput interval

◆ arcsin_assign()

template<typename Derived >
void ZonoOpt::IntervalBase< Derived >::arcsin_assign ( const Derived x)
inline

compute interval containing arcsin(x) over x

Parameters
xinput interval

◆ arctan_assign()

template<typename Derived >
void ZonoOpt::IntervalBase< Derived >::arctan_assign ( const Derived x)
inline

compute interval containing arctan(x) over x

Parameters
xinput interval

◆ contains()

template<typename Derived >
bool ZonoOpt::IntervalBase< Derived >::contains ( zono_float  y) const
inline

checks whether interval contains a value

Parameters
yscalar value
Returns
flag indicating if interval contains y

◆ cos_assign()

template<typename Derived >
void ZonoOpt::IntervalBase< Derived >::cos_assign ( const Derived x)
inline

compute interval containing cos(x) over x

Parameters
xinput interval

◆ divide_assign()

template<typename Derived >
void ZonoOpt::IntervalBase< Derived >::divide_assign ( const Derived x1,
const Derived x2 
)
inline

sets interval to x1 / x2

Parameters
x1interval
x2interval

◆ exp_assign()

template<typename Derived >
void ZonoOpt::IntervalBase< Derived >::exp_assign ( const Derived x)
inline

compute interval containing exp(x) over x

Parameters
xinput interval

◆ intersect_assign()

template<typename Derived >
void ZonoOpt::IntervalBase< Derived >::intersect_assign ( const Derived x1,
const Derived x2 
)
inline

sets interval to intersection of x1 and x2

Parameters
x1interval
x2interval

◆ inverse()

template<typename Derived >
void ZonoOpt::IntervalBase< Derived >::inverse ( )
inline

sets interval to its inverse

◆ is_empty()

template<typename Derived >
bool ZonoOpt::IntervalBase< Derived >::is_empty ( ) const
inline

checks whether interval is empty

Returns
flag indicating if interval is empty

◆ is_single_valued()

template<typename Derived >
bool ZonoOpt::IntervalBase< Derived >::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

◆ multiply_assign() [1/2]

template<typename Derived >
void ZonoOpt::IntervalBase< Derived >::multiply_assign ( const Derived x1,
const Derived x2 
)
inline

sets interval to x1 * x2

Parameters
x1interval
x2interval

◆ multiply_assign() [2/2]

template<typename Derived >
void ZonoOpt::IntervalBase< Derived >::multiply_assign ( const Derived x1,
zono_float  alpha 
)
inline

sets interval to alpha * x1

Parameters
x1interval
alphascalar

◆ set()

template<typename Derived >
void ZonoOpt::IntervalBase< Derived >::set ( const zono_float  min,
const zono_float  max 
)
inline

Sets interval bounds.

Parameters
minlower bound
maxupper bound

◆ sin_assign()

template<typename Derived >
void ZonoOpt::IntervalBase< Derived >::sin_assign ( const Derived x)
inline

compute interval containing sin(x) over x

Parameters
xinput interval

◆ subtract_assign()

template<typename Derived >
void ZonoOpt::IntervalBase< Derived >::subtract_assign ( const Derived x1,
const Derived x2 
)
inline

sets interval to x1 - x2

Parameters
x1interval
x2interval

◆ tan_assign()

template<typename Derived >
void ZonoOpt::IntervalBase< Derived >::tan_assign ( const Derived x)
inline

compute interval containing tan(x) over x

Parameters
xinput interval

◆ width()

template<typename Derived >
zono_float ZonoOpt::IntervalBase< Derived >::width ( ) const
inline

get width of interval (ub - lb)

Returns
interval width

◆ y_max() [1/2]

template<typename Derived >
zono_float & ZonoOpt::IntervalBase< Derived >::y_max ( )
inline

Returns reference to interval upper bound.

Returns
reference to y_max

◆ y_max() [2/2]

template<typename Derived >
const zono_float & ZonoOpt::IntervalBase< Derived >::y_max ( ) const
inline

Returns const reference to interval upper bound.

Returns
reference to y_max

◆ y_min() [1/2]

template<typename Derived >
zono_float & ZonoOpt::IntervalBase< Derived >::y_min ( )
inline

Returns reference to interval lower bound.

Returns
reference to y_min

◆ y_min() [2/2]

template<typename Derived >
const zono_float & ZonoOpt::IntervalBase< Derived >::y_min ( ) const
inline

Returns const reference to interval lower bound.

Returns
reference to y_min

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