|
| Matrix_d () |
|
| Matrix_d (const Matrix_d &m) |
|
| Matrix_d (const Matrix_d< NCOLS, NROWS,!TRANSPOSED > &m) |
|
template<class Iterator > |
| Matrix_d (Iterator begin) |
| Fill constructor. More...
|
|
| Matrix_d (const Matrix &m) |
| Construct from "dynamic" vector. More...
|
|
| Matrix_d (double value) |
|
void | resize (size_t rows, size_t cols) |
|
Matrix_d & | swap (Matrix_d &other) |
|
Matrix_d< NROWS, NCOLS,!TRANSPOSED > & | transpose () |
|
const Matrix_d< NROWS, NCOLS,!TRANSPOSED > & | transpose () const |
|
Matrix_d & | operator= (const Matrix_d &other) |
| assignment More...
|
|
Matrix_d & | operator= (const Matrix_d< NCOLS, NROWS,!TRANSPOSED > &other) |
| assignment More...
|
|
Matrix_d & | operator= (const Matrix &other) |
| assignment from dynamic matrix More...
|
|
Matrix_d & | operator-= (const Matrix_d &second) |
|
Matrix_d | operator- (const Matrix_d &second) const |
|
Matrix_d & | operator-= (const Matrix_d< NCOLS, NROWS,!TRANSPOSED > &second) |
|
Matrix_d | operator- (const Matrix_d< NCOLS, NROWS,!TRANSPOSED > &second) const |
|
Matrix_d & | operator-= (const Matrix &second) |
|
Matrix_d | operator- (const Matrix &second) const |
|
Matrix_d | operator- () const |
| negation More...
|
|
Matrix_d & | operator+= (const Matrix_d &second) |
|
Matrix_d | operator+ (const Matrix_d &second) const |
|
Matrix_d & | operator+= (const Matrix_d< NCOLS, NROWS,!TRANSPOSED > &second) |
|
Matrix_d | operator+ (const Matrix_d< NCOLS, NROWS,!TRANSPOSED > &second) const |
|
Matrix_d & | operator+= (const Matrix &second) |
|
Matrix_d | operator+ (const Matrix &second) const |
|
template<std::size_t IN_COLS> |
Matrix_d< num_rows, IN_COLS > | operator* (const Matrix_d< num_cols, IN_COLS, false > &second) const |
|
template<std::size_t IN_COLS> |
Matrix_d< num_rows, IN_COLS > | operator* (const Matrix_d< IN_COLS, num_cols, true > &second) const |
|
Matrix_d & | operator*= (double s) |
| multiplication by a scalar More...
|
|
template<std::size_t IN_ROWS, bool IN_TRANSPOSED> |
Matrix_d & | operator*= (const Matrix_d< IN_ROWS, IN_ROWS, IN_TRANSPOSED > &other) |
|
Matrix_d | operator* (double s) const |
|
Vector_d< num_rows > | operator* (const Vector_d< num_cols > &v) const |
|
Matrix_d & | operator/= (double s) |
|
Matrix_d | operator/ (double s) const |
|
double & | operator() (size_t row, size_t col) |
|
const double & | operator() (size_t row, size_t col) const |
|
Vector_d< num_cols > | get_row (size_t r) const |
|
template<size_t D> |
void | set_row (size_t r, const Vector_d< D > &row) |
|
Vector_d< num_rows > | get_col (size_t c) const |
|
template<size_t D> |
void | set_col (size_t c, const Vector_d< D > &col) |
|
bool | operator== (const Matrix_d &op2) const |
|
bool | operator== (const Matrix_d< NCOLS, NROWS,!TRANSPOSED > &op2) const |
|
bool | operator== (const Matrix &op2) const |
|
bool | operator!= (const Matrix_d &op2) const |
|
bool | operator!= (const Matrix_d< NCOLS, NROWS,!TRANSPOSED > &op2) const |
|
bool | operator!= (const Matrix &op2) const |
|
template<class Matrix_type > |
Matrix_d< NROWS, NCOLS,
TRANSPOSED > & | assignment_dispatch_ (Matrix_type &other) |
|
template<class Matrix_op > |
Matrix_d< NROWS, NCOLS,
TRANSPOSED > & | plus_equals_dispatch_ (const Matrix_op &second) |
|
template<class Matrix_op > |
Matrix_d< NROWS, NCOLS,
TRANSPOSED > & | minus_equals_dispatch_ (const Matrix_op &second) |
|
template<size_t M, size_t N, bool Transposed>
class kjb::Matrix_d< M, N, Transposed >
Statically-allocated matrix. More limited in functionality than kjb::Matrix, but can offer significantly better performance, because no operations require heap allocation. Transposes are also handle statically, so a matrix can be transposed and used in operators without a copy and zero runtime overhead–the compiler simply calls a different version of the operation.
An added benefit is that all dimension mis-matches are caught at compile time.
- Note
- This is implemented as an array of Vector_d objects, which offers convenient semantics in some situations, especially with STL algorithms.
- Warning
- The transposed state of a matrix should be transparent to the user. For that reasons, square-bracket operator is generally discouraged, as it doesn't respect the transposed state. In other words, for transposed matrices, m(i,j) != m[i][j].
- Template Parameters
-
NROWS | number of rows in matrix |
NCOLS | number of columns in matrix |
TRANSPOSED | swap meaning of rows and columns. You'll rarely set this manually; rather the "transpose()" method will set this. It's actually a bit confusing to work in this mode deliberately, because the meaning of NROWS and NCOLS is swapped. Just use m.transpose() and trust the implementation ;-) |