MCPcopy Create free account
hub / github.com/PyMesh/PyMesh / test_identity

Method test_identity

python/pymesh/tests/test_sparse_solver.py:9–19  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

7
8class SparseSolverTest(TestCase):
9 def test_identity(self):
10 N =1000
11 M = scipy.sparse.eye(N)
12 rhs = np.ones(N)
13 for solver_type in pymesh.SparseSolver.get_supported_solvers():
14 solver = pymesh.SparseSolver.create(solver_type)
15 solver.max_iterations = 10
16 solver.analyze_pattern(M)
17 solver.factorize(M)
18 x = solver.solve(rhs)
19 self.assert_array_almost_equal(rhs.ravel(), x.ravel())
20

Callers

nothing calls this directly

Calls 6

get_supported_solversMethod · 0.45
createMethod · 0.45
analyze_patternMethod · 0.45
factorizeMethod · 0.45
solveMethod · 0.45

Tested by

no test coverage detected