00001 // This is core/vnl/algo/vnl_generalized_eigensystem.h 00002 #ifndef vnl_generalized_eigensystem_h_ 00003 #define vnl_generalized_eigensystem_h_ 00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE 00005 #pragma interface 00006 #endif 00007 //: 00008 // \file 00009 // \brief Solves the generalized eigenproblem Ax=La 00010 // \author Andrew W. Fitzgibbon, Oxford RRG 00011 // \date 29 Aug 96 00012 // 00013 // \verbatim 00014 // Modifications 00015 // dac (Manchester) 28/03/2001: tidied up documentation 00016 // Feb.2002 - Peter Vanroose - brief doxygen comment placed on single line 00017 // \endverbatim 00018 00019 #include <vnl/vnl_diag_matrix.h> 00020 00021 //: Solves the generalized eigenproblem Ax=Bx 00022 // Solves the generalized eigenproblem of $A x = \lambda B x$, 00023 // with $A$ symmetric and $B$ positive definite. \n 00024 // See Golub and van Loan, Section 8.7. 00025 00026 class vnl_generalized_eigensystem 00027 { 00028 public: 00029 // Public data members because they're unique. 00030 long n; 00031 00032 //: Solves the generalized eigenproblem Ax=Bx 00033 // Solve real generalized eigensystem $A x = \lambda B x$ for 00034 // $\lambda$ and $x$, where $A$ symmetric, $B$ positive definite. 00035 // Initializes storage for the matrix $V = [ x_0 x_1 .. x_n ]$ and 00036 // the vnl_diag_matrix $D = [ \lambda_0 \lambda_1 ... \lambda_n ]$. 00037 // The eigenvalues are sorted into increasing order (of value, not 00038 // absolute value). 00039 // 00040 // Uses vnl_cholesky decomposition $C^\top C = B$, to convert to 00041 // $C^{-\top} A C^{-1} x = \lambda x$ and then uses the 00042 // symmetric eigensystem code. It will print a verbose warning 00043 // if $B$ is not positive definite. 00044 00045 vnl_generalized_eigensystem(const vnl_matrix<double>& A, 00046 const vnl_matrix<double>& B); 00047 00048 //: Public eigenvectors. 00049 // After construction, this contains the matrix of eigenvectors. 00050 vnl_matrix<double> V; 00051 00052 //: Public eigenvalues. 00053 // After construction, this contains the diagonal matrix of eigenvalues, stored as a vector. 00054 vnl_diag_matrix<double> D; 00055 }; 00056 00057 #endif // vnl_generalized_eigensystem_h_