max does not support sparse boolean matrix
pbellec
pbellec at bic.mni.mcgill.ca
Fri Apr 3 16:24:48 CDT 2009
Thanks for the quick answer David. I will try to apply the patch and
recompile next week. I am not sure I correctly understands what the patch
does though
David Bateman-2 wrote:
>
> Something like the attached should make the behavior the same as the full
> types
>
If it is converting the max to a full array, that would not do. if max is
just a scalar it would have no impact, but commands like max(a,[],1) can
generate big vectors or arrays. It would be important to keep the sparse
attribute, and also the boolean type for cases where memory load is a
critical issue.
David Bateman-2 wrote:
>
> (what does matlab do in this case?).
>
Matlab 7.4.0.336 (R2007a) is actually messing up the types. It keeps the
array sparse, but goes from boolean to double :
>> a = sparse([true false; false false]);
>> whos a
Name Size Bytes Class Attributes
a 2x2 17 logical sparse
>> max_a = max(a,[],1)
max_a =
(1,1) 1
>> whos max_a
Name Size Bytes Class Attributes
max_a 1x2 36 double sparse
I hope this helps,
Pierre
--
View this message in context: http://www.nabble.com/max-does-not-support-sparse-boolean-matrix-tp22871279p22876725.html
Sent from the Octave - Bugs mailing list archive at Nabble.com.
More information about the Bug-octave
mailing list