gauss_jacobi_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_jacobi_check (Size R, Size p, Size q, Iterator1 zeta, Iterator2 omega,
Size Rtilde, Iterator1 x, Iterator2 w, Size order)
{
warning_macro ("gauss_jacobi_check...");
typedef typename std::iterator_traits<Iterator1>::value_type T;
T error = 0;
for (Size k = 0; k <= order; k++) {
T exact = 0, value = 0;
for (Size s = 0; s < Rtilde; s++)
exact += pow (x[s], k)*pow (1-x[s], p)*pow (1+x[s], q)*w[s];
for (Size r = 0; r < R; r++)
value += pow (zeta[r], k)*omega[r];
error = std::max(error, fabs (exact - value));
}
warning_macro ("gauss_jacobi_check: done : error="<<error);
return error;
}
warning_macro
#define warning_macro(message)
Definition: dis_macros.h:53
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
p
Definition: sphere.icc:25
gauss_jacobi_check
std::iterator_traits< Iterator1 >::value_type gauss_jacobi_check(Size R, Size p, Size q, Iterator1 zeta, Iterator2 omega, Size Rtilde, Iterator1 x, Iterator2 w, Size order)
Definition: gauss_jacobi_check.icc:25
T
Expr1::float_type T
Definition: field_expr.h:218