39 #define BOOST_SPIRIT_THREADSAFE
40 #include <boost/spirit/include/classic_assign_actor.hpp>
41 #include <boost/spirit/include/classic_ast.hpp>
42 #include <boost/spirit/include/classic_core.hpp>
43 #include <boost/spirit/include/classic_push_back_actor.hpp>
44 #include <boost/spirit/include/classic_symbols.hpp>
46 #include <boost/random/mersenne_twister.hpp>
47 #include <boost/random/normal_distribution.hpp>
48 #include <boost/random/variate_generator.hpp>
50 #include <boost/algorithm/string/trim.hpp>
51 #include <boost/math/special_functions/bessel.hpp>
53 namespace bsp = boost::spirit::classic;
58 #if defined(__INTEL_COMPILER)
66 namespace LibUtilities
72 return (arg > 0.0) - (arg < 0.0);
81 boost::variate_generator<boost::mt19937 &, boost::normal_distribution<>>
82 _normal(rng, boost::normal_distribution<>(0, sigma));
88 return (x != 0.0 || y != 0.0) ?
sqrt(x * x + y * y) : 0.0;
93 return (x != 0.0 || y != 0.0) ? atan2(y, x) : 0.0;
176 typedef bsp::tree_parse_info<std::string::const_iterator,
177 bsp::node_val_data_factory<NekDouble>>
179 typedef bsp::tree_match<std::string::const_iterator,
180 bsp::node_val_data_factory<NekDouble>>::
274 for (
auto &it : it_es)
296 for (
auto const &it : constants)
322 std::string errormsg =
323 "Attempt to add numerically different constants under the "
326 std::cout << errormsg << std::endl;
338 ASSERTL1(value != NULL,
"Constant variable not found: " +
name);
347 for (
auto const &it : params)
378 "Parameter not found: " +
name);
412 std::vector<std::string> variableNames;
413 bsp::parse((
char *)vlist.c_str(),
415 *(+(+bsp::graph_p)[bsp::push_back_a(variableNames)] >>
424 bsp::ast_parse<bsp::node_val_data_factory<NekDouble>,
426 bsp::space_parser>(expr.begin(), expr.end(),
427 myGrammar, bsp::space_p);
430 "Unable to fully parse function. Stopped just before: " +
431 std::string(parseInfo.stop, parseInfo.stop + 15));
435 throw std::runtime_error(
436 "Unable to fully parse function at: " +
437 std::string(parseInfo.stop, parseInfo.stop + 15));
451 for (
int i = 0; i < variableNames.size(); i++)
453 variableMap[variableNames[i]] = i;
459 stack, variableMap, 0);
465 "Constant expression yeilds non-empty execution stack. "
466 "Bug in PrepareExecutionAsYouParse()");
469 std::string(
"EXPRESSION_") + std::to_string(stackId), v.second);
470 stack.push_back(makeStep<StoreConst>(0, const_index));
493 "unknown analytic expression, it must first be defined "
494 "with DefineFunction(...)");
499 for (
int i = 0; i < stack.size(); i++)
501 (*stack[i]).run_once();
519 "unknown analytic expression, it must first be defined with "
520 "DefineFunction(...)");
541 for (
int i = 0; i < stack.size(); i++)
543 (*stack[i]).run_once();
560 "unknown analytic expression, it must first be defined with "
561 "DefineFunction(...)");
566 ASSERTL1(point.size() == variableMap.size(),
567 "The number of variables used to define this expression should"
568 " match the point dimensionality.");
573 VariableMap::const_iterator it;
575 for (it = variableMap.begin(); it != variableMap.end(); ++it)
581 for (
int i = 0; i < stack.size(); i++)
583 (*stack[i]).run_once();
602 std::vector<Array<OneD, const NekDouble>> points = {x, y, z, t};
617 const int num_points = points[0].size();
619 "unknown analytic expression, it must first be defined "
620 "with DefineFunction(...)");
621 ASSERTL1(result.size() >= num_points,
622 "destination array must have enough capacity to store "
623 "expression values at each given point");
630 const int max_chunk_size = 1024;
631 const int nvals = points.size();
632 const int chunk_size = (std::min)(max_chunk_size, num_points);
642 if (result.size() < num_points)
648 int work_left = num_points;
649 while (work_left > 0)
651 const int this_chunk_size = (std::min)(work_left, 1024);
652 for (
int i = 0; i < this_chunk_size; i++)
654 for (
int j = 0; j < nvals; ++j)
656 m_variable[i + this_chunk_size * j] = points[j][offset + i];
659 for (
int i = 0; i < stack.size(); i++)
661 (*stack[i]).run_many(this_chunk_size);
663 for (
int i = 0; i < this_chunk_size; i++)
665 result[offset + i] =
m_state[i];
667 work_left -= this_chunk_size;
668 offset += this_chunk_size;
715 std::string valueStr(location->value.begin(), location->value.end());
716 boost::algorithm::trim(valueStr);
718 const bsp::parser_id parserID = location->value.id();
719 #if defined(NEKTAR_DEBUG) || defined(NEKTAR_FULLDEBUG)
720 const int num_children = location->children.size();
726 "Illegal children under constant node: " + valueStr);
730 "Cannot find the value for the specified constant: " +
733 return std::make_pair(
true,
m_constant[it->second]);
738 "Illegal children under number node: " + valueStr);
739 return std::make_pair(
740 true, boost::lexical_cast<NekDouble>(valueStr.c_str()));
745 "Illegal children under variable node: " + valueStr);
747 VariableMap::const_iterator it = variableMap.find(valueStr);
749 "Unknown variable parsed: " + valueStr);
752 stack.push_back(makeStep<StoreVar>(stateIndex, it->second));
753 return std::make_pair(
false, 0);
758 "Illegal children under parameter node: " + valueStr);
762 "Unknown parameter parsed: " + valueStr);
765 stack.push_back(makeStep<StorePrm>(stateIndex, it->second));
766 return std::make_pair(
false, 0);
772 "Invalid function specified: " + valueStr);
773 ASSERTL1(num_children == 1 || num_children == 2,
774 "Function " + valueStr +
775 " has neither one or two "
776 "arguments: this is not implemented yet.");
778 if (location->children.size() == 1)
781 location->children.begin(), stack, variableMap, stateIndex);
791 makeStep<StoreConst>(stateIndex, const_index));
792 stack.push_back(makeStep<EvalAWGN>(stateIndex, stateIndex));
793 return std::make_pair(
false, 0);
798 return std::make_pair(
true,
806 stack, variableMap, stateIndex);
808 location->children.begin() + 1, stack, variableMap,
812 if (
true == v1.first &&
true == v2.first)
814 return std::make_pair(
815 true,
m_function2[it->second](v1.second, v2.second));
824 stack.push_back(makeStep<EvalAbs>(stateIndex, stateIndex));
825 return std::make_pair(
false, 0);
827 stack.push_back(makeStep<EvalAsin>(stateIndex, stateIndex));
828 return std::make_pair(
false, 0);
830 stack.push_back(makeStep<EvalAcos>(stateIndex, stateIndex));
831 return std::make_pair(
false, 0);
833 stack.push_back(makeStep<EvalAtan>(stateIndex, stateIndex));
834 return std::make_pair(
false, 0);
836 stack.push_back(makeStep<EvalAtan2>(stateIndex, stateIndex,
838 return std::make_pair(
false, 0);
840 stack.push_back(makeStep<EvalAng>(stateIndex, stateIndex,
842 return std::make_pair(
false, 0);
844 stack.push_back(makeStep<EvalBessel>(stateIndex, stateIndex,
846 return std::make_pair(
false, 0);
848 stack.push_back(makeStep<EvalCeil>(stateIndex, stateIndex));
849 return std::make_pair(
false, 0);
851 stack.push_back(makeStep<EvalCos>(stateIndex, stateIndex));
852 return std::make_pair(
false, 0);
854 stack.push_back(makeStep<EvalCosh>(stateIndex, stateIndex));
855 return std::make_pair(
false, 0);
857 stack.push_back(makeStep<EvalExp>(stateIndex, stateIndex));
858 return std::make_pair(
false, 0);
860 stack.push_back(makeStep<EvalFabs>(stateIndex, stateIndex));
861 return std::make_pair(
false, 0);
864 makeStep<EvalFloor>(stateIndex, stateIndex));
865 return std::make_pair(
false, 0);
867 stack.push_back(makeStep<EvalLog>(stateIndex, stateIndex));
868 return std::make_pair(
false, 0);
871 makeStep<EvalLog10>(stateIndex, stateIndex));
872 return std::make_pair(
false, 0);
874 stack.push_back(makeStep<EvalRad>(stateIndex, stateIndex,
876 return std::make_pair(
false, 0);
878 stack.push_back(makeStep<EvalSin>(stateIndex, stateIndex));
879 return std::make_pair(
false, 0);
881 stack.push_back(makeStep<EvalSinh>(stateIndex, stateIndex));
882 return std::make_pair(
false, 0);
884 stack.push_back(makeStep<EvalSqrt>(stateIndex, stateIndex));
885 return std::make_pair(
false, 0);
887 stack.push_back(makeStep<EvalTan>(stateIndex, stateIndex));
888 return std::make_pair(
false, 0);
890 stack.push_back(makeStep<EvalTanh>(stateIndex, stateIndex));
891 return std::make_pair(
false, 0);
893 stack.push_back(makeStep<EvalSign>(stateIndex, stateIndex));
894 return std::make_pair(
false, 0);
896 ASSERTL0(
false,
"Evaluation of " + valueStr +
897 " is not implemented yet");
899 return std::make_pair(
false, 0);
904 "Illegal factor - it can only be '-' and it was: " +
907 "Illegal number of children under factor node: " +
910 location->children.begin(), stack, variableMap, stateIndex);
915 return std::make_pair(
true, -v.second);
917 stack.push_back(makeStep<EvalNeg>(stateIndex, stateIndex));
918 return std::make_pair(
false, 0);
924 "Too few or too many arguments for mathematical operator: " +
927 location->children.begin() + 0, stack, variableMap, stateIndex);
930 stack, variableMap, stateIndex + 1);
934 if ((left.first ==
true) && (right.first ==
true))
936 switch (*valueStr.begin())
939 return std::make_pair(
true, left.second + right.second);
941 return std::make_pair(
true, left.second - right.second);
943 return std::make_pair(
true, left.second * right.second);
945 return std::make_pair(
true, left.second / right.second);
947 return std::make_pair(
948 true, std::pow(left.second, right.second));
950 return std::make_pair(
true,
951 left.second == right.second);
953 if (*(valueStr.end() - 1) ==
'=')
955 return std::make_pair(
true,
956 left.second <= right.second);
960 return std::make_pair(
true,
961 left.second < right.second);
963 return std::make_pair(
false, 0);
965 if (*(valueStr.end() - 1) ==
'=')
967 return std::make_pair(
true,
968 left.second >= right.second);
972 return std::make_pair(
true,
973 left.second > right.second);
975 return std::make_pair(
false, 0);
978 "Invalid operator encountered: " + valueStr);
980 return std::make_pair(
false, 0);
985 if (
true == left.first)
991 stack.push_back(makeStep<StoreConst>(stateIndex, const_index));
993 if (
true == right.first)
1000 makeStep<StoreConst>(stateIndex + 1, const_index));
1003 switch (*valueStr.begin())
1006 stack.push_back(makeStep<EvalSum>(stateIndex, stateIndex,
1008 return std::make_pair(
false, 0);
1010 stack.push_back(makeStep<EvalSub>(stateIndex, stateIndex,
1012 return std::make_pair(
false, 0);
1014 stack.push_back(makeStep<EvalMul>(stateIndex, stateIndex,
1016 return std::make_pair(
false, 0);
1018 stack.push_back(makeStep<EvalDiv>(stateIndex, stateIndex,
1020 return std::make_pair(
false, 0);
1022 stack.push_back(makeStep<EvalPow>(stateIndex, stateIndex,
1024 return std::make_pair(
false, 0);
1026 stack.push_back(makeStep<EvalLogicalEqual>(
1027 stateIndex, stateIndex, stateIndex + 1));
1028 return std::make_pair(
false, 0);
1030 if (*(valueStr.end() - 1) ==
'=')
1032 stack.push_back(makeStep<EvalLogicalLeq>(
1033 stateIndex, stateIndex, stateIndex + 1));
1037 stack.push_back(makeStep<EvalLogicalLess>(
1038 stateIndex, stateIndex, stateIndex + 1));
1040 return std::make_pair(
false, 0);
1043 if (*(valueStr.end() - 1) ==
'=')
1045 stack.push_back(makeStep<EvalLogicalGeq>(
1046 stateIndex, stateIndex, stateIndex + 1));
1050 stack.push_back(makeStep<EvalLogicalGreater>(
1051 stateIndex, stateIndex, stateIndex + 1));
1053 return std::make_pair(
false, 0);
1057 "Invalid operator encountered: " + valueStr);
1059 return std::make_pair(
false, 0);
1065 "Too few or too many arguments for mathematical operator: " +
1068 ASSERTL0(
false,
"Illegal expression encountered: " + valueStr);
1069 return std::make_pair(
false, 0);
1095 for (
auto const &it : vars)
1115 const std::vector<std::string> &
variables)
1138 *((bsp::root_node_d[bsp::str_p(
"||")] >>
logical_and));
1142 *((bsp::root_node_d[bsp::str_p(
"&&")] >>
equality));
1145 lt_gt >> *((bsp::root_node_d[bsp::str_p(
"==")] >>
lt_gt));
1148 *((bsp::root_node_d[bsp::str_p(
"<=")] >>
add_sub) |
1149 (bsp::root_node_d[bsp::str_p(
">=")] >>
add_sub) |
1150 (bsp::root_node_d[bsp::ch_p(
'<')] >>
add_sub) |
1151 (bsp::root_node_d[bsp::ch_p(
'>')] >>
add_sub));
1154 negate >> *((bsp::root_node_d[bsp::ch_p(
'+')] >>
negate) |
1155 (bsp::root_node_d[bsp::ch_p(
'-')] >>
negate));
1160 *((bsp::root_node_d[bsp::ch_p(
'*')] >>
exponential) |
1161 (bsp::root_node_d[bsp::ch_p(
'/')] >>
exponential));
1167 bsp::inner_node_d[bsp::ch_p(
'(') >>
expression >>
1170 bsp::leaf_node_d[bsp::lexeme_d[(bsp::alpha_p |
'_' |
'$') >>
1171 *(bsp::alnum_p |
'_' |
1177 bsp::infix_node_d[bsp::inner_node_d[bsp::ch_p(
'(') >>
1183 bsp::leaf_node_d[bsp::lexeme_d[
self.variables_p]] >>
op;
1185 number = bsp::leaf_node_d[bsp::lexeme_d[bsp::real_p]] >>
op;
1188 bsp::leaf_node_d[bsp::lexeme_d[*
self.constants_p]] >>
op;
1190 op = bsp::eps_p(bsp::end_p |
"||" |
"&&" |
"==" |
"<=" |
">=" |
1191 '<' |
'>' |
'+' |
'-' |
'*' |
'/' |
'^' |
')' |
1201 bsp::rule<ScannerT, bsp::parser_context<>, bsp::parser_tag<N>>;
1303 typedef std::vector<NekDouble> &
vr;
1304 typedef const std::vector<NekDouble> &
cvr;
1309 template <
typename StepType>
1383 for (
int i = 0; i < n; i++)
1399 for (
int i = 0; i < n; i++)
1415 for (
int i = 0; i < n; i++)
1431 for (
int i = 0; i < n; i++)
1447 for (
int i = 0; i < n; i++)
1464 for (
int i = 0; i < n; i++)
1481 for (
int i = 0; i < n; i++)
1498 for (
int i = 0; i < n; i++)
1515 for (
int i = 0; i < n; i++)
1532 for (
int i = 0; i < n; i++)
1548 for (
int i = 0; i < n; i++)
1565 for (
int i = 0; i < n; i++)
1582 for (
int i = 0; i < n; i++)
1599 for (
int i = 0; i < n; i++)
1616 for (
int i = 0; i < n; i++)
1633 for (
int i = 0; i < n; i++)
1649 for (
int i = 0; i < n; i++)
1666 for (
int i = 0; i < n; i++)
1682 for (
int i = 0; i < n; i++)
1698 for (
int i = 0; i < n; i++)
1714 for (
int i = 0; i < n; i++)
1731 for (
int i = 0; i < n; i++)
1748 for (
int i = 0; i < n; i++)
1766 for (
int i = 0; i < n; i++)
1782 for (
int i = 0; i < n; i++)
1798 for (
int i = 0; i < n; i++)
1814 for (
int i = 0; i < n; i++)
1830 for (
int i = 0; i < n; i++)
1846 for (
int i = 0; i < n; i++)
1862 for (
int i = 0; i < n; i++)
1878 for (
int i = 0; i < n; i++)
1894 for (
int i = 0; i < n; i++)
1911 for (
int i = 0; i < n; i++)
1927 for (
int i = 0; i < n; i++)
1943 for (
int i = 0; i < n; i++)
1959 for (
int i = 0; i < n; i++)
1975 for (
int i = 0; i < n; i++)
1993 boost::variate_generator<boost::mt19937 &,
1994 boost::normal_distribution<>>
1997 for (
int i = 0; i < n; i++)
2004 boost::variate_generator<boost::mt19937 &,
2005 boost::normal_distribution<>>
2027 m_impl = std::move(r.m_impl);
2033 m_impl->SetRandomSeed(seed);
2037 std::map<std::string, NekDouble>
const &constants)
2039 m_impl->AddConstants(constants);
2054 m_impl->SetParameters(params);
2069 return m_impl->GetTime();
2073 const std::string &
function)
2075 return m_impl->DefineFunction(vlist,
function);
2080 return m_impl->Evaluate(AnalyticExpression_id);
2087 return m_impl->Evaluate(AnalyticExpression_id, x, y, z, t);
2091 std::vector<NekDouble> point)
2093 return m_impl->EvaluateAtPoint(AnalyticExpression_id, point);
2103 m_impl->Evaluate(expression_id, x, y, z, t, result);
2107 const int expression_id,
2111 m_impl->Evaluate(expression_id, points, result);
#define ASSERTL0(condition, msg)
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
#define LIB_UTILITIES_EXPORT
static const int variableID
AnalyticExpression(const bsp::symbols< NekDouble > *constants, const std::vector< std::string > &variables)
static const int numberID
static const int constantID
static const int functionID
static const int parameterID
static const int operatorID
Nektar::LibUtilities::Interpreter::ExpressionEvaluator::AnalyticExpression::variables variables_p
const bsp::symbols< NekDouble > * constants_p
Concrete implementation of the interface defined in Interpreter.
std::map< std::string, int > VariableMap
void Evaluate(const int id, const Array< OneD, const NekDouble > &x, const Array< OneD, const NekDouble > &y, const Array< OneD, const NekDouble > &z, const Array< OneD, const NekDouble > &t, Array< OneD, NekDouble > &result)
Evaluate a function which depends only on constants and/or parameters.
std::vector< NekDouble > m_constant
int AddConstant(std::string const &name, NekDouble value)
Set constants to be evaluated.
void SetParameters(std::map< std::string, NekDouble > const ¶ms)
Set parameter values.
EvaluationStep * makeStep(ci dest, ci src_left=0, ci src_right=0)
Factory method which makes code little less messy.
const std::vector< NekDouble > & cvr
std::map< std::string, int > ParameterMap
VariableMap m_expressionVariableMap
std::map< std::string, int > FunctionNameMap
std::vector< int > m_state_sizes
Vector of state sizes per each.
FunctionNameMap m_functionMapNameToInstanceType
int DefineFunction(const std::string &vlist, const std::string &expr)
Defines a function for the purposes of evaluation.
NekDouble GetConstant(std::string const &name)
Return the value of a constant.
NekDouble Evaluate(const int id)
Evaluate a function which depends only on constants and/or parameters.
std::vector< ExecutionStack > m_executionStack
ConstantMap m_constantMapNameToId
Timer m_timer
Timer and sum of evaluation times.
std::vector< const Array< OneD, const NekDouble > * > VariableArray
NekDouble(* TwoArgFunc)(NekDouble, NekDouble)
std::vector< VariableMap > m_stackVariableMap
Keeping map of variables individually per each analytic expression allows correctly handling expressi...
bsp::tree_match< std::string::const_iterator, bsp::node_val_data_factory< NekDouble > >::tree_iterator ParsedTreeIterator
NekDouble EvaluateAtPoint(const int id, const std::vector< NekDouble > point)
Evaluate a function which depends on zero or more variables.
std::vector< EvaluationStep * > ExecutionStack
std::map< int, TwoArgFunc > m_function2
NekDouble Evaluate(const int id, const NekDouble x, const NekDouble y, const NekDouble z, const NekDouble t)
Evaluate a function which depends only on constants and/or parameters.
std::map< int, OneArgFunc > m_function
boost::mt19937 m_generator
void SetParameter(std::string const &name, NekDouble value)
Set parameter values.
ParameterMap m_parameterMapNameToId
The following data structures hold input data to be used on evaluation stage. There are three types o...
int m_state_size
This counter is used by PrepareExecutionAsYouParse for finding the minimal state size necessary for e...
NekDouble GetTime() const
Returns the total walltime spent in evaluation procedures in seconds.
ExpressionEvaluator()
Initializes the evaluator.
std::vector< NekDouble > m_variable
std::vector< NekDouble > m_parameter
std::pair< bool, NekDouble > PrecomputedValue
NekDouble GetParameter(std::string const &name)
Get the value of a parameter.
bsp::tree_parse_info< std::string::const_iterator, bsp::node_val_data_factory< NekDouble > > ParsedTreeInfo
std::vector< NekDouble > & vr
Short names to minimise the infractructural code mess in defining functors below.
void SetRandomSeed(unsigned int seed)
Sets the random seed for the pseudorandom number generator.
std::vector< NekDouble > m_state
This vector stores the execution state (memory) used by the sequential execution process.
std::map< std::string, int > ExpressionMap
NekDouble(* OneArgFunc)(NekDouble)
PrecomputedValue PrepareExecutionAsYouParse(const ParsedTreeIterator &location, ExecutionStack &stack, VariableMap &variableMap, int stateIndex)
Prepares an execution stack for the evaluation of a function.
void AddConstants(std::map< std::string, NekDouble > const &constants)
Set constants to be evaluated.
bsp::symbols< NekDouble > m_constantsParser
NekDouble m_total_eval_time
~ExpressionEvaluator(void)
Destructor that removes all entries from the execution stack.
void Evaluate(const int id, const std::vector< Array< OneD, const NekDouble >> &points, Array< OneD, NekDouble > &result)
Evaluate a function which depends only on constants and/or parameters.
ExpressionMap m_parsedMapExprToExecStackId
These vector and map store pre-processed evaluation sequences for the analytic expressions....
std::map< std::string, int > ConstantMap
Interpreter class for the evaluation of mathematical expressions.
NekDouble GetTime() const
Returns the total walltime spent in evaluation procedures in seconds.
void AddConstants(std::map< std::string, NekDouble > const &constants)
Set constants to be evaluated.
Interpreter()
Default constructor.
std::unique_ptr< ExpressionEvaluator > m_impl
Concrete implementation of the above API calls.
Interpreter & operator=(Interpreter &&)
Default assignment operator.
NekDouble GetConstant(std::string const &name)
Return the value of a constant.
int AddConstant(std::string const &name, NekDouble value)
Set constants to be evaluated.
NekDouble EvaluateAtPoint(const int id, std::vector< NekDouble > point)
Evaluate a function which depends on zero or more variables.
int DefineFunction(const std::string &vlist, const std::string &expr)
Defines a function for the purposes of evaluation.
~Interpreter()
Default destructor.
void SetParameters(std::map< std::string, NekDouble > const ¶ms)
Set parameter values.
void SetParameter(std::string const &name, NekDouble value)
Set parameter values.
NekDouble Evaluate(const int id)
Evaluate a function which depends only on constants and/or parameters.
NekDouble GetParameter(std::string const &name)
Get the value of a parameter.
void SetRandomSeed(unsigned int seed=123u)
Sets the random seed for the pseudorandom number generator.
NekDouble TimePerTest(unsigned int n)
Returns amount of seconds per iteration in a test with n iterations.
NekDouble(* PFD1)(NekDouble)
NekDouble(* PFD2)(NekDouble, NekDouble)
static NekDouble rad(NekDouble x, NekDouble y)
NekDouble awgn(NekDouble sigma)
static NekDouble ang(NekDouble x, NekDouble y)
NekDouble(* PFD4)(NekDouble, NekDouble, NekDouble, NekDouble)
NekDouble(* PFD3)(NekDouble, NekDouble, NekDouble)
NekDouble sign(NekDouble arg)
Nektar::LibUtilities::functions functions_p
InputIterator find(InputIterator first, InputIterator last, InputIterator startingpoint, const EqualityComparable &value)
The above copyright notice and this permission notice shall be included.
scalarT< T > log(scalarT< T > in)
scalarT< T > abs(scalarT< T > in)
scalarT< T > sqrt(scalarT< T > in)
bsp_rule< operatorID> add_sub
bsp_rule< parameterID > parameter
bsp::rule< ScannerT, bsp::parser_context<>, bsp::parser_tag< N > > bsp_rule
bsp_rule< operatorID> lt_gt
bsp_rule< unaryID > negate
bsp_rule< variableID > variable
definition(AnalyticExpression const &self)
bsp_rule< operatorID> expression
bsp_rule< operatorID> logical_and
bsp_rule< operatorID> equality
bsp_rule< constantID > constant
bsp_rule< operatorID> exponent
bsp_rule< operatorID> const & start() const
bsp_rule< numberID > number
bsp_rule< operatorID> base
bsp_rule< operatorID> mult_div
bsp_rule< operatorID> logical_or
bsp_rule< operatorID> exponential
variables(std::vector< std::string > const &vars)
CopyState(rgt rn, vr s, cvr c, cvr p, cvr v, ci i, ci l, ci r)
virtual void run_many(ci n)
declaring this guy pure virtual shortens virtual table. It saves some execution time.
virtual void run_many(ci n)
declaring this guy pure virtual shortens virtual table. It saves some execution time.
EvalAWGN(rgt rn, vr s, cvr c, cvr p, cvr v, ci i, ci l, ci r)
virtual void run_many(ci n)
declaring this guy pure virtual shortens virtual table. It saves some execution time.
EvalAbs(rgt rn, vr s, cvr c, cvr p, cvr v, ci i, ci l, ci r)
EvalAcos(rgt rn, vr s, cvr c, cvr p, cvr v, ci i, ci l, ci r)
virtual void run_many(ci n)
declaring this guy pure virtual shortens virtual table. It saves some execution time.
virtual void run_many(ci n)
declaring this guy pure virtual shortens virtual table. It saves some execution time.
EvalAng(rgt rn, vr s, cvr c, cvr p, cvr v, ci i, ci l, ci r)
virtual void run_many(ci n)
declaring this guy pure virtual shortens virtual table. It saves some execution time.
EvalAsin(rgt rn, vr s, cvr c, cvr p, cvr v, ci i, ci l, ci r)
EvalAtan2(rgt rn, vr s, cvr c, cvr p, cvr v, ci i, ci l, ci r)
virtual void run_many(ci n)
declaring this guy pure virtual shortens virtual table. It saves some execution time.
virtual void run_many(ci n)
declaring this guy pure virtual shortens virtual table. It saves some execution time.
EvalAtan(rgt rn, vr s, cvr c, cvr p, cvr v, ci i, ci l, ci r)
virtual void run_many(ci n)
declaring this guy pure virtual shortens virtual table. It saves some execution time.
EvalBessel(rgt rn, vr s, cvr c, cvr p, cvr v, ci i, ci l, ci r)
virtual void run_many(ci n)
declaring this guy pure virtual shortens virtual table. It saves some execution time.
EvalCeil(rgt rn, vr s, cvr c, cvr p, cvr v, ci i, ci l, ci r)
EvalCos(rgt rn, vr s, cvr c, cvr p, cvr v, ci i, ci l, ci r)
virtual void run_many(ci n)
declaring this guy pure virtual shortens virtual table. It saves some execution time.
virtual void run_many(ci n)
declaring this guy pure virtual shortens virtual table. It saves some execution time.
EvalCosh(rgt rn, vr s, cvr c, cvr p, cvr v, ci i, ci l, ci r)
EvalDiv(rgt rn, vr s, cvr c, cvr p, cvr v, ci i, ci l, ci r)
virtual void run_many(ci n)
declaring this guy pure virtual shortens virtual table. It saves some execution time.
virtual void run_many(ci n)
declaring this guy pure virtual shortens virtual table. It saves some execution time.
EvalExp(rgt rn, vr s, cvr c, cvr p, cvr v, ci i, ci l, ci r)
EvalFabs(rgt rn, vr s, cvr c, cvr p, cvr v, ci i, ci l, ci r)
virtual void run_many(ci n)
declaring this guy pure virtual shortens virtual table. It saves some execution time.
EvalFloor(rgt rn, vr s, cvr c, cvr p, cvr v, ci i, ci l, ci r)
virtual void run_many(ci n)
declaring this guy pure virtual shortens virtual table. It saves some execution time.
virtual void run_many(ci n)
declaring this guy pure virtual shortens virtual table. It saves some execution time.
EvalLog10(rgt rn, vr s, cvr c, cvr p, cvr v, ci i, ci l, ci r)
virtual void run_many(ci n)
declaring this guy pure virtual shortens virtual table. It saves some execution time.
EvalLog(rgt rn, vr s, cvr c, cvr p, cvr v, ci i, ci l, ci r)
EvalLogicalEqual(rgt rn, vr s, cvr c, cvr p, cvr v, ci i, ci l, ci r)
virtual void run_many(ci n)
declaring this guy pure virtual shortens virtual table. It saves some execution time.
EvalLogicalGeq(rgt rn, vr s, cvr c, cvr p, cvr v, ci i, ci l, ci r)
virtual void run_many(ci n)
declaring this guy pure virtual shortens virtual table. It saves some execution time.
virtual void run_many(ci n)
declaring this guy pure virtual shortens virtual table. It saves some execution time.
EvalLogicalGreater(rgt rn, vr s, cvr c, cvr p, cvr v, ci i, ci l, ci r)
virtual void run_many(ci n)
declaring this guy pure virtual shortens virtual table. It saves some execution time.
EvalLogicalLeq(rgt rn, vr s, cvr c, cvr p, cvr v, ci i, ci l, ci r)
virtual void run_many(ci n)
declaring this guy pure virtual shortens virtual table. It saves some execution time.
EvalLogicalLess(rgt rn, vr s, cvr c, cvr p, cvr v, ci i, ci l, ci r)
virtual void run_many(ci n)
declaring this guy pure virtual shortens virtual table. It saves some execution time.
EvalMul(rgt rn, vr s, cvr c, cvr p, cvr v, ci i, ci l, ci r)
virtual void run_many(ci n)
declaring this guy pure virtual shortens virtual table. It saves some execution time.
EvalNeg(rgt rn, vr s, cvr c, cvr p, cvr v, ci i, ci l, ci r)
EvalPow(rgt rn, vr s, cvr c, cvr p, cvr v, ci i, ci l, ci r)
virtual void run_many(ci n)
declaring this guy pure virtual shortens virtual table. It saves some execution time.
EvalRad(rgt rn, vr s, cvr c, cvr p, cvr v, ci i, ci l, ci r)
virtual void run_many(ci n)
declaring this guy pure virtual shortens virtual table. It saves some execution time.
EvalSign(rgt rn, vr s, cvr c, cvr p, cvr v, ci i, ci l, ci r)
virtual void run_many(ci n)
declaring this guy pure virtual shortens virtual table. It saves some execution time.
virtual void run_many(ci n)
declaring this guy pure virtual shortens virtual table. It saves some execution time.
EvalSin(rgt rn, vr s, cvr c, cvr p, cvr v, ci i, ci l, ci r)
virtual void run_many(ci n)
declaring this guy pure virtual shortens virtual table. It saves some execution time.
EvalSinh(rgt rn, vr s, cvr c, cvr p, cvr v, ci i, ci l, ci r)
EvalSqrt(rgt rn, vr s, cvr c, cvr p, cvr v, ci i, ci l, ci r)
virtual void run_many(ci n)
declaring this guy pure virtual shortens virtual table. It saves some execution time.
virtual void run_many(ci n)
declaring this guy pure virtual shortens virtual table. It saves some execution time.
EvalSub(rgt rn, vr s, cvr c, cvr p, cvr v, ci i, ci l, ci r)
virtual void run_many(ci n)
declaring this guy pure virtual shortens virtual table. It saves some execution time.
EvalSum(rgt rn, vr s, cvr c, cvr p, cvr v, ci i, ci l, ci r)
EvalTan(rgt rn, vr s, cvr c, cvr p, cvr v, ci i, ci l, ci r)
virtual void run_many(ci n)
declaring this guy pure virtual shortens virtual table. It saves some execution time.
virtual void run_many(ci n)
declaring this guy pure virtual shortens virtual table. It saves some execution time.
EvalTanh(rgt rn, vr s, cvr c, cvr p, cvr v, ci i, ci l, ci r)
Function objects (functors)
rgt rng
reference to random number generator
virtual void run_many(ci n)=0
declaring this guy pure virtual shortens virtual table. It saves some execution time.
ci storeIdx
indices in the above arrays uniquely defining actual command arguments
virtual ~EvaluationStep()
virtual void run_once()=0
EvaluationStep(rgt rn, ci i, ci l, ci r, vr s, cvr c, cvr p, cvr v)
vr state
references to arrays holding the common state
StoreConst(rgt rn, vr s, cvr c, cvr p, cvr v, ci i, ci l, ci r)
virtual void run_many(ci n)
declaring this guy pure virtual shortens virtual table. It saves some execution time.
virtual void run_many(ci n)
declaring this guy pure virtual shortens virtual table. It saves some execution time.
StorePrm(rgt rn, vr s, cvr c, cvr p, cvr v, ci i, ci l, ci r)
StoreVar(rgt rn, vr s, cvr c, cvr p, cvr v, ci i, ci l, ci r)
virtual void run_many(ci n)
declaring this guy pure virtual shortens virtual table. It saves some execution time.