Cadabra
Computer algebra system for field theory problems
Loading...
Searching...
No Matches
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
93namespace cadabra {
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
106
111 void simplify_components(iterator, bool run_sympy=true);
112
113 private:
116
117 bool is_component(iterator it) const;
118 bool is_scalar_function(iterator it) const;
119
125
129
131
135 iterator dense_factor(iterator sib, const index_map_t& ind_free, const index_map_t& ind_dummy);
136
140
144
147
150
153 std::set<Ex, tree_exact_less_obj> dependencies(iterator it);
154 };
155
156 }
Base class for all algorithms, containing generic routines and in particular the logic for index clas...
Definition Algorithm.hh:59
Ex::iterator iterator
Definition Algorithm.hh:70
Ex::sibling_iterator sibling_iterator
Definition Algorithm.hh:72
Basic storage class for symbolic mathemematical expressions.
Definition Storage.hh:142
result_t
Keeping track of what algorithms have done to this expression.
Definition Storage.hh:168
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
Definition Kernel.hh:15
Definition evaluate.hh:95
virtual bool can_apply(iterator) override
Definition evaluate.cc:28
iterator handle_components(iterator it)
Definition evaluate.cc:136
bool is_component(iterator it) const
Definition evaluate.cc:116
bool is_scalar_function(iterator it) const
Definition evaluate.cc:33
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:503
void cleanup_components(iterator it1)
Cleanup all components in a 'components' node; that is, call the cleanup_dispatch function on them.
Definition evaluate.cc:629
bool only_rhs
Definition evaluate.hh:115
iterator handle_prod(iterator it)
Definition evaluate.cc:1257
virtual result_t apply(iterator &) override
Definition evaluate.cc:39
std::set< Ex, tree_exact_less_obj > dependencies(iterator it)
Determine all the Coordinate dependencies of the object at 'it'.
Definition evaluate.cc:1164
iterator handle_derivative(iterator it)
Definition evaluate.cc:643
void simplify_components(iterator, bool run_sympy=true)
Simplify all components of a 'components' node by collecting terms and optionally running sympy's sim...
Definition evaluate.cc:1121
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:411
iterator handle_epsilon(iterator it)
Definition evaluate.cc:1049
const Ex & components
Definition evaluate.hh:114
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:547
iterator wrap_scalar_in_components_node(iterator sib)
Wrap a non-component scalar node in a 'components' node.
Definition evaluate.cc:1233
void unwrap_scalar_in_components_node(iterator sib)
Inverse of the above.
Definition evaluate.cc:1243
bool call_sympy
Definition evaluate.hh:115
iterator handle_sum(iterator it)
Definition evaluate.cc:151
iterator handle_factor(sibling_iterator sib, const index_map_t &full_ind_free)
Replace a single factor with a 'components' ... The full_ind_free argument can contain a list of indi...
Definition evaluate.cc:238
General purpose brute force scalar simplification algorithm.
Definition simplify.hh:15
Functions to handle the exchange properties of two or more symbols in a product.
Definition Adjform.cc:83
Ex rhs(Ex_ptr ex)
Definition py_ex.cc:391
void set(rset_t::iterator &num, multiplier_t fac)
Definition Storage.cc:1064