Boost.Real  1.0.0
Boost.Real numerical data type for real numbers representation using range arithmetic.
boost::real::interval Struct Reference

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. More...

#include <interval.hpp>

Collaboration diagram for boost::real::interval:

Public Member Functions

 interval ()=default
 default constructor: It construct a representation of the interval [0,0].
 
std::string as_string () const
 Generates a string representation of the boost::real::interval. The string represent the interval with the format [lower boundary, upper boundary]. More...
 
void swap_bounds ()
 Swaps the lower boundary with the upper boundary. After this method is called the boost::real::interval boundaries are swaped.
 
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 the interval arithmetic. *this is lower than other if and only if the upper boundary of this is lower than the lower boundary of other. More...
 
bool operator> (const boost::real::interval &other) const
 Compares two boost::real::interval to determine if *this is a greater interval than other according to the interval arithmetic. *this is greater than other if and only if the lower boundary of this is greater than the upper boundary of other. More...
 
bool positive () const
 Determine if the interval is fully contained in the positive real number line. More...
 
bool negative () const
 Determine if the interval is fully contained in the negative real number line. More...
 
bool operator== (const boost::real::interval &other) const
 Equality comparator. Determines if *this is equal or not to other. More...
 
bool is_a_number () const
 Determines if the interval represent a single number. i.e. the lower and upper boundaries are equals. More...
 

Public Attributes

boost::real::boundary lower_bound
 
boost::real::boundary upper_bound
 

Detailed Description

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.

Author
Laouen Mayal Louan Belloli

Member Function Documentation

std::string boost::real::interval::as_string ( ) const
inline

Generates a string representation of the boost::real::interval. The string represent the interval with the format [lower boundary, upper boundary].

Returns
a string that represent the state of the boost::real::interval.
bool boost::real::interval::is_a_number ( ) const
inline

Determines if the interval represent a single number. i.e. the lower and upper boundaries are equals.

Returns
a bool that is true if and only if the interval represent a single number.
bool boost::real::interval::negative ( ) const
inline

Determine if the interval is fully contained in the negative real number line.

Returns
a bool that is true if and only if both boundaries are negatives.
bool boost::real::interval::operator< ( const boost::real::interval other) const
inline

Compares two boost::real::interval to determine if *this is a lower interval than other according to the interval arithmetic. *this is lower than other if and only if the upper boundary of this is lower than the lower boundary of other.

Parameters
other- a boost::real::interval to compare with *this.
Returns
a bool that is true if and only if *this is lower than other.
bool boost::real::interval::operator== ( const boost::real::interval other) const
inline

Equality comparator. Determines if *this is equal or not to other.

Parameters
other- a boost::real::interval to compare to *this.
Returns
a bool that is true if and only if *this and equal boundaries are equals.
bool boost::real::interval::operator> ( const boost::real::interval other) const
inline

Compares two boost::real::interval to determine if *this is a greater interval than other according to the interval arithmetic. *this is greater than other if and only if the lower boundary of this is greater than the upper boundary of other.

Parameters
other- a boost::real::interval to compare with *this.
Returns
a bool that is true if and only if *this is greater than other.
bool boost::real::interval::positive ( ) const
inline

Determine if the interval is fully contained in the positive real number line.

Returns
a bool that is true if and only if both boundaries are positives.

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