Skip to content

Commit

Permalink
Remove fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
avik-pal committed Oct 25, 2023
1 parent 988e3f7 commit 45adbd0
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions src/LinearSolve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -153,24 +153,9 @@ end
needs_square_A(alg)
Returns `true` if the algorithm requires a square matrix.
Note that this checks if the implementation of the algorithm needs a square matrix by
trying to solve an underdetermined system. It is recommended to add a dispatch to this
function for custom algorithms!
"""
needs_square_A(::Nothing) = false # Linear Solve automatically will use a correct alg!
function needs_square_A(alg::SciMLLinearSolveAlgorithm)
try
A = [1.0 2.0;
3.0 4.0;
5.0 6.0]
b = ones(Float64, 3)
solve(LinearProblem(A, b), alg)
return false
catch err
return true
end
end
needs_square_A(alg::SciMLLinearSolveAlgorithm) = true

Check warning on line 158 in src/LinearSolve.jl

View check run for this annotation

Codecov / codecov/patch

src/LinearSolve.jl#L157-L158

Added lines #L157 - L158 were not covered by tests
for alg in (:QRFactorization, :FastQRFactorization, :NormalCholeskyFactorization,
:NormalBunchKaufmanFactorization)
@eval needs_square_A(::$(alg)) = false
Expand Down

0 comments on commit 45adbd0

Please sign in to comment.