From 4716040703be1ee906439385d20475dcddad5ce3 Mon Sep 17 00:00:00 2001 From: Benoit Jacob Date: Mon, 25 Oct 2010 10:15:22 -0400 Subject: bug #86 : use internal:: namespace instead of ei_ prefix --- Eigen/src/Core/Block.h | 71 ++++++++++++++++++++++++++------------------------ 1 file changed, 37 insertions(+), 34 deletions(-) (limited to 'Eigen/src/Core/Block.h') diff --git a/Eigen/src/Core/Block.h b/Eigen/src/Core/Block.h index a770b9721..76fb46e25 100644 --- a/Eigen/src/Core/Block.h +++ b/Eigen/src/Core/Block.h @@ -58,54 +58,57 @@ * * \sa DenseBase::block(Index,Index,Index,Index), DenseBase::block(Index,Index), class VectorBlock */ + +namespace internal { template -struct ei_traits > : ei_traits +struct traits > : traits { - typedef typename ei_traits::Scalar Scalar; - typedef typename ei_traits::StorageKind StorageKind; - typedef typename ei_traits::XprKind XprKind; - typedef typename ei_nested::type XprTypeNested; - typedef typename ei_unref::type _XprTypeNested; + typedef typename traits::Scalar Scalar; + typedef typename traits::StorageKind StorageKind; + typedef typename traits::XprKind XprKind; + typedef typename nested::type XprTypeNested; + typedef typename unref::type _XprTypeNested; enum{ - MatrixRows = ei_traits::RowsAtCompileTime, - MatrixCols = ei_traits::ColsAtCompileTime, + MatrixRows = traits::RowsAtCompileTime, + MatrixCols = traits::ColsAtCompileTime, RowsAtCompileTime = MatrixRows == 0 ? 0 : BlockRows, ColsAtCompileTime = MatrixCols == 0 ? 0 : BlockCols, MaxRowsAtCompileTime = BlockRows==0 ? 0 : RowsAtCompileTime != Dynamic ? int(RowsAtCompileTime) - : int(ei_traits::MaxRowsAtCompileTime), + : int(traits::MaxRowsAtCompileTime), MaxColsAtCompileTime = BlockCols==0 ? 0 : ColsAtCompileTime != Dynamic ? int(ColsAtCompileTime) - : int(ei_traits::MaxColsAtCompileTime), - XprTypeIsRowMajor = (int(ei_traits::Flags)&RowMajorBit) != 0, + : int(traits::MaxColsAtCompileTime), + XprTypeIsRowMajor = (int(traits::Flags)&RowMajorBit) != 0, IsRowMajor = (MaxRowsAtCompileTime==1&&MaxColsAtCompileTime!=1) ? 1 : (MaxColsAtCompileTime==1&&MaxRowsAtCompileTime!=1) ? 0 : XprTypeIsRowMajor, HasSameStorageOrderAsXprType = (IsRowMajor == XprTypeIsRowMajor), InnerSize = IsRowMajor ? int(ColsAtCompileTime) : int(RowsAtCompileTime), InnerStrideAtCompileTime = HasSameStorageOrderAsXprType - ? int(ei_inner_stride_at_compile_time::ret) - : int(ei_outer_stride_at_compile_time::ret), + ? int(inner_stride_at_compile_time::ret) + : int(outer_stride_at_compile_time::ret), OuterStrideAtCompileTime = HasSameStorageOrderAsXprType - ? int(ei_outer_stride_at_compile_time::ret) - : int(ei_inner_stride_at_compile_time::ret), - MaskPacketAccessBit = (InnerSize == Dynamic || (InnerSize % ei_packet_traits::size) == 0) + ? int(outer_stride_at_compile_time::ret) + : int(inner_stride_at_compile_time::ret), + MaskPacketAccessBit = (InnerSize == Dynamic || (InnerSize % packet_traits::size) == 0) && (InnerStrideAtCompileTime == 1) ? PacketAccessBit : 0, - MaskAlignedBit = (InnerPanel && (OuterStrideAtCompileTime!=Dynamic) && ((OuterStrideAtCompileTime % ei_packet_traits::size) == 0)) ? AlignedBit : 0, + MaskAlignedBit = (InnerPanel && (OuterStrideAtCompileTime!=Dynamic) && ((OuterStrideAtCompileTime % packet_traits::size) == 0)) ? AlignedBit : 0, FlagsLinearAccessBit = (RowsAtCompileTime == 1 || ColsAtCompileTime == 1) ? LinearAccessBit : 0, - Flags0 = ei_traits::Flags & (HereditaryBits | MaskPacketAccessBit | LvalueBit | DirectAccessBit | MaskAlignedBit), + Flags0 = traits::Flags & (HereditaryBits | MaskPacketAccessBit | LvalueBit | DirectAccessBit | MaskAlignedBit), Flags1 = Flags0 | FlagsLinearAccessBit, Flags = (Flags1 & ~RowMajorBit) | (IsRowMajor ? RowMajorBit : 0) }; }; +} template class Block - : public ei_dense_xpr_base >::type + : public internal::dense_xpr_base >::type { public: - typedef typename ei_dense_xpr_base::type Base; + typedef typename internal::dense_xpr_base::type Base; EIGEN_DENSE_PUBLIC_INTERFACE(Block) class InnerIterator; @@ -123,7 +126,7 @@ template=0) && ( + eigen_assert( (i>=0) && ( ((BlockRows==1) && (BlockCols==XprType::ColsAtCompileTime) && i= 0 && BlockRows >= 1 && startRow + BlockRows <= xpr.rows() + eigen_assert(startRow >= 0 && BlockRows >= 1 && startRow + BlockRows <= xpr.rows() && startCol >= 0 && BlockCols >= 1 && startCol + BlockCols <= xpr.cols()); } @@ -147,9 +150,9 @@ template= 0 && blockRows >= 0 && startRow + blockRows <= xpr.rows() + eigen_assert(startRow >= 0 && blockRows >= 0 && startRow + blockRows <= xpr.rows() && startCol >= 0 && blockCols >= 0 && startCol + blockCols <= xpr.cols()); } @@ -223,10 +226,10 @@ template m_startRow; - const ei_variable_if_dynamic m_startCol; - const ei_variable_if_dynamic m_blockRows; - const ei_variable_if_dynamic m_blockCols; + const internal::variable_if_dynamic m_startRow; + const internal::variable_if_dynamic m_startCol; + const internal::variable_if_dynamic m_blockRows; + const internal::variable_if_dynamic m_blockCols; }; /** \internal */ @@ -251,7 +254,7 @@ class Block BlockCols==1 ? 1 : xpr.cols()), m_xpr(xpr) { - ei_assert( (i>=0) && ( + eigen_assert( (i>=0) && ( ((BlockRows==1) && (BlockCols==XprType::ColsAtCompileTime) && i inline Block(const XprType& xpr, Index startRow, Index startCol) : Base(&xpr.const_cast_derived().coeffRef(startRow,startCol)), m_xpr(xpr) { - ei_assert(startRow >= 0 && BlockRows >= 1 && startRow + BlockRows <= xpr.rows() + eigen_assert(startRow >= 0 && BlockRows >= 1 && startRow + BlockRows <= xpr.rows() && startCol >= 0 && BlockCols >= 1 && startCol + BlockCols <= xpr.cols()); init(); } @@ -275,9 +278,9 @@ class Block : Base(&xpr.const_cast_derived().coeffRef(startRow,startCol), blockRows, blockCols), m_xpr(xpr) { - ei_assert((RowsAtCompileTime==Dynamic || RowsAtCompileTime==blockRows) + eigen_assert((RowsAtCompileTime==Dynamic || RowsAtCompileTime==blockRows) && (ColsAtCompileTime==Dynamic || ColsAtCompileTime==blockCols)); - ei_assert(startRow >= 0 && blockRows >= 0 && startRow + blockRows <= xpr.rows() + eigen_assert(startRow >= 0 && blockRows >= 0 && startRow + blockRows <= xpr.rows() && startCol >= 0 && blockCols >= 0 && startCol + blockCols <= xpr.cols()); init(); } @@ -285,7 +288,7 @@ class Block /** \sa MapBase::innerStride() */ inline Index innerStride() const { - return ei_traits::HasSameStorageOrderAsXprType + return internal::traits::HasSameStorageOrderAsXprType ? m_xpr.innerStride() : m_xpr.outerStride(); } @@ -314,7 +317,7 @@ class Block protected: void init() { - m_outerStride = ei_traits::HasSameStorageOrderAsXprType + m_outerStride = internal::traits::HasSameStorageOrderAsXprType ? m_xpr.outerStride() : m_xpr.innerStride(); } -- cgit v1.2.3