Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
Eigen::Block< XprType, BlockRows, BlockCols, InnerPanel > Class Template Reference

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

#include <src/eigen/Eigen/src/Core/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
 
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
 

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.

Template 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)
InnerPanelis 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:

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

Member Typedef Documentation

◆ Base

template<typename XprType , int BlockRows, int BlockCols, bool InnerPanel>
typedef Impl Eigen::Block< XprType, BlockRows, BlockCols, InnerPanel >::Base

◆ Impl

template<typename XprType , int BlockRows, int BlockCols, bool InnerPanel>
typedef BlockImpl<XprType, BlockRows, BlockCols, InnerPanel, typename internal::traits<XprType>::StorageKind> Eigen::Block< XprType, BlockRows, BlockCols, InnerPanel >::Impl
private

◆ NestedExpression

template<typename XprType , int BlockRows, int BlockCols, bool InnerPanel>
typedef internal::remove_all<XprType>::type Eigen::Block< XprType, BlockRows, BlockCols, InnerPanel >::NestedExpression

Constructor & Destructor Documentation

◆ Block() [1/3]

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

Column or Row constructor

118 : Impl(xpr,i)
119 {
120 eigen_assert( (i>=0) && (
121 ((BlockRows==1) && (BlockCols==XprType::ColsAtCompileTime) && i<xpr.rows())
122 ||((BlockRows==XprType::RowsAtCompileTime) && (BlockCols==1) && i<xpr.cols())));
123 }
#define eigen_assert(x)
Definition Macros.h:579
BlockImpl< XprType, BlockRows, BlockCols, InnerPanel, typename internal::traits< XprType >::StorageKind > Impl
Definition Block.h:106

References eigen_assert.

◆ Block() [2/3]

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

Fixed-size constructor

129 : Impl(xpr, startRow, startCol)
130 {
131 EIGEN_STATIC_ASSERT(RowsAtCompileTime!=Dynamic && ColsAtCompileTime!=Dynamic,THIS_METHOD_IS_ONLY_FOR_FIXED_SIZE)
132 eigen_assert(startRow >= 0 && BlockRows >= 0 && startRow + BlockRows <= xpr.rows()
133 && startCol >= 0 && BlockCols >= 0 && startCol + BlockCols <= xpr.cols());
134 }
#define EIGEN_STATIC_ASSERT(CONDITION, MSG)
Definition StaticAssert.h:124
const int Dynamic
Definition Constants.h:21

References Eigen::Dynamic, eigen_assert, and EIGEN_STATIC_ASSERT.

◆ Block() [3/3]

template<typename XprType , int BlockRows, int BlockCols, bool InnerPanel>
EIGEN_DEVICE_FUNC Eigen::Block< XprType, BlockRows, BlockCols, InnerPanel >::Block ( XprType &  xpr,
Index  startRow,
Index  startCol,
Index  blockRows,
Index  blockCols 
)
inline

Dynamic-size constructor

142 : Impl(xpr, startRow, startCol, blockRows, blockCols)
143 {
144 eigen_assert((RowsAtCompileTime==Dynamic || RowsAtCompileTime==blockRows)
145 && (ColsAtCompileTime==Dynamic || ColsAtCompileTime==blockCols));
146 eigen_assert(startRow >= 0 && blockRows >= 0 && startRow <= xpr.rows() - blockRows
147 && startCol >= 0 && blockCols >= 0 && startCol <= xpr.cols() - blockCols);
148 }

References Eigen::Dynamic, and eigen_assert.


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