[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #33601] Sparse bool matrices lose logical clas
From: |
Rik |
Subject: |
[Octave-bug-tracker] [bug #33601] Sparse bool matrices lose logical class with assignment of 1 |
Date: |
Mon, 20 Jun 2011 01:40:05 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1 |
URL:
<http://savannah.gnu.org/bugs/?33601>
Summary: Sparse bool matrices lose logical class with
assignment of 1
Project: GNU Octave
Submitted by: rik5
Submitted on: Sun 19 Jun 2011 06:40:05 PM PDT
Category: Libraries
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: None
Status: None
Assigned to: None
Originator Name:
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Release: dev
Operating System: GNU/Linux
_______________________________________________________
Details:
Sparse matrices support an underlying type of class double or class logical.
The double class normally takes 8 bytes to store while the logical class only
takes 1 byte so it is advantageous to use sparse logical matrices where
possible.
Unfortunately, assignment of 0 or 1 will promote a sparse logical matrix to a
sparse double matrix even though it is unnecessary and even though the
equivalent operation using full matrices would not cause such a promotion.
Some example code:
s = sparse(false(10,10));
typeinfo(s)
ans = sparse bool matrix
s(1) = 1;
typeinfo(s)
ans = sparse matrix
The same operation on a full matrix
f = false (10,10);
typeinfo(f)
ans = bool matrix
f(1) = 1;
typeinfo(f)
ans = bool matrix
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?33601>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [Octave-bug-tracker] [bug #33601] Sparse bool matrices lose logical class with assignment of 1,
Rik <=