#include <MRSymMatrix2.h>
Public Types | |
using | ValueType = T |
Public Member Functions | |
constexpr | SymMatrix2 () noexcept=default |
template<typename U > | |
constexpr | SymMatrix2 (const SymMatrix2< U > &m) |
constexpr T | trace () const noexcept |
computes trace of the matrix | |
constexpr T | normSq () const noexcept |
computes the squared norm of the matrix, which is equal to the sum of 4 squared elements | |
constexpr T | det () const noexcept |
computes determinant of the matrix | |
constexpr SymMatrix2< T > | inverse () const noexcept |
computes inverse matrix | |
constexpr SymMatrix2< T > | inverse (T det) const noexcept |
computes inverse matrix given determinant of this | |
SymMatrix2 & | operator+= (const SymMatrix2< T > &b) |
SymMatrix2 & | operator-= (const SymMatrix2< T > &b) |
SymMatrix2 & | operator*= (T b) |
SymMatrix2 & | operator/= (T b) |
Vector2< T > | eigens (Matrix2< T > *eigenvectors=nullptr) const |
Vector2< T > | eigenvector (T eigenvalue) const |
computes not-unit eigenvector corresponding to a not-repeating eigenvalue | |
Vector2< T > | maxEigenvector () const |
computes not-unit eigenvector corresponding to maximum eigenvalue | |
SymMatrix2< T > | pseudoinverse (T tol=std::numeric_limits< T >::epsilon(), int *rank=nullptr, Vector2< T > *space=nullptr) const |
Static Public Member Functions | |
static constexpr SymMatrix2 | identity () noexcept |
static constexpr SymMatrix2 | diagonal (T diagVal) noexcept |
Public Attributes | |
T | xx = 0 |
zero matrix by default | |
T | xy = 0 |
T | yy = 0 |
Related Symbols | |
(Note that these are not member symbols.) | |
template<typename T > | |
Vector2< T > | operator* (const SymMatrix2< T > &a, const Vector2< T > &b) |
x = a * b | |
template<typename T > | |
SymMatrix2< T > | outerSquare (const Vector2< T > &a) |
x = a * a^T | |
template<typename T > | |
SymMatrix2< T > | outerSquare (T k, const Vector2< T > &a) |
x = k * a * a^T | |
symmetric 2x2 matrix
using MR::SymMatrix2< T >::ValueType = T |
|
constexprdefaultnoexcept |
|
inlineexplicitconstexpr |
|
constexprnoexcept |
computes determinant of the matrix
|
inlinestaticconstexprnoexcept |
Vector2< T > MR::SymMatrix2< T >::eigens | ( | Matrix2< T > * | eigenvectors = nullptr | ) | const |
returns eigenvalues of the matrix in ascending order (diagonal matrix L), and optionally returns corresponding unit eigenvectors in the rows of orthogonal matrix V, M*V^T = V^T*L; M = V^T*L*V
Vector2< T > MR::SymMatrix2< T >::eigenvector | ( | T | eigenvalue | ) | const |
computes not-unit eigenvector corresponding to a not-repeating eigenvalue
|
inlinestaticconstexprnoexcept |
|
inlineconstexprnoexcept |
computes inverse matrix
|
constexprnoexcept |
computes inverse matrix given determinant of this
Vector2< T > MR::SymMatrix2< T >::maxEigenvector | ( | ) | const |
computes not-unit eigenvector corresponding to maximum eigenvalue
|
inlineconstexprnoexcept |
computes the squared norm of the matrix, which is equal to the sum of 4 squared elements
|
inline |
|
inline |
|
inline |
|
inline |
SymMatrix2< T > MR::SymMatrix2< T >::pseudoinverse | ( | T | tol = std::numeric_limits< T >::epsilon(), |
int * | rank = nullptr, | ||
Vector2< T > * | space = nullptr ) const |
for not-degenerate matrix returns just inverse matrix, otherwise returns degenerate matrix, which performs inversion on not-kernel subspace;
tol | relative epsilon-tolerance for too small number detection |
rank | optional output for this matrix rank according to given tolerance |
space | rank=1: unit direction of solution line, rank=2: zero vector |
|
inlineconstexprnoexcept |
computes trace of the matrix
|
related |
x = a * b
|
related |
x = a * a^T
|
related |
x = k * a * a^T
T MR::SymMatrix2< T >::xx = 0 |
zero matrix by default
T MR::SymMatrix2< T >::xy = 0 |
T MR::SymMatrix2< T >::yy = 0 |