MOAB
4.9.3pre
|
Expression of a fixed-size or dynamic-size block. More...
#include <Block.h>
Public Types | |
typedef Impl | Base |
typedef internal::remove_all < XprType >::type | NestedExpression |
Public Member Functions | |
EIGEN_DEVICE_FUNC | Block (XprType &xpr, Index i) |
EIGEN_DEVICE_FUNC | Block (XprType &xpr, Index startRow, Index startCol) |
EIGEN_DEVICE_FUNC | Block (XprType &xpr, Index startRow, Index startCol, Index blockRows, Index blockCols) |
Private Types | |
typedef BlockImpl< XprType, BlockRows, BlockCols, InnerPanel, typename internal::traits< XprType > ::StorageKind > | Impl |
Expression of a fixed-size or dynamic-size block.
XprType | the type of the expression in which we are taking a block |
BlockRows | the number of rows of the block we are taking at compile time (optional) |
BlockCols | the number of columns of the block we are taking at compile time (optional) |
InnerPanel | is true, if the block maps to a set of rows of a row major matrix or to set of columns of a column major matrix (optional). The parameter allows to determine at compile time whether aligned access is possible on the block expression. |
This class represents an expression of either a fixed-size or dynamic-size block. It is the return type of DenseBase::block(Index,Index,Index,Index) and DenseBase::block<int,int>(Index,Index) and most of the time this is the only way it is used.
However, if you want to directly maniputate block expressions, for instance if you want to write a function returning such an expression, you will need to use this class.
Here is an example illustrating the dynamic case:
Output:
Here is an example illustrating the fixed-size case:
Output:
typedef Impl Eigen::Block< XprType, BlockRows, BlockCols, InnerPanel >::Base |
Reimplemented in Eigen::VectorBlock< VectorType, Size >.
typedef BlockImpl<XprType, BlockRows, BlockCols, InnerPanel, typename internal::traits<XprType>::StorageKind> Eigen::Block< XprType, BlockRows, BlockCols, InnerPanel >::Impl [private] |
typedef internal::remove_all<XprType>::type Eigen::Block< XprType, BlockRows, BlockCols, InnerPanel >::NestedExpression |
EIGEN_DEVICE_FUNC Eigen::Block< XprType, BlockRows, BlockCols, InnerPanel >::Block | ( | XprType & | xpr, |
Index | i | ||
) | [inline] |
Column or Row constructor
Definition at line 118 of file Block.h.
: Impl(xpr,i) { eigen_assert( (i>=0) && ( ((BlockRows==1) && (BlockCols==XprType::ColsAtCompileTime) && i<xpr.rows()) ||((BlockRows==XprType::RowsAtCompileTime) && (BlockCols==1) && i<xpr.cols()))); }
EIGEN_DEVICE_FUNC Eigen::Block< XprType, BlockRows, BlockCols, InnerPanel >::Block | ( | XprType & | xpr, |
Index | startRow, | ||
Index | startCol | ||
) | [inline] |
Fixed-size constructor
Definition at line 128 of file Block.h.
: Impl(xpr, startRow, startCol) { EIGEN_STATIC_ASSERT(RowsAtCompileTime!=Dynamic && ColsAtCompileTime!=Dynamic,THIS_METHOD_IS_ONLY_FOR_FIXED_SIZE) eigen_assert(startRow >= 0 && BlockRows >= 0 && startRow + BlockRows <= xpr.rows() && startCol >= 0 && BlockCols >= 0 && startCol + BlockCols <= xpr.cols()); }
EIGEN_DEVICE_FUNC Eigen::Block< XprType, BlockRows, BlockCols, InnerPanel >::Block | ( | XprType & | xpr, |
Index | startRow, | ||
Index | startCol, | ||
Index | blockRows, | ||
Index | blockCols | ||
) | [inline] |
Dynamic-size constructor
Definition at line 139 of file Block.h.
: Impl(xpr, startRow, startCol, blockRows, blockCols) { eigen_assert((RowsAtCompileTime==Dynamic || RowsAtCompileTime==blockRows) && (ColsAtCompileTime==Dynamic || ColsAtCompileTime==blockCols)); eigen_assert(startRow >= 0 && blockRows >= 0 && startRow <= xpr.rows() - blockRows && startCol >= 0 && blockCols >= 0 && startCol <= xpr.cols() - blockCols); }