Documentation of CSL
utils.h
Go to the documentation of this file.
1 // This file is part of MARTY.
2 //
3 // MARTY is free software: you can redistribute it and/or modify
4 // it under the terms of the GNU General Public License as published by
5 // the Free Software Foundation, either version 3 of the License, or
6 // (at your option) any later version.
7 //
8 // MARTY is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 // GNU General Public License for more details.
12 //
13 // You should have received a copy of the GNU General Public License
14 // along with MARTY. If not, see <https://www.gnu.org/licenses/>.
15 
23 #ifndef UTILS_H_INCLUDED
24 #define UTILS_H_INCLUDED
25 
26 #include <functional>
27 #include "abstract.h"
28 
29 namespace csl {
30 
31 std::vector<Expr> InverseTaylorExpand(
32  Expr const& init,
33  Expr const& big,
34  size_t order);
35 
36 std::vector<Expr> TaylorExpand(
37  Expr const& init,
38  Expr const& eps,
39  size_t order);
40 
41 std::vector<Expr> internal_TaylorExpand(
42  Expr const& init,
43  Expr const& eps,
44  size_t order);
45 
51 [[nodiscard]]
52 Expr Copy(const Abstract* expr);
53 
54 [[nodiscard]]
55 Expr CopySelf(Abstract* expr);
56 
66 [[nodiscard]]
67 Expr Copy(const Expr& expr);
68 
74 [[nodiscard]]
75 Expr DeepCopy(const Abstract* expr);
76 
83 [[nodiscard]]
84 Expr DeepCopy(const Expr& expr);
85 
86 void WeakDeepCopy(Expr& expr);
87 
93 [[nodiscard]]
94 Expr Refreshed(const Abstract* expr);
95 
104 [[nodiscard]]
105 Expr Refreshed(const Expr& expr);
106 
115 [[nodiscard]]
116 Expr DeepRefreshed(const Expr& expr);
117 
118 inline void Refresh(Expr& expr)
119 {
120  expr = Refreshed(expr);
121 }
122 
123 inline void DeepRefresh(Expr& expr)
124 {
125  expr = DeepRefreshed(expr);
126 }
127 
128 
129 } // End of namespace csl
130 
131 #endif
Namespace for csl library.
Definition: abreviation.h:34
Expr DeepCopy(const Abstract *expr)
See DeepCopy(const Expr& expr).
Definition: utils.cpp:113
Expr DeepRefreshed(const Expr &expr)
Refreshed recursively an Abstract and apply basic simplifications.
Definition: utils.cpp:139
Expr Copy(const Abstract *expr)
See Copy(const Expr& expr).
Definition: utils.cpp:98
Expr Refreshed(const Abstract *expr)
See Refreshed(const Expr& expr).
Definition: utils.cpp:129
Base classes for all exprs in the program.