From 270ea539fa18e3db40c23b99c96466cd203c2fd1 Mon Sep 17 00:00:00 2001 From: Rasmus Munk Larsen <4643818-rmlarsen1@users.noreply.gitlab.com> Date: Fri, 20 Feb 2026 19:50:52 -0800 Subject: [PATCH] Remove redundant EIGEN_STRONG_INLINE from trivial constexpr and = default functions libeigen/eigen!2161 Co-authored-by: Rasmus Munk Larsen --- Eigen/src/Core/Array.h | 12 +- Eigen/src/Core/Block.h | 12 +- Eigen/src/Core/CoreEvaluators.h | 39 ++- Eigen/src/Core/CwiseBinaryOp.h | 4 +- Eigen/src/Core/CwiseNullaryOp.h | 4 +- Eigen/src/Core/CwiseUnaryOp.h | 4 +- Eigen/src/Core/CwiseUnaryView.h | 4 +- Eigen/src/Core/DenseCoeffsBase.h | 46 ++-- Eigen/src/Core/DenseStorage.h | 275 +++++++++---------- Eigen/src/Core/DeviceWrapper.h | 2 +- Eigen/src/Core/Diagonal.h | 10 +- Eigen/src/Core/Fill.h | 8 +- Eigen/src/Core/GeneralProduct.h | 8 +- Eigen/src/Core/Matrix.h | 12 +- Eigen/src/Core/NumTraits.h | 4 +- Eigen/src/Core/PlainObjectBase.h | 34 +-- Eigen/src/Core/Product.h | 4 +- Eigen/src/Core/Transpose.h | 12 +- Eigen/src/Core/arch/clang/Complex.h | 2 +- Eigen/src/Core/functors/AssignmentFunctors.h | 4 +- Eigen/src/Core/functors/NullaryFunctors.h | 2 +- Eigen/src/Core/util/Macros.h | 2 +- Eigen/src/Core/util/MaxSizeVector.h | 12 +- Eigen/src/Core/util/Memory.h | 8 +- Eigen/src/Core/util/MoreMeta.h | 77 +++--- Eigen/src/Core/util/XprHelper.h | 6 +- 26 files changed, 274 insertions(+), 333 deletions(-) diff --git a/Eigen/src/Core/Array.h b/Eigen/src/Core/Array.h index 57f3186b0..dd6ea3273 100644 --- a/Eigen/src/Core/Array.h +++ b/Eigen/src/Core/Array.h @@ -123,12 +123,12 @@ class Array : public PlainObjectBase::value) { Base::operator=(std::move(other)); return *this; @@ -178,9 +178,7 @@ class Array : public PlainObjectBase>& list) - : Base(list) {} + EIGEN_DEVICE_FUNC constexpr Array(const std::initializer_list>& list) : Base(list) {} #ifndef EIGEN_PARSED_BY_DOXYGEN template @@ -239,7 +237,7 @@ class Array : public PlainObjectBase EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE XprType& nestedExpression() { return m_xpr; } /** \sa MapBase::innerStride() */ - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index innerStride() const noexcept { + EIGEN_DEVICE_FUNC constexpr Index innerStride() const noexcept { return internal::traits::HasSameStorageOrderAsXprType ? m_xpr.innerStride() : m_xpr.outerStride(); } /** \sa MapBase::outerStride() */ - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index outerStride() const noexcept { + EIGEN_DEVICE_FUNC constexpr Index outerStride() const noexcept { return internal::traits::HasSameStorageOrderAsXprType ? m_xpr.outerStride() : m_xpr.innerStride(); } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr StorageIndex startRow() const noexcept { return m_startRow.value(); } + EIGEN_DEVICE_FUNC constexpr StorageIndex startRow() const noexcept { return m_startRow.value(); } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr StorageIndex startCol() const noexcept { return m_startCol.value(); } + EIGEN_DEVICE_FUNC constexpr StorageIndex startCol() const noexcept { return m_startCol.value(); } #ifndef __SUNPRO_CC // FIXME sunstudio is not friendly with the above friend... diff --git a/Eigen/src/Core/CoreEvaluators.h b/Eigen/src/Core/CoreEvaluators.h index 60857e2cc..e8e8722bd 100644 --- a/Eigen/src/Core/CoreEvaluators.h +++ b/Eigen/src/Core/CoreEvaluators.h @@ -124,7 +124,7 @@ struct evaluator_base { // noncopyable: // Don't make this class inherit noncopyable as this kills EBO (Empty Base Optimization) // and make complex evaluator much larger than then should do. - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr evaluator_base() = default; + EIGEN_DEVICE_FUNC constexpr evaluator_base() = default; private: EIGEN_DEVICE_FUNC evaluator_base(const evaluator_base&); @@ -142,23 +142,22 @@ struct evaluator_base { template class plainobjectbase_evaluator_data { public: - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr plainobjectbase_evaluator_data(const Scalar* ptr, Index outerStride) - : data(ptr) { + EIGEN_DEVICE_FUNC constexpr plainobjectbase_evaluator_data(const Scalar* ptr, Index outerStride) : data(ptr) { #ifndef EIGEN_INTERNAL_DEBUGGING EIGEN_UNUSED_VARIABLE(outerStride); #endif eigen_internal_assert(outerStride == OuterStride); } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index outerStride() const noexcept { return OuterStride; } + EIGEN_DEVICE_FUNC constexpr Index outerStride() const noexcept { return OuterStride; } const Scalar* data; }; template class plainobjectbase_evaluator_data { public: - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr plainobjectbase_evaluator_data(const Scalar* ptr, Index outerStride) + EIGEN_DEVICE_FUNC constexpr plainobjectbase_evaluator_data(const Scalar* ptr, Index outerStride) : data(ptr), m_outerStride(outerStride) {} - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index outerStride() const { return m_outerStride; } + EIGEN_DEVICE_FUNC constexpr Index outerStride() const { return m_outerStride; } const Scalar* data; protected: @@ -188,11 +187,11 @@ struct evaluator> : evaluator_base { : RowsAtCompileTime }; - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr evaluator() : m_d(0, OuterStrideAtCompileTime) { + EIGEN_DEVICE_FUNC constexpr evaluator() : m_d(0, OuterStrideAtCompileTime) { EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost); } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr explicit evaluator(const PlainObjectType& m) + EIGEN_DEVICE_FUNC constexpr explicit evaluator(const PlainObjectType& m) : m_d(m.data(), IsVectorAtCompileTime ? 0 : m.outerStride()) { EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost); } @@ -257,7 +256,7 @@ struct evaluator> : evaluator_base { plainobjectbase_evaluator_data m_d; private: - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index constexpr getIndex(Index row, Index col) const { + EIGEN_DEVICE_FUNC constexpr Index getIndex(Index row, Index col) const { return IsRowMajor ? row * m_d.outerStride() + col : row + col * m_d.outerStride(); } }; @@ -267,10 +266,9 @@ struct evaluator> : evaluator>> { typedef Matrix XprType; - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr evaluator() = default; + EIGEN_DEVICE_FUNC constexpr evaluator() = default; - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr explicit evaluator(const XprType& m) - : evaluator>(m) {} + EIGEN_DEVICE_FUNC constexpr explicit evaluator(const XprType& m) : evaluator>(m) {} }; template @@ -278,10 +276,9 @@ struct evaluator> : evaluator>> { typedef Array XprType; - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr evaluator() = default; + EIGEN_DEVICE_FUNC constexpr evaluator() = default; - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr explicit evaluator(const XprType& m) - : evaluator>(m) {} + EIGEN_DEVICE_FUNC constexpr explicit evaluator(const XprType& m) : evaluator>(m) {} }; // -------------------- Transpose -------------------- @@ -1309,10 +1306,10 @@ struct mapbase_evaluator : evaluator_base { } protected: - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index rowStride() const noexcept { + EIGEN_DEVICE_FUNC constexpr Index rowStride() const noexcept { return XprType::IsRowMajor ? m_outerStride.value() : m_innerStride.value(); } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index colStride() const noexcept { + EIGEN_DEVICE_FUNC constexpr Index colStride() const noexcept { return XprType::IsRowMajor ? m_innerStride.value() : m_outerStride.value(); } @@ -1954,12 +1951,8 @@ struct evaluator> : evaluator_base m_index; private: - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index rowOffset() const { - return m_index.value() > 0 ? 0 : -m_index.value(); - } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index colOffset() const { - return m_index.value() > 0 ? m_index.value() : 0; - } + EIGEN_DEVICE_FUNC constexpr Index rowOffset() const { return m_index.value() > 0 ? 0 : -m_index.value(); } + EIGEN_DEVICE_FUNC constexpr Index colOffset() const { return m_index.value() > 0 ? m_index.value() : 0; } }; //---------------------------------------------------------------------- diff --git a/Eigen/src/Core/CwiseBinaryOp.h b/Eigen/src/Core/CwiseBinaryOp.h index e7664ef07..e3051a796 100644 --- a/Eigen/src/Core/CwiseBinaryOp.h +++ b/Eigen/src/Core/CwiseBinaryOp.h @@ -108,12 +108,12 @@ class CwiseBinaryOp : public CwiseBinaryOpImpl>::RowsAtCompileTime == Dynamic ? m_rhs.rows() : m_lhs.rows(); } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index cols() const noexcept { + EIGEN_DEVICE_FUNC constexpr Index cols() const noexcept { // return the fixed size type if available to enable compile time optimizations return internal::traits>::ColsAtCompileTime == Dynamic ? m_rhs.cols() : m_lhs.cols(); diff --git a/Eigen/src/Core/CwiseNullaryOp.h b/Eigen/src/Core/CwiseNullaryOp.h index 084f503f2..401a54dfc 100644 --- a/Eigen/src/Core/CwiseNullaryOp.h +++ b/Eigen/src/Core/CwiseNullaryOp.h @@ -76,8 +76,8 @@ class CwiseNullaryOp : public internal::dense_xpr_base : public EigenBase { * * \sa operator()(Index,Index) const, coeffRef(Index,Index), coeff(Index) const */ - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr CoeffReturnType coeff(Index row, Index col) const { + EIGEN_DEVICE_FUNC constexpr CoeffReturnType coeff(Index row, Index col) const { eigen_internal_assert(row >= 0 && row < rows() && col >= 0 && col < cols()); return internal::evaluator(derived()).coeff(row, col); } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr CoeffReturnType coeffByOuterInner(Index outer, Index inner) const { + EIGEN_DEVICE_FUNC constexpr CoeffReturnType coeffByOuterInner(Index outer, Index inner) const { return coeff(rowIndexByOuterInner(outer, inner), colIndexByOuterInner(outer, inner)); } @@ -108,7 +108,7 @@ class DenseCoeffsBase : public EigenBase { * * \sa operator()(Index,Index), operator[](Index) */ - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr CoeffReturnType operator()(Index row, Index col) const { + EIGEN_DEVICE_FUNC constexpr CoeffReturnType operator()(Index row, Index col) const { eigen_assert(row >= 0 && row < rows() && col >= 0 && col < cols()); return coeff(row, col); } @@ -118,9 +118,7 @@ class DenseCoeffsBase : public EigenBase { * * \sa operator[](Index,Index), operator[](Index) */ - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr CoeffReturnType operator[](Index row, Index col) const { - return operator()(row, col); - } + EIGEN_DEVICE_FUNC constexpr CoeffReturnType operator[](Index row, Index col) const { return operator()(row, col); } #endif /** Short version: don't use this function, use @@ -138,7 +136,7 @@ class DenseCoeffsBase : public EigenBase { * \sa operator[](Index) const, coeffRef(Index), coeff(Index,Index) const */ - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr CoeffReturnType coeff(Index index) const { + EIGEN_DEVICE_FUNC constexpr CoeffReturnType coeff(Index index) const { EIGEN_STATIC_ASSERT(internal::evaluator::Flags & LinearAccessBit, THIS_COEFFICIENT_ACCESSOR_TAKING_ONE_ACCESS_IS_ONLY_FOR_EXPRESSIONS_ALLOWING_LINEAR_ACCESS) eigen_internal_assert(index >= 0 && index < size()); @@ -153,7 +151,7 @@ class DenseCoeffsBase : public EigenBase { * z() const, w() const */ - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr CoeffReturnType operator[](Index index) const { + EIGEN_DEVICE_FUNC constexpr CoeffReturnType operator[](Index index) const { EIGEN_STATIC_ASSERT(Derived::IsVectorAtCompileTime, THE_BRACKET_OPERATOR_IS_ONLY_FOR_VECTORS__USE_THE_PARENTHESIS_OPERATOR_INSTEAD) eigen_assert(index >= 0 && index < size()); @@ -170,32 +168,32 @@ class DenseCoeffsBase : public EigenBase { * z() const, w() const */ - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr CoeffReturnType operator()(Index index) const { + EIGEN_DEVICE_FUNC constexpr CoeffReturnType operator()(Index index) const { eigen_assert(index >= 0 && index < size()); return coeff(index); } /** equivalent to operator[](0). */ - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr CoeffReturnType x() const { return (*this)[0]; } + EIGEN_DEVICE_FUNC constexpr CoeffReturnType x() const { return (*this)[0]; } /** equivalent to operator[](1). */ - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr CoeffReturnType y() const { + EIGEN_DEVICE_FUNC constexpr CoeffReturnType y() const { EIGEN_STATIC_ASSERT(Derived::SizeAtCompileTime == -1 || Derived::SizeAtCompileTime >= 2, OUT_OF_RANGE_ACCESS); return (*this)[1]; } /** equivalent to operator[](2). */ - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr CoeffReturnType z() const { + EIGEN_DEVICE_FUNC constexpr CoeffReturnType z() const { EIGEN_STATIC_ASSERT(Derived::SizeAtCompileTime == -1 || Derived::SizeAtCompileTime >= 3, OUT_OF_RANGE_ACCESS); return (*this)[2]; } /** equivalent to operator[](3). */ - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr CoeffReturnType w() const { + EIGEN_DEVICE_FUNC constexpr CoeffReturnType w() const { EIGEN_STATIC_ASSERT(Derived::SizeAtCompileTime == -1 || Derived::SizeAtCompileTime >= 4, OUT_OF_RANGE_ACCESS); return (*this)[3]; } @@ -313,7 +311,7 @@ class DenseCoeffsBase : public DenseCoeffsBase= 0 && row < rows() && col >= 0 && col < cols()); return internal::evaluator(derived()).coeffRef(row, col); } @@ -326,7 +324,7 @@ class DenseCoeffsBase : public DenseCoeffsBase= 0 && row < rows() && col >= 0 && col < cols()); return coeffRef(row, col); } @@ -336,9 +334,7 @@ class DenseCoeffsBase : public DenseCoeffsBase : public DenseCoeffsBase::Flags & LinearAccessBit, THIS_COEFFICIENT_ACCESSOR_TAKING_ONE_ACCESS_IS_ONLY_FOR_EXPRESSIONS_ALLOWING_LINEAR_ACCESS) eigen_internal_assert(index >= 0 && index < size()); @@ -370,7 +366,7 @@ class DenseCoeffsBase : public DenseCoeffsBase= 0 && index < size()); @@ -386,32 +382,32 @@ class DenseCoeffsBase : public DenseCoeffsBase= 0 && index < size()); return coeffRef(index); } /** equivalent to operator[](0). */ - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Scalar& x() { return (*this)[0]; } + EIGEN_DEVICE_FUNC constexpr Scalar& x() { return (*this)[0]; } /** equivalent to operator[](1). */ - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Scalar& y() { + EIGEN_DEVICE_FUNC constexpr Scalar& y() { EIGEN_STATIC_ASSERT(Derived::SizeAtCompileTime == -1 || Derived::SizeAtCompileTime >= 2, OUT_OF_RANGE_ACCESS); return (*this)[1]; } /** equivalent to operator[](2). */ - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Scalar& z() { + EIGEN_DEVICE_FUNC constexpr Scalar& z() { EIGEN_STATIC_ASSERT(Derived::SizeAtCompileTime == -1 || Derived::SizeAtCompileTime >= 3, OUT_OF_RANGE_ACCESS); return (*this)[2]; } /** equivalent to operator[](3). */ - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Scalar& w() { + EIGEN_DEVICE_FUNC constexpr Scalar& w() { EIGEN_STATIC_ASSERT(Derived::SizeAtCompileTime == -1 || Derived::SizeAtCompileTime >= 4, OUT_OF_RANGE_ACCESS); return (*this)[3]; } diff --git a/Eigen/src/Core/DenseStorage.h b/Eigen/src/Core/DenseStorage.h index 45c8779ac..289212774 100644 --- a/Eigen/src/Core/DenseStorage.h +++ b/Eigen/src/Core/DenseStorage.h @@ -54,7 +54,7 @@ template { // on some 32-bit platforms, stack-allocated arrays are aligned to 4 bytes, not the preferred alignment of T EIGEN_ALIGN_TO_BOUNDARY(alignof(T)) T array[Size]; #if defined(EIGEN_NO_DEBUG) || defined(EIGEN_TESTING_PLAINOBJECT_CTOR) - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr plain_array() = default; + EIGEN_DEVICE_FUNC constexpr plain_array() = default; #else EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr plain_array() { EIGEN_MAKE_STACK_ALLOCATION_ASSERT(Size * sizeof(T)) } #endif @@ -92,8 +92,8 @@ class DenseStorage_impl { public: #ifndef EIGEN_DENSE_STORAGE_CTOR_PLUGIN - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr DenseStorage_impl() = default; - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr DenseStorage_impl(const DenseStorage_impl&) = default; + EIGEN_DEVICE_FUNC constexpr DenseStorage_impl() = default; + EIGEN_DEVICE_FUNC constexpr DenseStorage_impl(const DenseStorage_impl&) = default; #else EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr DenseStorage_impl() { EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN(Index size = Size) @@ -103,19 +103,18 @@ class DenseStorage_impl { smart_copy(other.m_data.array, other.m_data.array + Size, m_data.array); } #endif - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr DenseStorage_impl(Index /*size*/, Index /*rows*/, Index /*cols*/) {} - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr DenseStorage_impl& operator=(const DenseStorage_impl&) = default; + EIGEN_DEVICE_FUNC constexpr DenseStorage_impl(Index /*size*/, Index /*rows*/, Index /*cols*/) {} + EIGEN_DEVICE_FUNC constexpr DenseStorage_impl& operator=(const DenseStorage_impl&) = default; EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr void swap(DenseStorage_impl& other) { numext::swap(m_data, other.m_data); } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr void conservativeResize(Index /*size*/, Index /*rows*/, - Index /*cols*/) {} - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr void resize(Index /*size*/, Index /*rows*/, Index /*cols*/) {} - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index rows() const { return Rows; } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index cols() const { return Cols; } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index size() const { return Rows * Cols; } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr T* data() { return m_data.array; } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr const T* data() const { return m_data.array; } + EIGEN_DEVICE_FUNC constexpr void conservativeResize(Index /*size*/, Index /*rows*/, Index /*cols*/) {} + EIGEN_DEVICE_FUNC constexpr void resize(Index /*size*/, Index /*rows*/, Index /*cols*/) {} + EIGEN_DEVICE_FUNC constexpr Index rows() const { return Rows; } + EIGEN_DEVICE_FUNC constexpr Index cols() const { return Cols; } + EIGEN_DEVICE_FUNC constexpr Index size() const { return Rows * Cols; } + EIGEN_DEVICE_FUNC constexpr T* data() { return m_data.array; } + EIGEN_DEVICE_FUNC constexpr const T* data() const { return m_data.array; } }; template class DenseStorage_impl { @@ -123,7 +122,7 @@ class DenseStorage_impl { Index m_rows = 0; public: - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr DenseStorage_impl() = default; + EIGEN_DEVICE_FUNC constexpr DenseStorage_impl() = default; EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr DenseStorage_impl(const DenseStorage_impl& other) : m_rows(other.m_rows) { EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN(Index size = other.size()) @@ -143,17 +142,13 @@ class DenseStorage_impl { swap_plain_array(m_data, other.m_data, size(), other.size()); numext::swap(m_rows, other.m_rows); } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr void conservativeResize(Index /*size*/, Index rows, Index /*cols*/) { - m_rows = rows; - } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr void resize(Index /*size*/, Index rows, Index /*cols*/) { - m_rows = rows; - } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index rows() const { return m_rows; } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index cols() const { return Cols; } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index size() const { return m_rows * Cols; } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr T* data() { return m_data.array; } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr const T* data() const { return m_data.array; } + EIGEN_DEVICE_FUNC constexpr void conservativeResize(Index /*size*/, Index rows, Index /*cols*/) { m_rows = rows; } + EIGEN_DEVICE_FUNC constexpr void resize(Index /*size*/, Index rows, Index /*cols*/) { m_rows = rows; } + EIGEN_DEVICE_FUNC constexpr Index rows() const { return m_rows; } + EIGEN_DEVICE_FUNC constexpr Index cols() const { return Cols; } + EIGEN_DEVICE_FUNC constexpr Index size() const { return m_rows * Cols; } + EIGEN_DEVICE_FUNC constexpr T* data() { return m_data.array; } + EIGEN_DEVICE_FUNC constexpr const T* data() const { return m_data.array; } }; template class DenseStorage_impl { @@ -161,7 +156,7 @@ class DenseStorage_impl { Index m_cols = 0; public: - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr DenseStorage_impl() = default; + EIGEN_DEVICE_FUNC constexpr DenseStorage_impl() = default; EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr DenseStorage_impl(const DenseStorage_impl& other) : m_cols(other.m_cols) { EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN(Index size = other.size()) @@ -181,17 +176,13 @@ class DenseStorage_impl { swap_plain_array(m_data, other.m_data, size(), other.size()); numext::swap(m_cols, other.m_cols); } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr void conservativeResize(Index /*size*/, Index /*rows*/, Index cols) { - m_cols = cols; - } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr void resize(Index /*size*/, Index /*rows*/, Index cols) { - m_cols = cols; - } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index rows() const { return Rows; } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index cols() const { return m_cols; } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index size() const { return Rows * m_cols; } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr T* data() { return m_data.array; } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr const T* data() const { return m_data.array; } + EIGEN_DEVICE_FUNC constexpr void conservativeResize(Index /*size*/, Index /*rows*/, Index cols) { m_cols = cols; } + EIGEN_DEVICE_FUNC constexpr void resize(Index /*size*/, Index /*rows*/, Index cols) { m_cols = cols; } + EIGEN_DEVICE_FUNC constexpr Index rows() const { return Rows; } + EIGEN_DEVICE_FUNC constexpr Index cols() const { return m_cols; } + EIGEN_DEVICE_FUNC constexpr Index size() const { return Rows * m_cols; } + EIGEN_DEVICE_FUNC constexpr T* data() { return m_data.array; } + EIGEN_DEVICE_FUNC constexpr const T* data() const { return m_data.array; } }; template class DenseStorage_impl { @@ -200,7 +191,7 @@ class DenseStorage_impl { Index m_cols = 0; public: - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr DenseStorage_impl() = default; + EIGEN_DEVICE_FUNC constexpr DenseStorage_impl() = default; EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr DenseStorage_impl(const DenseStorage_impl& other) : m_rows(other.m_rows), m_cols(other.m_cols) { EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN(Index size = other.size()) @@ -222,87 +213,72 @@ class DenseStorage_impl { numext::swap(m_rows, other.m_rows); numext::swap(m_cols, other.m_cols); } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr void conservativeResize(Index /*size*/, Index rows, Index cols) { + EIGEN_DEVICE_FUNC constexpr void conservativeResize(Index /*size*/, Index rows, Index cols) { m_rows = rows; m_cols = cols; } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr void resize(Index /*size*/, Index rows, Index cols) { + EIGEN_DEVICE_FUNC constexpr void resize(Index /*size*/, Index rows, Index cols) { m_rows = rows; m_cols = cols; } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index rows() const { return m_rows; } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index cols() const { return m_cols; } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index size() const { return m_rows * m_cols; } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr T* data() { return m_data.array; } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr const T* data() const { return m_data.array; } + EIGEN_DEVICE_FUNC constexpr Index rows() const { return m_rows; } + EIGEN_DEVICE_FUNC constexpr Index cols() const { return m_cols; } + EIGEN_DEVICE_FUNC constexpr Index size() const { return m_rows * m_cols; } + EIGEN_DEVICE_FUNC constexpr T* data() { return m_data.array; } + EIGEN_DEVICE_FUNC constexpr const T* data() const { return m_data.array; } }; // null matrix variants template class DenseStorage_impl { public: - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr DenseStorage_impl() = default; - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr DenseStorage_impl(const DenseStorage_impl&) = default; - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr DenseStorage_impl(Index /*size*/, Index /*rows*/, Index /*cols*/) {} - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr DenseStorage_impl& operator=(const DenseStorage_impl&) = default; - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr void swap(DenseStorage_impl&) {} - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr void conservativeResize(Index /*size*/, Index /*rows*/, - Index /*cols*/) {} - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr void resize(Index /*size*/, Index /*rows*/, Index /*cols*/) {} - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index rows() const { return Rows; } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index cols() const { return Cols; } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index size() const { return Rows * Cols; } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr T* data() { return nullptr; } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr const T* data() const { return nullptr; } + EIGEN_DEVICE_FUNC constexpr DenseStorage_impl() = default; + EIGEN_DEVICE_FUNC constexpr DenseStorage_impl(const DenseStorage_impl&) = default; + EIGEN_DEVICE_FUNC constexpr DenseStorage_impl(Index /*size*/, Index /*rows*/, Index /*cols*/) {} + EIGEN_DEVICE_FUNC constexpr DenseStorage_impl& operator=(const DenseStorage_impl&) = default; + EIGEN_DEVICE_FUNC constexpr void swap(DenseStorage_impl&) {} + EIGEN_DEVICE_FUNC constexpr void conservativeResize(Index /*size*/, Index /*rows*/, Index /*cols*/) {} + EIGEN_DEVICE_FUNC constexpr void resize(Index /*size*/, Index /*rows*/, Index /*cols*/) {} + EIGEN_DEVICE_FUNC constexpr Index rows() const { return Rows; } + EIGEN_DEVICE_FUNC constexpr Index cols() const { return Cols; } + EIGEN_DEVICE_FUNC constexpr Index size() const { return Rows * Cols; } + EIGEN_DEVICE_FUNC constexpr T* data() { return nullptr; } + EIGEN_DEVICE_FUNC constexpr const T* data() const { return nullptr; } }; template class DenseStorage_impl { Index m_rows = 0; public: - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr DenseStorage_impl() = default; - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr DenseStorage_impl(const DenseStorage_impl&) = default; - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr DenseStorage_impl(Index /*size*/, Index rows, Index /*cols*/) - : m_rows(rows) {} - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr DenseStorage_impl& operator=(const DenseStorage_impl&) = default; - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr void swap(DenseStorage_impl& other) noexcept { - numext::swap(m_rows, other.m_rows); - } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr void conservativeResize(Index /*size*/, Index rows, Index /*cols*/) { - m_rows = rows; - } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr void resize(Index /*size*/, Index rows, Index /*cols*/) { - m_rows = rows; - } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index rows() const { return m_rows; } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index cols() const { return Cols; } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index size() const { return m_rows * Cols; } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr T* data() { return nullptr; } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr const T* data() const { return nullptr; } + EIGEN_DEVICE_FUNC constexpr DenseStorage_impl() = default; + EIGEN_DEVICE_FUNC constexpr DenseStorage_impl(const DenseStorage_impl&) = default; + EIGEN_DEVICE_FUNC constexpr DenseStorage_impl(Index /*size*/, Index rows, Index /*cols*/) : m_rows(rows) {} + EIGEN_DEVICE_FUNC constexpr DenseStorage_impl& operator=(const DenseStorage_impl&) = default; + EIGEN_DEVICE_FUNC constexpr void swap(DenseStorage_impl& other) noexcept { numext::swap(m_rows, other.m_rows); } + EIGEN_DEVICE_FUNC constexpr void conservativeResize(Index /*size*/, Index rows, Index /*cols*/) { m_rows = rows; } + EIGEN_DEVICE_FUNC constexpr void resize(Index /*size*/, Index rows, Index /*cols*/) { m_rows = rows; } + EIGEN_DEVICE_FUNC constexpr Index rows() const { return m_rows; } + EIGEN_DEVICE_FUNC constexpr Index cols() const { return Cols; } + EIGEN_DEVICE_FUNC constexpr Index size() const { return m_rows * Cols; } + EIGEN_DEVICE_FUNC constexpr T* data() { return nullptr; } + EIGEN_DEVICE_FUNC constexpr const T* data() const { return nullptr; } }; template class DenseStorage_impl { Index m_cols = 0; public: - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr DenseStorage_impl() = default; - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr DenseStorage_impl(const DenseStorage_impl&) = default; - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr DenseStorage_impl(Index /*size*/, Index /*rows*/, Index cols) - : m_cols(cols) {} - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr DenseStorage_impl& operator=(const DenseStorage_impl&) = default; - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr void swap(DenseStorage_impl& other) noexcept { - numext::swap(m_cols, other.m_cols); - } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr void conservativeResize(Index /*size*/, Index /*rows*/, Index cols) { - m_cols = cols; - } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr void resize(Index /*size*/, Index /*rows*/, Index cols) { - m_cols = cols; - } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index rows() const { return Rows; } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index cols() const { return m_cols; } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index size() const { return Rows * m_cols; } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr T* data() { return nullptr; } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr const T* data() const { return nullptr; } + EIGEN_DEVICE_FUNC constexpr DenseStorage_impl() = default; + EIGEN_DEVICE_FUNC constexpr DenseStorage_impl(const DenseStorage_impl&) = default; + EIGEN_DEVICE_FUNC constexpr DenseStorage_impl(Index /*size*/, Index /*rows*/, Index cols) : m_cols(cols) {} + EIGEN_DEVICE_FUNC constexpr DenseStorage_impl& operator=(const DenseStorage_impl&) = default; + EIGEN_DEVICE_FUNC constexpr void swap(DenseStorage_impl& other) noexcept { numext::swap(m_cols, other.m_cols); } + EIGEN_DEVICE_FUNC constexpr void conservativeResize(Index /*size*/, Index /*rows*/, Index cols) { m_cols = cols; } + EIGEN_DEVICE_FUNC constexpr void resize(Index /*size*/, Index /*rows*/, Index cols) { m_cols = cols; } + EIGEN_DEVICE_FUNC constexpr Index rows() const { return Rows; } + EIGEN_DEVICE_FUNC constexpr Index cols() const { return m_cols; } + EIGEN_DEVICE_FUNC constexpr Index size() const { return Rows * m_cols; } + EIGEN_DEVICE_FUNC constexpr T* data() { return nullptr; } + EIGEN_DEVICE_FUNC constexpr const T* data() const { return nullptr; } }; template class DenseStorage_impl { @@ -310,28 +286,27 @@ class DenseStorage_impl { Index m_cols = 0; public: - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr DenseStorage_impl() = default; - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr DenseStorage_impl(const DenseStorage_impl&) = default; - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr DenseStorage_impl(Index /*size*/, Index rows, Index cols) - : m_rows(rows), m_cols(cols) {} - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr DenseStorage_impl& operator=(const DenseStorage_impl&) = default; - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr void swap(DenseStorage_impl& other) noexcept { + EIGEN_DEVICE_FUNC constexpr DenseStorage_impl() = default; + EIGEN_DEVICE_FUNC constexpr DenseStorage_impl(const DenseStorage_impl&) = default; + EIGEN_DEVICE_FUNC constexpr DenseStorage_impl(Index /*size*/, Index rows, Index cols) : m_rows(rows), m_cols(cols) {} + EIGEN_DEVICE_FUNC constexpr DenseStorage_impl& operator=(const DenseStorage_impl&) = default; + EIGEN_DEVICE_FUNC constexpr void swap(DenseStorage_impl& other) noexcept { numext::swap(m_rows, other.m_rows); numext::swap(m_cols, other.m_cols); } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr void conservativeResize(Index /*size*/, Index rows, Index cols) { + EIGEN_DEVICE_FUNC constexpr void conservativeResize(Index /*size*/, Index rows, Index cols) { m_rows = rows; m_cols = cols; } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr void resize(Index /*size*/, Index rows, Index cols) { + EIGEN_DEVICE_FUNC constexpr void resize(Index /*size*/, Index rows, Index cols) { m_rows = rows; m_cols = cols; } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index rows() const { return m_rows; } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index cols() const { return m_cols; } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index size() const { return m_rows * m_cols; } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr T* data() { return nullptr; } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr const T* data() const { return nullptr; } + EIGEN_DEVICE_FUNC constexpr Index rows() const { return m_rows; } + EIGEN_DEVICE_FUNC constexpr Index cols() const { return m_cols; } + EIGEN_DEVICE_FUNC constexpr Index size() const { return m_rows * m_cols; } + EIGEN_DEVICE_FUNC constexpr T* data() { return nullptr; } + EIGEN_DEVICE_FUNC constexpr const T* data() const { return nullptr; } }; // fixed-size matrix with dynamic memory allocation not currently supported template @@ -345,7 +320,7 @@ class DenseStorage_impl { public: static constexpr int Size = Dynamic; - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr DenseStorage_impl() = default; + EIGEN_DEVICE_FUNC constexpr DenseStorage_impl() = default; EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr DenseStorage_impl(const DenseStorage_impl& other) : m_data(conditional_aligned_new_auto(other.size())), m_rows(other.m_rows) { EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN(Index size = other.size()) @@ -355,7 +330,7 @@ class DenseStorage_impl { : m_data(conditional_aligned_new_auto(size)), m_rows(rows) { EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN({}) } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr DenseStorage_impl(DenseStorage_impl&& other) noexcept + EIGEN_DEVICE_FUNC constexpr DenseStorage_impl(DenseStorage_impl&& other) noexcept : m_data(other.m_data), m_rows(other.m_rows) { other.m_data = nullptr; other.m_rows = 0; @@ -366,11 +341,11 @@ class DenseStorage_impl { smart_copy(other.m_data, other.m_data + other.size(), m_data); return *this; } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr DenseStorage_impl& operator=(DenseStorage_impl&& other) noexcept { + EIGEN_DEVICE_FUNC constexpr DenseStorage_impl& operator=(DenseStorage_impl&& other) noexcept { this->swap(other); return *this; } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr void swap(DenseStorage_impl& other) noexcept { + EIGEN_DEVICE_FUNC constexpr void swap(DenseStorage_impl& other) noexcept { numext::swap(m_data, other.m_data); numext::swap(m_rows, other.m_rows); } @@ -387,11 +362,11 @@ class DenseStorage_impl { } m_rows = rows; } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index rows() const { return m_rows; } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index cols() const { return Cols; } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index size() const { return m_rows * Cols; } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr T* data() { return m_data; } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr const T* data() const { return m_data; } + EIGEN_DEVICE_FUNC constexpr Index rows() const { return m_rows; } + EIGEN_DEVICE_FUNC constexpr Index cols() const { return Cols; } + EIGEN_DEVICE_FUNC constexpr Index size() const { return m_rows * Cols; } + EIGEN_DEVICE_FUNC constexpr T* data() { return m_data; } + EIGEN_DEVICE_FUNC constexpr const T* data() const { return m_data; } }; template class DenseStorage_impl { @@ -401,7 +376,7 @@ class DenseStorage_impl { public: static constexpr int Size = Dynamic; - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr DenseStorage_impl() = default; + EIGEN_DEVICE_FUNC constexpr DenseStorage_impl() = default; EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr DenseStorage_impl(const DenseStorage_impl& other) : m_data(conditional_aligned_new_auto(other.size())), m_cols(other.m_cols) { EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN(Index size = other.size()) @@ -411,7 +386,7 @@ class DenseStorage_impl { : m_data(conditional_aligned_new_auto(size)), m_cols(cols) { EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN({}) } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr DenseStorage_impl(DenseStorage_impl&& other) noexcept + EIGEN_DEVICE_FUNC constexpr DenseStorage_impl(DenseStorage_impl&& other) noexcept : m_data(other.m_data), m_cols(other.m_cols) { other.m_data = nullptr; other.m_cols = 0; @@ -422,11 +397,11 @@ class DenseStorage_impl { smart_copy(other.m_data, other.m_data + other.size(), m_data); return *this; } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr DenseStorage_impl& operator=(DenseStorage_impl&& other) noexcept { + EIGEN_DEVICE_FUNC constexpr DenseStorage_impl& operator=(DenseStorage_impl&& other) noexcept { this->swap(other); return *this; } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr void swap(DenseStorage_impl& other) noexcept { + EIGEN_DEVICE_FUNC constexpr void swap(DenseStorage_impl& other) noexcept { numext::swap(m_data, other.m_data); numext::swap(m_cols, other.m_cols); } @@ -443,11 +418,11 @@ class DenseStorage_impl { } m_cols = cols; } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index rows() const { return Rows; } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index cols() const { return m_cols; } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index size() const { return Rows * m_cols; } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr T* data() { return m_data; } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr const T* data() const { return m_data; } + EIGEN_DEVICE_FUNC constexpr Index rows() const { return Rows; } + EIGEN_DEVICE_FUNC constexpr Index cols() const { return m_cols; } + EIGEN_DEVICE_FUNC constexpr Index size() const { return Rows * m_cols; } + EIGEN_DEVICE_FUNC constexpr T* data() { return m_data; } + EIGEN_DEVICE_FUNC constexpr const T* data() const { return m_data; } }; template class DenseStorage_impl { @@ -458,7 +433,7 @@ class DenseStorage_impl { public: static constexpr int Size = Dynamic; - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr DenseStorage_impl() = default; + EIGEN_DEVICE_FUNC constexpr DenseStorage_impl() = default; EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr DenseStorage_impl(const DenseStorage_impl& other) : m_data(conditional_aligned_new_auto(other.size())), m_rows(other.m_rows), m_cols(other.m_cols) { EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN(Index size = other.size()) @@ -468,7 +443,7 @@ class DenseStorage_impl { : m_data(conditional_aligned_new_auto(size)), m_rows(rows), m_cols(cols) { EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN({}) } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr DenseStorage_impl(DenseStorage_impl&& other) noexcept + EIGEN_DEVICE_FUNC constexpr DenseStorage_impl(DenseStorage_impl&& other) noexcept : m_data(other.m_data), m_rows(other.m_rows), m_cols(other.m_cols) { other.m_data = nullptr; other.m_rows = 0; @@ -480,11 +455,11 @@ class DenseStorage_impl { smart_copy(other.m_data, other.m_data + other.size(), m_data); return *this; } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr DenseStorage_impl& operator=(DenseStorage_impl&& other) noexcept { + EIGEN_DEVICE_FUNC constexpr DenseStorage_impl& operator=(DenseStorage_impl&& other) noexcept { this->swap(other); return *this; } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr void swap(DenseStorage_impl& other) noexcept { + EIGEN_DEVICE_FUNC constexpr void swap(DenseStorage_impl& other) noexcept { numext::swap(m_data, other.m_data); numext::swap(m_rows, other.m_rows); numext::swap(m_cols, other.m_cols); @@ -504,11 +479,11 @@ class DenseStorage_impl { m_rows = rows; m_cols = cols; } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index rows() const { return m_rows; } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index cols() const { return m_cols; } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index size() const { return m_rows * m_cols; } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr T* data() { return m_data; } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr const T* data() const { return m_data; } + EIGEN_DEVICE_FUNC constexpr Index rows() const { return m_rows; } + EIGEN_DEVICE_FUNC constexpr Index cols() const { return m_cols; } + EIGEN_DEVICE_FUNC constexpr Index size() const { return m_rows * m_cols; } + EIGEN_DEVICE_FUNC constexpr T* data() { return m_data; } + EIGEN_DEVICE_FUNC constexpr const T* data() const { return m_data; } }; template struct use_default_move { @@ -537,15 +512,14 @@ class DenseStorage : public internal::DenseStorage_impl; public: - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr DenseStorage() = default; - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr DenseStorage(const DenseStorage&) = default; - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr DenseStorage(Index size, Index rows, Index cols) - : Base(size, rows, cols) {} - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr DenseStorage& operator=(const DenseStorage&) = default; + EIGEN_DEVICE_FUNC constexpr DenseStorage() = default; + EIGEN_DEVICE_FUNC constexpr DenseStorage(const DenseStorage&) = default; + EIGEN_DEVICE_FUNC constexpr DenseStorage(Index size, Index rows, Index cols) : Base(size, rows, cols) {} + EIGEN_DEVICE_FUNC constexpr DenseStorage& operator=(const DenseStorage&) = default; // if DenseStorage meets the requirements of use_default_move, then use the move construction and move assignment // operation defined in DenseStorage_impl, or the compiler-generated version if none is defined - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr DenseStorage(DenseStorage&&) = default; - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr DenseStorage& operator=(DenseStorage&&) = default; + EIGEN_DEVICE_FUNC constexpr DenseStorage(DenseStorage&&) = default; + EIGEN_DEVICE_FUNC constexpr DenseStorage& operator=(DenseStorage&&) = default; }; template class DenseStorage @@ -553,16 +527,15 @@ class DenseStorage using Base = internal::DenseStorage_impl; public: - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr DenseStorage() = default; - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr DenseStorage(const DenseStorage&) = default; - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr DenseStorage(Index size, Index rows, Index cols) - : Base(size, rows, cols) {} - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr DenseStorage& operator=(const DenseStorage&) = default; + EIGEN_DEVICE_FUNC constexpr DenseStorage() = default; + EIGEN_DEVICE_FUNC constexpr DenseStorage(const DenseStorage&) = default; + EIGEN_DEVICE_FUNC constexpr DenseStorage(Index size, Index rows, Index cols) : Base(size, rows, cols) {} + EIGEN_DEVICE_FUNC constexpr DenseStorage& operator=(const DenseStorage&) = default; // if DenseStorage does not meet the requirements of use_default_move, then defer to the copy construction and copy // assignment behavior - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr DenseStorage(DenseStorage&& other) + EIGEN_DEVICE_FUNC constexpr DenseStorage(DenseStorage&& other) : DenseStorage(static_cast(other)) {} - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr DenseStorage& operator=(DenseStorage&& other) { + EIGEN_DEVICE_FUNC constexpr DenseStorage& operator=(DenseStorage&& other) { *this = other; return *this; } diff --git a/Eigen/src/Core/DeviceWrapper.h b/Eigen/src/Core/DeviceWrapper.h index 012dce10d..76c1a6db3 100644 --- a/Eigen/src/Core/DeviceWrapper.h +++ b/Eigen/src/Core/DeviceWrapper.h @@ -87,7 +87,7 @@ template struct dense_assignment_loop_with_device { using Base = dense_assignment_loop; - static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr void run(Kernel& kernel, Device&) { Base::run(kernel); } + static EIGEN_DEVICE_FUNC constexpr void run(Kernel& kernel, Device&) { Base::run(kernel); } }; // entry point for a generic expression with device diff --git a/Eigen/src/Core/Diagonal.h b/Eigen/src/Core/Diagonal.h index ff8611c60..a3bd071b5 100644 --- a/Eigen/src/Core/Diagonal.h +++ b/Eigen/src/Core/Diagonal.h @@ -132,15 +132,11 @@ class Diagonal : public internal::dense_xpr_base 0 ? m_index.value() : -m_index.value(); } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index rowOffset() const noexcept { - return m_index.value() > 0 ? 0 : -m_index.value(); - } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index colOffset() const noexcept { - return m_index.value() > 0 ? m_index.value() : 0; - } + EIGEN_DEVICE_FUNC constexpr Index rowOffset() const noexcept { return m_index.value() > 0 ? 0 : -m_index.value(); } + EIGEN_DEVICE_FUNC constexpr Index colOffset() const noexcept { return m_index.value() > 0 ? m_index.value() : 0; } // trigger a compile-time error if someone try to call packet template typename MatrixType::PacketReturnType packet(Index) const; diff --git a/Eigen/src/Core/Fill.h b/Eigen/src/Core/Fill.h index 6f4593589..cacf921c2 100644 --- a/Eigen/src/Core/Fill.h +++ b/Eigen/src/Core/Fill.h @@ -60,12 +60,12 @@ struct eigen_fill_impl { using Func = scalar_constant_op; using PlainObject = typename Xpr::PlainObject; using Constant = typename PlainObject::ConstantReturnType; - static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr void run(Xpr& dst, const Scalar& val) { + static EIGEN_DEVICE_FUNC constexpr void run(Xpr& dst, const Scalar& val) { const Constant src(dst.rows(), dst.cols(), val); run(dst, src); } template - static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr void run(Xpr& dst, const SrcXpr& src) { + static EIGEN_DEVICE_FUNC constexpr void run(Xpr& dst, const SrcXpr& src) { call_dense_assignment_loop(dst, src, assign_op()); } }; @@ -104,12 +104,12 @@ struct eigen_zero_impl { using Scalar = typename Xpr::Scalar; using PlainObject = typename Xpr::PlainObject; using Zero = typename PlainObject::ZeroReturnType; - static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr void run(Xpr& dst) { + static EIGEN_DEVICE_FUNC constexpr void run(Xpr& dst) { const Zero src(dst.rows(), dst.cols()); run(dst, src); } template - static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr void run(Xpr& dst, const SrcXpr& src) { + static EIGEN_DEVICE_FUNC constexpr void run(Xpr& dst, const SrcXpr& src) { call_dense_assignment_loop(dst, src, assign_op()); } }; diff --git a/Eigen/src/Core/GeneralProduct.h b/Eigen/src/Core/GeneralProduct.h index e4c51d2a6..ace438d77 100644 --- a/Eigen/src/Core/GeneralProduct.h +++ b/Eigen/src/Core/GeneralProduct.h @@ -229,7 +229,7 @@ struct gemv_static_vector_if; template struct gemv_static_vector_if { - EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC constexpr Scalar* data() { + EIGEN_DEVICE_FUNC constexpr Scalar* data() { eigen_internal_assert(false && "should never be called"); return 0; } @@ -237,19 +237,19 @@ struct gemv_static_vector_if { template struct gemv_static_vector_if { - EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC constexpr Scalar* data() { return 0; } + EIGEN_DEVICE_FUNC constexpr Scalar* data() { return 0; } }; template struct gemv_static_vector_if { #if EIGEN_MAX_STATIC_ALIGN_BYTES != 0 internal::plain_array m_data; - EIGEN_STRONG_INLINE constexpr Scalar* data() { return m_data.array; } + constexpr Scalar* data() { return m_data.array; } #else // Some architectures cannot align on the stack, // => let's manually enforce alignment by allocating more data and return the address of the first aligned element. internal::plain_array m_data; - EIGEN_STRONG_INLINE constexpr Scalar* data() { + constexpr Scalar* data() { return reinterpret_cast((std::uintptr_t(m_data.array) & ~(std::size_t(EIGEN_MAX_ALIGN_BYTES - 1))) + EIGEN_MAX_ALIGN_BYTES); } diff --git a/Eigen/src/Core/Matrix.h b/Eigen/src/Core/Matrix.h index a2c8eba57..01ca9db45 100644 --- a/Eigen/src/Core/Matrix.h +++ b/Eigen/src/Core/Matrix.h @@ -207,7 +207,7 @@ class Matrix : public PlainObjectBase::value) { Base::operator=(std::move(other)); return *this; @@ -385,7 +385,7 @@ class Matrix : public PlainObjectBase&) diff --git a/Eigen/src/Core/NumTraits.h b/Eigen/src/Core/NumTraits.h index bf41c3bb6..2bb1eedb8 100644 --- a/Eigen/src/Core/NumTraits.h +++ b/Eigen/src/Core/NumTraits.h @@ -99,12 +99,12 @@ namespace numext { /** \internal bit-wise cast without changing the underlying bit representation. */ #if defined(__cpp_lib_bit_cast) && __cpp_lib_bit_cast >= 201806L template -EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC constexpr Tgt bit_cast(const Src& src) { +EIGEN_DEVICE_FUNC constexpr Tgt bit_cast(const Src& src) { return std::bit_cast(src); } #elif EIGEN_HAS_BUILTIN(__builtin_bit_cast) template -EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC constexpr Tgt bit_cast(const Src& src) { +EIGEN_DEVICE_FUNC constexpr Tgt bit_cast(const Src& src) { EIGEN_STATIC_ASSERT(std::is_trivially_copyable::value, THIS_TYPE_IS_NOT_SUPPORTED) EIGEN_STATIC_ASSERT(std::is_trivially_copyable::value, THIS_TYPE_IS_NOT_SUPPORTED) EIGEN_STATIC_ASSERT(sizeof(Src) == sizeof(Tgt), THIS_TYPE_IS_NOT_SUPPORTED) diff --git a/Eigen/src/Core/PlainObjectBase.h b/Eigen/src/Core/PlainObjectBase.h index a78305e25..54681905f 100644 --- a/Eigen/src/Core/PlainObjectBase.h +++ b/Eigen/src/Core/PlainObjectBase.h @@ -162,14 +162,14 @@ class PlainObjectBase : public internal::dense_xpr_base::type { EIGEN_DEVICE_FUNC Base& base() { return *static_cast(this); } EIGEN_DEVICE_FUNC const Base& base() const { return *static_cast(this); } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index rows() const noexcept { return m_storage.rows(); } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index cols() const noexcept { return m_storage.cols(); } + EIGEN_DEVICE_FUNC constexpr Index rows() const noexcept { return m_storage.rows(); } + EIGEN_DEVICE_FUNC constexpr Index cols() const noexcept { return m_storage.cols(); } /** This is an overloaded version of DenseCoeffsBase::coeff(Index,Index) const * provided to by-pass the creation of an evaluator of the expression, thus saving compilation efforts. * * See DenseCoeffsBase::coeff(Index) const for details. */ - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr const Scalar& coeff(Index rowId, Index colId) const { + EIGEN_DEVICE_FUNC constexpr const Scalar& coeff(Index rowId, Index colId) const { if (Flags & RowMajorBit) return m_storage.data()[colId + rowId * m_storage.cols()]; else // column-major @@ -180,15 +180,13 @@ class PlainObjectBase : public internal::dense_xpr_base::type { * provided to by-pass the creation of an evaluator of the expression, thus saving compilation efforts. * * See DenseCoeffsBase::coeff(Index) const for details. */ - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr const Scalar& coeff(Index index) const { - return m_storage.data()[index]; - } + EIGEN_DEVICE_FUNC constexpr const Scalar& coeff(Index index) const { return m_storage.data()[index]; } /** This is an overloaded version of DenseCoeffsBase::coeffRef(Index,Index) const * provided to by-pass the creation of an evaluator of the expression, thus saving compilation efforts. * * See DenseCoeffsBase::coeffRef(Index,Index) const for details. */ - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Scalar& coeffRef(Index rowId, Index colId) { + EIGEN_DEVICE_FUNC constexpr Scalar& coeffRef(Index rowId, Index colId) { if (Flags & RowMajorBit) return m_storage.data()[colId + rowId * m_storage.cols()]; else // column-major @@ -199,11 +197,11 @@ class PlainObjectBase : public internal::dense_xpr_base::type { * provided to by-pass the creation of an evaluator of the expression, thus saving compilation efforts. * * See DenseCoeffsBase::coeffRef(Index) const for details. */ - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Scalar& coeffRef(Index index) { return m_storage.data()[index]; } + EIGEN_DEVICE_FUNC constexpr Scalar& coeffRef(Index index) { return m_storage.data()[index]; } /** This is the const version of coeffRef(Index,Index) which is thus synonym of coeff(Index,Index). * It is provided for convenience. */ - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr const Scalar& coeffRef(Index rowId, Index colId) const { + EIGEN_DEVICE_FUNC constexpr const Scalar& coeffRef(Index rowId, Index colId) const { if (Flags & RowMajorBit) return m_storage.data()[colId + rowId * m_storage.cols()]; else // column-major @@ -212,9 +210,7 @@ class PlainObjectBase : public internal::dense_xpr_base::type { /** This is the const version of coeffRef(Index) which is thus synonym of coeff(Index). * It is provided for convenience. */ - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr const Scalar& coeffRef(Index index) const { - return m_storage.data()[index]; - } + EIGEN_DEVICE_FUNC constexpr const Scalar& coeffRef(Index index) const { return m_storage.data()[index]; } /** \internal */ template @@ -426,9 +422,7 @@ class PlainObjectBase : public internal::dense_xpr_base::type { /** This is a special case of the templated operator=. Its purpose is to * prevent a default operator= from hiding the templated operator=. */ - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Derived& operator=(const PlainObjectBase& other) { - return _set(other); - } + EIGEN_DEVICE_FUNC constexpr Derived& operator=(const PlainObjectBase& other) { return _set(other); } /** \sa MatrixBase::lazyAssign() */ template @@ -446,9 +440,9 @@ class PlainObjectBase : public internal::dense_xpr_base::type { // Prevent user from trying to instantiate PlainObjectBase objects // by making all its constructor protected. See bug 1074. protected: - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr PlainObjectBase() = default; + EIGEN_DEVICE_FUNC constexpr PlainObjectBase() = default; /** \brief Move constructor */ - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr PlainObjectBase(PlainObjectBase&&) = default; + EIGEN_DEVICE_FUNC constexpr PlainObjectBase(PlainObjectBase&&) = default; /** \brief Move assignment operator */ EIGEN_DEVICE_FUNC constexpr PlainObjectBase& operator=(PlainObjectBase&& other) noexcept { m_storage = std::move(other.m_storage); @@ -456,7 +450,7 @@ class PlainObjectBase : public internal::dense_xpr_base::type { } /** Copy constructor */ - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr PlainObjectBase(const PlainObjectBase&) = default; + EIGEN_DEVICE_FUNC constexpr PlainObjectBase(const PlainObjectBase&) = default; EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE PlainObjectBase(Index size, Index rows, Index cols) : m_storage(size, rows, cols) {} @@ -714,7 +708,7 @@ class PlainObjectBase : public internal::dense_xpr_base::type { // aliasing is dealt once in internal::call_assignment // so at this stage we have to assume aliasing... and resising has to be done later. template - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Derived& _set(const DenseBase& other) { + EIGEN_DEVICE_FUNC constexpr Derived& _set(const DenseBase& other) { internal::call_assignment(this->derived(), other.derived()); return this->derived(); } @@ -725,7 +719,7 @@ class PlainObjectBase : public internal::dense_xpr_base::type { * \sa operator=(const MatrixBase&), _set() */ template - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Derived& _set_noalias(const DenseBase& other) { + EIGEN_DEVICE_FUNC constexpr Derived& _set_noalias(const DenseBase& 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); diff --git a/Eigen/src/Core/Product.h b/Eigen/src/Core/Product.h index e16c7cc96..c4f5650d6 100644 --- a/Eigen/src/Core/Product.h +++ b/Eigen/src/Core/Product.h @@ -224,8 +224,8 @@ class Product "if you wanted a coeff-wise or a dot product use the respective explicit functions"); } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index rows() const noexcept { return m_lhs.rows(); } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr Index cols() const noexcept { return m_rhs.cols(); } + EIGEN_DEVICE_FUNC constexpr Index rows() const noexcept { return m_lhs.rows(); } + EIGEN_DEVICE_FUNC constexpr Index cols() const noexcept { return m_rhs.cols(); } EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const LhsNestedCleaned& lhs() const { return m_lhs; } EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const RhsNestedCleaned& rhs() const { return m_rhs; } diff --git a/Eigen/src/Core/Transpose.h b/Eigen/src/Core/Transpose.h index 0676a252a..c69efc14a 100644 --- a/Eigen/src/Core/Transpose.h +++ b/Eigen/src/Core/Transpose.h @@ -65,8 +65,8 @@ class Transpose : public TransposeImpl& nestedExpression() const { @@ -119,12 +119,8 @@ class TransposeImpl : public internal::TransposeImpl_base::value, Scalar, const Scalar> ScalarWithConstIfNotLvalue; - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr ScalarWithConstIfNotLvalue* data() { - return derived().nestedExpression().data(); - } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr const Scalar* data() const { - return derived().nestedExpression().data(); - } + EIGEN_DEVICE_FUNC constexpr ScalarWithConstIfNotLvalue* data() { return derived().nestedExpression().data(); } + EIGEN_DEVICE_FUNC constexpr const Scalar* data() const { return derived().nestedExpression().data(); } // FIXME: shall we keep the const version of coeffRef? EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar& coeffRef(Index rowId, Index colId) const { diff --git a/Eigen/src/Core/arch/clang/Complex.h b/Eigen/src/Core/arch/clang/Complex.h index b109e1ef9..edc9693a9 100644 --- a/Eigen/src/Core/arch/clang/Complex.h +++ b/Eigen/src/Core/arch/clang/Complex.h @@ -19,7 +19,7 @@ namespace internal { template struct complex_packet_wrapper { using RealPacketT = detail::VectorType; - EIGEN_STRONG_INLINE complex_packet_wrapper() = default; + complex_packet_wrapper() = default; EIGEN_STRONG_INLINE explicit complex_packet_wrapper(const RealPacketT& a) : v(a) {} EIGEN_STRONG_INLINE constexpr std::complex operator[](Index i) const { return std::complex(v[2 * i], v[2 * i + 1]); diff --git a/Eigen/src/Core/functors/AssignmentFunctors.h b/Eigen/src/Core/functors/AssignmentFunctors.h index 0239262ae..e3ad3375c 100644 --- a/Eigen/src/Core/functors/AssignmentFunctors.h +++ b/Eigen/src/Core/functors/AssignmentFunctors.h @@ -23,7 +23,7 @@ namespace internal { */ template struct assign_op { - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr void assignCoeff(DstScalar& a, const SrcScalar& b) const { a = b; } + EIGEN_DEVICE_FUNC constexpr void assignCoeff(DstScalar& a, const SrcScalar& b) const { a = b; } template EIGEN_STRONG_INLINE void assignPacket(DstScalar* a, const Packet& b) const { @@ -56,7 +56,7 @@ struct functor_traits> { template struct compound_assign_op { using traits = functor_traits>; - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr void assignCoeff(DstScalar& a, const SrcScalar& b) const { + EIGEN_DEVICE_FUNC constexpr void assignCoeff(DstScalar& a, const SrcScalar& b) const { assign_op().assignCoeff(a, Func().operator()(a, b)); } diff --git a/Eigen/src/Core/functors/NullaryFunctors.h b/Eigen/src/Core/functors/NullaryFunctors.h index 6d85883d7..dc394d625 100644 --- a/Eigen/src/Core/functors/NullaryFunctors.h +++ b/Eigen/src/Core/functors/NullaryFunctors.h @@ -38,7 +38,7 @@ struct functor_traits> { template struct scalar_zero_op { - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE scalar_zero_op() = default; + EIGEN_DEVICE_FUNC scalar_zero_op() = default; EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar operator()() const { return Scalar(0); } template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE PacketType packetOp() const { diff --git a/Eigen/src/Core/util/Macros.h b/Eigen/src/Core/util/Macros.h index 2b7919af2..e76c74cca 100644 --- a/Eigen/src/Core/util/Macros.h +++ b/Eigen/src/Core/util/Macros.h @@ -1033,7 +1033,7 @@ namespace Eigen { namespace internal { template -EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr void ignore_unused_variable(const T&) {} +EIGEN_DEVICE_FUNC constexpr void ignore_unused_variable(const T&) {} } // namespace internal } // namespace Eigen #define EIGEN_UNUSED_VARIABLE(var) Eigen::internal::ignore_unused_variable(var); diff --git a/Eigen/src/Core/util/MaxSizeVector.h b/Eigen/src/Core/util/MaxSizeVector.h index db5bb8950..3375015aa 100644 --- a/Eigen/src/Core/util/MaxSizeVector.h +++ b/Eigen/src/Core/util/MaxSizeVector.h @@ -116,17 +116,17 @@ class MaxSizeVector { EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE bool empty() const { return size_ == 0; } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr T* data() { return data_; } + EIGEN_DEVICE_FUNC constexpr T* data() { return data_; } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr const T* data() const { return data_; } + EIGEN_DEVICE_FUNC constexpr const T* data() const { return data_; } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr T* begin() { return data_; } + EIGEN_DEVICE_FUNC constexpr T* begin() { return data_; } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr T* end() { return data_ + size_; } + EIGEN_DEVICE_FUNC constexpr T* end() { return data_ + size_; } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr const T* begin() const { return data_; } + EIGEN_DEVICE_FUNC constexpr const T* begin() const { return data_; } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr const T* end() const { return data_ + size_; } + EIGEN_DEVICE_FUNC constexpr const T* end() const { return data_ + size_; } private: size_t reserve_; diff --git a/Eigen/src/Core/util/Memory.h b/Eigen/src/Core/util/Memory.h index 9ae780819..95712ff41 100644 --- a/Eigen/src/Core/util/Memory.h +++ b/Eigen/src/Core/util/Memory.h @@ -1355,15 +1355,13 @@ EIGEN_DEVICE_FUNC void destroy_at(T* p) { #endif // FIXME(rmlarsen): Work around missing linker symbol with msan on ARM. -#if !defined(EIGEN_DONT_ASSUME_ALIGNED) && __has_feature(memory_sanitizer) && \ - (EIGEN_ARCH_ARM || EIGEN_ARCH_ARM64) +#if !defined(EIGEN_DONT_ASSUME_ALIGNED) && __has_feature(memory_sanitizer) && (EIGEN_ARCH_ARM || EIGEN_ARCH_ARM64) #define EIGEN_DONT_ASSUME_ALIGNED #endif - #if !defined(EIGEN_DONT_ASSUME_ALIGNED) && defined(__cpp_lib_assume_aligned) && (__cpp_lib_assume_aligned >= 201811L) template -EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC constexpr T* assume_aligned(T* ptr) { +EIGEN_DEVICE_FUNC constexpr T* assume_aligned(T* ptr) { return std::assume_aligned(ptr); } #elif !defined(EIGEN_DONT_ASSUME_ALIGNED) && EIGEN_HAS_BUILTIN(__builtin_assume_aligned) @@ -1373,7 +1371,7 @@ EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC T* assume_aligned(T* ptr) { } #else template -EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC constexpr T* assume_aligned(T* ptr) { +EIGEN_DEVICE_FUNC constexpr T* assume_aligned(T* ptr) { return ptr; } #endif diff --git a/Eigen/src/Core/util/MoreMeta.h b/Eigen/src/Core/util/MoreMeta.h index 6823bca97..bf88d38ce 100644 --- a/Eigen/src/Core/util/MoreMeta.h +++ b/Eigen/src/Core/util/MoreMeta.h @@ -186,12 +186,11 @@ struct h_skip_helper_type<0> { template struct h_skip { template - constexpr static EIGEN_STRONG_INLINE typename h_skip_helper_numeric::type helper( - numeric_list) { + constexpr static typename h_skip_helper_numeric::type helper(numeric_list) { return typename h_skip_helper_numeric::type(); } template - constexpr static EIGEN_STRONG_INLINE typename h_skip_helper_type::type helper(type_list) { + constexpr static typename h_skip_helper_type::type helper(type_list) { return typename h_skip_helper_type::type(); } }; @@ -330,17 +329,17 @@ struct reduce; template struct reduce { - EIGEN_DEVICE_FUNC constexpr static EIGEN_STRONG_INLINE int run() { return Reducer::Identity; } + EIGEN_DEVICE_FUNC constexpr static int run() { return Reducer::Identity; } }; template struct reduce { - EIGEN_DEVICE_FUNC constexpr static EIGEN_STRONG_INLINE A run(A a) { return a; } + EIGEN_DEVICE_FUNC constexpr static A run(A a) { return a; } }; template struct reduce { - EIGEN_DEVICE_FUNC constexpr static EIGEN_STRONG_INLINE auto run(A a, Ts... ts) + EIGEN_DEVICE_FUNC constexpr static auto run(A a, Ts... ts) -> decltype(Reducer::run(a, reduce::run(ts...))) { return Reducer::run(a, reduce::run(ts...)); } @@ -350,14 +349,14 @@ struct reduce { struct sum_op { template - EIGEN_DEVICE_FUNC constexpr static EIGEN_STRONG_INLINE auto run(A a, B b) -> decltype(a + b) { + EIGEN_DEVICE_FUNC constexpr static auto run(A a, B b) -> decltype(a + b) { return a + b; } static constexpr int Identity = 0; }; struct product_op { template - EIGEN_DEVICE_FUNC constexpr static EIGEN_STRONG_INLINE auto run(A a, B b) -> decltype(a * b) { + EIGEN_DEVICE_FUNC constexpr static auto run(A a, B b) -> decltype(a * b) { return a * b; } static constexpr int Identity = 1; @@ -365,50 +364,50 @@ struct product_op { struct logical_and_op { template - constexpr static EIGEN_STRONG_INLINE auto run(A a, B b) -> decltype(a && b) { + constexpr static auto run(A a, B b) -> decltype(a && b) { return a && b; } }; struct logical_or_op { template - constexpr static EIGEN_STRONG_INLINE auto run(A a, B b) -> decltype(a || b) { + constexpr static auto run(A a, B b) -> decltype(a || b) { return a || b; } }; struct equal_op { template - constexpr static EIGEN_STRONG_INLINE auto run(A a, B b) -> decltype(a == b) { + constexpr static auto run(A a, B b) -> decltype(a == b) { return a == b; } }; struct not_equal_op { template - constexpr static EIGEN_STRONG_INLINE auto run(A a, B b) -> decltype(a != b) { + constexpr static auto run(A a, B b) -> decltype(a != b) { return a != b; } }; struct lesser_op { template - constexpr static EIGEN_STRONG_INLINE auto run(A a, B b) -> decltype(a < b) { + constexpr static auto run(A a, B b) -> decltype(a < b) { return a < b; } }; struct lesser_equal_op { template - constexpr static EIGEN_STRONG_INLINE auto run(A a, B b) -> decltype(a <= b) { + constexpr static auto run(A a, B b) -> decltype(a <= b) { return a <= b; } }; struct greater_op { template - constexpr static EIGEN_STRONG_INLINE auto run(A a, B b) -> decltype(a > b) { + constexpr static auto run(A a, B b) -> decltype(a > b) { return a > b; } }; struct greater_equal_op { template - constexpr static EIGEN_STRONG_INLINE auto run(A a, B b) -> decltype(a >= b) { + constexpr static auto run(A a, B b) -> decltype(a >= b) { return a >= b; } }; @@ -417,19 +416,19 @@ struct greater_equal_op { struct not_op { template - constexpr static EIGEN_STRONG_INLINE auto run(A a) -> decltype(!a) { + constexpr static auto run(A a) -> decltype(!a) { return !a; } }; struct negation_op { template - constexpr static EIGEN_STRONG_INLINE auto run(A a) -> decltype(-a) { + constexpr static auto run(A a) -> decltype(-a) { return -a; } }; struct greater_equal_zero_op { template - constexpr static EIGEN_STRONG_INLINE auto run(A a) -> decltype(a >= 0) { + constexpr static auto run(A a) -> decltype(a >= 0) { return a >= 0; } }; @@ -440,25 +439,24 @@ struct greater_equal_zero_op { // together in front... (13.0 doesn't work with array_prod/array_reduce/... anyway, but 13.1 // does... template -EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE decltype(reduce::run((*((Ts*)0))...)) arg_prod( - Ts... ts) { +EIGEN_DEVICE_FUNC constexpr decltype(reduce::run((*((Ts*)0))...)) arg_prod(Ts... ts) { return reduce::run(ts...); } template -constexpr EIGEN_STRONG_INLINE decltype(reduce::run((*((Ts*)0))...)) arg_sum(Ts... ts) { +constexpr decltype(reduce::run((*((Ts*)0))...)) arg_sum(Ts... ts) { return reduce::run(ts...); } /* reverse arrays */ template -constexpr EIGEN_STRONG_INLINE Array h_array_reverse(Array arr, numeric_list) { +constexpr Array h_array_reverse(Array arr, numeric_list) { return {{array_get(arr)...}}; } template -constexpr EIGEN_STRONG_INLINE array array_reverse(array arr) { +constexpr array array_reverse(array arr) { return h_array_reverse(arr, typename gen_numeric_list::type()); } @@ -471,7 +469,7 @@ constexpr EIGEN_STRONG_INLINE array array_reverse(array arr) { // an infinite loop) template struct h_array_reduce { - EIGEN_DEVICE_FUNC constexpr static EIGEN_STRONG_INLINE auto run(array arr, T identity) + EIGEN_DEVICE_FUNC constexpr static auto run(array arr, T identity) -> decltype(Reducer::run(h_array_reduce::run(arr, identity), array_get(arr))) { return Reducer::run(h_array_reduce::run(arr, identity), array_get(arr)); } @@ -479,16 +477,16 @@ struct h_array_reduce { template struct h_array_reduce { - EIGEN_DEVICE_FUNC constexpr static EIGEN_STRONG_INLINE T run(const array& arr, T) { return array_get<0>(arr); } + EIGEN_DEVICE_FUNC constexpr static T run(const array& arr, T) { return array_get<0>(arr); } }; template struct h_array_reduce { - EIGEN_DEVICE_FUNC constexpr static EIGEN_STRONG_INLINE T run(const array&, T identity) { return identity; } + EIGEN_DEVICE_FUNC constexpr static T run(const array&, T identity) { return identity; } }; template -EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE auto array_reduce(const array& arr, T identity) +EIGEN_DEVICE_FUNC constexpr auto array_reduce(const array& arr, T identity) -> decltype(h_array_reduce::run(arr, identity)) { return h_array_reduce::run(arr, identity); } @@ -496,13 +494,13 @@ EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE auto array_reduce(const array -EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE auto array_sum(const array& arr) +EIGEN_DEVICE_FUNC constexpr auto array_sum(const array& arr) -> decltype(array_reduce(arr, static_cast(0))) { return array_reduce(arr, static_cast(0)); } template -EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE auto array_prod(const array& arr) +EIGEN_DEVICE_FUNC constexpr auto array_prod(const array& arr) -> decltype(array_reduce(arr, static_cast(1))) { return array_reduce(arr, static_cast(1)); } @@ -520,20 +518,19 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE t array_prod(const std::vector& a) { /* zip an array */ template -constexpr EIGEN_STRONG_INLINE array h_array_zip(array a, array b, - numeric_list) { +constexpr array h_array_zip(array a, array b, numeric_list) { return array{{Op::run(array_get(a), array_get(b))...}}; } template -constexpr EIGEN_STRONG_INLINE array array_zip(array a, array b) { +constexpr array array_zip(array a, array b) { return h_array_zip(a, b, typename gen_numeric_list::type()); } /* zip an array and reduce the result */ template -constexpr EIGEN_STRONG_INLINE auto h_array_zip_and_reduce(array a, array b, numeric_list) +constexpr auto h_array_zip_and_reduce(array a, array b, numeric_list) -> decltype(reduce::type...>::run( Op::run(array_get(a), array_get(b))...)) { return reduce::type...>::run( @@ -541,7 +538,7 @@ constexpr EIGEN_STRONG_INLINE auto h_array_zip_and_reduce(array a, array -constexpr EIGEN_STRONG_INLINE auto array_zip_and_reduce(array a, array b) +constexpr auto array_zip_and_reduce(array a, array b) -> decltype(h_array_zip_and_reduce(a, b, typename gen_numeric_list::type())) { return h_array_zip_and_reduce(a, b, typename gen_numeric_list::type()); } @@ -549,19 +546,19 @@ constexpr EIGEN_STRONG_INLINE auto array_zip_and_reduce(array a, array -constexpr EIGEN_STRONG_INLINE array h_array_apply(array a, numeric_list) { +constexpr array h_array_apply(array a, numeric_list) { return array{{Op::run(array_get(a))...}}; } template -constexpr EIGEN_STRONG_INLINE array array_apply(array a) { +constexpr array array_apply(array a) { return h_array_apply(a, typename gen_numeric_list::type()); } /* apply stuff to an array and reduce */ template -constexpr EIGEN_STRONG_INLINE auto h_array_apply_and_reduce(array arr, numeric_list) +constexpr auto h_array_apply_and_reduce(array arr, numeric_list) -> decltype(reduce::type...>::run( Op::run(array_get(arr))...)) { return reduce::type...>::run( @@ -569,7 +566,7 @@ constexpr EIGEN_STRONG_INLINE auto h_array_apply_and_reduce(array arr, num } template -constexpr EIGEN_STRONG_INLINE auto array_apply_and_reduce(array a) +constexpr auto array_apply_and_reduce(array a) -> decltype(h_array_apply_and_reduce(a, typename gen_numeric_list::type())) { return h_array_apply_and_reduce(a, typename gen_numeric_list::type()); } @@ -582,7 +579,7 @@ constexpr EIGEN_STRONG_INLINE auto array_apply_and_reduce(array a) template struct h_repeat { template - constexpr static EIGEN_STRONG_INLINE array run(t v, numeric_list) { + constexpr static array run(t v, numeric_list) { return {{typename id_numeric::type(v)...}}; } }; diff --git a/Eigen/src/Core/util/XprHelper.h b/Eigen/src/Core/util/XprHelper.h index 043b006bc..63290638b 100644 --- a/Eigen/src/Core/util/XprHelper.h +++ b/Eigen/src/Core/util/XprHelper.h @@ -156,8 +156,8 @@ class variable_if_dynamic { EIGEN_ONLY_USED_FOR_DEBUG(v); eigen_assert(v == T(Value)); } - EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE constexpr T value() { return T(Value); } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr operator T() const { return T(Value); } + EIGEN_DEVICE_FUNC static constexpr T value() { return T(Value); } + EIGEN_DEVICE_FUNC constexpr operator T() const { return T(Value); } EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void setValue(T v) const { EIGEN_ONLY_USED_FOR_DEBUG(v); eigen_assert(v == T(Value)); @@ -184,7 +184,7 @@ class variable_if_dynamicindex { EIGEN_ONLY_USED_FOR_DEBUG(v); eigen_assert(v == T(Value)); } - EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE constexpr T value() { return T(Value); } + EIGEN_DEVICE_FUNC static constexpr T value() { return T(Value); } EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void setValue(T) {} };