Cadabra
Computer algebra system for field theory problems
Public Member Functions | Public Attributes | List of all members
cadabra::Evaluator Class Reference

Description

Functionality to numerically evaluate a scalar expression, give the values of its building blocks.

The input is a map which relates subtrees in the expression to numerical values. The evaluate function will then do a post-order iteration over the tree, collecting and combining the values thus obtained.

Currently needs the leaf nodes to have an entry in the subtree_values map; may be extended later to cover values of non-elementary subtrees.

#include <Evaluator.hh>

Public Member Functions

void find_common_subexpressions (std::vector< Ex * >)
 
void set_variables ()
 
double evaluate (const Ex &)
 

Public Attributes

std::map< Ex::iterator, double, Ex::iterator_base_less > subtree_values
 
std::map< Ex::iterator, Ex::iterator, Ex::iterator_base_less > subtree_equalities
 

Member Function Documentation

◆ evaluate()

double Evaluator::evaluate ( const Ex ex)

◆ find_common_subexpressions()

void Evaluator::find_common_subexpressions ( std::vector< Ex * >  )

◆ set_variables()

void cadabra::Evaluator::set_variables ( )

Member Data Documentation

◆ subtree_equalities

std::map<Ex::iterator, Ex::iterator, Ex::iterator_base_less> cadabra::Evaluator::subtree_equalities

◆ subtree_values

std::map<Ex::iterator, double, Ex::iterator_base_less> cadabra::Evaluator::subtree_values

The documentation for this class was generated from the following files: