Verified Commit 8ae7f81f authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

Fix bug with var_expectation nodes introduced in 38152c34

We must provide a return value for
VarExpectationNode::maxLagWithDiffsExpanded().

Return zero, which will lead to the right overall result even if it is not
strictly the right choice (see the comment in the code).
parent 20690e16
Pipeline #872 passed with stage
in 1 minute and 23 seconds
...@@ -8775,8 +8775,14 @@ VarExpectationNode::maxLag() const ...@@ -8775,8 +8775,14 @@ VarExpectationNode::maxLag() const
int int
VarExpectationNode::maxLagWithDiffsExpanded() const VarExpectationNode::maxLagWithDiffsExpanded() const
{ {
cerr << "VarExpectationNode::maxLagWithDiffsExpanded not implemented." << endl; /* This node will be substituted by lagged variables, so in theory we should
exit(EXIT_FAILURE); return a strictly positive value. But from here this value is not easy to
compute.
We return 0, because currently this function is only called from
DynamicModel::setLeadsLagsOrig(), and the maximum lag will nevertheless be
correctly computed because the maximum lag of the VAR will be taken into
account via the corresponding equations. */
return 0;
} }
expr_t expr_t
...@@ -9238,6 +9244,7 @@ PacExpectationNode::maxLag() const ...@@ -9238,6 +9244,7 @@ PacExpectationNode::maxLag() const
int int
PacExpectationNode::maxLagWithDiffsExpanded() const PacExpectationNode::maxLagWithDiffsExpanded() const
{ {
// Same comment as in VarExpectationNode::maxLagWithDiffsExpanded()
return 0; return 0;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment