[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-gsl] Possible bug(s) in rowcol_source.c (gsl_matrix_subrow and
From: |
Patrick Alken |
Subject: |
Re: [Bug-gsl] Possible bug(s) in rowcol_source.c (gsl_matrix_subrow and gsl_matrix_subcolumn) |
Date: |
Fri, 11 Apr 2008 11:47:50 -0600 |
User-agent: |
Mutt/1.5.15+20070412 (2007-04-11) |
Yes it looks like you're right. I have fixed this in the repository.
Thanks for reporting this!
Patrick
On Fri, Apr 11, 2008 at 11:46:57AM +0200, Thord Andersson wrote:
> 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
> address@hidden
> http://lists.gnu.org/mailman/listinfo/bug-gsl