CMS 3D CMS Logo

formulaVariableEvaluator.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: CommonTools/Utils
4 // Class : reco::formula::VariableEvaluator
5 //
6 // Implementation:
7 // [Notes on implementation]
8 //
9 // Original Author: Christopher Jones
10 // Created: Wed, 23 Sep 2015 18:06:29 GMT
11 //
12 
13 // system include files
14 
15 // user include files
17 
18 
19 namespace reco {
20  namespace formula {
21  double VariableEvaluator::evaluate(double const* iVariables, double const* /*iParameters*/) const {
22  return iVariables[m_index];
23  }
24 
25  std::vector<std::string> VariableEvaluator::abstractSyntaxTree() const {
26  return std::vector<std::string>{1, std::string("var[")+std::to_string(m_index)+"]"};
27  }
28  }
29 }
std::vector< std::string > abstractSyntaxTree() const final
double evaluate(double const *iVariables, double const *iParameters) const final
fixed size matrix