[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #40105] Logical diagonal matrices are not supp
From: |
Rik |
Subject: |
[Octave-bug-tracker] [bug #40105] Logical diagonal matrices are not supported |
Date: |
Thu, 26 Sep 2013 17:00:32 +0000 |
User-agent: |
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:24.0) Gecko/20100101 Firefox/24.0 |
Update of bug #40105 (project octave):
Severity: 3 - Normal => 2 - Minor
Status: None => Confirmed
Summary: Multiplying a logical sparse matrix by a logical
diagonal matrix gives a full matrix => Logical diagonal matrices are not
supported
_______________________________________________________
Follow-up Comment #1:
I think the problem is actually that diag doesn't support logical matrices.
If I break the problem up I can see that the multiplication is between a
SPARSE matrix and a FULL matrix and the rules are that the SPARSE matrix is
coerced into a full matrix.
x = logical (speye (3))
x =
Compressed Column Sparse (rows = 3, cols = 3, nnz = 3 [33%])
(1, 1) -> 1
(2, 2) -> 1
(3, 3) -> 1
typeinfo (x)
ans = sparse bool matrix
y = diag (logical ([1 1 1]))
y =
1 0 0
0 1 0
0 0 1
typeinfo (y)
ans = bool matrix
z = x * y
z =
1 0 0
0 1 0
0 0 1
typeinfo (z)
ans = matrix
On the other hand, If I use double values which diag() does support in the
special diagonal matrix class then I get the right result.
x = speye (3);
typeinfo (x)
ans = sparse matrix
y = diag ([1 1 1])
typeinfo (y)
Diagonal Matrix
1 0 0
0 1 0
0 0 1
z = x * y;
typeinfo (z)
ans = sparse matrix
I'm going to re-title the report to indicate that logical diagonal matrices
are not supported.
Simple test code for this is
typeinfo (diag ([true true true]))
which should return "logical diagonal matrix".
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?40105>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/