OPAL (Object Oriented Parallel Accelerator Library) 2024.2
OPAL
Public Types | Public Member Functions | List of all members
matheval::detail::ConstantFolder< real_t > Struct Template Reference

#include <matheval.hpp>

Public Types

using result_type = typename expr_ast< real_t >::tree_t
 Necessary typedef for 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.
 
result_type operator() (recursive_wrapper< expr_ast< real_t > > const &w) const
 Handle recursive_wrapper for expr_ast.
 
result_type operator() (recursive_wrapper< binary_op< real_t > > const &w) const
 Handle recursive_wrapper for binary_op.
 
result_type operator() (recursive_wrapper< unary_op< real_t > > const &w) const
 Handle recursive_wrapper for unary_op.
 

Detailed Description

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

Definition at line 355 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 visitor.

Definition at line 357 of file matheval.hpp.

Member Function Documentation

◆ operator()() [1/9]

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 374 of file matheval.hpp.

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

◆ operator()() [2/9]

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 369 of file matheval.hpp.

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

◆ operator()() [3/9]

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 360 of file matheval.hpp.

◆ operator()() [4/9]

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

Numbers evaluate to themselves.

Definition at line 363 of file matheval.hpp.

◆ operator()() [5/9]

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

Handle recursive_wrapper for binary_op.

Definition at line 404 of file matheval.hpp.

◆ operator()() [6/9]

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

Handle recursive_wrapper for expr_ast.

Definition at line 399 of file matheval.hpp.

◆ operator()() [7/9]

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

Handle recursive_wrapper for unary_op.

Definition at line 409 of file matheval.hpp.

◆ operator()() [8/9]

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 366 of file matheval.hpp.

◆ operator()() [9/9]

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 389 of file matheval.hpp.

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


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