Eigen  3.4.90 (git rev 5a9f66fb35d03a4da9ef8976e67a61b30aa16dcf)
 
Loading...
Searching...
No Matches
BlockMethods.inc
1// This file is part of Eigen, a lightweight C++ template library
2// for linear algebra.
3//
4// Copyright (C) 2008-2010 Gael Guennebaud <[email protected]>
5// Copyright (C) 2006-2010 Benoit Jacob <[email protected]>
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
14typedef Block<Derived, internal::traits<Derived>::RowsAtCompileTime, 1, !IsRowMajor> ColXpr;
15typedef const Block<const Derived, internal::traits<Derived>::RowsAtCompileTime, 1, !IsRowMajor> ConstColXpr;
17typedef Block<Derived, 1, internal::traits<Derived>::ColsAtCompileTime, IsRowMajor> RowXpr;
18typedef const Block<const Derived, 1, internal::traits<Derived>::ColsAtCompileTime, IsRowMajor> ConstRowXpr;
20typedef Block<Derived, internal::traits<Derived>::RowsAtCompileTime, Dynamic, !IsRowMajor> ColsBlockXpr;
21typedef const Block<const Derived, internal::traits<Derived>::RowsAtCompileTime, Dynamic, !IsRowMajor>
22 ConstColsBlockXpr;
24typedef Block<Derived, Dynamic, internal::traits<Derived>::ColsAtCompileTime, IsRowMajor> RowsBlockXpr;
25typedef const Block<const Derived, Dynamic, internal::traits<Derived>::ColsAtCompileTime, IsRowMajor> ConstRowsBlockXpr;
27template <int N>
28struct NColsBlockXpr {
29 typedef Block<Derived, internal::traits<Derived>::RowsAtCompileTime, N, !IsRowMajor> Type;
30};
31template <int N>
32struct ConstNColsBlockXpr {
33 typedef const Block<const Derived, internal::traits<Derived>::RowsAtCompileTime, N, !IsRowMajor> Type;
34};
36template <int N>
37struct NRowsBlockXpr {
38 typedef Block<Derived, N, internal::traits<Derived>::ColsAtCompileTime, IsRowMajor> Type;
39};
40template <int N>
41struct ConstNRowsBlockXpr {
42 typedef const Block<const Derived, N, internal::traits<Derived>::ColsAtCompileTime, IsRowMajor> Type;
43};
45typedef Block<Derived> BlockXpr;
46typedef const Block<const Derived> ConstBlockXpr;
48template <int Rows, int Cols>
49struct FixedBlockXpr {
50 typedef Block<Derived, Rows, Cols> Type;
51};
52template <int Rows, int Cols>
53struct ConstFixedBlockXpr {
54 typedef Block<const Derived, Rows, Cols> Type;
55};
56
57typedef VectorBlock<Derived> SegmentReturnType;
58typedef const VectorBlock<const Derived> ConstSegmentReturnType;
59template <int Size>
60struct FixedSegmentReturnType {
61 typedef VectorBlock<Derived, Size> Type;
62};
63template <int Size>
64struct ConstFixedSegmentReturnType {
65 typedef const VectorBlock<const Derived, Size> Type;
66};
67
69typedef Block<Derived, IsRowMajor ? 1 : Dynamic, IsRowMajor ? Dynamic : 1, true> InnerVectorReturnType;
70typedef Block<const Derived, IsRowMajor ? 1 : Dynamic, IsRowMajor ? Dynamic : 1, true> ConstInnerVectorReturnType;
71
73typedef Block<Derived, Dynamic, Dynamic, true> InnerVectorsReturnType;
74typedef Block<const Derived, Dynamic, Dynamic, true> ConstInnerVectorsReturnType;
75
76#endif // not EIGEN_PARSED_BY_DOXYGEN
77
109EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
113template <typename NRowsType, typename NColsType>
114EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
115#ifndef EIGEN_PARSED_BY_DOXYGEN
116 typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,
117 internal::get_fixed_value<NColsType>::value>::Type
118#else
119 typename FixedBlockXpr<..., ...>::Type
120#endif
121 block(Index startRow, Index startCol, NRowsType blockRows, NColsType blockCols) {
122 return
123 typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,
124 internal::get_fixed_value<NColsType>::value>::Type(derived(), startRow, startCol,
125 internal::get_runtime_value(blockRows),
126 internal::get_runtime_value(blockCols));
127}
128
130template <typename NRowsType, typename NColsType>
131EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
132#ifndef EIGEN_PARSED_BY_DOXYGEN
133 const typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,
134 internal::get_fixed_value<NColsType>::value>::Type
135#else
136 const typename ConstFixedBlockXpr<..., ...>::Type
137#endif
138 block(Index startRow, Index startCol, NRowsType blockRows, NColsType blockCols) const {
139 return typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,
140 internal::get_fixed_value<NColsType>::value>::Type(derived(), startRow, startCol,
141 internal::get_runtime_value(
142 blockRows),
143 internal::get_runtime_value(
144 blockCols));
145}
146
161EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
165template <typename NRowsType, typename NColsType>
166EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
167#ifndef EIGEN_PARSED_BY_DOXYGEN
168 typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,
169 internal::get_fixed_value<NColsType>::value>::Type
170#else
171 typename FixedBlockXpr<..., ...>::Type
172#endif
173 topRightCorner(NRowsType cRows, NColsType cCols) {
174 return typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,
175 internal::get_fixed_value<NColsType>::value>::Type(derived(), 0,
176 cols() - internal::get_runtime_value(
177 cCols),
178 internal::get_runtime_value(cRows),
179 internal::get_runtime_value(cCols));
180}
181
183template <typename NRowsType, typename NColsType>
184EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
185#ifndef EIGEN_PARSED_BY_DOXYGEN
186 const typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,
187 internal::get_fixed_value<NColsType>::value>::Type
188#else
189 const typename ConstFixedBlockXpr<..., ...>::Type
190#endif
191 topRightCorner(NRowsType cRows, NColsType cCols) const {
192 return
193 typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,
194 internal::get_fixed_value<NColsType>::value>::Type(derived(), 0,
195 cols() -
196 internal::get_runtime_value(
197 cCols),
198 internal::get_runtime_value(cRows),
199 internal::get_runtime_value(
200 cCols));
201}
202
211EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
215template <int CRows, int CCols>
216EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename FixedBlockXpr<CRows, CCols>::Type topRightCorner() {
217 return typename FixedBlockXpr<CRows, CCols>::Type(derived(), 0, cols() - CCols);
218}
219
221template <int CRows, int CCols>
222EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename ConstFixedBlockXpr<CRows, CCols>::Type topRightCorner() const {
223 return typename ConstFixedBlockXpr<CRows, CCols>::Type(derived(), 0, cols() - CCols);
224}
225
241EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
245template <int CRows, int CCols>
246EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename FixedBlockXpr<CRows, CCols>::Type topRightCorner(Index cRows,
247 Index cCols) {
248 return typename FixedBlockXpr<CRows, CCols>::Type(derived(), 0, cols() - cCols, cRows, cCols);
249}
250
252template <int CRows, int CCols>
253EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename ConstFixedBlockXpr<CRows, CCols>::Type topRightCorner(
254 Index cRows, Index cCols) const {
255 return typename ConstFixedBlockXpr<CRows, CCols>::Type(derived(), 0, cols() - cCols, cRows, cCols);
256}
257
272EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
276template <typename NRowsType, typename NColsType>
277EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
278#ifndef EIGEN_PARSED_BY_DOXYGEN
279 typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,
280 internal::get_fixed_value<NColsType>::value>::Type
281#else
282 typename FixedBlockXpr<..., ...>::Type
283#endif
284 topLeftCorner(NRowsType cRows, NColsType cCols) {
285 return typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,
286 internal::get_fixed_value<NColsType>::value>::Type(derived(), 0, 0,
287 internal::get_runtime_value(cRows),
288 internal::get_runtime_value(cCols));
289}
290
292template <typename NRowsType, typename NColsType>
293EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
294#ifndef EIGEN_PARSED_BY_DOXYGEN
295 const typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,
296 internal::get_fixed_value<NColsType>::value>::Type
297#else
298 const typename ConstFixedBlockXpr<..., ...>::Type
299#endif
300 topLeftCorner(NRowsType cRows, NColsType cCols) const {
301 return
302 typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,
303 internal::get_fixed_value<NColsType>::value>::Type(derived(), 0, 0,
304 internal::get_runtime_value(cRows),
305 internal::get_runtime_value(
306 cCols));
307}
308
316EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
320template <int CRows, int CCols>
321EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename FixedBlockXpr<CRows, CCols>::Type topLeftCorner() {
322 return typename FixedBlockXpr<CRows, CCols>::Type(derived(), 0, 0);
323}
324
326template <int CRows, int CCols>
327EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename ConstFixedBlockXpr<CRows, CCols>::Type topLeftCorner() const {
328 return typename ConstFixedBlockXpr<CRows, CCols>::Type(derived(), 0, 0);
329}
330
346EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
350template <int CRows, int CCols>
351EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename FixedBlockXpr<CRows, CCols>::Type topLeftCorner(Index cRows,
352 Index cCols) {
353 return typename FixedBlockXpr<CRows, CCols>::Type(derived(), 0, 0, cRows, cCols);
354}
355
357template <int CRows, int CCols>
358EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename ConstFixedBlockXpr<CRows, CCols>::Type topLeftCorner(
359 Index cRows, Index cCols) const {
360 return typename ConstFixedBlockXpr<CRows, CCols>::Type(derived(), 0, 0, cRows, cCols);
361}
362
377EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
381template <typename NRowsType, typename NColsType>
382EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
383#ifndef EIGEN_PARSED_BY_DOXYGEN
384 typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,
385 internal::get_fixed_value<NColsType>::value>::Type
386#else
387 typename FixedBlockXpr<..., ...>::Type
388#endif
389 bottomRightCorner(NRowsType cRows, NColsType cCols) {
390 return
391 typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value, internal::get_fixed_value<NColsType>::value>::
392 Type(derived(), rows() - internal::get_runtime_value(cRows), cols() - internal::get_runtime_value(cCols),
393 internal::get_runtime_value(cRows), internal::get_runtime_value(cCols));
394}
395
397template <typename NRowsType, typename NColsType>
398EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
399#ifndef EIGEN_PARSED_BY_DOXYGEN
400 const typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,
401 internal::get_fixed_value<NColsType>::value>::Type
402#else
403 const typename ConstFixedBlockXpr<..., ...>::Type
404#endif
405 bottomRightCorner(NRowsType cRows, NColsType cCols) const {
406 return typename ConstFixedBlockXpr<
407 internal::get_fixed_value<NRowsType>::value,
408 internal::get_fixed_value<NColsType>::value>::Type(derived(), rows() - internal::get_runtime_value(cRows),
409 cols() - internal::get_runtime_value(cCols),
410 internal::get_runtime_value(cRows),
411 internal::get_runtime_value(cCols));
412}
413
421EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
425template <int CRows, int CCols>
426EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename FixedBlockXpr<CRows, CCols>::Type bottomRightCorner() {
427 return typename FixedBlockXpr<CRows, CCols>::Type(derived(), rows() - CRows, cols() - CCols);
428}
429
431template <int CRows, int CCols>
432EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename ConstFixedBlockXpr<CRows, CCols>::Type bottomRightCorner() const {
433 return typename ConstFixedBlockXpr<CRows, CCols>::Type(derived(), rows() - CRows, cols() - CCols);
434}
435
451EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
455template <int CRows, int CCols>
456EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename FixedBlockXpr<CRows, CCols>::Type bottomRightCorner(Index cRows,
457 Index cCols) {
458 return typename FixedBlockXpr<CRows, CCols>::Type(derived(), rows() - cRows, cols() - cCols, cRows, cCols);
459}
460
462template <int CRows, int CCols>
463EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename ConstFixedBlockXpr<CRows, CCols>::Type bottomRightCorner(
464 Index cRows, Index cCols) const {
465 return typename ConstFixedBlockXpr<CRows, CCols>::Type(derived(), rows() - cRows, cols() - cCols, cRows, cCols);
466}
467
482EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
486template <typename NRowsType, typename NColsType>
487EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
488#ifndef EIGEN_PARSED_BY_DOXYGEN
489 typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,
490 internal::get_fixed_value<NColsType>::value>::Type
491#else
492 typename FixedBlockXpr<..., ...>::Type
493#endif
494 bottomLeftCorner(NRowsType cRows, NColsType cCols) {
495 return
496 typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,
497 internal::get_fixed_value<NColsType>::value>::Type(derived(),
498 rows() -
499 internal::get_runtime_value(cRows),
500 0, internal::get_runtime_value(cRows),
501 internal::get_runtime_value(cCols));
502}
503
505template <typename NRowsType, typename NColsType>
506EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
507#ifndef EIGEN_PARSED_BY_DOXYGEN
508 typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,
509 internal::get_fixed_value<NColsType>::value>::Type
510#else
511 typename ConstFixedBlockXpr<..., ...>::Type
512#endif
513 bottomLeftCorner(NRowsType cRows, NColsType cCols) const {
514 return typename ConstFixedBlockXpr<
515 internal::get_fixed_value<NRowsType>::value,
516 internal::get_fixed_value<NColsType>::value>::Type(derived(), rows() - internal::get_runtime_value(cRows), 0,
517 internal::get_runtime_value(cRows),
518 internal::get_runtime_value(cCols));
519}
520
528EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
532template <int CRows, int CCols>
533EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename FixedBlockXpr<CRows, CCols>::Type bottomLeftCorner() {
534 return typename FixedBlockXpr<CRows, CCols>::Type(derived(), rows() - CRows, 0);
535}
536
538template <int CRows, int CCols>
539EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename ConstFixedBlockXpr<CRows, CCols>::Type bottomLeftCorner() const {
540 return typename ConstFixedBlockXpr<CRows, CCols>::Type(derived(), rows() - CRows, 0);
541}
542
558EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
562template <int CRows, int CCols>
563EIGEN_STRONG_INLINE typename FixedBlockXpr<CRows, CCols>::Type bottomLeftCorner(Index cRows, Index cCols) {
564 return typename FixedBlockXpr<CRows, CCols>::Type(derived(), rows() - cRows, 0, cRows, cCols);
565}
566
568template <int CRows, int CCols>
569EIGEN_STRONG_INLINE const typename ConstFixedBlockXpr<CRows, CCols>::Type bottomLeftCorner(Index cRows,
570 Index cCols) const {
571 return typename ConstFixedBlockXpr<CRows, CCols>::Type(derived(), rows() - cRows, 0, cRows, cCols);
572}
573
586EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row - major)
590template <typename NRowsType>
591EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
592#ifndef EIGEN_PARSED_BY_DOXYGEN
593 typename NRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
594#else
595 typename NRowsBlockXpr<...>::Type
596#endif
597 topRows(NRowsType n) {
598 return typename NRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type(
599 derived(), 0, 0, internal::get_runtime_value(n), cols());
600}
601
603template <typename NRowsType>
604EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
605#ifndef EIGEN_PARSED_BY_DOXYGEN
606 const typename ConstNRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
607#else
608 const typename ConstNRowsBlockXpr<...>::Type
609#endif
610 topRows(NRowsType n) const {
611 return typename ConstNRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type(
612 derived(), 0, 0, internal::get_runtime_value(n), cols());
613}
614
626EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row - major)
630template <int N>
631EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename NRowsBlockXpr<N>::Type topRows(Index n = N) {
632 return typename NRowsBlockXpr<N>::Type(derived(), 0, 0, n, cols());
633}
634
636template <int N>
637EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename ConstNRowsBlockXpr<N>::Type topRows(Index n = N) const {
638 return typename ConstNRowsBlockXpr<N>::Type(derived(), 0, 0, n, cols());
639}
640
653EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row - major)
657template <typename NRowsType>
658EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
659#ifndef EIGEN_PARSED_BY_DOXYGEN
660 typename NRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
661#else
662 typename NRowsBlockXpr<...>::Type
663#endif
664 bottomRows(NRowsType n) {
665 return typename NRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type(
666 derived(), rows() - internal::get_runtime_value(n), 0, internal::get_runtime_value(n), cols());
667}
668
670template <typename NRowsType>
671EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
672#ifndef EIGEN_PARSED_BY_DOXYGEN
673 const typename ConstNRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
674#else
675 const typename ConstNRowsBlockXpr<...>::Type
676#endif
677 bottomRows(NRowsType n) const {
678 return typename ConstNRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type(
679 derived(), rows() - internal::get_runtime_value(n), 0, internal::get_runtime_value(n), cols());
680}
681
693EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row - major)
697template <int N>
698EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename NRowsBlockXpr<N>::Type bottomRows(Index n = N) {
699 return typename NRowsBlockXpr<N>::Type(derived(), rows() - n, 0, n, cols());
700}
701
703template <int N>
704EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename ConstNRowsBlockXpr<N>::Type bottomRows(Index n = N) const {
705 return typename ConstNRowsBlockXpr<N>::Type(derived(), rows() - n, 0, n, cols());
706}
707
721EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row - major)
725template <typename NRowsType>
726EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
727#ifndef EIGEN_PARSED_BY_DOXYGEN
728 typename NRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
729#else
730 typename NRowsBlockXpr<...>::Type
731#endif
732 middleRows(Index startRow, NRowsType n) {
733 return typename NRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type(
734 derived(), startRow, 0, internal::get_runtime_value(n), cols());
735}
736
738template <typename NRowsType>
739EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
740#ifndef EIGEN_PARSED_BY_DOXYGEN
741 const typename ConstNRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
742#else
743 const typename ConstNRowsBlockXpr<...>::Type
744#endif
745 middleRows(Index startRow, NRowsType n) const {
746 return typename ConstNRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type(
747 derived(), startRow, 0, internal::get_runtime_value(n), cols());
748}
749
762EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row - major)
766template <int N>
767EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename NRowsBlockXpr<N>::Type middleRows(Index startRow, Index n = N) {
768 return typename NRowsBlockXpr<N>::Type(derived(), startRow, 0, n, cols());
769}
770
772template <int N>
773EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename ConstNRowsBlockXpr<N>::Type middleRows(Index startRow,
774 Index n = N) const {
775 return typename ConstNRowsBlockXpr<N>::Type(derived(), startRow, 0, n, cols());
776}
777
790EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column - major)
794template <typename NColsType>
795EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
796#ifndef EIGEN_PARSED_BY_DOXYGEN
797 typename NColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
798#else
799 typename NColsBlockXpr<...>::Type
800#endif
801 leftCols(NColsType n) {
802 return typename NColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type(derived(), 0, 0, rows(),
803 internal::get_runtime_value(n));
804}
805
807template <typename NColsType>
808EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
809#ifndef EIGEN_PARSED_BY_DOXYGEN
810 const typename ConstNColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
811#else
812 const typename ConstNColsBlockXpr<...>::Type
813#endif
814 leftCols(NColsType n) const {
815 return typename ConstNColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type(derived(), 0, 0, rows(),
816 internal::get_runtime_value(n));
817}
818
830EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column - major)
834template <int N>
835EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename NColsBlockXpr<N>::Type leftCols(Index n = N) {
836 return typename NColsBlockXpr<N>::Type(derived(), 0, 0, rows(), n);
837}
838
840template <int N>
841EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename ConstNColsBlockXpr<N>::Type leftCols(Index n = N) const {
842 return typename ConstNColsBlockXpr<N>::Type(derived(), 0, 0, rows(), n);
843}
844
857EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column - major)
861template <typename NColsType>
862EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
863#ifndef EIGEN_PARSED_BY_DOXYGEN
864 typename NColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
865#else
866 typename NColsBlockXpr<...>::Type
867#endif
868 rightCols(NColsType n) {
869 return typename NColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type(
870 derived(), 0, cols() - internal::get_runtime_value(n), rows(), internal::get_runtime_value(n));
871}
872
874template <typename NColsType>
875EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
876#ifndef EIGEN_PARSED_BY_DOXYGEN
877 const typename ConstNColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
878#else
879 const typename ConstNColsBlockXpr<...>::Type
880#endif
881 rightCols(NColsType n) const {
882 return typename ConstNColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type(
883 derived(), 0, cols() - internal::get_runtime_value(n), rows(), internal::get_runtime_value(n));
884}
885
897EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column - major)
901template <int N>
902EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename NColsBlockXpr<N>::Type rightCols(Index n = N) {
903 return typename NColsBlockXpr<N>::Type(derived(), 0, cols() - n, rows(), n);
904}
905
907template <int N>
908EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename ConstNColsBlockXpr<N>::Type rightCols(Index n = N) const {
909 return typename ConstNColsBlockXpr<N>::Type(derived(), 0, cols() - n, rows(), n);
910}
911
925EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column - major)
929template <typename NColsType>
930EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
931#ifndef EIGEN_PARSED_BY_DOXYGEN
932 typename NColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
933#else
934 typename NColsBlockXpr<...>::Type
935#endif
936 middleCols(Index startCol, NColsType numCols) {
937 return typename NColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type(
938 derived(), 0, startCol, rows(), internal::get_runtime_value(numCols));
939}
940
942template <typename NColsType>
943EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
944#ifndef EIGEN_PARSED_BY_DOXYGEN
945 const typename ConstNColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
946#else
947 const typename ConstNColsBlockXpr<...>::Type
948#endif
949 middleCols(Index startCol, NColsType numCols) const {
950 return typename ConstNColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type(
951 derived(), 0, startCol, rows(), internal::get_runtime_value(numCols));
952}
953
966EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column - major)
970template <int N>
971EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename NColsBlockXpr<N>::Type middleCols(Index startCol, Index n = N) {
972 return typename NColsBlockXpr<N>::Type(derived(), 0, startCol, rows(), n);
973}
974
976template <int N>
977EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename ConstNColsBlockXpr<N>::Type middleCols(Index startCol,
978 Index n = N) const {
979 return typename ConstNColsBlockXpr<N>::Type(derived(), 0, startCol, rows(), n);
980}
981
1002EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
1006template <int NRows, int NCols>
1007EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename FixedBlockXpr<NRows, NCols>::Type block(Index startRow, Index startCol) {
1008 return typename FixedBlockXpr<NRows, NCols>::Type(derived(), startRow, startCol);
1009}
1010
1012template <int NRows, int NCols>
1013EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename ConstFixedBlockXpr<NRows, NCols>::Type block(
1014 Index startRow, Index startCol) const {
1015 return typename ConstFixedBlockXpr<NRows, NCols>::Type(derived(), startRow, startCol);
1016}
1017
1045EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
1049template <int NRows, int NCols>
1050EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename FixedBlockXpr<NRows, NCols>::Type block(Index startRow, Index startCol,
1051 Index blockRows,
1052 Index blockCols) {
1053 return typename FixedBlockXpr<NRows, NCols>::Type(derived(), startRow, startCol, blockRows, blockCols);
1054}
1055
1057template <int NRows, int NCols>
1058EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename ConstFixedBlockXpr<NRows, NCols>::Type block(
1059 Index startRow, Index startCol, Index blockRows, Index blockCols) const {
1060 return typename ConstFixedBlockXpr<NRows, NCols>::Type(derived(), startRow, startCol, blockRows, blockCols);
1061}
1062
1068EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column - major)
1071EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ColXpr col(Index i) { return ColXpr(derived(), i); }
1072
1074EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ConstColXpr col(Index i) const { return ConstColXpr(derived(), i); }
1075
1081EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row - major)
1084EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE RowXpr row(Index i) { return RowXpr(derived(), i); }
1085
1087EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ConstRowXpr row(Index i) const { return ConstRowXpr(derived(), i); }
1088
1110template <typename NType>
1111EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1112#ifndef EIGEN_PARSED_BY_DOXYGEN
1113 typename FixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
1114#else
1115 typename FixedSegmentReturnType<...>::Type
1116#endif
1117 segment(Index start, NType n) {
1118 EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
1119 return typename FixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type(derived(), start,
1120 internal::get_runtime_value(n));
1121}
1122
1124template <typename NType>
1125EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1126#ifndef EIGEN_PARSED_BY_DOXYGEN
1127 const typename ConstFixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
1128#else
1129 const typename ConstFixedSegmentReturnType<...>::Type
1130#endif
1131 segment(Index start, NType n) const {
1132 EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
1133 return typename ConstFixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type(
1134 derived(), start, internal::get_runtime_value(n));
1135}
1136
1157template <typename NType>
1158EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1159#ifndef EIGEN_PARSED_BY_DOXYGEN
1160 typename FixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
1161#else
1162 typename FixedSegmentReturnType<...>::Type
1163#endif
1164 head(NType n) {
1165 EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
1166 return typename FixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type(derived(), 0,
1167 internal::get_runtime_value(n));
1168}
1169
1171template <typename NType>
1172EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1173#ifndef EIGEN_PARSED_BY_DOXYGEN
1174 const typename ConstFixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
1175#else
1176 const typename ConstFixedSegmentReturnType<...>::Type
1177#endif
1178 head(NType n) const {
1179 EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
1180 return typename ConstFixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type(
1181 derived(), 0, internal::get_runtime_value(n));
1182}
1183
1204template <typename NType>
1205EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1206#ifndef EIGEN_PARSED_BY_DOXYGEN
1207 typename FixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
1208#else
1209 typename FixedSegmentReturnType<...>::Type
1210#endif
1211 tail(NType n) {
1212 EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
1213 return typename FixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type(
1214 derived(), this->size() - internal::get_runtime_value(n), internal::get_runtime_value(n));
1215}
1216
1218template <typename NType>
1219EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1220#ifndef EIGEN_PARSED_BY_DOXYGEN
1221 const typename ConstFixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
1222#else
1223 const typename ConstFixedSegmentReturnType<...>::Type
1224#endif
1225 tail(NType n) const {
1226 EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
1227 return typename ConstFixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type(
1228 derived(), this->size() - internal::get_runtime_value(n), internal::get_runtime_value(n));
1229}
1230
1247template <int N>
1248EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename FixedSegmentReturnType<N>::Type segment(Index start, Index n = N) {
1249 EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
1250 return typename FixedSegmentReturnType<N>::Type(derived(), start, n);
1251}
1252
1254template <int N>
1255EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename ConstFixedSegmentReturnType<N>::Type segment(Index start,
1256 Index n = N) const {
1257 EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
1258 return typename ConstFixedSegmentReturnType<N>::Type(derived(), start, n);
1259}
1260
1276template <int N>
1277EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename FixedSegmentReturnType<N>::Type head(Index n = N) {
1278 EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
1279 return typename FixedSegmentReturnType<N>::Type(derived(), 0, n);
1280}
1281
1283template <int N>
1284EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename ConstFixedSegmentReturnType<N>::Type head(Index n = N) const {
1285 EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
1286 return typename ConstFixedSegmentReturnType<N>::Type(derived(), 0, n);
1287}
1288
1304template <int N>
1305EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename FixedSegmentReturnType<N>::Type tail(Index n = N) {
1306 EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
1307 return typename FixedSegmentReturnType<N>::Type(derived(), size() - n);
1308}
1309
1311template <int N>
1312EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename ConstFixedSegmentReturnType<N>::Type tail(Index n = N) const {
1313 EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
1314 return typename ConstFixedSegmentReturnType<N>::Type(derived(), size() - n);
1315}
1316
1320EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE InnerVectorReturnType innerVector(Index outer) {
1321 return InnerVectorReturnType(derived(), outer);
1322}
1323
1327EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const ConstInnerVectorReturnType innerVector(Index outer) const {
1328 return ConstInnerVectorReturnType(derived(), outer);
1329}
1330
1334EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE InnerVectorsReturnType innerVectors(Index outerStart, Index outerSize) {
1335 return Block<Derived, Dynamic, Dynamic, true>(derived(), IsRowMajor ? outerStart : 0, IsRowMajor ? 0 : outerStart,
1336 IsRowMajor ? outerSize : rows(), IsRowMajor ? cols() : outerSize);
1337}
1338
1342EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const ConstInnerVectorsReturnType innerVectors(Index outerStart,
1343 Index outerSize) const {
1344 return Block<const Derived, Dynamic, Dynamic, true>(derived(), IsRowMajor ? outerStart : 0,
1345 IsRowMajor ? 0 : outerStart, IsRowMajor ? outerSize : rows(),
1346 IsRowMajor ? cols() : outerSize);
1347}
1348
1352template <DirectionType Direction>
1353EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE std::conditional_t<Direction == Vertical, ColXpr, RowXpr> subVector(Index i) {
1354 return std::conditional_t<Direction == Vertical, ColXpr, RowXpr>(derived(), i);
1355}
1356
1358template <DirectionType Direction>
1359EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE std::conditional_t<Direction == Vertical, ConstColXpr, ConstRowXpr> subVector(
1360 Index i) const {
1361 return std::conditional_t<Direction == Vertical, ConstColXpr, ConstRowXpr>(derived(), i);
1362}
1363
1367template <DirectionType Direction>
1368EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index subVectors() const {
1369 return (Direction == Vertical) ? cols() : rows();
1370}
const int Dynamic
Definition Constants.h:25