20 template <
typename XprType_,
int BlockRows,
int BlockCols,
bool InnerPanel_>
30 RowsAtCompileTime = MatrixRows == 0 ? 0 : BlockRows,
31 ColsAtCompileTime = MatrixCols == 0 ? 0 : BlockCols,
32 MaxRowsAtCompileTime = BlockRows == 0 ? 0
33 : RowsAtCompileTime !=
Dynamic ?
int(RowsAtCompileTime)
35 MaxColsAtCompileTime = BlockCols == 0 ? 0
36 : ColsAtCompileTime !=
Dynamic ?
int(ColsAtCompileTime)
40 IsRowMajor = (MaxRowsAtCompileTime == 1 && MaxColsAtCompileTime != 1) ? 1
41 : (MaxColsAtCompileTime == 1 && MaxRowsAtCompileTime != 1) ? 0
43 HasSameStorageOrderAsXprType = (IsRowMajor == XprTypeIsRowMajor),
44 InnerSize = IsRowMajor ?
int(ColsAtCompileTime) :
int(RowsAtCompileTime),
61 InnerPanel = InnerPanel_ ? 1 : 0
65 template <
typename XprType,
int BlockRows =
Dynamic,
int BlockCols =
Dynamic,
bool InnerPanel =
false,
71 template <
typename XprType,
int BlockRows,
int BlockCols,
bool InnerPanel,
typename StorageKind>
108 template <
typename XprType,
int BlockRows,
int BlockCols,
bool InnerPanel>
110 :
public BlockImpl<XprType, BlockRows, BlockCols, InnerPanel, typename internal::traits<XprType>::StorageKind> {
125 eigen_assert((
i >= 0) && (((BlockRows == 1) && (BlockCols == XprType::ColsAtCompileTime) &&
i < xpr.rows()) ||
126 ((BlockRows == XprType::RowsAtCompileTime) && (BlockCols == 1) &&
i < xpr.cols())));
132 :
Impl(xpr, startRow, startCol) {
134 THIS_METHOD_IS_ONLY_FOR_FIXED_SIZE)
135 eigen_assert(startRow >= 0 && BlockRows >= 0 && startRow + BlockRows <= xpr.rows() && startCol >= 0 &&
136 BlockCols >= 0 && startCol + BlockCols <= xpr.cols());
143 :
Impl(xpr, startRow, startCol, blockRows, blockCols) {
145 (ColsAtCompileTime ==
Dynamic || ColsAtCompileTime == blockCols));
146 eigen_assert(startRow >= 0 && blockRows >= 0 && startRow <= xpr.rows() - blockRows && startCol >= 0 &&
147 blockCols >= 0 && startCol <= xpr.cols() - blockCols);
169 template <
typename XprType,
int BlockRows,
int BlockCols,
bool InnerPanel>
180 :
Impl(xpr, startRow, startCol) {}
183 :
Impl(xpr, startRow, startCol, blockRows, blockCols) {}
189 template <
typename XprType,
int BlockRows,
int BlockCols,
bool InnerPanel,
bool HasDirectAccess>
209 m_startRow((BlockRows == 1) && (BlockCols ==
XprType::ColsAtCompileTime) ?
i : 0),
210 m_startCol((BlockRows ==
XprType::RowsAtCompileTime) && (BlockCols == 1) ?
i : 0),
211 m_blockRows(BlockRows == 1 ? 1 : xpr.
rows()),
212 m_blockCols(BlockCols == 1 ? 1 : xpr.
cols()) {}
217 : m_xpr(xpr), m_startRow(startRow), m_startCol(startCol), m_blockRows(BlockRows), m_blockCols(BlockCols) {}
223 : m_xpr(xpr), m_startRow(startRow), m_startCol(startCol), m_blockRows(blockRows), m_blockCols(blockCols) {}
230 return m_xpr.coeffRef(rowId + m_startRow.value(), colId + m_startCol.value());
234 return m_xpr.derived().coeffRef(rowId + m_startRow.value(), colId + m_startCol.value());
238 return m_xpr.coeff(rowId + m_startRow.value(), colId + m_startCol.value());
243 return m_xpr.coeffRef(m_startRow.value() + (RowsAtCompileTime == 1 ? 0 : index),
244 m_startCol.value() + (RowsAtCompileTime == 1 ? index : 0));
248 return m_xpr.coeffRef(m_startRow.value() + (RowsAtCompileTime == 1 ? 0 : index),
249 m_startCol.value() + (RowsAtCompileTime == 1 ? index : 0));
253 return m_xpr.coeff(m_startRow.value() + (RowsAtCompileTime == 1 ? 0 : index),
254 m_startCol.value() + (RowsAtCompileTime == 1 ? index : 0));
257 template <
int LoadMode>
259 return m_xpr.template packet<Unaligned>(rowId + m_startRow.value(), colId + m_startCol.value());
262 template <
int LoadMode>
264 m_xpr.template writePacket<Unaligned>(rowId + m_startRow.value(), colId + m_startCol.value(),
val);
267 template <
int LoadMode>
269 return m_xpr.template packet<Unaligned>(m_startRow.value() + (RowsAtCompileTime == 1 ? 0 : index),
270 m_startCol.value() + (RowsAtCompileTime == 1 ? index : 0));
273 template <
int LoadMode>
275 m_xpr.template writePacket<Unaligned>(m_startRow.value() + (RowsAtCompileTime == 1 ? 0 : index),
276 m_startCol.value() + (RowsAtCompileTime == 1 ? index : 0),
val);
279 #ifdef EIGEN_PARSED_BY_DOXYGEN
293 return m_startRow.value();
297 return m_startCol.value();
311 template <
typename XprType,
int BlockRows,
int BlockCols,
bool InnerPanel>
313 :
public MapBase<Block<XprType, BlockRows, BlockCols, InnerPanel>> {
321 template <
typename Scalar>
324 return base !=
nullptr ? base + offset :
nullptr;
335 :
Base((BlockRows == 0 || BlockCols == 0)
337 : add_to_nullable_pointer(
339 i * (((BlockRows == 1) && (BlockCols ==
XprType::ColsAtCompileTime) && (!XprTypeIsRowMajor)) ||
340 ((BlockRows ==
XprType::RowsAtCompileTime) && (BlockCols == 1) &&
343 : xpr.outerStride())),
344 BlockRows == 1 ? 1 : xpr.
rows(), BlockCols == 1 ? 1 : xpr.
cols()),
346 m_startRow((BlockRows == 1) && (BlockCols ==
XprType::ColsAtCompileTime) ?
i : 0),
347 m_startCol((BlockRows ==
XprType::RowsAtCompileTime) && (BlockCols == 1) ?
i : 0) {
354 :
Base((BlockRows == 0 || BlockCols == 0)
356 : add_to_nullable_pointer(xpr.
data(),
357 xpr.innerStride() * (XprTypeIsRowMajor ? startCol : startRow) +
358 xpr.outerStride() * (XprTypeIsRowMajor ? startRow : startCol))),
360 m_startRow(startRow),
361 m_startCol(startCol) {
369 :
Base((blockRows == 0 || blockCols == 0)
371 : add_to_nullable_pointer(xpr.
data(),
372 xpr.innerStride() * (XprTypeIsRowMajor ? startCol : startRow) +
373 xpr.outerStride() * (XprTypeIsRowMajor ? startRow : startCol)),
374 blockRows, blockCols),
376 m_startRow(startRow),
377 m_startCol(startCol) {
399 return m_startRow.value();
403 return m_startCol.value();
412 #ifndef EIGEN_PARSED_BY_DOXYGEN
416 :
Base(
data, blockRows, blockCols), m_xpr(xpr) {
int i
Definition: BiCGSTAB_step_by_step.cpp:9
#define EIGEN_ALWAYS_INLINE
Definition: Macros.h:845
#define EIGEN_GENERIC_PUBLIC_INTERFACE(Derived)
Definition: Macros.h:1149
#define EIGEN_NOEXCEPT
Definition: Macros.h:1267
#define EIGEN_CONSTEXPR
Definition: Macros.h:758
#define EIGEN_DEVICE_FUNC
Definition: Macros.h:892
#define EIGEN_DENSE_PUBLIC_INTERFACE(Derived)
Definition: Macros.h:1171
#define eigen_assert(x)
Definition: Macros.h:910
#define EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Derived)
Macro to manually inherit assignment operators. This is necessary, because the implicitly defined ass...
Definition: Macros.h:1126
#define EIGEN_STRONG_INLINE
Definition: Macros.h:834
int data[]
Definition: Map_placement_new.cpp:1
#define EIGEN_STATIC_ASSERT_LVALUE(Derived)
Definition: StaticAssert.h:87
#define EIGEN_STATIC_ASSERT(X, MSG)
Definition: StaticAssert.h:26
int rows
Definition: Tutorial_commainit_02.cpp:1
int cols
Definition: Tutorial_commainit_02.cpp:1
SCALAR Scalar
Definition: bench_gemm.cpp:45
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE BlockImpl(XprType &xpr, Index startRow, Index startCol, Index blockRows, Index blockCols)
Definition: Block.h:181
Impl Base
Definition: Block.h:176
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE BlockImpl(XprType &xpr, Index startRow, Index startCol)
Definition: Block.h:179
internal::BlockImpl_dense< XprType, BlockRows, BlockCols, InnerPanel > Impl
Definition: Block.h:172
XprType::StorageIndex StorageIndex
Definition: Block.h:173
Expression of a fixed-size or dynamic-size block.
Definition: Block.h:110
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Block(XprType &xpr, Index startRow, Index startCol)
Definition: Block.h:131
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE UnwindReturnType unwind()
Definition: Block.h:161
internal::remove_all_t< XprType > NestedExpression
Definition: Block.h:120
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Block(XprType &xpr, Index startRow, Index startCol, Index blockRows, Index blockCols)
Definition: Block.h:141
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ConstUnwindReturnType unwind() const
Definition: Block.h:155
Impl Base
Definition: Block.h:116
BlockImpl< XprType, BlockRows, BlockCols, InnerPanel, typename internal::traits< XprType >::StorageKind > Impl
Definition: Block.h:111
Definition: ForwardDeclarations.h:150
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE BlockImpl_dense(XprType &xpr, const Scalar *data, Index blockRows, Index blockCols)
Definition: Block.h:414
MapBase< BlockType > Base
Definition: Block.h:328
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const internal::remove_all_t< XprTypeNested > & nestedExpression() const EIGEN_NOEXCEPT
Definition: Block.h:381
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE BlockImpl_dense(XprType &xpr, Index startRow, Index startCol, Index blockRows, Index blockCols)
Definition: Block.h:367
internal::ref_selector< XprType >::non_const_type XprTypeNested
Definition: Block.h:315
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index outerStride() const EIGEN_NOEXCEPT
Definition: Block.h:394
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void init()
Definition: Block.h:422
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR StorageIndex startCol() const EIGEN_NOEXCEPT
Definition: Block.h:402
XprTypeNested m_xpr
Definition: Block.h:427
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index innerStride() const EIGEN_NOEXCEPT
Definition: Block.h:389
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR StorageIndex startRow() const EIGEN_NOEXCEPT
Definition: Block.h:398
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE XprType & nestedExpression()
Definition: Block.h:386
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE BlockImpl_dense(XprType &xpr, Index startRow, Index startCol)
Definition: Block.h:353
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR static EIGEN_ALWAYS_INLINE Scalar * add_to_nullable_pointer(Scalar *base, Index offset)
Definition: Block.h:322
Index m_outerStride
Definition: Block.h:432
Block< XprType, BlockRows, BlockCols, InnerPanel > BlockType
Definition: Block.h:314
EIGEN_DEVICE_FUNC const Scalar & coeffRef(Index index) const
Definition: Block.h:247
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR StorageIndex startRow() const EIGEN_NOEXCEPT
Definition: Block.h:292
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR StorageIndex startCol() const EIGEN_NOEXCEPT
Definition: Block.h:296
EIGEN_DEVICE_FUNC BlockImpl_dense(XprType &xpr, Index startRow, Index startCol, Index blockRows, Index blockCols)
Definition: Block.h:221
EIGEN_DEVICE_FUNC Scalar & coeffRef(Index rowId, Index colId)
Definition: Block.h:228
Block< XprType, BlockRows, BlockCols, InnerPanel > BlockType
Definition: Block.h:191
EIGEN_DEVICE_FUNC Index rows() const
Definition: Block.h:225
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const internal::remove_all_t< XprTypeNested > & nestedExpression() const
Definition: Block.h:286
EIGEN_DEVICE_FUNC const CoeffReturnType coeff(Index index) const
Definition: Block.h:252
EIGEN_DEVICE_FUNC void writePacket(Index index, const PacketScalar &val)
Definition: Block.h:274
EIGEN_DEVICE_FUNC PacketScalar packet(Index index) const
Definition: Block.h:268
internal::ref_selector< XprType >::non_const_type XprTypeNested
Definition: Block.h:192
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CoeffReturnType coeff(Index rowId, Index colId) const
Definition: Block.h:237
const internal::variable_if_dynamic< StorageIndex, ColsAtCompileTime > m_blockCols
Definition: Block.h:307
internal::dense_xpr_base< BlockType >::type Base
Definition: Block.h:195
EIGEN_DEVICE_FUNC const Scalar & coeffRef(Index rowId, Index colId) const
Definition: Block.h:233
XprTypeNested m_xpr
Definition: Block.h:301
EIGEN_DEVICE_FUNC Scalar & coeffRef(Index index)
Definition: Block.h:241
EIGEN_DEVICE_FUNC PacketScalar packet(Index rowId, Index colId) const
Definition: Block.h:258
EIGEN_DEVICE_FUNC BlockImpl_dense(XprType &xpr, Index startRow, Index startCol)
Definition: Block.h:216
EIGEN_DEVICE_FUNC void writePacket(Index rowId, Index colId, const PacketScalar &val)
Definition: Block.h:263
const internal::variable_if_dynamic< StorageIndex, RowsAtCompileTime > m_blockRows
Definition: Block.h:306
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE XprType & nestedExpression()
Definition: Block.h:290
EIGEN_DEVICE_FUNC Index cols() const
Definition: Block.h:226
Definition: XprHelper.h:154
const unsigned int DirectAccessBit
Definition: Constants.h:159
const unsigned int LvalueBit
Definition: Constants.h:148
const unsigned int RowMajorBit
Definition: Constants.h:70
const unsigned int CompressedAccessBit
Definition: Constants.h:195
Eigen::DenseIndex ret
Definition: level1_cplx_impl.h:43
typename remove_all< T >::type remove_all_t
Definition: Meta.h:142
Namespace containing all symbols from the Eigen library.
Definition: bench_norm.cpp:70
squared absolute value
Definition: GlobalFunctions.h:87
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:83
const int Dynamic
Definition: Constants.h:25
Extend namespace for flags.
Definition: fsi_chan_precond_driver.cc:56
val
Definition: calibrate.py:119
type
Definition: compute_granudrum_aor.py:141
Definition: Eigen_Colamd.h:49
CwiseBinaryOp< internal::scalar_sum_op< double, double >, const CpyMatrixXd, const CpyMatrixXd > XprType
Definition: nestbyvalue.cpp:15
Definition: Constants.h:519
Definition: XprHelper.h:941
Definition: XprHelper.h:558
Definition: ForwardDeclarations.h:31
Definition: DenseCoeffsBase.h:546
Definition: XprHelper.h:819
Definition: DenseCoeffsBase.h:556
std::conditional_t< bool(traits< T >::Flags &NestByRefBit), T const &, const T > type
Definition: XprHelper.h:507
std::conditional_t< bool(traits< T >::Flags &NestByRefBit), T &, T > non_const_type
Definition: XprHelper.h:509
traits< XprType_ >::StorageKind StorageKind
Definition: Block.h:23
std::remove_reference_t< XprTypeNested > XprTypeNested_
Definition: Block.h:26
ref_selector< XprType_ >::type XprTypeNested
Definition: Block.h:25
traits< XprType_ >::Scalar Scalar
Definition: Block.h:22
traits< XprType_ >::XprKind XprKind
Definition: Block.h:24
Definition: ForwardDeclarations.h:21
Definition: TutorialInplaceLU.cpp:2