aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2008-07-21 12:40:56 +0000
committerGravatar Gael Guennebaud <g.gael@free.fr>2008-07-21 12:40:56 +0000
commit516db2c3b97345553c3489681fba67f52a8eda6b (patch)
tree20594204246869186b207db64862ccbfd5eeac43
parentc10f069b6b9f0dd4bb313341d1969bd7e1cf9338 (diff)
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)
-rw-r--r--Eigen/src/Core/Block.h9
-rw-r--r--Eigen/src/Core/Functors.h3
-rw-r--r--Eigen/src/Core/arch/SSE/PacketMath.h2
-rw-r--r--Eigen/src/Core/util/StaticAssert.h3
-rw-r--r--Eigen/src/Geometry/AngleAxis.h2
5 files changed, 14 insertions, 5 deletions
diff --git a/Eigen/src/Core/Block.h b/Eigen/src/Core/Block.h
index b185e90cf..9e15261b3 100644
--- a/Eigen/src/Core/Block.h
+++ b/Eigen/src/Core/Block.h
@@ -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());
diff --git a/Eigen/src/Core/Functors.h b/Eigen/src/Core/Functors.h
index 41049940f..cb14585f6 100644
--- a/Eigen/src/Core/Functors.h
+++ b/Eigen/src/Core/Functors.h
@@ -141,6 +141,9 @@ struct ei_functor_traits<ei_scalar_quotient_op<Scalar> > {
enum {
Cost = 2 * NumTraits<Scalar>::MulCost,
PacketAccess = ei_packet_traits<Scalar>::size>1
+ #ifdef EIGEN_VECTORIZE_SSE
+ && NumTraits<Scalar>::HasFloatingPoint
+ #endif
};
};
diff --git a/Eigen/src/Core/arch/SSE/PacketMath.h b/Eigen/src/Core/arch/SSE/PacketMath.h
index 114ed49e2..148835732 100644
--- a/Eigen/src/Core/arch/SSE/PacketMath.h
+++ b/Eigen/src/Core/arch/SSE/PacketMath.h
@@ -61,6 +61,8 @@ template<> inline __m128i ei_pmul(const __m128i& a, const __m128i& b)
template<> inline __m128 ei_pdiv(const __m128& a, const __m128& b) { return _mm_div_ps(a,b); }
template<> inline __m128d ei_pdiv(const __m128d& a, const __m128d& b) { return _mm_div_pd(a,b); }
+template<> inline __m128i ei_pdiv(const __m128i& a, const __m128i& b)
+{ ei_assert(false && "packet integer division are not supported by SSE"); }
// for some weird raisons, it has to be overloaded for packet integer
template<> inline __m128i ei_pmadd(const __m128i& a, const __m128i& b, const __m128i& c) { return ei_padd(ei_pmul(a,b), c); }
diff --git a/Eigen/src/Core/util/StaticAssert.h b/Eigen/src/Core/util/StaticAssert.h
index 751f8f878..3584926af 100644
--- a/Eigen/src/Core/util/StaticAssert.h
+++ b/Eigen/src/Core/util/StaticAssert.h
@@ -64,7 +64,8 @@
unaligned_load_and_store_operations_unimplemented_on_AltiVec,
scalar_type_must_be_floating_point,
default_writting_to_selfadjoint_not_supported,
- writting_to_triangular_part_with_unit_diag_is_not_supported
+ writting_to_triangular_part_with_unit_diag_is_not_supported,
+ this_method_is_only_for_fixed_size
};
};
diff --git a/Eigen/src/Geometry/AngleAxis.h b/Eigen/src/Geometry/AngleAxis.h
index ca53140fb..ba3e9f46e 100644
--- a/Eigen/src/Geometry/AngleAxis.h
+++ b/Eigen/src/Geometry/AngleAxis.h
@@ -74,7 +74,7 @@ public:
inline AngleAxis(const QuaternionType& q) { *this = q; }
/** Constructs and initialize the angle-axis rotation from a 3x3 rotation matrix. */
template<typename Derived>
- inline AngleAxis(const MatrixBase<Derived>& m) { *this = m; }
+ inline explicit AngleAxis(const MatrixBase<Derived>& m) { *this = m; }
Scalar angle() const { return m_angle; }
Scalar& angle() { return m_angle; }