SheafSystem  0.0.0.0
antisymmetric_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 antisymmetric_matrix_2x2 classes.
19 
20 #ifndef ANTISYMMETRIC_MATRIX_2X2_H
21 #define ANTISYMMETRIC_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 general_matrix_1x2;
35 template <typename T> class general_matrix_2x1;
36 template <typename T> class general_matrix_2x2;
37 template <typename T> class general_matrix_2x3;
38 
39 template <typename T> class at2_e2_row_dofs_type;
40 
41 //==============================================================================
42 //==============================================================================
43 
54 template <typename T>
56 {
57 public:
58 
62  operator at2_e2_row_dofs_type<T>& () const;
63 
67  static int number_of_rows();
68 
72  static int number_of_columns();
73 
77  static int d();
78 
83  T* operator[](int xrow);
84 
89  const T* operator[](int xrow) const;
90 
95  operator T* ();
96 
101  operator const T* () const;
102 
106  int row_index(int xrow) const;
107 
111  operator general_matrix_2x2<T> () const;
112 
116  general_matrix_1x2<T> row(int xrow) const;
117 
121  general_matrix_2x1<T> column(int xcolumn) const;
122 
127 
128  //============================================================================
129  //============================================================================
130 
134  void adjoint(antisymmetric_matrix_2x2<T>& xresult) const;
135 
140 
144  void assign(const T& xscalar);
145 
149  void determinant(T& xresult) const;
150 
154  T determinant() const;
155 
159  void inverse(antisymmetric_matrix_2x2<T>& xresult) const;
160 
165 
170  bool is_positive_definite() const;
171 
175  void multiply(const T& xscalar, antisymmetric_matrix_2x2<T>& xresult) const;
176 
180  antisymmetric_matrix_2x2<T> multiply(const T& xscalar) const;
181 
185  void multiply(const general_matrix_2x1<T>& xother,
186  general_matrix_2x1<T>& xresult) const;
187 
192 
196  void multiply(const general_matrix_2x2<T>& xother,
197  general_matrix_2x2<T>& xresult) const;
198 
203 
207  void multiply(const general_matrix_2x3<T>& xother,
208  general_matrix_2x3<T>& xresult) const;
209 
214 
220  void multiply(const antisymmetric_matrix_2x2<T>& xother,
221  general_matrix_2x2<T>& xresult) const;
222 
229 
233  void trace(T& xresult) const;
234 
238  T trace() const;
239 
243  void transpose(antisymmetric_matrix_2x2<T>& xresult) const;
244 
249 
256 
257 
258 protected:
259 private:
260 
261 };
262 
263 // =============================================================================
264 // NON-MEMBER FUNCTIONS
265 // =============================================================================
266 
270 template <typename T>
271 std::ostream& operator<<(std::ostream& xos, const antisymmetric_matrix_2x2<T>& xm);
272 
273 } // namespace fiber_bundle
274 
275 #endif // ifndef ANTISYMMETRIC_MATRIX_2X2_H
T determinant() const
The determinant of the matrix (auto-allocated).
static int number_of_columns()
The number of columns.
void multiply(const T &xscalar, antisymmetric_matrix_2x2< T > &xresult) const
This matrix multiplied by a scalar (pre-allocated).
static int d()
Dimension of the underlying elements.
general_matrix_1x2< T > row(int xrow) const
A 1x2 matrix containing the elements or row xrow.
General matrix with 1 row and 2 columns.
General matrix with 2 rows and 2 columns.
static int number_of_rows()
The number of rows.
antisymmetric_matrix_2x2< T > transpose() const
The transpose of the matrix (auto-allocated).
General matrix with 2 rows and 1 column.
Antisymmetric matrix with 2 rows and 2 columns.
Row dofs type for class at2_e2.
Definition: at2_e2.h:51
general_matrix_2x1< T > column(int xcolumn) const
A 2x1 matrix containing the elements or column xcolumn.
antisymmetric_matrix_2x2< T > adjoint() const
The adjoint 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]...
bool is_positive_definite() const
True if this matrix is positive definite. Always returns false for antisymmetric_matrices.
General matrix with 2 rows and 3 columns.
int row_index(int xrow) const
Index for row xrow in the linear storage array.
antisymmetric_matrix_2x2< T > inverse() const
The inverse of the matrix (auto-allocated).
void assign(const T &xscalar)
Assign all elements of this matrix to the value xvalue.
Namespace for the fiber_bundles component of the sheaf system.
T trace() const
The trace of the matrix (auto-allocated).