This is the mail archive of the
gsl-discuss@sources.redhat.com
mailing list for the GSL project.
Re: Proposal for new functions for matrix manipulation.
- From: Martin Jansche <jansche at ling dot ohio-state dot edu>
- To: Lukas Dobrek <dobrek at itp dot uni-hannover dot de>
- Cc: <gsl-discuss at sources dot redhat dot com>
- Date: Tue, 28 Jan 2003 14:00:19 -0500 (EST)
- Subject: Re: Proposal for new functions for matrix manipulation.
- Reply-to: Martin Jansche <jansche at ling dot ohio-state dot edu>
On Tue, 28 Jan 2003, Lukas Dobrek wrote:
> [dobrek@maldini ~]$ cat t.c
> #define GSL_RANGE_CHECK_OFF 1
> #include<gsl/gsl_matrix.h>
> int main(){
> gsl_matrix *M;
> double add;
> int i,j;
> gsl_matrix_set(M,i,j,add+gsl_matrix_get(M,i,j));
> }
>
> [dobrek@maldini ~]$ gcc -S -O2 t.c
>
> One can see in t.s that bouth functions are consecutively called
> gsl_matrix_get and gsl_matrix_set.
I compiled your file using
gcc -S -O2 -DHAVE_INLINE -fverbose-asm t.c
and the assembly output looks exactly as you'd want it. If that's
not an option for you, couldn't you say
double *elem = gsl_matrix_ptr(M, i, j);
*elem += add;
in you C source?
- martin