Skip to content

Commit

Permalink
include cholesky and qr
Browse files Browse the repository at this point in the history
  • Loading branch information
dkarrasch committed Sep 7, 2023
1 parent 1c7dd9d commit 254b378
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/solvers/cholmod.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1439,6 +1439,17 @@ cholesky(A::Union{SparseMatrixCSC{T}, SparseMatrixCSC{Complex{T}},
Hermitian{T, <:SparseMatrixCSC{T}}};
kws...) where {T<:Real} = cholesky(Sparse(A); kws...)

LinearAlgebra._cholesky(A::Union{SparseMatrixCSC{T}, SparseMatrixCSC{Complex{T}},

Check warning on line 1442 in src/solvers/cholmod.jl

View check run for this annotation

Codecov / codecov/patch

src/solvers/cholmod.jl#L1442

Added line #L1442 was not covered by tests
Symmetric{T, <:SparseMatrixCSC{T}},
Hermitian{Complex{T}, <:SparseMatrixCSC{Complex{T}}},
Hermitian{T, <:SparseMatrixCSC{T}}};
kws...) where {T<:Real} = cholesky(A; kws...)
LinearAlgebra._cholesky(A::Union{SparseMatrixCSC{T}, SparseMatrixCSC{Complex{T}},

Check warning on line 1447 in src/solvers/cholmod.jl

View check run for this annotation

Codecov / codecov/patch

src/solvers/cholmod.jl#L1447

Added line #L1447 was not covered by tests
Symmetric{T, <:SparseMatrixCSC{T}},
Hermitian{Complex{T}, <:SparseMatrixCSC{Complex{T}}},
Hermitian{T, <:SparseMatrixCSC{T}}}, ::LinearAlgebra.PivotingStrategy;
kws...) where {T<:Real} = error("Pivoting Strategies are not supported for `SparseMatrixCSC`s")

function ldlt!(F::Factor{Tv}, A::Sparse{Tv};
shift::Real=0.0, check::Bool = true) where Tv
# Makes it an LDLt
Expand Down
5 changes: 5 additions & 0 deletions src/solvers/spqr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,11 @@ LinearAlgebra.qr(A::FixedSparseCSC; tol=_default_tol(A), ordering=ORDERING_DEFAU
let B=A
qr(_unsafe_unfix(B); tol, ordering)
end

LinearAlgebra._qr(A::SparseMatrixCSC; kwargs...) = qr(A; kwargs...)
LinearAlgebra._qr(::SparseMatrixCSC, ::LinearAlgebra.PivotingStrategy; kwargs...) =

Check warning on line 235 in src/solvers/spqr.jl

View check run for this annotation

Codecov / codecov/patch

src/solvers/spqr.jl#L234-L235

Added lines #L234 - L235 were not covered by tests
error("Pivoting Strategies are not supported for `SparseMatrixCSC`s")

function LinearAlgebra.lmul!(Q::QRSparseQ, A::StridedVecOrMat)
if size(A, 1) != size(Q, 1)
throw(DimensionMismatch("size(Q) = $(size(Q)) but size(A) = $(size(A))"))
Expand Down

0 comments on commit 254b378

Please sign in to comment.