21 #ifndef GENERAL_MATRIX_3X2_IMPL_H 22 #define GENERAL_MATRIX_3X2_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_2X1_H 41 #include "SheafSystem/general_matrix_2x1.h" 44 #ifndef GENERAL_MATRIX_2X2_H 45 #include "SheafSystem/general_matrix_2x2.h" 48 #ifndef GENERAL_MATRIX_2X3_H 49 #include "SheafSystem/general_matrix_2x3.h" 52 #ifndef GENERAL_MATRIX_3X1_H 53 #include "SheafSystem/general_matrix_3x1.h" 56 #ifndef GENERAL_MATRIX_3X2_H 57 #include "SheafSystem/general_matrix_3x2.h" 60 #ifndef GENERAL_MATRIX_3X3_H 61 #include "SheafSystem/general_matrix_3x3.h" 65 #include "SheafSystem/std_sstream.h" 69 #include "SheafSystem/std_cmath.h" 75 using namespace sheaf;
83 general_matrix_3x2<T>::
90 T* lcomps =
const_cast<T*
>(components);
104 template <
typename T>
121 template <
typename T>
138 template <
typename T>
155 template <
typename T>
162 require(nrow >= 0 && nrow < number_of_rows());
166 T* result = &components[row_index(nrow)];
177 template <
typename T>
184 require(nrow >= 0 && nrow < number_of_rows());
188 const T* result = &components[row_index(nrow)];
200 template <
typename T>
210 T* result = components;
222 template <
typename T>
224 operator
const T* ()
const 232 const T* result = components;
244 template <
typename T>
252 require(xrow >= 0 && xrow < number_of_rows());
256 int result = number_of_columns()*xrow;
260 ensure(result == number_of_columns()*xrow);
268 template <
typename T>
275 require(xrow >= 0 && xrow < number_of_rows());
281 int lindex = row_index(xrow);
294 template <
typename T>
301 require(xcolumn >= 0 && xcolumn < number_of_columns());
307 int lindex = xcolumn;
322 template <
typename T>
331 for(
int i=0; i<d(); ++i)
333 components[i] = xvalue;
338 ensure_for_all(i, 0, d(), components[i] == xvalue);
346 template <
typename T>
355 for(
int i=0; i<d(); ++i)
357 xresult.
components[i] = xscalar*components[i];
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>
452 template <
typename T>
466 int nra = number_of_rows();
467 int nca = number_of_columns();
470 for(
int i=0; i<nra; ++i)
472 for(
int j=0; j<ncb; ++j)
476 for(
int k=0; k<nca; ++k)
478 sum += lm[i][k]*xother[k][j];
492 template <
typename T>
512 template <
typename T>
526 int nra = number_of_rows();
527 int nca = number_of_columns();
530 for(
int i=0; i<nra; ++i)
532 for(
int j=0; j<ncb; ++j)
536 for(
int k=0; k<nca; ++k)
538 sum += lm[i][k]*xother[k][j];
552 template <
typename T>
572 template <
typename T>
586 for(
int i=0; i<nrows; ++i)
588 for(
int j=0; j<ncols; ++j)
590 xresult[i][j] = lm[j][i];
601 template <
typename T>
626 #ifndef DOXYGEN_SKIP_IMPLEMENTATIONS 629 template <
typename T>
630 std::ostream& operator<<(std::ostream& xos, const general_matrix_3x2<T>& xm)
637 int ncols = xm.number_of_columns();
639 for(
int i=0; i<nrows; ++i)
641 for(
int j=0; j<ncols; ++j)
643 xos <<
" " << xm[i][j];
655 #endif // ifndef DOXYGEN_SKIP_IMPLEMENTATIONS 662 #endif // GENERAL_MATRIX_3X2_IMPL_H T components[2]
Linear storage array.
general_matrix_2x3< T > transpose() const
The transpose of the matrix (auto-allocated).
static int number_of_columns()
The number of columns.
static int number_of_columns()
The number of columns.
static int number_of_rows()
The number of rows.
Row dofs type for class jcb_e23.
General matrix with 3 rows and 2 columns.
General matrix with 1 row 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.
Namespace for the sheaves component of the sheaf system.
General matrix with 2 rows and 3 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.
T components[3]
Linear storage array.
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).
T components[6]
Linear storage array.
Namespace for the fiber_bundles component of the sheaf system.