MCPcopy Index your code
hub / github.com/numpy/numpy / do

Method do

numpy/linalg/tests/test_linalg.py:493–503  ·  view source on GitHub ↗
(self, a, b, tags)

Source from the content-addressed store, hash-verified

491class 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
506class TestSolve(SolveCases):

Callers

nothing calls this directly

Calls 4

matmulFunction · 0.90
assert_almost_equalFunction · 0.90
assert_Function · 0.90
consistent_subclassFunction · 0.85

Tested by

no test coverage detected