57 Ex::iterator
one, Ex::iterator two,
58 int mod_prel=-2,
bool checksets=
true,
int compare_multiplier=-2,
59 bool literal_wildcards=
false);
64 const Ex&
one,
const Ex& two,
65 int mod_prel=-2,
bool checksets=
true,
int compare_multiplier=-2);
67 const Ex&
one,
const Ex& two,
68 int mod_prel=-2,
bool checksets=
true,
int compare_multiplier=-2);
70 const Ex&
one,
const Ex& two,
71 int mod_prel=-2,
bool checksets=
true,
int compare_multiplier=-2,
72 bool literal_wildcards=
false);
74 const Ex&
one,
const Ex& two,
75 int mod_prel=-2,
bool checksets=
true,
int compare_multiplier=-2,
76 bool literal_wildcards=
false);
79 Ex::iterator
one, Ex::iterator two,
80 int mod_prel=-2,
bool checksets=
true,
int compare_multiplier=-2);
82 Ex::iterator
one, Ex::iterator two,
83 int mod_prel=-2,
bool checksets=
true,
int compare_multiplier=-2);
85 Ex::iterator
one, Ex::iterator two,
86 int mod_prel=-2,
bool checksets=
true,
int compare_multiplier=-2,
87 bool literal_wildcards=
false);
89 Ex::iterator
one, Ex::iterator two,
90 int mod_prel=-2,
bool checksets=
true,
int compare_multiplier=-2,
91 bool literal_wildcards=
false);
252 Ex::sibling_iterator
lhs, Ex::sibling_iterator tofind,
253 Ex::sibling_iterator st, Ex::iterator conditions);
263 Ex::sibling_iterator
lhs, Ex::sibling_iterator tofind,
264 Ex::sibling_iterator st, Ex::iterator conditions);
317 bool ignore_implicit_indices=
false);
332 Ex::sibling_iterator two,
bool fix_one=
false) ;
342 int can_move_adjacent(Ex::iterator prod,
const std::vector<Ex::sibling_iterator>& factors, Ex::sibling_iterator to_move);
355 bool nobrackets=
false,
357 bool ignore_parent_rel=
false);
368 std::string
tab()
const;
403 bool operator<(
const cadabra::Ex::iterator&,
const cadabra::Ex::iterator&);
std::ostream & operator<<(std::ostream &, cadabra::Ex_comparator::useprops_t up)
Definition: Compare.cc:1771
bool operator<(const cadabra::Ex::iterator &, const cadabra::Ex::iterator &)
Definition: Compare.cc:1761
A generic tree comparison class which will take into account index contractions and will also keep tr...
Definition: Compare.hh:192
match_t match_subsum(const Ex &, Ex::sibling_iterator lhs, Ex::sibling_iterator tofind, Ex::sibling_iterator st, Ex::iterator conditions)
Find a sub-sum in a sum.
Definition: Compare.cc:1032
match_t report(match_t r) const
Definition: Compare.cc:450
Ex_comparator(const Properties &)
Definition: Compare.cc:432
int can_swap_components(Ex::iterator one, Ex::iterator two, match_t subtree_comparison)
Wrapper for can_swap which is meant for objects that have implicit indices.
Definition: Compare.cc:1229
std::map< nset_t::iterator, Ex::iterator, nset_it_less > subtree_replacement_map_t
Map for the replacement of entire subtrees (object patterns).
Definition: Compare.hh:279
void clear()
Reset the object for a new match.
Definition: Compare.cc:282
bool lhs_contains_dummies
Flag to indicate whether additional care must be taken to handle dummies in the lhs of the pattern.
Definition: Compare.hh:299
multiplier_t term_ratio
Definition: Compare.hh:294
int can_move_to_front(Ex &, Ex::iterator prod, Ex::sibling_iterator one)
Determine whether object 'one' can be moved to be the first factor in the given product.
Definition: Compare.cc:1219
int can_move_adjacent(Ex::iterator prod, Ex::sibling_iterator one, Ex::sibling_iterator two, bool fix_one=false)
Determine whether object 'one' and 'two' can be moved next to each other by moving either one or the ...
Definition: Compare.cc:1164
match_t match_subproduct(const Ex &, Ex::sibling_iterator lhs, Ex::sibling_iterator tofind, Ex::sibling_iterator st, Ex::iterator conditions)
Find a sub-product in a product.
Definition: Compare.cc:938
match_t equal_subtree(Ex::iterator i1, Ex::iterator i2, useprops_t use_props=useprops_t::always, bool ignore_parent_rel=false)
Match two subtrees taking into account symbol properties.
Definition: Compare.cc:305
int can_swap(Ex::iterator one, Ex::iterator two, match_t subtree_comparison, bool ignore_implicit_indices=false)
Determine whether obj and obj+1 be exchanged? If yes, return the sign, if no return zero.
Definition: Compare.cc:1495
useprops_t
Definition: Compare.hh:207
bool should_swap(Ex::iterator obj, match_t subtree_comparison)
Determine whether two objects should be swapped according to the available SortOrder properties.
Definition: Compare.cc:1306
bool can_swap_different_indexsets(Ex::iterator obj1, Ex::iterator obj2)
Definition: Compare.cc:1469
int can_swap_sum_sum(Ex::iterator sum1, Ex::iterator sum2, bool)
Definition: Compare.cc:1423
int can_swap_sum_obj(Ex::iterator sum, Ex::iterator obj, bool)
Definition: Compare.cc:1387
bool name_match_with_autodeclare(Ex::sibling_iterator one, Ex::sibling_iterator two) const
Match the name elements of a node, but take into account that one of them can be an autodeclare name ...
Definition: Compare.cc:927
replacement_map_t index_value_map
Map for matching of index names to index values.
Definition: Compare.hh:285
void set_value_matches_index(bool)
Determine whether Coordinates in the pattern (first argument to functions below) can match against In...
Definition: Compare.cc:437
static int offset
Definition: Compare.hh:375
match_t match_subtree(const Ex &, Ex::iterator i1, Ex::iterator i2, Ex::iterator conditions)
Match two subtrees, new-style equal_subtree that handles conditions; this is what substitute uses.
Definition: Compare.cc:291
int can_swap_ilist_ilist(Ex::iterator obj1, Ex::iterator obj2)
Definition: Compare.cc:1440
int can_swap_prod_prod(Ex::iterator prod1, Ex::iterator prod2, bool)
Definition: Compare.cc:1371
std::string tab() const
Definition: Compare.cc:442
const Properties & properties
Definition: Compare.hh:345
bool value_matches_index
Definition: Compare.hh:347
int can_swap_prod_sum(Ex::iterator prod, Ex::iterator sum, bool)
Definition: Compare.cc:1406
match_t compare(const Ex::iterator &, const Ex::iterator &, bool nobrackets=false, useprops_t use_props=useprops_t::always, bool ignore_parent_rel=false)
Internal entry point.
Definition: Compare.cc:491
subtree_replacement_map_t subtree_replacement_map
Definition: Compare.hh:280
std::vector< Ex::sibling_iterator > factor_locations
Information to keep track of where individual factors/terms in a sub-product/sub-sum were found,...
Definition: Compare.hh:292
std::vector< int > factor_moving_signs
Definition: Compare.hh:293
int can_swap_prod_obj(Ex::iterator prod, Ex::iterator obj, bool)
Definition: Compare.cc:1346
bool satisfies_conditions(Ex::iterator conditions, std::string &error)
Check whether the a match found by calling equal_subtree or match_subproduct satisfies the conditions...
Definition: Compare.cc:1590
match_t
Definition: Compare.hh:196
@ no_match_indexpos_greater
replacement_map_t replacement_map
Definition: Compare.hh:275
std::map< Ex, Ex, tree_exact_less_no_wildcards_obj > replacement_map_t
Map for the replacement of nodes (indices, patterns).
Definition: Compare.hh:274
Basic comparison operator for tree iterators, so we can use them as keys in maps.
Definition: Compare.hh:382
Ex_is_equivalent(const Properties &)
Definition: Compare.cc:1735
bool operator()(const Ex &, const Ex &)
Definition: Compare.cc:1740
const Properties & properties
Definition: Compare.hh:387
Definition: Compare.hh:390
Ex_is_less(const Properties &, int mod_prel)
Definition: Compare.cc:1747
const Properties & properties
Definition: Compare.hh:395
int mod_prel
Definition: Compare.hh:396
bool operator()(const Ex &, const Ex &)
Definition: Compare.cc:1752
Basic storage class for symbolic mathemematical expressions.
Definition: Storage.hh:142
Class holding a collection of properties attached to expressions.
Definition: Props.hh:237
Definition: Compare.hh:111
tree_equal_obj(const Properties *)
Definition: Compare.cc:216
const Properties * properties
Definition: Compare.hh:116
bool operator()(const Ex &first, const Ex &second) const
Definition: Compare.cc:221
Definition: Compare.hh:145
const Properties * properties
Definition: Compare.hh:150
bool operator()(const Ex &first, const Ex &second) const
Definition: Compare.cc:266
tree_exact_equal_mod_prel_obj(const Properties *)
Definition: Compare.hh:137
const Properties * properties
Definition: Compare.hh:142
bool operator()(const Ex &first, const Ex &second) const
Definition: Compare.cc:251
tree_exact_equal_obj(const Properties *)
Compare for indexmap_t.
Definition: Compare.hh:160
bool operator()(const Ex &first, const Ex &second) const
Definition: Compare.cc:271
Definition: Compare.hh:129
bool operator()(const Ex &first, const Ex &second) const
Definition: Compare.cc:261
const Properties * properties
Definition: Compare.hh:134
tree_exact_less_mod_prel_obj(const Properties *)
Definition: Compare.cc:256
Definition: Compare.hh:176
tree_exact_less_no_wildcards_mod_prel_obj(const Properties *)
bool operator()(const Ex &first, const Ex &second) const
Definition: Compare.cc:246
const Properties * properties
Definition: Compare.hh:181
Compare two trees exactly, treat wildcard names as ordinary names.
Definition: Compare.hh:167
tree_exact_less_no_wildcards_obj()
Definition: Compare.cc:236
bool operator()(const Ex &first, const Ex &second) const
Definition: Compare.cc:241
const Properties * properties
Definition: Compare.hh:173
tree_exact_less_no_wildcards_obj(const Properties *)
Compare two trees exactly, i.e. including exact index names.
Definition: Compare.hh:121
tree_exact_less_obj(const Properties *)
Definition: Compare.cc:226
bool operator()(const Ex &first, const Ex &second) const
Definition: Compare.cc:231
const Properties * properties
Definition: Compare.hh:126
Definition: Compare.hh:103
const Properties * properties
Definition: Compare.hh:108
bool operator()(const Ex &first, const Ex &second) const
Definition: Compare.cc:211
tree_less_modprel_obj(const Properties *)
Definition: Compare.cc:206
Compare two trees by pattern logic, i.e. modulo index names.
Definition: Compare.hh:95
bool operator()(const Ex &first, const Ex &second) const
Definition: Compare.cc:201
const Properties * properties
Definition: Compare.hh:100
tree_less_obj(const Properties *)
Definition: Compare.cc:196
int subtree_compare(const Properties *properties, Ex::iterator one, Ex::iterator two, int mod_prel, bool, int compare_multiplier, bool literal_wildcards)
Basic building block subtree comparison function for tensors without dummy indices,...
Definition: Compare.cc:34
Functions to handle the exchange properties of two or more symbols in a product.
Definition: Adjform.cc:83
bool subtree_exact_equal(const Properties *properties, Ex::iterator one, Ex::iterator two, int mod_prel, bool checksets, int compare_multiplier, bool literal_wildcards)
Definition: Compare.cc:188
bool tree_exact_equal(const Properties *properties, const Ex &one, const Ex &two, int mod_prel, bool checksets, int compare_multiplier, bool literal_wildcards)
Definition: Compare.cc:161
bool tree_equal(const Properties *properties, const Ex &one, const Ex &two, int mod_prel, bool checksets, int compare_multiplier)
Definition: Compare.cc:151
void one(rset_t::iterator &num)
Definition: Storage.cc:1054
bool tree_less(const Properties *properties, const Ex &one, const Ex &two, int mod_prel, bool checksets, int compare_multiplier)
Various comparison functions, some exact, some with pattern logic.
Definition: Compare.cc:146
Ex lhs(Ex_ptr ex)
Definition: py_ex.cc:379
bool subtree_equal(const Properties *properties, Ex::iterator one, Ex::iterator two, int mod_prel, bool checksets, int compare_multiplier)
Definition: Compare.cc:173
bool subtree_less(const Properties *properties, Ex::iterator one, Ex::iterator two, int mod_prel, bool checksets, int compare_multiplier)
Definition: Compare.cc:166
mpq_class multiplier_t
Definition: Storage.hh:38
bool subtree_exact_less(const Properties *properties, Ex::iterator one, Ex::iterator two, int mod_prel, bool checksets, int compare_multiplier, bool literal_wildcards)
Definition: Compare.cc:180
bool tree_exact_less(const Properties *properties, const Ex &one, const Ex &two, int mod_prel, bool checksets, int compare_multiplier, bool literal_wildcards)
Definition: Compare.cc:156
const char error[]
Definition: Snoop.hh:338