(self, a, b, tags)
| 491 | class SolveCases(LinalgSquareTestCase, LinalgGeneralizedSquareTestCase): |
| 492 | # kept apart from TestSolve for use for testing with matrices. |
| 493 | def do(self, a, b, tags): |
| 494 | x = linalg.solve(a, b) |
| 495 | if np.array(b).ndim == 1: |
| 496 | # When a is (..., M, M) and b is (M,), it is the same as when b is |
| 497 | # (M, 1), except the result has shape (..., M) |
| 498 | adotx = matmul(a, x[..., None])[..., 0] |
| 499 | assert_almost_equal(np.broadcast_to(b, adotx.shape), adotx) |
| 500 | else: |
| 501 | adotx = matmul(a, x) |
| 502 | assert_almost_equal(b, adotx) |
| 503 | assert_(consistent_subclass(x, b)) |
| 504 | |
| 505 | |
| 506 | class TestSolve(SolveCases): |
nothing calls this directly
no test coverage detected