rename the EigenSolver module to Eigenvalues

This commit is contained in:
Gael Guennebaud 2009-09-04 09:23:38 +02:00
parent 7f5256f628
commit 68b28f7bfb
19 changed files with 111 additions and 103 deletions

View File

@ -1,4 +1,4 @@
set(Eigen_HEADERS Core LU Cholesky QR Geometry Sparse Array SVD LeastSquares QtAlignedMalloc StdVector Householder Jacobi EigenSolver) set(Eigen_HEADERS Core LU Cholesky QR Geometry Sparse Array SVD LeastSquares QtAlignedMalloc StdVector Householder Jacobi Eigenvalues)
if(EIGEN_BUILD_LIB) if(EIGEN_BUILD_LIB)
set(Eigen_SRCS set(Eigen_SRCS

View File

@ -1,74 +0,0 @@
#ifndef EIGEN_EIGEN_SOLVER_MODULE_H
#define EIGEN_EIGEN_SOLVER_MODULE_H
#include "Core"
#include "src/Core/util/DisableMSVCWarnings.h"
#include "Cholesky"
#include "Jacobi"
#include "Householder"
// Note that EIGEN_HIDE_HEAVY_CODE has to be defined per module
#if (defined EIGEN_EXTERN_INSTANTIATIONS) && (EIGEN_EXTERN_INSTANTIATIONS>=2)
#ifndef EIGEN_HIDE_HEAVY_CODE
#define EIGEN_HIDE_HEAVY_CODE
#endif
#elif defined EIGEN_HIDE_HEAVY_CODE
#undef EIGEN_HIDE_HEAVY_CODE
#endif
namespace Eigen {
/** \defgroup EigenSolver_Module Eigen Solver module
*
* \nonstableyet
*
* This module mainly provides various eigen value solvers.
* This module also provides some MatrixBase methods, including:
* - MatrixBase::eigenvalues(),
* - MatrixBase::operatorNorm()
*
* \code
* #include <Eigen/EigenSolver>
* \endcode
*/
#include "src/EigenSolver/Tridiagonalization.h"
#include "src/EigenSolver/EigenSolver.h"
#include "src/EigenSolver/SelfAdjointEigenSolver.h"
#include "src/EigenSolver/HessenbergDecomposition.h"
#include "src/EigenSolver/ComplexSchur.h"
#include "src/EigenSolver/ComplexEigenSolver.h"
// declare all classes for a given matrix type
#define EIGEN_EIGEN_SOLVER_MODULE_INSTANTIATE_TYPE(MATRIXTYPE,PREFIX) \
PREFIX template class Tridiagonalization<MATRIXTYPE>; \
PREFIX template class HessenbergDecomposition<MATRIXTYPE>; \
PREFIX template class SelfAdjointEigenSolver<MATRIXTYPE>
// removed because it does not support complex yet
// PREFIX template class EigenSolver<MATRIXTYPE>
// declare all class for all types
#define EIGEN_EIGEN_SOLVER_MODULE_INSTANTIATE(PREFIX) \
EIGEN_EIGEN_SOLVER_MODULE_INSTANTIATE_TYPE(Matrix2f,PREFIX); \
EIGEN_EIGEN_SOLVER_MODULE_INSTANTIATE_TYPE(Matrix2d,PREFIX); \
EIGEN_EIGEN_SOLVER_MODULE_INSTANTIATE_TYPE(Matrix3f,PREFIX); \
EIGEN_EIGEN_SOLVER_MODULE_INSTANTIATE_TYPE(Matrix3d,PREFIX); \
EIGEN_EIGEN_SOLVER_MODULE_INSTANTIATE_TYPE(Matrix4f,PREFIX); \
EIGEN_EIGEN_SOLVER_MODULE_INSTANTIATE_TYPE(Matrix4d,PREFIX); \
EIGEN_EIGEN_SOLVER_MODULE_INSTANTIATE_TYPE(MatrixXf,PREFIX); \
EIGEN_EIGEN_SOLVER_MODULE_INSTANTIATE_TYPE(MatrixXd,PREFIX); \
EIGEN_EIGEN_SOLVER_MODULE_INSTANTIATE_TYPE(MatrixXcf,PREFIX); \
EIGEN_EIGEN_SOLVER_MODULE_INSTANTIATE_TYPE(MatrixXcd,PREFIX)
#ifdef EIGEN_EXTERN_INSTANTIATIONS
EIGEN_EIGEN_SOLVER_MODULE_INSTANTIATE(extern);
#endif // EIGEN_EXTERN_INSTANTIATIONS
} // namespace Eigen
#include "src/Core/util/EnableMSVCWarnings.h"
#endif // EIGEN_EIGEN_SOLVER_MODULE_H

74
Eigen/Eigenvalues Normal file
View File

@ -0,0 +1,74 @@
#ifndef EIGEN_EIGENVALUES_MODULE_H
#define EIGEN_EIGENVALUES_MODULE_H
#include "Core"
#include "src/Core/util/DisableMSVCWarnings.h"
#include "Cholesky"
#include "Jacobi"
#include "Householder"
// Note that EIGEN_HIDE_HEAVY_CODE has to be defined per module
#if (defined EIGEN_EXTERN_INSTANTIATIONS) && (EIGEN_EXTERN_INSTANTIATIONS>=2)
#ifndef EIGEN_HIDE_HEAVY_CODE
#define EIGEN_HIDE_HEAVY_CODE
#endif
#elif defined EIGEN_HIDE_HEAVY_CODE
#undef EIGEN_HIDE_HEAVY_CODE
#endif
namespace Eigen {
/** \defgroup Eigenvalues_Module Eigenvalues module
*
* \nonstableyet
*
* This module mainly provides various eigenvalue solvers.
* This module also provides some MatrixBase methods, including:
* - MatrixBase::eigenvalues(),
* - MatrixBase::operatorNorm()
*
* \code
* #include <Eigen/Eigenvalues>
* \endcode
*/
#include "src/Eigenvalues/Tridiagonalization.h"
#include "src/Eigenvalues/EigenSolver.h"
#include "src/Eigenvalues/SelfAdjointEigenSolver.h"
#include "src/Eigenvalues/HessenbergDecomposition.h"
#include "src/Eigenvalues/ComplexSchur.h"
#include "src/Eigenvalues/ComplexEigenSolver.h"
// declare all classes for a given matrix type
#define EIGEN_EIGENVALUES_MODULE_INSTANTIATE_TYPE(MATRIXTYPE,PREFIX) \
PREFIX template class Tridiagonalization<MATRIXTYPE>; \
PREFIX template class HessenbergDecomposition<MATRIXTYPE>; \
PREFIX template class SelfAdjointEigenSolver<MATRIXTYPE>
// removed because it does not support complex yet
// PREFIX template class EigenSolver<MATRIXTYPE>
// declare all class for all types
#define EIGEN_EIGENVALUES_MODULE_INSTANTIATE(PREFIX) \
EIGEN_EIGENVALUES_MODULE_INSTANTIATE_TYPE(Matrix2f,PREFIX); \
EIGEN_EIGENVALUES_MODULE_INSTANTIATE_TYPE(Matrix2d,PREFIX); \
EIGEN_EIGENVALUES_MODULE_INSTANTIATE_TYPE(Matrix3f,PREFIX); \
EIGEN_EIGENVALUES_MODULE_INSTANTIATE_TYPE(Matrix3d,PREFIX); \
EIGEN_EIGENVALUES_MODULE_INSTANTIATE_TYPE(Matrix4f,PREFIX); \
EIGEN_EIGENVALUES_MODULE_INSTANTIATE_TYPE(Matrix4d,PREFIX); \
EIGEN_EIGENVALUES_MODULE_INSTANTIATE_TYPE(MatrixXf,PREFIX); \
EIGEN_EIGENVALUES_MODULE_INSTANTIATE_TYPE(MatrixXd,PREFIX); \
EIGEN_EIGENVALUES_MODULE_INSTANTIATE_TYPE(MatrixXcf,PREFIX); \
EIGEN_EIGENVALUES_MODULE_INSTANTIATE_TYPE(MatrixXcd,PREFIX)
#ifdef EIGEN_EXTERN_INSTANTIATIONS
EIGEN_EIGENVALUES_MODULE_INSTANTIATE(extern);
#endif // EIGEN_EXTERN_INSTANTIATIONS
} // namespace Eigen
#include "src/Core/util/EnableMSVCWarnings.h"
#endif // EIGEN_EIGENVALUES_MODULE_H

View File

@ -5,7 +5,7 @@
#include "src/Core/util/DisableMSVCWarnings.h" #include "src/Core/util/DisableMSVCWarnings.h"
#include "EigenSolver" #include "Eigenvalues"
#include "Geometry" #include "Geometry"
namespace Eigen { namespace Eigen {

View File

@ -62,7 +62,7 @@ namespace Eigen {
#include "src/Core/util/EnableMSVCWarnings.h" #include "src/Core/util/EnableMSVCWarnings.h"
// FIXME for compatibility we include EigenSolver here: // FIXME for compatibility we include Eigenvalues here:
#include "EigenSolver" #include "Eigenvalues"
#endif // EIGEN_QR_MODULE_H #endif // EIGEN_QR_MODULE_H

View File

@ -9,4 +9,4 @@ ADD_SUBDIRECTORY(LeastSquares)
ADD_SUBDIRECTORY(Sparse) ADD_SUBDIRECTORY(Sparse)
ADD_SUBDIRECTORY(Jacobi) ADD_SUBDIRECTORY(Jacobi)
ADD_SUBDIRECTORY(Householder) ADD_SUBDIRECTORY(Householder)
ADD_SUBDIRECTORY(EigenSolver) ADD_SUBDIRECTORY(Eigenvalues)

View File

@ -1,6 +0,0 @@
FILE(GLOB Eigen_EIGENSOLVER_SRCS "*.h")
INSTALL(FILES
${Eigen_EIGENSOLVER_SRCS}
DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/EigenSolver COMPONENT Devel
)

View File

@ -0,0 +1,6 @@
FILE(GLOB Eigen_EIGENVALUES_SRCS "*.h")
INSTALL(FILES
${Eigen_EIGENVALUES_SRCS}
DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/Eigenvalues COMPONENT Devel
)

View File

@ -26,8 +26,17 @@
#ifndef EIGEN_COMPLEX_EIGEN_SOLVER_H #ifndef EIGEN_COMPLEX_EIGEN_SOLVER_H
#define EIGEN_COMPLEX_EIGEN_SOLVER_H #define EIGEN_COMPLEX_EIGEN_SOLVER_H
#define MAXITER 30 /** \eigenvalues_module \ingroup Eigenvalues_Module
* \nonstableyet
*
* \class ComplexEigenSolver
*
* \brief Eigen values/vectors solver for general complex matrices
*
* \param MatrixType the type of the matrix of which we are computing the eigen decomposition
*
* \sa class EigenSolver, class SelfAdjointEigenSolver
*/
template<typename _MatrixType> class ComplexEigenSolver template<typename _MatrixType> class ComplexEigenSolver
{ {
public: public:

View File

@ -26,9 +26,8 @@
#ifndef EIGEN_COMPLEX_SCHUR_H #ifndef EIGEN_COMPLEX_SCHUR_H
#define EIGEN_COMPLEX_SCHUR_H #define EIGEN_COMPLEX_SCHUR_H
#define MAXITER 30 /** \eigenvalues_module \ingroup Eigenvalues_Module
* \nonstableyet
/** \ingroup QR
* *
* \class ComplexShur * \class ComplexShur
* *
@ -155,7 +154,7 @@ void ComplexSchur<MatrixType>::compute(const MatrixType& matrix)
if(iu==0) break; if(iu==0) break;
iter++; iter++;
if(iter >= MAXITER) if(iter >= 30)
{ {
// FIXME : what to do when iter==MAXITER ?? // FIXME : what to do when iter==MAXITER ??
std::cerr << "MAXITER" << std::endl; std::cerr << "MAXITER" << std::endl;

View File

@ -25,7 +25,7 @@
#ifndef EIGEN_EIGENSOLVER_H #ifndef EIGEN_EIGENSOLVER_H
#define EIGEN_EIGENSOLVER_H #define EIGEN_EIGENSOLVER_H
/** \ingroup EigenSolver_Module /** \eigenvalues_module \ingroup Eigenvalues_Module
* \nonstableyet * \nonstableyet
* *
* \class EigenSolver * \class EigenSolver

View File

@ -25,7 +25,7 @@
#ifndef EIGEN_HESSENBERGDECOMPOSITION_H #ifndef EIGEN_HESSENBERGDECOMPOSITION_H
#define EIGEN_HESSENBERGDECOMPOSITION_H #define EIGEN_HESSENBERGDECOMPOSITION_H
/** \ingroup EigenSolver_Module /** \eigenvalues_module \ingroup Eigenvalues_Module
* \nonstableyet * \nonstableyet
* *
* \class HessenbergDecomposition * \class HessenbergDecomposition

View File

@ -25,7 +25,7 @@
#ifndef EIGEN_SELFADJOINTEIGENSOLVER_H #ifndef EIGEN_SELFADJOINTEIGENSOLVER_H
#define EIGEN_SELFADJOINTEIGENSOLVER_H #define EIGEN_SELFADJOINTEIGENSOLVER_H
/** \eigensolver_module \ingroup EigenSolver_Module /** \eigenvalues_module \ingroup Eigenvalues_Module
* \nonstableyet * \nonstableyet
* *
* \class SelfAdjointEigenSolver * \class SelfAdjointEigenSolver
@ -137,7 +137,7 @@ template<typename _MatrixType> class SelfAdjointEigenSolver
/** \internal /** \internal
* *
* \eigensolver_module * \eigenvalues_module \ingroup Eigenvalues_Module
* *
* Performs a QR step on a tridiagonal symmetric matrix represented as a * Performs a QR step on a tridiagonal symmetric matrix represented as a
* pair of two vectors \a diag and \a subdiag. * pair of two vectors \a diag and \a subdiag.
@ -266,7 +266,7 @@ compute(const MatrixType& matA, const MatrixType& matB, bool computeEigenvectors
#endif // EIGEN_HIDE_HEAVY_CODE #endif // EIGEN_HIDE_HEAVY_CODE
/** \eigensolver_module /** \eigenvalues_module
* *
* \returns a vector listing the eigenvalues of this matrix. * \returns a vector listing the eigenvalues of this matrix.
*/ */
@ -307,7 +307,7 @@ template<typename Derived> struct ei_operatorNorm_selector<Derived, false>
} }
}; };
/** \eigensolver_module /** \eigenvalues_module
* *
* \returns the matrix norm of this matrix. * \returns the matrix norm of this matrix.
*/ */

View File

@ -25,7 +25,7 @@
#ifndef EIGEN_TRIDIAGONALIZATION_H #ifndef EIGEN_TRIDIAGONALIZATION_H
#define EIGEN_TRIDIAGONALIZATION_H #define EIGEN_TRIDIAGONALIZATION_H
/** \ingroup EigenSolver_Module /** \eigenvalues_module \ingroup Eigenvalues_Module
* \nonstableyet * \nonstableyet
* *
* \class Tridiagonalization * \class Tridiagonalization

View File

@ -212,7 +212,7 @@ ALIASES = "only_for_vectors=This is only for vectors (either row-
"svd_module=This is defined in the %SVD module. \code #include <Eigen/SVD> \endcode" \ "svd_module=This is defined in the %SVD module. \code #include <Eigen/SVD> \endcode" \
"geometry_module=This is defined in the %Geometry module. \code #include <Eigen/Geometry> \endcode" \ "geometry_module=This is defined in the %Geometry module. \code #include <Eigen/Geometry> \endcode" \
"leastsquares_module=This is defined in the %LeastSquares module. \code #include <Eigen/LeastSquares> \endcode" \ "leastsquares_module=This is defined in the %LeastSquares module. \code #include <Eigen/LeastSquares> \endcode" \
"eigensolver_module=This is defined in the %EigenSolver module. \code #include <Eigen/EigenSolver> \endcode" \ "eigenvalues_module=This is defined in the %Eigenvalues module. \code #include <Eigen/Eigenvalues> \endcode" \
"label=\bug" \ "label=\bug" \
"redstar=<a href='#warningarraymodule' style='color:red;text-decoration: none;'>*</a>" \ "redstar=<a href='#warningarraymodule' style='color:red;text-decoration: none;'>*</a>" \
"nonstableyet=\warning This is not considered to be part of the stable public API yet. Changes may happen in future releases. See \ref Experimental \"Experimental parts of Eigen\"" "nonstableyet=\warning This is not considered to be part of the stable public API yet. Changes may happen in future releases. See \ref Experimental \"Experimental parts of Eigen\""

View File

@ -23,7 +23,7 @@
// Eigen. If not, see <http://www.gnu.org/licenses/>. // Eigen. If not, see <http://www.gnu.org/licenses/>.
#include "main.h" #include "main.h"
#include <Eigen/EigenSolver> #include <Eigen/Eigenvalues>
#include <Eigen/LU> #include <Eigen/LU>
template<typename MatrixType> void eigensolver(const MatrixType& m) template<typename MatrixType> void eigensolver(const MatrixType& m)

View File

@ -23,7 +23,7 @@
// Eigen. If not, see <http://www.gnu.org/licenses/>. // Eigen. If not, see <http://www.gnu.org/licenses/>.
#include "main.h" #include "main.h"
#include <Eigen/EigenSolver> #include <Eigen/Eigenvalues>
#ifdef HAS_GSL #ifdef HAS_GSL
#include "gsl_helper.h" #include "gsl_helper.h"

View File

@ -23,7 +23,7 @@
// Eigen. If not, see <http://www.gnu.org/licenses/>. // Eigen. If not, see <http://www.gnu.org/licenses/>.
#include "main.h" #include "main.h"
#include <Eigen/EigenSolver> #include <Eigen/Eigenvalues>
#ifdef HAS_GSL #ifdef HAS_GSL
#include "gsl_helper.h" #include "gsl_helper.h"

View File

@ -95,7 +95,7 @@ void mixingtypes_large(int size)
VERIFY_RAISES_ASSERT(mf*vcf); VERIFY_RAISES_ASSERT(mf*vcf);
VERIFY_RAISES_ASSERT(mcf*vf); VERIFY_RAISES_ASSERT(mcf*vf);
VERIFY_RAISES_ASSERT(mcf *= mf); VERIFY_RAISES_ASSERT(mcf *= mf);
// VERIFY_RAISES_ASSERT(vcd = md*vcd); // does not even compile // VERIFY_RAISES_ASSERT(vcd = md*vcd); // does not even compile (cannot convert complex to double)
VERIFY_RAISES_ASSERT(vcf = mcf*vf); VERIFY_RAISES_ASSERT(vcf = mcf*vf);
VERIFY_RAISES_ASSERT(mf*md); VERIFY_RAISES_ASSERT(mf*md);