|
|
| Matrix2 () |
| | Empty.
|
| constexpr | Matrix2 (const double &) |
| | Creates a matrix with the same diagonal value.
|
| | Matrix2 (const Vector2 &) |
| | Create a diagonal matrix with diagonal terms set to the vector entries.
|
| | Matrix2 (const Vector2 &, const Vector2 &) |
| | Creates a column vector matrix.
|
| constexpr | Matrix2 (const double &, const double &, const double &, const double &) |
| | Creates a matrix with a set of double values.
|
| | Matrix2 (const double &, const double &, const double &) |
| | Create a symmetric matrix.
|
|
constexpr double & | operator[] (int) |
| | Direct access to the array of the matrix.
|
|
constexpr double | operator[] (int) const |
| | Overloaded.
|
| constexpr double & | operator() (int, int) |
| | Get element (i,j) of the matrix.
|
|
constexpr double | operator() (int, int) const |
| | Overloaded.
|
| Vector2 | C (int) const |
| | Get the i-th column vector of the matrix.
|
|
Matrix2 | operator- () const |
| | Returns the opposite of a matrix -A.
|
| Matrix2 & | operator+= (const Matrix2 &) |
| | Destructive addition operator.
|
| Matrix2 & | operator-= (const Matrix2 &) |
| | Destructive subtraction operator.
|
|
Matrix2 & | operator*= (const Matrix2 &) |
| | Destructive multiplication.
|
|
Matrix2 & | operator*= (const double &) |
| | Destructive multiplication operator.
|
|
Matrix2 & | operator/= (double) |
| | Destructive division operator.
|
| Matrix2 | Scaled (const Matrix2 &) const |
| | Hadamart product, which is the element-wise product.
|
|
Vector2 | operator* (const Vector2 &) const |
| | Right multiply by a vector.
|
| QString | ToGLSL () const |
| | Return a string expression.
|
| Matrix2 | T () const |
| | Transpose the matrix.
|
|
double | Determinant () const |
| | Computes the determinant of the matrix.
|
| Matrix2 | Inverse () const |
| | Computes the inverse of a matrix \( A^{-1} \).
|
|
double | Trace () const |
| | Compute the trace (sum of diagonal terms) of a matrix.
|
|
double | FrobeniusNorm () const |
| | Compute the Frobenius norm of the matrix.
|
|
Quadric | Characteristic () const |
| | Compute the characteristic polynomial.
|
|
double | SpectralNorm () const |
| | Compute the spectral norm of the matrix.
|
| double | InfinityNorm () const |
| | Compute the max-norm of the matrix, i.e. the largest absolute value of its coefficients.
|
| void | EigenSolveSymmetric (double[2], Vector2[2]) const |
| | Compute the eigen values of the matrix.
|
|
Vector2 | Eigen () const |
| | Compute the eigen values.
|
This class implements \( 2^2 \) matrix.
Operators have been overloaded to behave as expected. Thus it is possible to write:
static constexpr double Pi
.
Definition mathematics.h:168
static Matrix2 Rotation(const double &)
Create a rotation matrix.
Definition matrix2.cpp:77
Matrix2()
Empty.
Definition matrix.h:17
Vectors in two dimensions.
Definition evector.h:632
Vector2()
Empty.
Definition evector.h:637
| Matrix2::Matrix2 |
( |
const double & | c0r0, |
|
|
const double & | c0r1, |
|
|
const double & | c1r0, |
|
|
const double & | c1r1 ) |
|
inlineexplicitconstexpr |
Creates a matrix with a set of double values.
The coefficients are given column by column: the parameter cJrI is the coefficient of the column J and of the row I, i.e., the element (I,J) of the matrix, which is stored at the index I+2J. The matrix whose rows are (a,b) and (c,d) is therefore Matrix2(a, c, b, d).
- Parameters
-
| c0r0,c0r1 | Coefficients of the first column. |
| c1r0,c1r1 | Coefficients of the second column. |
| double Matrix2::InfinityNorm |
( |
| ) |
const |
Compute the max-norm of the matrix, i.e. the largest absolute value of its coefficients.
\[ \|A\|_{\max} = \max_{i,j} |a_{ij}| \]
Despite its name, this is not the matrix norm induced by the infinity norm of vectors, which is the largest sum of the absolute values of a row,
\[ \|A\|_{\infty} = \max_i \sum_j |a_{ij}| \]
For a \( 2 \times 2 \) matrix, \( \|A\|_{\max} \le \|A\|_{\infty} \le 2\,\|A\|_{\max} \). The name is kept for compatibility, the function is suited to tolerance tests on the coefficients, but should not be used where the induced norm is required (bounds of the form \( \|Av\|_\infty \le \|A\|_\infty \|v\|_\infty \)).
- See also
- FrobeniusNorm(), SpectralNorm()