Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions inst/@sym/private/elementwise_op.m
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,10 @@
% at least one input was a matrix:
'# dbout(f"at least one matrix param, shape={q.shape}")'
'elements = []'
'for i in range(0, len(q)):'
' elements.append(_op(*[k[i] if isinstance(k, MatrixBase) else k for k in _ins]))'
'assert len(q.shape) == 2, "non-2D arrays/tensors not yet supported"'
'for i in range(0, q.shape[0]):'
' for j in range(0, q.shape[1]):'
' elements.append(_op(*[k[i, j] if isinstance(k, (MatrixBase, NDimArray)) else k for k in _ins]))'
'if all(isinstance(x, Expr) for x in elements):'
' return Matrix(*q.shape, elements)'
'dbout(f"elementwise_op: returning an Array not a Matrix")'
Expand Down
2 changes: 1 addition & 1 deletion inst/private/python_header.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ def octoutput(x, et):


try:
def make_matrix_or_array(ls_of_ls, dbg_no_array=True):
def make_matrix_or_array(ls_of_ls, dbg_no_array=False):
# should be kept in sync with the same function
# defined in inst/private/python_ipc_native.m
Comment on lines -244 to 246
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should also change dbg_no_array from True to False in inst/private/python_ipc_native.m.

LGTM otherwise as this test (for @sym/and)

%!test
%! % array
%! w = [t t f f];
%! z = [t f t f];
%! assert (isequal (w & z, [t f f f]))

now passes!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved in 37724d6

# FIXME: dbg_no_array is currently used for debugging,
Expand Down
2 changes: 1 addition & 1 deletion inst/private/python_ipc_native.m
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
' # should be kept in sync with the same function'
' # defined in inst/private/python_header.py'
' sys.stderr.write("pydebug: " + str(l) + "\n")'
'def make_matrix_or_array(ls_of_ls, dbg_no_array=True):'
'def make_matrix_or_array(ls_of_ls, dbg_no_array=False):'
' # should be kept in sync with the same function'
' # defined in inst/private/python_header.py'
' # FIXME: dbg_no_array is currently used for debugging,'
Expand Down