help-gsl
[Top][All Lists]
Advanced

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

Fwd: [Help-gsl] why disable range checking ? Re: Help-gsl Digest, Vol 8


From: glide creme
Subject: Fwd: [Help-gsl] why disable range checking ? Re: Help-gsl Digest, Vol 81, Issue 10
Date: Thu, 12 Aug 2010 03:22:39 +0200

Sorry for the double post...

---------- Forwarded message ----------
From: glide creme <address@hidden>
Date: Thu, Aug 12, 2010 at 3:20 AM
Subject: Re: [Help-gsl] why disable range checking ? Re: Help-gsl
Digest, Vol 81, Issue 10
To: Brian Gough <address@hidden>


On Tue, Aug 10, 2010 at 10:31 PM, Brian Gough <address@hidden> wrote:
> At Mon, 9 Aug 2010 18:45:10 +0200,
> glide creme wrote:
>>
>> Yes, i wanted to do this, because of speed issues.
>>
>> But it would seem from the lack of responses,
>> that it might not be possible afterall to disable the range checking.
>>
>
> It is possible, and is tested in the test suite.
>
> Maybe your header file is from an older version which used a different
> macro.
>

Hi thanks for your reply,

Can you specify which testsuite that is?
I ran 'make check' and everything seems to be working

It says '1 test passed' 42 times, and twice it says 'All 2 tests passed'

I'm using the gsl version 1.14, and I installed it using the make utility,
No other version of gsl has been previously installed on this computer.


My sourcecode which is taken directly from
http://www.gnu.org/software/gsl/manual/html_node/Example-programs-for-vectors.html
looks like.

//file start
#define GSL_RANGE_CHECK_OFF

#include <stdio.h>
    #include <gsl/gsl_vector.h>

    int
    main (void)
    {
      int i;
      gsl_vector * v = gsl_vector_alloc (3);

      for (i = 0; i < 3; i++)
        {
          gsl_vector_set (v, i, 1.23 + i);
        }

      for (i = 0; i < 100; i++) /* OUT OF RANGE ERROR */
        {
          printf ("v_%d = %g\n", i, gsl_vector_get (v, i));
        }

      gsl_vector_free (v);
      return 0;
    }
//fileend


When I have GSL_RANGE_CHECK_OFF in the file, the compiler complains if
I  also supply the -DGSL_RANGE_CHECK=0 in the command line.


gcc -lgsl gslRangeCheck.c -lgslcblas -DGSL_RANGE_CHECK=0
In file included from /usr/include/gsl/gsl_vector_complex_long_double.h:27,
                from /usr/include/gsl/gsl_vector.h:4,
                from gslRangeCheck.c:4:
/usr/include/gsl/gsl_check_range.h:47:4: error: #error "cannot set
both GSL_RANGE_CHECK and GSL_RANGE_CHECK_OFF"


thanks for you help



reply via email to

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