Fix compilation issues with icc and g++ < 4.1. Those include:

- conflicts with operator * overloads
 - discard the use of ei_pdiv for interger
   (g++ handles operators on __m128* types, this is why it worked)
 - weird behavior of icc in fixed size Block() constructor complaining
   the initializer of m_blockRows and m_blockCols were missing while
   we are in fixed size (maybe this hide deeper problem since this is a
   recent one, but icc gives only little feedback)
This commit is contained in:
Gael Guennebaud
2008-07-21 12:40:56 +00:00
parent c10f069b6b
commit 516db2c3b9
5 changed files with 14 additions and 5 deletions

View File

@@ -111,9 +111,10 @@ template<typename MatrixType, int BlockRows, int BlockCols, int DirectAccesStatu
/** Fixed-size constructor
*/
inline Block(const MatrixType& matrix, int startRow, int startCol)
: m_matrix(matrix), m_startRow(startRow), m_startCol(startCol)
: m_matrix(matrix), m_startRow(startRow), m_startCol(startCol),
m_blockRows(matrix.rows()), m_blockCols(matrix.cols())
{
ei_assert(RowsAtCompileTime!=Dynamic && RowsAtCompileTime!=Dynamic);
EIGEN_STATIC_ASSERT(RowsAtCompileTime!=Dynamic && RowsAtCompileTime!=Dynamic,this_method_is_only_for_fixed_size);
ei_assert(startRow >= 0 && BlockRows >= 1 && startRow + BlockRows <= matrix.rows()
&& startCol >= 0 && BlockCols >= 1 && startCol + BlockCols <= matrix.cols());
}
@@ -233,8 +234,10 @@ template<typename MatrixType, int BlockRows, int BlockCols> class Block<MatrixTy
/** Fixed-size constructor
*/
inline Block(const MatrixType& matrix, int startRow, int startCol)
: m_matrix(matrix), m_data_ptr(&matrix.const_cast_derived().coeffRef(startRow,startCol))
: m_matrix(matrix), m_data_ptr(&matrix.const_cast_derived().coeffRef(startRow,startCol)),
m_blockRows(matrix.rows()), m_blockCols(matrix.cols())
{
EIGEN_STATIC_ASSERT(RowsAtCompileTime!=Dynamic && RowsAtCompileTime!=Dynamic,this_method_is_only_for_fixed_size);
ei_assert(RowsAtCompileTime!=Dynamic && RowsAtCompileTime!=Dynamic);
ei_assert(startRow >= 0 && BlockRows >= 1 && startRow + BlockRows <= matrix.rows()
&& startCol >= 0 && BlockCols >= 1 && startCol + BlockCols <= matrix.cols());