From d873414728cb19b610f5159a072cc013bc537c69 Mon Sep 17 00:00:00 2001 From: Houtan Bastani <houtan@dynare.org> Date: Mon, 27 May 2019 16:06:08 +0200 Subject: [PATCH] pac_model growth: allow single parameters --- src/ComputingTasks.cc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/ComputingTasks.cc b/src/ComputingTasks.cc index 0d96ac53..cbe7528a 100644 --- a/src/ComputingTasks.cc +++ b/src/ComputingTasks.cc @@ -291,15 +291,23 @@ PacModelStatement::overwriteGrowth(expr_t new_growth) { if (new_growth == nullptr || growth == nullptr) return; + growth = new_growth; + try { growth_info = growth->matchLinearCombinationOfVariables(); } catch (ExprNode::MatchFailureException &e) { - cerr << "Pac growth must be a linear combination of varibles" << endl; - exit(EXIT_FAILURE); + auto gv = dynamic_cast<const VariableNode *>(growth); + if (gv) + growth_info.push_back({gv->symb_id, gv->lag, -1, 1}); + else + { + cerr << "Pac growth must be a linear combination of varibles" << endl; + exit(EXIT_FAILURE); + } } } -- GitLab