octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #46110] broadcasting with diagonal matrices fa


From: jan
Subject: [Octave-bug-tracker] [bug #46110] broadcasting with diagonal matrices fails for addition
Date: Sat, 03 Oct 2015 09:56:24 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:41.0) Gecko/20100101 Firefox/41.0

URL:
  <http://savannah.gnu.org/bugs/?46110>

                 Summary: broadcasting with diagonal matrices fails for
addition
                 Project: GNU Octave
            Submitted by: pfa
            Submitted on: lör  3 okt 2015 09.56.23
                Category: None
                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: 4.0.0
        Operating System: GNU/Linux

    _______________________________________________________

Details:

Broadcasting for diagonal matrices fails in general for addition in the
releases 3.8.2, 4.0.0, and dev. Broadcasting works in the case of addition of
a scalar and returns then a full matrix. 

A related bug is addresses for the case of sparse matrices in the bug #41441:
"Broadcasting does not behave properly on sparse matrices".



>> diag([1,2])+[0;0]
error: operator +: nonconformant arguments (op1 is 2x2, op2 is 2x1)

>> sparse(diag([1,2]))+[0;0]
error: operator +: nonconformant arguments (op1 is 2x2, op2 is 2x1)

>> full(sparse(diag([1,2])))+[0;0]
ans =

   1   0
   0   2

>> diag([1;2])+0
ans =

   1   0
   0   2

>> sparse(diag([1;2]))+[0]
ans =

   1   0
   0   2





    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?46110>

_______________________________________________
  Meddelandet skickades via/av Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]