Optimization for derivation of STEADY_STATE(…) operator in a dynamic context
In a dynamic context, the only potentially non-null derivatives of STEADY_STATE(…) are the parameters. We know that the derivatives w.r.t. other variables are zero, so store that information in non_null_derivatives.master
parent
d64317a64f
commit
41052ccb74
|
@ -2136,13 +2136,18 @@ UnaryOpNode::prepareForDerivation()
|
|||
|
||||
preparedForDerivation = true;
|
||||
|
||||
arg->prepareForDerivation();
|
||||
|
||||
// Non-null derivatives are those of the argument (except for STEADY_STATE)
|
||||
non_null_derivatives = arg->non_null_derivatives;
|
||||
if (op_code == UnaryOpcode::steadyState || op_code == UnaryOpcode::steadyStateParamDeriv
|
||||
|| op_code == UnaryOpcode::steadyStateParam2ndDeriv)
|
||||
/* Non-null derivatives are those of the argument (except for STEADY_STATE in
|
||||
a dynamic context, in which case the potentially non-null derivatives are
|
||||
all the parameters) */
|
||||
if ((op_code == UnaryOpcode::steadyState || op_code == UnaryOpcode::steadyStateParamDeriv
|
||||
|| op_code == UnaryOpcode::steadyStateParam2ndDeriv)
|
||||
&& datatree.isDynamic())
|
||||
datatree.addAllParamDerivId(non_null_derivatives);
|
||||
else
|
||||
{
|
||||
arg->prepareForDerivation();
|
||||
non_null_derivatives = arg->non_null_derivatives;
|
||||
}
|
||||
}
|
||||
|
||||
expr_t
|
||||
|
|
Loading…
Reference in New Issue