diff --git a/Eigen/src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h b/Eigen/src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h index 5d9dbb56e..14ff1a25d 100644 --- a/Eigen/src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h +++ b/Eigen/src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h @@ -141,16 +141,14 @@ class GeneralizedSelfAdjointEigenSolver : public SelfAdjointEigenSolver<_MatrixT * * \returns Reference to \c *this * - * If \p options contains Ax_lBx (the default), this function computes eigenvalues - * and (if requested) the eigenvectors of the generalized eigenproblem - * \f$ Ax = \lambda B x \f$ with \a matA the selfadjoint - * matrix \f$ A \f$ and \a matB the positive definite - * matrix \f$ B \f$. In addition, each eigenvector \f$ x \f$ - * satisfies the property \f$ x^* B x = 1 \f$. - * - * In addition, the two following variants can be solved via \p options: + * Accoring to \p options, this function computes eigenvalues and (if requested) + * the eigenvectors of one of the following three generalized eigenproblems: + * - \c Ax_lBx: \f$ Ax = \lambda B x \f$ * - \c ABx_lx: \f$ ABx = \lambda x \f$ * - \c BAx_lx: \f$ BAx = \lambda x \f$ + * with \a matA the selfadjoint matrix \f$ A \f$ and \a matB the positive definite + * matrix \f$ B \f$. + * In addition, each eigenvector \f$ x \f$ satisfies the property \f$ x^* B x = 1 \f$. * * The eigenvalues() function can be used to retrieve * the eigenvalues. If \p options contains ComputeEigenvectors, then the @@ -158,17 +156,19 @@ class GeneralizedSelfAdjointEigenSolver : public SelfAdjointEigenSolver<_MatrixT * eigenvectors(). * * The implementation uses LLT to compute the Cholesky decomposition - * \f$ B = LL^* \f$ and calls compute(const MatrixType&, bool) to compute - * the eigendecomposition \f$ L^{-1} A (L^*)^{-1} \f$. This solves the + * \f$ B = LL^* \f$ and computes the classical eigendecomposition + * of the selfadjoint matrix \f$ L^{-1} A (L^*)^{-1} \f$ if \p options contains Ax_lBx + * and of \f$ L^{*} A L \f$ otherwise. This solves the * generalized eigenproblem, because any solution of the generalized * eigenproblem \f$ Ax = \lambda B x \f$ corresponds to a solution * \f$ L^{-1} A (L^*)^{-1} (L^* x) = \lambda (L^* x) \f$ of the - * eigenproblem for \f$ L^{-1} A (L^*)^{-1} \f$. + * eigenproblem for \f$ L^{-1} A (L^*)^{-1} \f$. Similar statements + * can be made for the two other variants. * * Example: \include SelfAdjointEigenSolver_compute_MatrixType2.cpp * Output: \verbinclude SelfAdjointEigenSolver_compute_MatrixType2.out * - * \sa SelfAdjointEigenSolver(const MatrixType&, const MatrixType&, int) + * \sa GeneralizedSelfAdjointEigenSolver(const MatrixType&, const MatrixType&, int) */ GeneralizedSelfAdjointEigenSolver& compute(const MatrixType& matA, const MatrixType& matB, int options = ComputeEigenvectors|Ax_lBx); diff --git a/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h b/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h index 789937437..eed56786c 100644 --- a/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h +++ b/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h @@ -68,7 +68,7 @@ * contains an example of the typical use of this class. * * To solve the \em generalized eigenvalue problem \f$ Av = \lambda Bv \f$ and - * the like see the class GeneralizedSelfAdjointEigenSolver. + * the likes, see the class GeneralizedSelfAdjointEigenSolver. * * \sa MatrixBase::eigenvalues(), class EigenSolver, class ComplexEigenSolver */ diff --git a/doc/snippets/SelfAdjointEigenSolver_SelfAdjointEigenSolver_MatrixType2.cpp b/doc/snippets/SelfAdjointEigenSolver_SelfAdjointEigenSolver_MatrixType2.cpp index f05d67da3..bbb821e02 100644 --- a/doc/snippets/SelfAdjointEigenSolver_SelfAdjointEigenSolver_MatrixType2.cpp +++ b/doc/snippets/SelfAdjointEigenSolver_SelfAdjointEigenSolver_MatrixType2.cpp @@ -5,7 +5,7 @@ X = MatrixXd::Random(5,5); MatrixXd B = X * X.transpose(); cout << "and a random postive-definite matrix, B:" << endl << B << endl << endl; -SelfAdjointEigenSolver es(A,B); +GeneralizedSelfAdjointEigenSolver es(A,B); cout << "The eigenvalues of the pencil (A,B) are:" << endl << es.eigenvalues() << endl; cout << "The matrix of eigenvectors, V, is:" << endl << es.eigenvectors() << endl << endl; diff --git a/doc/snippets/SelfAdjointEigenSolver_compute_MatrixType2.cpp b/doc/snippets/SelfAdjointEigenSolver_compute_MatrixType2.cpp index 4b0f11003..07c92a1e4 100644 --- a/doc/snippets/SelfAdjointEigenSolver_compute_MatrixType2.cpp +++ b/doc/snippets/SelfAdjointEigenSolver_compute_MatrixType2.cpp @@ -3,7 +3,7 @@ MatrixXd A = X * X.transpose(); X = MatrixXd::Random(5,5); MatrixXd B = X * X.transpose(); -SelfAdjointEigenSolver es(A,B,false); +GeneralizedSelfAdjointEigenSolver es(A,B,EigenvaluesOnly); cout << "The eigenvalues of the pencil (A,B) are:" << endl << es.eigenvalues() << endl; es.compute(B,A,false); cout << "The eigenvalues of the pencil (B,A) are:" << endl << es.eigenvalues() << endl;