jacobi.icc
Go to the documentation of this file.
#include <cstdlib>
namespace rheolef {
template <class T>
class jacobi {
public:
jacobi (size_t R1, T alpha1, T beta1)
: R(R1), alpha(alpha1), beta(beta1) {}
T operator() (T x) const {
if (R == 0) return 1;
T P_prev = 1;
T P = ((alpha+beta+2)*x + alpha - beta)/2;
for (size_t r = 1; r < R; r++) {
T P_save = P;
T a = (beta*beta - alpha*alpha)/((alpha+beta+T(2.*r))*(alpha+beta+T(2.*r+2)));
T b = 2*(alpha+T(1.*r))*(beta+T(1.*r))/((alpha+beta+T(2.*r))*(alpha+beta+T(2.*r+1)));
T c = 2*T(r+1.)*(alpha+beta+T(r+1.))/((alpha+beta+T(2.*r+1))*(alpha+beta+T(2.*r+2)));
P = ((x-a)*P - b*P_prev)/c;
P_prev = P_save;
}
return P;
}
protected:
size_t R;
T alpha, beta;
};
} // namespace rheolef
rheolef::jacobi::jacobi
jacobi(size_t R1, T alpha1, T beta1)
Definition: jacobi.icc:26
mkgeo_ball.c
c
Definition: mkgeo_ball.sh:153
rheolef::jacobi::alpha
T alpha
Definition: jacobi.icc:44
rheolef::jacobi::operator()
T operator()(T x) const
Definition: jacobi.icc:28
rheolef::jacobi::beta
T beta
Definition: jacobi.icc:44
a
Definition: diffusion_isotropic.h:25
rheolef::jacobi::R
size_t R
Definition: jacobi.icc:43
rheolef
This file is part of Rheolef.
Definition: compiler_eigen.h:37
mkgeo_ball.b
b
Definition: mkgeo_ball.sh:152
mkgeo_ball.a
a
Definition: mkgeo_ball.sh:151
rheolef::jacobi
Definition: jacobi.icc:24
T
Expr1::float_type T
Definition: field_expr.h:218