8#ifndef FMTEXPRESSION_Hm_included
9#define FMTEXPRESSION_Hm_included
61 double shuntingYard(
const std::map<std::string, double>& mapping)
const;
73 operator std::string()
const;
88 std::vector<std::string>m_infix;
95 std::vector<std::string> _getPostFix(
const std::vector<std::string>& localinfix)
const;
102 std::vector<std::string> _replaceVariables(
const std::map<std::string, double>& mapping)
const;
109 double _evaluatePostFix(
const std::vector<std::string>& postfix)
const;
116 bool _isNumber(
const std::string& s)
const;
Mathematical expression evaluated with the shunting yard algorithm, used in yields and outputs.
Definition: FMTExpression.h:23
FMTExpression simplify(std::map< std::string, double > &values) const
Return a simplified expression using the given variable values.
~FMTExpression()=default
Default destructor for FMTExpression.
FMTExpression()
Default constructor for FMTExpression.
std::vector< std::string > getInFix() const
Return the infix expression.
FMTExpression(const FMTExpression &rhs)
Copy constructor for FMTExpression.
FMTExpression(const std::vector< std::string > &lsources)
Construct a FMTExpression from a vector of tokens.
FMTExpression & operator=(const FMTExpression &rhs)
Copy assignment operator for FMTExpression.
std::vector< std::string > getVariables() const
Return the variables of the expression.
double shuntingYard(const std::map< std::string, double > &mapping) const
Evaluate the expression using the shunting yard algorithm.
The Core namespace provides classes for simulating stands/strata growth/harvest through time.
Definition: FMTAction.h:34