12#ifndef EIGEN_PARSED_BY_DOXYGEN
15using ColXpr = Block<Derived, internal::traits<Derived>::RowsAtCompileTime, 1, !IsRowMajor>;
16using ConstColXpr =
const Block<const Derived, internal::traits<Derived>::RowsAtCompileTime, 1, !IsRowMajor>;
18using RowXpr = Block<Derived, 1, internal::traits<Derived>::ColsAtCompileTime, IsRowMajor>;
19using ConstRowXpr =
const Block<const Derived, 1, internal::traits<Derived>::ColsAtCompileTime, IsRowMajor>;
21using ColsBlockXpr = Block<Derived, internal::traits<Derived>::RowsAtCompileTime, Dynamic, !IsRowMajor>;
22using ConstColsBlockXpr =
23 const Block<const Derived, internal::traits<Derived>::RowsAtCompileTime, Dynamic, !IsRowMajor>;
25using RowsBlockXpr = Block<Derived, Dynamic, internal::traits<Derived>::ColsAtCompileTime, IsRowMajor>;
26using ConstRowsBlockXpr =
const Block<const Derived, Dynamic, internal::traits<Derived>::ColsAtCompileTime, IsRowMajor>;
30 using Type = Block<Derived, internal::traits<Derived>::RowsAtCompileTime, N, !IsRowMajor>;
33struct ConstNColsBlockXpr {
34 using Type =
const Block<const Derived, internal::traits<Derived>::RowsAtCompileTime, N, !IsRowMajor>;
39 using Type = Block<Derived, N, internal::traits<Derived>::ColsAtCompileTime, IsRowMajor>;
42struct ConstNRowsBlockXpr {
43 using Type =
const Block<const Derived, N, internal::traits<Derived>::ColsAtCompileTime, IsRowMajor>;
46using BlockXpr = Block<Derived>;
47using ConstBlockXpr =
const Block<const Derived>;
49template <
int Rows,
int Cols>
51 using Type = Block<Derived, Rows, Cols>;
53template <
int Rows,
int Cols>
54struct ConstFixedBlockXpr {
55 using Type = Block<const Derived, Rows, Cols>;
58using SegmentReturnType = VectorBlock<Derived>;
59using ConstSegmentReturnType =
const VectorBlock<const Derived>;
61struct FixedSegmentReturnType {
62 using Type = VectorBlock<Derived, Size>;
65struct ConstFixedSegmentReturnType {
66 using Type =
const VectorBlock<const Derived, Size>;
70using InnerVectorReturnType = std::conditional_t<IsRowMajor, RowXpr, ColXpr>;
71using ConstInnerVectorReturnType = std::conditional_t<IsRowMajor, ConstRowXpr, ConstColXpr>;
74using InnerVectorsReturnType = std::conditional_t<IsRowMajor, RowsBlockXpr, ColsBlockXpr>;
75using ConstInnerVectorsReturnType = std::conditional_t<IsRowMajor, ConstRowsBlockXpr, ConstColsBlockXpr>;
110EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
114template <
typename NRowsType,
typename NColsType>
115EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE
116#ifndef EIGEN_PARSED_BY_DOXYGEN
117 typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,
118 internal::get_fixed_value<NColsType>::value>::Type
120 typename FixedBlockXpr<..., ...>::Type
122 block(Index startRow, Index startCol, NRowsType blockRows, NColsType blockCols) {
124 typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,
125 internal::get_fixed_value<NColsType>::value>::Type(derived(), startRow, startCol,
126 internal::get_runtime_value(blockRows),
127 internal::get_runtime_value(blockCols));
131template <
typename NRowsType,
typename NColsType>
132EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE
133#ifndef EIGEN_PARSED_BY_DOXYGEN
134 const typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,
135 internal::get_fixed_value<NColsType>::value>::Type
137 const typename ConstFixedBlockXpr<..., ...>::Type
139 block(Index startRow, Index startCol, NRowsType blockRows, NColsType blockCols)
const {
140 return typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,
141 internal::get_fixed_value<NColsType>::value>::Type(derived(), startRow, startCol,
142 internal::get_runtime_value(
144 internal::get_runtime_value(
162EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
166template <
typename NRowsType,
typename NColsType>
167EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE
168#ifndef EIGEN_PARSED_BY_DOXYGEN
169 typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,
170 internal::get_fixed_value<NColsType>::value>::Type
172 typename FixedBlockXpr<..., ...>::Type
174 topRightCorner(NRowsType cRows, NColsType cCols) {
175 return typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,
176 internal::get_fixed_value<NColsType>::value>::Type(derived(), 0,
177 cols() - internal::get_runtime_value(
179 internal::get_runtime_value(cRows),
180 internal::get_runtime_value(cCols));
184template <
typename NRowsType,
typename NColsType>
185EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE
186#ifndef EIGEN_PARSED_BY_DOXYGEN
187 const typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,
188 internal::get_fixed_value<NColsType>::value>::Type
190 const typename ConstFixedBlockXpr<..., ...>::Type
192 topRightCorner(NRowsType cRows, NColsType cCols)
const {
194 typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,
195 internal::get_fixed_value<NColsType>::value>::Type(derived(), 0,
197 internal::get_runtime_value(
199 internal::get_runtime_value(cRows),
200 internal::get_runtime_value(
212EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
216template <
int CRows,
int CCols>
217EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE
typename FixedBlockXpr<CRows, CCols>::Type topRightCorner() {
218 return typename FixedBlockXpr<CRows, CCols>::Type(derived(), 0, cols() - CCols);
222template <
int CRows,
int CCols>
223EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE
const typename ConstFixedBlockXpr<CRows, CCols>::Type topRightCorner()
225 return typename ConstFixedBlockXpr<CRows, CCols>::Type(derived(), 0, cols() - CCols);
243EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
247template <
int CRows,
int CCols>
248EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE
typename FixedBlockXpr<CRows, CCols>::Type topRightCorner(Index cRows,
250 return typename FixedBlockXpr<CRows, CCols>::Type(derived(), 0, cols() - cCols, cRows, cCols);
254template <
int CRows,
int CCols>
255EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE
const typename ConstFixedBlockXpr<CRows, CCols>::Type topRightCorner(
256 Index cRows, Index cCols)
const {
257 return typename ConstFixedBlockXpr<CRows, CCols>::Type(derived(), 0, cols() - cCols, cRows, cCols);
274EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
278template <
typename NRowsType,
typename NColsType>
279EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE
280#ifndef EIGEN_PARSED_BY_DOXYGEN
281 typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,
282 internal::get_fixed_value<NColsType>::value>::Type
284 typename FixedBlockXpr<..., ...>::Type
286 topLeftCorner(NRowsType cRows, NColsType cCols) {
287 return typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,
288 internal::get_fixed_value<NColsType>::value>::Type(derived(), 0, 0,
289 internal::get_runtime_value(cRows),
290 internal::get_runtime_value(cCols));
294template <
typename NRowsType,
typename NColsType>
295EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE
296#ifndef EIGEN_PARSED_BY_DOXYGEN
297 const typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,
298 internal::get_fixed_value<NColsType>::value>::Type
300 const typename ConstFixedBlockXpr<..., ...>::Type
302 topLeftCorner(NRowsType cRows, NColsType cCols)
const {
304 typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,
305 internal::get_fixed_value<NColsType>::value>::Type(derived(), 0, 0,
306 internal::get_runtime_value(cRows),
307 internal::get_runtime_value(
318EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
322template <
int CRows,
int CCols>
323EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE
typename FixedBlockXpr<CRows, CCols>::Type topLeftCorner() {
324 return typename FixedBlockXpr<CRows, CCols>::Type(derived(), 0, 0);
328template <
int CRows,
int CCols>
329EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE
const typename ConstFixedBlockXpr<CRows, CCols>::Type topLeftCorner()
331 return typename ConstFixedBlockXpr<CRows, CCols>::Type(derived(), 0, 0);
349EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
353template <
int CRows,
int CCols>
354EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE
typename FixedBlockXpr<CRows, CCols>::Type topLeftCorner(Index cRows,
356 return typename FixedBlockXpr<CRows, CCols>::Type(derived(), 0, 0, cRows, cCols);
360template <
int CRows,
int CCols>
361EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE
const typename ConstFixedBlockXpr<CRows, CCols>::Type topLeftCorner(
362 Index cRows, Index cCols)
const {
363 return typename ConstFixedBlockXpr<CRows, CCols>::Type(derived(), 0, 0, cRows, cCols);
380EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
384template <
typename NRowsType,
typename NColsType>
385EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE
386#ifndef EIGEN_PARSED_BY_DOXYGEN
387 typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,
388 internal::get_fixed_value<NColsType>::value>::Type
390 typename FixedBlockXpr<..., ...>::Type
392 bottomRightCorner(NRowsType cRows, NColsType cCols) {
394 typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value, internal::get_fixed_value<NColsType>::value>::
395 Type(derived(), rows() - internal::get_runtime_value(cRows), cols() - internal::get_runtime_value(cCols),
396 internal::get_runtime_value(cRows), internal::get_runtime_value(cCols));
400template <
typename NRowsType,
typename NColsType>
401EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE
402#ifndef EIGEN_PARSED_BY_DOXYGEN
403 const typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,
404 internal::get_fixed_value<NColsType>::value>::Type
406 const typename ConstFixedBlockXpr<..., ...>::Type
408 bottomRightCorner(NRowsType cRows, NColsType cCols)
const {
409 return typename ConstFixedBlockXpr<
410 internal::get_fixed_value<NRowsType>::value,
411 internal::get_fixed_value<NColsType>::value>::Type(derived(), rows() - internal::get_runtime_value(cRows),
412 cols() - internal::get_runtime_value(cCols),
413 internal::get_runtime_value(cRows),
414 internal::get_runtime_value(cCols));
424EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
428template <
int CRows,
int CCols>
429EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE
typename FixedBlockXpr<CRows, CCols>::Type bottomRightCorner() {
430 return typename FixedBlockXpr<CRows, CCols>::Type(derived(), rows() - CRows, cols() - CCols);
434template <
int CRows,
int CCols>
435EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE
const typename ConstFixedBlockXpr<CRows, CCols>::Type
436bottomRightCorner()
const {
437 return typename ConstFixedBlockXpr<CRows, CCols>::Type(derived(), rows() - CRows, cols() - CCols);
455EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
459template <
int CRows,
int CCols>
460EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE
typename FixedBlockXpr<CRows, CCols>::Type bottomRightCorner(
461 Index cRows, Index cCols) {
462 return typename FixedBlockXpr<CRows, CCols>::Type(derived(), rows() - cRows, cols() - cCols, cRows, cCols);
466template <
int CRows,
int CCols>
467EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE
const typename ConstFixedBlockXpr<CRows, CCols>::Type bottomRightCorner(
468 Index cRows, Index cCols)
const {
469 return typename ConstFixedBlockXpr<CRows, CCols>::Type(derived(), rows() - cRows, cols() - cCols, cRows, cCols);
486EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
490template <
typename NRowsType,
typename NColsType>
491EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE
492#ifndef EIGEN_PARSED_BY_DOXYGEN
493 typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,
494 internal::get_fixed_value<NColsType>::value>::Type
496 typename FixedBlockXpr<..., ...>::Type
498 bottomLeftCorner(NRowsType cRows, NColsType cCols) {
500 typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,
501 internal::get_fixed_value<NColsType>::value>::Type(derived(),
503 internal::get_runtime_value(cRows),
504 0, internal::get_runtime_value(cRows),
505 internal::get_runtime_value(cCols));
509template <
typename NRowsType,
typename NColsType>
510EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE
511#ifndef EIGEN_PARSED_BY_DOXYGEN
512 typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,
513 internal::get_fixed_value<NColsType>::value>::Type
515 typename ConstFixedBlockXpr<..., ...>::Type
517 bottomLeftCorner(NRowsType cRows, NColsType cCols)
const {
518 return typename ConstFixedBlockXpr<
519 internal::get_fixed_value<NRowsType>::value,
520 internal::get_fixed_value<NColsType>::value>::Type(derived(), rows() - internal::get_runtime_value(cRows), 0,
521 internal::get_runtime_value(cRows),
522 internal::get_runtime_value(cCols));
532EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
536template <
int CRows,
int CCols>
537EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE
typename FixedBlockXpr<CRows, CCols>::Type bottomLeftCorner() {
538 return typename FixedBlockXpr<CRows, CCols>::Type(derived(), rows() - CRows, 0);
542template <
int CRows,
int CCols>
543EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE
const typename ConstFixedBlockXpr<CRows, CCols>::Type bottomLeftCorner()
545 return typename ConstFixedBlockXpr<CRows, CCols>::Type(derived(), rows() - CRows, 0);
563EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
567template <
int CRows,
int CCols>
568EIGEN_STRONG_INLINE
typename FixedBlockXpr<CRows, CCols>::Type bottomLeftCorner(Index cRows, Index cCols) {
569 return typename FixedBlockXpr<CRows, CCols>::Type(derived(), rows() - cRows, 0, cRows, cCols);
573template <
int CRows,
int CCols>
574EIGEN_STRONG_INLINE
const typename ConstFixedBlockXpr<CRows, CCols>::Type bottomLeftCorner(Index cRows,
576 return typename ConstFixedBlockXpr<CRows, CCols>::Type(derived(), rows() - cRows, 0, cRows, cCols);
591EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row - major)
595template <
typename NRowsType>
596EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE
597#ifndef EIGEN_PARSED_BY_DOXYGEN
598 typename NRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
600 typename NRowsBlockXpr<...>::Type
602 topRows(NRowsType n) {
603 return typename NRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type(
604 derived(), 0, 0, internal::get_runtime_value(n), cols());
608template <
typename NRowsType>
609EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE
610#ifndef EIGEN_PARSED_BY_DOXYGEN
611 const typename ConstNRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
613 const typename ConstNRowsBlockXpr<...>::Type
615 topRows(NRowsType n)
const {
616 return typename ConstNRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type(
617 derived(), 0, 0, internal::get_runtime_value(n), cols());
631EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row - major)
636EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE
typename NRowsBlockXpr<N>::Type topRows(Index n = N) {
637 return typename NRowsBlockXpr<N>::Type(derived(), 0, 0, n, cols());
642EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE
typename ConstNRowsBlockXpr<N>::Type topRows(Index n = N)
const {
643 return typename ConstNRowsBlockXpr<N>::Type(derived(), 0, 0, n, cols());
658EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row - major)
662template <
typename NRowsType>
663EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE
664#ifndef EIGEN_PARSED_BY_DOXYGEN
665 typename NRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
667 typename NRowsBlockXpr<...>::Type
669 bottomRows(NRowsType n) {
670 return typename NRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type(
671 derived(), rows() - internal::get_runtime_value(n), 0, internal::get_runtime_value(n), cols());
675template <
typename NRowsType>
676EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE
677#ifndef EIGEN_PARSED_BY_DOXYGEN
678 const typename ConstNRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
680 const typename ConstNRowsBlockXpr<...>::Type
682 bottomRows(NRowsType n)
const {
683 return typename ConstNRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type(
684 derived(), rows() - internal::get_runtime_value(n), 0, internal::get_runtime_value(n), cols());
698EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row - major)
703EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE
typename NRowsBlockXpr<N>::Type bottomRows(Index n = N) {
704 return typename NRowsBlockXpr<N>::Type(derived(), rows() - n, 0, n, cols());
709EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE
typename ConstNRowsBlockXpr<N>::Type bottomRows(Index n = N)
const {
710 return typename ConstNRowsBlockXpr<N>::Type(derived(), rows() - n, 0, n, cols());
726EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row - major)
730template <
typename NRowsType>
731EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE
732#ifndef EIGEN_PARSED_BY_DOXYGEN
733 typename NRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
735 typename NRowsBlockXpr<...>::Type
737 middleRows(Index startRow, NRowsType n) {
738 return typename NRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type(
739 derived(), startRow, 0, internal::get_runtime_value(n), cols());
743template <
typename NRowsType>
744EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE
745#ifndef EIGEN_PARSED_BY_DOXYGEN
746 const typename ConstNRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
748 const typename ConstNRowsBlockXpr<...>::Type
750 middleRows(Index startRow, NRowsType n)
const {
751 return typename ConstNRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type(
752 derived(), startRow, 0, internal::get_runtime_value(n), cols());
767EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row - major)
772EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE
typename NRowsBlockXpr<N>::Type middleRows(Index startRow,
774 return typename NRowsBlockXpr<N>::Type(derived(), startRow, 0, n, cols());
779EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE
typename ConstNRowsBlockXpr<N>::Type middleRows(Index startRow,
781 return typename ConstNRowsBlockXpr<N>::Type(derived(), startRow, 0, n, cols());
796EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column - major)
800template <
typename NColsType>
801EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE
802#ifndef EIGEN_PARSED_BY_DOXYGEN
803 typename NColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
805 typename NColsBlockXpr<...>::Type
807 leftCols(NColsType n) {
808 return typename NColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type(derived(), 0, 0, rows(),
809 internal::get_runtime_value(n));
813template <
typename NColsType>
814EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE
815#ifndef EIGEN_PARSED_BY_DOXYGEN
816 const typename ConstNColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
818 const typename ConstNColsBlockXpr<...>::Type
820 leftCols(NColsType n)
const {
821 return typename ConstNColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type(derived(), 0, 0, rows(),
822 internal::get_runtime_value(n));
836EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column - major)
841EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE
typename NColsBlockXpr<N>::Type leftCols(Index n = N) {
842 return typename NColsBlockXpr<N>::Type(derived(), 0, 0, rows(), n);
847EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE
typename ConstNColsBlockXpr<N>::Type leftCols(Index n = N)
const {
848 return typename ConstNColsBlockXpr<N>::Type(derived(), 0, 0, rows(), n);
863EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column - major)
867template <
typename NColsType>
868EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE
869#ifndef EIGEN_PARSED_BY_DOXYGEN
870 typename NColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
872 typename NColsBlockXpr<...>::Type
874 rightCols(NColsType n) {
875 return typename NColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type(
876 derived(), 0, cols() - internal::get_runtime_value(n), rows(), internal::get_runtime_value(n));
880template <
typename NColsType>
881EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE
882#ifndef EIGEN_PARSED_BY_DOXYGEN
883 const typename ConstNColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
885 const typename ConstNColsBlockXpr<...>::Type
887 rightCols(NColsType n)
const {
888 return typename ConstNColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type(
889 derived(), 0, cols() - internal::get_runtime_value(n), rows(), internal::get_runtime_value(n));
903EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column - major)
908EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE
typename NColsBlockXpr<N>::Type rightCols(Index n = N) {
909 return typename NColsBlockXpr<N>::Type(derived(), 0, cols() - n, rows(), n);
914EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE
typename ConstNColsBlockXpr<N>::Type rightCols(Index n = N)
const {
915 return typename ConstNColsBlockXpr<N>::Type(derived(), 0, cols() - n, rows(), n);
931EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column - major)
935template <
typename NColsType>
936EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE
937#ifndef EIGEN_PARSED_BY_DOXYGEN
938 typename NColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
940 typename NColsBlockXpr<...>::Type
942 middleCols(Index startCol, NColsType numCols) {
943 return typename NColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type(
944 derived(), 0, startCol, rows(), internal::get_runtime_value(numCols));
948template <
typename NColsType>
949EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE
950#ifndef EIGEN_PARSED_BY_DOXYGEN
951 const typename ConstNColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
953 const typename ConstNColsBlockXpr<...>::Type
955 middleCols(Index startCol, NColsType numCols)
const {
956 return typename ConstNColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type(
957 derived(), 0, startCol, rows(), internal::get_runtime_value(numCols));
972EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column - major)
977EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE
typename NColsBlockXpr<N>::Type middleCols(Index startCol,
979 return typename NColsBlockXpr<N>::Type(derived(), 0, startCol, rows(), n);
984EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE
typename ConstNColsBlockXpr<N>::Type middleCols(Index startCol,
986 return typename ConstNColsBlockXpr<N>::Type(derived(), 0, startCol, rows(), n);
1009EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
1013template <
int NRows,
int NCols>
1014EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE
typename FixedBlockXpr<NRows, NCols>::Type block(Index startRow,
1016 return typename FixedBlockXpr<NRows, NCols>::Type(derived(), startRow, startCol);
1020template <
int NRows,
int NCols>
1021EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE
const typename ConstFixedBlockXpr<NRows, NCols>::Type block(
1022 Index startRow, Index startCol)
const {
1023 return typename ConstFixedBlockXpr<NRows, NCols>::Type(derived(), startRow, startCol);
1053EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
1057template <
int NRows,
int NCols>
1058EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE
typename FixedBlockXpr<NRows, NCols>::Type block(Index startRow,
1062 return typename FixedBlockXpr<NRows, NCols>::Type(derived(), startRow, startCol, blockRows, blockCols);
1066template <
int NRows,
int NCols>
1067EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE
const typename ConstFixedBlockXpr<NRows, NCols>::Type block(
1068 Index startRow, Index startCol, Index blockRows, Index blockCols)
const {
1069 return typename ConstFixedBlockXpr<NRows, NCols>::Type(derived(), startRow, startCol, blockRows, blockCols);
1077EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column - major)
1080EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE ColXpr col(Index i) {
return ColXpr(derived(), i); }
1083EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE ConstColXpr col(Index i)
const {
return ConstColXpr(derived(), i); }
1090EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row - major)
1093EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE RowXpr row(Index i) {
return RowXpr(derived(), i); }
1096EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE ConstRowXpr row(Index i)
const {
return ConstRowXpr(derived(), i); }
1119template <
typename NType>
1120EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE
1121#ifndef EIGEN_PARSED_BY_DOXYGEN
1122 typename FixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
1124 typename FixedSegmentReturnType<...>::Type
1126 segment(Index start, NType n) {
1127 EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
1128 return typename FixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type(derived(), start,
1129 internal::get_runtime_value(n));
1133template <
typename NType>
1134EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE
1135#ifndef EIGEN_PARSED_BY_DOXYGEN
1136 const typename ConstFixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
1138 const typename ConstFixedSegmentReturnType<...>::Type
1140 segment(Index start, NType n)
const {
1141 EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
1142 return typename ConstFixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type(
1143 derived(), start, internal::get_runtime_value(n));
1166template <
typename NType>
1167EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE
1168#ifndef EIGEN_PARSED_BY_DOXYGEN
1169 typename FixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
1171 typename FixedSegmentReturnType<...>::Type
1174 EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
1175 return typename FixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type(derived(), 0,
1176 internal::get_runtime_value(n));
1180template <
typename NType>
1181EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE
1182#ifndef EIGEN_PARSED_BY_DOXYGEN
1183 const typename ConstFixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
1185 const typename ConstFixedSegmentReturnType<...>::Type
1187 head(NType n)
const {
1188 EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
1189 return typename ConstFixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type(
1190 derived(), 0, internal::get_runtime_value(n));
1213template <
typename NType>
1214EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE
1215#ifndef EIGEN_PARSED_BY_DOXYGEN
1216 typename FixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
1218 typename FixedSegmentReturnType<...>::Type
1221 EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
1222 return typename FixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type(
1223 derived(), this->size() - internal::get_runtime_value(n), internal::get_runtime_value(n));
1227template <
typename NType>
1228EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE
1229#ifndef EIGEN_PARSED_BY_DOXYGEN
1230 const typename ConstFixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
1232 const typename ConstFixedSegmentReturnType<...>::Type
1234 tail(NType n)
const {
1235 EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
1236 return typename ConstFixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type(
1237 derived(), this->size() - internal::get_runtime_value(n), internal::get_runtime_value(n));
1257EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE
typename FixedSegmentReturnType<N>::Type segment(Index start,
1259 EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
1260 return typename FixedSegmentReturnType<N>::Type(derived(), start, n);
1265EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE
typename ConstFixedSegmentReturnType<N>::Type segment(
1266 Index start, Index n = N)
const {
1267 EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
1268 return typename ConstFixedSegmentReturnType<N>::Type(derived(), start, n);
1287EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE
typename FixedSegmentReturnType<N>::Type head(Index n = N) {
1288 EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
1289 return typename FixedSegmentReturnType<N>::Type(derived(), 0, n);
1294EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE
typename ConstFixedSegmentReturnType<N>::Type head(Index n = N)
const {
1295 EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
1296 return typename ConstFixedSegmentReturnType<N>::Type(derived(), 0, n);
1315EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE
typename FixedSegmentReturnType<N>::Type tail(Index n = N) {
1316 EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
1317 return typename FixedSegmentReturnType<N>::Type(derived(), size() - n, n);
1322EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE
typename ConstFixedSegmentReturnType<N>::Type tail(Index n = N)
const {
1323 EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
1324 return typename ConstFixedSegmentReturnType<N>::Type(derived(), size() - n, n);
1330EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE InnerVectorReturnType innerVector(Index outer) {
1331 return InnerVectorReturnType(derived(), outer);
1337EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE
const ConstInnerVectorReturnType innerVector(Index outer)
const {
1338 return ConstInnerVectorReturnType(derived(), outer);
1344EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE InnerVectorsReturnType innerVectors(Index outerStart, Index outerSize) {
1345 return InnerVectorsReturnType(derived(), IsRowMajor ? outerStart : 0, IsRowMajor ? 0 : outerStart,
1346 IsRowMajor ? outerSize : rows(), IsRowMajor ? cols() : outerSize);
1352EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE
const ConstInnerVectorsReturnType innerVectors(Index outerStart,
1353 Index outerSize)
const {
1354 return ConstInnerVectorsReturnType(derived(), IsRowMajor ? outerStart : 0, IsRowMajor ? 0 : outerStart,
1355 IsRowMajor ? outerSize : rows(), IsRowMajor ? cols() : outerSize);
1361template <DirectionType Direction>
1362EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE std::conditional_t<Direction == Vertical, ColXpr, RowXpr> subVector(
1364 return std::conditional_t<Direction == Vertical, ColXpr, RowXpr>(derived(), i);
1368template <DirectionType Direction>
1369EIGEN_DEVICE_FUNC
constexpr EIGEN_STRONG_INLINE std::conditional_t<Direction == Vertical, ConstColXpr, ConstRowXpr>
1370subVector(Index i)
const {
1371 return std::conditional_t<Direction == Vertical, ConstColXpr, ConstRowXpr>(derived(), i);
1377template <DirectionType Direction>
1378EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
constexpr Index subVectors()
const {
1379 return (Direction == Vertical) ? cols() : rows();