1 #ifndef mmx_interval_hpp
2 #define mmx_interval_hpp
43 template<
class T,
int r = 3 >
77 void define(
const T& m,
const T& M ) { this->m = m; this->M = M; };
78 void assign(
const T& m,
const T& M ) { define(m,M); };
82 template<
class X>
bool operator==(
const X& k)
const {
return m == M && M == k ; };
84 {
return b.
m == m && b.
M == M ; };
86 template<
class X>
inline bool operator>(
const X& x )
const {
return m > x; };
88 template<
class X>
inline bool operator>=(
const X& x )
const {
return m >= x; };
90 template<
class X>
inline bool operator<(
const X& x )
const {
return M < x; };
92 template<
class X>
inline bool operator<=(
const X& x )
const {
return M <= x; };
94 template<
class X>
inline bool operator!=(
const X& x )
const {
return !(*
this == x); };
95 template<
class X,
int _r>
bool operator<( const Interval<X,_r>& i )
const {
return M < i.m; };
98 const T&
lower()
const {
return m; };
99 const T&
upper()
const {
return M; };
108 template<
class X,
int R>
134 template<
class OSTREAM,
class T,
int r>
inline void
139 template<
class T,
int r>
140 void hull( Interval<T,r>& v,
const Interval<T,r>& a,
const Interval<T,r>&
b );
141 template<
class T,
int r>
inline
143 const Interval<T,r>& a,
const Interval<T,r>&
b );
159 template<
class X,
class Y,
int r0,
int r1>
inline void
167 template<
class C,
int R>
168 template<
class X>
inline
175 template<
class C,
int R>
176 template<
class X>
inline
179 std::cout<<
"assign "<<x<<std::endl;
183 template<
class C,
int mode>
184 template<
class X,
int R>
192 template<
class A,
class B>
void assign(A& a,
const B&
b);
194 template<
class C,
class T>
inline void
Interval()
default constructor sets values to zero
Definition: Interval_fcts.hpp:72
Definition: Interval.hpp:40
void add(double &a, double b, double c)
Definition: texp_double.hpp:4
Interval & operator+=(const Interval &x)
Definition: Interval.hpp:119
Interval & operator/=(const Interval &x)
Definition: Interval.hpp:122
Definition: Interval_fcts.hpp:23
const C & b
Definition: Interval_glue.hpp:25
void div(double &a, double b, double c)
Definition: texp_double.hpp:7
TMPL X
Definition: polynomial_operators.hpp:148
Definition: Interval.hpp:51
structure defining a the empty list
Definition: texp_bool.hpp:11
void assign(const Interval &b)
Definition: Interval.hpp:79
void define(const T &m, const T &M)
Definition: Interval.hpp:77
bool operator<(const X &x) const
comparison with scalar value (<)
Definition: Interval.hpp:90
const T & upper() const
Definition: Interval.hpp:99
void sub(double &a, double b, double c)
Definition: texp_double.hpp:5
MP swap(const MP &P, int var_i, int var_j)
Definition: sparse_monomials.hpp:988
T upper(const Interval< T, r > &x)
Definition: Interval_fcts.hpp:89
bool operator>=(const X &x) const
comparison with scalar value (>=)
Definition: Interval.hpp:88
base_t::rnd rnd_t
Definition: Interval.hpp:49
kernelof< X >::T T
Definition: Interval.hpp:154
bool intersect(Interval< T, r > &result, const Interval< T, r > &a, const Interval< T, r > &b)
Definition: Interval_fcts.hpp:150
T value_type
Definition: Interval.hpp:45
T & inf()
Definition: Interval.hpp:104
Interval & operator-=(const Interval &x)
Definition: Interval.hpp:120
void mul(double &a, double b, double c)
Definition: texp_double.hpp:6
const T & sup() const
Definition: Interval.hpp:103
bool operator>(const X &x) const
comparison with scalar value (>)
Definition: Interval.hpp:86
Definition: rounding_mode.hpp:71
const T & lower() const
Definition: Interval.hpp:98
const T & inf() const
Definition: Interval.hpp:102
T boundary_type
Definition: Interval.hpp:47
void assign(const T &m, const T &M)
Definition: Interval.hpp:78
void hull(Interval< T, r > &v, const Interval< T, r > &a, const Interval< T, r > &b)
Definition: Interval_fcts.hpp:120
Definition: texp_expression.hpp:67
T coeff_t
Definition: Interval.hpp:46
Interval & operator=(const T &x)
Definition: Interval.hpp:107
T & sup()
Definition: Interval.hpp:105
#define Interval
Definition: Interval_glue.hpp:8
T lower(const Interval< T, r > &x)
Definition: Interval_fcts.hpp:87
T & upper()
Definition: Interval.hpp:101
T size() const
same as width
Definition: Interval.hpp:127
T width(const Interval< T, r > &x)
Definition: Interval_fcts.hpp:93
Interval & operator*=(const Interval &x)
Definition: Interval.hpp:121
numerics::interval_base< T,((unsigned) r)%4 > base_t
Definition: Interval.hpp:48
Generic class for intervals.
Definition: Interval.hpp:44
T m
Definition: Interval.hpp:52
const C & c
Definition: Interval_glue.hpp:45
bool operator!=(const X &x) const
comparison with scalar value (!=)
Definition: Interval.hpp:94
double C
Definition: solver_mv_fatarcs.cpp:16
bool operator>(const Interval< X, _r > &i) const
Definition: Interval.hpp:96
extended(const T &c, const T &d)
Definition: Interval.hpp:51
bool operator==(const X &k) const
true if the lower and upper bounds equals to k
Definition: Interval.hpp:82
void assign(A &a, const B &b)
Generic definition of the assignement function.
Definition: assign.hpp:97
Interval & operator=(const Interval &i)
Definition: Interval.hpp:67
T & lower()
Definition: Interval.hpp:100
bool operator==(const Interval< X, r_ > &b) const
Definition: Interval.hpp:83
T center() const
return the center of the interval
Definition: Interval.hpp:130
Interval< T, r > self_t
Definition: Interval.hpp:50
return the arithmetic kernel from which the unqualified type X comes from.
Definition: GMP.hpp:50
T width() const
return the width of the interval
Definition: Interval.hpp:125
bool operator<=(const X &x) const
comparison with scalar value (<=)
Definition: Interval.hpp:92
std::ostream & print(std::ostream &o)
Definition: texp_demangle.hpp:16
T M
Definition: Interval.hpp:52