|
| Mat2 ()=default |
| Default constructor.
|
|
| Mat2 (T s) |
| Constructor that initializes diagonal elements to a scalar value and others zeros.
|
|
| Mat2 (const Mat< 2, 2, T > &rhs) |
| Copy constructor. This provides compatibility with generic operations implemented by Mat.
|
|
| Mat2 (const Mat< 3, 3, T > &rhs) |
| Copies the top-left corner of rhs. This provides compatibility with generic operations implemented by Mat.
|
|
| Mat2 (T s00, T s01, T s10, T s11) |
| Initialize elements from individual scalars. The digits following s in the parameter names indicate the row/column of the element being set.
|
|
| Mat2 (const T *m) |
| Initialize elements from an array of type T.
|
|
| Mat2 (const Vec< 2, T > &x, const Vec< 2, T > &y) |
| Initialize elements from two vectors. If MATRIX_ROW_MAJOR is defined, x and y specify rows of the matrix, else columns.
|
|
| Mat ()=default |
| Default constructor.
|
|
| Mat (T s) |
| Constructs a matrix with diagonal elements set to s and other elements set to zero.
|
|
| Mat (const Mat< rN, rM, T > &rhs) |
| Copy constructor for matrices with different dimensions (rN >= N, rM >= M).
|
|
| Mat (const T *m) |
| Constructs a matrix from an array of elements.
|
|
Vec< M, T > | row (size_t row) const |
| Returns the specified row as a vector.
|
|
Vec< N, T > | col (size_t col) const |
| Returns the specified column as a vector.
|
|
const T & | operator() (size_t row, size_t col) const |
| Returns a constant reference to the element at the specified row and column.
|
|
T & | operator() (size_t row, size_t col) |
| Returns a reference to the element at the specified row and column.
|
|
| operator const T * () const |
| Returns a constant pointer to the matrix elements.
|
|
| operator T* () |
| Returns a pointer to the matrix elements.
|
|
void | load_zero () |
| Sets all elements to zero.
|
|
void | load_identity (T s=T(1)) |
| Sets the diagonal elements to s and other elements to zero.
|
|
void | set_row (size_t row, const Vec< vN, T > &v) |
| Sets the specified row from a vector.
|
|
void | set_col (size_t col, const Vec< vN, T > &v) |
| Sets the specified column from a vector.
|
|
void | swap_rows (size_t a, size_t b) |
| Swaps the specified rows.
|
|
void | swap_cols (size_t a, size_t b) |
| Swaps the specified columns.
|
|
bool | operator== (const Mat< N, M, T > &rhs) const |
| Checks if the matrix is equal to another matrix.
|
|
bool | operator!= (const Mat< N, M, T > &rhs) const |
| Checks if the matrix is not equal to another matrix.
|
|
Mat< N, rM, T > | operator* (const Mat< M, rM, T > &rhs) const |
| Multiplies the matrix by another matrix.
|
|
Vec< N, T > | operator* (const Vec< M, T > &rhs) const |
| Multiplies the matrix by a vector.
|
|
Mat< N, M, T > | operator* (T rhs) const |
| Multiplies the matrix by a scalar.
|
|
Mat< N, M, T > | operator+ (const Mat< N, M, T > &rhs) const |
| Adds the matrix to another matrix. Component-wise matrix-matrix addition.
|
|
Mat< N, M, T > | operator- (const Mat< N, M, T > &rhs) const |
| Subtracts another matrix from the matrix. Component-wise matrix-matrix subtraction.
|
|
Mat< N, M, T > | operator- () const |
| Negates the matrix. Component-wise matrix negation.
|
|
Mat< N, M, T > | operator/ (T rhs) const |
| Divides the matrix by a scalar.
|
|
Mat< N, M, T > & | operator*= (const Mat< N, M, T > &rhs) |
| Multiplies the matrix by another matrix and assigns the result to the matrix.
|
|
Mat< N, M, T > & | operator*= (T rhs) |
| Multiplies the matrix by a scalar and assigns the result to the matrix.
|
|
Mat< N, M, T > & | operator+= (const Mat< N, M, T > &rhs) |
| Adds another matrix to the matrix and assigns the result to the matrix.
|
|
Mat< N, M, T > & | operator+= (T rhs) |
| Adds a scalar to the matrix and assigns the result to the matrix.
|
|
Mat< N, M, T > & | operator-= (const Mat< N, M, T > &rhs) |
| Subtracts another matrix from the matrix and assigns the result to the matrix.
|
|
Mat< N, M, T > & | operator-= (T rhs) |
| Subtracts a scalar from the matrix and assigns the result to the matrix.
|
|
Mat< N, M, T > & | operator/= (T rhs) |
| Divides the matrix by a scalar and assigns the result to the matrix.
|
|
template<typename T>
class easy3d::Mat2< T >
2 by 2 matrix. Extends Mat with 2D-specific functionality and constructors.
- Attention
- : Matrices are stored internally as column - major unless MATRIX_ROW_MAJOR is defined.
- Template Parameters
-
T | The scalar type for vector elements. |
- See also
- Mat.