help-octave
[Top][All Lists]
Advanced

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

Re: sparse bug or unexplicable behaviour


From: Francesco Potortì
Subject: Re: sparse bug or unexplicable behaviour
Date: Sun, 21 Jun 2015 20:30:01 +0200

>I observe behaviour that I cannot explicate on Debian Octave, either I
>miss something obvious or it'a a bug.  But since that would be a bug in
>a fundamental feature of Octave, I am puzzled.

I found the problem.  The function sparse should be called with the
"unique" option.


>I have three vectors from which I build a sparse matrix.  but I observe
>that the min value of the third vector (whioch is negative) is different
>from the min value of the sparse matrix:
>
>octave-cli> version
>ans = 3.8.2
>octave-cli> clear p
>octave-cli> size(prowidx)
>ans =
>
>   111263        1
>
>octave-cli> min(prowidx)
>ans =  1
>octave-cli> max(prowidx)
>ans =  2579
>octave-cli> min(pcolidx)
>ans =  1
>octave-cli> max(pcolidx)
>ans =  138
>octave-cli> length(pt(:,2))
>ans =  111263
>octave-cli> p = full(sparse(prowidx, pcolidx, pt(:,2)));
>octave-cli> size(p)
>ans =
>
>   2579    138
>
>octave-cli> max(pt(:,2))
>ans = -30
>octave-cli> max(p(p!=0)(:))
>ans = -30
>octave-cli> min(pt(:,2))
>ans = -94
>octave-cli> min(p(:))
>ans = -182
>
>Is this a bug or am I missing something?
>
>-- 
>Francesco Potortì (ricercatore)        Voice:  +39.050.621.3058
>ISTI - Area della ricerca CNR          Mobile: +39.348.8283.107
>via G. Moruzzi 1, I-56124 Pisa         Skype:  wnlabisti
>(entrance 20, 1st floor, room C71)     Web:    http://fly.isti.cnr.it
>
>
>_______________________________________________
>Help-octave mailing list
>address@hidden
>https://lists.gnu.org/mailman/listinfo/help-octave
>
>




reply via email to

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