|
definie +, -, *, /, +=, -=, *=, /=, etc.
|
| constexpr auto | operator- () const -> Matrix2< T1, T2 > |
| | Negate the matrix.
|
| |
| template<typename U1 , typename U2 > |
| CONSTEXPR14 auto | operator+= (const Matrix2< U1, U2 > &other) -> Matrix2< T1, T2 > & |
| | Add another matrix to this one.
|
| |
| template<typename U1 , typename U2 > |
| CONSTEXPR14 auto | operator-= (const Matrix2< U1, U2 > &other) -> Matrix2< T1, T2 > & |
| | Subtract another matrix from this one.
|
| |
| template<typename R > |
| CONSTEXPR14 auto | operator*= (const R &alpha) -> Matrix2< T1, T2 > & |
| | Multiply.
|
| |
| template<typename R > |
| CONSTEXPR14 auto | operator/= (const R &alpha) -> Matrix2< T1, T2 > & |
| | Divide matrix by a scalar.
|
| |
| template<typename U1 , typename U2 > |
| constexpr auto | mdot (const Vector2< U1, U2 > &other) const -> T1 |
| | Multiply matrix with vector.
|
| |
| constexpr auto | det () const -> double |
| | Calculate the determinant.
|
| |
| template<typename U1 , typename U2 > |
| constexpr auto | operator+ (Matrix2< T1, T2 > x, const Matrix2< U1, U2 > &y) -> Matrix2< T1, T2 > |
| | Add two matrices.
|
| |
| template<typename U1 , typename U2 > |
| constexpr auto | operator- (Matrix2< T1, T2 > x, const Matrix2< U1, U2 > &y) -> Matrix2< T1, T2 > |
| | Subtract two matrices.
|
| |
| template<typename R > |
| constexpr auto | operator* (Matrix2< T1, T2 > x, const R &alpha) -> Matrix2< T1, T2 > |
| | Multiply matrix by a scalar.
|
| |
| template<typename R > |
| constexpr auto | operator* (const R &alpha, Matrix2< T1, T2 > x) -> Matrix2< T1, T2 > |
| | Multiply a scalar by a matrix.
|
| |
| template<typename R > |
| constexpr auto | operator/ (Matrix2< T1, T2 > x, const R &alpha) -> Matrix2< T1, T2 > |
| | Divide matrix by a scalar.
|
| |
template<typename T1, typename T2 = T1>
class ginger::Matrix2< T1, T2 >
Matrix2.
A template class representing a 2x2 matrix with column vectors. The matrix is stored as two column vectors (x and y).
- Template Parameters
-
| T1 | The type of the first column vector |
| T2 | The type of the second column vector (defaults to T1) |
template<typename T1 , typename T2 = T1>
template<typename U1 , typename U2 >
Multiply matrix with vector.
Performs matrix-vector multiplication:
\[
\begin{bmatrix} a & b \\ c & d \end{bmatrix}
\begin{bmatrix} x \\ y \end{bmatrix}
= \begin{bmatrix} ax + by \\ cx + dy \end{bmatrix}
\]
- Template Parameters
-
| U1 | Type of the first component of the vector |
| U2 | Type of the second component of the vector |
- Parameters
-
| [in] | other | The vector to multiply |
- Returns
- T1 The resulting vector (as column vector type)