[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #41441] Broadcasting does not behave properly
From: |
David Spies |
Subject: |
[Octave-bug-tracker] [bug #41441] Broadcasting does not behave properly on sparse matrices |
Date: |
Mon, 03 Feb 2014 03:15:30 +0000 |
User-agent: |
Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:26.0) Gecko/20100101 Firefox/26.0 |
URL:
<http://savannah.gnu.org/bugs/?41441>
Summary: Broadcasting does not behave properly on sparse
matrices
Project: GNU Octave
Submitted by: dspyz
Submitted on: Mon 03 Feb 2014 03:15:29 AM GMT
Category: Octave Function
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Incorrect Result
Status: None
Assigned to: None
Originator Name:
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Release: dev
Operating System: Any
_______________________________________________________
Details:
Broadcasting doesn't work at all for sparse matrices. There appears to be no
good workaround
#Doesn't work automatically for sparse matrix with full vector
octave:1> a = sprand(100000,100000,0.00001);
octave:2> b = rand(100000,1);
octave:3> res = a == b;
error: mx_el_eq: nonconformant arguments (op1 is 100000x100000, op2 is
100000x1)
#Doesn't work explicitly for sparse matrix with full vector
octave:9> res = bsxfun(@eq,a,b);
error: out of memory or dimension too large for Octave's index type
#Doesn't work automatically for sparse matrix with sparse vector
octave:9> b = sparse(b);
octave:10> res = a == b;
error: mx_el_eq: nonconformant arguments (op1 is 100000x100000, op2 is
100000x1)
#Doesn't work explicitly for sparse matrix with sparse vector
octave:10> res = bsxfun(@eq,a,b);
error: out of memory or dimension too large for Octave's index type
#Often there's a special-case work-around, but it's generally unwieldy
octave:10> b_mat = diag(b) * spones(a);
octave:11> [i,j] = find(a);
octave:12> res = sparse(i,j,nonzeros(a) == nonzeros(b_mat));
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?41441>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [Octave-bug-tracker] [bug #41441] Broadcasting does not behave properly on sparse matrices,
David Spies <=