Skip to content

Commit dd57d23

Browse files
committed
Add ReturnCodes for NonlinearSolve.jl
1 parent c4a29dd commit dd57d23

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/retcodes.jl

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
EnumX.@enumx(ReturnCode, Default, Success, Terminated, DtNaN, MaxIters, DtLessThanMin, Unstable,
2-
InitialFailure, ConvergenceFailure, Failure)
1+
EnumX.@enumx(ReturnCode, Default, Success, Terminated, DtNaN, MaxIters, DtLessThanMin,
2+
Unstable,
3+
InitialFailure, ConvergenceFailure, Failure, ExactSolutionLeft,
4+
ExactSolutionRight, FloatingPointLimit)
35

46
Base.convert(::Type{Symbol}, retcode::ReturnCode.T) = Symbol(retcode)
57

@@ -38,4 +40,7 @@ function Base.convert(::Type{ReturnCode.T}, bool::Bool)
3840
bool ? ReturnCode.Success : ReturnCode.Failure
3941
end
4042

41-
successful_retcode(retcode::ReturnCode.T) = retcode == :Success || retcode == :Terminated
43+
function successful_retcode(retcode::ReturnCode.T)
44+
retcode == :Success || retcode == :Terminated || retcode == :ExactSolutionLeft ||
45+
retcode == :ExactSolutionRight || retcode == :FloatingPointLimit
46+
end

0 commit comments

Comments
 (0)