SheafSystem  0.0.0.0
general_matrix_1x2.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_1x2 classes.
19 
20 #ifndef GENERAL_MATRIX_1X2_H
21 #define GENERAL_MATRIX_1X2_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_2x3;
38 
39 //==============================================================================
40 //==============================================================================
41 
52 template <typename T>
53 class general_matrix_1x2
54 {
55 public:
56 
60  static int number_of_rows();
61 
65  static int number_of_columns();
66 
70  static int d();
71 
76  T* operator[](int xrow);
77 
82  const T* operator[](int xrow) const;
83 
88  operator T* ();
89 
94  operator const T* () const;
95 
99  int row_index(int xrow) const;
100 
105 
106  //============================================================================
107  //============================================================================
108 
112  void assign(const T& xvalue);
113 
117  void multiply(const T& xscalar, general_matrix_1x2<T>& xresult) const;
118 
122  general_matrix_1x2<T> multiply(const T& xscalar) const;
123 
128  void multiply(const general_matrix_2x1<T>& xother, T& xresult) const;
129 
134  T multiply(const general_matrix_2x1<T>& xother) const;
135 
139  void multiply(const general_matrix_2x2<T>& xother,
140  general_matrix_1x2<T>& xresult) const;
141 
146 
150  void multiply(const general_matrix_2x3<T>& xother,
151  general_matrix_1x3<T>& xresult) const;
152 
157 
161  void transpose(general_matrix_2x1<T>& xresult) const;
162 
167 
168 
169 protected:
170 private:
171 
172 };
173 
174 // =============================================================================
175 // NON-MEMBER FUNCTIONS
176 // =============================================================================
177 
181 template <typename T>
182 std::ostream& operator<<(std::ostream& xos, const general_matrix_1x2<T>& xm);
183 
184 
185 } // namespace fiber_bundle
186 
187 #endif // ifndef GENERAL_MATRIX_1X2_H
T components[2]
Linear storage array.
general_matrix_2x1< T > transpose() const
The transpose 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 1 row and 2 columns.
General matrix with 2 rows and 2 columns.
void assign(const T &xvalue)
Assign all elements of this matrix to the value xvalue.
static int number_of_columns()
The number of columns.
General matrix with 2 rows and 1 column.
static int number_of_rows()
The number of rows.
static int d()
Dimension of the underlying elements.
void multiply(const T &xscalar, general_matrix_1x2< T > &xresult) const
This matrix multiplied by a scalar (pre-allocated).
General matrix with 1 row and 3 columns.
General matrix with 2 rows and 3 columns.
int row_index(int xrow) const
Index for row xrow in the linear storage array.
Namespace for the fiber_bundles component of the sheaf system.