|
using | Real = double |
| Real scalar type used by requests within this interface.
|
|
using | Complex = std::complex< double > |
| Complex scalar type used by requests within this interface.
|
|
|
SolverResult< Real, 3 > | Solver3x3RealSymmetric (const SquareMatrix< Real, 3 > &matrix) |
|
SolverResult< Real, 3 > | NonIterativeSymmetricEigensolver3x3 (double a00, double a01, double a02, double a11, double a12, double a22) |
|
VectorVariable | CrossProduct (const VectorVariable &lhs, const VectorVariable &rhs) |
|
void | ComputeOrthogonalComplement (const VectorVariable &vecW, VectorVariable &vecU, VectorVariable &vecV) |
|
VectorVariable | ComputeEigenvector0 (double a00, double a01, double a02, double a11, double a12, double a22, double val) |
|
VectorVariable | ComputeEigenvector1 (double a00, double a01, double a02, double a11, double a12, double a22, double val, const VectorVariable &vec) |
|
VectorVariable | ComputeEigenvector2 (const VectorVariable &vec0, const VectorVariable &vec1) |
|
Namespace for methods for finding eigenvalues and unit-length eigenvectors of matrices. The 3x3 symmetric eigensolver algorithm was adapted from A Robust Eigensolver for 3x3 Symmetric Matrices by Eberly.
◆ SolverOutcome
Used when returning the solver result to indicate if the solver was successful or to indicate failure reasons.
Enumerator |
---|
Invalid | Default value to which fields of this type should be initialized.
|
Success | The solver successfully found the eigenvalues and vectors.
|
Failure | The solver failed for unspecified reasons.
|
FailureInvalidInput | The solver failed because the input matrix was not valid.
|
◆ ComputeEigenvector0()
VectorVariable NumericalMethods::Eigenanalysis::ComputeEigenvector0 |
( |
double |
a00, |
|
|
double |
a01, |
|
|
double |
a02, |
|
|
double |
a11, |
|
|
double |
a12, |
|
|
double |
a22, |
|
|
double |
val |
|
) |
| |
Given elements of a symmetric 3x3 matrix and one of its eigenvalues, computes the corresponding eigenvector. For numerical stability, this function should only be used to find the eigenvector corresponding to eigenvalues that are unique and numerically not close to other eigenvalues.
- Parameters
-
a<ij> | The element of the matrix in row i, column j. |
val | One of the eigenvalues of the matrix. |
- Returns
- The corresponding eigenvector.
◆ ComputeEigenvector1()
VectorVariable NumericalMethods::Eigenanalysis::ComputeEigenvector1 |
( |
double |
a00, |
|
|
double |
a01, |
|
|
double |
a02, |
|
|
double |
a11, |
|
|
double |
a12, |
|
|
double |
a22, |
|
|
double |
val, |
|
|
const VectorVariable & |
vec |
|
) |
| |
Given elements of a symmetric 3x3 matrix, one of its eigenvalues and an unrelated eigenvector, computes the eigenvector corresponding to the eigenvalue. This algorithm is numerically stable even if the eigenvalue is repeated.
- Parameters
-
a<ij> | The element of the matrix in row i, column j. |
val | The eigenvalue whose corresponding eigenvector is to be found. |
vec | The unrelated eigenvector that is already known. |
- Returns
- The eigenvector corresponding to the given eigenvalue.
◆ ComputeEigenvector2()
- Parameters
-
vec0 | The first of the already known eigenvectors. |
vec1 | The second of the already known eigenvectors. |
- Returns
- The computed eigenvector.
◆ ComputeOrthogonalComplement()
Robustly computes a right-handed orthonormal basis containing a given unit-length 3D input vector.
- Parameters
-
vecW[in] | A 3D input vector which must be of unit length. |
vecU[out] | The first of the computed unit-length orthogonal vectors. |
vecV[out] | The second of the computed unit-length orthogonal vectors. |
- Returns
- {vecU, vecV, vecW} will be a right-handed orthogonal set.
◆ CrossProduct()
Compute the cross product between two 3D vectors.
- Parameters
-
lhs | The left-hand side vector. |
rhs | The right-hand side vector. |
- Returns
- The 3D vector equal to the cross product if both input vectors are 3-dimensional.
◆ NonIterativeSymmetricEigensolver3x3()
SolverResult<Real, 3> NumericalMethods::Eigenanalysis::NonIterativeSymmetricEigensolver3x3 |
( |
double |
a00, |
|
|
double |
a01, |
|
|
double |
a02, |
|
|
double |
a11, |
|
|
double |
a12, |
|
|
double |
a22 |
|
) |
| |
Finds the eigenvalues and vectors of the symmetric matrix whose unique elements are given (see Eberly).
- Parameters
-
a<ij> | The element of the matrix in row i, column j. |
- Returns
- Orthonormal eigenbasis of the matrix and the corresponding eigenvalues.
◆ Solver3x3RealSymmetric()
Compute the eigenvalues and a corresponding eigenbasis for a real symmetric 3x3 matrix. The eigenvalues in this case are guaranteed to be real and the eigenbasis returned is guaranteed to be right-handed and orthonormal (within numerical precision).
- Parameters
-
matrix | The input matrix which must be real and symmetric. |
- Returns
- An instance of SolverResult. The SolverResult::m_outcome will be set to SolverOutcome::FailureInvalidInput if the given matrix is not real and symmetric. Otherwise, SolverResult::m_eigenpairs will contain an orthonormal basis.