(a)
| 451 | |
| 452 | |
| 453 | def identity_like_generalized(a): |
| 454 | a = asarray(a) |
| 455 | if a.ndim >= 3: |
| 456 | r = np.empty(a.shape, dtype=a.dtype) |
| 457 | r[...] = identity(a.shape[-2]) |
| 458 | return r |
| 459 | else: |
| 460 | return identity(a.shape[0]) |
| 461 | |
| 462 | |
| 463 | class SolveCases(LinalgSquareTestCase, LinalgGeneralizedSquareTestCase): |