6 #ifndef realroot_SOLVE_SBDSLV_LOOPS_UPOLDSE_HPP
7 #define realroot_SOLVE_SBDSLV_LOOPS_UPOLDSE_HPP
13 template<
typename real_t>
inline
14 void diff( real_t * dst, real_t
const *
const src,
unsigned sz,
int st )
16 for (
unsigned i = 0; i < sz-1; dst[i*st] = (i+1)*src[(i+1)*st], i ++ ) ;
18 template<
typename coeff_t,
typename parm_t>
inline
19 void horner( parm_t& res, coeff_t
const *
const mnms,
unsigned sz,
const parm_t& t,
int st = 1 )
22 for (
int p = (sz-1)*st; p != 0; res += mnms[p], res *= t, p -= st ) ;
25 template<
typename real_t>
inline
26 real_t
horner( real_t
const *
const mnms,
unsigned sz,
const real_t& t,
int st = 1 )
32 template<
typename real_t>
inline
33 void dhorner( real_t& p, real_t& dp, real_t
const *
const mnms,
unsigned sz,
const real_t& t )
36 p = mnms[n], dp = 0.0;
37 for (
int j = n-1; j>=0; dp=dp*t+p, p=p*t+mnms[j], j-- ) ;
void diff(real_t *dst, real_t const *const src, unsigned sz, int st)
Definition: loops_upoldse.hpp:14
void horner(parm_t &res, coeff_t const *const mnms, unsigned sz, const parm_t &t, int st=1)
Definition: loops_upoldse.hpp:19
void dhorner(real_t &p, real_t &dp, real_t const *const mnms, unsigned sz, const real_t &t)
Definition: loops_upoldse.hpp:33