Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/eigen3/Eigen/src/plugins/BlockMethods.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // This file is part of Eigen, a lightweight C++ template library
0002 // for linear algebra.
0003 //
0004 // Copyright (C) 2008-2010 Gael Guennebaud <gael.guennebaud@inria.fr>
0005 // Copyright (C) 2006-2010 Benoit Jacob <jacob.benoit.1@gmail.com>
0006 //
0007 // This Source Code Form is subject to the terms of the Mozilla
0008 // Public License v. 2.0. If a copy of the MPL was not distributed
0009 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
0010 
0011 #ifndef EIGEN_PARSED_BY_DOXYGEN
0012 
0013 /// \internal expression type of a column */
0014 typedef Block<Derived, internal::traits<Derived>::RowsAtCompileTime, 1, !IsRowMajor> ColXpr;
0015 typedef const Block<const Derived, internal::traits<Derived>::RowsAtCompileTime, 1, !IsRowMajor> ConstColXpr;
0016 /// \internal expression type of a row */
0017 typedef Block<Derived, 1, internal::traits<Derived>::ColsAtCompileTime, IsRowMajor> RowXpr;
0018 typedef const Block<const Derived, 1, internal::traits<Derived>::ColsAtCompileTime, IsRowMajor> ConstRowXpr;
0019 /// \internal expression type of a block of whole columns */
0020 typedef Block<Derived, internal::traits<Derived>::RowsAtCompileTime, Dynamic, !IsRowMajor> ColsBlockXpr;
0021 typedef const Block<const Derived, internal::traits<Derived>::RowsAtCompileTime, Dynamic, !IsRowMajor> ConstColsBlockXpr;
0022 /// \internal expression type of a block of whole rows */
0023 typedef Block<Derived, Dynamic, internal::traits<Derived>::ColsAtCompileTime, IsRowMajor> RowsBlockXpr;
0024 typedef const Block<const Derived, Dynamic, internal::traits<Derived>::ColsAtCompileTime, IsRowMajor> ConstRowsBlockXpr;
0025 /// \internal expression type of a block of whole columns */
0026 template<int N> struct NColsBlockXpr { typedef Block<Derived, internal::traits<Derived>::RowsAtCompileTime, N, !IsRowMajor> Type; };
0027 template<int N> struct ConstNColsBlockXpr { typedef const Block<const Derived, internal::traits<Derived>::RowsAtCompileTime, N, !IsRowMajor> Type; };
0028 /// \internal expression type of a block of whole rows */
0029 template<int N> struct NRowsBlockXpr { typedef Block<Derived, N, internal::traits<Derived>::ColsAtCompileTime, IsRowMajor> Type; };
0030 template<int N> struct ConstNRowsBlockXpr { typedef const Block<const Derived, N, internal::traits<Derived>::ColsAtCompileTime, IsRowMajor> Type; };
0031 /// \internal expression of a block */
0032 typedef Block<Derived> BlockXpr;
0033 typedef const Block<const Derived> ConstBlockXpr;
0034 /// \internal expression of a block of fixed sizes */
0035 template<int Rows, int Cols> struct FixedBlockXpr { typedef Block<Derived,Rows,Cols> Type; };
0036 template<int Rows, int Cols> struct ConstFixedBlockXpr { typedef Block<const Derived,Rows,Cols> Type; };
0037 
0038 typedef VectorBlock<Derived> SegmentReturnType;
0039 typedef const VectorBlock<const Derived> ConstSegmentReturnType;
0040 template<int Size> struct FixedSegmentReturnType { typedef VectorBlock<Derived, Size> Type; };
0041 template<int Size> struct ConstFixedSegmentReturnType { typedef const VectorBlock<const Derived, Size> Type; };
0042 
0043 /// \internal inner-vector
0044 typedef Block<Derived,IsRowMajor?1:Dynamic,IsRowMajor?Dynamic:1,true>       InnerVectorReturnType;
0045 typedef Block<const Derived,IsRowMajor?1:Dynamic,IsRowMajor?Dynamic:1,true> ConstInnerVectorReturnType;
0046 
0047 /// \internal set of inner-vectors
0048 typedef Block<Derived,Dynamic,Dynamic,true> InnerVectorsReturnType;
0049 typedef Block<const Derived,Dynamic,Dynamic,true> ConstInnerVectorsReturnType;
0050 
0051 #endif // not EIGEN_PARSED_BY_DOXYGEN
0052 
0053 /// \returns an expression of a block in \c *this with either dynamic or fixed sizes.
0054 ///
0055 /// \param  startRow  the first row in the block
0056 /// \param  startCol  the first column in the block
0057 /// \param  blockRows number of rows in the block, specified at either run-time or compile-time
0058 /// \param  blockCols number of columns in the block, specified at either run-time or compile-time
0059 /// \tparam NRowsType the type of the value handling the number of rows in the block, typically Index.
0060 /// \tparam NColsType the type of the value handling the number of columns in the block, typically Index.
0061 ///
0062 /// Example using runtime (aka dynamic) sizes: \include MatrixBase_block_int_int_int_int.cpp
0063 /// Output: \verbinclude MatrixBase_block_int_int_int_int.out
0064 ///
0065 /// \newin{3.4}:
0066 ///
0067 /// The number of rows \a blockRows and columns \a blockCols can also be specified at compile-time by passing Eigen::fix<N>,
0068 /// or Eigen::fix<N>(n) as arguments. In the later case, \c n plays the role of a runtime fallback value in case \c N equals Eigen::Dynamic.
0069 /// Here is an example with a fixed number of rows \c NRows and dynamic number of columns \c cols:
0070 /// \code
0071 /// mat.block(i,j,fix<NRows>,cols)
0072 /// \endcode
0073 ///
0074 /// This function thus fully covers the features offered by the following overloads block<NRows,NCols>(Index, Index),
0075 /// and block<NRows,NCols>(Index, Index, Index, Index) that are thus obsolete. Indeed, this generic version avoids
0076 /// redundancy, it preserves the argument order, and prevents the need to rely on the template keyword in templated code.
0077 ///
0078 /// but with less redundancy and more consistency as it does not modify the argument order
0079 /// and seamlessly enable hybrid fixed/dynamic sizes.
0080 ///
0081 /// \note Even in the case that the returned expression has dynamic size, in the case
0082 /// when it is applied to a fixed-size matrix, it inherits a fixed maximal size,
0083 /// which means that evaluating it does not cause a dynamic memory allocation.
0084 ///
0085 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
0086 ///
0087 /// \sa class Block, fix, fix<N>(int)
0088 ///
0089 template<typename NRowsType, typename NColsType>
0090 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
0091 #ifndef EIGEN_PARSED_BY_DOXYGEN
0092 typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
0093 #else
0094 typename FixedBlockXpr<...,...>::Type
0095 #endif
0096 block(Index startRow, Index startCol, NRowsType blockRows, NColsType blockCols)
0097 {
0098   return typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type(
0099             derived(), startRow, startCol, internal::get_runtime_value(blockRows), internal::get_runtime_value(blockCols));
0100 }
0101 
0102 /// This is the const version of block(Index,Index,NRowsType,NColsType)
0103 template<typename NRowsType, typename NColsType>
0104 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
0105 #ifndef EIGEN_PARSED_BY_DOXYGEN
0106 const typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
0107 #else
0108 const typename ConstFixedBlockXpr<...,...>::Type
0109 #endif
0110 block(Index startRow, Index startCol, NRowsType blockRows, NColsType blockCols) const
0111 {
0112   return typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type(
0113             derived(), startRow, startCol, internal::get_runtime_value(blockRows), internal::get_runtime_value(blockCols));
0114 }
0115 
0116 
0117 
0118 /// \returns a expression of a top-right corner of \c *this with either dynamic or fixed sizes.
0119 ///
0120 /// \param cRows the number of rows in the corner
0121 /// \param cCols the number of columns in the corner
0122 /// \tparam NRowsType the type of the value handling the number of rows in the block, typically Index.
0123 /// \tparam NColsType the type of the value handling the number of columns in the block, typically Index.
0124 ///
0125 /// Example with dynamic sizes: \include MatrixBase_topRightCorner_int_int.cpp
0126 /// Output: \verbinclude MatrixBase_topRightCorner_int_int.out
0127 ///
0128 /// The number of rows \a blockRows and columns \a blockCols can also be specified at compile-time by passing Eigen::fix<N>,
0129 /// or Eigen::fix<N>(n) as arguments. See \link block(Index,Index,NRowsType,NColsType) block() \endlink for the details.
0130 ///
0131 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
0132 ///
0133 /// \sa block(Index,Index,NRowsType,NColsType), class Block
0134 ///
0135 template<typename NRowsType, typename NColsType>
0136 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
0137 #ifndef EIGEN_PARSED_BY_DOXYGEN
0138 typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
0139 #else
0140 typename FixedBlockXpr<...,...>::Type
0141 #endif
0142 topRightCorner(NRowsType cRows, NColsType cCols)
0143 {
0144   return typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
0145             (derived(), 0, cols() - internal::get_runtime_value(cCols), internal::get_runtime_value(cRows), internal::get_runtime_value(cCols));
0146 }
0147 
0148 /// This is the const version of topRightCorner(NRowsType, NColsType).
0149 template<typename NRowsType, typename NColsType>
0150 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
0151 #ifndef EIGEN_PARSED_BY_DOXYGEN
0152 const typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
0153 #else
0154 const typename ConstFixedBlockXpr<...,...>::Type
0155 #endif
0156 topRightCorner(NRowsType cRows, NColsType cCols) const
0157 {
0158   return typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
0159             (derived(), 0, cols() - internal::get_runtime_value(cCols), internal::get_runtime_value(cRows), internal::get_runtime_value(cCols));
0160 }
0161 
0162 /// \returns an expression of a fixed-size top-right corner of \c *this.
0163 ///
0164 /// \tparam CRows the number of rows in the corner
0165 /// \tparam CCols the number of columns in the corner
0166 ///
0167 /// Example: \include MatrixBase_template_int_int_topRightCorner.cpp
0168 /// Output: \verbinclude MatrixBase_template_int_int_topRightCorner.out
0169 ///
0170 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
0171 ///
0172 /// \sa class Block, block<int,int>(Index,Index)
0173 ///
0174 template<int CRows, int CCols>
0175 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
0176 typename FixedBlockXpr<CRows,CCols>::Type topRightCorner()
0177 {
0178   return typename FixedBlockXpr<CRows,CCols>::Type(derived(), 0, cols() - CCols);
0179 }
0180 
0181 /// This is the const version of topRightCorner<int, int>().
0182 template<int CRows, int CCols>
0183 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
0184 const typename ConstFixedBlockXpr<CRows,CCols>::Type topRightCorner() const
0185 {
0186   return typename ConstFixedBlockXpr<CRows,CCols>::Type(derived(), 0, cols() - CCols);
0187 }
0188 
0189 /// \returns an expression of a top-right corner of \c *this.
0190 ///
0191 /// \tparam CRows number of rows in corner as specified at compile-time
0192 /// \tparam CCols number of columns in corner as specified at compile-time
0193 /// \param  cRows number of rows in corner as specified at run-time
0194 /// \param  cCols number of columns in corner as specified at run-time
0195 ///
0196 /// This function is mainly useful for corners where the number of rows is specified at compile-time
0197 /// and the number of columns is specified at run-time, or vice versa. The compile-time and run-time
0198 /// information should not contradict. In other words, \a cRows should equal \a CRows unless
0199 /// \a CRows is \a Dynamic, and the same for the number of columns.
0200 ///
0201 /// Example: \include MatrixBase_template_int_int_topRightCorner_int_int.cpp
0202 /// Output: \verbinclude MatrixBase_template_int_int_topRightCorner_int_int.out
0203 ///
0204 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
0205 ///
0206 /// \sa class Block
0207 ///
0208 template<int CRows, int CCols>
0209 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
0210 typename FixedBlockXpr<CRows,CCols>::Type topRightCorner(Index cRows, Index cCols)
0211 {
0212   return typename FixedBlockXpr<CRows,CCols>::Type(derived(), 0, cols() - cCols, cRows, cCols);
0213 }
0214 
0215 /// This is the const version of topRightCorner<int, int>(Index, Index).
0216 template<int CRows, int CCols>
0217 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
0218 const typename ConstFixedBlockXpr<CRows,CCols>::Type topRightCorner(Index cRows, Index cCols) const
0219 {
0220   return typename ConstFixedBlockXpr<CRows,CCols>::Type(derived(), 0, cols() - cCols, cRows, cCols);
0221 }
0222 
0223 
0224 
0225 /// \returns an expression of a top-left corner of \c *this  with either dynamic or fixed sizes.
0226 ///
0227 /// \param cRows the number of rows in the corner
0228 /// \param cCols the number of columns in the corner
0229 /// \tparam NRowsType the type of the value handling the number of rows in the block, typically Index.
0230 /// \tparam NColsType the type of the value handling the number of columns in the block, typically Index.
0231 ///
0232 /// Example: \include MatrixBase_topLeftCorner_int_int.cpp
0233 /// Output: \verbinclude MatrixBase_topLeftCorner_int_int.out
0234 ///
0235 /// The number of rows \a blockRows and columns \a blockCols can also be specified at compile-time by passing Eigen::fix<N>,
0236 /// or Eigen::fix<N>(n) as arguments. See \link block(Index,Index,NRowsType,NColsType) block() \endlink for the details.
0237 ///
0238 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
0239 ///
0240 /// \sa block(Index,Index,NRowsType,NColsType), class Block
0241 ///
0242 template<typename NRowsType, typename NColsType>
0243 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
0244 #ifndef EIGEN_PARSED_BY_DOXYGEN
0245 typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
0246 #else
0247 typename FixedBlockXpr<...,...>::Type
0248 #endif
0249 topLeftCorner(NRowsType cRows, NColsType cCols)
0250 {
0251   return typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
0252             (derived(), 0, 0, internal::get_runtime_value(cRows), internal::get_runtime_value(cCols));
0253 }
0254 
0255 /// This is the const version of topLeftCorner(Index, Index).
0256 template<typename NRowsType, typename NColsType>
0257 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
0258 #ifndef EIGEN_PARSED_BY_DOXYGEN
0259 const typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
0260 #else
0261 const typename ConstFixedBlockXpr<...,...>::Type
0262 #endif
0263 topLeftCorner(NRowsType cRows, NColsType cCols) const
0264 {
0265   return typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
0266             (derived(), 0, 0, internal::get_runtime_value(cRows), internal::get_runtime_value(cCols));
0267 }
0268 
0269 /// \returns an expression of a fixed-size top-left corner of \c *this.
0270 ///
0271 /// The template parameters CRows and CCols are the number of rows and columns in the corner.
0272 ///
0273 /// Example: \include MatrixBase_template_int_int_topLeftCorner.cpp
0274 /// Output: \verbinclude MatrixBase_template_int_int_topLeftCorner.out
0275 ///
0276 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
0277 ///
0278 /// \sa block(Index,Index,NRowsType,NColsType), class Block
0279 ///
0280 template<int CRows, int CCols>
0281 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
0282 typename FixedBlockXpr<CRows,CCols>::Type topLeftCorner()
0283 {
0284   return typename FixedBlockXpr<CRows,CCols>::Type(derived(), 0, 0);
0285 }
0286 
0287 /// This is the const version of topLeftCorner<int, int>().
0288 template<int CRows, int CCols>
0289 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
0290 const typename ConstFixedBlockXpr<CRows,CCols>::Type topLeftCorner() const
0291 {
0292   return typename ConstFixedBlockXpr<CRows,CCols>::Type(derived(), 0, 0);
0293 }
0294 
0295 /// \returns an expression of a top-left corner of \c *this.
0296 ///
0297 /// \tparam CRows number of rows in corner as specified at compile-time
0298 /// \tparam CCols number of columns in corner as specified at compile-time
0299 /// \param  cRows number of rows in corner as specified at run-time
0300 /// \param  cCols number of columns in corner as specified at run-time
0301 ///
0302 /// This function is mainly useful for corners where the number of rows is specified at compile-time
0303 /// and the number of columns is specified at run-time, or vice versa. The compile-time and run-time
0304 /// information should not contradict. In other words, \a cRows should equal \a CRows unless
0305 /// \a CRows is \a Dynamic, and the same for the number of columns.
0306 ///
0307 /// Example: \include MatrixBase_template_int_int_topLeftCorner_int_int.cpp
0308 /// Output: \verbinclude MatrixBase_template_int_int_topLeftCorner_int_int.out
0309 ///
0310 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
0311 ///
0312 /// \sa class Block
0313 ///
0314 template<int CRows, int CCols>
0315 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
0316 typename FixedBlockXpr<CRows,CCols>::Type topLeftCorner(Index cRows, Index cCols)
0317 {
0318   return typename FixedBlockXpr<CRows,CCols>::Type(derived(), 0, 0, cRows, cCols);
0319 }
0320 
0321 /// This is the const version of topLeftCorner<int, int>(Index, Index).
0322 template<int CRows, int CCols>
0323 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
0324 const typename ConstFixedBlockXpr<CRows,CCols>::Type topLeftCorner(Index cRows, Index cCols) const
0325 {
0326   return typename ConstFixedBlockXpr<CRows,CCols>::Type(derived(), 0, 0, cRows, cCols);
0327 }
0328 
0329 
0330 
0331 /// \returns an expression of a bottom-right corner of \c *this  with either dynamic or fixed sizes.
0332 ///
0333 /// \param cRows the number of rows in the corner
0334 /// \param cCols the number of columns in the corner
0335 /// \tparam NRowsType the type of the value handling the number of rows in the block, typically Index.
0336 /// \tparam NColsType the type of the value handling the number of columns in the block, typically Index.
0337 ///
0338 /// Example: \include MatrixBase_bottomRightCorner_int_int.cpp
0339 /// Output: \verbinclude MatrixBase_bottomRightCorner_int_int.out
0340 ///
0341 /// The number of rows \a blockRows and columns \a blockCols can also be specified at compile-time by passing Eigen::fix<N>,
0342 /// or Eigen::fix<N>(n) as arguments. See \link block(Index,Index,NRowsType,NColsType) block() \endlink for the details.
0343 ///
0344 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
0345 ///
0346 /// \sa block(Index,Index,NRowsType,NColsType), class Block
0347 ///
0348 template<typename NRowsType, typename NColsType>
0349 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
0350 #ifndef EIGEN_PARSED_BY_DOXYGEN
0351 typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
0352 #else
0353 typename FixedBlockXpr<...,...>::Type
0354 #endif
0355 bottomRightCorner(NRowsType cRows, NColsType cCols)
0356 {
0357   return typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
0358             (derived(), rows() - internal::get_runtime_value(cRows), cols() - internal::get_runtime_value(cCols),
0359                         internal::get_runtime_value(cRows), internal::get_runtime_value(cCols));
0360 }
0361 
0362 /// This is the const version of bottomRightCorner(NRowsType, NColsType).
0363 template<typename NRowsType, typename NColsType>
0364 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
0365 #ifndef EIGEN_PARSED_BY_DOXYGEN
0366 const typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
0367 #else
0368 const typename ConstFixedBlockXpr<...,...>::Type
0369 #endif
0370 bottomRightCorner(NRowsType cRows, NColsType cCols) const
0371 {
0372   return typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
0373             (derived(), rows() - internal::get_runtime_value(cRows), cols() - internal::get_runtime_value(cCols),
0374                         internal::get_runtime_value(cRows), internal::get_runtime_value(cCols));
0375 }
0376 
0377 /// \returns an expression of a fixed-size bottom-right corner of \c *this.
0378 ///
0379 /// The template parameters CRows and CCols are the number of rows and columns in the corner.
0380 ///
0381 /// Example: \include MatrixBase_template_int_int_bottomRightCorner.cpp
0382 /// Output: \verbinclude MatrixBase_template_int_int_bottomRightCorner.out
0383 ///
0384 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
0385 ///
0386 /// \sa block(Index,Index,NRowsType,NColsType), class Block
0387 ///
0388 template<int CRows, int CCols>
0389 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
0390 typename FixedBlockXpr<CRows,CCols>::Type bottomRightCorner()
0391 {
0392   return typename FixedBlockXpr<CRows,CCols>::Type(derived(), rows() - CRows, cols() - CCols);
0393 }
0394 
0395 /// This is the const version of bottomRightCorner<int, int>().
0396 template<int CRows, int CCols>
0397 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
0398 const typename ConstFixedBlockXpr<CRows,CCols>::Type bottomRightCorner() const
0399 {
0400   return typename ConstFixedBlockXpr<CRows,CCols>::Type(derived(), rows() - CRows, cols() - CCols);
0401 }
0402 
0403 /// \returns an expression of a bottom-right corner of \c *this.
0404 ///
0405 /// \tparam CRows number of rows in corner as specified at compile-time
0406 /// \tparam CCols number of columns in corner as specified at compile-time
0407 /// \param  cRows number of rows in corner as specified at run-time
0408 /// \param  cCols number of columns in corner as specified at run-time
0409 ///
0410 /// This function is mainly useful for corners where the number of rows is specified at compile-time
0411 /// and the number of columns is specified at run-time, or vice versa. The compile-time and run-time
0412 /// information should not contradict. In other words, \a cRows should equal \a CRows unless
0413 /// \a CRows is \a Dynamic, and the same for the number of columns.
0414 ///
0415 /// Example: \include MatrixBase_template_int_int_bottomRightCorner_int_int.cpp
0416 /// Output: \verbinclude MatrixBase_template_int_int_bottomRightCorner_int_int.out
0417 ///
0418 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
0419 ///
0420 /// \sa class Block
0421 ///
0422 template<int CRows, int CCols>
0423 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
0424 typename FixedBlockXpr<CRows,CCols>::Type bottomRightCorner(Index cRows, Index cCols)
0425 {
0426   return typename FixedBlockXpr<CRows,CCols>::Type(derived(), rows() - cRows, cols() - cCols, cRows, cCols);
0427 }
0428 
0429 /// This is the const version of bottomRightCorner<int, int>(Index, Index).
0430 template<int CRows, int CCols>
0431 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
0432 const typename ConstFixedBlockXpr<CRows,CCols>::Type bottomRightCorner(Index cRows, Index cCols) const
0433 {
0434   return typename ConstFixedBlockXpr<CRows,CCols>::Type(derived(), rows() - cRows, cols() - cCols, cRows, cCols);
0435 }
0436 
0437 
0438 
0439 /// \returns an expression of a bottom-left corner of \c *this  with either dynamic or fixed sizes.
0440 ///
0441 /// \param cRows the number of rows in the corner
0442 /// \param cCols the number of columns in the corner
0443 /// \tparam NRowsType the type of the value handling the number of rows in the block, typically Index.
0444 /// \tparam NColsType the type of the value handling the number of columns in the block, typically Index.
0445 ///
0446 /// Example: \include MatrixBase_bottomLeftCorner_int_int.cpp
0447 /// Output: \verbinclude MatrixBase_bottomLeftCorner_int_int.out
0448 ///
0449 /// The number of rows \a blockRows and columns \a blockCols can also be specified at compile-time by passing Eigen::fix<N>,
0450 /// or Eigen::fix<N>(n) as arguments. See \link block(Index,Index,NRowsType,NColsType) block() \endlink for the details.
0451 ///
0452 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
0453 ///
0454 /// \sa block(Index,Index,NRowsType,NColsType), class Block
0455 ///
0456 template<typename NRowsType, typename NColsType>
0457 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
0458 #ifndef EIGEN_PARSED_BY_DOXYGEN
0459 typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
0460 #else
0461 typename FixedBlockXpr<...,...>::Type
0462 #endif
0463 bottomLeftCorner(NRowsType cRows, NColsType cCols)
0464 {
0465   return typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
0466             (derived(), rows() - internal::get_runtime_value(cRows), 0,
0467                         internal::get_runtime_value(cRows), internal::get_runtime_value(cCols));
0468 }
0469 
0470 /// This is the const version of bottomLeftCorner(NRowsType, NColsType).
0471 template<typename NRowsType, typename NColsType>
0472 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
0473 #ifndef EIGEN_PARSED_BY_DOXYGEN
0474 typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
0475 #else
0476 typename ConstFixedBlockXpr<...,...>::Type
0477 #endif
0478 bottomLeftCorner(NRowsType cRows, NColsType cCols) const
0479 {
0480   return typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
0481             (derived(), rows() - internal::get_runtime_value(cRows), 0,
0482                         internal::get_runtime_value(cRows), internal::get_runtime_value(cCols));
0483 }
0484 
0485 /// \returns an expression of a fixed-size bottom-left corner of \c *this.
0486 ///
0487 /// The template parameters CRows and CCols are the number of rows and columns in the corner.
0488 ///
0489 /// Example: \include MatrixBase_template_int_int_bottomLeftCorner.cpp
0490 /// Output: \verbinclude MatrixBase_template_int_int_bottomLeftCorner.out
0491 ///
0492 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
0493 ///
0494 /// \sa block(Index,Index,NRowsType,NColsType), class Block
0495 ///
0496 template<int CRows, int CCols>
0497 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
0498 typename FixedBlockXpr<CRows,CCols>::Type bottomLeftCorner()
0499 {
0500   return typename FixedBlockXpr<CRows,CCols>::Type(derived(), rows() - CRows, 0);
0501 }
0502 
0503 /// This is the const version of bottomLeftCorner<int, int>().
0504 template<int CRows, int CCols>
0505 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
0506 const typename ConstFixedBlockXpr<CRows,CCols>::Type bottomLeftCorner() const
0507 {
0508   return typename ConstFixedBlockXpr<CRows,CCols>::Type(derived(), rows() - CRows, 0);
0509 }
0510 
0511 /// \returns an expression of a bottom-left corner of \c *this.
0512 ///
0513 /// \tparam CRows number of rows in corner as specified at compile-time
0514 /// \tparam CCols number of columns in corner as specified at compile-time
0515 /// \param  cRows number of rows in corner as specified at run-time
0516 /// \param  cCols number of columns in corner as specified at run-time
0517 ///
0518 /// This function is mainly useful for corners where the number of rows is specified at compile-time
0519 /// and the number of columns is specified at run-time, or vice versa. The compile-time and run-time
0520 /// information should not contradict. In other words, \a cRows should equal \a CRows unless
0521 /// \a CRows is \a Dynamic, and the same for the number of columns.
0522 ///
0523 /// Example: \include MatrixBase_template_int_int_bottomLeftCorner_int_int.cpp
0524 /// Output: \verbinclude MatrixBase_template_int_int_bottomLeftCorner_int_int.out
0525 ///
0526 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
0527 ///
0528 /// \sa class Block
0529 ///
0530 template<int CRows, int CCols>
0531 EIGEN_STRONG_INLINE
0532 typename FixedBlockXpr<CRows,CCols>::Type bottomLeftCorner(Index cRows, Index cCols)
0533 {
0534   return typename FixedBlockXpr<CRows,CCols>::Type(derived(), rows() - cRows, 0, cRows, cCols);
0535 }
0536 
0537 /// This is the const version of bottomLeftCorner<int, int>(Index, Index).
0538 template<int CRows, int CCols>
0539 EIGEN_STRONG_INLINE
0540 const typename ConstFixedBlockXpr<CRows,CCols>::Type bottomLeftCorner(Index cRows, Index cCols) const
0541 {
0542   return typename ConstFixedBlockXpr<CRows,CCols>::Type(derived(), rows() - cRows, 0, cRows, cCols);
0543 }
0544 
0545 
0546 
0547 /// \returns a block consisting of the top rows of \c *this.
0548 ///
0549 /// \param n the number of rows in the block
0550 /// \tparam NRowsType the type of the value handling the number of rows in the block, typically Index.
0551 ///
0552 /// Example: \include MatrixBase_topRows_int.cpp
0553 /// Output: \verbinclude MatrixBase_topRows_int.out
0554 ///
0555 /// The number of rows \a n can also be specified at compile-time by passing Eigen::fix<N>,
0556 /// or Eigen::fix<N>(n) as arguments.
0557 /// See \link block(Index,Index,NRowsType,NColsType) block() \endlink for the details.
0558 ///
0559 EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row-major)
0560 ///
0561 /// \sa block(Index,Index,NRowsType,NColsType), class Block
0562 ///
0563 template<typename NRowsType>
0564 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
0565 #ifndef EIGEN_PARSED_BY_DOXYGEN
0566 typename NRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
0567 #else
0568 typename NRowsBlockXpr<...>::Type
0569 #endif
0570 topRows(NRowsType n)
0571 {
0572   return typename NRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
0573             (derived(), 0, 0, internal::get_runtime_value(n), cols());
0574 }
0575 
0576 /// This is the const version of topRows(NRowsType).
0577 template<typename NRowsType>
0578 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
0579 #ifndef EIGEN_PARSED_BY_DOXYGEN
0580 const typename ConstNRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
0581 #else
0582 const typename ConstNRowsBlockXpr<...>::Type
0583 #endif
0584 topRows(NRowsType n) const
0585 {
0586   return typename ConstNRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
0587             (derived(), 0, 0, internal::get_runtime_value(n), cols());
0588 }
0589 
0590 /// \returns a block consisting of the top rows of \c *this.
0591 ///
0592 /// \tparam N the number of rows in the block as specified at compile-time
0593 /// \param n the number of rows in the block as specified at run-time
0594 ///
0595 /// The compile-time and run-time information should not contradict. In other words,
0596 /// \a n should equal \a N unless \a N is \a Dynamic.
0597 ///
0598 /// Example: \include MatrixBase_template_int_topRows.cpp
0599 /// Output: \verbinclude MatrixBase_template_int_topRows.out
0600 ///
0601 EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row-major)
0602 ///
0603 /// \sa block(Index,Index,NRowsType,NColsType), class Block
0604 ///
0605 template<int N>
0606 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
0607 typename NRowsBlockXpr<N>::Type topRows(Index n = N)
0608 {
0609   return typename NRowsBlockXpr<N>::Type(derived(), 0, 0, n, cols());
0610 }
0611 
0612 /// This is the const version of topRows<int>().
0613 template<int N>
0614 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
0615 typename ConstNRowsBlockXpr<N>::Type topRows(Index n = N) const
0616 {
0617   return typename ConstNRowsBlockXpr<N>::Type(derived(), 0, 0, n, cols());
0618 }
0619 
0620 
0621 
0622 /// \returns a block consisting of the bottom rows of \c *this.
0623 ///
0624 /// \param n the number of rows in the block
0625 /// \tparam NRowsType the type of the value handling the number of rows in the block, typically Index.
0626 ///
0627 /// Example: \include MatrixBase_bottomRows_int.cpp
0628 /// Output: \verbinclude MatrixBase_bottomRows_int.out
0629 ///
0630 /// The number of rows \a n can also be specified at compile-time by passing Eigen::fix<N>,
0631 /// or Eigen::fix<N>(n) as arguments.
0632 /// See \link block(Index,Index,NRowsType,NColsType) block() \endlink for the details.
0633 ///
0634 EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row-major)
0635 ///
0636 /// \sa block(Index,Index,NRowsType,NColsType), class Block
0637 ///
0638 template<typename NRowsType>
0639 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
0640 #ifndef EIGEN_PARSED_BY_DOXYGEN
0641 typename NRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
0642 #else
0643 typename NRowsBlockXpr<...>::Type
0644 #endif
0645 bottomRows(NRowsType n)
0646 {
0647   return typename NRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
0648             (derived(), rows() - internal::get_runtime_value(n), 0, internal::get_runtime_value(n), cols());
0649 }
0650 
0651 /// This is the const version of bottomRows(NRowsType).
0652 template<typename NRowsType>
0653 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
0654 #ifndef EIGEN_PARSED_BY_DOXYGEN
0655 const typename ConstNRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
0656 #else
0657 const typename ConstNRowsBlockXpr<...>::Type
0658 #endif
0659 bottomRows(NRowsType n) const
0660 {
0661   return typename ConstNRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
0662             (derived(), rows() - internal::get_runtime_value(n), 0, internal::get_runtime_value(n), cols());
0663 }
0664 
0665 /// \returns a block consisting of the bottom rows of \c *this.
0666 ///
0667 /// \tparam N the number of rows in the block as specified at compile-time
0668 /// \param n the number of rows in the block as specified at run-time
0669 ///
0670 /// The compile-time and run-time information should not contradict. In other words,
0671 /// \a n should equal \a N unless \a N is \a Dynamic.
0672 ///
0673 /// Example: \include MatrixBase_template_int_bottomRows.cpp
0674 /// Output: \verbinclude MatrixBase_template_int_bottomRows.out
0675 ///
0676 EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row-major)
0677 ///
0678 /// \sa block(Index,Index,NRowsType,NColsType), class Block
0679 ///
0680 template<int N>
0681 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
0682 typename NRowsBlockXpr<N>::Type bottomRows(Index n = N)
0683 {
0684   return typename NRowsBlockXpr<N>::Type(derived(), rows() - n, 0, n, cols());
0685 }
0686 
0687 /// This is the const version of bottomRows<int>().
0688 template<int N>
0689 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
0690 typename ConstNRowsBlockXpr<N>::Type bottomRows(Index n = N) const
0691 {
0692   return typename ConstNRowsBlockXpr<N>::Type(derived(), rows() - n, 0, n, cols());
0693 }
0694 
0695 
0696 
0697 /// \returns a block consisting of a range of rows of \c *this.
0698 ///
0699 /// \param startRow the index of the first row in the block
0700 /// \param n the number of rows in the block
0701 /// \tparam NRowsType the type of the value handling the number of rows in the block, typically Index.
0702 ///
0703 /// Example: \include DenseBase_middleRows_int.cpp
0704 /// Output: \verbinclude DenseBase_middleRows_int.out
0705 ///
0706 /// The number of rows \a n can also be specified at compile-time by passing Eigen::fix<N>,
0707 /// or Eigen::fix<N>(n) as arguments.
0708 /// See \link block(Index,Index,NRowsType,NColsType) block() \endlink for the details.
0709 ///
0710 EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row-major)
0711 ///
0712 /// \sa block(Index,Index,NRowsType,NColsType), class Block
0713 ///
0714 template<typename NRowsType>
0715 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
0716 #ifndef EIGEN_PARSED_BY_DOXYGEN
0717 typename NRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
0718 #else
0719 typename NRowsBlockXpr<...>::Type
0720 #endif
0721 middleRows(Index startRow, NRowsType n)
0722 {
0723   return typename NRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
0724             (derived(), startRow, 0, internal::get_runtime_value(n), cols());
0725 }
0726 
0727 /// This is the const version of middleRows(Index,NRowsType).
0728 template<typename NRowsType>
0729 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
0730 #ifndef EIGEN_PARSED_BY_DOXYGEN
0731 const typename ConstNRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
0732 #else
0733 const typename ConstNRowsBlockXpr<...>::Type
0734 #endif
0735 middleRows(Index startRow, NRowsType n) const
0736 {
0737   return typename ConstNRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
0738             (derived(), startRow, 0, internal::get_runtime_value(n), cols());
0739 }
0740 
0741 /// \returns a block consisting of a range of rows of \c *this.
0742 ///
0743 /// \tparam N the number of rows in the block as specified at compile-time
0744 /// \param startRow the index of the first row in the block
0745 /// \param n the number of rows in the block as specified at run-time
0746 ///
0747 /// The compile-time and run-time information should not contradict. In other words,
0748 /// \a n should equal \a N unless \a N is \a Dynamic.
0749 ///
0750 /// Example: \include DenseBase_template_int_middleRows.cpp
0751 /// Output: \verbinclude DenseBase_template_int_middleRows.out
0752 ///
0753 EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row-major)
0754 ///
0755 /// \sa block(Index,Index,NRowsType,NColsType), class Block
0756 ///
0757 template<int N>
0758 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
0759 typename NRowsBlockXpr<N>::Type middleRows(Index startRow, Index n = N)
0760 {
0761   return typename NRowsBlockXpr<N>::Type(derived(), startRow, 0, n, cols());
0762 }
0763 
0764 /// This is the const version of middleRows<int>().
0765 template<int N>
0766 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
0767 typename ConstNRowsBlockXpr<N>::Type middleRows(Index startRow, Index n = N) const
0768 {
0769   return typename ConstNRowsBlockXpr<N>::Type(derived(), startRow, 0, n, cols());
0770 }
0771 
0772 
0773 
0774 /// \returns a block consisting of the left columns of \c *this.
0775 ///
0776 /// \param n the number of columns in the block
0777 /// \tparam NColsType the type of the value handling the number of columns in the block, typically Index.
0778 ///
0779 /// Example: \include MatrixBase_leftCols_int.cpp
0780 /// Output: \verbinclude MatrixBase_leftCols_int.out
0781 ///
0782 /// The number of columns \a n can also be specified at compile-time by passing Eigen::fix<N>,
0783 /// or Eigen::fix<N>(n) as arguments.
0784 /// See \link block(Index,Index,NRowsType,NColsType) block() \endlink for the details.
0785 ///
0786 EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column-major)
0787 ///
0788 /// \sa block(Index,Index,NRowsType,NColsType), class Block
0789 ///
0790 template<typename NColsType>
0791 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
0792 #ifndef EIGEN_PARSED_BY_DOXYGEN
0793 typename NColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
0794 #else
0795 typename NColsBlockXpr<...>::Type
0796 #endif
0797 leftCols(NColsType n)
0798 {
0799   return typename NColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
0800             (derived(), 0, 0, rows(), internal::get_runtime_value(n));
0801 }
0802 
0803 /// This is the const version of leftCols(NColsType).
0804 template<typename NColsType>
0805 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
0806 #ifndef EIGEN_PARSED_BY_DOXYGEN
0807 const typename ConstNColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
0808 #else
0809 const typename ConstNColsBlockXpr<...>::Type
0810 #endif
0811 leftCols(NColsType n) const
0812 {
0813   return typename ConstNColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
0814             (derived(), 0, 0, rows(), internal::get_runtime_value(n));
0815 }
0816 
0817 /// \returns a block consisting of the left columns of \c *this.
0818 ///
0819 /// \tparam N the number of columns in the block as specified at compile-time
0820 /// \param n the number of columns in the block as specified at run-time
0821 ///
0822 /// The compile-time and run-time information should not contradict. In other words,
0823 /// \a n should equal \a N unless \a N is \a Dynamic.
0824 ///
0825 /// Example: \include MatrixBase_template_int_leftCols.cpp
0826 /// Output: \verbinclude MatrixBase_template_int_leftCols.out
0827 ///
0828 EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column-major)
0829 ///
0830 /// \sa block(Index,Index,NRowsType,NColsType), class Block
0831 ///
0832 template<int N>
0833 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
0834 typename NColsBlockXpr<N>::Type leftCols(Index n = N)
0835 {
0836   return typename NColsBlockXpr<N>::Type(derived(), 0, 0, rows(), n);
0837 }
0838 
0839 /// This is the const version of leftCols<int>().
0840 template<int N>
0841 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
0842 typename ConstNColsBlockXpr<N>::Type leftCols(Index n = N) const
0843 {
0844   return typename ConstNColsBlockXpr<N>::Type(derived(), 0, 0, rows(), n);
0845 }
0846 
0847 
0848 
0849 /// \returns a block consisting of the right columns of \c *this.
0850 ///
0851 /// \param n the number of columns in the block
0852 /// \tparam NColsType the type of the value handling the number of columns in the block, typically Index.
0853 ///
0854 /// Example: \include MatrixBase_rightCols_int.cpp
0855 /// Output: \verbinclude MatrixBase_rightCols_int.out
0856 ///
0857 /// The number of columns \a n can also be specified at compile-time by passing Eigen::fix<N>,
0858 /// or Eigen::fix<N>(n) as arguments.
0859 /// See \link block(Index,Index,NRowsType,NColsType) block() \endlink for the details.
0860 ///
0861 EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column-major)
0862 ///
0863 /// \sa block(Index,Index,NRowsType,NColsType), class Block
0864 ///
0865 template<typename NColsType>
0866 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
0867 #ifndef EIGEN_PARSED_BY_DOXYGEN
0868 typename NColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
0869 #else
0870 typename NColsBlockXpr<...>::Type
0871 #endif
0872 rightCols(NColsType n)
0873 {
0874   return typename NColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
0875             (derived(), 0, cols() - internal::get_runtime_value(n), rows(), internal::get_runtime_value(n));
0876 }
0877 
0878 /// This is the const version of rightCols(NColsType).
0879 template<typename NColsType>
0880 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
0881 #ifndef EIGEN_PARSED_BY_DOXYGEN
0882 const typename ConstNColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
0883 #else
0884 const typename ConstNColsBlockXpr<...>::Type
0885 #endif
0886 rightCols(NColsType n) const
0887 {
0888   return typename ConstNColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
0889             (derived(), 0, cols() - internal::get_runtime_value(n), rows(), internal::get_runtime_value(n));
0890 }
0891 
0892 /// \returns a block consisting of the right columns of \c *this.
0893 ///
0894 /// \tparam N the number of columns in the block as specified at compile-time
0895 /// \param n the number of columns in the block as specified at run-time
0896 ///
0897 /// The compile-time and run-time information should not contradict. In other words,
0898 /// \a n should equal \a N unless \a N is \a Dynamic.
0899 ///
0900 /// Example: \include MatrixBase_template_int_rightCols.cpp
0901 /// Output: \verbinclude MatrixBase_template_int_rightCols.out
0902 ///
0903 EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column-major)
0904 ///
0905 /// \sa block(Index,Index,NRowsType,NColsType), class Block
0906 ///
0907 template<int N>
0908 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
0909 typename NColsBlockXpr<N>::Type rightCols(Index n = N)
0910 {
0911   return typename NColsBlockXpr<N>::Type(derived(), 0, cols() - n, rows(), n);
0912 }
0913 
0914 /// This is the const version of rightCols<int>().
0915 template<int N>
0916 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
0917 typename ConstNColsBlockXpr<N>::Type rightCols(Index n = N) const
0918 {
0919   return typename ConstNColsBlockXpr<N>::Type(derived(), 0, cols() - n, rows(), n);
0920 }
0921 
0922 
0923 
0924 /// \returns a block consisting of a range of columns of \c *this.
0925 ///
0926 /// \param startCol the index of the first column in the block
0927 /// \param numCols the number of columns in the block
0928 /// \tparam NColsType the type of the value handling the number of columns in the block, typically Index.
0929 ///
0930 /// Example: \include DenseBase_middleCols_int.cpp
0931 /// Output: \verbinclude DenseBase_middleCols_int.out
0932 ///
0933 /// The number of columns \a n can also be specified at compile-time by passing Eigen::fix<N>,
0934 /// or Eigen::fix<N>(n) as arguments.
0935 /// See \link block(Index,Index,NRowsType,NColsType) block() \endlink for the details.
0936 ///
0937 EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column-major)
0938 ///
0939 /// \sa block(Index,Index,NRowsType,NColsType), class Block
0940 ///
0941 template<typename NColsType>
0942 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
0943 #ifndef EIGEN_PARSED_BY_DOXYGEN
0944 typename NColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
0945 #else
0946 typename NColsBlockXpr<...>::Type
0947 #endif
0948 middleCols(Index startCol, NColsType numCols)
0949 {
0950   return typename NColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
0951             (derived(), 0, startCol, rows(), internal::get_runtime_value(numCols));
0952 }
0953 
0954 /// This is the const version of middleCols(Index,NColsType).
0955 template<typename NColsType>
0956 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
0957 #ifndef EIGEN_PARSED_BY_DOXYGEN
0958 const typename ConstNColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
0959 #else
0960 const typename ConstNColsBlockXpr<...>::Type
0961 #endif
0962 middleCols(Index startCol, NColsType numCols) const
0963 {
0964   return typename ConstNColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
0965             (derived(), 0, startCol, rows(), internal::get_runtime_value(numCols));
0966 }
0967 
0968 /// \returns a block consisting of a range of columns of \c *this.
0969 ///
0970 /// \tparam N the number of columns in the block as specified at compile-time
0971 /// \param startCol the index of the first column in the block
0972 /// \param n the number of columns in the block as specified at run-time
0973 ///
0974 /// The compile-time and run-time information should not contradict. In other words,
0975 /// \a n should equal \a N unless \a N is \a Dynamic.
0976 ///
0977 /// Example: \include DenseBase_template_int_middleCols.cpp
0978 /// Output: \verbinclude DenseBase_template_int_middleCols.out
0979 ///
0980 EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column-major)
0981 ///
0982 /// \sa block(Index,Index,NRowsType,NColsType), class Block
0983 ///
0984 template<int N>
0985 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
0986 typename NColsBlockXpr<N>::Type middleCols(Index startCol, Index n = N)
0987 {
0988   return typename NColsBlockXpr<N>::Type(derived(), 0, startCol, rows(), n);
0989 }
0990 
0991 /// This is the const version of middleCols<int>().
0992 template<int N>
0993 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
0994 typename ConstNColsBlockXpr<N>::Type middleCols(Index startCol, Index n = N) const
0995 {
0996   return typename ConstNColsBlockXpr<N>::Type(derived(), 0, startCol, rows(), n);
0997 }
0998 
0999 
1000 
1001 /// \returns a fixed-size expression of a block of \c *this.
1002 ///
1003 /// The template parameters \a NRows and \a NCols are the number of
1004 /// rows and columns in the block.
1005 ///
1006 /// \param startRow the first row in the block
1007 /// \param startCol the first column in the block
1008 ///
1009 /// Example: \include MatrixBase_block_int_int.cpp
1010 /// Output: \verbinclude MatrixBase_block_int_int.out
1011 ///
1012 /// \note The usage of of this overload is discouraged from %Eigen 3.4, better used the generic
1013 /// block(Index,Index,NRowsType,NColsType), here is the one-to-one equivalence:
1014 /// \code
1015 /// mat.template block<NRows,NCols>(i,j)  <-->  mat.block(i,j,fix<NRows>,fix<NCols>)
1016 /// \endcode
1017 ///
1018 /// \note since block is a templated member, the keyword template has to be used
1019 /// if the matrix type is also a template parameter: \code m.template block<3,3>(1,1); \endcode
1020 ///
1021 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
1022 ///
1023 /// \sa block(Index,Index,NRowsType,NColsType), class Block
1024 ///
1025 template<int NRows, int NCols>
1026 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1027 typename FixedBlockXpr<NRows,NCols>::Type block(Index startRow, Index startCol)
1028 {
1029   return typename FixedBlockXpr<NRows,NCols>::Type(derived(), startRow, startCol);
1030 }
1031 
1032 /// This is the const version of block<>(Index, Index). */
1033 template<int NRows, int NCols>
1034 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1035 const typename ConstFixedBlockXpr<NRows,NCols>::Type block(Index startRow, Index startCol) const
1036 {
1037   return typename ConstFixedBlockXpr<NRows,NCols>::Type(derived(), startRow, startCol);
1038 }
1039 
1040 /// \returns an expression of a block of \c *this.
1041 ///
1042 /// \tparam NRows number of rows in block as specified at compile-time
1043 /// \tparam NCols number of columns in block as specified at compile-time
1044 /// \param  startRow  the first row in the block
1045 /// \param  startCol  the first column in the block
1046 /// \param  blockRows number of rows in block as specified at run-time
1047 /// \param  blockCols number of columns in block as specified at run-time
1048 ///
1049 /// This function is mainly useful for blocks where the number of rows is specified at compile-time
1050 /// and the number of columns is specified at run-time, or vice versa. The compile-time and run-time
1051 /// information should not contradict. In other words, \a blockRows should equal \a NRows unless
1052 /// \a NRows is \a Dynamic, and the same for the number of columns.
1053 ///
1054 /// Example: \include MatrixBase_template_int_int_block_int_int_int_int.cpp
1055 /// Output: \verbinclude MatrixBase_template_int_int_block_int_int_int_int.out
1056 ///
1057 /// \note The usage of of this overload is discouraged from %Eigen 3.4, better used the generic
1058 /// block(Index,Index,NRowsType,NColsType), here is the one-to-one complete equivalence:
1059 /// \code
1060 /// mat.template block<NRows,NCols>(i,j,rows,cols)     <-->  mat.block(i,j,fix<NRows>(rows),fix<NCols>(cols))
1061 /// \endcode
1062 /// If we known that, e.g., NRows==Dynamic and NCols!=Dynamic, then the equivalence becomes:
1063 /// \code
1064 /// mat.template block<Dynamic,NCols>(i,j,rows,NCols)  <-->  mat.block(i,j,rows,fix<NCols>)
1065 /// \endcode
1066 ///
1067 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
1068 ///
1069 /// \sa block(Index,Index,NRowsType,NColsType), class Block
1070 ///
1071 template<int NRows, int NCols>
1072 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1073 typename FixedBlockXpr<NRows,NCols>::Type block(Index startRow, Index startCol,
1074                                                   Index blockRows, Index blockCols)
1075 {
1076   return typename FixedBlockXpr<NRows,NCols>::Type(derived(), startRow, startCol, blockRows, blockCols);
1077 }
1078 
1079 /// This is the const version of block<>(Index, Index, Index, Index).
1080 template<int NRows, int NCols>
1081 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1082 const typename ConstFixedBlockXpr<NRows,NCols>::Type block(Index startRow, Index startCol,
1083                                                               Index blockRows, Index blockCols) const
1084 {
1085   return typename ConstFixedBlockXpr<NRows,NCols>::Type(derived(), startRow, startCol, blockRows, blockCols);
1086 }
1087 
1088 /// \returns an expression of the \a i-th column of \c *this. Note that the numbering starts at 0.
1089 ///
1090 /// Example: \include MatrixBase_col.cpp
1091 /// Output: \verbinclude MatrixBase_col.out
1092 ///
1093 EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column-major)
1094 /**
1095   * \sa row(), class Block */
1096 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1097 ColXpr col(Index i)
1098 {
1099   return ColXpr(derived(), i);
1100 }
1101 
1102 /// This is the const version of col().
1103 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1104 ConstColXpr col(Index i) const
1105 {
1106   return ConstColXpr(derived(), i);
1107 }
1108 
1109 /// \returns an expression of the \a i-th row of \c *this. Note that the numbering starts at 0.
1110 ///
1111 /// Example: \include MatrixBase_row.cpp
1112 /// Output: \verbinclude MatrixBase_row.out
1113 ///
1114 EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row-major)
1115 /**
1116   * \sa col(), class Block */
1117 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1118 RowXpr row(Index i)
1119 {
1120   return RowXpr(derived(), i);
1121 }
1122 
1123 /// This is the const version of row(). */
1124 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1125 ConstRowXpr row(Index i) const
1126 {
1127   return ConstRowXpr(derived(), i);
1128 }
1129 
1130 /// \returns an expression of a segment (i.e. a vector block) in \c *this with either dynamic or fixed sizes.
1131 ///
1132 /// \only_for_vectors
1133 ///
1134 /// \param start the first coefficient in the segment
1135 /// \param n the number of coefficients in the segment
1136 /// \tparam NType the type of the value handling the number of coefficients in the segment, typically Index.
1137 ///
1138 /// Example: \include MatrixBase_segment_int_int.cpp
1139 /// Output: \verbinclude MatrixBase_segment_int_int.out
1140 ///
1141 /// The number of coefficients \a n can also be specified at compile-time by passing Eigen::fix<N>,
1142 /// or Eigen::fix<N>(n) as arguments.
1143 /// See \link block(Index,Index,NRowsType,NColsType) block() \endlink for the details.
1144 ///
1145 /// \note Even in the case that the returned expression has dynamic size, in the case
1146 /// when it is applied to a fixed-size vector, it inherits a fixed maximal size,
1147 /// which means that evaluating it does not cause a dynamic memory allocation.
1148 ///
1149 /// \sa block(Index,Index,NRowsType,NColsType), fix<N>, fix<N>(int), class Block
1150 ///
1151 template<typename NType>
1152 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1153 #ifndef EIGEN_PARSED_BY_DOXYGEN
1154 typename FixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
1155 #else
1156 typename FixedSegmentReturnType<...>::Type
1157 #endif
1158 segment(Index start, NType n)
1159 {
1160   EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
1161   return typename FixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
1162             (derived(), start, internal::get_runtime_value(n));
1163 }
1164 
1165 
1166 /// This is the const version of segment(Index,NType).
1167 template<typename NType>
1168 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1169 #ifndef EIGEN_PARSED_BY_DOXYGEN
1170 const typename ConstFixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
1171 #else
1172 const typename ConstFixedSegmentReturnType<...>::Type
1173 #endif
1174 segment(Index start, NType n) const
1175 {
1176   EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
1177   return typename ConstFixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
1178             (derived(), start, internal::get_runtime_value(n));
1179 }
1180 
1181 /// \returns an expression of the first coefficients of \c *this with either dynamic or fixed sizes.
1182 ///
1183 /// \only_for_vectors
1184 ///
1185 /// \param n the number of coefficients in the segment
1186 /// \tparam NType the type of the value handling the number of coefficients in the segment, typically Index.
1187 ///
1188 /// Example: \include MatrixBase_start_int.cpp
1189 /// Output: \verbinclude MatrixBase_start_int.out
1190 ///
1191 /// The number of coefficients \a n can also be specified at compile-time by passing Eigen::fix<N>,
1192 /// or Eigen::fix<N>(n) as arguments.
1193 /// See \link block(Index,Index,NRowsType,NColsType) block() \endlink for the details.
1194 ///
1195 /// \note Even in the case that the returned expression has dynamic size, in the case
1196 /// when it is applied to a fixed-size vector, it inherits a fixed maximal size,
1197 /// which means that evaluating it does not cause a dynamic memory allocation.
1198 ///
1199 /// \sa class Block, block(Index,Index)
1200 ///
1201 template<typename NType>
1202 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1203 #ifndef EIGEN_PARSED_BY_DOXYGEN
1204 typename FixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
1205 #else
1206 typename FixedSegmentReturnType<...>::Type
1207 #endif
1208 head(NType n)
1209 {
1210   EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
1211   return typename FixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
1212               (derived(), 0, internal::get_runtime_value(n));
1213 }
1214 
1215 /// This is the const version of head(NType).
1216 template<typename NType>
1217 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1218 #ifndef EIGEN_PARSED_BY_DOXYGEN
1219 const typename ConstFixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
1220 #else
1221 const typename ConstFixedSegmentReturnType<...>::Type
1222 #endif
1223 head(NType n) const
1224 {
1225   EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
1226   return typename ConstFixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
1227             (derived(), 0, internal::get_runtime_value(n));
1228 }
1229 
1230 /// \returns an expression of a last coefficients of \c *this with either dynamic or fixed sizes.
1231 ///
1232 /// \only_for_vectors
1233 ///
1234 /// \param n the number of coefficients in the segment
1235 /// \tparam NType the type of the value handling the number of coefficients in the segment, typically Index.
1236 ///
1237 /// Example: \include MatrixBase_end_int.cpp
1238 /// Output: \verbinclude MatrixBase_end_int.out
1239 ///
1240 /// The number of coefficients \a n can also be specified at compile-time by passing Eigen::fix<N>,
1241 /// or Eigen::fix<N>(n) as arguments.
1242 /// See \link block(Index,Index,NRowsType,NColsType) block() \endlink for the details.
1243 ///
1244 /// \note Even in the case that the returned expression has dynamic size, in the case
1245 /// when it is applied to a fixed-size vector, it inherits a fixed maximal size,
1246 /// which means that evaluating it does not cause a dynamic memory allocation.
1247 ///
1248 /// \sa class Block, block(Index,Index)
1249 ///
1250 template<typename NType>
1251 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1252 #ifndef EIGEN_PARSED_BY_DOXYGEN
1253 typename FixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
1254 #else
1255 typename FixedSegmentReturnType<...>::Type
1256 #endif
1257 tail(NType n)
1258 {
1259   EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
1260   return typename FixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
1261             (derived(), this->size() - internal::get_runtime_value(n), internal::get_runtime_value(n));
1262 }
1263 
1264 /// This is the const version of tail(Index).
1265 template<typename NType>
1266 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1267 #ifndef EIGEN_PARSED_BY_DOXYGEN
1268 const typename ConstFixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
1269 #else
1270 const typename ConstFixedSegmentReturnType<...>::Type
1271 #endif
1272 tail(NType n) const
1273 {
1274   EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
1275   return typename ConstFixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
1276             (derived(), this->size() - internal::get_runtime_value(n), internal::get_runtime_value(n));
1277 }
1278 
1279 /// \returns a fixed-size expression of a segment (i.e. a vector block) in \c *this
1280 ///
1281 /// \only_for_vectors
1282 ///
1283 /// \tparam N the number of coefficients in the segment as specified at compile-time
1284 /// \param start the index of the first element in the segment
1285 /// \param n the number of coefficients in the segment as specified at compile-time
1286 ///
1287 /// The compile-time and run-time information should not contradict. In other words,
1288 /// \a n should equal \a N unless \a N is \a Dynamic.
1289 ///
1290 /// Example: \include MatrixBase_template_int_segment.cpp
1291 /// Output: \verbinclude MatrixBase_template_int_segment.out
1292 ///
1293 /// \sa segment(Index,NType), class Block
1294 ///
1295 template<int N>
1296 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1297 typename FixedSegmentReturnType<N>::Type segment(Index start, Index n = N)
1298 {
1299   EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
1300   return typename FixedSegmentReturnType<N>::Type(derived(), start, n);
1301 }
1302 
1303 /// This is the const version of segment<int>(Index).
1304 template<int N>
1305 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1306 typename ConstFixedSegmentReturnType<N>::Type segment(Index start, Index n = N) const
1307 {
1308   EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
1309   return typename ConstFixedSegmentReturnType<N>::Type(derived(), start, n);
1310 }
1311 
1312 /// \returns a fixed-size expression of the first coefficients of \c *this.
1313 ///
1314 /// \only_for_vectors
1315 ///
1316 /// \tparam N the number of coefficients in the segment as specified at compile-time
1317 /// \param  n the number of coefficients in the segment as specified at run-time
1318 ///
1319 /// The compile-time and run-time information should not contradict. In other words,
1320 /// \a n should equal \a N unless \a N is \a Dynamic.
1321 ///
1322 /// Example: \include MatrixBase_template_int_start.cpp
1323 /// Output: \verbinclude MatrixBase_template_int_start.out
1324 ///
1325 /// \sa head(NType), class Block
1326 ///
1327 template<int N>
1328 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1329 typename FixedSegmentReturnType<N>::Type head(Index n = N)
1330 {
1331   EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
1332   return typename FixedSegmentReturnType<N>::Type(derived(), 0, n);
1333 }
1334 
1335 /// This is the const version of head<int>().
1336 template<int N>
1337 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1338 typename ConstFixedSegmentReturnType<N>::Type head(Index n = N) const
1339 {
1340   EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
1341   return typename ConstFixedSegmentReturnType<N>::Type(derived(), 0, n);
1342 }
1343 
1344 /// \returns a fixed-size expression of the last coefficients of \c *this.
1345 ///
1346 /// \only_for_vectors
1347 ///
1348 /// \tparam N the number of coefficients in the segment as specified at compile-time
1349 /// \param  n the number of coefficients in the segment as specified at run-time
1350 ///
1351 /// The compile-time and run-time information should not contradict. In other words,
1352 /// \a n should equal \a N unless \a N is \a Dynamic.
1353 ///
1354 /// Example: \include MatrixBase_template_int_end.cpp
1355 /// Output: \verbinclude MatrixBase_template_int_end.out
1356 ///
1357 /// \sa tail(NType), class Block
1358 ///
1359 template<int N>
1360 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1361 typename FixedSegmentReturnType<N>::Type tail(Index n = N)
1362 {
1363   EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
1364   return typename FixedSegmentReturnType<N>::Type(derived(), size() - n);
1365 }
1366 
1367 /// This is the const version of tail<int>.
1368 template<int N>
1369 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1370 typename ConstFixedSegmentReturnType<N>::Type tail(Index n = N) const
1371 {
1372   EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
1373   return typename ConstFixedSegmentReturnType<N>::Type(derived(), size() - n);
1374 }
1375 
1376 /// \returns the \a outer -th column (resp. row) of the matrix \c *this if \c *this
1377 /// is col-major (resp. row-major).
1378 ///
1379 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1380 InnerVectorReturnType innerVector(Index outer)
1381 { return InnerVectorReturnType(derived(), outer); }
1382 
1383 /// \returns the \a outer -th column (resp. row) of the matrix \c *this if \c *this
1384 /// is col-major (resp. row-major). Read-only.
1385 ///
1386 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1387 const ConstInnerVectorReturnType innerVector(Index outer) const
1388 { return ConstInnerVectorReturnType(derived(), outer); }
1389 
1390 /// \returns the \a outer -th column (resp. row) of the matrix \c *this if \c *this
1391 /// is col-major (resp. row-major).
1392 ///
1393 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1394 InnerVectorsReturnType
1395 innerVectors(Index outerStart, Index outerSize)
1396 {
1397   return Block<Derived,Dynamic,Dynamic,true>(derived(),
1398                                              IsRowMajor ? outerStart : 0, IsRowMajor ? 0 : outerStart,
1399                                              IsRowMajor ? outerSize : rows(), IsRowMajor ? cols() : outerSize);
1400 
1401 }
1402 
1403 /// \returns the \a outer -th column (resp. row) of the matrix \c *this if \c *this
1404 /// is col-major (resp. row-major). Read-only.
1405 ///
1406 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1407 const ConstInnerVectorsReturnType
1408 innerVectors(Index outerStart, Index outerSize) const
1409 {
1410   return Block<const Derived,Dynamic,Dynamic,true>(derived(),
1411                                                   IsRowMajor ? outerStart : 0, IsRowMajor ? 0 : outerStart,
1412                                                   IsRowMajor ? outerSize : rows(), IsRowMajor ? cols() : outerSize);
1413 
1414 }
1415 
1416 /** \returns the i-th subvector (column or vector) according to the \c Direction
1417   * \sa subVectors()
1418   */
1419 template<DirectionType Direction>
1420 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1421 typename internal::conditional<Direction==Vertical,ColXpr,RowXpr>::type
1422 subVector(Index i)
1423 {
1424   return typename internal::conditional<Direction==Vertical,ColXpr,RowXpr>::type(derived(),i);
1425 }
1426 
1427 /** This is the const version of subVector(Index) */
1428 template<DirectionType Direction>
1429 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1430 typename internal::conditional<Direction==Vertical,ConstColXpr,ConstRowXpr>::type
1431 subVector(Index i) const
1432 {
1433   return typename internal::conditional<Direction==Vertical,ConstColXpr,ConstRowXpr>::type(derived(),i);
1434 }
1435 
1436 /** \returns the number of subvectors (rows or columns) in the direction \c Direction
1437   * \sa subVector(Index)
1438   */
1439 template<DirectionType Direction>
1440 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR
1441 Index subVectors() const
1442 { return (Direction==Vertical)?cols():rows(); }