BlockMethods.h
Go to the documentation of this file.
1 // This file is part of Eigen, a lightweight C++ template library
2 // for linear algebra.
3 //
4 // Copyright (C) 2008-2010 Gael Guennebaud <gael.guennebaud@inria.fr>
5 // Copyright (C) 2006-2010 Benoit Jacob <jacob.benoit.1@gmail.com>
6 //
7 // This Source Code Form is subject to the terms of the Mozilla
8 // Public License v. 2.0. If a copy of the MPL was not distributed
9 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 
11 #ifndef EIGEN_PARSED_BY_DOXYGEN
12 
14 typedef Block<Derived, internal::traits<Derived>::RowsAtCompileTime, 1, !IsRowMajor> ColXpr;
15 typedef const Block<const Derived, internal::traits<Derived>::RowsAtCompileTime, 1, !IsRowMajor> ConstColXpr;
17 typedef Block<Derived, 1, internal::traits<Derived>::ColsAtCompileTime, IsRowMajor> RowXpr;
18 typedef const Block<const Derived, 1, internal::traits<Derived>::ColsAtCompileTime, IsRowMajor> ConstRowXpr;
20 typedef Block<Derived, internal::traits<Derived>::RowsAtCompileTime, Dynamic, !IsRowMajor> ColsBlockXpr;
21 typedef const Block<const Derived, internal::traits<Derived>::RowsAtCompileTime, Dynamic, !IsRowMajor> ConstColsBlockXpr;
23 typedef Block<Derived, Dynamic, internal::traits<Derived>::ColsAtCompileTime, IsRowMajor> RowsBlockXpr;
24 typedef const Block<const Derived, Dynamic, internal::traits<Derived>::ColsAtCompileTime, IsRowMajor> ConstRowsBlockXpr;
26 template<int N> struct NColsBlockXpr { typedef Block<Derived, internal::traits<Derived>::RowsAtCompileTime, N, !IsRowMajor> Type; };
27 template<int N> struct ConstNColsBlockXpr { typedef const Block<const Derived, internal::traits<Derived>::RowsAtCompileTime, N, !IsRowMajor> Type; };
29 template<int N> struct NRowsBlockXpr { typedef Block<Derived, N, internal::traits<Derived>::ColsAtCompileTime, IsRowMajor> Type; };
30 template<int N> struct ConstNRowsBlockXpr { typedef const Block<const Derived, N, internal::traits<Derived>::ColsAtCompileTime, IsRowMajor> Type; };
32 typedef Block<Derived> BlockXpr;
33 typedef const Block<const Derived> ConstBlockXpr;
35 template<int Rows, int Cols> struct FixedBlockXpr { typedef Block<Derived,Rows,Cols> Type; };
36 template<int Rows, int Cols> struct ConstFixedBlockXpr { typedef Block<const Derived,Rows,Cols> Type; };
37 
38 typedef VectorBlock<Derived> SegmentReturnType;
39 typedef const VectorBlock<const Derived> ConstSegmentReturnType;
40 template<int Size> struct FixedSegmentReturnType { typedef VectorBlock<Derived, Size> Type; };
41 template<int Size> struct ConstFixedSegmentReturnType { typedef const VectorBlock<const Derived, Size> Type; };
42 
44 typedef Block<Derived,IsRowMajor?1:Dynamic,IsRowMajor?Dynamic:1,true> InnerVectorReturnType;
45 typedef Block<const Derived,IsRowMajor?1:Dynamic,IsRowMajor?Dynamic:1,true> ConstInnerVectorReturnType;
46 
48 typedef Block<Derived,Dynamic,Dynamic,true> InnerVectorsReturnType;
49 typedef Block<const Derived,Dynamic,Dynamic,true> ConstInnerVectorsReturnType;
50 
51 #endif // not EIGEN_PARSED_BY_DOXYGEN
52 
89 template<typename NRowsType, typename NColsType>
90 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
91 #ifndef EIGEN_PARSED_BY_DOXYGEN
92 typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
93 #else
94 typename FixedBlockXpr<...,...>::Type
95 #endif
96 block(Index startRow, Index startCol, NRowsType blockRows, NColsType blockCols)
97 {
98  return typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type(
99  derived(), startRow, startCol, internal::get_runtime_value(blockRows), internal::get_runtime_value(blockCols));
100 }
101 
103 template<typename NRowsType, typename NColsType>
104 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
105 #ifndef EIGEN_PARSED_BY_DOXYGEN
106 const typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
107 #else
108 const typename ConstFixedBlockXpr<...,...>::Type
109 #endif
110 block(Index startRow, Index startCol, NRowsType blockRows, NColsType blockCols) const
111 {
112  return typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type(
113  derived(), startRow, startCol, internal::get_runtime_value(blockRows), internal::get_runtime_value(blockCols));
114 }
115 
116 
117 
135 template<typename NRowsType, typename NColsType>
136 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
137 #ifndef EIGEN_PARSED_BY_DOXYGEN
138 typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
139 #else
140 typename FixedBlockXpr<...,...>::Type
141 #endif
142 topRightCorner(NRowsType cRows, NColsType cCols)
143 {
144  return typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
146 }
147 
149 template<typename NRowsType, typename NColsType>
150 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
151 #ifndef EIGEN_PARSED_BY_DOXYGEN
152 const typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
153 #else
154 const typename ConstFixedBlockXpr<...,...>::Type
155 #endif
156 topRightCorner(NRowsType cRows, NColsType cCols) const
157 {
158  return typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
160 }
161 
174 template<int CRows, int CCols>
175 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
177 {
178  return typename FixedBlockXpr<CRows,CCols>::Type(derived(), 0, cols() - CCols);
179 }
180 
182 template<int CRows, int CCols>
183 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
185 {
186  return typename ConstFixedBlockXpr<CRows,CCols>::Type(derived(), 0, cols() - CCols);
187 }
188 
208 template<int CRows, int CCols>
209 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
211 {
212  return typename FixedBlockXpr<CRows,CCols>::Type(derived(), 0, cols() - cCols, cRows, cCols);
213 }
214 
216 template<int CRows, int CCols>
217 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
219 {
220  return typename ConstFixedBlockXpr<CRows,CCols>::Type(derived(), 0, cols() - cCols, cRows, cCols);
221 }
222 
223 
224 
242 template<typename NRowsType, typename NColsType>
243 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
244 #ifndef EIGEN_PARSED_BY_DOXYGEN
245 typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
246 #else
247 typename FixedBlockXpr<...,...>::Type
248 #endif
249 topLeftCorner(NRowsType cRows, NColsType cCols)
250 {
251  return typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
252  (derived(), 0, 0, internal::get_runtime_value(cRows), internal::get_runtime_value(cCols));
253 }
254 
256 template<typename NRowsType, typename NColsType>
257 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
258 #ifndef EIGEN_PARSED_BY_DOXYGEN
259 const typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
260 #else
261 const typename ConstFixedBlockXpr<...,...>::Type
262 #endif
263 topLeftCorner(NRowsType cRows, NColsType cCols) const
264 {
265  return typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
266  (derived(), 0, 0, internal::get_runtime_value(cRows), internal::get_runtime_value(cCols));
267 }
268 
280 template<int CRows, int CCols>
281 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
283 {
284  return typename FixedBlockXpr<CRows,CCols>::Type(derived(), 0, 0);
285 }
286 
288 template<int CRows, int CCols>
289 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
291 {
292  return typename ConstFixedBlockXpr<CRows,CCols>::Type(derived(), 0, 0);
293 }
294 
314 template<int CRows, int CCols>
315 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
317 {
318  return typename FixedBlockXpr<CRows,CCols>::Type(derived(), 0, 0, cRows, cCols);
319 }
320 
322 template<int CRows, int CCols>
323 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
325 {
326  return typename ConstFixedBlockXpr<CRows,CCols>::Type(derived(), 0, 0, cRows, cCols);
327 }
328 
329 
330 
348 template<typename NRowsType, typename NColsType>
349 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
350 #ifndef EIGEN_PARSED_BY_DOXYGEN
351 typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
352 #else
353 typename FixedBlockXpr<...,...>::Type
354 #endif
355 bottomRightCorner(NRowsType cRows, NColsType cCols)
356 {
357  return typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
358  (derived(), rows() - internal::get_runtime_value(cRows), cols() - internal::get_runtime_value(cCols),
360 }
361 
363 template<typename NRowsType, typename NColsType>
364 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
365 #ifndef EIGEN_PARSED_BY_DOXYGEN
366 const typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
367 #else
368 const typename ConstFixedBlockXpr<...,...>::Type
369 #endif
370 bottomRightCorner(NRowsType cRows, NColsType cCols) const
371 {
372  return typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
373  (derived(), rows() - internal::get_runtime_value(cRows), cols() - internal::get_runtime_value(cCols),
375 }
376 
388 template<int CRows, int CCols>
389 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
391 {
392  return typename FixedBlockXpr<CRows,CCols>::Type(derived(), rows() - CRows, cols() - CCols);
393 }
394 
396 template<int CRows, int CCols>
397 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
399 {
400  return typename ConstFixedBlockXpr<CRows,CCols>::Type(derived(), rows() - CRows, cols() - CCols);
401 }
402 
422 template<int CRows, int CCols>
423 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
425 {
426  return typename FixedBlockXpr<CRows,CCols>::Type(derived(), rows() - cRows, cols() - cCols, cRows, cCols);
427 }
428 
430 template<int CRows, int CCols>
431 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
433 {
434  return typename ConstFixedBlockXpr<CRows,CCols>::Type(derived(), rows() - cRows, cols() - cCols, cRows, cCols);
435 }
436 
437 
438 
456 template<typename NRowsType, typename NColsType>
457 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
458 #ifndef EIGEN_PARSED_BY_DOXYGEN
459 typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
460 #else
461 typename FixedBlockXpr<...,...>::Type
462 #endif
463 bottomLeftCorner(NRowsType cRows, NColsType cCols)
464 {
465  return typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
466  (derived(), rows() - internal::get_runtime_value(cRows), 0,
468 }
469 
471 template<typename NRowsType, typename NColsType>
472 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
473 #ifndef EIGEN_PARSED_BY_DOXYGEN
474 typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
475 #else
476 typename ConstFixedBlockXpr<...,...>::Type
477 #endif
478 bottomLeftCorner(NRowsType cRows, NColsType cCols) const
479 {
480  return typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
481  (derived(), rows() - internal::get_runtime_value(cRows), 0,
483 }
484 
496 template<int CRows, int CCols>
497 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
499 {
500  return typename FixedBlockXpr<CRows,CCols>::Type(derived(), rows() - CRows, 0);
501 }
502 
504 template<int CRows, int CCols>
505 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
507 {
508  return typename ConstFixedBlockXpr<CRows,CCols>::Type(derived(), rows() - CRows, 0);
509 }
510 
530 template<int CRows, int CCols>
531 EIGEN_STRONG_INLINE
533 {
534  return typename FixedBlockXpr<CRows,CCols>::Type(derived(), rows() - cRows, 0, cRows, cCols);
535 }
536 
538 template<int CRows, int CCols>
539 EIGEN_STRONG_INLINE
541 {
542  return typename ConstFixedBlockXpr<CRows,CCols>::Type(derived(), rows() - cRows, 0, cRows, cCols);
543 }
544 
545 
546 
563 template<typename NRowsType>
564 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
565 #ifndef EIGEN_PARSED_BY_DOXYGEN
566 typename NRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
567 #else
568 typename NRowsBlockXpr<...>::Type
569 #endif
570 topRows(NRowsType n)
571 {
572  return typename NRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
573  (derived(), 0, 0, internal::get_runtime_value(n), cols());
574 }
575 
577 template<typename NRowsType>
578 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
579 #ifndef EIGEN_PARSED_BY_DOXYGEN
580 const typename ConstNRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
581 #else
582 const typename ConstNRowsBlockXpr<...>::Type
583 #endif
584 topRows(NRowsType n) const
585 {
586  return typename ConstNRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
587  (derived(), 0, 0, internal::get_runtime_value(n), cols());
588 }
589 
605 template<int N>
606 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
608 {
609  return typename NRowsBlockXpr<N>::Type(derived(), 0, 0, n, cols());
610 }
611 
613 template<int N>
614 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
616 {
617  return typename ConstNRowsBlockXpr<N>::Type(derived(), 0, 0, n, cols());
618 }
619 
620 
621 
638 template<typename NRowsType>
639 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
640 #ifndef EIGEN_PARSED_BY_DOXYGEN
641 typename NRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
642 #else
643 typename NRowsBlockXpr<...>::Type
644 #endif
645 bottomRows(NRowsType n)
646 {
647  return typename NRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
649 }
650 
652 template<typename NRowsType>
653 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
654 #ifndef EIGEN_PARSED_BY_DOXYGEN
655 const typename ConstNRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
656 #else
657 const typename ConstNRowsBlockXpr<...>::Type
658 #endif
659 bottomRows(NRowsType n) const
660 {
661  return typename ConstNRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
663 }
664 
680 template<int N>
681 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
683 {
684  return typename NRowsBlockXpr<N>::Type(derived(), rows() - n, 0, n, cols());
685 }
686 
688 template<int N>
689 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
691 {
692  return typename ConstNRowsBlockXpr<N>::Type(derived(), rows() - n, 0, n, cols());
693 }
694 
695 
696 
714 template<typename NRowsType>
715 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
716 #ifndef EIGEN_PARSED_BY_DOXYGEN
717 typename NRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
718 #else
719 typename NRowsBlockXpr<...>::Type
720 #endif
721 middleRows(Index startRow, NRowsType n)
722 {
723  return typename NRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
724  (derived(), startRow, 0, internal::get_runtime_value(n), cols());
725 }
726 
728 template<typename NRowsType>
729 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
730 #ifndef EIGEN_PARSED_BY_DOXYGEN
731 const typename ConstNRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
732 #else
733 const typename ConstNRowsBlockXpr<...>::Type
734 #endif
735 middleRows(Index startRow, NRowsType n) const
736 {
737  return typename ConstNRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
738  (derived(), startRow, 0, internal::get_runtime_value(n), cols());
739 }
740 
757 template<int N>
758 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
760 {
761  return typename NRowsBlockXpr<N>::Type(derived(), startRow, 0, n, cols());
762 }
763 
765 template<int N>
766 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
767 typename ConstNRowsBlockXpr<N>::Type middleRows(Index startRow, Index n = N) const
768 {
769  return typename ConstNRowsBlockXpr<N>::Type(derived(), startRow, 0, n, cols());
770 }
771 
772 
773 
790 template<typename NColsType>
791 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
792 #ifndef EIGEN_PARSED_BY_DOXYGEN
793 typename NColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
794 #else
795 typename NColsBlockXpr<...>::Type
796 #endif
797 leftCols(NColsType n)
798 {
799  return typename NColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
800  (derived(), 0, 0, rows(), internal::get_runtime_value(n));
801 }
802 
804 template<typename NColsType>
805 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
806 #ifndef EIGEN_PARSED_BY_DOXYGEN
807 const typename ConstNColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
808 #else
809 const typename ConstNColsBlockXpr<...>::Type
810 #endif
811 leftCols(NColsType n) const
812 {
813  return typename ConstNColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
814  (derived(), 0, 0, rows(), internal::get_runtime_value(n));
815 }
816 
832 template<int N>
833 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
835 {
836  return typename NColsBlockXpr<N>::Type(derived(), 0, 0, rows(), n);
837 }
838 
840 template<int N>
841 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
843 {
844  return typename ConstNColsBlockXpr<N>::Type(derived(), 0, 0, rows(), n);
845 }
846 
847 
848 
865 template<typename NColsType>
866 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
867 #ifndef EIGEN_PARSED_BY_DOXYGEN
868 typename NColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
869 #else
870 typename NColsBlockXpr<...>::Type
871 #endif
872 rightCols(NColsType n)
873 {
874  return typename NColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
876 }
877 
879 template<typename NColsType>
880 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
881 #ifndef EIGEN_PARSED_BY_DOXYGEN
882 const typename ConstNColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
883 #else
884 const typename ConstNColsBlockXpr<...>::Type
885 #endif
886 rightCols(NColsType n) const
887 {
888  return typename ConstNColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
890 }
891 
907 template<int N>
908 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
910 {
911  return typename NColsBlockXpr<N>::Type(derived(), 0, cols() - n, rows(), n);
912 }
913 
915 template<int N>
916 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
918 {
919  return typename ConstNColsBlockXpr<N>::Type(derived(), 0, cols() - n, rows(), n);
920 }
921 
922 
923 
941 template<typename NColsType>
942 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
943 #ifndef EIGEN_PARSED_BY_DOXYGEN
944 typename NColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
945 #else
946 typename NColsBlockXpr<...>::Type
947 #endif
948 middleCols(Index startCol, NColsType numCols)
949 {
950  return typename NColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
951  (derived(), 0, startCol, rows(), internal::get_runtime_value(numCols));
952 }
953 
955 template<typename NColsType>
956 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
957 #ifndef EIGEN_PARSED_BY_DOXYGEN
958 const typename ConstNColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
959 #else
960 const typename ConstNColsBlockXpr<...>::Type
961 #endif
962 middleCols(Index startCol, NColsType numCols) const
963 {
964  return typename ConstNColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
965  (derived(), 0, startCol, rows(), internal::get_runtime_value(numCols));
966 }
967 
984 template<int N>
985 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
987 {
988  return typename NColsBlockXpr<N>::Type(derived(), 0, startCol, rows(), n);
989 }
990 
992 template<int N>
993 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
994 typename ConstNColsBlockXpr<N>::Type middleCols(Index startCol, Index n = N) const
995 {
996  return typename ConstNColsBlockXpr<N>::Type(derived(), 0, startCol, rows(), n);
997 }
998 
999 
1000 
1025 template<int NRows, int NCols>
1026 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1028 {
1029  return typename FixedBlockXpr<NRows,NCols>::Type(derived(), startRow, startCol);
1030 }
1031 
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 
1071 template<int NRows, int NCols>
1072 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1074  Index blockRows, Index blockCols)
1075 {
1076  return typename FixedBlockXpr<NRows,NCols>::Type(derived(), startRow, startCol, blockRows, blockCols);
1077 }
1078 
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 
1096 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1097 ColXpr col(Index i)
1098 {
1099  return ColXpr(derived(), i);
1100 }
1101 
1103 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1104 ConstColXpr col(Index i) const
1105 {
1106  return ConstColXpr(derived(), i);
1107 }
1108 
1117 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1118 RowXpr row(Index i)
1119 {
1120  return RowXpr(derived(), i);
1121 }
1122 
1124 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1125 ConstRowXpr row(Index i) const
1126 {
1127  return ConstRowXpr(derived(), i);
1128 }
1129 
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 {
1161  return typename FixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
1162  (derived(), start, internal::get_runtime_value(n));
1163 }
1164 
1165 
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 {
1177  return typename ConstFixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
1178  (derived(), start, internal::get_runtime_value(n));
1179 }
1180 
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 {
1211  return typename FixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
1212  (derived(), 0, internal::get_runtime_value(n));
1213 }
1214 
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 {
1226  return typename ConstFixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
1227  (derived(), 0, internal::get_runtime_value(n));
1228 }
1229 
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 {
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 
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 {
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 
1295 template<int N>
1296 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1298 {
1300  return typename FixedSegmentReturnType<N>::Type(derived(), start, n);
1301 }
1302 
1304 template<int N>
1305 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1307 {
1309  return typename ConstFixedSegmentReturnType<N>::Type(derived(), start, n);
1310 }
1311 
1327 template<int N>
1328 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1330 {
1332  return typename FixedSegmentReturnType<N>::Type(derived(), 0, n);
1333 }
1334 
1336 template<int N>
1337 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1339 {
1341  return typename ConstFixedSegmentReturnType<N>::Type(derived(), 0, n);
1342 }
1343 
1359 template<int N>
1360 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1362 {
1364  return typename FixedSegmentReturnType<N>::Type(derived(), size() - n);
1365 }
1366 
1368 template<int N>
1369 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1371 {
1373  return typename ConstFixedSegmentReturnType<N>::Type(derived(), size() - n);
1374 }
1375 
1379 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1380 InnerVectorReturnType innerVector(Index outer)
1381 { return InnerVectorReturnType(derived(), outer); }
1382 
1386 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1387 const ConstInnerVectorReturnType innerVector(Index outer) const
1388 { return ConstInnerVectorReturnType(derived(), outer); }
1389 
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 
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 
1419 template<DirectionType Direction>
1420 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1421 std::conditional_t<Direction==Vertical,ColXpr,RowXpr>
1423 {
1424  return std::conditional_t<Direction==Vertical,ColXpr,RowXpr>(derived(),i);
1425 }
1426 
1428 template<DirectionType Direction>
1429 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1430 std::conditional_t<Direction==Vertical,ConstColXpr,ConstRowXpr>
1432 {
1433  return std::conditional_t<Direction==Vertical,ConstColXpr,ConstRowXpr>(derived(),i);
1434 }
1435 
1439 template<DirectionType Direction>
1440 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR
1442 { return (Direction==Vertical)?cols():rows(); }
int n
EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL FixedBlockXpr<...,... >::Type block(Index startRow, Index startCol, NRowsType blockRows, NColsType blockCols)
Definition: BlockMethods.h:96
EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL FixedBlockXpr<...,... >::Type topLeftCorner(NRowsType cRows, NColsType cCols)
Definition: BlockMethods.h:249
InnerVectorsReturnType innerVectors(Index outerStart, Index outerSize)
NRowsBlockXpr<... >::Type topRows(NRowsType n)
Definition: BlockMethods.h:570
NRowsBlockXpr<... >::Type middleRows(Index startRow, NRowsType n)
Definition: BlockMethods.h:721
EIGEN_CONSTEXPR Index subVectors() const
FixedSegmentReturnType<... >::Type head(NType n)
RowXpr row(Index i)
This is the const version of row(). *‍/.
EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL FixedBlockXpr<...,... >::Type bottomRightCorner(NRowsType cRows, NColsType cCols)
Definition: BlockMethods.h:355
NColsBlockXpr<... >::Type leftCols(NColsType n)
Definition: BlockMethods.h:797
ColXpr col(Index i)
This is the const version of col().
NColsBlockXpr<... >::Type middleCols(Index startCol, NColsType numCols)
Definition: BlockMethods.h:948
InnerVectorReturnType innerVector(Index outer)
FixedSegmentReturnType<... >::Type segment(Index start, NType n)
NColsBlockXpr<... >::Type rightCols(NColsType n)
Definition: BlockMethods.h:872
std::conditional_t< Direction==Vertical, ColXpr, RowXpr > subVector(Index i)
NRowsBlockXpr<... >::Type bottomRows(NRowsType n)
Definition: BlockMethods.h:645
EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL FixedBlockXpr<...,... >::Type topRightCorner(NRowsType cRows, NColsType cCols)
Definition: BlockMethods.h:142
EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL FixedBlockXpr<...,... >::Type bottomLeftCorner(NRowsType cRows, NColsType cCols)
Definition: BlockMethods.h:463
FixedSegmentReturnType<... >::Type tail(NType n)
#define EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(COND)
Definition: DenseBase.h:658
#define EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
Definition: DenseBase.h:657
#define EIGEN_CONSTEXPR
Definition: Macros.h:747
#define EIGEN_DEVICE_FUNC
Definition: Macros.h:883
#define EIGEN_STATIC_ASSERT_VECTOR_ONLY(TYPE)
Definition: StaticAssert.h:36
@ Vertical
Definition: Constants.h:266
Index get_runtime_value(const T &x)
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:82
const int Dynamic
Definition: Constants.h:24