gauss_legendre_check.icc
Go to the documentation of this file.
#include "rheolef/compiler.h"
#include <iterator>
template <class Iterator1, class Iterator2, class Size>
typename std::iterator_traits<Iterator1>::value_type
gauss_legendre_check (Size R, Iterator1 zeta, Iterator2 omega, Size order) {
typedef typename std::iterator_traits<Iterator1>::value_type T;
T error = 0;
for (Size k = 0; k <= order; k++) {
T value = 0;
for (Size r = 0; r < R; r++) {
value += pow (zeta[r], k)*omega[r];
}
T exact = (k % 2 == 1) ? T(0.) : 2/T(k+1.);
error = std::max (error, fabs (exact - value));
}
typedef typename std::iterator_traits<Iterator1>::value_type T;
return error;
}
T
Expr1::float_type T
Definition: field_expr.h:261
gauss_legendre_check
std::iterator_traits< Iterator1 >::value_type gauss_legendre_check(Size R, Iterator1 zeta, Iterator2 omega, Size order)
Definition: gauss_legendre_check.icc:25
mkgeo_ball.order
order
Definition: mkgeo_ball.sh:343
rheolef::pow
space_mult_list< T, M > pow(const space_basic< T, M > &X, size_t n)
Definition: space_mult.h:120