39#include <boost/spirit/include/classic_assign_actor.hpp>
40#include <boost/spirit/include/classic_ast.hpp>
41#include <boost/spirit/include/classic_core.hpp>
42#include <boost/spirit/include/classic_push_back_actor.hpp>
43#include <boost/spirit/include/classic_symbols.hpp>
45#include <boost/algorithm/string/trim.hpp>
46#include <boost/math/special_functions/bessel.hpp>
48namespace bsp = boost::spirit::classic;
62 return (arg > 0.0) - (arg < 0.0);
71 std::random_device rd;
72 std::mt19937 gen(rd());
73 return std::normal_distribution<>(0, sigma)(gen);
78 return (x != 0.0 || y != 0.0) ?
sqrt(x * x + y * y) : 0.0;
83 return (x != 0.0 || y != 0.0) ? atan2(y, x) : 0.0;
134 (
"fmod",
static_cast<double (*)(
double,
double)
>(
172 typedef bsp::tree_parse_info<std::string::const_iterator,
173 bsp::node_val_data_factory<NekDouble>>
175 typedef bsp::tree_match<std::string::const_iterator,
176 bsp::node_val_data_factory<NekDouble>>::
278 for (
auto &it : it_es)
300 for (
auto const &it : constants)
326 std::string errormsg =
327 "Attempt to add numerically different constants under the "
330 std::cout << errormsg << std::endl;
342 ASSERTL1(value !=
nullptr,
"Constant variable not found: " +
name);
351 for (
auto const &it : params)
382 "Parameter not found: " +
name);
416 std::vector<std::string> variableNames;
417 bsp::parse((
char *)vlist.c_str(),
419 *(+(+bsp::graph_p)[bsp::push_back_a(variableNames)] >>
428 bsp::ast_parse<bsp::node_val_data_factory<NekDouble>,
430 bsp::space_parser>(expr.begin(), expr.end(),
431 myGrammar, bsp::space_p);
434 "Unable to fully parse function. Stopped just before: " +
435 std::string(parseInfo.stop, parseInfo.stop + 15));
439 throw std::runtime_error(
440 "Unable to fully parse function at: " +
441 std::string(parseInfo.stop, parseInfo.stop + 15));
455 for (
int i = 0; i < variableNames.size(); i++)
457 variableMap[variableNames[i]] = i;
463 stack, variableMap, 0);
469 "Constant expression yeilds non-empty execution stack. "
470 "Bug in PrepareExecutionAsYouParse()");
473 std::string(
"EXPRESSION_") + std::to_string(stackId), v.second);
474 stack.push_back(makeStep<StoreConst>(0, const_index));
497 "unknown analytic expression, it must first be defined "
498 "with DefineFunction(...)");
503 for (
int i = 0; i < stack.size(); i++)
505 (*stack[i]).run_once();
523 "unknown analytic expression, it must first be defined with "
524 "DefineFunction(...)");
545 for (
int i = 0; i < stack.size(); i++)
547 (*stack[i]).run_once();
564 "unknown analytic expression, it must first be defined with "
565 "DefineFunction(...)");
570 ASSERTL1(point.size() == variableMap.size(),
571 "The number of variables used to define this expression should"
572 " match the point dimensionality.");
577 VariableMap::const_iterator it;
579 for (it = variableMap.begin(); it != variableMap.end(); ++it)
585 for (
int i = 0; i < stack.size(); i++)
587 (*stack[i]).run_once();
605 std::vector<Array<OneD, const NekDouble>> points = {x, y,
z, t};
618 const int num_points = points[0].size();
620 "unknown analytic expression, it must first be defined "
621 "with DefineFunction(...)");
622 ASSERTL1(result.size() >= num_points,
623 "destination array must have enough capacity to store "
624 "expression values at each given point");
631 const int max_chunk_size = 1024;
632 const int nvals = points.size();
633 const int chunk_size = (std::min)(max_chunk_size, num_points);
643 if (result.size() < num_points)
649 int work_left = num_points;
650 while (work_left > 0)
652 const int this_chunk_size = (std::min)(work_left, 1024);
653 for (
int i = 0; i < this_chunk_size; i++)
655 for (
int j = 0; j < nvals; ++j)
657 m_variable[i + this_chunk_size * j] = points[j][offset + i];
660 for (
int i = 0; i < stack.size(); i++)
662 (*stack[i]).run_many(this_chunk_size);
664 for (
int i = 0; i < this_chunk_size; i++)
666 result[offset + i] =
m_state[i];
668 work_left -= this_chunk_size;
669 offset += this_chunk_size;
716 std::string valueStr(location->value.begin(), location->value.end());
717 boost::algorithm::trim(valueStr);
719 const bsp::parser_id parserID = location->value.id();
720#if defined(NEKTAR_DEBUG) || defined(NEKTAR_FULLDEBUG)
721 const int num_children = location->children.size();
727 "Illegal children under constant node: " + valueStr);
731 "Cannot find the value for the specified constant: " +
734 return std::make_pair(
true,
m_constant[it->second]);
739 "Illegal children under number node: " + valueStr);
740 return std::make_pair(
741 true, boost::lexical_cast<NekDouble>(valueStr.c_str()));
746 "Illegal children under variable node: " + valueStr);
748 VariableMap::const_iterator it = variableMap.find(valueStr);
750 "Unknown variable parsed: " + valueStr);
753 stack.push_back(makeStep<StoreVar>(stateIndex, it->second));
754 return std::make_pair(
false, 0);
759 "Illegal children under parameter node: " + valueStr);
763 "Unknown parameter parsed: " + valueStr);
766 stack.push_back(makeStep<StorePrm>(stateIndex, it->second));
767 return std::make_pair(
false, 0);
773 "Invalid function specified: " + valueStr);
774 ASSERTL1(num_children == 1 || num_children == 2,
775 "Function " + valueStr +
776 " has neither one or two "
777 "arguments: this is not implemented yet.");
779 if (location->children.size() == 1)
782 location->children.begin(), stack, variableMap, stateIndex);
792 makeStep<StoreConst>(stateIndex, const_index));
793 stack.push_back(makeStep<EvalAWGN>(stateIndex, stateIndex));
794 return std::make_pair(
false, 0);
799 return std::make_pair(
true,
807 stack, variableMap, stateIndex);
809 location->children.begin() + 1, stack, variableMap,
813 if (
true == v1.first &&
true == v2.first)
815 return std::make_pair(
816 true,
m_function2[it->second](v1.second, v2.second));
825 stack.push_back(makeStep<EvalAbs>(stateIndex, stateIndex));
826 return std::make_pair(
false, 0);
828 stack.push_back(makeStep<EvalAsin>(stateIndex, stateIndex));
829 return std::make_pair(
false, 0);
831 stack.push_back(makeStep<EvalAcos>(stateIndex, stateIndex));
832 return std::make_pair(
false, 0);
834 stack.push_back(makeStep<EvalAtan>(stateIndex, stateIndex));
835 return std::make_pair(
false, 0);
837 stack.push_back(makeStep<EvalAtan2>(stateIndex, stateIndex,
839 return std::make_pair(
false, 0);
841 stack.push_back(makeStep<EvalAng>(stateIndex, stateIndex,
843 return std::make_pair(
false, 0);
845 stack.push_back(makeStep<EvalBessel>(stateIndex, stateIndex,
847 return std::make_pair(
false, 0);
849 stack.push_back(makeStep<EvalCeil>(stateIndex, stateIndex));
850 return std::make_pair(
false, 0);
852 stack.push_back(makeStep<EvalCos>(stateIndex, stateIndex));
853 return std::make_pair(
false, 0);
855 stack.push_back(makeStep<EvalCosh>(stateIndex, stateIndex));
856 return std::make_pair(
false, 0);
858 stack.push_back(makeStep<EvalExp>(stateIndex, stateIndex));
859 return std::make_pair(
false, 0);
861 stack.push_back(makeStep<EvalFabs>(stateIndex, stateIndex));
862 return std::make_pair(
false, 0);
865 makeStep<EvalFloor>(stateIndex, stateIndex));
866 return std::make_pair(
false, 0);
868 stack.push_back(makeStep<EvalFmod>(stateIndex, stateIndex,
870 return std::make_pair(
false, 0);
872 stack.push_back(makeStep<EvalLog>(stateIndex, stateIndex));
873 return std::make_pair(
false, 0);
876 makeStep<EvalLog10>(stateIndex, stateIndex));
877 return std::make_pair(
false, 0);
879 stack.push_back(makeStep<EvalMax>(stateIndex, stateIndex,
881 return std::make_pair(
false, 0);
883 stack.push_back(makeStep<EvalMin>(stateIndex, stateIndex,
885 return std::make_pair(
false, 0);
887 stack.push_back(makeStep<EvalRad>(stateIndex, stateIndex,
889 return std::make_pair(
false, 0);
891 stack.push_back(makeStep<EvalSin>(stateIndex, stateIndex));
892 return std::make_pair(
false, 0);
894 stack.push_back(makeStep<EvalSinh>(stateIndex, stateIndex));
895 return std::make_pair(
false, 0);
897 stack.push_back(makeStep<EvalSqrt>(stateIndex, stateIndex));
898 return std::make_pair(
false, 0);
900 stack.push_back(makeStep<EvalTan>(stateIndex, stateIndex));
901 return std::make_pair(
false, 0);
903 stack.push_back(makeStep<EvalTanh>(stateIndex, stateIndex));
904 return std::make_pair(
false, 0);
906 stack.push_back(makeStep<EvalSign>(stateIndex, stateIndex));
907 return std::make_pair(
false, 0);
909 ASSERTL0(
false,
"Evaluation of " + valueStr +
910 " is not implemented yet");
912 return std::make_pair(
false, 0);
917 "Illegal factor - it can only be '-' and it was: " +
920 "Illegal number of children under factor node: " +
923 location->children.begin(), stack, variableMap, stateIndex);
928 return std::make_pair(
true, -v.second);
930 stack.push_back(makeStep<EvalNeg>(stateIndex, stateIndex));
931 return std::make_pair(
false, 0);
937 "Too few or too many arguments for mathematical operator: " +
940 location->children.begin() + 0, stack, variableMap, stateIndex);
943 stack, variableMap, stateIndex + 1);
947 if ((left.first ==
true) && (right.first ==
true))
949 switch (*valueStr.begin())
952 return std::make_pair(
true, left.second + right.second);
954 return std::make_pair(
true, left.second - right.second);
956 return std::make_pair(
true, left.second * right.second);
958 return std::make_pair(
true, left.second / right.second);
960 return std::make_pair(
961 true, std::fmod(left.second, right.second));
963 return std::make_pair(
964 true, std::pow(left.second, right.second));
966 return std::make_pair(
true,
967 left.second == right.second);
969 if (*(valueStr.end() - 1) ==
'=')
971 return std::make_pair(
true,
972 left.second <= right.second);
976 return std::make_pair(
true,
977 left.second < right.second);
980 if (*(valueStr.end() - 1) ==
'=')
982 return std::make_pair(
true,
983 left.second >= right.second);
987 return std::make_pair(
true,
988 left.second > right.second);
992 "Invalid operator encountered: " + valueStr);
994 return std::make_pair(
false, 0);
999 if (
true == left.first)
1005 stack.push_back(makeStep<StoreConst>(stateIndex, const_index));
1007 if (
true == right.first)
1014 makeStep<StoreConst>(stateIndex + 1, const_index));
1017 switch (*valueStr.begin())
1020 stack.push_back(makeStep<EvalSum>(stateIndex, stateIndex,
1022 return std::make_pair(
false, 0);
1024 stack.push_back(makeStep<EvalSub>(stateIndex, stateIndex,
1026 return std::make_pair(
false, 0);
1028 stack.push_back(makeStep<EvalMul>(stateIndex, stateIndex,
1030 return std::make_pair(
false, 0);
1032 stack.push_back(makeStep<EvalDiv>(stateIndex, stateIndex,
1034 return std::make_pair(
false, 0);
1036 stack.push_back(makeStep<EvalMod>(stateIndex, stateIndex,
1038 return std::make_pair(
false, 0);
1040 stack.push_back(makeStep<EvalPow>(stateIndex, stateIndex,
1042 return std::make_pair(
false, 0);
1044 stack.push_back(makeStep<EvalLogicalEqual>(
1045 stateIndex, stateIndex, stateIndex + 1));
1046 return std::make_pair(
false, 0);
1048 if (*(valueStr.end() - 1) ==
'=')
1050 stack.push_back(makeStep<EvalLogicalLeq>(
1051 stateIndex, stateIndex, stateIndex + 1));
1055 stack.push_back(makeStep<EvalLogicalLess>(
1056 stateIndex, stateIndex, stateIndex + 1));
1058 return std::make_pair(
false, 0);
1061 if (*(valueStr.end() - 1) ==
'=')
1063 stack.push_back(makeStep<EvalLogicalGeq>(
1064 stateIndex, stateIndex, stateIndex + 1));
1068 stack.push_back(makeStep<EvalLogicalGreater>(
1069 stateIndex, stateIndex, stateIndex + 1));
1071 return std::make_pair(
false, 0);
1075 "Invalid operator encountered: " + valueStr);
1077 return std::make_pair(
false, 0);
1083 "Too few or too many arguments for mathematical operator: " +
1086 ASSERTL0(
false,
"Illegal expression encountered: " + valueStr);
1087 return std::make_pair(
false, 0);
1113 for (
auto const &it : vars)
1133 const std::vector<std::string> &
variables)
1156 *((bsp::root_node_d[bsp::str_p(
"||")] >>
logical_and));
1160 *((bsp::root_node_d[bsp::str_p(
"&&")] >>
equality));
1163 lt_gt >> *((bsp::root_node_d[bsp::str_p(
"==")] >>
lt_gt));
1166 *((bsp::root_node_d[bsp::str_p(
"<=")] >>
add_sub) |
1167 (bsp::root_node_d[bsp::str_p(
">=")] >>
add_sub) |
1168 (bsp::root_node_d[bsp::ch_p(
'<')] >>
add_sub) |
1169 (bsp::root_node_d[bsp::ch_p(
'>')] >>
add_sub));
1172 negate >> *((bsp::root_node_d[bsp::ch_p(
'+')] >>
negate) |
1173 (bsp::root_node_d[bsp::ch_p(
'-')] >>
negate));
1179 *((bsp::root_node_d[bsp::ch_p(
'*')] >>
exponential) |
1180 (bsp::root_node_d[bsp::ch_p(
'/')] >>
exponential) |
1181 (bsp::root_node_d[bsp::ch_p(
'%')] >>
exponential));
1187 bsp::inner_node_d[bsp::ch_p(
'(') >>
expression >>
1190 bsp::leaf_node_d[bsp::lexeme_d[(bsp::alpha_p |
'_' |
'$') >>
1191 *(bsp::alnum_p |
'_' |
1197 bsp::infix_node_d[bsp::inner_node_d[bsp::ch_p(
'(') >>
1205 number = bsp::leaf_node_d[bsp::lexeme_d[bsp::real_p]] >>
op;
1210 op = bsp::eps_p(bsp::end_p |
"||" |
"&&" |
"==" |
"<=" |
">=" |
1211 '<' |
'>' |
'+' |
'-' |
'*' |
'/' |
'%' |
'^' |
1221 bsp::rule<ScannerT, bsp::parser_context<>, bsp::parser_tag<N>>;
1323 typedef std::vector<NekDouble> &
vr;
1324 typedef const std::vector<NekDouble> &
cvr;
1329 template <
typename StepType>
1406 for (
int i = 0; i < n; i++)
1424 for (
int i = 0; i < n; i++)
1442 for (
int i = 0; i < n; i++)
1460 for (
int i = 0; i < n; i++)
1478 for (
int i = 0; i < n; i++)
1497 for (
int i = 0; i < n; i++)
1516 for (
int i = 0; i < n; i++)
1535 for (
int i = 0; i < n; i++)
1554 for (
int i = 0; i < n; i++)
1573 for (
int i = 0; i < n; i++)
1591 for (
int i = 0; i < n; i++)
1610 for (
int i = 0; i < n; i++)
1629 for (
int i = 0; i < n; i++)
1648 for (
int i = 0; i < n; i++)
1667 for (
int i = 0; i < n; i++)
1686 for (
int i = 0; i < n; i++)
1705 for (
int i = 0; i < n; i++)
1723 for (
int i = 0; i < n; i++)
1742 for (
int i = 0; i < n; i++)
1760 for (
int i = 0; i < n; i++)
1778 for (
int i = 0; i < n; i++)
1796 for (
int i = 0; i < n; i++)
1815 for (
int i = 0; i < n; i++)
1834 for (
int i = 0; i < n; i++)
1854 for (
int i = 0; i < n; i++)
1872 for (
int i = 0; i < n; i++)
1890 for (
int i = 0; i < n; i++)
1908 for (
int i = 0; i < n; i++)
1926 for (
int i = 0; i < n; i++)
1944 for (
int i = 0; i < n; i++)
1962 for (
int i = 0; i < n; i++)
1981 for (
int i = 0; i < n; i++)
1999 for (
int i = 0; i < n; i++)
2017 for (
int i = 0; i < n; i++)
2036 for (
int i = 0; i < n; i++)
2055 for (
int i = 0; i < n; i++)
2074 for (
int i = 0; i < n; i++)
2092 for (
int i = 0; i < n; i++)
2110 for (
int i = 0; i < n; i++)
2128 for (
int i = 0; i < n; i++)
2146 for (
int i = 0; i < n; i++)
2167 for (
int i = 0; i < n; i++)
2195 m_impl = std::move(r.m_impl);
2201 m_impl->SetRandomSeed(seed);
2205 std::map<std::string, NekDouble>
const &constants)
2207 m_impl->AddConstants(constants);
2222 m_impl->SetParameters(params);
2237 return m_impl->GetTime();
2241 const std::string &function)
2243 return m_impl->DefineFunction(vlist, function);
2248 return m_impl->Evaluate(AnalyticExpression_id);
2255 return m_impl->Evaluate(AnalyticExpression_id, x, y,
z, t);
2259 std::vector<NekDouble> point)
2261 return m_impl->EvaluateAtPoint(AnalyticExpression_id, point);
2271 m_impl->Evaluate(expression_id, x, y,
z, t, result);
2275 const int expression_id,
2279 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.
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...
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
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.
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.
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)
bsp::tree_match< std::string::const_iterator, bsp::node_val_data_factory< NekDouble > >::tree_iterator ParsedTreeIterator
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.
EvaluationStep * makeStep(ci dest, ci src_left=0, ci src_right=0)
Factory method which makes code little less messy.
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)
std::vector< double > z(NPUPPER)
scalarT< T > abs(scalarT< T > in)
scalarT< T > log(scalarT< T > in)
scalarT< T > sqrt(scalarT< T > in)
bsp_rule< operatorID> add_sub
bsp_rule< operatorID> mult_div_mod
bsp_rule< parameterID > parameter
bsp_rule< operatorID> const & start() const
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< functionID > function
bsp_rule< operatorID> exponent
bsp_rule< numberID > number
bsp_rule< operatorID> base
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)
void run_many(ci n) override
declaring this guy pure virtual shortens virtual table. It saves some execution time.
void run_many(ci n) override
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)
void run_many(ci n) override
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)
void run_many(ci n) override
declaring this guy pure virtual shortens virtual table. It saves some execution time.
void run_many(ci n) override
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)
void run_many(ci n) override
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)
void run_many(ci n) override
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)
void run_many(ci n) override
declaring this guy pure virtual shortens virtual table. It saves some execution time.
void run_many(ci n) override
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)
EvalCeil(rgt rn, vr s, cvr c, cvr p, cvr v, ci i, ci l, ci r)
void run_many(ci n) override
declaring this guy pure virtual shortens virtual table. It saves some execution time.
void run_many(ci n) override
declaring this guy pure virtual shortens virtual table. It saves some execution time.
EvalCos(rgt rn, vr s, cvr c, cvr p, cvr v, ci i, ci l, ci r)
void run_many(ci n) override
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)
void run_many(ci n) override
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)
void run_many(ci n) override
declaring this guy pure virtual shortens virtual table. It saves some execution time.
EvalFabs(rgt rn, vr s, cvr c, cvr p, cvr v, ci i, ci l, ci r)
void run_many(ci n) override
declaring this guy pure virtual shortens virtual table. It saves some execution time.
void run_many(ci n) override
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)
EvalFmod(rgt rn, vr s, cvr c, cvr p, cvr v, ci i, ci l, ci r)
void run_many(ci n) override
declaring this guy pure virtual shortens virtual table. It saves some execution time.
void run_many(ci n) override
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)
EvalLog(rgt rn, vr s, cvr c, cvr p, cvr v, ci i, ci l, ci r)
void run_many(ci n) override
declaring this guy pure virtual shortens virtual table. It saves some execution time.
EvalLogicalEqual(rgt rn, vr s, cvr c, cvr p, cvr v, ci i, ci l, ci r)
void run_many(ci n) override
declaring this guy pure virtual shortens virtual table. It saves some execution time.
void run_many(ci n) override
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)
void run_many(ci n) override
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)
void run_many(ci n) override
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)
void run_many(ci n) override
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)
void run_many(ci n) override
declaring this guy pure virtual shortens virtual table. It saves some execution time.
EvalMax(rgt rn, vr s, cvr c, cvr p, cvr v, ci i, ci l, ci r)
void run_many(ci n) override
declaring this guy pure virtual shortens virtual table. It saves some execution time.
EvalMin(rgt rn, vr s, cvr c, cvr p, cvr v, ci i, ci l, ci r)
EvalMod(rgt rn, vr s, cvr c, cvr p, cvr v, ci i, ci l, ci r)
void run_many(ci n) override
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)
void run_many(ci n) override
declaring this guy pure virtual shortens virtual table. It saves some execution time.
void run_many(ci n) override
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)
void run_many(ci n) override
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)
void run_many(ci n) override
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)
void run_many(ci n) override
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)
void run_many(ci n) override
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)
void run_many(ci n) override
declaring this guy pure virtual shortens virtual table. It saves some execution time.
EvalSqrt(rgt rn, vr s, cvr c, cvr p, cvr v, ci i, ci l, ci r)
void run_many(ci n) override
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)
void run_many(ci n) override
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)
void run_many(ci n) override
declaring this guy pure virtual shortens virtual table. It saves some execution time.
void run_many(ci n) override
declaring this guy pure virtual shortens virtual table. It saves some execution time.
EvalTan(rgt rn, vr s, cvr c, cvr p, cvr v, ci i, ci l, ci r)
void run_many(ci n) override
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
void run_many(ci n) override
declaring this guy pure virtual shortens virtual table. It saves some execution time.
StoreConst(rgt rn, vr s, cvr c, cvr p, cvr v, ci i, ci l, ci r)
StorePrm(rgt rn, vr s, cvr c, cvr p, cvr v, ci i, ci l, ci r)
void run_many(ci n) override
declaring this guy pure virtual shortens virtual table. It saves some execution time.
void run_many(ci n) override
declaring this guy pure virtual shortens virtual table. It saves some execution time.
StoreVar(rgt rn, vr s, cvr c, cvr p, cvr v, ci i, ci l, ci r)