Cadabra
Computer algebra system for field theory problems
NEvaluator.hh
Go to the documentation of this file.
1 
2 #pragma once
3 
4 #include "Storage.hh"
5 #include "NTensor.hh"
6 
7 namespace cadabra {
8 
24 
25  class NEvaluator {
26  public:
27  NEvaluator(const Ex&);
28 
31  std::map<Ex::iterator, NTensor, Ex::iterator_base_less> subtree_values;
32 
37  std::map<Ex::iterator, Ex::iterator, Ex::iterator_base_less> subtree_equalities;
38 
43  public:
46  std::vector<Ex::iterator> locations;
47  };
48  std::vector<VariableValues> variable_values;
49 
52  void set_variable(const Ex&, const NTensor& val);
53 
56  NTensor evaluate();
57 
59 
61 
62  private:
63  const Ex& ex;
64  };
65 
66 };
Basic storage class for symbolic mathemematical expressions.
Definition: Storage.hh:142
The expression will get evaluated for a range of values for each unknown sub-expression (variable).
Definition: NEvaluator.hh:42
Ex variable
Definition: NEvaluator.hh:44
std::vector< Ex::iterator > locations
Definition: NEvaluator.hh:46
NTensor values
Definition: NEvaluator.hh:45
Functionality to numerically evaluate a scalar expression, give the values of its building blocks.
Definition: NEvaluator.hh:25
std::vector< VariableValues > variable_values
Definition: NEvaluator.hh:48
std::map< Ex::iterator, NTensor, Ex::iterator_base_less > subtree_values
If we know the value of a subtree explicitly as a number, it is stored in this map.
Definition: NEvaluator.hh:31
void find_variable_locations()
PRIVATE:
Definition: NEvaluator.cc:207
std::map< Ex::iterator, Ex::iterator, Ex::iterator_base_less > subtree_equalities
If we know the value of a subtree is equal to another subtree (either in the same expression or anoth...
Definition: NEvaluator.hh:37
const Ex & ex
Definition: NEvaluator.hh:63
NTensor evaluate()
Evaluate the expression, using the variable values set in set_variable.
Definition: NEvaluator.cc:21
NEvaluator(const Ex &)
Definition: NEvaluator.cc:16
void set_variable(const Ex &, const NTensor &val)
Set the range of values which we want to insert into the indicated variable.
Definition: NEvaluator.cc:202
Definition: NTensor.hh:14
Functions to handle the exchange properties of two or more symbols in a product.
Definition: Adjform.cc:83