Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members

Implements a rudimentary interval class. More...

#include <interval.hpp>

Public Member Functions

 Interval ()
 Default constructor. More...
 
 Interval (const double c)
 Constructor for a constant value c More...
 
 Interval (const double l_, const double u_)
 Constructor for a variable that belongs to the interval [l,u]. More...
 
 Interval (const Interval &I)
 Copy constructor. More...
 
BooleanType isCompact () const
 
const double & l () const
 Returns the lower bounding value. More...
 
void l (const double lb)
 Sets the lower bound. More...
 
Intervaloperator*= (const double c)
 
Intervaloperator*= (const Interval &I)
 
Intervaloperator+= (const double c)
 
Intervaloperator+= (const Interval &I)
 
Intervaloperator-= (const double c)
 
Intervaloperator-= (const Interval &I)
 
Intervaloperator/= (const double c)
 
Intervaloperator/= (const Interval &I)
 
Intervaloperator= (const double c)
 
Intervaloperator= (const Interval &I)
 
void print () const
 
const double & u () const
 Returns the upper bounding value. More...
 
void u (const double ub)
 Sets the upper bound. More...
 
 ~Interval ()
 Destructor. More...
 

Private Member Functions

double mid (const double convRel, const double concRel, const double valCut, int &indexMid) const
 
double xlog (const double x) const
 

Private Attributes

double _l
 Lower bound. More...
 
double _u
 Upper bound. More...
 

Friends

double abs (const Interval &)
 
Interval acos (const Interval &)
 
Interval arh (const Interval &, const double)
 
Interval asin (const Interval &)
 
Interval atan (const Interval &)
 
Interval cos (const Interval &)
 
double diam (const Interval &)
 
Interval exp (const Interval &)
 
Interval fabs (const Interval &)
 
Interval hull (const Interval &, const Interval &)
 
bool inter (Interval &, const Interval &, const Interval &)
 
Interval inv (const Interval &)
 
Interval log (const Interval &)
 
Interval max (const Interval &, const Interval &)
 
Interval max (const unsigned int, const Interval *)
 
double mid (const Interval &)
 
double mid (const double, const double, const double, int &)
 
Interval min (const Interval &, const Interval &)
 
Interval min (const unsigned int, const Interval *)
 
bool operator!= (const Interval &, const Interval &)
 
Interval operator* (const Interval &, const Interval &)
 
Interval operator* (const Interval &, const double)
 
Interval operator* (const double, const Interval &)
 
Interval operator+ (const Interval &)
 
Interval operator+ (const Interval &, const Interval &)
 
Interval operator+ (const double, const Interval &)
 
Interval operator+ (const Interval &, const double)
 
Interval operator- (const Interval &)
 
Interval operator- (const Interval &, const Interval &)
 
Interval operator- (const double, const Interval &)
 
Interval operator- (const Interval &, const double)
 
Interval operator/ (const Interval &, const Interval &)
 
Interval operator/ (const Interval &, const double)
 
Interval operator/ (const double, const Interval &)
 
bool operator< (const Interval &, const Interval &)
 
std::ostream & operator<< (std::ostream &, const Interval &)
 
bool operator<= (const Interval &, const Interval &)
 
bool operator== (const Interval &, const Interval &)
 
bool operator> (const Interval &, const Interval &)
 
bool operator>= (const Interval &, const Interval &)
 
Interval pow (const Interval &, const int)
 
Interval pow (const Interval &, const double)
 
Interval pow (const Interval &, const Interval &)
 
Interval sin (const Interval &)
 
Interval sqr (const Interval &)
 
Interval sqrt (const Interval &)
 
Interval tan (const Interval &)
 
Interval xlog (const Interval &)
 

Detailed Description

Implements a rudimentary interval class.

Interval is a C++ class for calculating the natural interval
extension of a factorable function on a box.

Example Code:

Definition at line 67 of file interval.hpp.

Constructor & Destructor Documentation

Interval::Interval ( )
inline

Default constructor.

Definition at line 138 of file interval.hpp.

Interval::Interval ( const double  c)
inline

Constructor for a constant value c

Definition at line 141 of file interval.hpp.

Interval::Interval ( const double  l_,
const double  u_ 
)
inline

Constructor for a variable that belongs to the interval [l,u].

Definition at line 144 of file interval.hpp.

Interval::Interval ( const Interval I)
inline

Copy constructor.

Definition at line 147 of file interval.hpp.

Interval::~Interval ( )
inline

Destructor.

Definition at line 150 of file interval.hpp.

Member Function Documentation

BEGIN_NAMESPACE_ACADO BooleanType Interval::isCompact ( ) const

Routine which returns BT_FALSE if the lower or upper bounds is equal to "nan" or "INFTY".
Otherwise, BT_TRUE is returned.

Definition at line 41 of file interval.cpp.

const double& Interval::l ( ) const
inline

Returns the lower bounding value.

Definition at line 153 of file interval.hpp.

void Interval::l ( const double  lb)
inline

Sets the lower bound.

Definition at line 159 of file interval.hpp.

double Interval::mid ( const double  convRel,
const double  concRel,
const double  valCut,
int &  indexMid 
) const
private

Definition at line 55 of file interval.cpp.

Interval& Interval::operator*= ( const double  c)
inline

Definition at line 131 of file interval.hpp.

Interval& Interval::operator*= ( const Interval I)
inline

Definition at line 133 of file interval.hpp.

Interval& Interval::operator+= ( const double  c)
inline

Definition at line 127 of file interval.hpp.

Interval& Interval::operator+= ( const Interval I)
inline

Definition at line 128 of file interval.hpp.

Interval& Interval::operator-= ( const double  c)
inline

Definition at line 129 of file interval.hpp.

Interval& Interval::operator-= ( const Interval I)
inline

Definition at line 130 of file interval.hpp.

Interval& Interval::operator/= ( const double  c)
inline

Definition at line 134 of file interval.hpp.

Interval& Interval::operator/= ( const Interval I)
inline

Definition at line 135 of file interval.hpp.

Interval& Interval::operator= ( const double  c)
inline

Definition at line 125 of file interval.hpp.

Interval& Interval::operator= ( const Interval I)
inline

Definition at line 126 of file interval.hpp.

void Interval::print ( ) const
inline

Definition at line 165 of file interval.hpp.

const double& Interval::u ( ) const
inline

Returns the upper bounding value.

Definition at line 156 of file interval.hpp.

void Interval::u ( const double  ub)
inline

Sets the upper bound.

Definition at line 162 of file interval.hpp.

double Interval::xlog ( const double  x) const
inlineprivate

Definition at line 175 of file interval.hpp.

Friends And Related Function Documentation

double abs ( const Interval )
friend
Interval acos ( const Interval )
friend
Interval arh ( const Interval ,
const double   
)
friend
Interval asin ( const Interval )
friend
Interval atan ( const Interval )
friend
Interval cos ( const Interval )
friend
double diam ( const Interval )
friend
Interval exp ( const Interval )
friend
Interval fabs ( const Interval )
friend
Interval hull ( const Interval ,
const Interval  
)
friend
bool inter ( Interval ,
const Interval ,
const Interval  
)
friend
Interval inv ( const Interval )
friend
Interval log ( const Interval )
friend
Interval max ( const Interval ,
const Interval  
)
friend
Interval max ( const unsigned  int,
const Interval  
)
friend
double mid ( const Interval )
friend
double mid ( const double  ,
const double  ,
const double  ,
int &   
)
friend
Interval min ( const Interval ,
const Interval  
)
friend
Interval min ( const unsigned  int,
const Interval  
)
friend
bool operator!= ( const Interval ,
const Interval  
)
friend
Interval operator* ( const Interval ,
const Interval  
)
friend
Interval operator* ( const Interval ,
const double   
)
friend
Interval operator* ( const double  ,
const Interval  
)
friend
Interval operator+ ( const Interval )
friend
Interval operator+ ( const Interval ,
const Interval  
)
friend
Interval operator+ ( const double  ,
const Interval  
)
friend
Interval operator+ ( const Interval ,
const double   
)
friend
Interval operator- ( const Interval )
friend
Interval operator- ( const Interval ,
const Interval  
)
friend
Interval operator- ( const double  ,
const Interval  
)
friend
Interval operator- ( const Interval ,
const double   
)
friend
Interval operator/ ( const Interval ,
const Interval  
)
friend
Interval operator/ ( const Interval ,
const double   
)
friend
Interval operator/ ( const double  ,
const Interval  
)
friend
bool operator< ( const Interval ,
const Interval  
)
friend
std::ostream& operator<< ( std::ostream &  ,
const Interval  
)
friend
bool operator<= ( const Interval ,
const Interval  
)
friend
bool operator== ( const Interval ,
const Interval  
)
friend
bool operator> ( const Interval ,
const Interval  
)
friend
bool operator>= ( const Interval ,
const Interval  
)
friend
Interval pow ( const Interval ,
const int   
)
friend
Interval pow ( const Interval ,
const double   
)
friend
Interval pow ( const Interval ,
const Interval  
)
friend
Interval sin ( const Interval )
friend
Interval sqr ( const Interval )
friend
Interval sqrt ( const Interval )
friend
Interval tan ( const Interval )
friend
Interval xlog ( const Interval )
friend

Member Data Documentation

double Interval::_l
private

Lower bound.

Definition at line 178 of file interval.hpp.

double Interval::_u
private

Upper bound.

Definition at line 180 of file interval.hpp.


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


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Mon Jun 10 2019 12:35:25