11 template<
typename Number>
21 return boost::numeric::median(i.
content());
29 template<
typename Number>
48 template<
typename Number>
57 Number cur = Number(leftnum) / Number(leftden);
62 Int curnum = leftnum + rightnum;
63 Int curden = leftden + rightden;
64 cur = Number(curnum) / Number(curden);
65 if ((cur < i.
lower()) || (!includingBounds && cur == i.
lower())) {
68 }
else if ((cur > i.
upper()) || (!includingBounds && cur == i.
upper())) {
82 template<
typename Number>
97 template<
typename Number>
114 template<
typename Number>
128 template<
typename Number>
carl is the main namespace for the library.
Number sample_infty(const Interval< Number > &i)
Searches for some point in this interval, preferably far aways from zero and with a small representat...
Number sample_left(const Interval< Number > &i)
Searches for some point in this interval, preferably near the left endpoint and with a small represen...
Interval< Number > ceil(const Interval< Number > &_in)
Method which returns the next larger integer of the passed number or the number itself,...
Number sample(const Interval< Number > &i, bool includingBounds=true)
Searches for some point in this interval, preferably near the midpoint and with a small representatio...
Number center(const Interval< Number > &i)
Returns the center point of the interval.
Number sample_zero(const Interval< Number > &i)
Searches for some point in this interval, preferably near zero and with a small representation.
Interval< Number > floor(const Interval< Number > &_in)
Method which returns the next smaller integer of this number or the number itself,...
Number sample_stern_brocot(const Interval< Number > &i, bool includingBounds=true)
Searches for some point in this interval, preferably near the midpoint and with a small representatio...
Number sample_right(const Interval< Number > &i)
Searches for some point in this interval, preferably near the right endpoint and with a small represe...
@ INFTY
the given bound is interpreted as minus or plus infinity depending on whether it is the left or the r...
The class which contains the interval arithmetic including trigonometric functions.
bool is_empty() const
Function which determines, if the interval is empty.
BoundType lower_bound_type() const
The getter for the lower bound type of the interval.
const BoostInterval & content() const
Returns a reference to the included boost interval.
const Number & upper() const
The getter for the upper boundary of the interval.
bool is_semi_positive() const
bool contains(const Number &val) const
Checks if the interval contains the given value.
const Number & lower() const
The getter for the lower boundary of the interval.
bool is_point_interval() const
Function which determines, if the interval is a pointinterval.
bool is_semi_negative() const
bool is_consistent() const
A quick check for the bound values.
BoundType upper_bound_type() const
The getter for the upper bound type of the interval.
bool is_infinite() const
Function which determines, if the interval is (-oo,oo).