Go to the documentation of this file.
14 #include <Eigen/Eigenvalues>
15 #include <Eigen/SparseCore>
48 std::cerr <<
"reference eigenvalues: " << eiSymm.
eigenvalues().transpose() <<
"\n"
49 <<
"obtained eigenvalues: " << eiDirect.
eigenvalues().transpose() <<
"\n"
80 RealScalar largerEps = 10*test_precision<RealScalar>();
89 symmA.template triangularView<StrictlyUpper>().setZero();
90 symmC.template triangularView<StrictlyUpper>().setZero();
95 symmB.template triangularView<StrictlyUpper>().setZero();
111 symmB.template selfadjointView<Lower>() * (eiSymmGen.
eigenvectors() * eiSymmGen.
eigenvalues().asDiagonal()), largerEps));
116 VERIFY((symmB.template selfadjointView<Lower>() * (symmC.template selfadjointView<Lower>() * eiSymmGen.
eigenvectors())).isApprox(
122 VERIFY((symmC.template selfadjointView<Lower>() * (symmB.template selfadjointView<Lower>() * eiSymmGen.
eigenvectors())).isApprox(
141 eiSymmUninitialized.
compute(symmA,
false);
172 symmC(0,0) = std::numeric_limits<typename MatrixType::RealScalar>::quiet_NaN();
180 eig.compute(
a.adjoint() *
a);
197 m << 850.961, 51.966, 0,
207 m << 0.11111111111111114658, 0, 0,
208 0, 0.11111111111111109107, 0,
209 0, 0, 0.11111111111111107719;
EIGEN_DEVICE_FUNC SelfAdjointEigenSolver & computeDirect(const MatrixType &matrix, int options=ComputeEigenvectors)
Computes eigendecomposition of given matrix using a closed-form algorithm.
#define VERIFY_IS_MUCH_SMALLER_THAN(a, b)
Tridiagonal decomposition of a selfadjoint matrix.
SubDiagonalReturnType subDiagonal() const
Returns the subdiagonal of the tridiagonal matrix T in the decomposition.
SelfAdjointEigenSolver & computeFromTridiagonal(const RealVectorType &diag, const SubDiagonalType &subdiag, int options=ComputeEigenvectors)
Computes the eigen decomposition from a tridiagonal symmetric matrix.
#define VERIFY_IS_EQUAL(a, b)
void selfadjointeigensolver(const MatrixType &m)
EIGEN_DEVICE_FUNC SelfAdjointEigenSolver & compute(const EigenBase< InputType > &matrix, int options=ComputeEigenvectors)
Computes eigendecomposition of given matrix.
void selfadjointeigensolver_essential_check(const MatrixType &m)
const EIGEN_DEVICE_FUNC RealVectorType & eigenvalues() const
Returns the eigenvalues of given matrix.
HouseholderSequenceType matrixQ() const
Returns the unitary matrix Q in the decomposition.
#define CALL_SUBTEST_9(FUNC)
MatrixTReturnType matrixT() const
Returns an expression of the tridiagonal matrix T in the decomposition.
#define VERIFY_RAISES_ASSERT(a)
Matrix< SCALARA, Dynamic, Dynamic, opt_A > A
EIGEN_DEVICE_FUNC ComputationInfo info() const
Reports whether previous computation was successful.
#define CALL_SUBTEST_4(FUNC)
EIGEN_DECLARE_TEST(eigensolver_selfadjoint)
#define CALL_SUBTEST_3(FUNC)
#define CALL_SUBTEST_1(FUNC)
const EIGEN_DEVICE_FUNC EigenvectorsType & eigenvectors() const
Returns the eigenvectors of given matrix.
void svd_fill_random(MatrixType &m, int Option=0)
#define CALL_SUBTEST_13(FUNC)
Computes eigenvalues and eigenvectors of selfadjoint matrices.
#define CALL_SUBTEST_5(FUNC)
EIGEN_DEVICE_FUNC MatrixType operatorInverseSqrt() const
Computes the inverse square root of the matrix.
SelfAdjointEigenSolver< PlainMatrixType > eig(mat, computeVectors?ComputeEigenvectors:EigenvaluesOnly)
#define CALL_SUBTEST_6(FUNC)
#define CALL_SUBTEST_2(FUNC)
AdjointReturnType adjoint() const
Adjoint (conjugate transpose) of the Householder sequence.
#define VERIFY_IS_UNITARY(a)
#define VERIFY_IS_APPROX(a, b)
NumTraits< Scalar >::Real RealScalar
EIGEN_DEVICE_FUNC MatrixType operatorSqrt() const
Computes the positive-definite square root of the matrix.
DiagonalReturnType diagonal() const
Returns the diagonal of the tridiagonal matrix T in the decomposition.
Computes eigenvalues and eigenvectors of the generalized selfadjoint eigen problem.
#define EIGEN_TEST_MAX_SIZE
#define CALL_SUBTEST_12(FUNC)
The matrix class, also used for vectors and row-vectors.
GeneralizedSelfAdjointEigenSolver & compute(const MatrixType &matA, const MatrixType &matB, int options=ComputeEigenvectors|Ax_lBx)
Computes generalized eigendecomposition of given matrix pencil.
#define CALL_SUBTEST_7(FUNC)
#define CALL_SUBTEST_8(FUNC)
Holds information about the various numeric (i.e. scalar) types allowed by Eigen.
#define TEST_SET_BUT_UNUSED_VARIABLE(X)
#define CALL_SUBTEST(FUNC)
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
gtsam
Author(s):
autogenerated on Sun Dec 22 2024 04:11:30