|
|
|
|
@ -51,6 +51,24 @@ function solve!(solver::HYPRESolver, x::PVector, A::PSparseMatrix, b::PVector)
@@ -51,6 +51,24 @@ function solve!(solver::HYPRESolver, x::PVector, A::PSparseMatrix, b::PVector)
|
|
|
|
|
return x |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
######################################## |
|
|
|
|
# SparseMatrixCS(C|R) solver interface # |
|
|
|
|
######################################## |
|
|
|
|
|
|
|
|
|
# TODO: This could use the HYPRE compile flag for sequential mode to avoid MPI overhead |
|
|
|
|
|
|
|
|
|
function solve(solver::HYPRESolver, A::Union{SparseMatrixCSC,SparseMatrixCSR}, b::Vector) |
|
|
|
|
hypre_x = solve(solver, HYPREMatrix(A), HYPREVector(b)) |
|
|
|
|
x = copy!(copy(b), hypre_x) |
|
|
|
|
return x |
|
|
|
|
end |
|
|
|
|
function solve!(solver::HYPRESolver, x::Vector, A::Union{SparseMatrixCSC,SparseMatrixCSR}, b::Vector) |
|
|
|
|
hypre_x = HYPREVector(x) |
|
|
|
|
solve!(solver, hypre_x, HYPREMatrix(A), HYPREVector(b)) |
|
|
|
|
copy!(x, hypre_x) |
|
|
|
|
return x |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
##################################### |
|
|
|
|
## Concrete solver implementations ## |
|
|
|
|
|