[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #35787] Diagonal matrices don't broadcast
From: |
Lachlan Andrew |
Subject: |
[Octave-bug-tracker] [bug #35787] Diagonal matrices don't broadcast |
Date: |
Sat, 11 Jul 2015 03:50:15 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36 |
Follow-up Comment #4, bug #35787 (project octave):
This is still an issue in version 4.0.0.
It is easy to work around by placing the diagonal matrix in [...]:
> [eye(2)] + [1 0]
ans =
2 0
1 1
However, that is not done in some library routines (I was bitten by mvnrnd.m)
and so Matlab-compliant user code that does not rely on automatic broadcasting
can be affected. The bug has been open for three years; is it time to rewrite
all library routines to work around it?
Another surprising twist is that a slice of a diagonal matrix is still
considered "diagonal".
> a = eye(2);
> b = a(1,:)
b =
Diagonal Matrix
1 0
> b + [1; 0]
error: operator +: nonconformant arguments (op1 is 1x2, op2 is 2x1)
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?35787>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Octave-bug-tracker] [bug #35787] Diagonal matrices don't broadcast,
Lachlan Andrew <=