OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
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 boost::apply_visitor More...
 

Public Member Functions

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

Detailed Description

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

Definition at line 287 of file matheval.hpp.

Member Typedef Documentation

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

Member Function Documentation

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

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

Numbers evaluate to themselves.

Definition at line 295 of file matheval.hpp.

References Hypervolume::n.

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

References Physics::c.

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

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

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 306 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.

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


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