11 #ifndef EIGEN_GENERALIZEDSELFADJOINTEIGENSOLVER_H 12 #define EIGEN_GENERALIZEDSELFADJOINTEIGENSOLVER_H 14 #include "./Tridiagonalization.h" 17 #include "./InternalHeaderCheck.h" 50 template <
typename MatrixType_>
55 typedef MatrixType_ MatrixType;
108 :
Base(matA.cols()) {
158 template <
typename MatrixType>
160 const MatrixType& matA,
const MatrixType& matB,
int options) {
161 eigen_assert(matA.cols() == matA.rows() && matB.rows() == matA.rows() && matB.cols() == matB.rows());
162 eigen_assert((options & ~(EigVecMask | GenEigMask)) == 0 && (options & EigVecMask) != EigVecMask &&
163 ((options & GenEigMask) == 0 || (options & GenEigMask) ==
Ax_lBx || (options & GenEigMask) ==
ABx_lx ||
164 (options & GenEigMask) ==
BAx_lx) &&
165 "invalid option parameter");
167 bool computeEigVecs = ((options & EigVecMask) == 0) || ((options & EigVecMask) ==
ComputeEigenvectors);
172 int type = (options & GenEigMask);
173 if (type == 0) type =
Ax_lBx;
177 MatrixType matC = matA.template selfadjointView<Lower>();
178 cholB.
matrixL().template solveInPlace<OnTheLeft>(matC);
179 cholB.
matrixU().template solveInPlace<OnTheRight>(matC);
184 if (computeEigVecs) cholB.
matrixU().solveInPlace(Base::m_eivec);
185 }
else if (type ==
ABx_lx) {
187 MatrixType matC = matA.template selfadjointView<Lower>();
194 if (computeEigVecs) cholB.
matrixU().solveInPlace(Base::m_eivec);
195 }
else if (type ==
BAx_lx) {
197 MatrixType matC = matA.template selfadjointView<Lower>();
204 if (computeEigVecs) Base::m_eivec = cholB.
matrixL() * Base::m_eivec;
212 #endif // EIGEN_GENERALIZEDSELFADJOINTEIGENSOLVER_H Definition: Constants.h:398
Computes eigenvalues and eigenvectors of selfadjoint matrices.
Definition: SelfAdjointEigenSolver.h:82
Namespace containing all symbols from the Eigen library.
Definition: B01_Experimental.dox:1
GeneralizedSelfAdjointEigenSolver()
Default constructor for fixed-size matrices.
Definition: GeneralizedSelfAdjointEigenSolver.h:64
Definition: Constants.h:409
Definition: Constants.h:412
Definition: Constants.h:406
Definition: Constants.h:401
Eigen::Index Index
Definition: SelfAdjointEigenSolver.h:94
Standard Cholesky decomposition (LL^T) of a matrix and associated features.
Definition: LLT.h:70
Computes eigenvalues and eigenvectors of the generalized selfadjoint eigen problem.
Definition: GeneralizedSelfAdjointEigenSolver.h:51
Traits::MatrixU matrixU() const
Definition: LLT.h:117
GeneralizedSelfAdjointEigenSolver(const MatrixType &matA, const MatrixType &matB, int options=ComputeEigenvectors|Ax_lBx)
Constructor; computes generalized eigendecomposition of given matrix pencil.
Definition: GeneralizedSelfAdjointEigenSolver.h:106
GeneralizedSelfAdjointEigenSolver & compute(const MatrixType &matA, const MatrixType &matB, int options=ComputeEigenvectors|Ax_lBx)
Computes generalized eigendecomposition of given matrix pencil.
Definition: GeneralizedSelfAdjointEigenSolver.h:159
GeneralizedSelfAdjointEigenSolver(Index size)
Constructor, pre-allocates memory for dynamic-size matrices.
Definition: GeneralizedSelfAdjointEigenSolver.h:78
Traits::MatrixL matrixL() const
Definition: LLT.h:123