gnu-octave / symbolic

A Symbolic Package for Octave using SymPy
https://octave.sourceforge.io/symbolic/
GNU General Public License v3.0
151 stars 36 forks source link

subs: needs to use make_matrix_or_array #1226

Closed cbm755 closed 1 year ago

cbm755 commented 2 years ago

MWE, from test @sym/and:

syms x
e = (x == 3) & (x^2 == 9);
subs(e, x, [-3 0 3])
sympy(ans)
ans = MutableDenseMatrix([[false, false, true]])

Here e is a scalar but subs "broadcasts" to the size of [-3 0 3].

I guess the implementation needs to do a list-of-lists thing and then call make_matrix_or_array.

Blocks #1124.

alexvong243f commented 1 year ago

Fixed by https://github.com/cbm755/octsympy/pull/1227