![]() |
Cadabra
Computer algebra system for field theory problems
|
#include <evaluate.hh>
Public Member Functions | |
evaluate (const Kernel &, Ex &, const Ex &component_values, bool rhs=false, bool simplify=true) | |
virtual bool | can_apply (iterator) override |
virtual result_t | apply (iterator &) override |
void | merge_components (iterator it1, iterator it2) |
Merge the information in two 'components' nodes at the given iterators, moving all out of the second one into the first one. | |
void | simplify_components (iterator, bool run_sympy=true) |
Simplify all components of a 'components' node by collecting terms and optionally running sympy's simplify on them. | |
Public Member Functions inherited from cadabra::Algorithm | |
Algorithm (const Kernel &, Ex &) | |
Initialise the algorithm with a reference to the expression tree, but do not yet do anything with this tree. | |
virtual | ~Algorithm () |
void | set_progress_monitor (ProgressMonitor *) |
Provide the algorithm with a ProgressMonitor object on which to register (nested) progress information, to be reported out-of-band to a client. | |
result_t | apply_generic (bool deep=true, bool repeat=false, unsigned int depth=0) |
The main entry points for running algorithms, which traverse the tree post-order ('child before parent'). | |
result_t | apply_generic (iterator &, bool deep, bool repeat, unsigned int depth) |
result_t | apply_pre_order (bool repeat=false) |
Apply algorithm with alternative traversal: starting from the top node, traverse the tree pre-order ('parent before child') and once the algorithm acts at a given node, do not traverse the subtree below anymore. | |
bool | check_consistency (iterator) const |
Given an expression top node, check index consistency. | |
bool | check_index_consistency (iterator) const |
bool | check_degree_consistency (iterator) const |
Given an expression top node, check differential form degree consistency. | |
void | report_progress (const std::string &, int todo, int done, int count=2) |
index_iterator | begin_index (iterator it) const |
index_iterator | end_index (iterator it) const |
unsigned int | number_of_indices (iterator it) |
std::string | get_index_set_name (iterator it) const |
bool | rename_replacement_dummies (iterator, bool still_inside_algo=false) |
Rename the dummies in the sub-tree starting with head at the given iterator. | |
void | pushup_multiplier (iterator) |
Determines whether the indicated node is 'like a factor in a product'. | |
template<class BinaryPredicate> | |
unsigned int | intersection_number (sibling_iterator, sibling_iterator, sibling_iterator, sibling_iterator, BinaryPredicate) const |
Determine the number of elements in the first range which also occur in the second range. | |
void | node_zero (iterator) |
void | node_one (iterator) |
void | node_integer (iterator, int) |
Public Member Functions inherited from cadabra::IndexClassifier | |
IndexClassifier (const Kernel &) | |
void | fill_index_position_map (Ex::iterator, const index_map_t &, index_position_map_t &) const |
Routines to find and classify all indices in an expression, taking into account sums and products. | |
void | fill_map (index_map_t &, Ex::sibling_iterator, Ex::sibling_iterator) const |
void | print_classify_indices (std::ostream &, Ex::iterator) const |
void | determine_intersection (index_map_t &one, index_map_t &two, index_map_t &target, bool move_out=false) const |
Determine those indices in 'two' which have a name which is identical to an index name occurring in 'one'. | |
void | classify_add_index (Ex::iterator it, index_map_t &ind_free, index_map_t &ind_dummy) const |
void | classify_indices_up (Ex::iterator, index_map_t &ind_free, index_map_t &ind_dummy) const |
Classify indices bottom-up, that is, given a node, it goes up the tree to find. | |
void | classify_indices (Ex::iterator, index_map_t &ind_free, index_map_t &ind_dummy) const |
Classify indices top-down, that is, finds the free indices and all dummy index pairs used in the full subtree below a given node. | |
int | max_numbered_name_one (const std::string &nm, const index_map_t *one) const |
int | max_numbered_name (const std::string &, const index_map_t *m1, const index_map_t *m2=0, const index_map_t *m3=0, const index_map_t *m4=0, const index_map_t *m5=0) const |
Ex | get_dummy (const list_property *, const index_map_t *m1, const index_map_t *m2=0, const index_map_t *m3=0, const index_map_t *m4=0, const index_map_t *m5=0) const |
Ex | get_dummy (const list_property *, Ex::iterator) const |
Ex | get_dummy (const list_property *, Ex::iterator, Ex::iterator) const |
bool | index_in_set (Ex, const index_map_t *) const |
void | dumpmap (std::ostream &, const index_map_t &) const |
index_map_t::iterator | find_modulo_parent_rel (Ex::iterator it, index_map_t &imap) const |
Find an index in the set, not taking into account index position. |
Private Member Functions | |
bool | is_component (iterator it) const |
bool | is_scalar_function (iterator it) const |
iterator | handle_components (iterator it) |
iterator | handle_sum (iterator it) |
iterator | handle_prod (iterator it) |
iterator | handle_derivative (iterator it) |
iterator | handle_epsilon (iterator it) |
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 indices in the order in which values should be stored in index value sets. | |
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. | |
void | merge_component_children (iterator it) |
Merge entries in a single 'components' node when they are for the same index value(s). | |
void | cleanup_components (iterator it1) |
Cleanup all components in a 'components' node; that is, call the cleanup_dispatch function on them. | |
iterator | wrap_scalar_in_components_node (iterator sib) |
Wrap a non-component scalar node in a 'components' node. | |
void | unwrap_scalar_in_components_node (iterator sib) |
Inverse of the above. | |
std::set< Ex, tree_exact_less_obj > | dependencies (iterator it) |
Determine all the Coordinate dependencies of the object at 'it'. |
Private Attributes | |
const Ex & | components |
bool | only_rhs |
bool | call_sympy |
Additional Inherited Members | |
Public Types inherited from cadabra::Algorithm | |
typedef Ex::iterator | iterator |
typedef Ex::post_order_iterator | post_order_iterator |
typedef Ex::sibling_iterator | sibling_iterator |
typedef Ex::result_t | result_t |
Public Types inherited from cadabra::IndexClassifier | |
typedef 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. | |
typedef std::map< Ex::iterator, int, Ex::iterator_base_less > | index_position_map_t |
A map from the position of each index to the sequential index. | |
Static Public Member Functions inherited from cadabra::Algorithm | |
static unsigned int | number_of_indices (const Properties &, iterator it) |
static unsigned int | number_of_direct_indices (iterator it) |
static bool | is_termlike (iterator) |
Determines whether the indicated node is 'like a term in a sum'. | |
Public Attributes inherited from cadabra::Algorithm | |
bool | interrupted |
unsigned int | number_of_calls |
unsigned int | number_of_modifications |
bool | suppress_normal_output |
bool | discard_command_node |
Stopwatch | index_sw |
Stopwatch | get_dummy_sw |
Stopwatch | report_progress_stopwatch |
Protected Attributes inherited from cadabra::Algorithm | |
bool | traverse_ldots |
Protected Attributes inherited from cadabra::IndexClassifier | |
const Kernel & | kernel |
evaluate::evaluate | ( | const Kernel & | k, |
Ex & | tr, | ||
const Ex & | component_values, | ||
bool | rhs = false, | ||
bool | simplify = true ) |
|
overridevirtual |
|
overridevirtual |
|
private |
Cleanup all components in a 'components' node; that is, call the cleanup_dispatch function on them.
|
private |
Expand a tensor factor into a components node with all components written out explicitly.
Used when there is no sparse rule matching this factor.
|
private |
Determine all the Coordinate dependencies of the object at 'it'.
For the time being this can only be a 'components' node.
|
private |
|
private |
|
private |
|
private |
Replace a single factor with a 'components' ... The full_ind_free argument can contain a list of indices in the order in which values should be stored in index value sets.
|
private |
|
private |
|
private |
|
private |
|
private |
Merge entries in a single 'components' node when they are for the same index value(s).
Merge the information in two 'components' nodes at the given iterators, moving all out of the second one into the first one.
void evaluate::simplify_components | ( | iterator | it, |
bool | run_sympy = true ) |
Simplify all components of a 'components' node by collecting terms and optionally running sympy's simplify on them.
Returns a replacement iterator to the top. Removes entries for vanishing components.
|
private |
Inverse of the above.
|
private |
Wrap a non-component scalar node in a 'components' node.
|
private |
|
private |
|
private |