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

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

[Octave-bug-tracker] [bug #58366] [octave forge] (symbolic) equality ele


From: Nicholas Jankowski
Subject: [Octave-bug-tracker] [bug #58366] [octave forge] (symbolic) equality element by element assignment produces Python exception
Date: Wed, 13 May 2020 15:28:28 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36

URL:
  <https://savannah.gnu.org/bugs/?58366>

                 Summary: [octave forge] (symbolic) equality element by
element assignment produces Python exception
                 Project: GNU Octave
            Submitted by: nrjank
            Submitted on: Wed 13 May 2020 03:28:26 PM EDT
                Category: Octave Forge Package
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Unexpected Error
                  Status: None
             Assigned to: None
         Originator Name: Nicholas Jankowski
        Originator Email: 
             Open/Closed: Open
                 Release: 5.2.0
         Discussion Lock: Any
        Operating System: Any

    _______________________________________________________

Details:

As first evidenced in a stackexchange post [1], making an element by element
assignment produces an error, apparently dependent on the assignment order.
here's a simpler example than at stackexchange that causes the same error:


runs fine in Matlab 2020a:

>> syms a b c d
>> e = [a == b, c == d]
e =
[ a == b, c == d]
>> f(1) = a==b
f =
a == b
>> f(2) = c==d
f =
[ a == b, c == d]
>> g(2) = c==d
g =
[ 0, c == d]
>> g(1) = a==b
g =
[ a == b, c == d]
>> h(2) = c==d
h =
[ 0, c == d]
>> h(1) = a==b
h =
[ a == b, c == d]
>> h(3) = a==c
h =
[ a == b, c == d, a == c]


output from Octave 5.2.0, Windows 10, with Symbolic 2.9.0 (and unbundled
Python 3.7):

>> pkg load symbolic
>> syms a b c d
Symbolic pkg v2.9.0: Python communication link active, SymPy v1.3.
>> e = [a == b, c == d]
e = (sym) [a = b  c = d]  (1x2 matrix)
>> f(1) = a==b
f = (sym) a = b
>> f(2) = c==d
error: Python exception: TypeError: cannot determine truth value of
Relational
    occurred at line 7 of the Python code block:
    if not A or not A.is_Matrix:
error: called from
    pycall_sympy__ at line 178 column 7
    mat_rclist_asgn at line 78 column 5
    mat_replace at line 144 column 5
    subsasgn at line 101 column 13
>> g(2) = c==d
g = (sym) [0  c = d]  (1x2 matrix)
>> g(1) = a==b
g = (sym) [a = b  c = d]  (1x2 matrix)
>> h(2) = c==d
h = (sym) [0  c = d]  (1x2 matrix)
>> h(1) = a==b
h = (sym) [a = b  c = d]  (1x2 matrix)
>> h(3) = a==c
h = (sym) [a = b  c = d  a = c]  (1x3 matrix)


not sure what unique case is occurring under the hood when it goes from size
1->2, but the error doesn't reoccur at size 2->3.  




    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?58366>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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