Cadabra
Computer algebra system for field theory problems
substitute.hh
Go to the documentation of this file.
1 
2 #pragma once
3 
4 #include "Algorithm.hh"
6 
7 namespace cadabra {
8 
12 
13  class substitute : public Algorithm {
14  public:
15  substitute(const Kernel&, Ex& tr, Ex& args, bool partial=true);
16 
32 
33  virtual bool can_apply(iterator st);
34 
35  virtual result_t apply(iterator&);
36 
38  private:
39  Ex& args;
40 
43 
44  std::map<iterator, bool> lhs_contains_dummies, rhs_contains_dummies;
45 
46  // For object swap testing routines:
48  bool partial;
49  };
50 
51  }
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
Ex & tr
Definition: Algorithm.hh:151
A generic tree comparison class which will take into account index contractions and will also keep tr...
Definition: Compare.hh:192
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: sort_product.hh:8
Generic substitution algorithm.
Definition: substitute.hh:13
sort_product sort_product_
Definition: substitute.hh:47
iterator conditions
Definition: substitute.hh:42
iterator use_rule
Definition: substitute.hh:41
bool partial
Definition: substitute.hh:48
Ex & args
Definition: substitute.hh:39
std::map< iterator, bool > lhs_contains_dummies
Definition: substitute.hh:44
std::map< iterator, bool > rhs_contains_dummies
Definition: substitute.hh:44
virtual result_t apply(iterator &)
Definition: substitute.cc:175
virtual bool can_apply(iterator st)
Match the lhs of the replacement rule to the subtree 'st' under consideration.
Definition: substitute.cc:90
substitute(const Kernel &, Ex &tr, Ex &args, bool partial=true)
Definition: substitute.cc:16
Ex_comparator comparator
Definition: substitute.hh:37
Functions to handle the exchange properties of two or more symbols in a product.
Definition: Adjform.cc:83