Cadabra Computer algebra system for field theory problems
evaluate.hh
Go to the documentation of this file.
1
2 #pragma once
3
4 #include "Compare.hh"
5
6
11
90 #include "Algorithm.hh"
91 #include "properties/Indices.hh"
92
94
95  class evaluate : public Algorithm {
96  public:
97  evaluate(const Kernel&, Ex&, const Ex& component_values, bool rhs=false, bool simplify=true);
98
99  virtual bool can_apply(iterator) override;
100  virtual result_t apply(iterator&) override;
101
105  void merge_components(iterator it1, iterator it2);
106
107  private:
108  const Ex& components;
110
111  bool is_component(iterator it) const;
112  bool is_scalar_function(iterator it) const;
113
119
123
124  iterator handle_factor(sibling_iterator sib, const index_map_t& full_ind_free);
125
129  iterator dense_factor(iterator sib, const index_map_t& ind_free, const index_map_t& ind_dummy);
130
134
137  void cleanup_components(iterator it1);
138
142
145
148
151  std::set<Ex, tree_exact_less_obj> dependencies(iterator it);
152  };
153
154  }
Indices.hh
bool is_component(iterator it) const
Definition: evaluate.cc:107
iterator handle_prod(iterator it)
Definition: evaluate.cc:1179
Ex::sibling_iterator sibling_iterator
Definition: Algorithm.hh:72
iterator handle_factor(sibling_iterator sib, const index_map_t &full_ind_free)
Replace a single factor with a 'components' ...
Definition: evaluate.cc:229
Algorithm.hh
std::multimap< Ex, Ex::iterator, tree_exact_less_for_indexmap_obj > index_map_t
A map from a pattern to the position where it occurs in the tree.
Definition: IndexClassifier.hh:23
void simplify_components(iterator)
Simplify all components of a 'components' node by running sympy's simplify on them.
Definition: evaluate.cc:1047
Definition: Kernel.hh:15
iterator handle_sum(iterator it)
Definition: evaluate.cc:142
iterator handle_derivative(iterator it)
Definition: evaluate.cc:602
const Ex & components
Definition: evaluate.hh:108
Definition: evaluate.hh:95
Definition: simplify.hh:15
void merge_components(iterator it1, iterator it2)
Merge the information in two 'components' nodes at the given iterators, moving all out of the second ...
Definition: evaluate.cc:506
Ex rhs(Ex_ptr ex)
Definition: py_ex.cc:354
Compare.hh
evaluate(const Kernel &, Ex &, const Ex &component_values, bool rhs=false, bool simplify=true)
Definition: evaluate.cc:21
iterator wrap_scalar_in_components_node(iterator sib)
Wrap a non-component scalar node in a 'components' node.
Definition: evaluate.cc:1155
bool is_scalar_function(iterator it) const
Definition: evaluate.cc:31
Ex::iterator iterator
Definition: Algorithm.hh:70
virtual result_t apply(iterator &) override
Definition: evaluate.cc:37
Definition: Algorithm.hh:59
void merge_component_children(iterator it)
Merge entries in a single 'components' node when they are for the same index value(s).
Definition: evaluate.cc:462
Functions to handle the exchange properties of two or more symbols in a product.
Definition: Storage.hh:141
void unwrap_scalar_in_components_node(iterator sib)
Inverse of the above.
Definition: evaluate.cc:1165
iterator handle_epsilon(iterator it)
Definition: evaluate.cc:1004
iterator dense_factor(iterator sib, const index_map_t &ind_free, const index_map_t &ind_dummy)
Expand a tensor factor into a components node with all components written out explicitly.
Definition: evaluate.cc:388
virtual bool can_apply(iterator) override
Definition: evaluate.cc:26
result_t
Keeping track of what algorithms have done to this expression.
Definition: Storage.hh:160
std::set< Ex, tree_exact_less_obj > dependencies(iterator it)
Determine all the Coordinate dependencies of the object at 'it'.
Definition: evaluate.cc:1086
void cleanup_components(iterator it1)
Cleanup all components in a 'components' node; that is, call the cleanup_dispatch function on them.
Definition: evaluate.cc:588
bool call_sympy
Definition: evaluate.hh:109
iterator handle_components(iterator it)
Definition: evaluate.cc:127