Cadabra
Computer algebra system for field theory problems
Loading...
Searching...
No Matches
Hash.hh
Go to the documentation of this file.
1#pragma once
2
3#include "Storage.hh"
4
5namespace cadabra
6{
22
24 {
25 public:
27 Ex_hasher();
29
30 result_t operator () (const Ex& ex) const;
31 result_t operator () (Ex::iterator it) const;
32
37
38 private:
39 result_t hash(Ex::iterator it, bool toplevel) const;
40 bool flag_set(HashFlags flag) const;
41
43 };
44
50
51 Ex_hasher::result_t hash_ex(Ex::iterator it, HashFlags flags = HASH_DEFAULT);
52 bool hash_compare(Ex::iterator lhs, Ex::iterator rhs, HashFlags flags = HASH_DEFAULT);
53}
Definition Hash.hh:24
void remove_flags(HashFlags flags)
void add_flags(HashFlags flags)
size_t result_t
Definition Hash.hh:26
HashFlags flags
Definition Hash.hh:42
result_t hash(Ex::iterator it, bool toplevel) const
Definition Hash.cc:41
void set_flags(HashFlags flags)
Ex_hasher()
Definition Hash.cc:19
result_t operator()(const Ex &ex) const
Definition Hash.cc:31
HashFlags get_flags() const
bool flag_set(HashFlags flag) const
Definition Hash.cc:99
Basic storage class for symbolic mathemematical expressions.
Definition Storage.hh:142
Functions to handle the exchange properties of two or more symbols in a product.
Definition Adjform.cc:83
HashFlags operator~(HashFlags flags)
Definition Hash.cc:106
bool hash_compare(Ex::iterator lhs, Ex::iterator rhs, HashFlags flags)
Definition Hash.cc:137
HashFlags operator&(HashFlags lhs, HashFlags rhs)
Definition Hash.cc:116
HashFlags operator|(HashFlags lhs, HashFlags rhs)
Definition Hash.cc:111
HashFlags
Definition Hash.hh:8
@ HASH_IGNORE_CHILD_ORDER
Definition Hash.hh:20
@ HASH_IGNORE_INDICES
Definition Hash.hh:19
@ HASH_IGNORE_PARENT_REL
Definition Hash.hh:15
@ HASH_IGNORE_NAMES
Definition Hash.hh:18
@ HASH_DEFAULT
Definition Hash.hh:9
@ HASH_IGNORE_CHILDREN
Definition Hash.hh:17
@ HASH_IGNORE_BRACKET_TYPE
Definition Hash.hh:16
@ HASH_IGNORE_SUM_ORDER
Definition Hash.hh:13
@ HASH_IGNORE_TOP_MULTIPLIER
Definition Hash.hh:10
@ HASH_IGNORE_PRODUCT_ORDER
Definition Hash.hh:12
@ HASH_IGNORE_INDEX_ORDER
Definition Hash.hh:14
@ HASH_IGNORE_MULTIPLIER
Definition Hash.hh:11
HashFlags & operator|=(HashFlags &lhs, HashFlags rhs)
Definition Hash.cc:121
Ex_hasher::result_t hash_ex(Ex::iterator it, HashFlags flags)
Definition Hash.cc:131
Ex rhs(Ex_ptr ex)
Definition py_ex.cc:391
Ex lhs(Ex_ptr ex)
Definition py_ex.cc:379
void set(rset_t::iterator &num, multiplier_t fac)
Definition Storage.cc:1063
HashFlags & operator&=(HashFlags &lhs, HashFlags rhs)
Definition Hash.cc:126