Skip to content

Commit

Permalink
Banded QR for non square matrices
Browse files Browse the repository at this point in the history
  • Loading branch information
avik-pal committed Oct 25, 2023
1 parent 4ee3e1e commit 9fbc583
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions ext/LinearSolveBandedMatricesExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,14 @@ import LinearSolve: defaultalg,
do_factorization, init_cacheval, DefaultLinearSolver, DefaultAlgorithmChoice

# Defaults for BandedMatrices
function defaultalg(A::BandedMatrix, b, ::OperatorAssumptions)
return DefaultLinearSolver(DefaultAlgorithmChoice.DirectLdiv!)
function defaultalg(A::BandedMatrix, b, oa::OperatorAssumptions)
if oa.issq
return DefaultLinearSolver(DefaultAlgorithmChoice.DirectLdiv!)
elseif LinearSolve.is_underdetermined(A)
error("No solver for underdetermined `A::BandedMatrix` is currently implemented!")

Check warning on line 12 in ext/LinearSolveBandedMatricesExt.jl

View check run for this annotation

Codecov / codecov/patch

ext/LinearSolveBandedMatricesExt.jl#L8-L12

Added lines #L8 - L12 were not covered by tests
else
return DefaultLinearSolver(DefaultAlgorithmChoice.QRFactorization)

Check warning on line 14 in ext/LinearSolveBandedMatricesExt.jl

View check run for this annotation

Codecov / codecov/patch

ext/LinearSolveBandedMatricesExt.jl#L14

Added line #L14 was not covered by tests
end
end

function defaultalg(A::Symmetric{<:Number, <:BandedMatrix}, b, ::OperatorAssumptions)
Expand Down

0 comments on commit 9fbc583

Please sign in to comment.