Skip to content

Commit 9fbc583

Browse files
committed
Banded QR for non square matrices
1 parent 4ee3e1e commit 9fbc583

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

ext/LinearSolveBandedMatricesExt.jl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,14 @@ import LinearSolve: defaultalg,
55
do_factorization, init_cacheval, DefaultLinearSolver, DefaultAlgorithmChoice
66

77
# Defaults for BandedMatrices
8-
function defaultalg(A::BandedMatrix, b, ::OperatorAssumptions)
9-
return DefaultLinearSolver(DefaultAlgorithmChoice.DirectLdiv!)
8+
function defaultalg(A::BandedMatrix, b, oa::OperatorAssumptions)
9+
if oa.issq
10+
return DefaultLinearSolver(DefaultAlgorithmChoice.DirectLdiv!)
11+
elseif LinearSolve.is_underdetermined(A)
12+
error("No solver for underdetermined `A::BandedMatrix` is currently implemented!")
13+
else
14+
return DefaultLinearSolver(DefaultAlgorithmChoice.QRFactorization)
15+
end
1016
end
1117

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

0 commit comments

Comments
 (0)