def test_factorized_without_umfpack(self): # Prefactorize matrix for solving with multiple rhs linsolve.use_solver(useUmfpack=False) a = self.a.astype('d') solve = linsolve.factorized(a) x1 = solve(self.b) assert_array_almost_equal(a*x1, self.b) x2 = solve(self.b2) assert_array_almost_equal(a*x2, self.b2)
def test_factorized_umfpack(self): """Prefactorize (with UMFPACK) matrix for solving with multiple rhs""" linsolve.use_solver(useUmfpack=True) a = self.a.astype('d') solve = linsolve.factorized(a) x1 = solve(self.b) assert_array_almost_equal(a*x1, self.b) x2 = solve(self.b2) assert_array_almost_equal(a*x2, self.b2)
def test_factorized_without_umfpack(self): # Prefactorize matrix for solving with multiple rhs linsolve.use_solver(useUmfpack=False) a = self.a.astype('d') solve = linsolve.factorized(a) x1 = solve(self.b) assert_array_almost_equal(a * x1, self.b) x2 = solve(self.b2) assert_array_almost_equal(a * x2, self.b2)
def test_factorized_long_umfpack(self): # Prefactorize (with UMFPACK) matrix for solving with multiple rhs linsolve.use_solver(useUmfpack=True) a = _to_int64(self.a.astype('d')) solve = linsolve.factorized(a) x1 = solve(self.b) assert_array_almost_equal(a * x1, self.b) x2 = solve(self.b2) assert_array_almost_equal(a * x2, self.b2)