bugfixes for ICC (compilation and runtime)

This commit is contained in:
Gael Guennebaud 2009-09-15 11:53:24 +02:00
parent 432fcefcb1
commit 9e9abab2b9

View File

@ -25,6 +25,22 @@
#ifndef EIGEN_JACOBISVD_H #ifndef EIGEN_JACOBISVD_H
#define EIGEN_JACOBISVD_H #define EIGEN_JACOBISVD_H
// forward declarations (needed by ICC)
template<typename MatrixType, unsigned int Options, bool IsComplex = NumTraits<typename MatrixType::Scalar>::IsComplex>
struct ei_svd_precondition_2x2_block_to_be_real;
template<typename MatrixType, unsigned int Options,
bool PossiblyMoreRowsThanCols = (Options & AtLeastAsManyColsAsRows) == 0
&& (MatrixType::RowsAtCompileTime==Dynamic
|| (MatrixType::RowsAtCompileTime>MatrixType::ColsAtCompileTime))>
struct ei_svd_precondition_if_more_rows_than_cols;
template<typename MatrixType, unsigned int Options,
bool PossiblyMoreColsThanRows = (Options & AtLeastAsManyRowsAsCols) == 0
&& (MatrixType::ColsAtCompileTime==Dynamic
|| (MatrixType::ColsAtCompileTime>MatrixType::RowsAtCompileTime))>
struct ei_svd_precondition_if_more_cols_than_rows;
/** \ingroup SVD_Module /** \ingroup SVD_Module
* \nonstableyet * \nonstableyet
* *
@ -118,8 +134,8 @@ template<typename MatrixType, unsigned int Options> class JacobiSVD
friend struct ei_svd_precondition_if_more_cols_than_rows; friend struct ei_svd_precondition_if_more_cols_than_rows;
}; };
template<typename MatrixType, unsigned int Options, bool IsComplex = NumTraits<typename MatrixType::Scalar>::IsComplex> template<typename MatrixType, unsigned int Options>
struct ei_svd_precondition_2x2_block_to_be_real struct ei_svd_precondition_2x2_block_to_be_real<MatrixType, Options, false>
{ {
typedef JacobiSVD<MatrixType, Options> SVD; typedef JacobiSVD<MatrixType, Options> SVD;
static void run(typename SVD::WorkMatrixType&, JacobiSVD<MatrixType, Options>&, int, int) {} static void run(typename SVD::WorkMatrixType&, JacobiSVD<MatrixType, Options>&, int, int) {}
@ -195,10 +211,7 @@ void ei_real_2x2_jacobi_svd(const MatrixType& matrix, int p, int q,
*j_left = rot1 * j_right->transpose(); *j_left = rot1 * j_right->transpose();
} }
template<typename MatrixType, unsigned int Options, template<typename MatrixType, unsigned int Options, bool PossiblyMoreRowsThanCols>
bool PossiblyMoreRowsThanCols = (Options & AtLeastAsManyColsAsRows) == 0
&& (MatrixType::RowsAtCompileTime==Dynamic
|| MatrixType::RowsAtCompileTime>MatrixType::ColsAtCompileTime)>
struct ei_svd_precondition_if_more_rows_than_cols struct ei_svd_precondition_if_more_rows_than_cols
{ {
typedef JacobiSVD<MatrixType, Options> SVD; typedef JacobiSVD<MatrixType, Options> SVD;
@ -231,10 +244,7 @@ struct ei_svd_precondition_if_more_rows_than_cols<MatrixType, Options, true>
} }
}; };
template<typename MatrixType, unsigned int Options, template<typename MatrixType, unsigned int Options, bool PossiblyMoreColsThanRows>
bool PossiblyMoreColsThanRows = (Options & AtLeastAsManyRowsAsCols) == 0
&& (MatrixType::ColsAtCompileTime==Dynamic
|| MatrixType::ColsAtCompileTime>MatrixType::RowsAtCompileTime)>
struct ei_svd_precondition_if_more_cols_than_rows struct ei_svd_precondition_if_more_cols_than_rows
{ {
typedef JacobiSVD<MatrixType, Options> SVD; typedef JacobiSVD<MatrixType, Options> SVD;
@ -256,7 +266,7 @@ struct ei_svd_precondition_if_more_cols_than_rows<MatrixType, Options, true>
MaxColsAtCompileTime = SVD::MaxColsAtCompileTime, MaxColsAtCompileTime = SVD::MaxColsAtCompileTime,
MatrixOptions = SVD::MatrixOptions MatrixOptions = SVD::MatrixOptions
}; };
static bool run(const MatrixType& matrix, typename SVD::WorkMatrixType& work_matrix, SVD& svd) static bool run(const MatrixType& matrix, typename SVD::WorkMatrixType& work_matrix, SVD& svd)
{ {
int rows = matrix.rows(); int rows = matrix.rows();