bug-gsl
[Top][All Lists]
Advanced

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

[Bug-gsl] Bug in integration/cquad.c


From: Pedro Gonnet
Subject: [Bug-gsl] Bug in integration/cquad.c
Date: Thu, 20 Sep 2012 17:14:28 +0100

Hi,

I just got an e-mail from Mick Pont at NAG who ported my quadrature
codes to their library, and found a bug in the process. This bug is also
present in the GSL version, of which I am the original author.

The corrections are as follows:

        === modified file 'integration/cquad.c'
        --- integration/cquad.c 2011-05-02 22:20:13 +0000
        +++ integration/cquad.c 2012-09-20 16:09:15 +0000
        @@ -245,7 +245,7 @@
           Vinvfx (iv->fx, &(iv->c[idx[3]]), 3);
           Vinvfx (iv->fx, &(iv->c[idx[2]]), 2);
           for (i = 0; i < nnans; i++)
        -    iv->fx[i] = GSL_NAN;
        +    iv->fx[nans[i]] = GSL_NAN;
           iv->a = a;
           iv->b = b;
           iv->depth = 3;
        @@ -334,7 +334,7 @@
                    {
                      downdate (&(iv->c[idx[d]]), n[d], d, nans, nnans);
                      for (i = 0; i < nnans; i++)
        -               iv->fx[i] = GSL_NAN;
        +               iv->fx[nans[i]] = GSL_NAN;
                    }
         
                  /* Compute the error estimate. */
        @@ -455,7 +455,7 @@
                    {
                      downdate (ivl->c, n[0], 0, nans, nnans);
                      for (i = 0; i < nnans; i++)
        -               ivl->fx[i] = GSL_NAN;
        +               ivl->fx[nans[i]] = GSL_NAN;
                    }
                  for (i = 0; i <= n[d]; i++)
                    {
        @@ -521,7 +521,7 @@
                    {
                      downdate (ivr->c, n[0], 0, nans, nnans);
                      for (i = 0; i < nnans; i++)
        -               ivr->fx[i] = GSL_NAN;
        +               ivr->fx[nans[i]] = GSL_NAN;
                    }
                  for (i = 0; i <= n[d]; i++)
                    {

Cheers,
Pedro






reply via email to

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