Double precision 2x2 matrix class. More...
#include <cvb/matrix_2d.hpp>
Public Member Functions | |
| Matrix2D () noexcept=default | |
| Default constructor for empty matrix. | |
| template<std::size_t N> | |
| Matrix2D (const double(&list)[N]) noexcept | |
| Construct a 2x2 matrix with an initializer list. | |
| Matrix2D (double a11, double a12, double a21, double a22) noexcept | |
| Construct a 2x2 matrix. | |
| Matrix2D (Angle rotation, double scale=1.0) noexcept | |
| Construct a 2x2 matrix that is a combination of a rotation and scale operation. | |
| Matrix2D (double scale) noexcept | |
| Construct a 2x2 matrix that represents a scaling. | |
| Matrix2D (double scaleX, double scaleY) noexcept | |
| Constructs a 2x2 matrix that represent a scaling with different scaling in x and y directions. | |
| Matrix2D (Cvb::Point2D< double > column1, Cvb::Point2D< double > column2) noexcept | |
| Construct a 2x2 matrix from two column vectors. | |
| const double * | operator[] (int row) const noexcept |
| Index based element access. | |
| double * | operator[] (int row) noexcept |
| Index based element access. | |
| const double & | At (int row, int column) const noexcept |
| Index based element access. | |
| double & | At (int row, int column) noexcept |
| Index based element access. | |
| double | A11 () const noexcept |
| Gets top left matrix element. | |
| void | SetA11 (double a11) noexcept |
| Sets top left matrix element. | |
| double | A12 () const noexcept |
| Gets top right matrix element. | |
| void | SetA12 (double a12) noexcept |
| Sets top right matrix element. | |
| double | A21 () const noexcept |
| Gets bottom left matrix element. | |
| void | SetA21 (double a21) noexcept |
| Sets bottom left matrix element. | |
| double | A22 () const noexcept |
| Gets bottom right matrix element. | |
| void | SetA22 (double a22) noexcept |
| Sets bottom right matrix element. | |
| double | Det () const noexcept |
| Matrix determinant. | |
| void | Invert () |
| Inverts this matrix in-place if possible. | |
| Matrix2D | Inverse () |
| Gets the inverse of this matrix if possible. | |
| bool | operator== (const Matrix2D &matrix) const noexcept |
| Compares to an other matrix. | |
| bool | operator!= (const Matrix2D &matrix) const noexcept |
| Compares to an other matrix. | |
| Matrix2D & | operator+= (const Matrix2D &matrix) noexcept |
| Adds and assigns to this matrix. | |
| Matrix2D & | operator-= (const Matrix2D &matrix) noexcept |
| Subtracts and assigns to this matrix. | |
| Matrix2D & | operator*= (const Matrix2D &matrix) noexcept |
| Multiplies and assigns to this matrix. | |
| Matrix2D & | operator*= (const double &value) noexcept |
| Multiplies and assigns to this matrix. | |
| Matrix2D & | operator/= (const double &value) noexcept |
| Divides each element of this matrix by the given value. | |
Static Public Member Functions | |
| static Matrix2D | Identity () noexcept |
| The identity element. | |
Related Symbols | |
(Note that these are not member symbols.) | |
| Matrix2D | operator+ (const Matrix2D &lhs, const Matrix2D &rhs) |
| Add two matrices. | |
| Matrix2D | operator- (const Matrix2D &lhs, const Matrix2D &rhs) |
| Substract two matrices. | |
| Matrix2D | operator* (const Matrix2D &lhs, const Matrix2D &rhs) |
| Multiply two matrices. | |
| Point2D< double > | operator* (const Matrix2D &lhs, const Point2D< double > &rhs) |
| Multiply matrix with 2D point. | |
| Matrix2D | operator* (const Matrix2D &lhs, const double &rhs) |
| Multiply matrix with scalar. | |
| Matrix2D | operator* (const double &lhs, const Matrix2D &rhs) |
| Multiply scalar with matrix . | |
| Matrix2D | operator/ (const Matrix2D &lhs, const double &rhs) |
| Divide matrix by scalar. | |
Double precision 2x2 matrix class.
|
defaultnoexcept |
Default constructor for empty matrix.
| Does | not throw any exception. |
|
inlinenoexcept |
Construct a 2x2 matrix with an initializer list.
| [in] | list | Containing exactly 4 elements. |
| Any | exception derived from std::exception including CvbException. |
|
inlinenoexcept |
Construct a 2x2 matrix.
| [in] | a11 | Top left matrix element. |
| [in] | a12 | Top right matrix element. |
| [in] | a21 | Bottom left matrix element. |
| [in] | a22 | Bottom right matrix element. |
| Does | not throw any exception. |
Construct a 2x2 matrix that is a combination of a rotation and scale operation.
| [in] | rotation | Rotation angle to create the matrix for. |
| [in] | scale | Scale factor to create the matrix for. |
| Does | not throw any exception. |
|
inlineexplicitnoexcept |
Construct a 2x2 matrix that represents a scaling.
| [in] | scale | Scale factor to create the matrix for. |
| Does | not throw any exception. |
|
inlinenoexcept |
Constructs a 2x2 matrix that represent a scaling with different scaling in x and y directions.
| [in] | scaleX | Scale factor in X direction to create the matrix. |
| [in] | scaleY | Scale factor in Y direction to create the matrix. |
| Does | not throw any exception. |
|
inlinenoexcept |
Construct a 2x2 matrix from two column vectors.
| [in] | column1 | Column vector one. |
| [in] | column2 | Columns vector two. |
| Does | not throw any exception. |
|
inlinenoexcept |
Gets top left matrix element.
| Does | not throw any exception. |
|
inlinenoexcept |
Gets top right matrix element.
| Does | not throw any exception. |
|
inlinenoexcept |
Gets bottom left matrix element.
| Does | not throw any exception. |
|
inlinenoexcept |
Gets bottom right matrix element.
| Does | not throw any exception. |
|
inlinenoexcept |
Index based element access.
| [in] | row | The row to access. |
| [in] | column | The column to access. |
| Does | not throw any exception. |
|
inlinenoexcept |
Index based element access.
| [in] | row | The row to access. |
| [in] | column | The column to access. |
| Does | not throw any exception. |
|
inlinenoexcept |
Matrix determinant.
| Does | not throw any exception. |
|
inlinestaticnoexcept |
The identity element.
| Does | not throw any exception. |
|
inline |
Gets the inverse of this matrix if possible.
| Any | exception derived from std::exception including CvbException. |
Might cause division by zero.
|
inline |
Inverts this matrix in-place if possible.
| Any | exception derived from std::exception including CvbException. |
Might cause division by zero.
|
inlinenoexcept |
Compares to an other matrix.
| [in] | matrix | Other matrix. |
| Does | not throw any exception. |
|
inlinenoexcept |
Multiplies and assigns to this matrix.
| [in] | value | Factor. |
| Does | not throw any exception. |
Multiplies and assigns to this matrix.
| [in] | matrix | Other matrix. |
| Does | not throw any exception. |
Adds and assigns to this matrix.
| [in] | matrix | Other matrix. |
| Does | not throw any exception. |
Subtracts and assigns to this matrix.
| [in] | matrix | Other matrix. |
| Does | not throw any exception. |
|
inlinenoexcept |
Divides each element of this matrix by the given value.
| [in] | value | Divisor. |
| Does | not throw any exception. |
|
inlinenoexcept |
Compares to an other matrix.
| [in] | matrix | Other matrix. |
| Does | not throw any exception. |
|
inlinenoexcept |
Index based element access.
| [in] | row |
| Does | not throw any exception. |
|
inlinenoexcept |
Index based element access.
| [in] | row |
| Does | not throw any exception. |
|
inlinenoexcept |
Sets top left matrix element.
| [in] | a11 | The element. |
| Does | not throw any exception. |
|
inlinenoexcept |
Sets top right matrix element.
| [in] | a12 | The element. |
| Does | not throw any exception. |
|
inlinenoexcept |
Sets bottom left matrix element.
| [in] | a21 | The element. |
| Does | not throw any exception. |
|
inlinenoexcept |
Sets bottom right matrix element.
| [in] | a22 | The element. |
| Does | not throw any exception. |
Multiply scalar with matrix .
| [in] | lhs | Right hand side value. |
| [in] | rhs | Left hand side matrix. |
| Does | not throw any exception. |
Multiply matrix with scalar.
| [in] | lhs | Right hand side matrix. |
| [in] | rhs | Left hand side value. |
| Does | not throw any exception. |
Multiply two matrices.
| [in] | lhs | Right hand side matrix. |
| [in] | rhs | Left hand side matrix. |
| Does | not throw any exception. |
Multiply matrix with 2D point.
| [in] | lhs | Right hand side matrix. |
| [in] | rhs | Left hand side point. |
| Does | not throw any exception. |
Add two matrices.
| [in] | lhs | Right hand side matrix. |
| [in] | rhs | Left hand side matrix. |
| Does | not throw any exception. |
Substract two matrices.
| [in] | lhs | Right hand side matrix. |
| [in] | rhs | Left hand side matrix. |
| Does | not throw any exception. |