linalg.direct_solvers#

Classes#

Inheritance diagram of psydac.linalg.direct_solvers

BandedSolver(u, l, bmat[, transposed])

Solve the equation Ax = b for x, assuming A is banded matrix.

SparseSolver(spmat[, transposed])

Solve the equation Ax = b for x, assuming A is scipy sparse matrix.

Details#

class BandedSolver(u, l, bmat, transposed=False)[source]#

Bases: LinearSolver

Solve the equation Ax = b for x, assuming A is banded matrix.

Parameters:
uinteger

Number of non-zero upper diagonal.

linteger

Number of non-zero lower diagonal.

bmatnd-array

Banded matrix.

property finfo#
property sinfo#
property space#
transpose()[source]#

Return the transpose of the LinearSolver.

solve(rhs, out=None)[source]#

Solves for the given right-hand side.

Parameters:
rhsndarray

The right-hand sides to solve for. The vectors are assumed to be given in C-contiguous order, i.e. if multiple right-hand sides are given, then rhs is a two-dimensional array with the 0-th index denoting the number of the right-hand side, and the 1-st index denoting the element inside a right-hand side.

outndarray | NoneType

Output vector. If given, it has to have the same shape and datatype as rhs.

class SparseSolver(spmat, transposed=False)[source]#

Bases: LinearSolver

Solve the equation Ax = b for x, assuming A is scipy sparse matrix.

Parameters:
spmatscipy.sparse.spmatrix

Generic sparse matrix.

property space#
transpose()[source]#

Return the transpose of the LinearSolver.

solve(rhs, out=None)[source]#

Solves for the given right-hand side.

Parameters:
rhsndarray

The right-hand sides to solve for. The vectors are assumed to be given in C-contiguous order, i.e. if multiple right-hand sides are given, then rhs is a two-dimensional array with the 0-th index denoting the number of the right-hand side, and the 1-st index denoting the element inside a right-hand side.

outndarray | NoneType

Output vector. If given, it has to have the same shape and datatype as rhs.