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
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef EIGEN_PARSED_BY_DOXYGEN
0012
0013
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
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
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
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
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
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
0032 typedef Block<Derived> BlockXpr;
0033 typedef const Block<const Derived> ConstBlockXpr;
0034
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
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
0048 typedef Block<Derived,Dynamic,Dynamic,true> InnerVectorsReturnType;
0049 typedef Block<const Derived,Dynamic,Dynamic,true> ConstInnerVectorsReturnType;
0050
0051 #endif
0052
0053
0054
0055
0056
0057
0058
0059
0060
0061
0062
0063
0064
0065
0066
0067
0068
0069
0070
0071
0072
0073
0074
0075
0076
0077
0078
0079
0080
0081
0082
0083
0084
0085 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
0086
0087
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
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
0119
0120
0121
0122
0123
0124
0125
0126
0127
0128
0129
0130
0131 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
0132
0133
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
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
0163
0164
0165
0166
0167
0168
0169
0170 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
0171
0172
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
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
0190
0191
0192
0193
0194
0195
0196
0197
0198
0199
0200
0201
0202
0203
0204 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
0205
0206
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
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
0226
0227
0228
0229
0230
0231
0232
0233
0234
0235
0236
0237
0238 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
0239
0240
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
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
0270
0271
0272
0273
0274
0275
0276 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
0277
0278
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
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
0296
0297
0298
0299
0300
0301
0302
0303
0304
0305
0306
0307
0308
0309
0310 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
0311
0312
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
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
0332
0333
0334
0335
0336
0337
0338
0339
0340
0341
0342
0343
0344 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
0345
0346
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
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
0378
0379
0380
0381
0382
0383
0384 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
0385
0386
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
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
0404
0405
0406
0407
0408
0409
0410
0411
0412
0413
0414
0415
0416
0417
0418 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
0419
0420
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
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
0440
0441
0442
0443
0444
0445
0446
0447
0448
0449
0450
0451
0452 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
0453
0454
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
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
0486
0487
0488
0489
0490
0491
0492 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
0493
0494
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
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
0512
0513
0514
0515
0516
0517
0518
0519
0520
0521
0522
0523
0524
0525
0526 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
0527
0528
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
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
0548
0549
0550
0551
0552
0553
0554
0555
0556
0557
0558
0559 EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row-major)
0560
0561
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
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
0591
0592
0593
0594
0595
0596
0597
0598
0599
0600
0601 EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row-major)
0602
0603
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
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
0623
0624
0625
0626
0627
0628
0629
0630
0631
0632
0633
0634 EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row-major)
0635
0636
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
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
0666
0667
0668
0669
0670
0671
0672
0673
0674
0675
0676 EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row-major)
0677
0678
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
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
0698
0699
0700
0701
0702
0703
0704
0705
0706
0707
0708
0709
0710 EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row-major)
0711
0712
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
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
0742
0743
0744
0745
0746
0747
0748
0749
0750
0751
0752
0753 EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row-major)
0754
0755
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
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
0775
0776
0777
0778
0779
0780
0781
0782
0783
0784
0785
0786 EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column-major)
0787
0788
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
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
0818
0819
0820
0821
0822
0823
0824
0825
0826
0827
0828 EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column-major)
0829
0830
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
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
0850
0851
0852
0853
0854
0855
0856
0857
0858
0859
0860
0861 EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column-major)
0862
0863
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
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
0893
0894
0895
0896
0897
0898
0899
0900
0901
0902
0903 EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column-major)
0904
0905
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
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
0925
0926
0927
0928
0929
0930
0931
0932
0933
0934
0935
0936
0937 EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column-major)
0938
0939
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
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
0969
0970
0971
0972
0973
0974
0975
0976
0977
0978
0979
0980 EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column-major)
0981
0982
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
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
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
1022
1023
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
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
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
1068
1069
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
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
1089
1090
1091
1092
1093 EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column-major)
1094
1095
1096 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1097 ColXpr col(Index i)
1098 {
1099 return ColXpr(derived(), i);
1100 }
1101
1102
1103 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1104 ConstColXpr col(Index i) const
1105 {
1106 return ConstColXpr(derived(), i);
1107 }
1108
1109
1110
1111
1112
1113
1114 EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row-major)
1115
1116
1117 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1118 RowXpr row(Index i)
1119 {
1120 return RowXpr(derived(), i);
1121 }
1122
1123
1124 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1125 ConstRowXpr row(Index i) const
1126 {
1127 return ConstRowXpr(derived(), i);
1128 }
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
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
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
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
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
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
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
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
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
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
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
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
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
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
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
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
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
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
1377
1378
1379 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1380 InnerVectorReturnType innerVector(Index outer)
1381 { return InnerVectorReturnType(derived(), outer); }
1382
1383
1384
1385
1386 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1387 const ConstInnerVectorReturnType innerVector(Index outer) const
1388 { return ConstInnerVectorReturnType(derived(), outer); }
1389
1390
1391
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
1404
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
1417
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
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
1437
1438
1439 template<DirectionType Direction>
1440 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR
1441 Index subVectors() const
1442 { return (Direction==Vertical)?cols():rows(); }