bug-gsl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-gsl] Possible bug(s) in rowcol_source.c (gsl_matrix_subrow and gsl_


From: Thord Andersson
Subject: [Bug-gsl] Possible bug(s) in rowcol_source.c (gsl_matrix_subrow and gsl_matrix_subcolumn)
Date: Fri, 11 Apr 2008 11:46:57 +0200
User-agent: Thunderbird 2.0.0.12 (Windows/20080213)

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);
   }
..






reply via email to

[Prev in Thread] Current Thread [Next in Thread]