From 678f18fce4dec90ffa97b2fb3a92d572fb64c059 Mon Sep 17 00:00:00 2001 From: Benoit Jacob Date: Mon, 12 May 2008 17:34:46 +0000 Subject: put inline keywords everywhere appropriate. So we don't need anymore to pass -finline-limit=1000 to gcc to get good performance. By the way some cleanup. --- Eigen/Core | 4 ++ Eigen/src/Core/Assign.h | 19 ++++--- Eigen/src/Core/Block.h | 72 ++++++++++++------------ Eigen/src/Core/Coeffs.h | 45 +++++++++------ Eigen/src/Core/CommaInitializer.h | 10 ++-- Eigen/src/Core/CwiseBinaryOp.h | 42 +++++++------- Eigen/src/Core/CwiseNullaryOp.h | 14 ++--- Eigen/src/Core/CwiseUnaryOp.h | 42 +++++++------- Eigen/src/Core/DiagonalCoeffs.h | 14 ++--- Eigen/src/Core/DiagonalMatrix.h | 10 ++-- Eigen/src/Core/Dot.h | 14 ++--- Eigen/src/Core/Functors.h | 84 ++++++++++++++-------------- Eigen/src/Core/Lazy.h | 12 ++-- Eigen/src/Core/Map.h | 28 +++++----- Eigen/src/Core/Matrix.h | 45 +++++++-------- Eigen/src/Core/MatrixBase.h | 41 ++++++-------- Eigen/src/Core/MatrixStorage.h | 96 ++++++++++++++++---------------- Eigen/src/Core/Minor.h | 16 +++--- Eigen/src/Core/Product.h | 42 +++++++------- Eigen/src/Core/ProductWIP.h | 42 +++++++------- Eigen/src/Core/Redux.h | 20 +++---- Eigen/src/Core/Temporary.h | 12 ++-- Eigen/src/Core/Transpose.h | 24 ++++---- Eigen/src/Core/Triangular.h | 35 ++++++------ Eigen/src/Core/TriangularAssign.h | 8 +-- Eigen/src/Core/Visitor.h | 8 +-- Eigen/src/Core/arch/AltiVec/PacketMath.h | 2 +- Eigen/src/Core/util/Macros.h | 4 +- 28 files changed, 410 insertions(+), 395 deletions(-) diff --git a/Eigen/Core b/Eigen/Core index a0eef26f7..dfe18fe43 100644 --- a/Eigen/Core +++ b/Eigen/Core @@ -58,6 +58,10 @@ namespace Eigen { #include "src/Core/arch/AltiVec/PacketMath.h" #endif +#ifndef EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD +#define EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD 16 +#endif + #include "src/Core/Functors.h" #include "src/Core/MatrixBase.h" #include "src/Core/Coeffs.h" diff --git a/Eigen/src/Core/Assign.h b/Eigen/src/Core/Assign.h index ad62b209b..bf57b3754 100644 --- a/Eigen/src/Core/Assign.h +++ b/Eigen/src/Core/Assign.h @@ -35,7 +35,7 @@ struct ei_matrix_assignment_unroller row = (UnrollCount-1) % Derived1::RowsAtCompileTime }; - static void run(Derived1 &dst, const Derived2 &src) + inline static void run(Derived1 &dst, const Derived2 &src) { ei_matrix_assignment_unroller::run(dst, src); dst.coeffRef(row, col) = src.coeff(row, col); @@ -45,7 +45,7 @@ struct ei_matrix_assignment_unroller template struct ei_matrix_assignment_unroller { - static void run(Derived1 &dst, const Derived2 &src) + inline static void run(Derived1 &dst, const Derived2 &src) { dst.coeffRef(0, 0) = src.coeff(0, 0); } @@ -55,13 +55,13 @@ struct ei_matrix_assignment_unroller template struct ei_matrix_assignment_unroller { - static void run(Derived1 &, const Derived2 &) {} + inline static void run(Derived1 &, const Derived2 &) {} }; template struct ei_matrix_assignment_unroller { - static void run(Derived1 &, const Derived2 &) {} + inline static void run(Derived1 &, const Derived2 &) {} }; //---- @@ -74,7 +74,7 @@ struct ei_matrix_assignment_packet_unroller col = Derived1::Flags&RowMajorBit ? Index % Derived1::ColsAtCompileTime : Index / Derived1::RowsAtCompileTime }; - static void run(Derived1 &dst, const Derived2 &src) + inline static void run(Derived1 &dst, const Derived2 &src) { ei_matrix_assignment_packet_unroller::size>::run(dst, src); @@ -85,7 +85,7 @@ struct ei_matrix_assignment_packet_unroller template struct ei_matrix_assignment_packet_unroller { - static void run(Derived1 &dst, const Derived2 &src) + inline static void run(Derived1 &dst, const Derived2 &src) { dst.template writePacketCoeff(0, 0, src.template packetCoeff(0, 0)); } @@ -94,7 +94,8 @@ struct ei_matrix_assignment_packet_unroller template struct ei_matrix_assignment_packet_unroller { - static void run(Derived1 &, const Derived2 &) { ei_internal_assert(false && "ei_matrix_assignment_packet_unroller"); } + inline static void run(Derived1 &, const Derived2 &) + { ei_internal_assert(false && "ei_matrix_assignment_packet_unroller"); } }; template template -Derived& MatrixBase +inline Derived& MatrixBase ::lazyAssign(const MatrixBase& other) { // std::cout << typeid(OtherDerived).name() << "\n"; @@ -121,7 +122,7 @@ Derived& MatrixBase template template -Derived& MatrixBase +inline Derived& MatrixBase ::operator=(const MatrixBase& other) { const bool need_to_transpose = Derived::IsVectorAtCompileTime diff --git a/Eigen/src/Core/Block.h b/Eigen/src/Core/Block.h index 4b417224c..125ae3979 100644 --- a/Eigen/src/Core/Block.h +++ b/Eigen/src/Core/Block.h @@ -85,7 +85,7 @@ template class Block /** Column or Row constructor */ - Block(const MatrixType& matrix, int i) + inline Block(const MatrixType& matrix, int i) : m_matrix(matrix), // It is a row if and only if BlockRows==1 and BlockCols==MatrixType::ColsAtCompileTime, // and it is a column if and only if BlockRows==MatrixType::RowsAtCompileTime and BlockCols==1, @@ -103,7 +103,7 @@ template class Block /** Fixed-size constructor */ - 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) { ei_assert(RowsAtCompileTime!=Dynamic && RowsAtCompileTime!=Dynamic); @@ -113,7 +113,7 @@ template class Block /** Dynamic-size constructor */ - Block(const MatrixType& matrix, + inline Block(const MatrixType& matrix, int startRow, int startCol, int blockRows, int blockCols) : m_matrix(matrix), m_startRow(startRow), m_startCol(startCol), @@ -129,30 +129,30 @@ template class Block private: - int _rows() const { return m_blockRows.value(); } - int _cols() const { return m_blockCols.value(); } + inline int _rows() const { return m_blockRows.value(); } + inline int _cols() const { return m_blockCols.value(); } - int _stride(void) const { return m_matrix.stride(); } + inline int _stride(void) const { return m_matrix.stride(); } - Scalar& _coeffRef(int row, int col) + inline Scalar& _coeffRef(int row, int col) { return m_matrix.const_cast_derived() .coeffRef(row + m_startRow.value(), col + m_startCol.value()); } - const Scalar _coeff(int row, int col) const + inline const Scalar _coeff(int row, int col) const { return m_matrix.coeff(row + m_startRow.value(), col + m_startCol.value()); } template - PacketScalar _packetCoeff(int row, int col) const + inline PacketScalar _packetCoeff(int row, int col) const { return m_matrix.template packetCoeff(row + m_startRow.value(), col + m_startCol.value()); } template - void _writePacketCoeff(int row, int col, const PacketScalar& x) + inline void _writePacketCoeff(int row, int col, const PacketScalar& x) { m_matrix.const_cast_derived().template writePacketCoeff(row + m_startRow.value(), col + m_startCol.value(), x); } @@ -183,7 +183,7 @@ template class Block * \sa class Block, block(int,int) */ template -Block MatrixBase +inline Block MatrixBase ::block(int startRow, int startCol, int blockRows, int blockCols) { return Block(derived(), startRow, startCol, blockRows, blockCols); @@ -191,7 +191,7 @@ Block MatrixBase /** This is the const version of block(int,int,int,int). */ template -const Block MatrixBase +inline const Block MatrixBase ::block(int startRow, int startCol, int blockRows, int blockCols) const { return Block(derived(), startRow, startCol, blockRows, blockCols); @@ -214,7 +214,7 @@ const Block MatrixBase * \sa class Block, block(int) */ template -Block MatrixBase +inline Block MatrixBase ::block(int start, int size) { ei_assert(IsVectorAtCompileTime); @@ -226,7 +226,7 @@ Block MatrixBase /** This is the const version of block(int,int).*/ template -const Block MatrixBase +inline const Block MatrixBase ::block(int start, int size) const { ei_assert(IsVectorAtCompileTime); @@ -252,7 +252,7 @@ const Block MatrixBase * \sa class Block, block(int,int) */ template -Block MatrixBase::start(int size) +inline Block MatrixBase::start(int size) { ei_assert(IsVectorAtCompileTime); return Block(derived(), 0, 0, @@ -262,7 +262,7 @@ Block MatrixBase::start(int size) /** This is the const version of start(int).*/ template -const Block MatrixBase::start(int size) const +inline const Block MatrixBase::start(int size) const { ei_assert(IsVectorAtCompileTime); return Block(derived(), 0, 0, @@ -286,7 +286,7 @@ const Block MatrixBase::start(int size) const * \sa class Block, block(int,int) */ template -Block MatrixBase::end(int size) +inline Block MatrixBase::end(int size) { ei_assert(IsVectorAtCompileTime); return Block(derived(), @@ -298,7 +298,7 @@ Block MatrixBase::end(int size) /** This is the const version of end(int).*/ template -const Block MatrixBase::end(int size) const +inline const Block MatrixBase::end(int size) const { ei_assert(IsVectorAtCompileTime); return Block(derived(), @@ -321,8 +321,8 @@ const Block MatrixBase::end(int size) const */ template template -Block::RowsAtCompileTime == 1 ? 1 : Size, - ei_traits::ColsAtCompileTime == 1 ? 1 : Size> +inline Block::RowsAtCompileTime == 1 ? 1 : Size, + ei_traits::ColsAtCompileTime == 1 ? 1 : Size> MatrixBase::start() { ei_assert(IsVectorAtCompileTime); @@ -333,8 +333,8 @@ MatrixBase::start() /** This is the const version of start().*/ template template -const Block::RowsAtCompileTime == 1 ? 1 : Size, - ei_traits::ColsAtCompileTime == 1 ? 1 : Size> +inline const Block::RowsAtCompileTime == 1 ? 1 : Size, + ei_traits::ColsAtCompileTime == 1 ? 1 : Size> MatrixBase::start() const { ei_assert(IsVectorAtCompileTime); @@ -355,8 +355,8 @@ MatrixBase::start() const */ template template -Block::RowsAtCompileTime == 1 ? 1 : Size, - ei_traits::ColsAtCompileTime == 1 ? 1 : Size> +inline Block::RowsAtCompileTime == 1 ? 1 : Size, + ei_traits::ColsAtCompileTime == 1 ? 1 : Size> MatrixBase::end() { ei_assert(IsVectorAtCompileTime); @@ -370,8 +370,8 @@ MatrixBase::end() /** This is the const version of end.*/ template template -const Block::RowsAtCompileTime == 1 ? 1 : Size, - ei_traits::ColsAtCompileTime == 1 ? 1 : Size> +inline const Block::RowsAtCompileTime == 1 ? 1 : Size, + ei_traits::ColsAtCompileTime == 1 ? 1 : Size> MatrixBase::end() const { ei_assert(IsVectorAtCompileTime); @@ -399,7 +399,7 @@ MatrixBase::end() const * \sa class Block, block(int,int,int,int) */ template -Block MatrixBase +inline Block MatrixBase ::corner(CornerType type, int cRows, int cCols) { switch(type) @@ -419,7 +419,7 @@ Block MatrixBase /** This is the const version of corner(CornerType, int, int).*/ template -const Block MatrixBase +inline const Block MatrixBase ::corner(CornerType type, int cRows, int cCols) const { switch(type) @@ -451,7 +451,7 @@ const Block MatrixBase */ template template -Block MatrixBase +inline Block MatrixBase ::corner(CornerType type) { switch(type) @@ -472,7 +472,7 @@ Block MatrixBase /** This is the const version of corner(CornerType).*/ template template -const Block MatrixBase +inline const Block MatrixBase ::corner(CornerType type) const { switch(type) @@ -508,7 +508,7 @@ const Block MatrixBase */ template template -Block MatrixBase +inline Block MatrixBase ::block(int startRow, int startCol) { return Block(derived(), startRow, startCol); @@ -517,7 +517,7 @@ Block MatrixBase /** This is the const version of block<>(int, int). */ template template -const Block MatrixBase +inline const Block MatrixBase ::block(int startRow, int startCol) const { return Block(derived(), startRow, startCol); @@ -530,7 +530,7 @@ const Block MatrixBase * * \sa row(), class Block */ template -Block::RowsAtCompileTime, 1> +inline Block::RowsAtCompileTime, 1> MatrixBase::col(int i) { return Block::RowsAtCompileTime, 1>(derived(), i); @@ -538,7 +538,7 @@ MatrixBase::col(int i) /** This is the const version of col(). */ template -const Block::RowsAtCompileTime, 1> +inline const Block::RowsAtCompileTime, 1> MatrixBase::col(int i) const { return Block::RowsAtCompileTime, 1>(derived(), i); @@ -551,7 +551,7 @@ MatrixBase::col(int i) const * * \sa col(), class Block */ template -Block::ColsAtCompileTime> +inline Block::ColsAtCompileTime> MatrixBase::row(int i) { return Block::ColsAtCompileTime>(derived(), i); @@ -559,7 +559,7 @@ MatrixBase::row(int i) /** This is the const version of row(). */ template -const Block::ColsAtCompileTime> +inline const Block::ColsAtCompileTime> MatrixBase::row(int i) const { return Block::ColsAtCompileTime>(derived(), i); diff --git a/Eigen/src/Core/Coeffs.h b/Eigen/src/Core/Coeffs.h index 8e298de7d..28845cd95 100644 --- a/Eigen/src/Core/Coeffs.h +++ b/Eigen/src/Core/Coeffs.h @@ -40,7 +40,7 @@ * \sa operator()(int,int) const, coeffRef(int,int), coeff(int) const */ template -const typename ei_traits::Scalar MatrixBase +inline const typename ei_traits::Scalar MatrixBase ::coeff(int row, int col) const { ei_internal_assert(row >= 0 && row < rows() @@ -53,7 +53,7 @@ const typename ei_traits::Scalar MatrixBase * \sa operator()(int,int), operator[](int) const */ template -const typename ei_traits::Scalar MatrixBase +inline const typename ei_traits::Scalar MatrixBase ::operator()(int row, int col) const { ei_assert(row >= 0 && row < rows() @@ -76,7 +76,7 @@ const typename ei_traits::Scalar MatrixBase * \sa operator()(int,int), coeff(int, int) const, coeffRef(int) */ template -typename ei_traits::Scalar& MatrixBase +inline typename ei_traits::Scalar& MatrixBase ::coeffRef(int row, int col) { ei_internal_assert(row >= 0 && row < rows() @@ -89,7 +89,7 @@ typename ei_traits::Scalar& MatrixBase * \sa operator()(int,int) const, operator[](int) */ template -typename ei_traits::Scalar& MatrixBase +inline typename ei_traits::Scalar& MatrixBase ::operator()(int row, int col) { ei_assert(row >= 0 && row < rows() @@ -112,7 +112,7 @@ typename ei_traits::Scalar& MatrixBase * \sa operator[](int) const, coeffRef(int), coeff(int,int) const */ template -const typename ei_traits::Scalar MatrixBase +inline const typename ei_traits::Scalar MatrixBase ::coeff(int index) const { ei_internal_assert(IsVectorAtCompileTime); @@ -136,7 +136,7 @@ const typename ei_traits::Scalar MatrixBase * z() const, w() const */ template -const typename ei_traits::Scalar MatrixBase +inline const typename ei_traits::Scalar MatrixBase ::operator[](int index) const { ei_assert(IsVectorAtCompileTime); @@ -167,7 +167,7 @@ const typename ei_traits::Scalar MatrixBase * \sa operator[](int), coeff(int) const, coeffRef(int,int) */ template -typename ei_traits::Scalar& MatrixBase +inline typename ei_traits::Scalar& MatrixBase ::coeffRef(int index) { ei_internal_assert(IsVectorAtCompileTime); @@ -190,7 +190,7 @@ typename ei_traits::Scalar& MatrixBase * \sa operator[](int) const, operator()(int,int), x(), y(), z(), w() */ template -typename ei_traits::Scalar& MatrixBase +inline typename ei_traits::Scalar& MatrixBase ::operator[](int index) { ei_assert(IsVectorAtCompileTime); @@ -208,42 +208,55 @@ typename ei_traits::Scalar& MatrixBase /** equivalent to operator[](0). \only_for_vectors */ template -const typename ei_traits::Scalar MatrixBase +inline const typename ei_traits::Scalar MatrixBase ::x() const { return (*this)[0]; } /** equivalent to operator[](1). \only_for_vectors */ template -const typename ei_traits::Scalar MatrixBase +inline const typename ei_traits::Scalar MatrixBase ::y() const { return (*this)[1]; } /** equivalent to operator[](2). \only_for_vectors */ template -const typename ei_traits::Scalar MatrixBase +inline const typename ei_traits::Scalar MatrixBase ::z() const { return (*this)[2]; } /** equivalent to operator[](3). \only_for_vectors */ template -const typename ei_traits::Scalar MatrixBase +inline const typename ei_traits::Scalar MatrixBase ::w() const { return (*this)[3]; } /** equivalent to operator[](0). \only_for_vectors */ template -typename ei_traits::Scalar& MatrixBase +inline typename ei_traits::Scalar& MatrixBase ::x() { return (*this)[0]; } /** equivalent to operator[](1). \only_for_vectors */ template -typename ei_traits::Scalar& MatrixBase +inline typename ei_traits::Scalar& MatrixBase ::y() { return (*this)[1]; } /** equivalent to operator[](2). \only_for_vectors */ template -typename ei_traits::Scalar& MatrixBase +inline typename ei_traits::Scalar& MatrixBase ::z() { return (*this)[2]; } /** equivalent to operator[](3). \only_for_vectors */ template -typename ei_traits::Scalar& MatrixBase +inline typename ei_traits::Scalar& MatrixBase ::w() { return (*this)[3]; } +template +template +inline typename ei_packet_traits::Scalar>::type +MatrixBase::packetCoeff(int row, int col) const +{ return derived().template _packetCoeff(row,col); } + +template +template +inline void MatrixBase::writePacketCoeff +(int row, int col, const typename ei_packet_traits::Scalar>::type& x) +{ return derived().template _writePacketCoeff(row,col,x); } + + #endif // EIGEN_COEFFS_H diff --git a/Eigen/src/Core/CommaInitializer.h b/Eigen/src/Core/CommaInitializer.h index 21551ccf2..d5e25b6e4 100644 --- a/Eigen/src/Core/CommaInitializer.h +++ b/Eigen/src/Core/CommaInitializer.h @@ -32,14 +32,14 @@ template struct MatrixBase::CommaInitializer { - CommaInitializer(Derived& mat, const Scalar& s) + inline CommaInitializer(Derived& mat, const Scalar& s) : m_matrix(mat), m_row(0), m_col(1), m_currentBlockRows(1) { m_matrix.coeffRef(0,0) = s; } template - CommaInitializer(Derived& mat, const MatrixBase& other) + inline CommaInitializer(Derived& mat, const MatrixBase& other) : m_matrix(mat), m_row(0), m_col(other.cols()), m_currentBlockRows(other.rows()) { m_matrix.block(0, 0, other.rows(), other.cols()) = other; @@ -86,7 +86,7 @@ struct MatrixBase::CommaInitializer return *this; } - ~CommaInitializer(void) + inline ~CommaInitializer() { ei_assert((m_row+m_currentBlockRows) == m_matrix.rows() && m_col == m_matrix.cols() @@ -108,14 +108,14 @@ struct MatrixBase::CommaInitializer * Output: \verbinclude MatrixBase_set.out */ template -typename MatrixBase::CommaInitializer MatrixBase::operator<< (const Scalar& s) +inline typename MatrixBase::CommaInitializer MatrixBase::operator<< (const Scalar& s) { return CommaInitializer(*static_cast(this), s); } template template -typename MatrixBase::CommaInitializer +inline typename MatrixBase::CommaInitializer MatrixBase::operator<<(const MatrixBase& other) { return CommaInitializer(*static_cast(this), other); diff --git a/Eigen/src/Core/CwiseBinaryOp.h b/Eigen/src/Core/CwiseBinaryOp.h index 31afbe0f1..daa81ddb7 100644 --- a/Eigen/src/Core/CwiseBinaryOp.h +++ b/Eigen/src/Core/CwiseBinaryOp.h @@ -87,7 +87,7 @@ class CwiseBinaryOp : ei_no_assignment_operator, typedef typename ei_traits::LhsNested LhsNested; typedef typename ei_traits::RhsNested RhsNested; - CwiseBinaryOp(const Lhs& lhs, const Rhs& rhs, const BinaryOp& func = BinaryOp()) + inline CwiseBinaryOp(const Lhs& lhs, const Rhs& rhs, const BinaryOp& func = BinaryOp()) : m_lhs(lhs), m_rhs(rhs), m_functor(func) { ei_assert(lhs.rows() == rhs.rows() && lhs.cols() == rhs.cols()); @@ -95,16 +95,16 @@ class CwiseBinaryOp : ei_no_assignment_operator, private: - int _rows() const { return m_lhs.rows(); } - int _cols() const { return m_lhs.cols(); } + inline int _rows() const { return m_lhs.rows(); } + inline int _cols() const { return m_lhs.cols(); } - const Scalar _coeff(int row, int col) const + inline const Scalar _coeff(int row, int col) const { return m_functor(m_lhs.coeff(row, col), m_rhs.coeff(row, col)); } template - PacketScalar _packetCoeff(int row, int col) const + inline PacketScalar _packetCoeff(int row, int col) const { return m_functor.packetOp(m_lhs.template packetCoeff(row, col), m_rhs.template packetCoeff(row, col)); } @@ -121,8 +121,8 @@ class CwiseBinaryOp : ei_no_assignment_operator, */ template template -const CwiseBinaryOp::Scalar>, - Derived, OtherDerived> +inline const CwiseBinaryOp::Scalar>, + Derived, OtherDerived> MatrixBase::operator-(const MatrixBase &other) const { return CwiseBinaryOp, @@ -135,7 +135,7 @@ MatrixBase::operator-(const MatrixBase &other) const */ template template -Derived & +inline Derived & MatrixBase::operator-=(const MatrixBase &other) { return *this = *this - other; @@ -149,7 +149,7 @@ MatrixBase::operator-=(const MatrixBase &other) */ template template -const CwiseBinaryOp::Scalar>, Derived, OtherDerived> +inline const CwiseBinaryOp::Scalar>, Derived, OtherDerived> MatrixBase::operator+(const MatrixBase &other) const { return CwiseBinaryOp, Derived, OtherDerived>(derived(), other.derived()); @@ -161,7 +161,7 @@ MatrixBase::operator+(const MatrixBase &other) const */ template template -Derived & +inline Derived & MatrixBase::operator+=(const MatrixBase& other) { return *this = *this + other; @@ -173,7 +173,7 @@ MatrixBase::operator+=(const MatrixBase& other) */ template template -const CwiseBinaryOp::Scalar>, Derived, OtherDerived> +inline const CwiseBinaryOp::Scalar>, Derived, OtherDerived> MatrixBase::cwiseProduct(const MatrixBase &other) const { return CwiseBinaryOp, Derived, OtherDerived>(derived(), other.derived()); @@ -185,7 +185,7 @@ MatrixBase::cwiseProduct(const MatrixBase &other) const */ template template -const CwiseBinaryOp::Scalar>, Derived, OtherDerived> +inline const CwiseBinaryOp::Scalar>, Derived, OtherDerived> MatrixBase::cwiseQuotient(const MatrixBase &other) const { return CwiseBinaryOp, Derived, OtherDerived>(derived(), other.derived()); @@ -197,7 +197,7 @@ MatrixBase::cwiseQuotient(const MatrixBase &other) const */ template template -const CwiseBinaryOp::Scalar>, Derived, OtherDerived> +inline const CwiseBinaryOp::Scalar>, Derived, OtherDerived> MatrixBase::cwiseMin(const MatrixBase &other) const { return CwiseBinaryOp, Derived, OtherDerived>(derived(), other.derived()); @@ -209,7 +209,7 @@ MatrixBase::cwiseMin(const MatrixBase &other) const */ template template -const CwiseBinaryOp::Scalar>, Derived, OtherDerived> +inline const CwiseBinaryOp::Scalar>, Derived, OtherDerived> MatrixBase::cwiseMax(const MatrixBase &other) const { return CwiseBinaryOp, Derived, OtherDerived>(derived(), other.derived()); @@ -224,7 +224,7 @@ MatrixBase::cwiseMax(const MatrixBase &other) const */ template template -const CwiseBinaryOp +inline const CwiseBinaryOp MatrixBase::cwise(const MatrixBase &other, const CustomBinaryOp& func) const { return CwiseBinaryOp(derived(), other.derived(), func); @@ -236,7 +236,7 @@ MatrixBase::cwise(const MatrixBase &other, const CustomBi */ template template -const CwiseBinaryOp::Scalar>, Derived, OtherDerived> +inline const CwiseBinaryOp::Scalar>, Derived, OtherDerived> MatrixBase::cwiseLessThan(const MatrixBase &other) const { return cwise(other, std::less()); @@ -248,7 +248,7 @@ MatrixBase::cwiseLessThan(const MatrixBase &other) const */ template template -const CwiseBinaryOp::Scalar>, Derived, OtherDerived> +inline const CwiseBinaryOp::Scalar>, Derived, OtherDerived> MatrixBase::cwiseLessEqual(const MatrixBase &other) const { return cwise(other, std::less_equal()); @@ -260,7 +260,7 @@ MatrixBase::cwiseLessEqual(const MatrixBase &other) const */ template template -const CwiseBinaryOp::Scalar>, Derived, OtherDerived> +inline const CwiseBinaryOp::Scalar>, Derived, OtherDerived> MatrixBase::cwiseGreaterThan(const MatrixBase &other) const { return cwise(other, std::greater()); @@ -272,7 +272,7 @@ MatrixBase::cwiseGreaterThan(const MatrixBase &other) con */ template template -const CwiseBinaryOp::Scalar>, Derived, OtherDerived> +inline const CwiseBinaryOp::Scalar>, Derived, OtherDerived> MatrixBase::cwiseGreaterEqual(const MatrixBase &other) const { return cwise(other, std::greater_equal()); @@ -284,7 +284,7 @@ MatrixBase::cwiseGreaterEqual(const MatrixBase &other) co */ template template -const CwiseBinaryOp::Scalar>, Derived, OtherDerived> +inline const CwiseBinaryOp::Scalar>, Derived, OtherDerived> MatrixBase::cwiseEqualTo(const MatrixBase &other) const { return cwise(other, std::equal_to()); @@ -296,7 +296,7 @@ MatrixBase::cwiseEqualTo(const MatrixBase &other) const */ template template -const CwiseBinaryOp::Scalar>, Derived, OtherDerived> +inline const CwiseBinaryOp::Scalar>, Derived, OtherDerived> MatrixBase::cwiseNotEqualTo(const MatrixBase &other) const { return cwise(other, std::not_equal_to()); diff --git a/Eigen/src/Core/CwiseNullaryOp.h b/Eigen/src/Core/CwiseNullaryOp.h index bcc09d0c8..ee986de48 100644 --- a/Eigen/src/Core/CwiseNullaryOp.h +++ b/Eigen/src/Core/CwiseNullaryOp.h @@ -440,7 +440,7 @@ Derived& MatrixBase::setOnes() * \sa ei_random(), ei_random(int) */ template -const CwiseNullaryOp::Scalar>, Derived> +inline const CwiseNullaryOp::Scalar>, Derived> MatrixBase::random(int rows, int cols) { return create(rows, cols, ei_scalar_random_op()); @@ -463,7 +463,7 @@ MatrixBase::random(int rows, int cols) * \sa ei_random(), ei_random(int,int) */ template -const CwiseNullaryOp::Scalar>, Derived> +inline const CwiseNullaryOp::Scalar>, Derived> MatrixBase::random(int size) { return create(size, ei_scalar_random_op()); @@ -481,7 +481,7 @@ MatrixBase::random(int size) * \sa ei_random(int), ei_random(int,int) */ template -const CwiseNullaryOp::Scalar>, Derived> +inline const CwiseNullaryOp::Scalar>, Derived> MatrixBase::random() { return create(RowsAtCompileTime, ColsAtCompileTime, ei_scalar_random_op()); @@ -495,7 +495,7 @@ MatrixBase::random() * \sa class CwiseNullaryOp, ei_random() */ template -Derived& MatrixBase::setRandom() +inline Derived& MatrixBase::setRandom() { return *this = random(rows(), cols()); } @@ -517,7 +517,7 @@ Derived& MatrixBase::setRandom() * \sa identity(), setIdentity(), isIdentity() */ template -const CwiseNullaryOp::Scalar>, Derived> +inline const CwiseNullaryOp::Scalar>, Derived> MatrixBase::identity(int rows, int cols) { return create(rows, cols, ei_scalar_identity_op()); @@ -534,7 +534,7 @@ MatrixBase::identity(int rows, int cols) * \sa identity(int,int), setIdentity(), isIdentity() */ template -const CwiseNullaryOp::Scalar>, Derived> +inline const CwiseNullaryOp::Scalar>, Derived> MatrixBase::identity() { return create(RowsAtCompileTime, ColsAtCompileTime, ei_scalar_identity_op()); @@ -580,7 +580,7 @@ bool MatrixBase::isIdentity * \sa class CwiseNullaryOp, identity(), identity(int,int), isIdentity() */ template -Derived& MatrixBase::setIdentity() +inline Derived& MatrixBase::setIdentity() { return *this = identity(rows(), cols()); } diff --git a/Eigen/src/Core/CwiseUnaryOp.h b/Eigen/src/Core/CwiseUnaryOp.h index 438417829..d7a415d48 100644 --- a/Eigen/src/Core/CwiseUnaryOp.h +++ b/Eigen/src/Core/CwiseUnaryOp.h @@ -69,21 +69,21 @@ class CwiseUnaryOp : ei_no_assignment_operator, EIGEN_GENERIC_PUBLIC_INTERFACE(CwiseUnaryOp) - CwiseUnaryOp(const MatrixType& mat, const UnaryOp& func = UnaryOp()) + inline CwiseUnaryOp(const MatrixType& mat, const UnaryOp& func = UnaryOp()) : m_matrix(mat), m_functor(func) {} private: - int _rows() const { return m_matrix.rows(); } - int _cols() const { return m_matrix.cols(); } + inline int _rows() const { return m_matrix.rows(); } + inline int _cols() const { return m_matrix.cols(); } - const Scalar _coeff(int row, int col) const + inline const Scalar _coeff(int row, int col) const { return m_functor(m_matrix.coeff(row, col)); } template - PacketScalar _packetCoeff(int row, int col) const + inline PacketScalar _packetCoeff(int row, int col) const { return m_functor.packetOp(m_matrix.template packetCoeff(row, col)); } @@ -105,7 +105,7 @@ class CwiseUnaryOp : ei_no_assignment_operator, */ template template -const CwiseUnaryOp +inline const CwiseUnaryOp MatrixBase::cwise(const CustomUnaryOp& func) const { return CwiseUnaryOp(derived(), func); @@ -114,7 +114,7 @@ MatrixBase::cwise(const CustomUnaryOp& func) const /** \returns an expression of the opposite of \c *this */ template -const CwiseUnaryOp::Scalar>,Derived> +inline const CwiseUnaryOp::Scalar>,Derived> MatrixBase::operator-() const { return CwiseUnaryOp, Derived>(derived()); @@ -123,7 +123,7 @@ MatrixBase::operator-() const /** \returns an expression of the coefficient-wise absolute value of \c *this */ template -const CwiseUnaryOp::Scalar>,Derived> +inline const CwiseUnaryOp::Scalar>,Derived> MatrixBase::cwiseAbs() const { return CwiseUnaryOp,Derived>(derived()); @@ -132,7 +132,7 @@ MatrixBase::cwiseAbs() const /** \returns an expression of the coefficient-wise squared absolute value of \c *this */ template -const CwiseUnaryOp::Scalar>,Derived> +inline const CwiseUnaryOp::Scalar>,Derived> MatrixBase::cwiseAbs2() const { return CwiseUnaryOp,Derived>(derived()); @@ -142,7 +142,7 @@ MatrixBase::cwiseAbs2() const * * \sa adjoint() */ template -const CwiseUnaryOp::Scalar>, Derived> +inline const CwiseUnaryOp::Scalar>, Derived> MatrixBase::conjugate() const { return CwiseUnaryOp, Derived>(derived()); @@ -157,7 +157,7 @@ MatrixBase::conjugate() const */ template template -const CwiseUnaryOp::Scalar, NewType>, Derived> +inline const CwiseUnaryOp::Scalar, NewType>, Derived> MatrixBase::cast() const { return CwiseUnaryOp, Derived>(derived()); @@ -165,7 +165,7 @@ MatrixBase::cast() const /** \relates MatrixBase */ template -const CwiseUnaryOp::Scalar>, Derived> +inline const CwiseUnaryOp::Scalar>, Derived> MatrixBase::operator*(const Scalar& scalar) const { return CwiseUnaryOp, Derived> @@ -174,7 +174,7 @@ MatrixBase::operator*(const Scalar& scalar) const /** \relates MatrixBase */ template -const CwiseUnaryOp::Scalar>, Derived> +inline const CwiseUnaryOp::Scalar>, Derived> MatrixBase::operator/(const Scalar& scalar) const { return CwiseUnaryOp, Derived> @@ -182,14 +182,14 @@ MatrixBase::operator/(const Scalar& scalar) const } template -Derived& +inline Derived& MatrixBase::operator*=(const Scalar& other) { return *this = *this * other; } template -Derived& +inline Derived& MatrixBase::operator/=(const Scalar& other) { return *this = *this / other; @@ -197,7 +197,7 @@ MatrixBase::operator/=(const Scalar& other) /** \returns an expression of the coefficient-wise square root of *this. */ template -const CwiseUnaryOp::Scalar>, Derived> +inline const CwiseUnaryOp::Scalar>, Derived> MatrixBase::cwiseSqrt() const { return CwiseUnaryOp, Derived>(derived()); @@ -205,7 +205,7 @@ MatrixBase::cwiseSqrt() const /** \returns an expression of the coefficient-wise exponential of *this. */ template -const CwiseUnaryOp::Scalar>, Derived> +inline const CwiseUnaryOp::Scalar>, Derived> MatrixBase::cwiseExp() const { return CwiseUnaryOp, Derived>(derived()); @@ -213,7 +213,7 @@ MatrixBase::cwiseExp() const /** \returns an expression of the coefficient-wise logarithm of *this. */ template -const CwiseUnaryOp::Scalar>, Derived> +inline const CwiseUnaryOp::Scalar>, Derived> MatrixBase::cwiseLog() const { return CwiseUnaryOp, Derived>(derived()); @@ -221,7 +221,7 @@ MatrixBase::cwiseLog() const /** \returns an expression of the coefficient-wise cosine of *this. */ template -const CwiseUnaryOp::Scalar>, Derived> +inline const CwiseUnaryOp::Scalar>, Derived> MatrixBase::cwiseCos() const { return CwiseUnaryOp, Derived>(derived()); @@ -229,7 +229,7 @@ MatrixBase::cwiseCos() const /** \returns an expression of the coefficient-wise sine of *this. */ template -const CwiseUnaryOp::Scalar>, Derived> +inline const CwiseUnaryOp::Scalar>, Derived> MatrixBase::cwiseSin() const { return CwiseUnaryOp, Derived>(derived()); @@ -237,7 +237,7 @@ MatrixBase::cwiseSin() const /** \relates MatrixBase */ template -const CwiseUnaryOp::Scalar>, Derived> +inline const CwiseUnaryOp::Scalar>, Derived> MatrixBase::cwisePow(const Scalar& exponent) const { return CwiseUnaryOp, Derived> diff --git a/Eigen/src/Core/DiagonalCoeffs.h b/Eigen/src/Core/DiagonalCoeffs.h index 635d847f7..b9471e7a1 100644 --- a/Eigen/src/Core/DiagonalCoeffs.h +++ b/Eigen/src/Core/DiagonalCoeffs.h @@ -68,21 +68,21 @@ template class DiagonalCoeffs EIGEN_GENERIC_PUBLIC_INTERFACE(DiagonalCoeffs) - DiagonalCoeffs(const MatrixType& matrix) : m_matrix(matrix) {} + inline DiagonalCoeffs(const MatrixType& matrix) : m_matrix(matrix) {} EIGEN_INHERIT_ASSIGNMENT_OPERATORS(DiagonalCoeffs) private: - int _rows() const { return std::min(m_matrix.rows(), m_matrix.cols()); } - int _cols() const { return 1; } + inline int _rows() const { return std::min(m_matrix.rows(), m_matrix.cols()); } + inline int _cols() const { return 1; } - Scalar& _coeffRef(int row, int) + inline Scalar& _coeffRef(int row, int) { return m_matrix.const_cast_derived().coeffRef(row, row); } - const Scalar _coeff(int row, int) const + inline const Scalar _coeff(int row, int) const { return m_matrix.coeff(row, row); } @@ -102,14 +102,14 @@ template class DiagonalCoeffs * \sa class DiagonalCoeffs */ template DiagonalCoeffs -MatrixBase::diagonal() +inline MatrixBase::diagonal() { return DiagonalCoeffs(derived()); } /** This is the const version of diagonal(). */ template -const DiagonalCoeffs +inline const DiagonalCoeffs MatrixBase::diagonal() const { return DiagonalCoeffs(derived()); diff --git a/Eigen/src/Core/DiagonalMatrix.h b/Eigen/src/Core/DiagonalMatrix.h index 972ef464e..030b1b732 100644 --- a/Eigen/src/Core/DiagonalMatrix.h +++ b/Eigen/src/Core/DiagonalMatrix.h @@ -62,7 +62,7 @@ class DiagonalMatrix : ei_no_assignment_operator, EIGEN_GENERIC_PUBLIC_INTERFACE(DiagonalMatrix) - DiagonalMatrix(const CoeffsVectorType& coeffs) : m_coeffs(coeffs) + inline DiagonalMatrix(const CoeffsVectorType& coeffs) : m_coeffs(coeffs) { ei_assert(CoeffsVectorType::IsVectorAtCompileTime && coeffs.size() > 0); @@ -70,10 +70,10 @@ class DiagonalMatrix : ei_no_assignment_operator, private: - int _rows() const { return m_coeffs.size(); } - int _cols() const { return m_coeffs.size(); } + inline int _rows() const { return m_coeffs.size(); } + inline int _cols() const { return m_coeffs.size(); } - const Scalar _coeff(int row, int col) const + inline const Scalar _coeff(int row, int col) const { return row == col ? m_coeffs.coeff(row) : static_cast(0); } @@ -92,7 +92,7 @@ class DiagonalMatrix : ei_no_assignment_operator, * \sa class DiagonalMatrix, isDiagonal() **/ template -const DiagonalMatrix +inline const DiagonalMatrix MatrixBase::asDiagonal() const { return DiagonalMatrix(derived()); diff --git a/Eigen/src/Core/Dot.h b/Eigen/src/Core/Dot.h index c1c607639..28a93e71d 100644 --- a/Eigen/src/Core/Dot.h +++ b/Eigen/src/Core/Dot.h @@ -28,7 +28,7 @@ template struct ei_dot_unroller { - static void run(const Derived1 &v1, const Derived2& v2, typename Derived1::Scalar &dot) + inline static void run(const Derived1 &v1, const Derived2& v2, typename Derived1::Scalar &dot) { ei_dot_unroller::run(v1, v2, dot); dot += v1.coeff(Index) * ei_conj(v2.coeff(Index)); @@ -38,7 +38,7 @@ struct ei_dot_unroller template struct ei_dot_unroller<0, Size, Derived1, Derived2> { - static void run(const Derived1 &v1, const Derived2& v2, typename Derived1::Scalar &dot) + inline static void run(const Derived1 &v1, const Derived2& v2, typename Derived1::Scalar &dot) { dot = v1.coeff(0) * ei_conj(v2.coeff(0)); } @@ -47,14 +47,14 @@ struct ei_dot_unroller<0, Size, Derived1, Derived2> template struct ei_dot_unroller { - static void run(const Derived1&, const Derived2&, typename Derived1::Scalar&) {} + inline static void run(const Derived1&, const Derived2&, typename Derived1::Scalar&) {} }; // prevent buggy user code from causing an infinite recursion template struct ei_dot_unroller { - static void run(const Derived1&, const Derived2&, typename Derived1::Scalar&) {} + inline static void run(const Derived1&, const Derived2&, typename Derived1::Scalar&) {} }; /** \returns the dot product of *this with other. @@ -108,7 +108,7 @@ MatrixBase::dot(const MatrixBase& other) const * \sa dot(), norm() */ template -typename NumTraits::Scalar>::Real MatrixBase::norm2() const +inline typename NumTraits::Scalar>::Real MatrixBase::norm2() const { return ei_real(dot(*this)); } @@ -120,7 +120,7 @@ typename NumTraits::Scalar>::Real MatrixBase -typename NumTraits::Scalar>::Real MatrixBase::norm() const +inline typename NumTraits::Scalar>::Real MatrixBase::norm() const { return ei_sqrt(norm2()); } @@ -132,7 +132,7 @@ typename NumTraits::Scalar>::Real MatrixBase -const CwiseUnaryOp::Scalar>, Derived> +inline const CwiseUnaryOp::Scalar>, Derived> MatrixBase::normalized() const { return (*this) * (Scalar(1)/norm()); diff --git a/Eigen/src/Core/Functors.h b/Eigen/src/Core/Functors.h index 5af460dac..8472081a0 100644 --- a/Eigen/src/Core/Functors.h +++ b/Eigen/src/Core/Functors.h @@ -33,9 +33,9 @@ * \sa class CwiseBinaryOp, MatrixBase::operator+, class PartialRedux, MatrixBase::sum() */ template struct ei_scalar_sum_op EIGEN_EMPTY_STRUCT { - const Scalar operator() (const Scalar& a, const Scalar& b) const { return a + b; } + inline const Scalar operator() (const Scalar& a, const Scalar& b) const { return a + b; } template - PacketScalar packetOp(const PacketScalar& a, const PacketScalar& b) const + inline const PacketScalar packetOp(const PacketScalar& a, const PacketScalar& b) const { return ei_padd(a,b); } }; template @@ -52,9 +52,9 @@ struct ei_functor_traits > { * \sa class CwiseBinaryOp, MatrixBase::cwiseProduct(), class PartialRedux, MatrixBase::redux() */ template struct ei_scalar_product_op EIGEN_EMPTY_STRUCT { - const Scalar operator() (const Scalar& a, const Scalar& b) const { return a * b; } + inline const Scalar operator() (const Scalar& a, const Scalar& b) const { return a * b; } template - PacketScalar packetOp(const PacketScalar& a, const PacketScalar& b) const + inline const PacketScalar packetOp(const PacketScalar& a, const PacketScalar& b) const { return ei_pmul(a,b); } }; template @@ -71,9 +71,9 @@ struct ei_functor_traits > { * \sa class CwiseBinaryOp, MatrixBase::cwiseMin, class PartialRedux, MatrixBase::minCoeff() */ template struct ei_scalar_min_op EIGEN_EMPTY_STRUCT { - const Scalar operator() (const Scalar& a, const Scalar& b) const { return std::min(a, b); } + inline const Scalar operator() (const Scalar& a, const Scalar& b) const { return std::min(a, b); } template - PacketScalar packetOp(const PacketScalar& a, const PacketScalar& b) const + inline const PacketScalar packetOp(const PacketScalar& a, const PacketScalar& b) const { return ei_pmin(a,b); } }; template @@ -90,9 +90,9 @@ struct ei_functor_traits > { * \sa class CwiseBinaryOp, MatrixBase::cwiseMax, class PartialRedux, MatrixBase::maxCoeff() */ template struct ei_scalar_max_op EIGEN_EMPTY_STRUCT { - const Scalar operator() (const Scalar& a, const Scalar& b) const { return std::max(a, b); } + inline const Scalar operator() (const Scalar& a, const Scalar& b) const { return std::max(a, b); } template - PacketScalar packetOp(const PacketScalar& a, const PacketScalar& b) const + inline const PacketScalar packetOp(const PacketScalar& a, const PacketScalar& b) const { return ei_pmax(a,b); } }; template @@ -112,9 +112,9 @@ struct ei_functor_traits > { * \sa class CwiseBinaryOp, MatrixBase::operator- */ template struct ei_scalar_difference_op EIGEN_EMPTY_STRUCT { - const Scalar operator() (const Scalar& a, const Scalar& b) const { return a - b; } + inline const Scalar operator() (const Scalar& a, const Scalar& b) const { return a - b; } template - PacketScalar packetOp(const PacketScalar& a, const PacketScalar& b) const + inline const PacketScalar packetOp(const PacketScalar& a, const PacketScalar& b) const { return ei_psub(a,b); } }; template @@ -131,7 +131,7 @@ struct ei_functor_traits > { * \sa class CwiseBinaryOp, MatrixBase::cwiseQuotient() */ template struct ei_scalar_quotient_op EIGEN_EMPTY_STRUCT { - const Scalar operator() (const Scalar& a, const Scalar& b) const { return a / b; } + inline const Scalar operator() (const Scalar& a, const Scalar& b) const { return a / b; } }; template struct ei_functor_traits > @@ -146,7 +146,7 @@ struct ei_functor_traits > * \sa class CwiseUnaryOp, MatrixBase::operator- */ template struct ei_scalar_opposite_op EIGEN_EMPTY_STRUCT { - const Scalar operator() (const Scalar& a) const { return -a; } + inline const Scalar operator() (const Scalar& a) const { return -a; } }; template struct ei_functor_traits > @@ -159,7 +159,7 @@ struct ei_functor_traits > */ template struct ei_scalar_abs_op EIGEN_EMPTY_STRUCT { typedef typename NumTraits::Real result_type; - const result_type operator() (const Scalar& a) const { return ei_abs(a); } + inline const result_type operator() (const Scalar& a) const { return ei_abs(a); } }; template struct ei_functor_traits > @@ -172,7 +172,7 @@ struct ei_functor_traits > */ template struct ei_scalar_abs2_op EIGEN_EMPTY_STRUCT { typedef typename NumTraits::Real result_type; - const result_type operator() (const Scalar& a) const { return ei_abs2(a); } + inline const result_type operator() (const Scalar& a) const { return ei_abs2(a); } }; template struct ei_functor_traits > @@ -184,7 +184,7 @@ struct ei_functor_traits > * \sa class CwiseUnaryOp, MatrixBase::conjugate() */ template struct ei_scalar_conjugate_op EIGEN_EMPTY_STRUCT { - const Scalar operator() (const Scalar& a) const { return ei_conj(a); } + inline const Scalar operator() (const Scalar& a) const { return ei_conj(a); } }; template struct ei_functor_traits > @@ -198,7 +198,7 @@ struct ei_functor_traits > template struct ei_scalar_cast_op EIGEN_EMPTY_STRUCT { typedef NewType result_type; - const NewType operator() (const Scalar& a) const { return static_cast(a); } + inline const NewType operator() (const Scalar& a) const { return static_cast(a); } }; template struct ei_functor_traits > @@ -215,16 +215,16 @@ template::s template struct ei_scalar_multiple_op { typedef typename ei_packet_traits::type PacketScalar; - ei_scalar_multiple_op(const Scalar& other) : m_other(ei_pset1(other)) { } - Scalar operator() (const Scalar& a) const { return a * ei_pfirst(m_other); } - PacketScalar packetOp(const PacketScalar& a) const + inline ei_scalar_multiple_op(const Scalar& other) : m_other(ei_pset1(other)) { } + inline Scalar operator() (const Scalar& a) const { return a * ei_pfirst(m_other); } + inline const PacketScalar packetOp(const PacketScalar& a) const { return ei_pmul(a, m_other); } const PacketScalar m_other; }; template struct ei_scalar_multiple_op { - ei_scalar_multiple_op(const Scalar& other) : m_other(other) { } - Scalar operator() (const Scalar& a) const { return a * m_other; } + inline ei_scalar_multiple_op(const Scalar& other) : m_other(other) { } + inline Scalar operator() (const Scalar& a) const { return a * m_other; } const Scalar m_other; }; template @@ -233,8 +233,8 @@ struct ei_functor_traits > template struct ei_scalar_quotient1_impl { - ei_scalar_quotient1_impl(const Scalar& other) : m_other(static_cast(1) / other) {} - Scalar operator() (const Scalar& a) const { return a * m_other; } + inline ei_scalar_quotient1_impl(const Scalar& other) : m_other(static_cast(1) / other) {} + inline Scalar operator() (const Scalar& a) const { return a * m_other; } const Scalar m_other; }; template @@ -243,8 +243,8 @@ struct ei_functor_traits > template struct ei_scalar_quotient1_impl { - ei_scalar_quotient1_impl(const Scalar& other) : m_other(other) {} - Scalar operator() (const Scalar& a) const { return a / m_other; } + inline ei_scalar_quotient1_impl(const Scalar& other) : m_other(other) {} + inline Scalar operator() (const Scalar& a) const { return a / m_other; } const Scalar m_other; enum { Cost = 2 * NumTraits::MulCost }; }; @@ -262,7 +262,7 @@ struct ei_functor_traits > */ template struct ei_scalar_quotient1_op : ei_scalar_quotient1_impl::HasFloatingPoint > { - ei_scalar_quotient1_op(const Scalar& other) + inline ei_scalar_quotient1_op(const Scalar& other) : ei_scalar_quotient1_impl::HasFloatingPoint >(other) {} }; @@ -272,7 +272,7 @@ struct ei_scalar_quotient1_op : ei_scalar_quotient1_impl struct ei_scalar_sqrt_op EIGEN_EMPTY_STRUCT { - const Scalar operator() (const Scalar& a) const { return ei_sqrt(a); } + inline const Scalar operator() (const Scalar& a) const { return ei_sqrt(a); } }; template struct ei_functor_traits > @@ -284,7 +284,7 @@ struct ei_functor_traits > * \sa class CwiseUnaryOp, MatrixBase::cwiseExp() */ template struct ei_scalar_exp_op EIGEN_EMPTY_STRUCT { - const Scalar operator() (const Scalar& a) const { return ei_exp(a); } + inline const Scalar operator() (const Scalar& a) const { return ei_exp(a); } }; template struct ei_functor_traits > @@ -296,7 +296,7 @@ struct ei_functor_traits > * \sa class CwiseUnaryOp, MatrixBase::cwiseLog() */ template struct ei_scalar_log_op EIGEN_EMPTY_STRUCT { - const Scalar operator() (const Scalar& a) const { return ei_log(a); } + inline const Scalar operator() (const Scalar& a) const { return ei_log(a); } }; template struct ei_functor_traits > @@ -308,7 +308,7 @@ struct ei_functor_traits > * \sa class CwiseUnaryOp, MatrixBase::cwiseCos() */ template struct ei_scalar_cos_op EIGEN_EMPTY_STRUCT { - const Scalar operator() (const Scalar& a) const { return ei_cos(a); } + inline const Scalar operator() (const Scalar& a) const { return ei_cos(a); } }; template struct ei_functor_traits > @@ -320,7 +320,7 @@ struct ei_functor_traits > * \sa class CwiseUnaryOp, MatrixBase::cwiseSin() */ template struct ei_scalar_sin_op EIGEN_EMPTY_STRUCT { - const Scalar operator() (const Scalar& a) const { return ei_sin(a); } + inline const Scalar operator() (const Scalar& a) const { return ei_sin(a); } }; template struct ei_functor_traits > @@ -333,8 +333,8 @@ struct ei_functor_traits > */ template struct ei_scalar_pow_op { - ei_scalar_pow_op(const Scalar& exponent) : m_exponent(exponent) {} - Scalar operator() (const Scalar& a) const { return ei_pow(a, m_exponent); } + inline ei_scalar_pow_op(const Scalar& exponent) : m_exponent(exponent) {} + inline Scalar operator() (const Scalar& a) const { return ei_pow(a, m_exponent); } const Scalar m_exponent; }; template @@ -348,16 +348,16 @@ template::s template struct ei_scalar_constant_op { typedef typename ei_packet_traits::type PacketScalar; - ei_scalar_constant_op(const Scalar& other) : m_other(ei_pset1(other)) { } - Scalar operator() (int, int) const { return ei_pfirst(m_other); } - PacketScalar packetOp() const + inline ei_scalar_constant_op(const Scalar& other) : m_other(ei_pset1(other)) { } + inline const Scalar operator() (int, int) const { return ei_pfirst(m_other); } + inline const PacketScalar packetOp() const { return m_other; } const PacketScalar m_other; }; template struct ei_scalar_constant_op { - ei_scalar_constant_op(const Scalar& other) : m_other(other) { } - Scalar operator() (int, int) const { return m_other; } + inline ei_scalar_constant_op(const Scalar& other) : m_other(other) { } + inline const Scalar operator() (int, int) const { return m_other; } const Scalar m_other; }; template @@ -366,8 +366,8 @@ struct ei_functor_traits > template struct ei_scalar_random_op EIGEN_EMPTY_STRUCT { - ei_scalar_random_op(void) {} - Scalar operator() (int, int) const { return ei_random(); } + inline ei_scalar_random_op(void) {} + inline const Scalar operator() (int, int) const { return ei_random(); } }; template struct ei_functor_traits > @@ -375,8 +375,8 @@ struct ei_functor_traits > template struct ei_scalar_identity_op EIGEN_EMPTY_STRUCT { - ei_scalar_identity_op(void) {} - Scalar operator() (int row, int col) const { return row==col ? Scalar(1) : Scalar(0); } + inline ei_scalar_identity_op(void) {} + inline const Scalar operator() (int row, int col) const { return row==col ? Scalar(1) : Scalar(0); } }; template struct ei_functor_traits > diff --git a/Eigen/src/Core/Lazy.h b/Eigen/src/Core/Lazy.h index d2f763680..ef02c9832 100644 --- a/Eigen/src/Core/Lazy.h +++ b/Eigen/src/Core/Lazy.h @@ -58,22 +58,22 @@ template class Lazy EIGEN_GENERIC_PUBLIC_INTERFACE(Lazy) - Lazy(const ExpressionType& matrix) : m_expression(matrix) {} + inline Lazy(const ExpressionType& matrix) : m_expression(matrix) {} EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Lazy) private: - int _rows() const { return m_expression.rows(); } - int _cols() const { return m_expression.cols(); } + inline int _rows() const { return m_expression.rows(); } + inline int _cols() const { return m_expression.cols(); } - const Scalar _coeff(int row, int col) const + inline const Scalar _coeff(int row, int col) const { return m_expression.coeff(row, col); } template - PacketScalar _packetCoeff(int row, int col) const + inline PacketScalar _packetCoeff(int row, int col) const { return m_expression.template packetCoeff(row, col); } @@ -88,7 +88,7 @@ template class Lazy * Output: \verbinclude MatrixBase_lazy.out */ template -const Lazy +inline const Lazy MatrixBase::lazy() const { return Lazy(derived()); diff --git a/Eigen/src/Core/Map.h b/Eigen/src/Core/Map.h index 1f9a0f244..a503043ac 100644 --- a/Eigen/src/Core/Map.h +++ b/Eigen/src/Core/Map.h @@ -61,10 +61,10 @@ template class Map private: - int _rows() const { return m_rows; } - int _cols() const { return m_cols; } + inline int _rows() const { return m_rows; } + inline int _cols() const { return m_cols; } - const Scalar& _coeff(int row, int col) const + inline const Scalar& _coeff(int row, int col) const { if(Flags & RowMajorBit) return m_data[col + row * m_cols]; @@ -72,7 +72,7 @@ template class Map return m_data[row + col * m_rows]; } - Scalar& _coeffRef(int row, int col) + inline Scalar& _coeffRef(int row, int col) { if(Flags & RowMajorBit) return const_cast(m_data)[col + row * m_cols]; @@ -81,7 +81,7 @@ template class Map } public: - Map(const Scalar* data, int rows, int cols) : m_data(data), m_rows(rows), m_cols(cols) + inline Map(const Scalar* data, int rows, int cols) : m_data(data), m_rows(rows), m_cols(cols) { ei_assert(rows > 0 && (RowsAtCompileTime == Dynamic || RowsAtCompileTime == rows) @@ -98,7 +98,7 @@ template class Map /** This is the const version of map(Scalar*,int,int). */ template -const Map > +inline const Map > Matrix<_Scalar, _Rows, _Cols, _Flags, _MaxRows, _MaxCols>::map(const Scalar* data, int rows, int cols) { return Map(data, rows, cols); @@ -106,7 +106,7 @@ Matrix<_Scalar, _Rows, _Cols, _Flags, _MaxRows, _MaxCols>::map(const Scalar* dat /** This is the const version of map(Scalar*,int). */ template -const Map > +inline const Map > Matrix<_Scalar, _Rows, _Cols, _Flags, _MaxRows, _MaxCols>::map(const Scalar* data, int size) { ei_assert(_Cols == 1 || _Rows ==1); @@ -118,7 +118,7 @@ Matrix<_Scalar, _Rows, _Cols, _Flags, _MaxRows, _MaxCols>::map(const Scalar* dat /** This is the const version of map(Scalar*). */ template -const Map > +inline const Map > Matrix<_Scalar, _Rows, _Cols, _Flags, _MaxRows, _MaxCols>::map(const Scalar* data) { return Map(data, _Rows, _Cols); @@ -136,7 +136,7 @@ Matrix<_Scalar, _Rows, _Cols, _Flags, _MaxRows, _MaxCols>::map(const Scalar* dat * \sa map(const Scalar*, int, int), map(Scalar*, int), map(Scalar*), class Map */ template -Map > +inline Map > Matrix<_Scalar, _Rows, _Cols, _Flags, _MaxRows, _MaxCols>::map(Scalar* data, int rows, int cols) { return Map(data, rows, cols); @@ -155,7 +155,7 @@ Matrix<_Scalar, _Rows, _Cols, _Flags, _MaxRows, _MaxCols>::map(Scalar* data, int * \sa map(const Scalar*, int), map(Scalar*, int, int), map(Scalar*), class Map */ template -Map > +inline Map > Matrix<_Scalar, _Rows, _Cols, _Flags, _MaxRows, _MaxCols>::map(Scalar* data, int size) { ei_assert(_Cols == 1 || _Rows ==1); @@ -175,7 +175,7 @@ Matrix<_Scalar, _Rows, _Cols, _Flags, _MaxRows, _MaxCols>::map(Scalar* data, int * \sa map(const Scalar*), map(Scalar*, int), map(Scalar*, int, int), class Map */ template -Map > +inline Map > Matrix<_Scalar, _Rows, _Cols, _Flags, _MaxRows, _MaxCols>::map(Scalar* data) { return Map(data, _Rows, _Cols); @@ -190,7 +190,7 @@ Matrix<_Scalar, _Rows, _Cols, _Flags, _MaxRows, _MaxCols>::map(Scalar* data) * \sa Matrix(const Scalar *), Matrix::map(const Scalar *, int, int) */ template -Matrix<_Scalar, _Rows, _Cols, _Flags, _MaxRows, _MaxCols> +inline Matrix<_Scalar, _Rows, _Cols, _Flags, _MaxRows, _MaxCols> ::Matrix(const Scalar *data, int rows, int cols) : m_storage(rows*cols, rows, cols) { @@ -208,7 +208,7 @@ Matrix<_Scalar, _Rows, _Cols, _Flags, _MaxRows, _MaxCols> * \sa Matrix(const Scalar *), Matrix::map(const Scalar *, int) */ template -Matrix<_Scalar, _Rows, _Cols, _Flags, _MaxRows, _MaxCols> +inline Matrix<_Scalar, _Rows, _Cols, _Flags, _MaxRows, _MaxCols> ::Matrix(const Scalar *data, int size) : m_storage(size, RowsAtCompileTime == 1 ? 1 : size, ColsAtCompileTime == 1 ? 1 : size) { @@ -226,7 +226,7 @@ Matrix<_Scalar, _Rows, _Cols, _Flags, _MaxRows, _MaxCols> * Matrix::map(const Scalar *) */ template -Matrix<_Scalar, _Rows, _Cols, _Flags, _MaxRows, _MaxCols> +inline Matrix<_Scalar, _Rows, _Cols, _Flags, _MaxRows, _MaxCols> ::Matrix(const Scalar *data) { *this = map(data); diff --git a/Eigen/src/Core/Matrix.h b/Eigen/src/Core/Matrix.h index 016a9ef06..2fa4b16cf 100644 --- a/Eigen/src/Core/Matrix.h +++ b/Eigen/src/Core/Matrix.h @@ -97,10 +97,10 @@ class Matrix : public MatrixBase m_storage; - int _rows() const { return m_storage.rows(); } - int _cols() const { return m_storage.cols(); } + inline int _rows() const { return m_storage.rows(); } + inline int _cols() const { return m_storage.cols(); } - int _stride(void) const + inline int _stride(void) const { if(Flags & RowMajorBit) return m_storage.cols(); @@ -108,7 +108,7 @@ class Matrix : public MatrixBase - PacketScalar _packetCoeff(int row, int col) const + inline PacketScalar _packetCoeff(int row, int col) const { ei_internal_assert(Flags & VectorizableBit); if(Flags & RowMajorBit) @@ -141,7 +141,7 @@ class Matrix : public MatrixBase - void _writePacketCoeff(int row, int col, const PacketScalar& x) + inline void _writePacketCoeff(int row, int col, const PacketScalar& x) { ei_internal_assert(Flags & VectorizableBit); if(Flags & RowMajorBit) @@ -158,14 +158,14 @@ class Matrix : public MatrixBase 0 && (MaxRowsAtCompileTime == Dynamic || MaxRowsAtCompileTime >= rows) @@ -185,7 +185,7 @@ class Matrix : public MatrixBase - Matrix& operator=(const MatrixBase& other) + inline Matrix& operator=(const MatrixBase& other) { if(RowsAtCompileTime == 1) { @@ -204,7 +204,7 @@ class Matrix : public MatrixBase(other); } @@ -225,7 +225,7 @@ class Matrix : public MatrixBase 0 && ColsAtCompileTime > 0); } @@ -236,7 +236,8 @@ class Matrix : public MatrixBase 0); ei_assert((RowsAtCompileTime == 1 @@ -255,7 +256,7 @@ class Matrix : public MatrixBase - Matrix(const MatrixBase& other) + inline Matrix(const MatrixBase& other) : m_storage(other.rows() * other.cols(), other.rows(), other.cols()) { Base::lazyAssign(other.derived()); } /** Copy constructor */ - Matrix(const Matrix& other) + inline Matrix(const Matrix& other) : m_storage(other.rows() * other.cols(), other.rows(), other.cols()) { Base::lazyAssign(other); } /** Destructor */ - ~Matrix() {} + inline ~Matrix() {} }; #define EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, Size, SizeSuffix) \ diff --git a/Eigen/src/Core/MatrixBase.h b/Eigen/src/Core/MatrixBase.h index 5baa42261..9078e5677 100644 --- a/Eigen/src/Core/MatrixBase.h +++ b/Eigen/src/Core/MatrixBase.h @@ -151,17 +151,17 @@ template class MatrixBase /// \name Run-time traits //@{ /** \returns the number of rows. \sa cols(), RowsAtCompileTime */ - int rows() const { return derived()._rows(); } + inline int rows() const { return derived()._rows(); } /** \returns the number of columns. \sa row(), ColsAtCompileTime*/ - int cols() const { return derived()._cols(); } + inline int cols() const { return derived()._cols(); } /** \returns the number of coefficients, which is \a rows()*cols(). * \sa rows(), cols(), SizeAtCompileTime. */ - int size() const { return rows() * cols(); } + inline int size() const { return rows() * cols(); } /** \returns true if either the number of rows or the number of columns is equal to 1. * In other words, this function returns * \code rows()==1 || cols()==1 \endcode * \sa rows(), cols(), IsVectorAtCompileTime. */ - bool isVector() const { return rows()==1 || cols()==1; } + inline bool isVector() const { return rows()==1 || cols()==1; } //@} /// \name Copying and initialization @@ -178,7 +178,7 @@ template class MatrixBase /** Special case of the template operator=, in order to prevent the compiler * from generating a default operator= (issue hit with g++ 4.1) */ - Derived& operator=(const MatrixBase& other) + inline Derived& operator=(const MatrixBase& other) { return this->operator=(other); } @@ -208,9 +208,9 @@ template class MatrixBase Scalar& operator[](int index); template - PacketScalar packetCoeff(int row, int col) const { return derived().template _packetCoeff(row,col); } + PacketScalar packetCoeff(int row, int col) const; template - void writePacketCoeff(int row, int col, const PacketScalar& x) { return derived().template _writePacketCoeff(row,col,x); } + void writePacketCoeff(int row, int col, const PacketScalar& x); const Scalar x() const; const Scalar y() const; @@ -244,10 +244,12 @@ template class MatrixBase Derived& operator*=(const Scalar& other); Derived& operator/=(const Scalar& other); - const CwiseUnaryOp::Scalar>, Derived> operator*(const Scalar& scalar) const; - const CwiseUnaryOp::Scalar>, Derived> operator/(const Scalar& scalar) const; + const CwiseUnaryOp::Scalar>, Derived> + operator*(const Scalar& scalar) const; + const CwiseUnaryOp::Scalar>, Derived> + operator/(const Scalar& scalar) const; - friend const CwiseUnaryOp::Scalar>, Derived> + inline friend const CwiseUnaryOp::Scalar>, Derived> operator*(const Scalar& scalar, const MatrixBase& matrix) { return matrix*scalar; } //@} @@ -396,11 +398,11 @@ template class MatrixBase bool isOrtho(RealScalar prec = precision()) const; template - bool operator==(const MatrixBase& other) const + inline bool operator==(const MatrixBase& other) const { return derived().cwiseEqualTo(other.derived()).all(); } template - bool operator!=(const MatrixBase& other) const + inline bool operator!=(const MatrixBase& other) const { return derived().cwiseNotEqualTo(other.derived()).all(); } //@} @@ -409,7 +411,7 @@ template class MatrixBase template const CwiseUnaryOp::Scalar, NewType>, Derived> cast() const; - EIGEN_INLINE const typename ei_eval::type eval() const + EIGEN_ALWAYS_INLINE const typename ei_eval::type eval() const { return typename ei_eval::type(derived()); } @@ -522,9 +524,9 @@ template class MatrixBase /// \name Casting to the derived type //@{ - const Derived& derived() const { return *static_cast(this); } - Derived& derived() { return *static_cast(this); } - Derived& const_cast_derived() const + inline const Derived& derived() const { return *static_cast(this); } + inline Derived& derived() { return *static_cast(this); } + inline Derived& const_cast_derived() const { return *static_cast(const_cast(this)); } //@} @@ -562,13 +564,6 @@ template class MatrixBase const QR::type> qr() const; //@} - private: - - template - PacketScalar _packetCoeff(int , int) const { ei_internal_assert(false && "_packetCoeff not defined"); } - template - void _writePacketCoeff(int , int, const PacketScalar&) { ei_internal_assert(false && "_packetCoeff not defined"); } - }; #endif // EIGEN_MATRIXBASE_H diff --git a/Eigen/src/Core/MatrixStorage.h b/Eigen/src/Core/MatrixStorage.h index 6f88a31d6..94336f1a8 100644 --- a/Eigen/src/Core/MatrixStorage.h +++ b/Eigen/src/Core/MatrixStorage.h @@ -50,7 +50,7 @@ template struct ei_aligned_array }; template -T* ei_aligned_malloc(size_t size) +inline T* ei_aligned_malloc(size_t size) { #ifdef EIGEN_VECTORIZE if (ei_packet_traits::size>1) @@ -67,7 +67,7 @@ T* ei_aligned_malloc(size_t size) } template -void ei_aligned_free(T* ptr) +inline void ei_aligned_free(T* ptr) { #ifdef EIGEN_VECTORIZE if (ei_packet_traits::size>1) @@ -82,13 +82,13 @@ template class ei_matrix_storage { ei_aligned_array m_data; public: - ei_matrix_storage() {} - ei_matrix_storage(int,int,int) {} - static int rows(void) {return _Rows;} - static int cols(void) {return _Cols;} - void resize(int,int,int) {} - const T *data() const { return m_data.array; } - T *data() { return m_data.array; } + inline ei_matrix_storage() {} + inline ei_matrix_storage(int,int,int) {} + inline static int rows(void) {return _Rows;} + inline static int cols(void) {return _Cols;} + inline void resize(int,int,int) {} + inline const T *data() const { return m_data.array; } + inline T *data() { return m_data.array; } }; // dynamic-size matrix with fixed-size storage @@ -98,17 +98,17 @@ template class ei_matrix_storage class ei_matrix_storage class ei_matrix_storage class ei_matrix_storage int m_rows; int m_cols; public: - ei_matrix_storage(int size, int rows, int cols) + inline ei_matrix_storage(int size, int rows, int cols) : m_data(ei_aligned_malloc(size)), m_rows(rows), m_cols(cols) {} - ~ei_matrix_storage() { delete[] m_data; } - int rows(void) const {return m_rows;} - int cols(void) const {return m_cols;} + inline ~ei_matrix_storage() { delete[] m_data; } + inline int rows(void) const {return m_rows;} + inline int cols(void) const {return m_cols;} void resize(int size, int rows, int cols) { if(size != m_rows*m_cols) @@ -169,8 +169,8 @@ template class ei_matrix_storage m_rows = rows; m_cols = cols; } - const T *data() const { return m_data; } - T *data() { return m_data; } + inline const T *data() const { return m_data; } + inline T *data() { return m_data; } }; // matrix with dynamic width and fixed height (so that matrix has dynamic size). @@ -179,10 +179,10 @@ template class ei_matrix_storage(size)), m_cols(cols) {} - ~ei_matrix_storage() { delete[] m_data; } - static int rows(void) {return _Rows;} - int cols(void) const {return m_cols;} + inline ei_matrix_storage(int size, int, int cols) : m_data(ei_aligned_malloc(size)), m_cols(cols) {} + inline ~ei_matrix_storage() { delete[] m_data; } + inline static int rows(void) {return _Rows;} + inline int cols(void) const {return m_cols;} void resize(int size, int, int cols) { if(size != _Rows*m_cols) @@ -192,8 +192,8 @@ template class ei_matrix_storage class ei_matrix_storage(size)), m_rows(rows) {} - ~ei_matrix_storage() { delete[] m_data; } - int rows(void) const {return m_rows;} - static int cols(void) {return _Cols;} + inline ei_matrix_storage(int size, int rows, int) : m_data(ei_aligned_malloc(size)), m_rows(rows) {} + inline ~ei_matrix_storage() { delete[] m_data; } + inline int rows(void) const {return m_rows;} + inline static int cols(void) {return _Cols;} void resize(int size, int rows, int) { if(size != m_rows*_Cols) @@ -215,8 +215,8 @@ template class ei_matrix_storage class Minor EIGEN_GENERIC_PUBLIC_INTERFACE(Minor) - Minor(const MatrixType& matrix, - int row, int col) + inline Minor(const MatrixType& matrix, + int row, int col) : m_matrix(matrix), m_row(row), m_col(col) { ei_assert(row >= 0 && row < matrix.rows() @@ -76,15 +76,15 @@ template class Minor private: - int _rows() const { return m_matrix.rows() - 1; } - int _cols() const { return m_matrix.cols() - 1; } + inline int _rows() const { return m_matrix.rows() - 1; } + inline int _cols() const { return m_matrix.cols() - 1; } - Scalar& _coeffRef(int row, int col) + inline Scalar& _coeffRef(int row, int col) { return m_matrix.const_cast_derived().coeffRef(row + (row >= m_row), col + (col >= m_col)); } - const Scalar _coeff(int row, int col) const + inline const Scalar _coeff(int row, int col) const { return m_matrix.coeff(row + (row >= m_row), col + (col >= m_col)); } @@ -104,7 +104,7 @@ template class Minor * \sa class Minor */ template -Minor +inline Minor MatrixBase::minor(int row, int col) { return Minor(derived(), row, col); @@ -112,7 +112,7 @@ MatrixBase::minor(int row, int col) /** This is the const version of minor(). */ template -const Minor +inline const Minor MatrixBase::minor(int row, int col) const { return Minor(derived(), row, col); diff --git a/Eigen/src/Core/Product.h b/Eigen/src/Core/Product.h index dbd8b6cdd..414843651 100644 --- a/Eigen/src/Core/Product.h +++ b/Eigen/src/Core/Product.h @@ -29,8 +29,8 @@ template struct ei_product_unroller { - static void run(int row, int col, const Lhs& lhs, const Rhs& rhs, - typename Lhs::Scalar &res) + inline static void run(int row, int col, const Lhs& lhs, const Rhs& rhs, + typename Lhs::Scalar &res) { ei_product_unroller::run(row, col, lhs, rhs, res); res += lhs.coeff(row, Index) * rhs.coeff(Index, col); @@ -40,8 +40,8 @@ struct ei_product_unroller template struct ei_product_unroller<0, Size, Lhs, Rhs> { - static void run(int row, int col, const Lhs& lhs, const Rhs& rhs, - typename Lhs::Scalar &res) + inline static void run(int row, int col, const Lhs& lhs, const Rhs& rhs, + typename Lhs::Scalar &res) { res = lhs.coeff(row, 0) * rhs.coeff(0, col); } @@ -50,14 +50,14 @@ struct ei_product_unroller<0, Size, Lhs, Rhs> template struct ei_product_unroller { - static void run(int, int, const Lhs&, const Rhs&, typename Lhs::Scalar&) {} + inline static void run(int, int, const Lhs&, const Rhs&, typename Lhs::Scalar&) {} }; // prevent buggy user code from causing an infinite recursion template struct ei_product_unroller { - static void run(int, int, const Lhs&, const Rhs&, typename Lhs::Scalar&) {} + inline static void run(int, int, const Lhs&, const Rhs&, typename Lhs::Scalar&) {} }; template @@ -72,7 +72,7 @@ struct ei_packet_product_unroller; template struct ei_packet_product_unroller { - static void run(int row, int col, const Lhs& lhs, const Rhs& rhs, PacketScalar &res) + inline static void run(int row, int col, const Lhs& lhs, const Rhs& rhs, PacketScalar &res) { ei_packet_product_unroller::run(row, col, lhs, rhs, res); res = ei_pmadd(ei_pset1(lhs.coeff(row, Index)), rhs.template packetCoeff(Index, col), res); @@ -82,7 +82,7 @@ struct ei_packet_product_unroller template struct ei_packet_product_unroller { - static void run(int row, int col, const Lhs& lhs, const Rhs& rhs, PacketScalar &res) + inline static void run(int row, int col, const Lhs& lhs, const Rhs& rhs, PacketScalar &res) { ei_packet_product_unroller::run(row, col, lhs, rhs, res); res = ei_pmadd(lhs.template packetCoeff(row, Index), ei_pset1(rhs.coeff(Index, col)), res); @@ -92,7 +92,7 @@ struct ei_packet_product_unroller template struct ei_packet_product_unroller { - static void run(int row, int col, const Lhs& lhs, const Rhs& rhs, PacketScalar &res) + inline static void run(int row, int col, const Lhs& lhs, const Rhs& rhs, PacketScalar &res) { res = ei_pmul(ei_pset1(lhs.coeff(row, 0)),rhs.template packetCoeff(0, col)); } @@ -101,7 +101,7 @@ struct ei_packet_product_unroller template struct ei_packet_product_unroller { - static void run(int row, int col, const Lhs& lhs, const Rhs& rhs, PacketScalar &res) + inline static void run(int row, int col, const Lhs& lhs, const Rhs& rhs, PacketScalar &res) { res = ei_pmul(lhs.template packetCoeff(row, 0), ei_pset1(rhs.coeff(0, col))); } @@ -110,13 +110,13 @@ struct ei_packet_product_unroller template struct ei_packet_product_unroller { - static void run(int, int, const Lhs&, const Rhs&, PacketScalar&) {} + inline static void run(int, int, const Lhs&, const Rhs&, PacketScalar&) {} }; template struct ei_packet_product_unroller { - static void run(int, int, const Lhs&, const Rhs&, PacketScalar&) {} + inline static void run(int, int, const Lhs&, const Rhs&, PacketScalar&) {} }; template @@ -207,7 +207,7 @@ template class Product : ei_no_assignm typedef typename ei_traits::_LhsNested _LhsNested; typedef typename ei_traits::_RhsNested _RhsNested; - Product(const Lhs& lhs, const Rhs& rhs) + inline Product(const Lhs& lhs, const Rhs& rhs) : m_lhs(lhs), m_rhs(rhs) { ei_assert(lhs.cols() == rhs.rows()); @@ -223,8 +223,8 @@ template class Product : ei_no_assignm private: - int _rows() const { return m_lhs.rows(); } - int _cols() const { return m_rhs.cols(); } + inline int _rows() const { return m_lhs.rows(); } + inline int _cols() const { return m_rhs.cols(); } const Scalar _coeff(int row, int col) const { @@ -247,7 +247,7 @@ template class Product : ei_no_assignm } template - PacketScalar _packetCoeff(int row, int col) const + const PacketScalar _packetCoeff(int row, int col) const { if(Lhs::ColsAtCompileTime <= EIGEN_UNROLLING_LIMIT) { @@ -263,7 +263,7 @@ template class Product : ei_no_assignm return ProductPacketCoeffImpl::execute(*this, row, col); } - PacketScalar _packetCoeffRowMajor(int row, int col) const + const PacketScalar _packetCoeffRowMajor(int row, int col) const { PacketScalar res; res = ei_pmul(ei_pset1(m_lhs.coeff(row, 0)),m_rhs.template packetCoeff(0, col)); @@ -272,7 +272,7 @@ template class Product : ei_no_assignm return res; } - PacketScalar _packetCoeffColumnMajor(int row, int col) const + const PacketScalar _packetCoeffColumnMajor(int row, int col) const { PacketScalar res; res = ei_pmul(m_lhs.template packetCoeff(row, 0), ei_pset1(m_rhs.coeff(0, col))); @@ -304,7 +304,7 @@ template class Product : ei_no_assignm */ template template -const Product +inline const Product MatrixBase::operator*(const MatrixBase &other) const { return Product(derived(), other.derived()); @@ -316,7 +316,7 @@ MatrixBase::operator*(const MatrixBase &other) const */ template template -Derived & +inline Derived & MatrixBase::operator*=(const MatrixBase &other) { return *this = *this * other; @@ -324,7 +324,7 @@ MatrixBase::operator*=(const MatrixBase &other) template template -Derived& MatrixBase::lazyAssign(const Product& product) +inline Derived& MatrixBase::lazyAssign(const Product& product) { product.template _cacheOptimalEval(derived(), #ifdef EIGEN_VECTORIZE diff --git a/Eigen/src/Core/ProductWIP.h b/Eigen/src/Core/ProductWIP.h index 0a7ef43e9..fae9e4ac8 100644 --- a/Eigen/src/Core/ProductWIP.h +++ b/Eigen/src/Core/ProductWIP.h @@ -31,8 +31,8 @@ template struct ei_product_unroller { - static void run(int row, int col, const Lhs& lhs, const Rhs& rhs, - typename Lhs::Scalar &res) + inline static void run(int row, int col, const Lhs& lhs, const Rhs& rhs, + typename Lhs::Scalar &res) { ei_product_unroller::run(row, col, lhs, rhs, res); res += lhs.coeff(row, Index) * rhs.coeff(Index, col); @@ -42,7 +42,7 @@ struct ei_product_unroller template struct ei_product_unroller<0, Size, Lhs, Rhs> { - static void run(int row, int col, const Lhs& lhs, const Rhs& rhs, + inline static void run(int row, int col, const Lhs& lhs, const Rhs& rhs, typename Lhs::Scalar &res) { res = lhs.coeff(row, 0) * rhs.coeff(0, col); @@ -52,14 +52,14 @@ struct ei_product_unroller<0, Size, Lhs, Rhs> template struct ei_product_unroller { - static void run(int, int, const Lhs&, const Rhs&, typename Lhs::Scalar&) {} + inline static void run(int, int, const Lhs&, const Rhs&, typename Lhs::Scalar&) {} }; // prevent buggy user code from causing an infinite recursion template struct ei_product_unroller { - static void run(int, int, const Lhs&, const Rhs&, typename Lhs::Scalar&) {} + inline static void run(int, int, const Lhs&, const Rhs&, typename Lhs::Scalar&) {} }; template @@ -68,7 +68,7 @@ struct ei_packet_product_unroller; template struct ei_packet_product_unroller { - static void run(int row, int col, const Lhs& lhs, const Rhs& rhs, PacketScalar &res) + inline static void run(int row, int col, const Lhs& lhs, const Rhs& rhs, PacketScalar &res) { ei_packet_product_unroller::run(row, col, lhs, rhs, res); res = ei_pmadd(ei_pset1(lhs.coeff(row, Index)), rhs.template packetCoeff(Index, col), res); @@ -78,7 +78,7 @@ struct ei_packet_product_unroller template struct ei_packet_product_unroller { - static void run(int row, int col, const Lhs& lhs, const Rhs& rhs, PacketScalar &res) + inline static void run(int row, int col, const Lhs& lhs, const Rhs& rhs, PacketScalar &res) { ei_packet_product_unroller::run(row, col, lhs, rhs, res); res = ei_pmadd(lhs.template packetCoeff(row, Index), ei_pset1(rhs.coeff(Index, col)), res); @@ -88,7 +88,7 @@ struct ei_packet_product_unroller template struct ei_packet_product_unroller { - static void run(int row, int col, const Lhs& lhs, const Rhs& rhs, PacketScalar &res) + inline static void run(int row, int col, const Lhs& lhs, const Rhs& rhs, PacketScalar &res) { res = ei_pmul(ei_pset1(lhs.coeff(row, 0)),rhs.template packetCoeff(0, col)); } @@ -97,7 +97,7 @@ struct ei_packet_product_unroller template struct ei_packet_product_unroller { - static void run(int row, int col, const Lhs& lhs, const Rhs& rhs, PacketScalar &res) + inline static void run(int row, int col, const Lhs& lhs, const Rhs& rhs, PacketScalar &res) { res = ei_pmul(lhs.template packetCoeff(row, 0), ei_pset1(rhs.coeff(0, col))); } @@ -106,13 +106,13 @@ struct ei_packet_product_unroller template struct ei_packet_product_unroller { - static void run(int, int, const Lhs&, const Rhs&, PacketScalar&) {} + inline static void run(int, int, const Lhs&, const Rhs&, PacketScalar&) {} }; template struct ei_packet_product_unroller { - static void run(int, int, const Lhs&, const Rhs&, PacketScalar&) {} + inline static void run(int, int, const Lhs&, const Rhs&, PacketScalar&) {} }; template struct ProductPacketCoeffImpl { @@ -260,7 +260,7 @@ template class Product : ei_no_assignm PacketSize = ei_packet_traits::size }; - Product(const Lhs& lhs, const Rhs& rhs) + inline Product(const Lhs& lhs, const Rhs& rhs) : m_lhs(lhs), m_rhs(rhs) { ei_assert(lhs.cols() == rhs.rows()); @@ -272,8 +272,8 @@ template class Product : ei_no_assignm private: - int _rows() const { return m_lhs.rows(); } - int _cols() const { return m_rhs.cols(); } + inline int _rows() const { return m_lhs.rows(); } + inline int _cols() const { return m_rhs.cols(); } const Scalar _coeff(int row, int col) const { @@ -296,7 +296,7 @@ template class Product : ei_no_assignm } template - PacketScalar _packetCoeff(int row, int col) const + const PacketScalar _packetCoeff(int row, int col) const { if(Lhs::ColsAtCompileTime <= EIGEN_UNROLLING_LIMIT) { @@ -312,7 +312,7 @@ template class Product : ei_no_assignm return ProductPacketCoeffImpl::execute(*this, row, col); } - PacketScalar _packetCoeffRowMajor(int row, int col) const + const PacketScalar _packetCoeffRowMajor(int row, int col) const { PacketScalar res; res = ei_pmul(ei_pset1(m_lhs.coeff(row, 0)),m_rhs.template packetCoeff(0, col)); @@ -321,7 +321,7 @@ template class Product : ei_no_assignm return res; } - PacketScalar _packetCoeffColumnMajor(int row, int col) const + const PacketScalar _packetCoeffColumnMajor(int row, int col) const { PacketScalar res; res = ei_pmul(m_lhs.template packetCoeff(row, 0), ei_pset1(m_rhs.coeff(0, col))); @@ -348,7 +348,7 @@ template class Product : ei_no_assignm */ template template -const Product +inline const Product MatrixBase::operator*(const MatrixBase &other) const { return Product(derived(), other.derived()); @@ -360,7 +360,7 @@ MatrixBase::operator*(const MatrixBase &other) const */ template template -Derived & +inline Derived & MatrixBase::operator*=(const MatrixBase &other) { return *this = *this * other; @@ -368,7 +368,7 @@ MatrixBase::operator*=(const MatrixBase &other) template template -Derived& MatrixBase::lazyAssign(const Product& product) +inline Derived& MatrixBase::lazyAssign(const Product& product) { product._cacheFriendlyEval(derived()); return derived(); @@ -376,7 +376,7 @@ Derived& MatrixBase::lazyAssign(const Product template -void Product::_cacheFriendlyEval(DestDerived& res) const +inline void Product::_cacheFriendlyEval(DestDerived& res) const { #ifndef EIGEN_WIP_PRODUCT_DIRTY res.setZero(); diff --git a/Eigen/src/Core/Redux.h b/Eigen/src/Core/Redux.h index cb8f4d525..5b14f5b27 100644 --- a/Eigen/src/Core/Redux.h +++ b/Eigen/src/Core/Redux.h @@ -203,7 +203,7 @@ MatrixBase::redux(const BinaryOp& func) const */ template typename ei_traits::Scalar -MatrixBase::sum() const +inline MatrixBase::sum() const { return this->redux(Eigen::ei_scalar_sum_op()); } @@ -216,7 +216,7 @@ MatrixBase::sum() const */ template typename ei_traits::Scalar -MatrixBase::trace() const +inline MatrixBase::trace() const { return diagonal().sum(); } @@ -225,7 +225,7 @@ MatrixBase::trace() const */ template typename ei_traits::Scalar -MatrixBase::minCoeff() const +inline MatrixBase::minCoeff() const { return this->redux(Eigen::ei_scalar_min_op()); } @@ -234,7 +234,7 @@ MatrixBase::minCoeff() const */ template typename ei_traits::Scalar -MatrixBase::maxCoeff() const +inline MatrixBase::maxCoeff() const { return this->redux(Eigen::ei_scalar_max_op()); } @@ -249,7 +249,7 @@ struct ei_all_unroller row = (UnrollCount-1) % Derived::RowsAtCompileTime }; - static bool run(const Derived &mat) + inline static bool run(const Derived &mat) { return ei_all_unroller::run(mat) && mat.coeff(row, col); } @@ -258,13 +258,13 @@ struct ei_all_unroller template struct ei_all_unroller { - static bool run(const Derived &mat) { return mat.coeff(0, 0); } + inline static bool run(const Derived &mat) { return mat.coeff(0, 0); } }; template struct ei_all_unroller { - static bool run(const Derived &) { return false; } + inline static bool run(const Derived &) { return false; } }; template @@ -275,7 +275,7 @@ struct ei_any_unroller row = (UnrollCount-1) % Derived::RowsAtCompileTime }; - static bool run(const Derived &mat) + inline static bool run(const Derived &mat) { return ei_any_unroller::run(mat) || mat.coeff(row, col); } @@ -284,13 +284,13 @@ struct ei_any_unroller template struct ei_any_unroller { - static bool run(const Derived &mat) { return mat.coeff(0, 0); } + inline static bool run(const Derived &mat) { return mat.coeff(0, 0); } }; template struct ei_any_unroller { - static bool run(const Derived &) { return false; } + inline static bool run(const Derived &) { return false; } }; /** \returns true if all coefficients are true diff --git a/Eigen/src/Core/Temporary.h b/Eigen/src/Core/Temporary.h index 854bb4698..ed62ea786 100644 --- a/Eigen/src/Core/Temporary.h +++ b/Eigen/src/Core/Temporary.h @@ -59,20 +59,20 @@ template class Temporary EIGEN_GENERIC_PUBLIC_INTERFACE(Temporary) - Temporary(const ExpressionType& matrix) : m_expression(matrix) {} + inline Temporary(const ExpressionType& matrix) : m_expression(matrix) {} private: - int _rows() const { return m_expression.rows(); } - int _cols() const { return m_expression.cols(); } + inline int _rows() const { return m_expression.rows(); } + inline int _cols() const { return m_expression.cols(); } - const Scalar _coeff(int row, int col) const + inline const Scalar _coeff(int row, int col) const { return m_expression.coeff(row, col); } template - PacketScalar _packetCoeff(int row, int col) const + inline const PacketScalar _packetCoeff(int row, int col) const { return m_expression.template packetCoeff(row, col); } @@ -84,7 +84,7 @@ template class Temporary /** \returns an expression of the temporary version of *this. */ template -const Temporary +inline const Temporary MatrixBase::temporary() const { return Temporary(derived()); diff --git a/Eigen/src/Core/Transpose.h b/Eigen/src/Core/Transpose.h index d98d06597..e7f37bbae 100644 --- a/Eigen/src/Core/Transpose.h +++ b/Eigen/src/Core/Transpose.h @@ -60,35 +60,35 @@ template class Transpose EIGEN_GENERIC_PUBLIC_INTERFACE(Transpose) - Transpose(const MatrixType& matrix) : m_matrix(matrix) {} + inline Transpose(const MatrixType& matrix) : m_matrix(matrix) {} EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Transpose) private: - int _rows() const { return m_matrix.cols(); } - int _cols() const { return m_matrix.rows(); } + inline int _rows() const { return m_matrix.cols(); } + inline int _cols() const { return m_matrix.rows(); } - int _stride(void) const { return m_matrix.stride(); } + inline int _stride(void) const { return m_matrix.stride(); } - Scalar& _coeffRef(int row, int col) + inline Scalar& _coeffRef(int row, int col) { return m_matrix.const_cast_derived().coeffRef(col, row); } - const Scalar _coeff(int row, int col) const + inline const Scalar _coeff(int row, int col) const { return m_matrix.coeff(col, row); } template - PacketScalar _packetCoeff(int row, int col) const + inline const PacketScalar _packetCoeff(int row, int col) const { return m_matrix.template packetCoeff(col, row); } template - void _writePacketCoeff(int row, int col, const PacketScalar& x) + inline void _writePacketCoeff(int row, int col, const PacketScalar& x) { m_matrix.const_cast_derived().template writePacketCoeff(col, row, x); } @@ -104,7 +104,7 @@ template class Transpose * * \sa adjoint(), class DiagonalCoeffs */ template -Transpose +inline Transpose MatrixBase::transpose() { return Transpose(derived()); @@ -112,7 +112,7 @@ MatrixBase::transpose() /** This is the const version of transpose(). \sa adjoint() */ template -const Transpose +inline const Transpose MatrixBase::transpose() const { return Transpose(derived()); @@ -125,7 +125,9 @@ MatrixBase::transpose() const * * \sa transpose(), conjugate(), class Transpose, class ei_scalar_conjugate_op */ template -const Transpose::Scalar>, Derived > > > +inline const Transpose::Scalar>, Derived > + > > MatrixBase::adjoint() const { return conjugate().temporary().transpose(); diff --git a/Eigen/src/Core/Triangular.h b/Eigen/src/Core/Triangular.h index 8a17a3fee..ff2dcbb37 100755 --- a/Eigen/src/Core/Triangular.h +++ b/Eigen/src/Core/Triangular.h @@ -79,7 +79,7 @@ template class Triangular EIGEN_GENERIC_PUBLIC_INTERFACE(Triangular) - Triangular(const MatrixType& matrix) + inline Triangular(const MatrixType& matrix) : m_matrix(matrix) { assert(!( (Flags&UnitDiagBit) && (Flags&NullDiagBit))); @@ -89,15 +89,15 @@ template class Triangular EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Triangular) /** Overloaded to keep a Triangular expression */ - Triangular<(Upper | Lower) xor Mode, Temporary > > transpose() + inline Triangular<(Upper | Lower) ^ Mode, Temporary > > transpose() { - return Triangular<(Upper | Lower) xor Mode, Temporary > >((m_matrix.transpose().temporary())); + return Triangular<(Upper | Lower) ^ Mode, Temporary > >((m_matrix.transpose().temporary())); } /** Overloaded to keep a Triangular expression */ - const Triangular<(Upper | Lower) xor Mode, Temporary > > transpose() const + inline const Triangular<(Upper | Lower) ^ Mode, Temporary > > transpose() const { - return Triangular<(Upper | Lower) xor Mode, Temporary > >((m_matrix.transpose().temporary())); + return Triangular<(Upper | Lower) ^ Mode, Temporary > >((m_matrix.transpose().temporary())); } /** \returns the product of the inverse of *this with \a other. @@ -154,16 +154,16 @@ template class Triangular private: - int _rows() const { return m_matrix.rows(); } - int _cols() const { return m_matrix.cols(); } + inline int _rows() const { return m_matrix.rows(); } + inline int _cols() const { return m_matrix.cols(); } - Scalar& _coeffRef(int row, int col) + inline Scalar& _coeffRef(int row, int col) { ei_assert( ((! (Flags & Lower)) && row<=col) || (Flags & Lower && col<=row)); return m_matrix.const_cast_derived().coeffRef(row, col); } - Scalar _coeff(int row, int col) const + inline Scalar _coeff(int row, int col) const { if ((Flags & Lower) ? col>row : row>col) return 0; @@ -185,14 +185,14 @@ template class Triangular * \sa isUpper(), upperWithNullDiagBit(), upperWithNullDiagBit(), lower() */ template -Triangular MatrixBase::upper(void) +inline Triangular MatrixBase::upper(void) { return Triangular(derived()); } /** This is the const version of upper(). */ template -const Triangular MatrixBase::upper(void) const +inline const Triangular MatrixBase::upper(void) const { return Triangular(derived()); } @@ -202,14 +202,14 @@ const Triangular MatrixBase::upper(void) const * \sa isLower(), lowerWithUnitDiag(), lowerWithNullDiag(), upper() */ template -Triangular MatrixBase::lower(void) +inline Triangular MatrixBase::lower(void) { return Triangular(derived()); } /** This is the const version of lower().*/ template -const Triangular MatrixBase::lower(void) const +inline const Triangular MatrixBase::lower(void) const { return Triangular(derived()); } @@ -219,7 +219,7 @@ const Triangular MatrixBase::lower(void) const * \sa upper(), lowerWithUnitDiagBit() */ template -const Triangular MatrixBase::upperWithUnitDiag(void) const +inline const Triangular MatrixBase::upperWithUnitDiag(void) const { return Triangular(derived()); } @@ -230,7 +230,7 @@ const Triangular MatrixBase::upperWithUnitD * \sa upper(), lowerWithNullDiag() */ template -const Triangular MatrixBase::upperWithNullDiag(void) const +inline const Triangular MatrixBase::upperWithNullDiag(void) const { return Triangular(derived()); } @@ -240,7 +240,7 @@ const Triangular MatrixBase::upperWithNullD * \sa lower(), upperWithUnitDiag() */ template -const Triangular MatrixBase::lowerWithUnitDiag(void) const +inline const Triangular MatrixBase::lowerWithUnitDiag(void) const { return Triangular(derived()); } @@ -251,7 +251,7 @@ const Triangular MatrixBase::lowerWithUnitD * \sa lower(), upperWithNullDiag() */ template -const Triangular MatrixBase::lowerWithNullDiag(void) const +inline const Triangular MatrixBase::lowerWithNullDiag(void) const { return Triangular(derived()); } @@ -300,5 +300,4 @@ bool MatrixBase::isLower(RealScalar prec) const return true; } - #endif // EIGEN_TRIANGULAR_H diff --git a/Eigen/src/Core/TriangularAssign.h b/Eigen/src/Core/TriangularAssign.h index c52085ef1..ec208f2ad 100644 --- a/Eigen/src/Core/TriangularAssign.h +++ b/Eigen/src/Core/TriangularAssign.h @@ -33,7 +33,7 @@ struct ei_triangular_assign_unroller row = (UnrollCount-1) % Derived1::RowsAtCompileTime }; - static void run(Derived1 &dst, const Derived2 &src) + inline static void run(Derived1 &dst, const Derived2 &src) { ei_triangular_assign_unroller struct ei_triangular_assign_unroller { - static void run(Derived1 &dst, const Derived2 &src) + inline static void run(Derived1 &dst, const Derived2 &src) { dst.coeffRef(0, 0) = src.coeff(0, 0); } @@ -57,13 +57,13 @@ struct ei_triangular_assign_unroller template struct ei_triangular_assign_unroller { - static void run(Derived1 &, const Derived2 &) {} + inline static void run(Derived1 &, const Derived2 &) {} }; template struct ei_triangular_assign_unroller { - static void run(Derived1 &, const Derived2 &) {} + inline static void run(Derived1 &, const Derived2 &) {} }; diff --git a/Eigen/src/Core/Visitor.h b/Eigen/src/Core/Visitor.h index ac3ccc2cc..9dd8ef661 100644 --- a/Eigen/src/Core/Visitor.h +++ b/Eigen/src/Core/Visitor.h @@ -33,7 +33,7 @@ struct ei_visitor_unroller row = (UnrollCount-1) % Derived::RowsAtCompileTime }; - static void run(const Derived &mat, Visitor& visitor) + inline static void run(const Derived &mat, Visitor& visitor) { ei_visitor_unroller::run(mat, visitor); visitor(mat.coeff(row, col), row, col); @@ -43,7 +43,7 @@ struct ei_visitor_unroller template struct ei_visitor_unroller { - static void run(const Derived &mat, Visitor& visitor) + inline static void run(const Derived &mat, Visitor& visitor) { return visitor.init(mat.coeff(0, 0), 0, 0); } @@ -52,7 +52,7 @@ struct ei_visitor_unroller template struct ei_visitor_unroller { - static void run(const Derived &, Visitor&) {} + inline static void run(const Derived &, Visitor&) {} }; @@ -100,7 +100,7 @@ struct ei_coeff_visitor { int row, col; Scalar res; - void init(const Scalar& value, int i, int j) + inline void init(const Scalar& value, int i, int j) { res = value; row = i; diff --git a/Eigen/src/Core/arch/AltiVec/PacketMath.h b/Eigen/src/Core/arch/AltiVec/PacketMath.h index aec4e9312..b2627ae4b 100644 --- a/Eigen/src/Core/arch/AltiVec/PacketMath.h +++ b/Eigen/src/Core/arch/AltiVec/PacketMath.h @@ -46,7 +46,7 @@ inline vector int ei_psub(const vector int a, const vector int b) { r inline vector float ei_pmul(const vector float a, const vector float b) { return vec_madd(a,b, v0f); } inline vector int ei_pmul(const vector int a, const vector int b) { - // Taken from http:// + // Taken from http://developer.apple.com/hardwaredrivers/ve/algorithms.html#Multiply32 //Set up constants vector int bswap, lowProduct, highProduct; diff --git a/Eigen/src/Core/util/Macros.h b/Eigen/src/Core/util/Macros.h index 4b8c5fedb..306144218 100644 --- a/Eigen/src/Core/util/Macros.h +++ b/Eigen/src/Core/util/Macros.h @@ -86,9 +86,9 @@ using Eigen::MatrixBase; // Eval.h:91: sorry, unimplemented: inlining failed in call to 'const Eigen::Eval Eigen::MatrixBase::eval() const' // : function body not available #if EIGEN_GNUC_AT_LEAST(4,0) -#define EIGEN_INLINE __attribute__((always_inline)) +#define EIGEN_ALWAYS_INLINE __attribute__((always_inline)) inline #else -#define EIGEN_INLINE inline +#define EIGEN_ALWAYS_INLINE inline #endif #if (defined __GNUC__) -- cgit v1.2.3