SheafSystem  0.0.0.0
general_matrix_2x3.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_2x3 classes.
19 
20 #ifndef GENERAL_MATRIX_2X3_H
21 #define GENERAL_MATRIX_2X3_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_1x3;
35 template <typename T> class general_matrix_2x1;
36 template <typename T> class general_matrix_2x2;
37 template <typename T> class general_matrix_3x1;
38 template <typename T> class general_matrix_3x2;
39 template <typename T> class general_matrix_3x3;
40 
41 //==============================================================================
42 //==============================================================================
43 
54 template <typename T>
55 class general_matrix_2x3
56 {
57 public:
58 
62  static int number_of_rows();
63 
67  static int number_of_columns();
68 
72  static int d();
73 
78  T* operator[](int xrow);
79 
84  const T* operator[](int xrow) const;
85 
90  operator T* ();
91 
96  operator const T* () const;
97 
101  int row_index(int xrow) const;
102 
106  general_matrix_1x3<T> row(int xrow) const;
107 
111  general_matrix_2x1<T> column(int xcolumn) const;
112 
117 
118  //============================================================================
119  //============================================================================
120 
124  //void adjoint(general_matrix_2x3<T>& xresult) const;
125 
129  //general_matrix_2x3<T> adjoint() const;
130 
134  void assign(const T& xvalue);
135 
139  void multiply(const T& xscalar, general_matrix_2x3<T>& xresult) const;
140 
144  general_matrix_2x3<T> multiply(const T& xscalar) const;
145 
149  void multiply(const general_matrix_3x1<T>& xother,
150  general_matrix_2x1<T>& xresult) const;
151 
156 
160  void multiply(const general_matrix_3x2<T>& xother,
161  general_matrix_2x2<T>& xresult) const;
162 
167 
171  void multiply(const general_matrix_3x3<T>& xother,
172  general_matrix_2x3<T>& xresult) const;
173 
178 
182  void transpose(general_matrix_3x2<T>& xresult) const;
183 
188 
189 
190 protected:
191 private:
192 
193 };
194 
195 // =============================================================================
196 // NON-MEMBER FUNCTIONS
197 // =============================================================================
198 
202 template <typename T>
203 std::ostream& operator<<(std::ostream& xos, const general_matrix_2x3<T>& xm);
204 
205 
206 } // namespace fiber_bundle
207 
208 #endif // ifndef GENERAL_MATRIX_2X3_H
T components[6]
Linear storage array.
general_matrix_2x1< T > column(int xcolumn) const
A 2x1 matrix containing the elements or column xcolumn.
static int number_of_rows()
The number of rows.
General matrix with 3 rows and 2 columns.
General matrix with 2 rows and 2 columns.
void assign(const T &xvalue)
The adjoint of the matrix (pre-allocated).
static int d()
Dimension of the underlying elements.
general_matrix_3x2< T > transpose() const
The transpose of the matrix (auto-allocated).
General matrix with 3 rows and 1 column.
General matrix with 2 rows and 1 column.
void multiply(const T &xscalar, general_matrix_2x3< 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.
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 2 rows and 3 columns.
static int number_of_columns()
The number of columns.
Namespace for the fiber_bundles component of the sheaf system.
general_matrix_1x3< T > row(int xrow) const
A 1x3 matrix containing the elements or row xrow.