Loading...
Searching...
No Matches
gauss_chebyschev_check.icc
Go to the documentation of this file.
#include "rheolef/compiler.h"
#include "rheolef/gauss_chebyschev.h"
#include <iterator>
template <class Iterator1, class Iterator2, class Size>
typename std::iterator_traits<Iterator1>::value_type
gauss_chebyschev_check (Size R, Iterator1 zeta, Iterator2 omega,
Size R_e, Iterator1 zeta_e, Iterator2 omega_e,
Size order) {
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 r = 0; r < R_e; r++)
exact += pow (zeta_e[r], k)*omega_e[r];
for (Size r = 0; r < R; r++)
value += pow (zeta[r], k)*omega[r];
error = std::max(error, fabs (exact - value));
}
return error;
}
T
Expr1::float_type T
Definition field_expr.h:230
gauss_chebyschev_check
std::iterator_traits< Iterator1 >::value_type gauss_chebyschev_check(Size R, Iterator1 zeta, Iterator2 omega, Size R_e, Iterator1 zeta_e, Iterator2 omega_e, Size order)
Definition gauss_chebyschev_check.icc:26