help-gsl
[Top][All Lists]
Advanced

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

Re: [Help-gsl] Necessity of providing f, df, _and_ fdf?


From: Liam Healy
Subject: Re: [Help-gsl] Necessity of providing f, df, _and_ fdf?
Date: Sat, 24 Jan 2009 16:31:46 -0500

On Wed, Jan 21, 2009 at 10:06 AM, Brian Gough <address@hidden> wrote:
> At Mon, 19 Jan 2009 18:20:56 -0500,
> Liam Healy wrote:
>> Is possible to change GSL to allow f & df _or_ fdf instead of "and",
>> say providing a null pointer for the unneeded function.  If that's
>> already the case, can the documentation be made clear?
>
> Hello,
>
> To keep things simple using a NULL pointer is not supported -- the
> recommended way is to make a small function fdf which calls f and df.
>
>> In a related puzzle, I find this statement about fdf hard to understand:
>> "This function provides an optimization of the separate functions for
>> f(x) and g(x)—it is always faster to compute the function and its
>> derivative at the same time. "
>> The user is providing the function, so whether it's an optimization or
>> not depends on how it's written.  It seems like an overstatement that
>> it's "always" faster to compute the function and its derivative at the
>> same time; I'm willing to believe it's (essentially) at least as fast
>> perhaps.
>
> I was thinking that for analytic functions, at least, the function and
> the derivative always have some terms in common so it is faster to
> compute them together.

This has certainly been true in my experience.  But then why is it
necessary to supply f and df separately?  Why not just have fdf as a
single argument?  What happens if f and/or df are not consistent with
the corresponding values set by fdf?

Liam

> --
> Brian Gough
>




reply via email to

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