Skip to content

Commit edd41c9

Browse files
committed
use SciMLMessage for fallback to QR factorization
1 parent 05bff1f commit edd41c9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/default.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,9 @@ end
364364
newex = quote
365365
sol = SciMLBase.solve!(cache, $(algchoice_to_alg(alg)), args...; kwargs...)
366366
if sol.retcode === ReturnCode.Failure && alg.safetyfallback
367-
## TODO: Add verbosity logging here about using the fallback
367+
@SciMLMessage("LU factorization failed, falling back to QR factorization. `A` is potentially rank-deficient.",
368+
cache.verbose, :default_lu_fallback, :error_control)
369+
368370
sol = SciMLBase.solve!(cache, QRFactorization(ColumnNorm()), args...; kwargs...)
369371
SciMLBase.build_linear_solution(alg, sol.u, sol.resid, sol.cache;
370372
retcode = sol.retcode,
@@ -383,7 +385,9 @@ end
383385

384386
sol = SciMLBase.solve!(cache, $(algchoice_to_alg(alg)), args...; kwargs...)
385387
if sol.retcode === ReturnCode.Failure && alg.safetyfallback
386-
## TODO: Add verbosity logging here about using the fallback
388+
@SciMLMessage("LU factorization failed, falling back to QR factorization. `A` is potentially rank-deficient.",
389+
cache.verbose, :default_lu_fallback, :error_control)
390+
387391
sol = SciMLBase.solve!(cache, QRFactorization(ColumnNorm()), args...; kwargs...)
388392
SciMLBase.build_linear_solution(alg, sol.u, sol.resid, sol.cache;
389393
retcode = sol.retcode,

0 commit comments

Comments
 (0)