bugGNU Octave - Bugs: bug #58869, [octave forge] (symbolic) Failure...

 
 

bug #58869: [octave forge] (symbolic) Failure in matrix division

Submitter:  Rafael Laboissière <rlaboiss>
Submitted:  Sun 02 Aug 2020 10:48:55 AM UTC
   
 
Category:  Octave Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Regression
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * other Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 06 Jul 2022 06:51:39 PM UTC, comment #3: 

Closing as fixed as requested.

Markus Mützel <mmuetzel>
Group administrator
Wed 06 Jul 2022 06:26:17 PM UTC, comment #2: 

This should be fixed in 3.0.0, please close.

Colin Macdonald <cbm>
Sat 31 Oct 2020 10:22:02 AM UTC, comment #1: 

I was trying to look into this issue in order to fix octave-symbolic in Fedora 33 (that has sympy 1.6.2).

One option to solve this problem would be to rework the generated python code so that instead of issuing

eye (2) / Matrix ([[1, 2], [3, 4]])

it would generate the following python code:

eye(2).multiply_elementwise(Matrix ([[1, 2], [3, 4]]).applyfunc(lambda x: 1/x))

This should work, no?

José Matos <jamatos>
Sun 02 Aug 2020 10:48:55 AM UTC, original submission:  

The following is failing with version 2.9.0 of the symbolic package and with SymPy 1.6.1:


octave:1> pkg load symbolic
octave:2> sym (eye (2)) / sym ([1 2; 3 4])
Symbolic pkg v2.9.0: Python communication link active, SymPy v1.6.1.
error: Python exception: TypeError: unsupported operand type(s) for /: 'One' and 'MutableDenseMatrix'
    occurred at line 1 of the Python code block:
    return _ins[0]/_ins[1],
error: called from
    pycall_sympy__ at line 178 column 7
    mrdivide at line 79 column 5


The bug seems to come from SymPy itself:


>>> from sympy import *
>>> eye (2) / Matrix ([[1, 2], [3, 4]])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/sympy/core/decorators.py", line 127, in binary_op_wrapper
    return func(self, other)
  File "/usr/lib/python3/dist-packages/sympy/matrices/common.py", line 2712, in __truediv__
    return self.__div__(other)
  File "/usr/lib/python3/dist-packages/sympy/core/decorators.py", line 127, in binary_op_wrapper
    return func(self, other)
  File "/usr/lib/python3/dist-packages/sympy/matrices/common.py", line 2452, in __div__
    return self * (self.one / other)
TypeError: unsupported operand type(s) for /: 'One' and 'MutableDenseMatrix'


BTW, this problem cause the failure of many unit tests in inst/@sym/mrdivide.m.

Rafael Laboissière <rlaboiss>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mmuetzel (Posted a comment)
  • -email is unavailable- added by cbm (Posted a comment)
  • -email is unavailable- added by jamatos (Posted a comment)
  • -email is unavailable- added by rlaboiss (Submitted the item)
  •  

    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 group members can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-07-06 mmuetzel StatusNone Fixed
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code