Please, help us to better know about our user community by answering the following short survey: https://forms.gle/wpyrxWi18ox9Z5ae9
Eigen  3.4.0
 
Loading...
Searching...
No Matches
BlockMethods.h
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
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> ConstColsBlockXpr;
23typedef Block<Derived, Dynamic, internal::traits<Derived>::ColsAtCompileTime, IsRowMajor> RowsBlockXpr;
24typedef const Block<const Derived, Dynamic, internal::traits<Derived>::ColsAtCompileTime, IsRowMajor> ConstRowsBlockXpr;
26template<int N> struct NColsBlockXpr { typedef Block<Derived, internal::traits<Derived>::RowsAtCompileTime, N, !IsRowMajor> Type; };
27template<int N> struct ConstNColsBlockXpr { typedef const Block<const Derived, internal::traits<Derived>::RowsAtCompileTime, N, !IsRowMajor> Type; };
29template<int N> struct NRowsBlockXpr { typedef Block<Derived, N, internal::traits<Derived>::ColsAtCompileTime, IsRowMajor> Type; };
30template<int N> struct ConstNRowsBlockXpr { typedef const Block<const Derived, N, internal::traits<Derived>::ColsAtCompileTime, IsRowMajor> Type; };
32typedef Block<Derived> BlockXpr;
33typedef const Block<const Derived> ConstBlockXpr;
35template<int Rows, int Cols> struct FixedBlockXpr { typedef Block<Derived,Rows,Cols> Type; };
36template<int Rows, int Cols> struct ConstFixedBlockXpr { typedef Block<const Derived,Rows,Cols> Type; };
37
38typedef VectorBlock<Derived> SegmentReturnType;
39typedef const VectorBlock<const Derived> ConstSegmentReturnType;
40template<int Size> struct FixedSegmentReturnType { typedef VectorBlock<Derived, Size> Type; };
41template<int Size> struct ConstFixedSegmentReturnType { typedef const VectorBlock<const Derived, Size> Type; };
42
44typedef Block<Derived,IsRowMajor?1:Dynamic,IsRowMajor?Dynamic:1,true> InnerVectorReturnType;
45typedef Block<const Derived,IsRowMajor?1:Dynamic,IsRowMajor?Dynamic:1,true> ConstInnerVectorReturnType;
46
48typedef Block<Derived,Dynamic,Dynamic,true> InnerVectorsReturnType;
49typedef Block<const Derived,Dynamic,Dynamic,true> ConstInnerVectorsReturnType;
50
51#endif // not EIGEN_PARSED_BY_DOXYGEN
52
85EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
89template<typename NRowsType, typename NColsType>
90EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
91#ifndef EIGEN_PARSED_BY_DOXYGEN
92typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
93#else
94typename FixedBlockXpr<...,...>::Type
95#endif
96block(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
103template<typename NRowsType, typename NColsType>
104EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
105#ifndef EIGEN_PARSED_BY_DOXYGEN
106const typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
107#else
108const typename ConstFixedBlockXpr<...,...>::Type
109#endif
110block(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
131EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
135template<typename NRowsType, typename NColsType>
136EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
137#ifndef EIGEN_PARSED_BY_DOXYGEN
138typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
139#else
140typename FixedBlockXpr<...,...>::Type
141#endif
142topRightCorner(NRowsType cRows, NColsType cCols)
143{
144 return typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
145 (derived(), 0, cols() - internal::get_runtime_value(cCols), internal::get_runtime_value(cRows), internal::get_runtime_value(cCols));
146}
147
149template<typename NRowsType, typename NColsType>
150EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
151#ifndef EIGEN_PARSED_BY_DOXYGEN
152const typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
153#else
154const typename ConstFixedBlockXpr<...,...>::Type
155#endif
156topRightCorner(NRowsType cRows, NColsType cCols) const
157{
158 return typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
159 (derived(), 0, cols() - internal::get_runtime_value(cCols), internal::get_runtime_value(cRows), internal::get_runtime_value(cCols));
160}
161
170EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
174template<int CRows, int CCols>
175EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
176typename FixedBlockXpr<CRows,CCols>::Type topRightCorner()
177{
178 return typename FixedBlockXpr<CRows,CCols>::Type(derived(), 0, cols() - CCols);
179}
180
182template<int CRows, int CCols>
183EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
184const typename ConstFixedBlockXpr<CRows,CCols>::Type topRightCorner() const
185{
186 return typename ConstFixedBlockXpr<CRows,CCols>::Type(derived(), 0, cols() - CCols);
187}
188
204EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
208template<int CRows, int CCols>
209EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
210typename FixedBlockXpr<CRows,CCols>::Type topRightCorner(Index cRows, Index cCols)
211{
212 return typename FixedBlockXpr<CRows,CCols>::Type(derived(), 0, cols() - cCols, cRows, cCols);
213}
214
216template<int CRows, int CCols>
217EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
218const typename ConstFixedBlockXpr<CRows,CCols>::Type topRightCorner(Index cRows, Index cCols) const
219{
220 return typename ConstFixedBlockXpr<CRows,CCols>::Type(derived(), 0, cols() - cCols, cRows, cCols);
221}
222
223
224
238EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
242template<typename NRowsType, typename NColsType>
243EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
244#ifndef EIGEN_PARSED_BY_DOXYGEN
245typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
246#else
247typename FixedBlockXpr<...,...>::Type
248#endif
249topLeftCorner(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
256template<typename NRowsType, typename NColsType>
257EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
258#ifndef EIGEN_PARSED_BY_DOXYGEN
259const typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
260#else
261const typename ConstFixedBlockXpr<...,...>::Type
262#endif
263topLeftCorner(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
276EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
280template<int CRows, int CCols>
281EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
282typename FixedBlockXpr<CRows,CCols>::Type topLeftCorner()
283{
284 return typename FixedBlockXpr<CRows,CCols>::Type(derived(), 0, 0);
285}
286
288template<int CRows, int CCols>
289EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
290const typename ConstFixedBlockXpr<CRows,CCols>::Type topLeftCorner() const
291{
292 return typename ConstFixedBlockXpr<CRows,CCols>::Type(derived(), 0, 0);
293}
294
310EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
314template<int CRows, int CCols>
315EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
316typename FixedBlockXpr<CRows,CCols>::Type topLeftCorner(Index cRows, Index cCols)
317{
318 return typename FixedBlockXpr<CRows,CCols>::Type(derived(), 0, 0, cRows, cCols);
319}
320
322template<int CRows, int CCols>
323EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
324const typename ConstFixedBlockXpr<CRows,CCols>::Type topLeftCorner(Index cRows, Index cCols) const
325{
326 return typename ConstFixedBlockXpr<CRows,CCols>::Type(derived(), 0, 0, cRows, cCols);
327}
328
329
330
344EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
348template<typename NRowsType, typename NColsType>
349EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
350#ifndef EIGEN_PARSED_BY_DOXYGEN
351typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
352#else
353typename FixedBlockXpr<...,...>::Type
354#endif
355bottomRightCorner(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),
359 internal::get_runtime_value(cRows), internal::get_runtime_value(cCols));
360}
361
363template<typename NRowsType, typename NColsType>
364EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
365#ifndef EIGEN_PARSED_BY_DOXYGEN
366const typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
367#else
368const typename ConstFixedBlockXpr<...,...>::Type
369#endif
370bottomRightCorner(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),
374 internal::get_runtime_value(cRows), internal::get_runtime_value(cCols));
375}
376
384EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
388template<int CRows, int CCols>
389EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
390typename FixedBlockXpr<CRows,CCols>::Type bottomRightCorner()
391{
392 return typename FixedBlockXpr<CRows,CCols>::Type(derived(), rows() - CRows, cols() - CCols);
393}
394
396template<int CRows, int CCols>
397EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
398const typename ConstFixedBlockXpr<CRows,CCols>::Type bottomRightCorner() const
399{
400 return typename ConstFixedBlockXpr<CRows,CCols>::Type(derived(), rows() - CRows, cols() - CCols);
401}
402
418EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
422template<int CRows, int CCols>
423EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
424typename FixedBlockXpr<CRows,CCols>::Type bottomRightCorner(Index cRows, Index cCols)
425{
426 return typename FixedBlockXpr<CRows,CCols>::Type(derived(), rows() - cRows, cols() - cCols, cRows, cCols);
427}
428
430template<int CRows, int CCols>
431EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
432const typename ConstFixedBlockXpr<CRows,CCols>::Type bottomRightCorner(Index cRows, Index cCols) const
433{
434 return typename ConstFixedBlockXpr<CRows,CCols>::Type(derived(), rows() - cRows, cols() - cCols, cRows, cCols);
435}
436
437
438
452EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
456template<typename NRowsType, typename NColsType>
457EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
458#ifndef EIGEN_PARSED_BY_DOXYGEN
459typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
460#else
461typename FixedBlockXpr<...,...>::Type
462#endif
463bottomLeftCorner(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,
467 internal::get_runtime_value(cRows), internal::get_runtime_value(cCols));
468}
469
471template<typename NRowsType, typename NColsType>
472EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
473#ifndef EIGEN_PARSED_BY_DOXYGEN
474typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
475#else
476typename ConstFixedBlockXpr<...,...>::Type
477#endif
478bottomLeftCorner(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,
482 internal::get_runtime_value(cRows), internal::get_runtime_value(cCols));
483}
484
492EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
496template<int CRows, int CCols>
497EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
498typename FixedBlockXpr<CRows,CCols>::Type bottomLeftCorner()
499{
500 return typename FixedBlockXpr<CRows,CCols>::Type(derived(), rows() - CRows, 0);
501}
502
504template<int CRows, int CCols>
505EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
506const typename ConstFixedBlockXpr<CRows,CCols>::Type bottomLeftCorner() const
507{
508 return typename ConstFixedBlockXpr<CRows,CCols>::Type(derived(), rows() - CRows, 0);
509}
510
526EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
530template<int CRows, int CCols>
531EIGEN_STRONG_INLINE
532typename FixedBlockXpr<CRows,CCols>::Type bottomLeftCorner(Index cRows, Index cCols)
533{
534 return typename FixedBlockXpr<CRows,CCols>::Type(derived(), rows() - cRows, 0, cRows, cCols);
535}
536
538template<int CRows, int CCols>
539EIGEN_STRONG_INLINE
540const typename ConstFixedBlockXpr<CRows,CCols>::Type bottomLeftCorner(Index cRows, Index cCols) const
541{
542 return typename ConstFixedBlockXpr<CRows,CCols>::Type(derived(), rows() - cRows, 0, cRows, cCols);
543}
544
545
546
559EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row-major)
563template<typename NRowsType>
564EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
565#ifndef EIGEN_PARSED_BY_DOXYGEN
566typename NRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
567#else
568typename NRowsBlockXpr<...>::Type
569#endif
570topRows(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
577template<typename NRowsType>
578EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
579#ifndef EIGEN_PARSED_BY_DOXYGEN
580const typename ConstNRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
581#else
582const typename ConstNRowsBlockXpr<...>::Type
583#endif
584topRows(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
601EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row-major)
605template<int N>
606EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
607typename NRowsBlockXpr<N>::Type topRows(Index n = N)
608{
609 return typename NRowsBlockXpr<N>::Type(derived(), 0, 0, n, cols());
610}
611
613template<int N>
614EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
615typename ConstNRowsBlockXpr<N>::Type topRows(Index n = N) const
616{
617 return typename ConstNRowsBlockXpr<N>::Type(derived(), 0, 0, n, cols());
618}
619
620
621
634EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row-major)
638template<typename NRowsType>
639EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
640#ifndef EIGEN_PARSED_BY_DOXYGEN
641typename NRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
642#else
643typename NRowsBlockXpr<...>::Type
644#endif
645bottomRows(NRowsType n)
646{
647 return typename NRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
648 (derived(), rows() - internal::get_runtime_value(n), 0, internal::get_runtime_value(n), cols());
649}
650
652template<typename NRowsType>
653EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
654#ifndef EIGEN_PARSED_BY_DOXYGEN
655const typename ConstNRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
656#else
657const typename ConstNRowsBlockXpr<...>::Type
658#endif
659bottomRows(NRowsType n) const
660{
661 return typename ConstNRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
662 (derived(), rows() - internal::get_runtime_value(n), 0, internal::get_runtime_value(n), cols());
663}
664
676EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row-major)
680template<int N>
681EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
682typename NRowsBlockXpr<N>::Type bottomRows(Index n = N)
683{
684 return typename NRowsBlockXpr<N>::Type(derived(), rows() - n, 0, n, cols());
685}
686
688template<int N>
689EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
690typename ConstNRowsBlockXpr<N>::Type bottomRows(Index n = N) const
691{
692 return typename ConstNRowsBlockXpr<N>::Type(derived(), rows() - n, 0, n, cols());
693}
694
695
696
710EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row-major)
714template<typename NRowsType>
715EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
716#ifndef EIGEN_PARSED_BY_DOXYGEN
717typename NRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
718#else
719typename NRowsBlockXpr<...>::Type
720#endif
721middleRows(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
728template<typename NRowsType>
729EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
730#ifndef EIGEN_PARSED_BY_DOXYGEN
731const typename ConstNRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
732#else
733const typename ConstNRowsBlockXpr<...>::Type
734#endif
735middleRows(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
753EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row-major)
757template<int N>
758EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
759typename NRowsBlockXpr<N>::Type middleRows(Index startRow, Index n = N)
760{
761 return typename NRowsBlockXpr<N>::Type(derived(), startRow, 0, n, cols());
762}
763
765template<int N>
766EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
767typename 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
786EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column-major)
790template<typename NColsType>
791EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
792#ifndef EIGEN_PARSED_BY_DOXYGEN
793typename NColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
794#else
795typename NColsBlockXpr<...>::Type
796#endif
797leftCols(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
804template<typename NColsType>
805EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
806#ifndef EIGEN_PARSED_BY_DOXYGEN
807const typename ConstNColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
808#else
809const typename ConstNColsBlockXpr<...>::Type
810#endif
811leftCols(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
828EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column-major)
832template<int N>
833EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
834typename NColsBlockXpr<N>::Type leftCols(Index n = N)
835{
836 return typename NColsBlockXpr<N>::Type(derived(), 0, 0, rows(), n);
837}
838
840template<int N>
841EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
842typename ConstNColsBlockXpr<N>::Type leftCols(Index n = N) const
843{
844 return typename ConstNColsBlockXpr<N>::Type(derived(), 0, 0, rows(), n);
845}
846
847
848
861EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column-major)
865template<typename NColsType>
866EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
867#ifndef EIGEN_PARSED_BY_DOXYGEN
868typename NColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
869#else
870typename NColsBlockXpr<...>::Type
871#endif
872rightCols(NColsType n)
873{
874 return typename NColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
875 (derived(), 0, cols() - internal::get_runtime_value(n), rows(), internal::get_runtime_value(n));
876}
877
879template<typename NColsType>
880EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
881#ifndef EIGEN_PARSED_BY_DOXYGEN
882const typename ConstNColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
883#else
884const typename ConstNColsBlockXpr<...>::Type
885#endif
886rightCols(NColsType n) const
887{
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));
890}
891
903EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column-major)
907template<int N>
908EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
909typename NColsBlockXpr<N>::Type rightCols(Index n = N)
910{
911 return typename NColsBlockXpr<N>::Type(derived(), 0, cols() - n, rows(), n);
912}
913
915template<int N>
916EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
917typename ConstNColsBlockXpr<N>::Type rightCols(Index n = N) const
918{
919 return typename ConstNColsBlockXpr<N>::Type(derived(), 0, cols() - n, rows(), n);
920}
921
922
923
937EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column-major)
941template<typename NColsType>
942EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
943#ifndef EIGEN_PARSED_BY_DOXYGEN
944typename NColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
945#else
946typename NColsBlockXpr<...>::Type
947#endif
948middleCols(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
955template<typename NColsType>
956EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
957#ifndef EIGEN_PARSED_BY_DOXYGEN
958const typename ConstNColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
959#else
960const typename ConstNColsBlockXpr<...>::Type
961#endif
962middleCols(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
980EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column-major)
984template<int N>
985EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
986typename NColsBlockXpr<N>::Type middleCols(Index startCol, Index n = N)
987{
988 return typename NColsBlockXpr<N>::Type(derived(), 0, startCol, rows(), n);
989}
990
992template<int N>
993EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
994typename 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
1021EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
1025template<int NRows, int NCols>
1026EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1027typename FixedBlockXpr<NRows,NCols>::Type block(Index startRow, Index startCol)
1028{
1029 return typename FixedBlockXpr<NRows,NCols>::Type(derived(), startRow, startCol);
1030}
1031
1033template<int NRows, int NCols>
1034EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1035const typename ConstFixedBlockXpr<NRows,NCols>::Type block(Index startRow, Index startCol) const
1036{
1037 return typename ConstFixedBlockXpr<NRows,NCols>::Type(derived(), startRow, startCol);
1038}
1039
1067EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
1071template<int NRows, int NCols>
1072EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1073typename 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
1080template<int NRows, int NCols>
1081EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1082const 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
1093EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column-major)
1096EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1097ColXpr col(Index i)
1098{
1099 return ColXpr(derived(), i);
1100}
1101
1103EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1104ConstColXpr col(Index i) const
1105{
1106 return ConstColXpr(derived(), i);
1107}
1108
1114EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row-major)
1117EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1118RowXpr row(Index i)
1119{
1120 return RowXpr(derived(), i);
1121}
1122
1124EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1125ConstRowXpr row(Index i) const
1126{
1127 return ConstRowXpr(derived(), i);
1128}
1129
1151template<typename NType>
1152EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1153#ifndef EIGEN_PARSED_BY_DOXYGEN
1154typename FixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
1155#else
1156typename FixedSegmentReturnType<...>::Type
1157#endif
1158segment(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
1167template<typename NType>
1168EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1169#ifndef EIGEN_PARSED_BY_DOXYGEN
1170const typename ConstFixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
1171#else
1172const typename ConstFixedSegmentReturnType<...>::Type
1173#endif
1174segment(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
1201template<typename NType>
1202EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1203#ifndef EIGEN_PARSED_BY_DOXYGEN
1204typename FixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
1205#else
1206typename FixedSegmentReturnType<...>::Type
1207#endif
1208head(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
1216template<typename NType>
1217EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1218#ifndef EIGEN_PARSED_BY_DOXYGEN
1219const typename ConstFixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
1220#else
1221const typename ConstFixedSegmentReturnType<...>::Type
1222#endif
1223head(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
1250template<typename NType>
1251EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1252#ifndef EIGEN_PARSED_BY_DOXYGEN
1253typename FixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
1254#else
1255typename FixedSegmentReturnType<...>::Type
1256#endif
1257tail(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
1265template<typename NType>
1266EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1267#ifndef EIGEN_PARSED_BY_DOXYGEN
1268const typename ConstFixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
1269#else
1270const typename ConstFixedSegmentReturnType<...>::Type
1271#endif
1272tail(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
1295template<int N>
1296EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1297typename 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
1304template<int N>
1305EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1306typename 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
1327template<int N>
1328EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1329typename 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
1336template<int N>
1337EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1338typename 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
1359template<int N>
1360EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1361typename 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
1368template<int N>
1369EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1370typename 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
1379EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1380InnerVectorReturnType innerVector(Index outer)
1381{ return InnerVectorReturnType(derived(), outer); }
1382
1386EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1387const ConstInnerVectorReturnType innerVector(Index outer) const
1388{ return ConstInnerVectorReturnType(derived(), outer); }
1389
1393EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1394InnerVectorsReturnType
1395innerVectors(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
1406EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1407const ConstInnerVectorsReturnType
1408innerVectors(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
1419template<DirectionType Direction>
1420EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1421typename internal::conditional<Direction==Vertical,ColXpr,RowXpr>::type
1422subVector(Index i)
1423{
1424 return typename internal::conditional<Direction==Vertical,ColXpr,RowXpr>::type(derived(),i);
1425}
1426
1428template<DirectionType Direction>
1429EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
1430typename internal::conditional<Direction==Vertical,ConstColXpr,ConstRowXpr>::type
1431subVector(Index i) const
1432{
1433 return typename internal::conditional<Direction==Vertical,ConstColXpr,ConstRowXpr>::type(derived(),i);
1434}
1435
1439template<DirectionType Direction>
1440EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR
1441Index subVectors() const
1442{ return (Direction==Vertical)?cols():rows(); }
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:74
const int Dynamic
Definition: Constants.h:22