Skip to content

Commit

Permalink
added addition to composite parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
fradav committed Sep 24, 2023
1 parent c1daeef commit a9abe2f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/EstimParam.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ EstimParamResults EstimParam_fun(Reftable<MatrixType> &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();
Expand Down
2 changes: 2 additions & 0 deletions src/parse_parexpr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ void parse_paramexpression(const std::vector<std::string>& 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);
Expand Down
3 changes: 2 additions & 1 deletion src/parse_parexpr.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ enum op_type
{
none,
divide,
multiply
multiply,
add
};

void parse_paramexpression(const std::vector<std::string>& params_str,
Expand Down

0 comments on commit a9abe2f

Please sign in to comment.