Cadabra
Computer algebra system for field theory problems
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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_productlike(const Kernel& k, Ex&, Ex::iterator& it);
69 bool cleanup_sumlike(const Kernel& k, Ex&, Ex::iterator& it);
70 bool cleanup_derivative(const Kernel& k, Ex&, Ex::iterator& it);
71 bool cleanup_partialderivative(const Kernel& k, Ex&, Ex::iterator& it);
72 bool cleanup_components(const Kernel& k, Ex&, Ex::iterator& it);
73 bool cleanup_numericalflat(const Kernel& k, Ex&, Ex::iterator& it);
74 bool cleanup_diagonal(const Kernel& k, Ex&, Ex::iterator& it);
75 bool cleanup_kronecker(const Kernel& k, Ex&, Ex::iterator& it);
76 bool cleanup_exterior_derivative(const Kernel& k, Ex&, Ex::iterator& it);
77 
86 
87 bool push_down_multiplier(const Kernel& k, Ex& tr, Ex::iterator it);
88 
91 
92 void check_index_consistency(const Kernel& k, Ex& tr, Ex::iterator it);
93 
94 }
bool cleanup_sumlike(const Kernel &k, Ex &tr, Ex::iterator &it)
Definition: Cleanup.cc:213
Basic storage class for symbolic mathemematical expressions.
Definition: Storage.hh:130
bool cleanup_exterior_derivative(const Kernel &k, Ex &tr, Ex::iterator &it)
Definition: Cleanup.cc:547
bool cleanup_kronecker(const Kernel &k, Ex &tr, Ex::iterator &it)
Definition: Cleanup.cc:521
void(* dispatcher_t)(const Kernel &k, Ex &, Ex::iterator &it)
Definition: Cleanup.hh:29
bool cleanup_components(const Kernel &k, Ex &tr, Ex::iterator &it)
Definition: Cleanup.cc:326
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:17
bool cleanup_numericalflat(const Kernel &k, Ex &tr, Ex::iterator &it)
Definition: Cleanup.cc:467
bool cleanup_productlike(const Kernel &k, Ex &tr, Ex::iterator &it)
Individual node cleanup routines.
Definition: Cleanup.cc:99
int k
Definition: passing.cc:4
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:280
bool cleanup_diagonal(const Kernel &k, Ex &tr, Ex::iterator &it)
Definition: Cleanup.cc:502
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:91
bool cleanup_partialderivative(const Kernel &k, Ex &tr, Ex::iterator &it)
Definition: Cleanup.cc:376
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:563
bool cleanup_derivative(const Kernel &k, Ex &tr, Ex::iterator &it)
Definition: Cleanup.cc:414