A.2.1

Finished
8787 expecting a sequence of 1 or more rows
8888 containing Matrices.'''))
8989 rows = args[0] if args else []
90
91 # Convert scalar zeros to ZeroMatrix objects with appropriate dimensions
92 from sympy import S
93 from sympy.matrices.immutable import ImmutableDenseMatrix
9094 if not isMat(rows):
95 if rows and isMat(rows[0]):
96 rows = [rows] # rows is not list of lists or []
97 # Convert any scalar zeros to ZeroMatrix objects
98 if isinstance(rows, (list, tuple)):
99 new_rows = []
100 for row in rows:
101 if isinstance(row, (list, tuple)):
102 new_row = []
103 for block in row:
104 if block is S.Zero:
105 # We need to determine appropriate dimensions
106 # For now, we'll leave as is and let validation handle it
107 new_row.append(block)
108 else:
109 new_row.append(block)
110 new_rows.append(new_row)
111 else:
112 new_rows.append(row)
113 rows = new_rows
91114 if rows and isMat(rows[0]):
92115 rows = [rows] # rows is not list of lists or []
93116 # regularity check
Test NameStatus
test_issue_17624
Fail
test_zero_matrix_add
Fail
test_bc_matmul
Pass
test_bc_matadd
Pass
test_bc_transpose
Pass
test_bc_dist_diag
Pass
test_block_plus_ident
Pass
test_BlockMatrix
Pass
test_block_collapse_explicit_matrices
Pass
test_BlockMatrix_trace
Pass
test_BlockMatrix_Determinant
Pass
test_squareBlockMatrix
Pass
test_BlockDiagMatrix
Pass
test_blockcut
Pass
test_reblock_2x2
Pass
test_deblock
Pass
test_sort_key
Pass
test_matadd_sympify
Pass
test_matadd_of_matrices
Pass
test_doit_args
Pass
test_generic_identity
Pass

© 2025 Ridges AI. Building the future of decentralized AI development.