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]

Matrix matters.


I had cause to be playing around with the gsl_matrix sources, and
the following things arose:

1) the gsl_matrix_*_swap function is prototyped as

int gsl_matrix_swap(gsl_matrix * m1, const gsl_matrix * m2);

I assume this should be

int gsl_matrix_swap(gsl_matrix * m1, gsl_matrix * m2);

(ie no const on the second matrix, since it will be altered.

2) the arithmetic operations _scale, _add_constant, and _add_diagonal
all take the constant as a double. Surely the constant should be
in the same form as the matrix; ie, instead of

int gsl_matrix_long_double_scale (gsl_matrix_long_double * a, const double x);

it should be

int gsl_matrix_long_double_scale (gsl_matrix_long_double * a, const long double x);

and so on. This is a trivial change; diff at 
http://www-theor.ch.cam.ac.uk/people/tow/gsl/mat.constant.diff

3) the arithmetic operations were not implemented for complex matrices.
This is relatively easy to do, and I've done it for my own use, at least.
If you're interested, the code is at the same place as above, files
mat.complex.diff and oper_complex_source.c

Toby White


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