Implements a rudimentary interval class. More...
#include <interval.hpp>
Public Member Functions | |
| Interval () | |
| Default constructor. | |
| Interval (const double c) | |
| Constructor for a constant value c | |
| Interval (const double l_, const double u_) | |
| Constructor for a variable that belongs to the interval [l,u]. | |
| Interval (const Interval &I) | |
| Copy constructor. | |
| BooleanType | isCompact () const |
| const double & | l () const |
| Returns the lower bounding value. | |
| void | l (const double lb) |
| Sets the lower bound. | |
| Interval & | operator*= (const double c) |
| Interval & | operator*= (const Interval &I) |
| Interval & | operator+= (const double c) |
| Interval & | operator+= (const Interval &I) |
| Interval & | operator-= (const double c) |
| Interval & | operator-= (const Interval &I) |
| Interval & | operator/= (const double c) |
| Interval & | operator/= (const Interval &I) |
| Interval & | operator= (const double c) |
| Interval & | operator= (const Interval &I) |
| void | print () const |
| const double & | u () const |
| Returns the upper bounding value. | |
| void | u (const double ub) |
| Sets the upper bound. | |
| ~Interval () | |
| Destructor. | |
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. | |
| double | _u |
| Upper bound. | |
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 &) |
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:
Interval X(-1,1); // An interval X = [-1,1].
Interval Y( 1,2); // An interval Y = y[1,2].
Interval Z = X + X*Y; // An interval Z that contains
// the set { x + x*y | x in X, y in Y };
Z.print(); // display the result.
Definition at line 67 of file interval.hpp.
| 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.
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.
Definition at line 133 of file interval.hpp.
| Interval& Interval::operator+= | ( | const double | c | ) | [inline] |
Definition at line 127 of file interval.hpp.
Definition at line 128 of file interval.hpp.
| Interval& Interval::operator-= | ( | const double | c | ) | [inline] |
Definition at line 129 of file interval.hpp.
Definition at line 130 of file interval.hpp.
| Interval& Interval::operator/= | ( | const double | c | ) | [inline] |
Definition at line 134 of file interval.hpp.
Definition at line 135 of file interval.hpp.
| Interval& Interval::operator= | ( | const double | c | ) | [inline] |
Definition at line 125 of file interval.hpp.
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 [inline, private] |
Definition at line 175 of file interval.hpp.
| double mid | ( | const double | , |
| const double | , | ||
| const double | , | ||
| int & | |||
| ) | [friend] |
| std::ostream& operator<< | ( | std::ostream & | , |
| const Interval & | |||
| ) | [friend] |
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.