21 #ifndef GENERAL_MATRIX_2X3_IMPL_H 22 #define GENERAL_MATRIX_2X3_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_1x3_H 37 #include "SheafSystem/general_matrix_1x3.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;
100 template <
typename T>
117 template <
typename T>
134 template <
typename T>
141 require(nrow >= 0 && nrow < number_of_rows());
145 T* result = &components[row_index(nrow)];
156 template <
typename T>
163 require(nrow >= 0 && nrow < number_of_rows());
167 const T* result = &components[row_index(nrow)];
179 template <
typename T>
189 T* result = components;
201 template <
typename T>
203 operator
const T* ()
const 211 const T* result = components;
223 template <
typename T>
231 require(xrow >= 0 && xrow < number_of_rows());
235 int result = number_of_columns()*xrow;
239 ensure(result == number_of_columns()*xrow);
247 template <
typename T>
254 require(xrow >= 0 && xrow < number_of_rows());
260 int lindex = row_index(xrow);
274 template <
typename T>
281 require(xcolumn >= 0 && xcolumn < number_of_columns());
287 int lindex = xcolumn;
300 template <
typename T>
309 for(
int i=0; i<d(); ++i)
311 components[i] = xvalue;
316 ensure_for_all(i, 0, d(), components[i] == xvalue);
325 template <
typename T>
334 for(
int i=0; i<d(); ++i)
336 xresult.
components[i] = xscalar*components[i];
350 template <
typename T>
370 template <
typename T>
384 int nra = number_of_rows();
385 int nca = number_of_columns();
388 for(
int i=0; i<nra; ++i)
390 for(
int j=0; j<ncb; ++j)
394 for(
int k=0; k<nca; ++k)
396 sum += lm[i][k]*xother[k][j];
410 template <
typename T>
430 template <
typename T>
444 int nra = number_of_rows();
445 int nca = number_of_columns();
448 for(
int i=0; i<nra; ++i)
450 for(
int j=0; j<ncb; ++j)
454 for(
int k=0; k<nca; ++k)
456 sum += lm[i][k]*xother[k][j];
470 template <
typename T>
490 template <
typename T>
504 int nra = number_of_rows();
505 int nca = number_of_columns();
508 for(
int i=0; i<nra; ++i)
510 for(
int j=0; j<ncb; ++j)
514 for(
int k=0; k<nca; ++k)
516 sum += lm[i][k]*xother[k][j];
530 template <
typename T>
550 template <
typename T>
564 for(
int i=0; i<nrows; ++i)
566 for(
int j=0; j<ncols; ++j)
568 xresult[i][j] = lm[j][i];
579 template <
typename T>
603 #ifndef DOXYGEN_SKIP_IMPLEMENTATIONS 606 template <
typename T>
607 std::ostream& operator<<(std::ostream& xos, const general_matrix_2x3<T>& xm)
614 int ncols = xm.number_of_columns();
616 for(
int i=0; i<nrows; ++i)
618 for(
int j=0; j<ncols; ++j)
620 xos <<
" " << xm[i][j];
632 #endif // ifndef DOXYGEN_SKIP_IMPLEMENTATIONS 639 #endif // GENERAL_MATRIX_2X3_IMPL_H static int number_of_columns()
The number of columns.
static int number_of_columns()
The number of columns.
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.
T components[2]
Linear storage array.
static int number_of_rows()
The number of rows.
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 components[3]
Linear storage array.
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]...
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.
General matrix with 2 rows and 3 columns.
static int number_of_columns()
The number of columns.
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).
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.