Cadabra
Computer algebra system for field theory problems
Cleanup.hh
Go to the documentation of this file.
1 /*
2 
3  Cadabra: a field-theory motivated computer algebra system.
4  Copyright (C) 2001-2014 Kasper Peeters <kasper.peeters@phi-sci.com>
5 
6 This program is free software: you can redistribute it and/or
7 modify it under the terms of the GNU General Public License as
8  published by the Free Software Foundation, either version 3 of the
9 License, or (at your option) any later version.
10 
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
15 
16 You should have received a copy of the GNU General Public License
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
18 
19 */
20 
21 
22 #pragma once
23 
24 #include "Storage.hh"
25 #include "Kernel.hh"
26 
27 namespace cadabra {
28 
29  typedef void (*dispatcher_t)(const Kernel& k, Ex&, Ex::iterator& it);
30 
47 
48  void cleanup_dispatch(const Kernel& k, Ex&, Ex::iterator& it);
49 
54 
56  void cleanup_dispatch_deep(const Kernel& k, Ex&, Ex::iterator& it, dispatcher_t disp=&cleanup_dispatch);
57 
67 
68  bool cleanup_fraclike(const Kernel& k, Ex&, Ex::iterator& it);
69  bool cleanup_powlike(const Kernel& k, Ex&, Ex::iterator& it);
70  bool cleanup_productlike(const Kernel& k, Ex&, Ex::iterator& it);
71  bool cleanup_sumlike(const Kernel& k, Ex&, Ex::iterator& it);
72  bool cleanup_derivative(const Kernel& k, Ex&, Ex::iterator& it);
73  bool cleanup_partialderivative(const Kernel& k, Ex&, Ex::iterator& it);
74  bool cleanup_components(const Kernel& k, Ex&, Ex::iterator& it);
75  bool cleanup_numericalflat(const Kernel& k, Ex&, Ex::iterator& it);
76  bool cleanup_diagonal(const Kernel& k, Ex&, Ex::iterator& it);
77  bool cleanup_kronecker(const Kernel& k, Ex&, Ex::iterator& it);
78  bool cleanup_exterior_derivative(const Kernel& k, Ex&, Ex::iterator& it);
79  bool cleanup_comma(const Kernel&k, Ex&, Ex::iterator& it);
80  bool cleanup_tie(const Kernel&k, Ex&, Ex::iterator& it);
81 
90 
91  bool push_down_multiplier(const Kernel& k, Ex& tr, Ex::iterator it);
92 
95 
96  void check_index_consistency(const Kernel& k, Ex& tr, Ex::iterator it);
97 
98  }
Basic storage class for symbolic mathemematical expressions.
Definition: Storage.hh:142
Definition: Kernel.hh:15
void cleanup_dispatch_deep(const Kernel &k, Ex &tr, dispatcher_t dispatch)
More general cleanup of an entire tree.
Definition: Cleanup.cc:917
void cleanup_dispatch(const Kernel &kernel, Ex &tr, Ex::iterator &it)
Central cleanup dispatch routine, which calls the other cleanup functions defined later.
Definition: Cleanup.cc:22
Functions to handle the exchange properties of two or more symbols in a product.
Definition: Adjform.cc:83
bool cleanup_sumlike(const Kernel &k, Ex &tr, Ex::iterator &it)
Definition: Cleanup.cc:407
bool cleanup_exterior_derivative(const Kernel &k, Ex &tr, Ex::iterator &it)
Definition: Cleanup.cc:865
bool cleanup_components(const Kernel &k, Ex &tr, Ex::iterator &it)
Definition: Cleanup.cc:574
bool cleanup_productlike(const Kernel &k, Ex &tr, Ex::iterator &it)
Definition: Cleanup.cc:243
bool cleanup_diagonal(const Kernel &k, Ex &tr, Ex::iterator &it)
Definition: Cleanup.cc:808
bool cleanup_derivative(const Kernel &k, Ex &tr, Ex::iterator &it)
Definition: Cleanup.cc:718
bool push_down_multiplier(const Kernel &k, Ex &tr, Ex::iterator it)
Given a node with a non-unit multiplier, push this multiplier down the tree if the node is not allowe...
Definition: Cleanup.cc:528
bool cleanup_powlike(const Kernel &k, Ex &tr, Ex::iterator &it)
Definition: Cleanup.cc:138
void(* dispatcher_t)(const Kernel &k, Ex &, Ex::iterator &it)
Definition: Cleanup.hh:29
bool cleanup_kronecker(const Kernel &, Ex &tr, Ex::iterator &it)
Definition: Cleanup.cc:839
bool cleanup_partialderivative(const Kernel &, Ex &tr, Ex::iterator &it)
Definition: Cleanup.cc:680
void check_index_consistency(const Kernel &k, Ex &tr, Ex::iterator it)
Generic tool to check for index inconsistencies independent of running any algorithm.
Definition: Cleanup.cc:103
bool cleanup_numericalflat(const Kernel &, Ex &tr, Ex::iterator &it)
Definition: Cleanup.cc:771
bool cleanup_comma(const Kernel &k, Ex &tr, Ex::iterator &it)
Definition: Cleanup.cc:880
bool cleanup_fraclike(const Kernel &k, Ex &tr, Ex::iterator &it)
Individual node cleanup routines.
Definition: Cleanup.cc:111
bool cleanup_tie(const Kernel &k, Ex &tr, Ex::iterator &it)
Definition: Cleanup.cc:894
int k
Definition: passing.cc:4