mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-04-21 17:19:36 +08:00
eigenvalues: documentation fixes
This commit is contained in:
parent
9196b6b659
commit
ab6a044d0d
@ -141,16 +141,14 @@ class GeneralizedSelfAdjointEigenSolver : public SelfAdjointEigenSolver<_MatrixT
|
|||||||
*
|
*
|
||||||
* \returns Reference to \c *this
|
* \returns Reference to \c *this
|
||||||
*
|
*
|
||||||
* If \p options contains Ax_lBx (the default), this function computes eigenvalues
|
* Accoring to \p options, this function computes eigenvalues and (if requested)
|
||||||
* and (if requested) the eigenvectors of the generalized eigenproblem
|
* the eigenvectors of one of the following three generalized eigenproblems:
|
||||||
* \f$ Ax = \lambda B x \f$ with \a matA the selfadjoint
|
* - \c Ax_lBx: \f$ Ax = \lambda B x \f$
|
||||||
* 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:
|
|
||||||
* - \c ABx_lx: \f$ ABx = \lambda x \f$
|
* - \c ABx_lx: \f$ ABx = \lambda x \f$
|
||||||
* - \c BAx_lx: \f$ BAx = \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() function can be used to retrieve
|
||||||
* the eigenvalues. If \p options contains ComputeEigenvectors, then the
|
* the eigenvalues. If \p options contains ComputeEigenvectors, then the
|
||||||
@ -158,17 +156,19 @@ class GeneralizedSelfAdjointEigenSolver : public SelfAdjointEigenSolver<_MatrixT
|
|||||||
* eigenvectors().
|
* eigenvectors().
|
||||||
*
|
*
|
||||||
* The implementation uses LLT to compute the Cholesky decomposition
|
* The implementation uses LLT to compute the Cholesky decomposition
|
||||||
* \f$ B = LL^* \f$ and calls compute(const MatrixType&, bool) to compute
|
* \f$ B = LL^* \f$ and computes the classical eigendecomposition
|
||||||
* the eigendecomposition \f$ L^{-1} A (L^*)^{-1} \f$. This solves the
|
* 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
|
* generalized eigenproblem, because any solution of the generalized
|
||||||
* eigenproblem \f$ Ax = \lambda B x \f$ corresponds to a solution
|
* 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
|
* \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
|
* Example: \include SelfAdjointEigenSolver_compute_MatrixType2.cpp
|
||||||
* Output: \verbinclude SelfAdjointEigenSolver_compute_MatrixType2.out
|
* 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,
|
GeneralizedSelfAdjointEigenSolver& compute(const MatrixType& matA, const MatrixType& matB,
|
||||||
int options = ComputeEigenvectors|Ax_lBx);
|
int options = ComputeEigenvectors|Ax_lBx);
|
||||||
|
@ -68,7 +68,7 @@
|
|||||||
* contains an example of the typical use of this class.
|
* contains an example of the typical use of this class.
|
||||||
*
|
*
|
||||||
* To solve the \em generalized eigenvalue problem \f$ Av = \lambda Bv \f$ and
|
* 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
|
* \sa MatrixBase::eigenvalues(), class EigenSolver, class ComplexEigenSolver
|
||||||
*/
|
*/
|
||||||
|
@ -5,7 +5,7 @@ X = MatrixXd::Random(5,5);
|
|||||||
MatrixXd B = X * X.transpose();
|
MatrixXd B = X * X.transpose();
|
||||||
cout << "and a random postive-definite matrix, B:" << endl << B << endl << endl;
|
cout << "and a random postive-definite matrix, B:" << endl << B << endl << endl;
|
||||||
|
|
||||||
SelfAdjointEigenSolver<MatrixXd> es(A,B);
|
GeneralizedSelfAdjointEigenSolver<MatrixXd> es(A,B);
|
||||||
cout << "The eigenvalues of the pencil (A,B) are:" << endl << es.eigenvalues() << endl;
|
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;
|
cout << "The matrix of eigenvectors, V, is:" << endl << es.eigenvectors() << endl << endl;
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@ MatrixXd A = X * X.transpose();
|
|||||||
X = MatrixXd::Random(5,5);
|
X = MatrixXd::Random(5,5);
|
||||||
MatrixXd B = X * X.transpose();
|
MatrixXd B = X * X.transpose();
|
||||||
|
|
||||||
SelfAdjointEigenSolver<MatrixXd> es(A,B,false);
|
GeneralizedSelfAdjointEigenSolver<MatrixXd> es(A,B,EigenvaluesOnly);
|
||||||
cout << "The eigenvalues of the pencil (A,B) are:" << endl << es.eigenvalues() << endl;
|
cout << "The eigenvalues of the pencil (A,B) are:" << endl << es.eigenvalues() << endl;
|
||||||
es.compute(B,A,false);
|
es.compute(B,A,false);
|
||||||
cout << "The eigenvalues of the pencil (B,A) are:" << endl << es.eigenvalues() << endl;
|
cout << "The eigenvalues of the pencil (B,A) are:" << endl << es.eigenvalues() << endl;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user