54 Ex::iterator
one, Ex::iterator two,
55 int mod_prel=-2,
bool checksets=
true,
int compare_multiplier=-2,
56 bool literal_wildcards=
false);
61 const Ex&
one,
const Ex& two,
62 int mod_prel=-2,
bool checksets=
true,
int compare_multiplier=-2);
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,
69 bool literal_wildcards=
false);
71 const Ex&
one,
const Ex& two,
72 int mod_prel=-2,
bool checksets=
true,
int compare_multiplier=-2,
73 bool literal_wildcards=
false);
76 Ex::iterator
one, Ex::iterator two,
77 int mod_prel=-2,
bool checksets=
true,
int compare_multiplier=-2);
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,
84 bool literal_wildcards=
false);
86 Ex::iterator
one, Ex::iterator two,
87 int mod_prel=-2,
bool checksets=
true,
int compare_multiplier=-2,
88 bool literal_wildcards=
false);
234 Ex::sibling_iterator
lhs, Ex::sibling_iterator tofind,
235 Ex::sibling_iterator st, Ex::iterator conditions);
245 Ex::sibling_iterator
lhs, Ex::sibling_iterator tofind,
246 Ex::sibling_iterator st, Ex::iterator conditions);
299 bool ignore_implicit_indices=
false);
306 Ex::sibling_iterator two,
bool fix_one=
false) ;
317 bool nobrackets=
false,
319 bool ignore_parent_rel=
false);
329 std::string
tab()
const;
360 bool operator<(
const cadabra::Ex::iterator&,
const cadabra::Ex::iterator&);
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:1078
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:281
int can_swap_ilist_ilist(Ex::iterator obj1, Ex::iterator obj2)
Definition: Compare.cc:1204
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:152
bool operator()(const Ex &, const Ex &)
Definition: Compare.cc:1491
static int offset
Definition: Compare.hh:332
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:1018
Ex lhs(const Ex &ex)
Definition: PythonCdb.cc:207
Compare for indexmap_t.
Definition: Compare.hh:157
bool subtree_less(const Properties *properties, Ex::iterator one, Ex::iterator two, int mod_prel, bool checksets, int compare_multiplier)
Definition: Compare.cc:157
int subtree_compare(const Properties *properties, Ex::iterator one, Ex::iterator two, int mod_prel, bool checksets, int compare_multiplier, bool literal_wildcards)
Basic building block subtree comparison function for tensors without dummy indices, which determines whether two tensor subtrees are equal up to the names of indices.
Definition: Compare.cc:28
tree_exact_less_no_wildcards_obj()
Definition: Compare.cc:227
Compare two trees exactly, i.e. including exact index names.
Definition: Compare.hh:118
Basic storage class for symbolic mathemematical expressions.
Definition: Storage.hh:130
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:261
std::ostream & operator<<(std::ostream &, cadabra::Ex_comparator::useprops_t up)
Definition: Compare.cc:1510
Basic comparison operator for tree iterators, so we can use them as keys in maps. ...
Definition: Compare.hh:339
const Properties & properties
Definition: Compare.hh:309
bool operator()(const Ex &first, const Ex &second) const
Definition: Compare.cc:212
replacement_map_t index_value_map
Map for matching of index names to index values.
Definition: Compare.hh:267
bool subtree_equal(const Properties *properties, Ex::iterator one, Ex::iterator two, int mod_prel, bool checksets, int compare_multiplier)
Definition: Compare.cc:164
tree_exact_less_mod_prel_obj(const Properties *)
Definition: Compare.cc:247
A generic tree comparison class which will take into account index contractions and will also keep tr...
Definition: Compare.hh:189
void clear()
Reset the object for a new match.
Definition: Compare.cc:273
replacement_map_t replacement_map
Definition: Compare.hh:257
tree_less_modprel_obj(const Properties *)
Definition: Compare.cc:197
int mod_prel
Definition: Compare.hh:353
Definition: Compare.hh:126
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:179
std::map< Ex, Ex, tree_exact_less_no_wildcards_obj > replacement_map_t
Map for the replacement of nodes (indices, patterns).
Definition: Compare.hh:256
const Properties * properties
Definition: Compare.hh:178
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:1333
bool operator()(const Ex &first, const Ex &second) const
Definition: Compare.cc:242
int can_swap_prod_obj(Ex::iterator prod, Ex::iterator obj, bool)
Definition: Compare.cc:1110
int can_swap_prod_sum(Ex::iterator prod, Ex::iterator sum, bool)
Definition: Compare.cc:1170
Definition: Compare.hh:173
const Properties * properties
Definition: Compare.hh:170
int can_swap_sum_obj(Ex::iterator sum, Ex::iterator obj, bool)
Definition: Compare.cc:1151
bool operator<(const cadabra::Ex::iterator &, const cadabra::Ex::iterator &)
Definition: Compare.cc:1500
Ex_is_equivalent(const Properties &)
Definition: Compare.cc:1474
std::string tab() const
Definition: Compare.cc:389
tree_equal_obj(const Properties *)
Definition: Compare.cc:207
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:886
multiplier_t term_ratio
Definition: Compare.hh:276
const Properties * properties
Definition: Compare.hh:139
Compare two trees exactly, treat wildcard names as ordinary names.
Definition: Compare.hh:164
int can_swap_prod_prod(Ex::iterator prod1, Ex::iterator prod2, bool)
Definition: Compare.cc:1135
Definition: Compare.hh:142
Compare two trees by pattern logic, i.e. modulo index names.
Definition: Compare.hh:92
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:803
useprops_t
Definition: Compare.hh:204
match_t
Definition: Compare.hh:193
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:433
tree_exact_equal_mod_prel_obj(const Properties *)
const Properties * properties
Definition: Compare.hh:147
void one(rset_t::iterator &num)
Definition: Storage.cc:912
bool tree_equal(const Properties *properties, const Ex &one, const Ex &two, int mod_prel, bool checksets, int compare_multiplier)
Definition: Compare.cc:142
bool operator()(const Ex &first, const Ex &second) const
Definition: Compare.cc:257
const char error[]
Definition: Snoop.hh:156
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:282
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:137
Definition: Compare.hh:134
bool operator()(const Ex &first, const Ex &second) const
Definition: Compare.cc:237
tree_less_obj(const Properties *)
Definition: Compare.cc:187
bool operator()(const Ex &first, const Ex &second) const
Definition: Compare.cc:262
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:274
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:171
const Properties * properties
Definition: Compare.hh:105
Ex_is_less(const Properties &, int mod_prel)
Definition: Compare.cc:1486
const Properties & properties
Definition: Compare.hh:344
mpq_class multiplier_t
Definition: Storage.hh:38
tree_exact_less_no_wildcards_mod_prel_obj(const Properties *)
bool operator()(const Ex &first, const Ex &second) const
Definition: Compare.cc:192
const Properties * properties
Definition: Compare.hh:97
const Properties & properties
Definition: Compare.hh:352
const Properties * properties
Definition: Compare.hh:113
bool operator()(const Ex &first, const Ex &second) const
Definition: Compare.cc:252
bool operator()(const Ex &first, const Ex &second) const
Definition: Compare.cc:202
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:1233
Definition: Compare.hh:108
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:147
bool operator()(const Ex &first, const Ex &second) const
Definition: Compare.cc:222
subtree_replacement_map_t subtree_replacement_map
Definition: Compare.hh:262
tree_exact_equal_obj(const Properties *)
bool operator()(const Ex &, const Ex &)
Definition: Compare.cc:1479
const Properties * properties
Definition: Compare.hh:131
Definition: Compare.hh:347
const Properties * properties
Definition: Compare.hh:123
Ex_comparator(const Properties &)
Definition: Compare.cc:384
Class holding a collection of properties attached to expressions.
Definition: Props.hh:203
Definition: Compare.hh:100
bool operator()(const Ex &first, const Ex &second) const
Definition: Compare.cc:232
match_t report(match_t r) const
Definition: Compare.cc:397
int can_swap_sum_sum(Ex::iterator sum1, Ex::iterator sum2, bool)
Definition: Compare.cc:1187
tree_exact_less_obj(const Properties *)
Definition: Compare.cc:217
std::vector< int > factor_moving_signs
Definition: Compare.hh:275