21 #ifndef GENERAL_MATRIX_3X1_IMPL_H 22 #define GENERAL_MATRIX_3X1_IMPL_H 24 #ifndef SHEAF_DLL_SPEC_H 25 #include "SheafSystem/sheaf_dll_spec.h" 28 #ifndef ASSERT_CONTRACT_H 29 #include "SheafSystem/assert_contract.h" 32 #ifndef ERROR_MESSAGE_H 33 #include "SheafSystem/error_message.h" 36 #ifndef GENERAL_MATRIX_1X2_H 37 #include "SheafSystem/general_matrix_1x2.h" 40 #ifndef GENERAL_MATRIX_1X3_H 41 #include "SheafSystem/general_matrix_1x3.h" 44 #ifndef GENERAL_MATRIX_3X1_H 45 #include "SheafSystem/general_matrix_3x1.h" 48 #ifndef GENERAL_MATRIX_3X2_H 49 #include "SheafSystem/general_matrix_3x2.h" 52 #ifndef GENERAL_MATRIX_3X3_H 53 #include "SheafSystem/general_matrix_3x3.h" 57 #include "SheafSystem/std_sstream.h" 61 #include "SheafSystem/std_cmath.h" 67 using namespace sheaf;
75 general_matrix_3x1<T>::
82 T* lcomps =
const_cast<T*
>(components);
112 template <
typename T>
129 template <
typename T>
146 template <
typename T>
153 require(nrow >= 0 && nrow < number_of_rows());
157 T* result = &components[row_index(nrow)];
168 template <
typename T>
175 require(nrow >= 0 && nrow < number_of_rows());
179 const T* result = &components[row_index(nrow)];
191 template <
typename T>
201 T* result = components;
213 template <
typename T>
215 operator
const T* ()
const 223 const T* result = components;
235 template <
typename T>
243 require(xrow >= 0 && xrow < number_of_rows());
253 ensure(result == number_of_columns()*xrow);
261 template <
typename T>
270 for(
int i=0; i<d(); ++i)
272 components[i] = xvalue;
277 ensure_for_all(i, 0, d(), components[i] == xvalue);
285 template <
typename T>
294 for(
int i=0; i<d(); ++i)
296 xresult.
components[i] = xscalar*components[i];
310 template <
typename T>
331 template <
typename T>
345 int nra = number_of_rows();
346 int nca = number_of_columns();
349 for(
int i=0; i<nra; ++i)
351 for(
int j=0; j<ncb; ++j)
355 for(
int k=0; k<nca; ++k)
357 sum += lm[i][k]*xother[k][j];
371 template <
typename T>
391 template <
typename T>
405 int nra = number_of_rows();
406 int nca = number_of_columns();
409 for(
int i=0; i<nra; ++i)
411 for(
int j=0; j<ncb; ++j)
415 for(
int k=0; k<nca; ++k)
417 sum += lm[i][k]*xother[k][j];
431 template <
typename T>
451 template <
typename T>
462 xresult[0][0] = lm[0][0];
463 xresult[0][1] = lm[1][0];
464 xresult[0][2] = lm[2][0];
473 template <
typename T>
497 #ifndef DOXYGEN_SKIP_IMPLEMENTATIONS 500 template <
typename T>
501 std::ostream& operator<<(std::ostream& xos, const general_matrix_3x1<T>& xm)
508 int ncols = xm.number_of_columns();
510 for(
int i=0; i<nrows; ++i)
512 for(
int j=0; j<ncols; ++j)
514 xos <<
" " << xm[i][j];
526 #endif // ifndef DOXYGEN_SKIP_IMPLEMENTATIONS 533 #endif // GENERAL_MATRIX_3X1_IMPL_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.
static int number_of_rows()
The number of rows.
void multiply(const T &xscalar, general_matrix_3x1< T > &xresult) const
This matrix multiplied by a scalar (pre-allocated).
static int number_of_columns()
The number of columns.
T * operator[](int xrow)
Pointer to the first element in row xrow of this matrix. Facilitates accessing elements via matrix[i]...
static int number_of_columns()
The number of columns.
Row dofs type for class jcb_e13.
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.
Namespace for the sheaves component of the sheaf system.
T components[3]
Linear storage array.
static int d()
Dimension of the underlying elements.
SHEAF_DLL_SPEC void multiply(const vd &x0, const vd_value_type &x1, vd &xresult, bool xauto_access)
Vector x0 multiplied by scalar x1 (pre-allocated version for persistent types).
general_matrix_1x3< T > transpose() const
The transpose of the matrix (auto-allocated).
Namespace for the fiber_bundles component of the sheaf system.