This is the mail archive of the
gsl-discuss@sources.redhat.com
mailing list for the GSL project.
Bug in gsl_matrix_get_col
- To: gsl-discuss at sources dot redhat dot com
- Subject: Bug in gsl_matrix_get_col
- From: Ramin Nakisa <raminnakisa at yahoo dot com>
- Date: Fri, 01 Jun 2001 14:48:11 GMT
- Envelope-To: <gsl-discuss@sources.redhat.com>
- Reply-To: raminnakisa at yahoo dot com
When I tried this...
#include <stdio.h>
#include <gsl/gsl_matrix.h>
int main ()
{
int i, j;
gsl_matrix * m = gsl_matrix_alloc (10, 3) ;
gsl_vector * v = gsl_vector_alloc (10) ;
for (i = 0; i < 10; i++)
for (j = 0; j < 3; j++)
gsl_matrix_set (m, i, j, 0.23 + 100*i + j);
gsl_matrix_get_col( v, m, 0 );
for (i = 0; i < 10; i++)
printf("v(%d) = %g\n", i, gsl_vector_get ( v, i ));
}
I got this...
v(0) = 200.23
v(1) = 0
v(2) = 0
v(3) = 0
v(4) = 0
v(5) = 0
v(6) = 0
v(7) = 0
v(8) = 0
v(9) = 0
which means there's a problem. gsl_matrix_get_row seems to work okay.