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]

Bug in gsl_matrix_get_col


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.


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