Closed cjdrake closed 10 years ago
Right now, A + B will auto-flatten the array. It would be cool if 5x2 + 7x2 = 12x2, and 5x2x3 + 7x2x3 = 12x2x3.
A + B
If A.ndim == B.ndim, and A.shape[0:ndim-1] == B.shape[0:ndim-1], then it's straight-forward to construct the new array. Otherwise, just flatten.
A.ndim == B.ndim
A.shape[0:ndim-1] == B.shape[0:ndim-1]
Also, A * 3 will auto-flatten. Similar to above, 4x4 * 2 = 8x4.
A * 3
There are problems with the implementation of irregulars MDAs (non-zero start indices). Since the result most likely won't make any sense, better to just flatten them.
Right now,
A + B
will auto-flatten the array. It would be cool if 5x2 + 7x2 = 12x2, and 5x2x3 + 7x2x3 = 12x2x3.If
A.ndim == B.ndim
, andA.shape[0:ndim-1] == B.shape[0:ndim-1]
, then it's straight-forward to construct the new array. Otherwise, just flatten.Also,
A * 3
will auto-flatten. Similar to above, 4x4 * 2 = 8x4.