From a9abe2f459223ffa5a86f29c987d0e525074d63b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois-David=20Collin?= Date: Sun, 24 Sep 2023 14:01:11 +0200 Subject: [PATCH] added addition to composite parameter --- src/EstimParam.cpp | 3 +++ src/parse_parexpr.cpp | 2 ++ src/parse_parexpr.hpp | 3 ++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/EstimParam.cpp b/src/EstimParam.cpp index 33bf405..9c37318 100644 --- a/src/EstimParam.cpp +++ b/src/EstimParam.cpp @@ -94,6 +94,9 @@ EstimParamResults EstimParam_fun(Reftable &myread, case op_type::multiply: y = myread.params(all, p1) * myread.params(all, p2); break; + case op_type::add: + y = myread.params(all, p1) + myread.params(all, p2); + break; } // myread.params = std::move(myread.params(indexesModel,param_num)).eval(); diff --git a/src/parse_parexpr.cpp b/src/parse_parexpr.cpp index 1969aac..27d0c3b 100644 --- a/src/parse_parexpr.cpp +++ b/src/parse_parexpr.cpp @@ -38,6 +38,8 @@ void parse_paramexpression(const std::vector& params_str, op = op_type::multiply; else if(base_match[4].str()[0] == '/') op = op_type::divide; + else if(base_match[4].str()[0] == '+') + op = op_type::add; else { std::cout << "Wrong parameter composition : " << base_match[4].str() << std::endl; exit(1); diff --git a/src/parse_parexpr.hpp b/src/parse_parexpr.hpp index 7c19fef..249d805 100644 --- a/src/parse_parexpr.hpp +++ b/src/parse_parexpr.hpp @@ -8,7 +8,8 @@ enum op_type { none, divide, - multiply + multiply, + add }; void parse_paramexpression(const std::vector& params_str,