[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bug in any on sparse boolean
From: |
David Bateman |
Subject: |
Re: Bug in any on sparse boolean |
Date: |
Thu, 20 Jan 2011 00:38:21 +0100 |
User-agent: |
Mozilla-Thunderbird 2.0.0.22 (X11/20090706) |
Kim Hansen wrote:
> On Wed, Jan 19, 2011 at 01:08, Kim Hansen <address@hidden> wrote:
>
>> I think I have found a bug that affects any() when used on sparse booleans:
>>
>
> I am not sure that it is any() that is the problem.
>
> My guess is now that the error is somewhere in:
> template <class T>
> Sparse<T>::Sparse (const Array<T>& a, const idx_vector& r,
> const idx_vector& c, octave_idx_type nr,
> octave_idx_type nc, bool sum_terms,
> octave_idx_type nzm)
>
>
> I think this is an example of how to provoke the bug:
>
> octave:1> sparse(1, 1:5, true, 1, 5)
> ans =
>
> Compressed Column Sparse (rows = 1, cols = 5, nnz = 5 [100%])
>
> (1, 1) -> 1
> (-1216302479, 2) -> 1
> (135704533, 3) -> 1
> (18, 4) -> 1
> (138870485, 5) -> 1
>
> octave:2>
>
>
> The bug is on trunk and I will keep searching for a solution.
>
>
It is an off by one error in the changeset
http://hg.savannah.gnu.org/hgweb/octave/rev/ded9beac7582
in the method that Kim identified. I'm about the push a fix but what to
test some more first
D.
--
David Bateman address@hidden
35 rue Gambetta +33 1 46 04 02 18 (Home)
92100 Boulogne-Billancourt FRANCE +33 6 72 01 06 33 (Mob)