Cadabra
Computer algebra system for field theory problems
eliminate_metric.hh
Go to the documentation of this file.
1 
2 #pragma once
3 
4 #include "Algorithm.hh"
5 #include "IndexIterator.hh"
6 
7 namespace cadabra {
8 
9  class eliminate_converter : public Algorithm {
10  public:
11  eliminate_converter(const Kernel&, Ex&, Ex&, bool);
12 
13  virtual bool can_apply(iterator) override;
14  virtual result_t apply(iterator&) override;
15 
16  protected:
17  virtual bool is_conversion_object(iterator) const=0;
18 
19  private:
22  bool redundant;
23 
32  };
33 
34 
36  public:
37  eliminate_metric(const Kernel&, Ex&, Ex&, bool);
38 
39  protected:
40  virtual bool is_conversion_object(iterator) const override;
41  };
42 
43  }
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::sibling_iterator sibling_iterator
Definition: Algorithm.hh:72
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
std::multimap< Ex, Ex::iterator, tree_exact_less_for_indexmap_obj > index_map_t
A map from a pattern to the position where it occurs in the tree.
Definition: IndexClassifier.hh:23
Definition: Kernel.hh:15
Definition: eliminate_metric.hh:9
Ex preferred
Definition: eliminate_metric.hh:20
bool handle_one_index(index_iterator i1, index_iterator i2, iterator fit, sibling_iterator objs)
See if the conversion which turns index 'i1' into index 'i2' can be applied on the expression,...
Definition: eliminate_metric.cc:36
virtual bool is_conversion_object(iterator) const =0
eliminate_converter(const Kernel &, Ex &, Ex &, bool)
Definition: eliminate_metric.cc:25
bool redundant
Definition: eliminate_metric.hh:22
index_map_t ind_dummy
Definition: eliminate_metric.hh:21
virtual bool can_apply(iterator) override
Definition: eliminate_metric.cc:30
index_map_t ind_free
Definition: eliminate_metric.hh:21
virtual result_t apply(iterator &) override
Definition: eliminate_metric.cc:105
Definition: eliminate_metric.hh:35
eliminate_metric(const Kernel &, Ex &, Ex &, bool)
Definition: eliminate_metric.cc:11
virtual bool is_conversion_object(iterator) const override
Definition: eliminate_metric.cc:16
An iterator which iterates over indices even if they are at lower levels, i.e.
Definition: IndexIterator.hh:16
Functions to handle the exchange properties of two or more symbols in a product.
Definition: Adjform.cc:83