SheafSystem  0.0.0.0
general_matrix_3x1.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_3x1 classes.
19 
20 #ifndef GENERAL_MATRIX_3X1_H
21 #define GENERAL_MATRIX_3X1_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_1x3;
36 template <typename T> class general_matrix_3x2;
37 template <typename T> class general_matrix_3x3;
38 
39 template <typename T> class jcb_e13_row_dofs_type;
40 
41 //==============================================================================
42 //==============================================================================
43 
54 template <typename T>
55 class general_matrix_3x1
56 {
57 public:
58 
62  operator jcb_e13_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 
112 
113  //============================================================================
114  //============================================================================
115 
119  void assign(const T& xvalue);
120 
124  void multiply(const T& xscalar, general_matrix_3x1<T>& xresult) const;
125 
129  general_matrix_3x1<T> multiply(const T& xscalar) const;
130 
134  void multiply(const general_matrix_1x2<T>& xother,
135  general_matrix_3x2<T>& xresult) const;
136 
141 
145  void multiply(const general_matrix_1x3<T>& xother,
146  general_matrix_3x3<T>& xresult) const;
147 
152 
156  void transpose(general_matrix_1x3<T>& xresult) const;
157 
162 
163 
164 protected:
165 private:
166 
167 };
168 
169 // =============================================================================
170 // NON-MEMBER FUNCTIONS
171 // =============================================================================
172 
176 template <typename T>
177 std::ostream& operator<<(std::ostream& xos, const general_matrix_3x1<T>& xm);
178 
179 
180 } // namespace fiber_bundle
181 
182 #endif // ifndef GENERAL_MATRIX_3X1_H
int row_index(int xrow) const
Index for row xrow in the linear storage array.
static int number_of_columns()
The number of columns.
void assign(const T &xvalue)
Assign all elements of this matrix to the value xvalue.
General matrix with 3 rows and 2 columns.
General matrix with 1 row and 2 columns.
void multiply(const T &xscalar, general_matrix_3x1< T > &xresult) const
This matrix multiplied by a scalar (pre-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 1 column.
static int number_of_rows()
The number of rows.
General matrix with 3 rows and 3 columns.
General matrix with 1 row and 3 columns.
T components[3]
Linear storage array.
static int d()
Dimension of the underlying elements.
general_matrix_1x3< T > transpose() const
The transpose of the matrix (auto-allocated).
Namespace for the fiber_bundles component of the sheaf system.