@@ -206,7 +206,29 @@ function SciMLBase.solve(prob::StaticLinearProblem, args...; kwargs...)
206206end
207207
208208function SciMLBase. solve (prob:: StaticLinearProblem ,
209- alg:: Union{Nothing, SciMLLinearSolveAlgorithm} , args... ; kwargs... )
209+ alg:: Nothing , args... ; kwargs... )
210+ if alg === nothing || alg isa DirectLdiv!
211+ u = prob. A \ prob. b
212+ elseif alg isa LUFactorization
213+ u = lu (prob. A) \ prob. b
214+ elseif alg isa QRFactorization
215+ u = qr (prob. A) \ prob. b
216+ elseif alg isa CholeskyFactorization
217+ u = cholesky (prob. A) \ prob. b
218+ elseif alg isa NormalCholeskyFactorization
219+ u = cholesky (Symmetric (prob. A' * prob. A)) \ (prob. A' * prob. b)
220+ elseif alg isa SVDFactorization
221+ u = svd (prob. A) \ prob. b
222+ else
223+ # Slower Path but handles all cases
224+ cache = init (prob, alg, args... ; kwargs... )
225+ return solve! (cache)
226+ end
227+ return SciMLBase. build_linear_solution (alg, u, nothing , prob)
228+ end
229+
230+ function SciMLBase. solve (prob:: StaticLinearProblem ,
231+ alg:: SciMLLinearSolveAlgorithm , args... ; kwargs... )
210232 if alg === nothing || alg isa DirectLdiv!
211233 u = prob. A \ prob. b
212234 elseif alg isa LUFactorization
0 commit comments