Proposal for new functions for matrix manipulation.

Lukas Dobrek
Tue Jan 28 16:05:00 GMT 2003

Whould anyone opose for adding int GSL the set of functions giving the
easy posibility of adding something to matrix element. For instanca

gsl_matrix_addto_el(gsl_matrix * M, size_t i, size_t j, add);

whould corespond to M->data[i*M->tda+j]+=add

and so on. Ofcourse with full rank checking and stuff. 

Now the situation is a litle unconforteble if one wants to do it one can. 
use gsl :


the first one I dont like when I start thinking yes and what happends if

I get something like:
and this of course I dont like.

Or I am wrong and compiler will optimize it to the same ?

But the simple test :

[dobrek@maldini ~]$ cat t.c
int main(){
		gsl_matrix *M;
		double add;
		int 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. 

Concluding I belive that this functions could be usefull and should be added. 

Take care
Lukasz Dobrek
Łukasz Dobrek
   An optimist believes that we live in the best of all possible worlds.
   A pessimist is sure that this must be so.

More information about the Gsl-discuss mailing list