cjdrake / pyeda

Python EDA
BSD 2-Clause "Simplified" License
304 stars 54 forks source link

Enhance farray concatenate/repeat for MDAs #96

Closed cjdrake closed 10 years ago

cjdrake commented 10 years ago

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, and A.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.

cjdrake commented 10 years ago

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.