bug-gsl
[Top][All Lists]
Advanced

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

[Bug-gsl] bug in combination/combination.c


From: Mario Pernici
Subject: [Bug-gsl] bug in combination/combination.c
Date: Mon, 17 Mar 2003 10:30:19 +0100 (CET)

gsl version: 1.3
Red Hat 7.3
gcc version 2.96

Dear Sirs,
 I added a check in your example, see es2.c; I got
 [Examples]$ ./a.out
 All subsets of {0,1,2,3} by size:
 { }
 { 0 }
 { 1 }
 { 2 }
 { 3 }
 gsl: combination.c:89: ERROR: combination index no in increasing order
 Default GSL error handler invoked.
 { 0 1Aborted


Here is the fix:
int
gsl_combination_valid (gsl_combination * c)
{
 // ....
//          if (c->data[i] > c->data[j])  wrong order
            if (c->data[j] > c->data[i])
            {
//              GSL_ERROR("combination index no in increasing order",
//                      GSL_FAILURE) ;
              GSL_ERROR("combination index not in increasing order",
                        GSL_FAILURE) ;
            }
        }
    }

  return GSL_SUCCESS;
}


Best Regards
 Mario Pernici

Attachment: es2.c
Description: Text document


reply via email to

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