This is the mail archive of the gsl-discuss@sources.redhat.com mailing list for the GSL project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Proposal for new functions for matrix manipulation.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]