SheafSystem  0.0.0.0
general_matrix_2x2.h
1 
2 //
3 // Copyright (c) 2014 Limit Point Systems, Inc.
4 //
5 // Licensed under the Apache License, Version 2.0 (the "License");
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17 
18 // Interface for general_matrix_2x2 classes.
19 
20 #ifndef GENERAL_MATRIX_2X2_H
21 #define GENERAL_MATRIX_2X2_H
22 
23 #ifndef SHEAF_DLL_SPEC_H
24 #include "SheafSystem/sheaf_dll_spec.h"
25 #endif
26 
27 #ifndef STD_IOSTREAM_H
28 #include "SheafSystem/std_iostream.h"
29 #endif
30 
31 namespace fiber_bundle
32 {
33 
34 template <typename T> class antisymmetric_matrix_2x2;
35 template <typename T> class general_matrix_1x2;
36 template <typename T> class general_matrix_2x1;
37 template <typename T> class general_matrix_2x3;
38 template <typename T> class symmetric_matrix_2x2;
39 
40 template <typename T> class gl2_row_dofs_type;
41 template <typename T> class t02_e2_row_dofs_type;
42 template <typename T> class t11_e2_row_dofs_type;
43 
44 //==============================================================================
45 //==============================================================================
46 
57 template <typename T>
59 {
60 public:
61 
65  operator gl2_row_dofs_type<T>& () const;
66 
70  operator t02_e2_row_dofs_type<T>& () const;
71 
75  operator t11_e2_row_dofs_type<T>& () const;
76 
80  static int number_of_rows();
81 
85  static int number_of_columns();
86 
90  static int d();
91 
96  T* operator[](int xrow);
97 
102  const T* operator[](int xrow) const;
103 
108  operator T* ();
109 
114  operator const T* () const;
115 
119  int row_index(int xrow) const;
120 
124  general_matrix_1x2<T> row(int xrow) const;
125 
129  general_matrix_2x1<T> column(int xcolumn) const;
130 
135 
136  //============================================================================
137  // Matrix algebra, etc.
138  //============================================================================
139 
143  void adjoint(general_matrix_2x2<T>& xresult) const;
144 
149 
153  void assign(const T& xvalue);
154 
158  void determinant(T& xresult) const;
159 
163  T determinant() const;
164 
168  void diagonalization(general_matrix_2x2<T>& xresult) const;
169 
174 
178  void identity(general_matrix_2x2<T>& xresult) const;
179 
184 
188  void inverse(general_matrix_2x2<T>& xresult) const;
189 
193  bool is_antisymmetric() const;
194 
198  bool is_diagonal() const;
199 
203  bool is_identity() const;
204 
208  bool is_positive_definite() const;
209 
213  bool is_symmetric() const;
214 
219 
223  void multiply(const T& xscalar, general_matrix_2x2<T>& xresult) const;
224 
228  general_matrix_2x2<T> multiply(const T& xscalar) const;
229 
233  void multiply(const general_matrix_2x1<T>& xother,
234  general_matrix_2x1<T>& xresult) const;
235 
240 
244  void multiply(const general_matrix_2x2<T>& xother,
245  general_matrix_2x2<T>& xresult) const;
246 
251 
255  void multiply(const general_matrix_2x3<T>& xother,
256  general_matrix_2x3<T>& xresult) const;
257 
262 
266  void trace(T& xresult) const;
267 
271  T trace() const;
272 
276  void transpose(general_matrix_2x2<T>& xresult) const;
277 
282 
286  void antisymmetric_part(antisymmetric_matrix_2x2<T>& xresult) const;
287 
292 
296  void symmetric_part(symmetric_matrix_2x2<T>& xresult) const;
297 
302 
306  //general_matrix_2x2<T> operator= ();
307 
314 
315 
316 
317 
318 protected:
319 private:
320 
321 };
322 
323 // =============================================================================
324 // NON-MEMBER FUNCTIONS
325 // =============================================================================
326 
330 template <typename T>
331 std::ostream& operator<<(std::ostream& xos, const general_matrix_2x2<T>& xm);
332 
333 
334 } // namespace fiber_bundle
335 
336 #endif // ifndef GENERAL_MATRIX_2X2_H
bool is_positive_definite() const
True if this matrix is positive definite.
bool is_identity() const
True if this is an identity matrix.
T trace() const
The trace of the matrix (auto-allocated).
void assign(const T &xvalue)
Assign all elements of this matrix to the value xvalue.
T * operator[](int xrow)
Pointer to the first element in row xrow of this matrix. Facilitates accessing elements via matrix[i]...
general_matrix_2x2< T > inverse() const
The inverse of the matrix (auto-allocated).
static int number_of_columns()
The number of columns.
general_matrix_2x2< T > transpose() const
The transpose of the matrix (auto-allocated).
symmetric_matrix_2x2< T > symmetric_part() const
The symmetric part of a this matrix (auto-allocated).
general_matrix_2x1< T > column(int xcolumn) const
A 2x1 matrix containing the elements or column xcolumn.
T components[4]
Linear storage array.
General matrix with 1 row and 2 columns.
General matrix with 2 rows and 2 columns.
general_matrix_2x2< T > adjoint() const
The adjoint of the matrix (auto-allocated).
Row dofs type for class gl2.
Definition: gl2.h:50
general_matrix_2x2< T > diagonalization() const
The diagonalization of the matrix (auto-allocated).
void multiply(const T &xscalar, general_matrix_2x2< T > &xresult) const
This matrix multiplied by a scalar (pre-allocated).
int row_index(int xrow) const
Index for row xrow in the linear storage array.
general_matrix_2x2< T > identity() const
The identity matrix (auto-allocated).
Symmetric matrix with 2 rows and 2 columns.
General matrix with 2 rows and 1 column.
antisymmetric_matrix_2x2< T > antisymmetric_part() const
The antisymmetric part of a this matrix (auto-allocated).
Antisymmetric matrix with 2 rows and 2 columns.
bool is_diagonal() const
True if this matrix is diagonal.
bool is_antisymmetric() const
True if this matrix is antisymmetric.
T determinant() const
The determinant of the matrix (auto-allocated).
static int number_of_rows()
The number of rows.
general_matrix_1x2< T > row(int xrow) const
A 1x2 matrix containing the elements or row xrow.
General matrix with 2 rows and 3 columns.
static int d()
Dimension of the underlying elements.
bool is_symmetric() const
True if this matrix is symmetric.
Namespace for the fiber_bundles component of the sheaf system.