bug-gsl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-gsl] [bug #29606] insufficient argument checks in gsl_sf_coupling_6


From: Rhys Ulerich
Subject: [Bug-gsl] [bug #29606] insufficient argument checks in gsl_sf_coupling_6j
Date: Tue, 28 Aug 2012 14:11:34 +0000
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Ubuntu/10.04 Chromium/10.0.648.151 Chrome/10.0.648.151 Safari/534.16

Follow-up Comment #1, bug #29606 (project gsl):

From: address@hidden Jason Detwiler 
To:  <address@hidden> 
Date: Tue, 21 Aug 2012 03:07:47 -0500 
Subject: [Bug-gsl] gsl_sf_coupling_6j still missing triad sum check 
 
Dear GNU developers,

I just re-encountered a two-year old bug in the calculation of
Wigner's 6-j (and, hence, 9-J) symbols. The original bug report is
here, from v1.13:

https://savannah.gnu.org/bugs/?29606

It is still unfixed in 1.15. The problem is that the routine fails to
check whether the each triad that passes the triangle selection also
have an even sum.I suggest fixing this by changing this block starting
at line 205 of specfunc/coupling.c from:

  else if(   triangle_selection_fails(two_ja, two_jb, two_jc)
          || triangle_selection_fails(two_ja, two_je, two_jf)
          || triangle_selection_fails(two_jb, two_jd, two_jf)
          || triangle_selection_fails(two_je, two_jd, two_jc)
     ) {
    result->val = 0.0;
    result->err = 0.0;
    return GSL_SUCCESS;
  }

to:

  else if(   triangle_selection_fails(two_ja, two_jb, two_jc)
          || ((two_ja + two_jb + two_jc) % 2)
          || triangle_selection_fails(two_ja, two_je, two_jf)
          || ((two_ja + two_je + two_jf) % 2)
          || triangle_selection_fails(two_jb, two_jd, two_jf)
          || ((two_jb + two_jd + two_jf) % 2)
          || triangle_selection_fails(two_je, two_jd, two_jc)
          || ((two_je + two_jd + two_jc) % 2)
     ) {
    result->val = 0.0;
    result->err = 0.0;
    return GSL_SUCCESS;
  }

Thank you,
Jason Detwiler

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?29606>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]