diff options
author | David Tellenbach <david.tellenbach@me.com> | 2021-03-05 13:16:43 +0100 |
---|---|---|
committer | David Tellenbach <david.tellenbach@me.com> | 2021-03-05 13:16:43 +0100 |
commit | 5f0b4a4010af4cbf6161a0d1a03a747addc44a5d (patch) | |
tree | 23356aec10fb951fb51adf970a810e7ae18cf940 /Eigen/src/Core/Block.h | |
parent | 6cbb3038ac48cb5fe17eba4dfbf26e3e798041f1 (diff) |
Revert "Adds EIGEN_CONSTEXPR and EIGEN_NOEXCEPT to rows(), cols(), innerStride(), outerStride(), and size()"
This reverts commit 6cbb3038ac48cb5fe17eba4dfbf26e3e798041f1 because it
breaks clang-10 builds on x86 and aarch64 when C++11 is enabled.
Diffstat (limited to 'Eigen/src/Core/Block.h')
-rw-r--r-- | Eigen/src/Core/Block.h | 72 |
1 files changed, 38 insertions, 34 deletions
diff --git a/Eigen/src/Core/Block.h b/Eigen/src/Core/Block.h index 3206d6633..6e938ea58 100644 --- a/Eigen/src/Core/Block.h +++ b/Eigen/src/Core/Block.h @@ -11,7 +11,7 @@ #ifndef EIGEN_BLOCK_H #define EIGEN_BLOCK_H -namespace Eigen { +namespace Eigen { namespace internal { template<typename XprType, int BlockRows, int BlockCols, bool InnerPanel> @@ -52,7 +52,7 @@ struct traits<Block<XprType, BlockRows, BlockCols, InnerPanel> > : traits<XprTyp FlagsRowMajorBit = IsRowMajor ? RowMajorBit : 0, Flags = (traits<XprType>::Flags & (DirectAccessBit | (InnerPanel?CompressedAccessBit:0))) | FlagsLvalueBit | FlagsRowMajorBit, // FIXME DirectAccessBit should not be handled by expressions - // + // // Alignment is needed by MapBase's assertions // We can sefely set it to false here. Internal alignment errors will be detected by an eigen_internal_assert in the respective evaluator Alignment = 0 @@ -61,7 +61,7 @@ struct traits<Block<XprType, BlockRows, BlockCols, InnerPanel> > : traits<XprTyp template<typename XprType, int BlockRows=Dynamic, int BlockCols=Dynamic, bool InnerPanel = false, bool HasDirectAccess = internal::has_direct_access<XprType>::ret> class BlockImpl_dense; - + } // end namespace internal template<typename XprType, int BlockRows, int BlockCols, bool InnerPanel, typename StorageKind> class BlockImpl; @@ -109,9 +109,9 @@ template<typename XprType, int BlockRows, int BlockCols, bool InnerPanel> class typedef Impl Base; EIGEN_GENERIC_PUBLIC_INTERFACE(Block) EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Block) - + typedef typename internal::remove_all<XprType>::type NestedExpression; - + /** Column or Row constructor */ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE @@ -147,7 +147,7 @@ template<typename XprType, int BlockRows, int BlockCols, bool InnerPanel> class && startCol >= 0 && blockCols >= 0 && startCol <= xpr.cols() - blockCols); } }; - + // The generic default implementation for dense block simplu forward to the internal::BlockImpl_dense // that must be specialized for direct and non-direct access... template<typename XprType, int BlockRows, int BlockCols, bool InnerPanel> @@ -296,23 +296,23 @@ template<typename XprType, int BlockRows, int BlockCols, bool InnerPanel, bool H EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename internal::remove_all<XprTypeNested>::type& nestedExpression() const - { - return m_xpr; + { + return m_xpr; } EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE XprType& nestedExpression() { return m_xpr; } - - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR - StorageIndex startRow() const EIGEN_NOEXCEPT - { - return m_startRow.value(); + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + StorageIndex startRow() const + { + return m_startRow.value(); } - - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR - StorageIndex startCol() const EIGEN_NOEXCEPT - { - return m_startCol.value(); + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + StorageIndex startCol() const + { + return m_startCol.value(); } protected: @@ -344,7 +344,7 @@ class BlockImpl_dense<XprType,BlockRows,BlockCols, InnerPanel,true> */ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE BlockImpl_dense(XprType& xpr, Index i) - : Base(xpr.data() + i * ( ((BlockRows==1) && (BlockCols==XprType::ColsAtCompileTime) && (!XprTypeIsRowMajor)) + : Base(xpr.data() + i * ( ((BlockRows==1) && (BlockCols==XprType::ColsAtCompileTime) && (!XprTypeIsRowMajor)) || ((BlockRows==XprType::RowsAtCompileTime) && (BlockCols==1) && ( XprTypeIsRowMajor)) ? xpr.innerStride() : xpr.outerStride()), BlockRows==1 ? 1 : xpr.rows(), BlockCols==1 ? 1 : xpr.cols()), @@ -378,17 +378,17 @@ class BlockImpl_dense<XprType,BlockRows,BlockCols, InnerPanel,true> } EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE - const typename internal::remove_all<XprTypeNested>::type& nestedExpression() const EIGEN_NOEXCEPT - { - return m_xpr; + const typename internal::remove_all<XprTypeNested>::type& nestedExpression() const + { + return m_xpr; } EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE XprType& nestedExpression() { return m_xpr; } - + /** \sa MapBase::innerStride() */ - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR - Index innerStride() const EIGEN_NOEXCEPT + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Index innerStride() const { return internal::traits<BlockType>::HasSameStorageOrderAsXprType ? m_xpr.innerStride() @@ -396,19 +396,23 @@ class BlockImpl_dense<XprType,BlockRows,BlockCols, InnerPanel,true> } /** \sa MapBase::outerStride() */ - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR - Index outerStride() const EIGEN_NOEXCEPT + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + Index outerStride() const { - return internal::traits<BlockType>::HasSameStorageOrderAsXprType - ? m_xpr.outerStride() - : m_xpr.innerStride(); + return m_outerStride; } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR - StorageIndex startRow() const EIGEN_NOEXCEPT { return m_startRow.value(); } + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + StorageIndex startRow() const + { + return m_startRow.value(); + } - EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR - StorageIndex startCol() const EIGEN_NOEXCEPT { return m_startCol.value(); } + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE + StorageIndex startCol() const + { + return m_startCol.value(); + } #ifndef __SUNPRO_CC // FIXME sunstudio is not friendly with the above friend... |