SheafSystem  0.0.0.0
general_matrix_3x2.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_3x2 classes.
19 
20 #ifndef GENERAL_MATRIX_3X2_H
21 #define GENERAL_MATRIX_3X2_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 template <typename T> class general_matrix_3x1;
39 template <typename T> class general_matrix_3x3;
40 
41 template <typename T> class jcb_e23_row_dofs_type;
42 
43 //==============================================================================
44 //==============================================================================
45 
56 template <typename T>
57 class general_matrix_3x2
58 {
59 public:
60 
64  operator jcb_e23_row_dofs_type<T>& () const;
65 
69  static int number_of_rows();
70 
74  static int number_of_columns();
75 
79  static int d();
80 
85  T* operator[](int xrow);
86 
91  const T* operator[](int xrow) const;
92 
97  operator T* ();
98 
103  operator const T* () const;
104 
108  int row_index(int xrow) const;
109 
113  general_matrix_1x2<T> row(int xrow) const;
114 
118  general_matrix_3x1<T> column(int xcolumn) const;
119 
124 
125  //============================================================================
126  //============================================================================
127 
131  void assign(const T& xvalue);
132 
136  void multiply(const T& xscalar, general_matrix_3x2<T>& xresult) const;
137 
141  general_matrix_3x2<T> multiply(const T& xscalar) const;
142 
146  void multiply(const general_matrix_2x3<T>& xother,
147  general_matrix_3x3<T>& xresult) const;
148 
153 
157  void multiply(const general_matrix_2x2<T>& xother,
158  general_matrix_3x2<T>& xresult) const;
159 
164 
168  void multiply(const general_matrix_2x1<T>& xother,
169  general_matrix_3x1<T>& xresult) const;
170 
175 
179  void transpose(general_matrix_2x3<T>& xresult) const;
180 
185 
186 protected:
187 private:
188 
189 };
190 
191 // =============================================================================
192 // NON-MEMBER FUNCTIONS
193 // =============================================================================
194 
198 template <typename T>
199 std::ostream& operator<<(std::ostream& xos, const general_matrix_3x2<T>& xm);
200 
201 
202 } // namespace fiber_bundle
203 
204 #endif // ifndef GENERAL_MATRIX_3X2_H
general_matrix_2x3< T > transpose() const
The transpose of the matrix (auto-allocated).
General matrix with 3 rows and 2 columns.
General matrix with 2 rows and 2 columns.
T * operator[](int xrow)
Pointer to the first element in row xrow of this matrix. Facilitates accessing elements via matrix[i]...
general_matrix_1x2< T > row(int xrow) const
A 1x2 matrix containing the elements or row xrow.
static int number_of_rows()
The number of rows.
static int d()
Dimension of the underlying elements.
General matrix with 3 rows and 1 column.
General matrix with 2 rows and 1 column.
void multiply(const T &xscalar, general_matrix_3x2< 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.
static int number_of_columns()
The number of columns.
general_matrix_3x1< T > column(int xcolumn) const
A 3x1 matrix containing the elements or column xcolumn.
General matrix with 3 rows and 3 columns.
General matrix with 2 rows and 3 columns.
void assign(const T &xvalue)
Assign all elements of this matrix to the value xvalue.
T components[6]
Linear storage array.
Namespace for the fiber_bundles component of the sheaf system.