1 #ifndef BOOST_REAL_INTERVAL_HPP 2 #define BOOST_REAL_INTERVAL_HPP 6 #include <real/boundary.hpp> 7 #include <real/boundary_helper.hpp> 35 std::string result =
"";
36 std::string lb = this->lower_bound.
as_string();
37 std::string ub = this->upper_bound.
as_string();
42 result =
'[' + lb +
", " + ub +
']';
53 this->lower_bound.
swap(this->upper_bound);
65 return this->upper_bound < other.lower_bound;
77 return this->lower_bound > other.upper_bound;
88 return this->lower_bound.positive;
99 return !this->upper_bound.positive;
109 return this->lower_bound == other.lower_bound && this->upper_bound == other.upper_bound;
119 return this->lower_bound == this->upper_bound;
129 #endif //BOOST_REAL_INTERVAL_HPP bool operator<(const boost::real::interval &other) const
Compares two boost::real::interval to determine if *this is a lower interval than other according to ...
Definition: interval.hpp:64
bool is_a_number() const
Determines if the interval represent a single number. i.e. the lower and upper boundaries are equals...
Definition: interval.hpp:118
Definition: boundary.hpp:7
std::string as_string() const
Generates a string representation of the boost::real::interval. The string represent the interval wit...
Definition: interval.hpp:33
interval()=default
default constructor: It construct a representation of the interval [0,0].
std::basic_string< char > as_string() const
Generates a string representation of the boost::real::boundary.
Definition: boundary.hpp:114
Represent an interval composed by two boundaries, a lower boundary and an upper boundary. The boundaries are boost::real::boundary structs that represent fully represented numbers.
Definition: interval.hpp:18
bool positive() const
Determine if the interval is fully contained in the positive real number line.
Definition: interval.hpp:85
void swap(boundary &other)
Swaps the boost::real::boundary value with the value of the other boost::real::boundary. This operation is a more preformant form of swapping to boost::real::boundaries.
Definition: boundary.hpp:174
bool negative() const
Determine if the interval is fully contained in the negative real number line.
Definition: interval.hpp:96
bool operator==(const boost::real::interval &other) const
Equality comparator. Determines if *this is equal or not to other.
Definition: interval.hpp:108
bool operator>(const boost::real::interval &other) const
Compares two boost::real::interval to determine if *this is a greater interval than other according t...
Definition: interval.hpp:76
Explicitly represents a number as a vector of digits with a sign and an exponent. ...
Definition: boundary.hpp:15
void swap_bounds()
Swaps the lower boundary with the upper boundary. After this method is called the boost::real::interv...
Definition: interval.hpp:52