@@ -462,28 +462,30 @@ Note that this example aliases the parameters together for a memory-reduced repr
462462* `probs`: the collection of problems to solve
463463* `explictfuns!`: the explicit functions for mutating the parameter set
464464"""
465- mutable struct SCCNonlinearProblem{uType, iip, P, E, I , Par} < :
465+ mutable struct SCCNonlinearProblem{uType, iip, P, E, F <: NonlinearFunction{iip} , Par} < :
466466 AbstractNonlinearProblem{uType, iip}
467467 probs:: P
468468 explicitfuns!:: E
469- full_index_provider:: I
470- parameter_object:: Par
469+ # NonlinearFunction with `f = Returns(nothing)`
470+ f:: F
471+ p:: Par
471472 parameters_alias:: Bool
472473
473- function SCCNonlinearProblem {P, E, I , Par} (
474- probs :: P , funs :: E , indp :: I , pobj :: Par , alias:: Bool ) where {P, E, I , Par}
474+ function SCCNonlinearProblem {P, E, F , Par} (probs :: P , funs :: E , f :: F , pobj :: Par ,
475+ alias:: Bool ) where {P, E, F <: NonlinearFunction , Par}
475476 u0 = mapreduce (
476477 state_values, vcat, probs; init = similar (state_values (first (probs)), 0 ))
477478 uType = typeof (u0)
478- new {uType, false, P, E, I , Par} (probs, funs, indp , pobj, alias)
479+ new {uType, false, P, E, F , Par} (probs, funs, f , pobj, alias)
479480 end
480481end
481482
482- function SCCNonlinearProblem (probs, explicitfuns!, full_index_provider = nothing ,
483- parameter_object = nothing , parameters_alias = false )
483+ function SCCNonlinearProblem (probs, explicitfuns!, parameter_object = nothing ,
484+ parameters_alias = false ; kwargs... )
485+ f = NonlinearFunction {false} (Returns (nothing ); kwargs... )
484486 return SCCNonlinearProblem{typeof (probs), typeof (explicitfuns!),
485- typeof (full_index_provider ), typeof (parameter_object)}(
486- probs, explicitfuns!, full_index_provider , parameter_object, parameters_alias)
487+ typeof (f ), typeof (parameter_object)}(
488+ probs, explicitfuns!, f , parameter_object, parameters_alias)
487489end
488490
489491function Base. getproperty (prob:: SCCNonlinearProblem , name:: Symbol )
@@ -496,10 +498,10 @@ function Base.getproperty(prob::SCCNonlinearProblem, name::Symbol)
496498end
497499
498500function SymbolicIndexingInterface. symbolic_container (prob:: SCCNonlinearProblem )
499- prob. full_index_provider
501+ prob. f
500502end
501503function SymbolicIndexingInterface. parameter_values (prob:: SCCNonlinearProblem )
502- prob. parameter_object
504+ prob. p
503505end
504506function SymbolicIndexingInterface. state_values (prob:: SCCNonlinearProblem )
505507 mapreduce (
517519
518520function SymbolicIndexingInterface. set_parameter! (prob:: SCCNonlinearProblem , val, idx)
519521 if prob. parameter_object != = nothing
520- set_parameter! (prob. parameter_object , val, idx)
522+ set_parameter! (prob. p , val, idx)
521523 prob. parameters_alias && return
522524 end
523525 for scc in prob. probs
0 commit comments