This is the mail archive of the
gsl-discuss@sources.redhat.com
mailing list for the GSL project.
Views and maybe bugs
- To: <gsl-discuss at sources dot redhat dot com>
- Subject: Views and maybe bugs
- From: M Joonas Pihlaja <jpihlaja at cc dot helsinki dot fi>
- Date: Fri, 14 Sep 2001 20:25:45 +0300 (EET DST)
Hello all,
I wanted to send this in before the weekend, but I don't have the
source code that illustrate the bugs with me. I know, a shoddy
excuse for a shoddy bug report. :-( I checked the gsl-discuss
archives for 2001 and these probably haven't surfaced before.
I'm using GSL 0.9.2 with gcc 2.95.2 on a stock Debian Potato
2.2r0. The tarball source version of GSL, not a .deb.
1) The documentation for gsl_matrix_view_vector() says that it
will create a matrix view m' of a vector with elements
m'(i,j) = v->data[(i*n2+j)*v->stride]
That's impossible because the second index of a matrix doesn't
have a `stride' factor. Hence gsl_matrix_view_vector() only
works for vectors with unit stride.
There are two possibilities to fix this: Adding a stride factor
for the second index of matrices or disallowing non-unit strided
vectors as input for those functions.
The first would be nice because more general submatrix views
could be created, but unfortunately it would probably slow down
matrix manipulation functions and definitely break BLAS
compatibility (because the BLAS don't support strided second
indices either).
2) (Maybe a bug.) The gsl_vector_const_view_array() family of
functions don't exists in libgsl.a. A dump with nm confirms
this. Possibly a bad installation on my part, but perhaps
someone else could check their system?
3) (Maybe a bug.) The const modifier isn't uniformly applied to
some functions' input arguments. Some do, such as
gsl_vector_fprintf(), but whole families of functions, such as
gsl_vector_view_array() don't. This is an unpleasant surprise.
IMHO, if a function's argument is only for input then it should
be qualified const.
If anyone wants test case sources, just ask and I'll send them
once I'm home.
Regards,
Joonas Pihlaja