Shapeworks Studio  2.1
Shape analysis software suite
List of all members | Public Types | Public Member Functions
Eigen::Block< XprType, BlockRows, BlockCols, InnerPanel > Class Template Reference

Expression of a fixed-size or dynamic-size block. More...

#include <Block.h>

+ Inheritance diagram for Eigen::Block< XprType, BlockRows, BlockCols, InnerPanel >:
+ Collaboration diagram for Eigen::Block< XprType, BlockRows, BlockCols, InnerPanel >:

Public Types

typedef Impl Base
 

Public Member Functions

 Block (XprType &xpr, Index i)
 
 Block (XprType &xpr, Index a_startRow, Index a_startCol)
 
 Block (XprType &xpr, Index a_startRow, Index a_startCol, Index blockRows, Index blockCols)
 

Detailed Description

template<typename XprType, int BlockRows, int BlockCols, bool InnerPanel>
class Eigen::Block< XprType, BlockRows, BlockCols, InnerPanel >

Expression of a fixed-size or dynamic-size block.

Parameters
XprTypethe type of the expression in which we are taking a block
BlockRowsthe number of rows of the block we are taking at compile time (optional)
BlockColsthe number of columns of the block we are taking at compile time (optional)

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:

Note
Even though this expression has dynamic size, in the case where XprType has fixed size, this expression inherits a fixed maximal size which means that evaluating it does not cause a dynamic memory allocation.

Here is an example illustrating the fixed-size case:

Output:

See also
DenseBase::block(Index,Index,Index,Index), DenseBase::block(Index,Index), class VectorBlock

Definition at line 102 of file Block.h.

Constructor & Destructor Documentation

template<typename XprType, int BlockRows, int BlockCols, bool InnerPanel>
Eigen::Block< XprType, BlockRows, BlockCols, InnerPanel >::Block ( XprType &  xpr,
Index  i 
)
inline

Column or Row constructor

Definition at line 114 of file Block.h.

114  : Impl(xpr,i)
115  {
116  eigen_assert( (i>=0) && (
117  ((BlockRows==1) && (BlockCols==XprType::ColsAtCompileTime) && i<xpr.rows())
118  ||((BlockRows==XprType::RowsAtCompileTime) && (BlockCols==1) && i<xpr.cols())));
119  }
template<typename XprType, int BlockRows, int BlockCols, bool InnerPanel>
Eigen::Block< XprType, BlockRows, BlockCols, InnerPanel >::Block ( XprType &  xpr,
Index  a_startRow,
Index  a_startCol 
)
inline

Fixed-size constructor

Definition at line 123 of file Block.h.

124  : Impl(xpr, a_startRow, a_startCol)
125  {
126  EIGEN_STATIC_ASSERT(RowsAtCompileTime!=Dynamic && ColsAtCompileTime!=Dynamic,THIS_METHOD_IS_ONLY_FOR_FIXED_SIZE)
127  eigen_assert(a_startRow >= 0 && BlockRows >= 1 && a_startRow + BlockRows <= xpr.rows()
128  && a_startCol >= 0 && BlockCols >= 1 && a_startCol + BlockCols <= xpr.cols());
129  }
template<typename XprType, int BlockRows, int BlockCols, bool InnerPanel>
Eigen::Block< XprType, BlockRows, BlockCols, InnerPanel >::Block ( XprType &  xpr,
Index  a_startRow,
Index  a_startCol,
Index  blockRows,
Index  blockCols 
)
inline

Dynamic-size constructor

Definition at line 133 of file Block.h.

136  : Impl(xpr, a_startRow, a_startCol, blockRows, blockCols)
137  {
138  eigen_assert((RowsAtCompileTime==Dynamic || RowsAtCompileTime==blockRows)
139  && (ColsAtCompileTime==Dynamic || ColsAtCompileTime==blockCols));
140  eigen_assert(a_startRow >= 0 && blockRows >= 0 && a_startRow <= xpr.rows() - blockRows
141  && a_startCol >= 0 && blockCols >= 0 && a_startCol <= xpr.cols() - blockCols);
142  }

The documentation for this class was generated from the following file: