This is the mail archive of the
gsl-discuss@sources.redhat.com
mailing list for the GSL project.
Matrix matters.
- From: Toby White <tow at theor dot ch dot cam dot ac dot uk>
- To: gsl-discuss at sources dot redhat dot com
- Date: Thu, 14 Feb 2002 19:46:10 +0000
- Subject: Matrix matters.
- Organization: Cambridge University Chemical Laboratory, Theoretical Sector
- Reply-to: Toby White <tow at theor dot ch dot cam dot ac dot uk>
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