Skip to content

Commit

Permalink
fix: NonlinearLeastSquaresProblem is not a trivial initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
AayushSabharwal committed Dec 3, 2024
1 parent 651899b commit e2db32e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/initialization.jl
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ function get_initial_values(prob, valp, f, alg::OverrideInit,
initdata.update_initializeprob!(initprob, valp)
end

if state_values(initprob) === nothing
if is_trivial_initialization(initdata)
nlsol = initprob
success = true
else
Expand Down Expand Up @@ -227,7 +227,8 @@ function get_initial_values(prob, valp, f, alg::OverrideInit,
end

function is_trivial_initialization(initdata::OverrideInitData)
state_values(initdata.initializeprob) === nothing
!(initdata.initializeprob isa NonlinearLeastSquaresProblem) &&
state_values(initdata.initializeprob) === nothing
end

function is_trivial_initialization(f::AbstractSciMLFunction)
Expand Down

0 comments on commit e2db32e

Please sign in to comment.