Cadabra
Computer algebra system for field theory problems
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
factor_in.hh
Go to the documentation of this file.
1 
2 #pragma once
3 
4 #include "Algorithm.hh"
5 
6 namespace cadabra {
7 
9 
10 class factor_in : public Algorithm {
11  public:
12  factor_in(const Kernel&, Ex&, Ex&);
13 
14  virtual bool can_apply(iterator) override;
15  virtual result_t apply(iterator&) override;
16 
17  protected:
19  std::set<Ex, tree_exact_less_for_indexmap_obj> factnodes; // objects to be taken in brackets;
20  // FIXME: use patterns
21  bool compare_restricted(iterator one, iterator two) const;
22  bool compare_prod_nonprod(iterator prod, iterator nonprod) const;
23 
24  // Calculate the hash value excluding factors given in the argument list
26  void fill_hash_map(iterator);
27 
28  typedef std::multimap<hashval_t, Ex::sibling_iterator> term_hash_t;
29  typedef term_hash_t::iterator term_hash_iterator_t;
30 
32 };
33 
34 }
factor_in(const Kernel &, Ex &, Ex &)
Definition: factor_in.cc:7
Base class for all algorithms, containing generic routines and in particular the logic for index clas...
Definition: Algorithm.hh:58
bool compare_prod_nonprod(iterator prod, iterator nonprod) const
Definition: factor_in.cc:61
void fill_hash_map(iterator)
Definition: factor_in.cc:49
term_hash_t::iterator term_hash_iterator_t
Definition: factor_in.hh:29
Basic storage class for symbolic mathemematical expressions.
Definition: Storage.hh:130
bool compare_restricted(iterator one, iterator two) const
Definition: factor_in.cc:81
virtual result_t apply(iterator &) override
Definition: factor_in.cc:111
std::multimap< hashval_t, Ex::sibling_iterator > term_hash_t
Definition: factor_in.hh:28
term_hash_t term_hash
Definition: factor_in.hh:31
void one(rset_t::iterator &num)
Definition: Storage.cc:912
virtual bool can_apply(iterator) override
Definition: factor_in.cc:12
Ex & factors
Definition: factor_in.hh:18
Ex::iterator iterator
Definition: Algorithm.hh:69
std::set< Ex, tree_exact_less_for_indexmap_obj > factnodes
Definition: factor_in.hh:19
Definition: Kernel.hh:15
result_t
Keeping track of what algorithms have done to this expression.
Definition: Storage.hh:149
hashval_t calc_restricted_hash(iterator it) const
Definition: factor_in.cc:26
Definition: factor_in.hh:10
uintptr_t hashval_t
Definition: Storage.hh:41