SheafSystem  0.0.0.0
general_matrix_3x3.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_3x3 classes.
19 
20 #ifndef GENERAL_MATRIX_3X3_H
21 #define GENERAL_MATRIX_3X3_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_3x3;
35 template <typename T> class general_matrix_1x3;
36 template <typename T> class general_matrix_3x1;
37 template <typename T> class general_matrix_3x2;
38 template <typename T> class symmetric_matrix_3x3;
39 
40 template <typename T> class gl3_row_dofs_type;
41 template <typename T> class jcb_e33_row_dofs_type;
42 template <typename T> class t02_e3_row_dofs_type;
43 
44 //==============================================================================
45 //==============================================================================
46 
57 template <typename T>
59 {
60 public:
61 
65  operator gl3_row_dofs_type<T>& () const;
66 
70  operator jcb_e33_row_dofs_type<T>& () const;
71 
75  operator t02_e3_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_1x3<T> row(int xrow) const;
125 
129  general_matrix_3x1<T> column(int xcolumn) const;
130 
135 
136  //============================================================================
137  //============================================================================
138 
142  void adjoint(general_matrix_3x3<T>& xresult) const;
143 
148 
152  void assign(const T& xvalue);
153 
157  void determinant(T& xresult) const;
158 
162  T determinant() const;
163 
167  void diagonalization(general_matrix_3x3<T>& xresult) const;
168 
173 
177  void identity(general_matrix_3x3<T>& xresult) const;
178 
183 
187  void inverse(general_matrix_3x3<T>& xresult) const;
188 
193 
197  bool is_antisymmetric() const;
198 
202  bool is_diagonal() const;
203 
207  bool is_identity() const;
208 
212  bool is_positive_definite() const;
213 
217  bool is_symmetric() const;
218 
222  void multiply(const T& xscalar, general_matrix_3x3<T>& xresult) const;
223 
227  general_matrix_3x3<T> multiply(const T& xscalar) const;
228 
232  void multiply(const general_matrix_3x3<T>& xother,
233  general_matrix_3x3<T>& xresult) const;
234 
239 
243  void multiply(const general_matrix_3x2<T>& xother,
244  general_matrix_3x2<T>& xresult) const;
245 
250 
254  void multiply(const general_matrix_3x1<T>& xother,
255  general_matrix_3x1<T>& xresult) const;
256 
261 
265  void trace(T& xresult) const;
266 
270  T trace() const;
271 
275  void transpose(general_matrix_3x3<T>& xresult) const;
276 
281 
285  void antisymmetric_part(antisymmetric_matrix_3x3<T>& xresult) const;
286 
291 
295  void symmetric_part(symmetric_matrix_3x3<T>& xresult) const;
296 
301 
308 
309 
310 protected:
311 private:
312 
313 };
314 
315 // =============================================================================
316 // NON-MEMBER FUNCTIONS
317 // =============================================================================
318 
322 template <typename T>
323 std::ostream& operator<<(std::ostream& xos, const general_matrix_3x3<T>& xm);
324 
325 
326 } // namespace fiber_bundle
327 
328 #endif // ifndef GENERAL_MATRIX_3X3_H
T trace() const
The trace of the matrix (auto-allocated).
bool is_symmetric() const
True if this matrix is symmetric.
static int number_of_columns()
The number of columns.
symmetric_matrix_3x3< T > symmetric_part() const
The symmetric part of a this matrix (auto-allocated).
antisymmetric_matrix_3x3< T > antisymmetric_part() const
The antisymmetric part of a this matrix (auto-allocated).
Antisymmetric matrix with 3 rows and 3 columns.
general_matrix_3x3< T > identity() const
The identity matrix (auto-allocated).
general_matrix_1x3< T > row(int xrow) const
A 1x3 matrix containing the elements or row xrow.
bool is_antisymmetric() const
True if this matrix is antisymmetric.
general_matrix_3x3< T > diagonalization() const
The diagonalization of the matrix (auto-allocated).
bool is_identity() const
True if this is an identity matrix.
static int d()
Dimension of the underlying elements.
General matrix with 3 rows and 2 columns.
void assign(const T &xvalue)
Assign all elements of this matrix to the value xvalue.
bool is_positive_definite() const
True if this matrix is positive definite.
General matrix with 3 rows and 1 column.
T determinant() const
The determinant of the matrix (auto-allocated).
void multiply(const T &xscalar, general_matrix_3x3< T > &xresult) const
This matrix multiplied by a scalar (pre-allocated).
general_matrix_3x3< T > transpose() const
The transpose of the matrix (auto-allocated).
bool is_diagonal() const
True if this matrix is diagonal.
int row_index(int xrow) const
Index for row xrow in the linear storage array.
Row dofs type for class gl3.
Definition: gl3.h:50
Row dofs type for class jcb_e33.
Definition: jcb_e33.h:48
general_matrix_3x3< T > inverse() const
The inverse of the matrix (auto-allocated).
T * operator[](int xrow)
Pointer to the first element in row xrow of this matrix. Facilitates accessing elements via matrix[i]...
General matrix with 3 rows and 3 columns.
General matrix with 1 row and 3 columns.
general_matrix_3x1< T > column(int xcolumn) const
A 3x1 matrix containing the elements or column xcolumn.
static int number_of_rows()
The number of rows.
Namespace for the fiber_bundles component of the sheaf system.
general_matrix_3x3< T > adjoint() const
The adjoint of the matrix (auto-allocated).
T components[9]
Linear storage array.
Symmetric matrix with 3 rows and 3 columns.