Rheolef  7.2
an efficient C++ finite element environment
gauss_jacobi_check.icc
Go to the documentation of this file.
1 #include "rheolef/compiler.h"
22 #include <iterator>
23 template <class Iterator1, class Iterator2, class Size>
24 typename std::iterator_traits<Iterator1>::value_type
25 gauss_jacobi_check (Size R, Size p, Size q, Iterator1 zeta, Iterator2 omega,
26  Size Rtilde, Iterator1 x, Iterator2 w, Size order)
27 {
28 warning_macro ("gauss_jacobi_check...");
29  typedef typename std::iterator_traits<Iterator1>::value_type T;
30  T error = 0;
31  for (Size k = 0; k <= order; k++) {
32  T exact = 0, value = 0;
33  for (Size s = 0; s < Rtilde; s++)
34  exact += pow (x[s], k)*pow (1-x[s], p)*pow (1+x[s], q)*w[s];
35  for (Size r = 0; r < R; r++)
36  value += pow (zeta[r], k)*omega[r];
37  error = std::max(error, fabs (exact - value));
38  }
39 warning_macro ("gauss_jacobi_check: done : error="<<error);
40  return error;
41 }
#define warning_macro(message)
Definition: dis_macros.h:53
Expr1::float_type T
Definition: field_expr.h:230
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)
space_mult_list< T, M > pow(const space_basic< T, M > &X, size_t n)
Definition: space_mult.h:120
Definition: sphere.icc:25