1 #ifndef realroot_polynom_operators_hpp
2 #define realroot_polynom_operators_hpp
8 # define TMPL template <class C, class Rep, class Ord>
9 # define TMPLX template <class C, class Rep, class Ord, class X>
10 # define VARIANT with<Rep,Ord>
11 # define POLYNOMIAL polynomial<C,VARIANT>
18 add (r.rep (), a.rep () );
22 add (r.rep (), a.rep (), b.rep ());
26 add (r.rep (), a.rep (),
b);
30 add (r.rep(), b.rep(), a);
34 sub (r.rep (), a.rep () );
38 sub (r.rep (), a.rep (), b.rep ());
42 sub (r.rep (), a, b.rep ());
46 sub (r.rep (), a.rep (),
b);
50 mul (r.rep (), a.rep () );
54 mul (r.rep (), a.rep (), b.rep ());
58 mul (r.rep (), a.rep (),
b);
62 mul (r.rep (), b.rep (), a);
66 div (r.rep (), a.rep (), b.rep ());
70 div (r.rep (), a.rep (),
b);
74 rem (r.rep (), b.rep (), a.rep);
81 add (r.rep (), a.rep () );
85 add (r.rep (), a.rep (), b.rep ());
89 add (r.rep (), a.rep (),
b);
93 add (r.rep(), b.rep(), a);
97 sub (r.rep (), a.rep () );
101 sub (r.rep (), a.rep (), b.rep ());
105 sub (r.rep (), a, b.rep ());
109 sub (r.rep (), a.rep (),
b);
113 mul (r.rep (), a.rep () );
117 mul (r.rep (), a.rep (), b.rep ());
121 mul (r.rep (), a.rep (),
b); }
124 mul (r.rep (), b.rep (), a);
128 div (r.rep (), a.rep (), b.rep ());
132 div (r.rep (), a.rep (),
b);
136 rem (r.rep (), b.rep (), a.rep);
142 POLYNOMIAL r(p);
mul(r.rep(),(
typename POLYNOMIAL::value_type)(-1));
return r;
146 # define OP use<operators_of,typename POLYNOMIAL::rep_t>
166 operator^(
const POLYNOMIAL &a,
unsigned n) {
172 return mp.rep() ==
c;
177 return mp.rep() == (
C)n;
181 template<
class C,
class V,
class X>
bool operator==(const extended< NT > &lhs, const extended< NT > &rhs)
Definition: extended.hpp:88
TMPL void rem(POLYNOMIAL &r, const POLYNOMIAL &a, const POLYNOMIAL &b)
Definition: polynomial_operators.hpp:73
T pow(const T &a, int i)
Definition: binomials.hpp:12
const C & b
Definition: Interval_glue.hpp:25
TMPL X
Definition: polynomial_operators.hpp:148
#define TMPL
Definition: polynomial_operators.hpp:8
static void mul(POLYNOMIAL &r, const C &a, const POLYNOMIAL &b)
Definition: polynomial_operators.hpp:123
static void sub(POLYNOMIAL &r, const POLYNOMIAL &a, const POLYNOMIAL &b)
Definition: polynomial_operators.hpp:100
static void sub(POLYNOMIAL &r, const C &a, const POLYNOMIAL &b)
Definition: polynomial_operators.hpp:104
static void add(POLYNOMIAL &r, const POLYNOMIAL &a, const C &b)
Definition: polynomial_operators.hpp:88
extended< NT > operator-(const extended< NT > &lhs, const extended< NT > &rhs)
Definition: extended.hpp:132
static void mul(POLYNOMIAL &r, const POLYNOMIAL &a)
Definition: polynomial_operators.hpp:112
#define define_operator_r_r(parm0, parm1, parm2, opname, function)
Definition: shared_object.hpp:37
static void add(POLYNOMIAL &r, const POLYNOMIAL &a, const POLYNOMIAL &b)
Definition: polynomial_operators.hpp:84
void mul(Interval< C, r > &a, const C &x)
Definition: Interval_fcts.hpp:259
#define TMPLX
Definition: polynomial_operators.hpp:9
static void sub(POLYNOMIAL &r, const POLYNOMIAL &a)
Definition: polynomial_operators.hpp:96
static void div(POLYNOMIAL &r, const POLYNOMIAL &a, const POLYNOMIAL &b)
Definition: polynomial_operators.hpp:127
static void div(POLYNOMIAL &r, const POLYNOMIAL &a, const C &b)
Definition: polynomial_operators.hpp:131
TMPL void add(POLYNOMIAL &r, const C &a, const POLYNOMIAL &b)
Definition: polynomial_operators.hpp:29
void sub(Interval< C, r > &a, const C &x)
Definition: Interval_fcts.hpp:231
Definition: polynomial.hpp:34
static void sub(POLYNOMIAL &r, const POLYNOMIAL &a, const C &b)
Definition: polynomial_operators.hpp:108
TMPL POLYNOMIAL
Definition: polynomial_operators.hpp:148
Definition: polynomial.hpp:37
#define OP
Definition: polynomial_operators.hpp:146
static void mul(POLYNOMIAL &r, const POLYNOMIAL &a, const C &b)
Definition: polynomial_operators.hpp:120
#define define_operator_rr_(parm0, parm1, parm2, opname, function)
Definition: shared_object.hpp:32
static void rem(POLYNOMIAL &r, const POLYNOMIAL &a, const POLYNOMIAL &b)
Definition: polynomial_operators.hpp:135
TMPL define_operator_rrr(DUALPOL, POL, DUALPOL, operator*, sparse::mul) TMPL define_operator_rrr(POL
const C & c
Definition: Interval_glue.hpp:45
Definition: polynomial_operators.hpp:77
double C
Definition: solver_mv_fatarcs.cpp:16
bool operator!=(const extended< NT > &lhs, const extended< NT > &rhs)
Definition: extended.hpp:95
static void add(POLYNOMIAL &r, const POLYNOMIAL &a)
Definition: polynomial_operators.hpp:80
static void mul(POLYNOMIAL &r, const POLYNOMIAL &a, const POLYNOMIAL &b)
Definition: polynomial_operators.hpp:116
void div(Interval< C, r > &a, const C &x)
Definition: Interval_fcts.hpp:430
void add(dynamic_exp< E > &r, const dynamic_exp< E > &A, const dynamic_exp< E > &B)
Definition: dynamicexp.hpp:295
static void add(POLYNOMIAL &r, const C &a, const POLYNOMIAL &b)
Definition: polynomial_operators.hpp:92