Bugzilla – Attachment 349 Details for
Bug 579
Missing size parameters in fixed-size block method
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Forgot Password
Login:
[x]
This bugzilla service is closed. All entries have been migrated to
https://gitlab.com/libeigen/eigen
[patch]
implementation example of partial fixed-size blocks
partial_block_example.diff (text/plain), 2.06 KB, created by
Gael Guennebaud
on 2013-06-17 21:44:59 UTC
(
hide
)
Description:
implementation example of partial fixed-size blocks
Filename:
MIME Type:
Creator:
Gael Guennebaud
Created:
2013-06-17 21:44:59 UTC
Size:
2.06 KB
patch
obsolete
>diff --git a/Eigen/src/plugins/BlockMethods.h b/Eigen/src/plugins/BlockMethods.h >--- a/Eigen/src/plugins/BlockMethods.h >+++ b/Eigen/src/plugins/BlockMethods.h >@@ -540,16 +540,44 @@ inline Block<Derived, BlockRows, BlockCo > > /** This is the const version of block<>(Index, Index). */ > template<int BlockRows, int BlockCols> > inline const Block<const Derived, BlockRows, BlockCols> block(Index startRow, Index startCol) const > { > return Block<const Derived, BlockRows, BlockCols>(derived(), startRow, startCol); > } > >+/** \returns a partial fixed-size expression of a block in *this. >+ * >+ * The template parameters \a BlockRows and \a BlockCols are the number of >+ * rows and columns in the block. One of them is supposed to be \a Dynamic. >+ * >+ * \param startRow the first row in the block >+ * \param startCol the first column in the block >+ * \param blockRows the number of rows in the block >+ * \param blockCols the number of columns in the block >+ * >+ * \note since block is a templated member, the keyword template has to be used >+ * if the matrix type is also a template parameter: \code m.template block<3,Dynamic>(1,1,3,n); \endcode >+ * >+ * \sa class Block, block(Index,Index,Index,Index), block<>(Index,Index) >+ */ >+template<int BlockRows, int BlockCols> >+inline Block<Derived, BlockRows, BlockCols> block(Index startRow, Index startCol, Index numRows, Index numCols) >+{ >+ return Block<Derived, BlockRows, BlockCols>(derived(), startRow, startCol, numRows, numCols); >+} >+ >+/** This is the const version of block<>(Index, Index, Index, Index). */ >+template<int BlockRows, int BlockCols> >+inline const Block<const Derived, BlockRows, BlockCols> block(Index startRow, Index startCol, Index numRows, Index numCols) const >+{ >+ return Block<const Derived, BlockRows, BlockCols>(derived(), startRow, startCol, numRows, numCols); >+} >+ > /** \returns an expression of the \a i-th column of *this. Note that the numbering starts at 0. > * > * Example: \include MatrixBase_col.cpp > * Output: \verbinclude MatrixBase_col.out > * > * \sa row(), class Block */ > inline ColXpr col(Index i) > {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 579
:
325
| 349 |
405
|
407