def test_solve_umfpack(self): # Solve with UMFPACK: double precision linsolve.use_solver(useUmfpack=True) a = self.a.astype('d') b = self.b x = linsolve.spsolve(a, b) assert_array_almost_equal(a * x, b)
def test_solve_sparse_rhs(self): # Solve with UMFPACK: double precision, sparse rhs linsolve.use_solver(useUmfpack=True) a = self.a.astype('d') b = csc_matrix(self.b).T x = linsolve.spsolve(a, b) assert_array_almost_equal(a*x, self.b)
def test_solve_umfpack(self): # Solve with UMFPACK: double precision linsolve.use_solver(useUmfpack=True) a = self.a.astype('d') b = self.b x = linsolve.spsolve(a, b) assert_array_almost_equal(a*x, b)
def test_solve_without_umfpack(self): """Solve: single precision""" linsolve.use_solver(useUmfpack=False) a = self.a.astype('f') b = self.b x = linsolve.spsolve(a, b.astype('f')) assert_array_almost_equal(a*x, b, decimal=4)
def test_solve_complex_long_umfpack(self): # Solve with UMFPACK: double precision complex, long indices linsolve.use_solver(useUmfpack=True) a = _to_int64(self.a.astype('D')) b = self.b x = linsolve.spsolve(a, b) assert_array_almost_equal(a * x, b)
def test_solve_sparse_rhs(self): # Solve with UMFPACK: double precision, sparse rhs linsolve.use_solver(useUmfpack=True) a = self.a.astype('d') b = csc_matrix(self.b).T x = linsolve.spsolve(a, b) assert_array_almost_equal(a * x, self.b)
def test_solve_complex_long_umfpack(self): # Solve with UMFPACK: double precision complex, long indices linsolve.use_solver(useUmfpack=True) a = _to_int64(self.a.astype('D')) b = self.b x = linsolve.spsolve(a, b) assert_array_almost_equal(a*x, b)
def test_solve_umfpack(self): """Solve with UMFPACK: double precision""" linsolve.use_solver(useUmfpack=True) a = self.a.astype('d') b = self.b x = linsolve.spsolve(a, b) # print x # print "Error: ", a*x-b assert_array_almost_equal(a*x, b)
def test_solve_sparse_rhs(self): """Solve with UMFPACK: double precision, sparse rhs""" linsolve.use_solver( useUmfpack = True ) a = self.a.astype('d') b = csc_matrix( self.b ) x = linsolve.spsolve(a, b) #print x #print "Error: ", a*x-b assert_array_almost_equal(a*x, self.b)
def test_solve_umfpack(self): """Solve with UMFPACK: double precision""" linsolve.use_solver( useUmfpack = True ) a = self.a.astype('d') b = self.b x = linsolve.spsolve(a, b) #print x #print "Error: ", a*x-b assert_array_almost_equal(a*x, b)
def test_solve_without_umfpack(self): """Solve: single precision""" linsolve.use_solver( useUmfpack = False ) a = self.a.astype('f') b = self.b x = linsolve.spsolve(a, b.astype('f')) #print x #print "Error: ", a*x-b assert_array_almost_equal(a*x, b, decimal=4)
def test_solve_complex_without_umfpack(self): """Solve: single precision complex""" linsolve.use_solver(useUmfpack=False) a = self.a.astype('F') b = self.b x = linsolve.spsolve(a, b) # print x # print "Error: ", a*x-b assert_array_almost_equal(a*x, b, decimal=4)
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_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)
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)