Cadabra
Computer algebra system for field theory problems
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  }
Base class for all algorithms, containing generic routines and in particular the logic for index clas...
Definition: Algorithm.hh:59
Ex::iterator iterator
Definition: Algorithm.hh:70
Basic storage class for symbolic mathemematical expressions.
Definition: Storage.hh:142
result_t
Keeping track of what algorithms have done to this expression.
Definition: Storage.hh:164
Definition: Kernel.hh:15
Definition: factor_in.hh:10
std::multimap< hashval_t, Ex::sibling_iterator > term_hash_t
Definition: factor_in.hh:28
term_hash_t::iterator term_hash_iterator_t
Definition: factor_in.hh:29
factor_in(const Kernel &, Ex &, Ex &)
Definition: factor_in.cc:12
virtual bool can_apply(iterator) override
Definition: factor_in.cc:17
std::set< Ex, tree_exact_less_for_indexmap_obj > factnodes
Definition: factor_in.hh:19
term_hash_t term_hash
Definition: factor_in.hh:31
bool compare_prod_nonprod(iterator prod, iterator nonprod) const
Definition: factor_in.cc:70
virtual result_t apply(iterator &) override
Definition: factor_in.cc:123
void fill_hash_map(iterator)
Definition: factor_in.cc:56
bool compare_restricted(iterator one, iterator two) const
Definition: factor_in.cc:90
hashval_t calc_restricted_hash(iterator it) const
Definition: factor_in.cc:31
Ex & factors
Definition: factor_in.hh:18
Functions to handle the exchange properties of two or more symbols in a product.
Definition: Adjform.cc:83
uintptr_t hashval_t
Definition: Storage.hh:41
void one(rset_t::iterator &num)
Definition: Storage.cc:1062