Cadabra
Computer algebra system for field theory problems
Loading...
Searching...
No Matches
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
6This program is free software: you can redistribute it and/or
7modify it under the terms of the GNU General Public License as
8 published by the Free Software Foundation, either version 3 of the
9License, or (at your option) any later version.
10
11This program is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14General Public License for more details.
15
16You 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
27namespace 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:916
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:406
bool cleanup_exterior_derivative(const Kernel &k, Ex &tr, Ex::iterator &it)
Definition Cleanup.cc:864
bool cleanup_components(const Kernel &k, Ex &tr, Ex::iterator &it)
Definition Cleanup.cc:573
bool cleanup_productlike(const Kernel &k, Ex &tr, Ex::iterator &it)
Definition Cleanup.cc:242
bool cleanup_diagonal(const Kernel &k, Ex &tr, Ex::iterator &it)
Definition Cleanup.cc:807
bool cleanup_derivative(const Kernel &k, Ex &tr, Ex::iterator &it)
Definition Cleanup.cc:717
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:527
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:838
bool cleanup_partialderivative(const Kernel &, Ex &tr, Ex::iterator &it)
Definition Cleanup.cc:679
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
void set(rset_t::iterator &num, multiplier_t fac)
Definition Storage.cc:1063
bool cleanup_numericalflat(const Kernel &, Ex &tr, Ex::iterator &it)
Definition Cleanup.cc:770
bool cleanup_comma(const Kernel &k, Ex &tr, Ex::iterator &it)
Definition Cleanup.cc:879
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:893
int k
Definition passing.cc:4