Cadabra
Computer algebra system for field theory problems
|
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 |
double Evaluator::evaluate | ( | const Ex & | ex | ) |
void Evaluator::find_common_subexpressions | ( | std::vector< Ex * > | ) |
void cadabra::Evaluator::set_variables | ( | ) |
std::map<Ex::iterator, Ex::iterator, Ex::iterator_base_less> cadabra::Evaluator::subtree_equalities |
std::map<Ex::iterator, double, Ex::iterator_base_less> cadabra::Evaluator::subtree_values |