bug-gsl
[Top][All Lists]
Advanced

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

[Bug-gsl] Mistake in Documentation (section 33.4 - Providing the functio


From: Mark Jenkins
Subject: [Bug-gsl] Mistake in Documentation (section 33.4 - Providing the function to solve)
Date: Fri, 28 Jan 2011 15:16:03 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101208 Thunderbird/3.1.7

I am not sure this is the correct place to report this. Please forward to whoever should be notified. Thank you.

When providing examples of "gsl_function"

      gsl_function F;
      struct my_f_params params = { 3.0, 2.0, 1.0 };

      F.function =&my_f;
      F.params =&params;

The function f(x) can be evaluated using the following macro,

      #define GSL_FN_EVAL(F,x)
          (*((F)->function))(x,(F)->params)
Unless I am missing something, the macro is incorrect. The variable "F" is of type "gsl_function", not "pointer to gsl_function" so the use of "(F)->function" or "(F)->params" makes no sense in this context.

It should read:
      gsl_function F;
      struct my_f_params params = { 3.0, 2.0, 1.0 };

      F.function =&my_f;
      F.params =&params;

The function f(x) can be evaluated using the following macro,

      #define GSL_FN_EVAL(F,x)
          (*(F.function))(x,F.params)
The same mistake is made again further down in the "gsl_function_fdf" section.






reply via email to

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