Rheolef  7.2
an efficient C++ finite element environment
 
Loading...
Searching...
No Matches
gauss_jacobi_check.icc
Go to the documentation of this file.
1
21#include "rheolef/compiler.h"
22#include <iterator>
23template <class Iterator1, class Iterator2, class Size>
24typename std::iterator_traits<Iterator1>::value_type
25gauss_jacobi_check (Size R, Size p, Size q, Iterator1 zeta, Iterator2 omega,
26 Size Rtilde, Iterator1 x, Iterator2 w, Size order)
27{
28warning_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 }
39warning_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)
Definition sphere.icc:25