Skip to content

Commit

Permalink
Fix bug in computation of specific Wigner symbol
Browse files Browse the repository at this point in the history
  • Loading branch information
seweber committed Jan 22, 2016
1 parent e11b4a2 commit da14130
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/wignerSymbols-cpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ double wigner3j(double l1, double l2, double l3,
double l1min = std::max(std::fabs(l2-l3),std::fabs(m1));

// We fetch the proper value in the array.
int index = (int)l1-l1min;
int index = (int)(l1-l1min);

return wigner3j(l2,l3,m1,m2,m3)[index];
}
Expand Down Expand Up @@ -448,7 +448,7 @@ double wigner6j(double l1, double l2, double l3,

// We compute l1min and the position of the array we will want.
double l1min = std::max(std::fabs(l2-l3),std::fabs(l5-l6));
int index = (int)l1-l1min;
int index = (int)(l1-l1min);

return wigner6j(l2,l3,l4,l5,l6)[index];
}
Expand Down
4 changes: 2 additions & 2 deletions src/wignerSymbols-fortran.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ double wigner3j_f(double l1, double l2, double l3,
drc3jj_wrap(l2,l3,m2,m3,&l1min,&l1max,thrcof,size,&ierr);

// We fetch and return the value with the proper l1 value.
int index = (int)l1-l1min;
int index = (int)(l1-l1min);
return thrcof[index];
}

Expand Down Expand Up @@ -102,7 +102,7 @@ double wigner6j_f(double l1, double l2, double l3,
drc6j_wrap(l2,l3,l4,l5,l6,&l1min,&l1max,sixcof,size,&ierr);

// We fetch and return the coefficient with the proper l1 value.
int index = (int)l1-l1min;
int index = (int)(l1-l1min);
return sixcof[index];
}
}

0 comments on commit da14130

Please sign in to comment.