Skip to content

Commit 78decc0

Browse files
author
Boris Leistedt
committed
slag_basis.m Checked in
1 parent f1396ab commit 78decc0

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

src/main/c/flag_spherbessel.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,11 @@ void flag_sbesselslag(double *sbesselslag, int ell, double *kvalues, int Nk, int
8484
if( j == 0 ){
8585
weight = pow(2, 2) * gsl_sf_fact(ell + 2) * (n + 1.0) * (n + 2.0) / 2.0 ; //
8686
}else{
87-
weight = - 2 * (ell + 2 + j) * (n - j + 1) * weight / (j * (j + 2)); //
87+
weight = - 2 * (n - j + 1) * weight / ((j + 2)); //
8888
}
8989
//sbesselslag[n * Nk + k] += pow((n+1)*(n+2), -0.5) * weight * mulk_coefs[j+2] ;
9090
printf(" %3.0e ",weight);
91-
vals[j] = pow((n+1)*(n+2), -0.5) * weight * mulk_coefs[j+2];
91+
vals[j] = pow((n+1)*(n+2), -0.5) * ( weight * mulk_coefs[j+2] );
9292
}
9393
result = 0.0, hold = 0.0, temp = 0.0, y = 0.0;
9494
for(j = 0; j <= n/2; j++){

src/main/matlab/slag_basis.m

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
function f = slag_basis(N, nodes, tau)
2+
3+
% slag_basis_mex - Compute the spherical Laguerre basis functions
4+
% up to order N on a grid of radii nodes (with rescaling factor tau)
5+
%
6+
% Default usage :
7+
%
8+
% f = slag_basis(N, nodes, tau)
9+
% plot(f)
10+
%
11+
% where N is the maximum order/mode of the spherical Laguerre functions,
12+
% nodes is the radial grig on which to compute the basis function,
13+
% tau is the rescaling factor.
14+
%
15+
% FLAG package to perform 3D Fourier-Laguerre Analysis
16+
% Copyright (C) 2012 Boris Leistedt & Jason McEwen
17+
% See LICENSE.txt for license details
18+
19+
f = slag_basis_mex(N, nodes, tau);
20+
21+
end

0 commit comments

Comments
 (0)