Hi,

In rowcol_source.c , functions gsl_matrix_subrow() and gsl_matrix_subcolumn() , there are overflow checks which I think compare with the wrong matrix dimension. Possible fixes are indicated in inline comments. My applications works now....

Thank you for GSL! It's great!
/Thord Andersson

QUALIFIED_VIEW(_gsl_vector,view)
FUNCTION (gsl_matrix, subrow) (QUALIFIED_TYPE(gsl_matrix) * m, const size_t i, const size_t offset, const size_t n)
..
..
else if (offset + n > m->size1) // Should be: (offset + n > m->size2) (compare with length of row -->number of columns)
   {
     GSL_ERROR_VAL ("dimension n overflows matrix", GSL_EINVAL, view);
   }
..
..

and

QUALIFIED_VIEW(_gsl_vector,view)
FUNCTION (gsl_matrix, subcolumn) (QUALIFIED_TYPE(gsl_matrix) * m, const size_t j, const size_t offset, const size_t n)
..
..
else if (offset + n > m->size2) // Should be: (offset + n > m->size1) (compare with length of column -->number of rows)
   {
     GSL_ERROR_VAL ("dimension n overflows matrix", GSL_EINVAL, view);
   }
..




_______________________________________________
Bug-gsl mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-gsl

Reply via email to