This is the mail archive of the
gsl-discuss@sources.redhat.com
mailing list for the GSL project.
Re: Newton's method
- From: Brian Gough <bjg at network-theory dot co dot uk>
- To: fjmolina at lbl dot gov
- Cc: <gsl-discuss at sources dot redhat dot com>
- Date: Fri, 1 Aug 2003 09:57:13 +0100
- Subject: Re: Newton's method
- References: <16169.39282.273058.111710@dhcp-63-193.cse.ucsc.edu>
Francisco J Molina writes:
> In gsl_multiroot_function the prototype of the member function f
> is
> int f (gsl_vector * x, void * p, _matrix * f ).
>
> I am trying to avoid the use of the function
> gsl_vector_get ( x, 0 );
> and supstitute it with
> pX = x->data;
> pX [ 0 ];
> Is this safe? Is the stride of x always 1?
If you want to avoid typing I'd recommend using
#define X(i) gsl_vector_get(x,(i))
or
#define VEC(x,i) gsl_vector_get((x),(i))
which don't rely on assumptions about the stride.
--
Brian