diff --git a/Eigen/src/Array/VectorwiseOp.h b/Eigen/src/Array/VectorwiseOp.h index f495aae40..8926e7a04 100644 --- a/Eigen/src/Array/VectorwiseOp.h +++ b/Eigen/src/Array/VectorwiseOp.h @@ -92,7 +92,7 @@ class PartialReduxExpr : ei_no_assignment_operator, Index rows() const { return (Direction==Vertical ? 1 : m_matrix.rows()); } Index cols() const { return (Direction==Horizontal ? 1 : m_matrix.cols()); } - const Scalar coeff(Index i, Index j) const + EIGEN_STRONG_INLINE const Scalar coeff(Index i, Index j) const { if (Direction==Vertical) return m_functor(m_matrix.col(j)); @@ -113,15 +113,15 @@ class PartialReduxExpr : ei_no_assignment_operator, const MemberOp m_functor; }; -#define EIGEN_MEMBER_FUNCTOR(MEMBER,COST) \ - template \ - struct ei_member_##MEMBER { \ - EIGEN_EMPTY_STRUCT_CTOR(ei_member_##MEMBER) \ - typedef ResultType result_type; \ - template struct Cost \ - { enum { value = COST }; }; \ - template \ - inline ResultType operator()(const XprType& mat) const \ +#define EIGEN_MEMBER_FUNCTOR(MEMBER,COST) \ + template \ + struct ei_member_##MEMBER { \ + EIGEN_EMPTY_STRUCT_CTOR(ei_member_##MEMBER) \ + typedef ResultType result_type; \ + template struct Cost \ + { enum { value = COST }; }; \ + template \ + EIGEN_STRONG_INLINE ResultType operator()(const XprType& mat) const \ { return mat.MEMBER(); } \ } diff --git a/Eigen/src/Core/Block.h b/Eigen/src/Core/Block.h index bb1b8a6b9..59a0f72bc 100644 --- a/Eigen/src/Core/Block.h +++ b/Eigen/src/Core/Block.h @@ -162,7 +162,7 @@ template c .coeffRef(row + m_startRow.value(), col + m_startCol.value()); } - inline const CoeffReturnType coeff(Index row, Index col) const + EIGEN_STRONG_INLINE const CoeffReturnType coeff(Index row, Index col) const { return m_xpr.coeff(row + m_startRow.value(), col + m_startCol.value()); } diff --git a/Eigen/src/Core/DenseStorageBase.h b/Eigen/src/Core/DenseStorageBase.h index a9c4607b7..211984973 100644 --- a/Eigen/src/Core/DenseStorageBase.h +++ b/Eigen/src/Core/DenseStorageBase.h @@ -159,7 +159,7 @@ class DenseStorageBase : public ei_dense_xpr_base::type * * \sa resize(Index) for vectors, resize(NoChange_t, Index), resize(Index, NoChange_t) */ - inline void resize(Index rows, Index cols) + EIGEN_STRONG_INLINE void resize(Index rows, Index cols) { #ifdef EIGEN_INITIALIZE_MATRICES_BY_ZERO Index size = rows*cols; @@ -471,7 +471,9 @@ class DenseStorageBase : public ei_dense_xpr_base::type template EIGEN_STRONG_INLINE Derived& _set_noalias(const DenseBase& other) { - _resize_to_match(other); + // I don't think we need this resize call since the lazyAssign will anyways resize + // and lazyAssign will be called by the assign selector. + //_resize_to_match(other); // the 'false' below means to enforce lazy evaluation. We don't use lazyAssign() because // it wouldn't allow to copy a row-vector into a column-vector. return ei_assign_selector::run(this->derived(), other.derived()); diff --git a/Eigen/src/Core/Dot.h b/Eigen/src/Core/Dot.h index 6e54dac3c..dfa313e89 100644 --- a/Eigen/src/Core/Dot.h +++ b/Eigen/src/Core/Dot.h @@ -85,7 +85,7 @@ MatrixBase::dot(const MatrixBase& other) const * \sa dot(), norm() */ template -inline typename NumTraits::Scalar>::Real MatrixBase::squaredNorm() const +EIGEN_STRONG_INLINE typename NumTraits::Scalar>::Real MatrixBase::squaredNorm() const { return ei_real((*this).cwiseAbs2().sum()); } diff --git a/Eigen/src/Core/MatrixStorage.h b/Eigen/src/Core/MatrixStorage.h index aff83a64c..0165966f4 100644 --- a/Eigen/src/Core/MatrixStorage.h +++ b/Eigen/src/Core/MatrixStorage.h @@ -243,7 +243,7 @@ template class ei_matrix_storage(m_data, size, _Rows*m_cols); m_cols = cols; } - void resize(DenseIndex size, DenseIndex, DenseIndex cols) + EIGEN_STRONG_INLINE void resize(DenseIndex size, DenseIndex, DenseIndex cols) { if(size != _Rows*m_cols) { @@ -279,7 +279,7 @@ template class ei_matrix_storage(m_data, size, m_rows*_Cols); m_rows = rows; } - void resize(DenseIndex size, DenseIndex rows, DenseIndex) + EIGEN_STRONG_INLINE void resize(DenseIndex size, DenseIndex rows, DenseIndex) { if(size != m_rows*_Cols) { diff --git a/Eigen/src/Core/Redux.h b/Eigen/src/Core/Redux.h index 3fd5de74c..4d40a2029 100644 --- a/Eigen/src/Core/Redux.h +++ b/Eigen/src/Core/Redux.h @@ -177,7 +177,7 @@ struct ei_redux_impl { typedef typename Derived::Scalar Scalar; typedef typename Derived::Index Index; - static Scalar run(const Derived& mat, const Func& func) + static EIGEN_STRONG_INLINE Scalar run(const Derived& mat, const Func& func) { ei_assert(mat.rows()>0 && mat.cols()>0 && "you are using a non initialized matrix"); Scalar res; @@ -307,7 +307,7 @@ struct ei_redux_impl template -inline typename ei_result_of::Scalar)>::type +EIGEN_STRONG_INLINE typename ei_result_of::Scalar)>::type DenseBase::redux(const Func& func) const { typedef typename ei_cleantype::type ThisNested;