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 
22 
23  class NEvaluator {
24  public:
25  NEvaluator(const Ex&);
26 
29  std::map<Ex::iterator, NTensor, Ex::iterator_base_less> subtree_values;
30 
35  std::map<Ex::iterator, Ex::iterator, Ex::iterator_base_less> subtree_equalities;
36 
41  public:
44  std::vector<Ex::iterator> locations;
45  };
46  std::vector<VariableValues> variable_values;
47 
50  void set_variable(const Ex&, const NTensor& val);
51 
54  NTensor evaluate();
55 
57 
59 
60  private:
61  const Ex& ex;
62  };
63 
64 };
cadabra::NEvaluator::set_variable
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:105
cadabra::NEvaluator::variable_values
std::vector< VariableValues > variable_values
Definition: NEvaluator.hh:46
cadabra::NEvaluator::subtree_equalities
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:35
NTensor.hh
cadabra::NEvaluator::VariableValues::locations
std::vector< Ex::iterator > locations
Definition: NEvaluator.hh:44
cadabra::NEvaluator::NEvaluator
NEvaluator(const Ex &)
Definition: NEvaluator.cc:14
cadabra::NEvaluator::evaluate
NTensor evaluate()
Evaluate the expression, using the variable values set in set_variable.
Definition: NEvaluator.cc:19
cadabra::NEvaluator::VariableValues
The expression will get evaluated for a range of values for each unknown sub-expression (variable).
Definition: NEvaluator.hh:40
Storage.hh
cadabra::NEvaluator::subtree_values
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:29
cadabra::NEvaluator
Functionality to numerically evaluate a scalar expression, give the values of its building blocks.
Definition: NEvaluator.hh:23
cadabra
Functions to handle the exchange properties of two or more symbols in a product.
Definition: Adjform.cc:83
cadabra::Ex
Definition: Storage.hh:140
cadabra::NEvaluator::find_variable_locations
void find_variable_locations()
PRIVATE:
Definition: NEvaluator.cc:110
cadabra::NEvaluator::VariableValues::variable
Ex variable
Definition: NEvaluator.hh:42
cadabra::NEvaluator::ex
const Ex & ex
Definition: NEvaluator.hh:61
NTensor
Class to hold numerical values structured in tensor form, that is, a multi-dimensional array.
Definition: NTensor.hh:10
cadabra::NEvaluator::VariableValues::values
NTensor values
Definition: NEvaluator.hh:43