This is the mail archive of the
gsl-discuss@sourceware.org
mailing list for the GSL project.
Re: Adding new Vector/Matrix accessor functions
- From: Brian Gough <bjg at gnu dot org>
- To: "Stuart O Anderson" <soa at ri dot cmu dot edu>
- Cc: gsl-discuss at sourceware dot org
- Date: Tue, 06 May 2008 21:24:52 +0100
- Subject: Re: Adding new Vector/Matrix accessor functions
- References: <7ed3bc8b0805031457g6ef4f51ei810283a9b1f084b0@mail.gmail.com>
At Sat, 3 May 2008 17:57:42 -0400,
Stuart O Anderson wrote:
> I've run into a situation where it would be very convenient to be able
> to get pointers to individual elements of GSL vector and matrices.
> Currently I deal with this by using matrix and vector views of normal
> C arrays. However, if there were a pair of functions:
> double *gsl_vector_get_ptr( gsl_vector *v, int offset )
> double *gsl_matrix_get_ptr( gsl_vector *v, int row, int col )
Hello,
I think these already exist -- see the functions gsl_matrix_ptr(m,i,j)
and gsl_vector_ptr(v,i) in the manual. Manipulating data with the
pointers from these is fine.
--
Brian Gough