mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-14 04:35:57 +08:00
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:
parent
c10f069b6b
commit
516db2c3b9
@ -111,9 +111,10 @@ template<typename MatrixType, int BlockRows, int BlockCols, int DirectAccesStatu
|
|||||||
/** Fixed-size constructor
|
/** Fixed-size constructor
|
||||||
*/
|
*/
|
||||||
inline Block(const MatrixType& matrix, int startRow, int startCol)
|
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()
|
ei_assert(startRow >= 0 && BlockRows >= 1 && startRow + BlockRows <= matrix.rows()
|
||||||
&& startCol >= 0 && BlockCols >= 1 && startCol + BlockCols <= matrix.cols());
|
&& 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
|
/** Fixed-size constructor
|
||||||
*/
|
*/
|
||||||
inline Block(const MatrixType& matrix, int startRow, int startCol)
|
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(RowsAtCompileTime!=Dynamic && RowsAtCompileTime!=Dynamic);
|
||||||
ei_assert(startRow >= 0 && BlockRows >= 1 && startRow + BlockRows <= matrix.rows()
|
ei_assert(startRow >= 0 && BlockRows >= 1 && startRow + BlockRows <= matrix.rows()
|
||||||
&& startCol >= 0 && BlockCols >= 1 && startCol + BlockCols <= matrix.cols());
|
&& startCol >= 0 && BlockCols >= 1 && startCol + BlockCols <= matrix.cols());
|
||||||
|
@ -141,6 +141,9 @@ struct ei_functor_traits<ei_scalar_quotient_op<Scalar> > {
|
|||||||
enum {
|
enum {
|
||||||
Cost = 2 * NumTraits<Scalar>::MulCost,
|
Cost = 2 * NumTraits<Scalar>::MulCost,
|
||||||
PacketAccess = ei_packet_traits<Scalar>::size>1
|
PacketAccess = ei_packet_traits<Scalar>::size>1
|
||||||
|
#ifdef EIGEN_VECTORIZE_SSE
|
||||||
|
&& NumTraits<Scalar>::HasFloatingPoint
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -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 __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 __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
|
// 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); }
|
template<> inline __m128i ei_pmadd(const __m128i& a, const __m128i& b, const __m128i& c) { return ei_padd(ei_pmul(a,b), c); }
|
||||||
|
@ -64,7 +64,8 @@
|
|||||||
unaligned_load_and_store_operations_unimplemented_on_AltiVec,
|
unaligned_load_and_store_operations_unimplemented_on_AltiVec,
|
||||||
scalar_type_must_be_floating_point,
|
scalar_type_must_be_floating_point,
|
||||||
default_writting_to_selfadjoint_not_supported,
|
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
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -74,7 +74,7 @@ public:
|
|||||||
inline AngleAxis(const QuaternionType& q) { *this = q; }
|
inline AngleAxis(const QuaternionType& q) { *this = q; }
|
||||||
/** Constructs and initialize the angle-axis rotation from a 3x3 rotation matrix. */
|
/** Constructs and initialize the angle-axis rotation from a 3x3 rotation matrix. */
|
||||||
template<typename Derived>
|
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() const { return m_angle; }
|
||||||
Scalar& angle() { return m_angle; }
|
Scalar& angle() { return m_angle; }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user