OPAL (Object Oriented Parallel Accelerator Library) 2022.1
OPAL
TransportMap.h
Go to the documentation of this file.
1#ifndef CLASSIC_TransportMap_HH
2#define CLASSIC_TransportMap_HH
3
4// ------------------------------------------------------------------------
5// $RCSfile: TransportMap.h,v $
6// ------------------------------------------------------------------------
7// $Revision: 1.1.1.1 $
8// ------------------------------------------------------------------------
9// Copyright: see Copyright.readme
10// ------------------------------------------------------------------------
11//
12// Template Class: TransportMap<T,N>
13//
14// ------------------------------------------------------------------------
15// Class category: FixedAlgebra
16// ------------------------------------------------------------------------
17//
18// $Date: 2000/03/27 09:32:37 $
19// $Author: fci $
20//
21// ------------------------------------------------------------------------
22
23#include <iosfwd>
24
25template <class T, int M, int N> class FMatrix;
26template <class T, int N> class FVector;
27template <class T, int N> class FVps;
28template <class T, int N> class TransportFun;
29
30
31// Template class TransportMap<T,N>
32// ------------------------------------------------------------------------
34// The copy constructor, destructor, and assignment operator generated
35// by the compiler perform the correct operation. For speed reasons
36// they are not implemented.
37
38template <class T, int N>
40
41public:
42
44 // Construct identity map.
46
48 explicit TransportMap(const FVps<T, N> &rhs);
49
51 // The constant part is set to zero.
52 // The Transport part is filled from [b]M[/b].
53 explicit TransportMap(const FMatrix<T, N, N> &M);
54
56 // The constant part is filled from [b]V[/b].
57 // The Transport part is set to the identity.
58 explicit TransportMap(const FVector<T, N> &V);
59
61 // Return value of component [b]n[/b].
62 // Throw RangeError, if [b]n[/b] is out of range.
63 const TransportFun<T, N> &getComponent(int n) const;
64
66 // Assign value of component [b]n[/b].
67 // Throw RangeError, if [b]n[/b] is out of range.
68 void setComponent(int, const TransportFun<T, N> &);
69
71 // Return reference to component [b]n[/b].
72 // Result is undefined, if index is out of range.
74
76 // Return constant reference to component [b]n[/b].
77 // Result is undefined, if index is out of range.
78 const TransportFun<T, N> &operator[](int) const;
79
81 TransportMap operator+() const;
82
84 TransportMap operator-() const;
85
88
90 // Throw DivideError if constant part of [b]rhs[/b] is zero.
92
94 TransportMap &operator*=(const T &rhs);
95
97 // Throw DivideError if [b]rhs[/b] is zero.
98 TransportMap &operator/=(const T &rhs);
99
102
105
108
111
113 TransportMap inverse() const;
114
116 void identity();
117
120
124
126 // This is equivalent to extracting Transport part.
128
130 TransportMap substitute(const FMatrix<T, N, N> &rhs) const;
131
133 TransportMap substitute(const TransportMap &rhs) const;
134
137
138protected:
139
141 static const int SIZE = (N + 1) *(N + 2) / 2;
142
143 // Representation of the TransportMap.
145};
146
147
148// Global functions.
149// ------------------------------------------------------------------------
150
152template <class T, int N>
154operator*(const TransportMap<T, N> &lhs, const TransportFun<T, N> &rhs);
155
157template <class T, int N>
159operator*(const TransportFun<T, N> &lhs, const TransportMap<T, N> &rhs);
160
162template <class T, int N>
164operator*(const TransportMap<T, N> &lhs, const T &rhs);
165
167template <class T, int N>
169operator*(const T &lhs, const TransportMap<T, N> &rhs);
170
172template <class T, int N>
174operator*(const FMatrix<T, N, N> &lhs, const TransportMap<T, N> &rhs);
175
177// Throw DivideError, if constant part of [b]rhs[/b] is zero.
178template <class T, int N>
180operator/(const TransportMap<T, N> &lhs, const TransportFun<T, N> &rhs);
181
183// Throw DivideError, if [b]rhs[/b] is zero.
184template <class T, int N>
186operator/(const TransportMap<T, N> &lhs, const T &rhs);
187
189template <class T, int N>
191operator+(const TransportMap<T, N> &lhs, const TransportMap<T, N> &rhs);
192
194template <class T, int N>
196operator-(const TransportMap<T, N> &lhs, const TransportMap<T, N> &rhs);
197
199template <class T, int N>
201operator+(const TransportMap<T, N> &lhs, const FVector<T, N> &rhs);
202
204template <class T, int N>
206operator-(const TransportMap<T, N> &lhs, const FVector<T, N> &rhs);
207
209template <class T, int N>
211operator+(const FVector<T, N> &lhs, const TransportMap<T, N> &rhs);
212
214template <class T, int N>
216operator-(const FVector<T, N> &lhs, const TransportMap<T, N> &rhs);
217
218
219// Implementation.
221
222#endif // CLASSIC_TransportMap_HH
TransportMap< T, N > operator-(const TransportMap< T, N > &lhs, const TransportMap< T, N > &rhs)
Subtract.
TransportMap< T, N > operator*(const TransportMap< T, N > &lhs, const TransportFun< T, N > &rhs)
Multiply.
TransportMap< T, N > operator/(const TransportMap< T, N > &lhs, const TransportFun< T, N > &rhs)
Divide.
TransportMap< T, N > operator+(const TransportMap< T, N > &lhs, const TransportMap< T, N > &rhs)
Add.
Vector truncated power series in n variables.
Definition: FVps.h:39
A templated representation for matrices.
Definition: FMatrix.h:39
A templated representation for vectors.
Definition: FVector.h:38
Transport map with values of type [b]T[/b] in [b]N[/b] variables.
Definition: TransportMap.h:39
TransportMap & operator*=(const TransportFun< T, N > &rhs)
Multiply and assign.
TransportMap & operator-=(const TransportMap &rhs)
Subtract.
TransportMap & operator+=(const TransportMap &rhs)
Add.
TransportFun< T, N > & operator[](int)
Get component.
void identity()
Set to identity.
TransportMap inverse() const
Inverse.
TransportMap operator-() const
Unary minus.
const TransportFun< T, N > & getComponent(int n) const
Get component.
FMatrix< T, N, N > linearTerms() const
Extract Transport terms at origin.
FVector< T, N > constantTerm() const
TransportMap & operator/=(const TransportFun< T, N > &rhs)
Divide and assign.
void setComponent(int, const TransportFun< T, N > &)
Set component.
TransportMap()
Default constructor.
TransportMap operator+() const
Unary plus.
TransportMap substitute(const FMatrix< T, N, N > &rhs) const
Substitute matrix into map.
TransportMap substituteInto(const FMatrix< T, N, N > &lhs) const
Substitute map into matrix.
static const int SIZE
Size of a component.
Definition: TransportMap.h:141
TransportFun< T, N > data[N]
Definition: TransportMap.h:144
Transport function in N variables of type T.
Definition: TransportFun.h:40