|
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 |
When providing examples of "gsl_function"
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.gsl_function F; struct my_f_params params = { 3.0, 2.0, 1.0 }; F.function =&my_f; F.params =¶ms; The function f(x) can be evaluated using the following macro, #define GSL_FN_EVAL(F,x) (*((F)->function))(x,(F)->params)
It should read:
The same mistake is made again further down in the "gsl_function_fdf" section.gsl_function F; struct my_f_params params = { 3.0, 2.0, 1.0 }; F.function =&my_f; F.params =¶ms; The function f(x) can be evaluated using the following macro, #define GSL_FN_EVAL(F,x) (*(F.function))(x,F.params)
[Prev in Thread] | Current Thread | [Next in Thread] |