Skip to content

Commit b8d4a97

Browse files
Update bounds checking to support NonlinearProblem as well
Extended bounds checking in NonlinearSolveBase to support both NonlinearProblem and NonlinearLeastSquaresProblem with lb/ub fields. Updated SciMLBase PR to add lb/ub fields to both problem types: - Removed unnecessary UNSET_BOUNDS constant - Added lb/ub fields to NonlinearProblem - Updated ConstructionBase.constructorof for both problem types 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent cf7bea5 commit b8d4a97

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/NonlinearSolveBase/src/solve.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,9 @@ function solve_call(_prob, args...; merge_callbacks = true, kwargshandle = nothi
137137

138138
checkkwargs(kwargshandle; kwargs...)
139139

140-
# Check bounds support for NonlinearLeastSquaresProblem
141-
if _prob isa SciMLBase.NonlinearLeastSquaresProblem &&
140+
# Check bounds support for problems with bounds
141+
if (_prob isa SciMLBase.NonlinearProblem || _prob isa SciMLBase.NonlinearLeastSquaresProblem) &&
142+
(hasfield(typeof(_prob), :lb) && hasfield(typeof(_prob), :ub)) &&
142143
(_prob.lb !== nothing || _prob.ub !== nothing) &&
143144
length(args) > 0 && !SciMLBase.allowsbounds(args[1])
144145
error("Algorithm $(args[1]) does not support bounds. Use an algorithm with allowsbounds(alg) == true.")

0 commit comments

Comments
 (0)