Skip to content

Commit f6b5c00

Browse files
author
Boris Leistedt
committed
Fixed issue with first slag basis
1 parent 78decc0 commit f6b5c00

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/main/c/flag_spherbessel.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ 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 * (n - j + 1) * weight / ((j + 2)); //
87+
weight = - 2 * (ell + 2 + j) * (n - j + 1) * weight / (j * (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);

src/main/c/flag_spherlaguerre.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,7 @@ void flag_spherlaguerre_mapped_synthesis(complex double *f, const complex double
444444
void flag_spherlaguerre_basis(double *KN, const int N, const double *nodes, int Nnodes, double tau)
445445
{
446446
assert(Nnodes > 0);
447+
assert(N > 0);
447448
int i, n;
448449
const int alpha = 2;
449450
double factor, lagu0, lagu1, lagu2, r;
@@ -456,11 +457,9 @@ void flag_spherlaguerre_basis(double *KN, const int N, const double *nodes, int
456457
lagu0 = 0.0;
457458
lagu1 = 1.0;
458459

459-
if (N == 0 ){
460+
KN[i * N] = factor * pow(factorial_range(1, alpha), -0.5) * lagu1;
460461

461-
KN[i] = factor * pow(factorial_range(1, alpha), -0.5) * lagu1;
462-
463-
} else {
462+
if ( N > 1 ) {
464463

465464
for (n = 1; n < N; n++)
466465
{

0 commit comments

Comments
 (0)