LORENE
jacobi.C
1
namespace
Lorene
{
2
3
double
* jacobi(
int
n,
double
x) {
4
5
int
i ;
6
double
* J =
new
double
[n+1] ;
7
8
if
(n==0) {
9
10
J[0] = double(1) ;
11
}
12
else
{
13
14
J[0] = double(1) ;
15
J[1] = double(2) * x - 1 ;
16
for
( i = 2 ; i < n+1 ; i++) {
17
double
l = double(i) ;
18
J[i] = ((2*l + 1)*(l*(l+1)*x - 1)*J[i-1] - (l-1)*(l+1)*(l+1)*J[i-2])/(l*l*(l+2)) ;
19
20
}
21
}
22
return
J ;
23
}
24
}
Lorene
Lorene prototypes.
Definition:
app_hor.h:67
srv
www
html
Lorene
C++
Source
Non_class_members
Coef
jacobi.C
Generated by
1.8.14