Add a New Comment (Rich Markup)
I pushed the cset here (http://hg.savannah.gnu.org/hgweb/octave/rev/724fe19b50dc).
Thanks Rik and sorry for having forgotten about this. You cset fixes the problem. I haven't come across other places in the code where broadcasting was an issue.
Try the attached cset center.cset. If there are other common uses of broadcasting it would be best to find them now and temporarily replace them. (file #41448)
It would be okay to modify center until this is fixed. If you can submit a proposed patch that would help. In the code, before the modification, add a note about why this is being done and when it can be reverted. Something like
## FIXME: Use bsxfun, rather than broadcasting, until broadcasting ## supports diagonal and sparse matrices (Bugs #41441, #35787).
The fact that center() relies on broadcasting makes it crash when the input is a sparse or diagonal matrix:
>> center (eye (3)) error: center: operator -: nonconformant arguments (op1 is 3x3, op2 is 1x3) error: called from center at line 72 column 12 >> center (sparse (rand (3))) error: center: operator -: nonconformant arguments (op1 is 3x3, op2 is 1x3) error: called from center at line 72 column 12
These limitations of broadcasting are known (see bug #41441 and bug #35787) but are quite annoying when core functions rely on it - I came across this while calling var() on a sparse matrix. If fixing the mentioned bugs are long term projects, would it be ok to modify center() not to rely on broadcasting and use bsxfun() instead?
(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)
Attach Files: Comment:
Depends on the following items: None found
Items that depend on this one: None found
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Only project members can vote.
Please enter the title of George Orwell's famous dystopian book (it's a date):
Follow 5 latest changes.
Copyright © 2023 Free Software Foundation, Inc. Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved. The Levitating, Meditating, Flute-playing Gnu logo is a GNU GPL'ed image provided by the Nevrax Design Team. Source Code
Powered by Savane 3.11