6 #ifndef realroot_bernstein_univariate_hpp
7 #define realroot_bernstein_univariate_hpp
9 namespace mmx {
namespace bernstein {
12 template<
class VECTOR1,
class VECTOR2>
13 void diff(VECTOR1& res,
const VECTOR2& pol) {
14 res.resize(pol.size()-1);
15 for(
int i=0; i< pol.size()-1;i++)
16 res[i] = pol[i+1]-pol[i];
19 template<
class VECTOR,
class C>
20 C eval(
const VECTOR& pol,
const C& U,
const C& V,
const C& x) {
22 unsigned sz= pol.size();
23 if(sz==0)
return (
C)0;
27 for (
unsigned i=0; i < sz; i++ ) p[i]=pol[i];
29 for (
unsigned r = (sz-1); r != 0; r--)
30 for (
unsigned i=0; i < r; i++ )
31 p[i] = (1.0-t)*p[i]+t*(p[i+1]);
36 #endif //realroot_bernstein_univariate_hpp
C eval(const VECTOR &pol, const C &U, const C &V, const C &x)
Definition: bernstein_univariate.hpp:20
void diff(VECTOR1 &res, const VECTOR2 &pol)
Definition: bernstein_univariate.hpp:13
double C
Definition: solver_mv_fatarcs.cpp:16