OPALX (Object Oriented Parallel Accelerator Library for Exascal) MINIorX
OPALX
matheval::detail::ConstantFolder< real_t > Struct Template Reference

#include <matheval.hpp>

Collaboration diagram for matheval::detail::ConstantFolder< real_t >:

Public Types

using result_type = typename expr_ast<real_t>::tree_t
 Necessary typedef for boost::apply_visitor.

Public Member Functions

result_type operator() (nil) const
 Empty nodes in the tree evaluate to 0.
result_type operator() (real_t n) const
 Numbers evaluate to themselves.
result_type operator() (std::string const &c) const
 Variables do not evaluate.
result_type operator() (expr_ast< real_t > const &ast) const
 Recursively evaluate the AST.
result_type operator() (binary_op< real_t > const &tree) const
 Evaluate a binary operator and optionally recurse its operands.
result_type operator() (unary_op< real_t > const &tree) const
 Evaluate a unary operator and optionally recurse its operand.

Detailed Description

template<typename real_t>
struct matheval::detail::ConstantFolder< real_t >

Definition at line 279 of file matheval.hpp.

Member Typedef Documentation

◆ result_type

template<typename real_t>
using matheval::detail::ConstantFolder< real_t >::result_type = typename expr_ast<real_t>::tree_t

Necessary typedef for boost::apply_visitor.

Definition at line 281 of file matheval.hpp.

Member Function Documentation

◆ operator()() [1/6]

template<typename real_t>
result_type matheval::detail::ConstantFolder< real_t >::operator() ( binary_op< real_t > const & tree) const
inline

Evaluate a binary operator and optionally recurse its operands.

Definition at line 298 of file matheval.hpp.

References matheval::detail::holds_alternative(), matheval::detail::binary_op< real_t >::lhs, matheval::detail::binary_op< real_t >::op, and matheval::detail::binary_op< real_t >::rhs.

Here is the call graph for this function:

◆ operator()() [2/6]

template<typename real_t>
result_type matheval::detail::ConstantFolder< real_t >::operator() ( expr_ast< real_t > const & ast) const
inline

Recursively evaluate the AST.

Definition at line 293 of file matheval.hpp.

References matheval::detail::expr_ast< real_t >::tree.

◆ operator()() [3/6]

template<typename real_t>
result_type matheval::detail::ConstantFolder< real_t >::operator() ( nil ) const
inline

Empty nodes in the tree evaluate to 0.

Definition at line 284 of file matheval.hpp.

◆ operator()() [4/6]

template<typename real_t>
result_type matheval::detail::ConstantFolder< real_t >::operator() ( real_t n) const
inline

Numbers evaluate to themselves.

Definition at line 287 of file matheval.hpp.

◆ operator()() [5/6]

template<typename real_t>
result_type matheval::detail::ConstantFolder< real_t >::operator() ( std::string const & c) const
inline

Variables do not evaluate.

Definition at line 290 of file matheval.hpp.

◆ operator()() [6/6]

template<typename real_t>
result_type matheval::detail::ConstantFolder< real_t >::operator() ( unary_op< real_t > const & tree) const
inline

Evaluate a unary operator and optionally recurse its operand.

Definition at line 311 of file matheval.hpp.

References matheval::detail::holds_alternative(), matheval::detail::unary_op< real_t >::op, and matheval::detail::unary_op< real_t >::rhs.

Here is the call graph for this function:

The documentation for this struct was generated from the following file: