Eigen  3.3.90 (mercurial changeset b7a5520e097f)
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 
14 typedef Block<Derived, internal::traits<Derived>::RowsAtCompileTime, 1, !IsRowMajor> ColXpr;
15 typedef const Block<const Derived, internal::traits<Derived>::RowsAtCompileTime, 1, !IsRowMajor> ConstColXpr;
17 typedef Block<Derived, 1, internal::traits<Derived>::ColsAtCompileTime, IsRowMajor> RowXpr;
18 typedef const Block<const Derived, 1, internal::traits<Derived>::ColsAtCompileTime, IsRowMajor> ConstRowXpr;
20 typedef Block<Derived, internal::traits<Derived>::RowsAtCompileTime, Dynamic, !IsRowMajor> ColsBlockXpr;
21 typedef const Block<const Derived, internal::traits<Derived>::RowsAtCompileTime, Dynamic, !IsRowMajor> ConstColsBlockXpr;
23 typedef Block<Derived, Dynamic, internal::traits<Derived>::ColsAtCompileTime, IsRowMajor> RowsBlockXpr;
24 typedef const Block<const Derived, Dynamic, internal::traits<Derived>::ColsAtCompileTime, IsRowMajor> ConstRowsBlockXpr;
26 template<int N> struct NColsBlockXpr { typedef Block<Derived, internal::traits<Derived>::RowsAtCompileTime, N, !IsRowMajor> Type; };
27 template<int N> struct ConstNColsBlockXpr { typedef const Block<const Derived, internal::traits<Derived>::RowsAtCompileTime, N, !IsRowMajor> Type; };
29 template<int N> struct NRowsBlockXpr { typedef Block<Derived, N, internal::traits<Derived>::ColsAtCompileTime, IsRowMajor> Type; };
30 template<int N> struct ConstNRowsBlockXpr { typedef const Block<const Derived, N, internal::traits<Derived>::ColsAtCompileTime, IsRowMajor> Type; };
32 typedef Block<Derived> BlockXpr;
33 typedef const Block<const Derived> ConstBlockXpr;
35 template<int Rows, int Cols> struct FixedBlockXpr { typedef Block<Derived,Rows,Cols> Type; };
36 template<int Rows, int Cols> struct ConstFixedBlockXpr { typedef Block<const Derived,Rows,Cols> Type; };
37 
38 typedef VectorBlock<Derived> SegmentReturnType;
39 typedef const VectorBlock<const Derived> ConstSegmentReturnType;
40 template<int Size> struct FixedSegmentReturnType { typedef VectorBlock<Derived, Size> Type; };
41 template<int Size> struct ConstFixedSegmentReturnType { typedef const VectorBlock<const Derived, Size> Type; };
42 
44 typedef Block<Derived,IsRowMajor?1:Dynamic,IsRowMajor?Dynamic:1,true> InnerVectorReturnType;
45 typedef Block<const Derived,IsRowMajor?1:Dynamic,IsRowMajor?Dynamic:1,true> ConstInnerVectorReturnType;
46 
48 typedef Block<Derived,Dynamic,Dynamic,true> InnerVectorsReturnType;
49 typedef Block<const Derived,Dynamic,Dynamic,true> ConstInnerVectorsReturnType;
50 
51 #endif // not EIGEN_PARSED_BY_DOXYGEN
52 
85 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
89 template<typename NRowsType, typename NColsType>
90 EIGEN_DEVICE_FUNC
91 #ifndef EIGEN_PARSED_BY_DOXYGEN
92 inline typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
93 #else
94 inline typename FixedBlockXpr<...,...>::Type
95 #endif
96 block(Index startRow, Index startCol, NRowsType blockRows, NColsType blockCols)
97 {
98  return typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type(
99  derived(), startRow, startCol, internal::get_runtime_value(blockRows), internal::get_runtime_value(blockCols));
100 }
101 
103 template<typename NRowsType, typename NColsType>
104 EIGEN_DEVICE_FUNC
105 #ifndef EIGEN_PARSED_BY_DOXYGEN
106 inline const typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
107 #else
108 inline const typename ConstFixedBlockXpr<...,...>::Type
109 #endif
110 block(Index startRow, Index startCol, NRowsType blockRows, NColsType blockCols) const
111 {
112  return typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type(
113  derived(), startRow, startCol, internal::get_runtime_value(blockRows), internal::get_runtime_value(blockCols));
114 }
115 
116 
117 
131 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
135 template<typename NRowsType, typename NColsType>
136 EIGEN_DEVICE_FUNC
137 #ifndef EIGEN_PARSED_BY_DOXYGEN
138 inline typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
139 #else
140 inline typename FixedBlockXpr<...,...>::Type
141 #endif
142 topRightCorner(NRowsType cRows, NColsType cCols)
143 {
144  return typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
145  (derived(), 0, cols() - internal::get_runtime_value(cCols), internal::get_runtime_value(cRows), internal::get_runtime_value(cCols));
146 }
147 
149 template<typename NRowsType, typename NColsType>
150 EIGEN_DEVICE_FUNC
151 #ifndef EIGEN_PARSED_BY_DOXYGEN
152 inline const typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
153 #else
154 inline const typename ConstFixedBlockXpr<...,...>::Type
155 #endif
156 topRightCorner(NRowsType cRows, NColsType cCols) const
157 {
158  return typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
159  (derived(), 0, cols() - internal::get_runtime_value(cCols), internal::get_runtime_value(cRows), internal::get_runtime_value(cCols));
160 }
161 
170 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
174 template<int CRows, int CCols>
175 EIGEN_DEVICE_FUNC
176 inline typename FixedBlockXpr<CRows,CCols>::Type topRightCorner()
177 {
178  return typename FixedBlockXpr<CRows,CCols>::Type(derived(), 0, cols() - CCols);
179 }
180 
182 template<int CRows, int CCols>
183 EIGEN_DEVICE_FUNC
184 inline const typename ConstFixedBlockXpr<CRows,CCols>::Type topRightCorner() const
185 {
186  return typename ConstFixedBlockXpr<CRows,CCols>::Type(derived(), 0, cols() - CCols);
187 }
188 
204 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
208 template<int CRows, int CCols>
209 inline typename FixedBlockXpr<CRows,CCols>::Type topRightCorner(Index cRows, Index cCols)
210 {
211  return typename FixedBlockXpr<CRows,CCols>::Type(derived(), 0, cols() - cCols, cRows, cCols);
212 }
213 
215 template<int CRows, int CCols>
216 inline const typename ConstFixedBlockXpr<CRows,CCols>::Type topRightCorner(Index cRows, Index cCols) const
217 {
218  return typename ConstFixedBlockXpr<CRows,CCols>::Type(derived(), 0, cols() - cCols, cRows, cCols);
219 }
220 
221 
222 
236 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
240 template<typename NRowsType, typename NColsType>
241 EIGEN_DEVICE_FUNC
242 #ifndef EIGEN_PARSED_BY_DOXYGEN
243 inline typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
244 #else
245 inline typename FixedBlockXpr<...,...>::Type
246 #endif
247 topLeftCorner(NRowsType cRows, NColsType cCols)
248 {
249  return typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
250  (derived(), 0, 0, internal::get_runtime_value(cRows), internal::get_runtime_value(cCols));
251 }
252 
254 template<typename NRowsType, typename NColsType>
255 EIGEN_DEVICE_FUNC
256 #ifndef EIGEN_PARSED_BY_DOXYGEN
257 inline const typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
258 #else
259 inline const typename ConstFixedBlockXpr<...,...>::Type
260 #endif
261 topLeftCorner(NRowsType cRows, NColsType cCols) const
262 {
263  return typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
264  (derived(), 0, 0, internal::get_runtime_value(cRows), internal::get_runtime_value(cCols));
265 }
266 
274 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
278 template<int CRows, int CCols>
279 EIGEN_DEVICE_FUNC
280 inline typename FixedBlockXpr<CRows,CCols>::Type topLeftCorner()
281 {
282  return typename FixedBlockXpr<CRows,CCols>::Type(derived(), 0, 0);
283 }
284 
286 template<int CRows, int CCols>
287 EIGEN_DEVICE_FUNC
288 inline const typename ConstFixedBlockXpr<CRows,CCols>::Type topLeftCorner() const
289 {
290  return typename ConstFixedBlockXpr<CRows,CCols>::Type(derived(), 0, 0);
291 }
292 
308 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
312 template<int CRows, int CCols>
313 inline typename FixedBlockXpr<CRows,CCols>::Type topLeftCorner(Index cRows, Index cCols)
314 {
315  return typename FixedBlockXpr<CRows,CCols>::Type(derived(), 0, 0, cRows, cCols);
316 }
317 
319 template<int CRows, int CCols>
320 inline const typename ConstFixedBlockXpr<CRows,CCols>::Type topLeftCorner(Index cRows, Index cCols) const
321 {
322  return typename ConstFixedBlockXpr<CRows,CCols>::Type(derived(), 0, 0, cRows, cCols);
323 }
324 
325 
326 
340 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
344 template<typename NRowsType, typename NColsType>
345 EIGEN_DEVICE_FUNC
346 #ifndef EIGEN_PARSED_BY_DOXYGEN
347 inline typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
348 #else
349 inline typename FixedBlockXpr<...,...>::Type
350 #endif
351 bottomRightCorner(NRowsType cRows, NColsType cCols)
352 {
353  return typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
354  (derived(), rows() - internal::get_runtime_value(cRows), cols() - internal::get_runtime_value(cCols),
355  internal::get_runtime_value(cRows), internal::get_runtime_value(cCols));
356 }
357 
359 template<typename NRowsType, typename NColsType>
360 EIGEN_DEVICE_FUNC
361 #ifndef EIGEN_PARSED_BY_DOXYGEN
362 inline const typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
363 #else
364 inline const typename ConstFixedBlockXpr<...,...>::Type
365 #endif
366 bottomRightCorner(NRowsType cRows, NColsType cCols) const
367 {
368  return typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
369  (derived(), rows() - internal::get_runtime_value(cRows), cols() - internal::get_runtime_value(cCols),
370  internal::get_runtime_value(cRows), internal::get_runtime_value(cCols));
371 }
372 
380 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
384 template<int CRows, int CCols>
385 EIGEN_DEVICE_FUNC
386 inline typename FixedBlockXpr<CRows,CCols>::Type bottomRightCorner()
387 {
388  return typename FixedBlockXpr<CRows,CCols>::Type(derived(), rows() - CRows, cols() - CCols);
389 }
390 
392 template<int CRows, int CCols>
393 EIGEN_DEVICE_FUNC
394 inline const typename ConstFixedBlockXpr<CRows,CCols>::Type bottomRightCorner() const
395 {
396  return typename ConstFixedBlockXpr<CRows,CCols>::Type(derived(), rows() - CRows, cols() - CCols);
397 }
398 
414 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
418 template<int CRows, int CCols>
419 inline typename FixedBlockXpr<CRows,CCols>::Type bottomRightCorner(Index cRows, Index cCols)
420 {
421  return typename FixedBlockXpr<CRows,CCols>::Type(derived(), rows() - cRows, cols() - cCols, cRows, cCols);
422 }
423 
425 template<int CRows, int CCols>
426 inline const typename ConstFixedBlockXpr<CRows,CCols>::Type bottomRightCorner(Index cRows, Index cCols) const
427 {
428  return typename ConstFixedBlockXpr<CRows,CCols>::Type(derived(), rows() - cRows, cols() - cCols, cRows, cCols);
429 }
430 
431 
432 
446 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
450 template<typename NRowsType, typename NColsType>
451 EIGEN_DEVICE_FUNC
452 #ifndef EIGEN_PARSED_BY_DOXYGEN
453 inline typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
454 #else
455 inline typename FixedBlockXpr<...,...>::Type
456 #endif
457 bottomLeftCorner(NRowsType cRows, NColsType cCols)
458 {
459  return typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
460  (derived(), rows() - internal::get_runtime_value(cRows), 0,
461  internal::get_runtime_value(cRows), internal::get_runtime_value(cCols));
462 }
463 
465 template<typename NRowsType, typename NColsType>
466 EIGEN_DEVICE_FUNC
467 #ifndef EIGEN_PARSED_BY_DOXYGEN
468 inline typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
469 #else
470 inline typename ConstFixedBlockXpr<...,...>::Type
471 #endif
472 bottomLeftCorner(NRowsType cRows, NColsType cCols) const
473 {
474  return typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
475  (derived(), rows() - internal::get_runtime_value(cRows), 0,
476  internal::get_runtime_value(cRows), internal::get_runtime_value(cCols));
477 }
478 
486 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
490 template<int CRows, int CCols>
491 EIGEN_DEVICE_FUNC
492 inline typename FixedBlockXpr<CRows,CCols>::Type bottomLeftCorner()
493 {
494  return typename FixedBlockXpr<CRows,CCols>::Type(derived(), rows() - CRows, 0);
495 }
496 
498 template<int CRows, int CCols>
499 EIGEN_DEVICE_FUNC
500 inline const typename ConstFixedBlockXpr<CRows,CCols>::Type bottomLeftCorner() const
501 {
502  return typename ConstFixedBlockXpr<CRows,CCols>::Type(derived(), rows() - CRows, 0);
503 }
504 
520 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
524 template<int CRows, int CCols>
525 inline typename FixedBlockXpr<CRows,CCols>::Type bottomLeftCorner(Index cRows, Index cCols)
526 {
527  return typename FixedBlockXpr<CRows,CCols>::Type(derived(), rows() - cRows, 0, cRows, cCols);
528 }
529 
531 template<int CRows, int CCols>
532 inline const typename ConstFixedBlockXpr<CRows,CCols>::Type bottomLeftCorner(Index cRows, Index cCols) const
533 {
534  return typename ConstFixedBlockXpr<CRows,CCols>::Type(derived(), rows() - cRows, 0, cRows, cCols);
535 }
536 
537 
538 
551 EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row-major)
555 template<typename NRowsType>
556 EIGEN_DEVICE_FUNC
557 #ifndef EIGEN_PARSED_BY_DOXYGEN
558 inline typename NRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
559 #else
560 inline typename NRowsBlockXpr<...>::Type
561 #endif
562 topRows(NRowsType n)
563 {
564  return typename NRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
565  (derived(), 0, 0, internal::get_runtime_value(n), cols());
566 }
567 
569 template<typename NRowsType>
570 EIGEN_DEVICE_FUNC
571 #ifndef EIGEN_PARSED_BY_DOXYGEN
572 inline const typename ConstNRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
573 #else
574 inline const typename ConstNRowsBlockXpr<...>::Type
575 #endif
576 topRows(NRowsType n) const
577 {
578  return typename ConstNRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
579  (derived(), 0, 0, internal::get_runtime_value(n), cols());
580 }
581 
593 EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row-major)
597 template<int N>
598 EIGEN_DEVICE_FUNC
599 inline typename NRowsBlockXpr<N>::Type topRows(Index n = N)
600 {
601  return typename NRowsBlockXpr<N>::Type(derived(), 0, 0, n, cols());
602 }
603 
605 template<int N>
606 EIGEN_DEVICE_FUNC
607 inline typename ConstNRowsBlockXpr<N>::Type topRows(Index n = N) const
608 {
609  return typename ConstNRowsBlockXpr<N>::Type(derived(), 0, 0, n, cols());
610 }
611 
612 
613 
626 EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row-major)
630 template<typename NRowsType>
631 EIGEN_DEVICE_FUNC
632 #ifndef EIGEN_PARSED_BY_DOXYGEN
633 inline typename NRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
634 #else
635 inline typename NRowsBlockXpr<...>::Type
636 #endif
637 bottomRows(NRowsType n)
638 {
639  return typename NRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
640  (derived(), rows() - internal::get_runtime_value(n), 0, internal::get_runtime_value(n), cols());
641 }
642 
644 template<typename NRowsType>
645 EIGEN_DEVICE_FUNC
646 #ifndef EIGEN_PARSED_BY_DOXYGEN
647 inline const typename ConstNRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
648 #else
649 inline const typename ConstNRowsBlockXpr<...>::Type
650 #endif
651 bottomRows(NRowsType n) const
652 {
653  return typename ConstNRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
654  (derived(), rows() - internal::get_runtime_value(n), 0, internal::get_runtime_value(n), cols());
655 }
656 
668 EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row-major)
672 template<int N>
673 EIGEN_DEVICE_FUNC
674 inline typename NRowsBlockXpr<N>::Type bottomRows(Index n = N)
675 {
676  return typename NRowsBlockXpr<N>::Type(derived(), rows() - n, 0, n, cols());
677 }
678 
680 template<int N>
681 EIGEN_DEVICE_FUNC
682 inline typename ConstNRowsBlockXpr<N>::Type bottomRows(Index n = N) const
683 {
684  return typename ConstNRowsBlockXpr<N>::Type(derived(), rows() - n, 0, n, cols());
685 }
686 
687 
688 
702 EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row-major)
706 template<typename NRowsType>
707 EIGEN_DEVICE_FUNC
708 #ifndef EIGEN_PARSED_BY_DOXYGEN
709 inline typename NRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
710 #else
711 inline typename NRowsBlockXpr<...>::Type
712 #endif
713 middleRows(Index startRow, NRowsType n)
714 {
715  return typename NRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
716  (derived(), startRow, 0, internal::get_runtime_value(n), cols());
717 }
718 
720 template<typename NRowsType>
721 EIGEN_DEVICE_FUNC
722 #ifndef EIGEN_PARSED_BY_DOXYGEN
723 inline const typename ConstNRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
724 #else
725 inline const typename ConstNRowsBlockXpr<...>::Type
726 #endif
727 middleRows(Index startRow, NRowsType n) const
728 {
729  return typename ConstNRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
730  (derived(), startRow, 0, internal::get_runtime_value(n), cols());
731 }
732 
745 EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row-major)
749 template<int N>
750 EIGEN_DEVICE_FUNC
751 inline typename NRowsBlockXpr<N>::Type middleRows(Index startRow, Index n = N)
752 {
753  return typename NRowsBlockXpr<N>::Type(derived(), startRow, 0, n, cols());
754 }
755 
757 template<int N>
758 EIGEN_DEVICE_FUNC
759 inline typename ConstNRowsBlockXpr<N>::Type middleRows(Index startRow, Index n = N) const
760 {
761  return typename ConstNRowsBlockXpr<N>::Type(derived(), startRow, 0, n, cols());
762 }
763 
764 
765 
778 EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column-major)
782 template<typename NColsType>
783 EIGEN_DEVICE_FUNC
784 #ifndef EIGEN_PARSED_BY_DOXYGEN
785 inline typename NColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
786 #else
787 inline typename NColsBlockXpr<...>::Type
788 #endif
789 leftCols(NColsType n)
790 {
791  return typename NColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
792  (derived(), 0, 0, rows(), internal::get_runtime_value(n));
793 }
794 
796 template<typename NColsType>
797 EIGEN_DEVICE_FUNC
798 #ifndef EIGEN_PARSED_BY_DOXYGEN
799 inline const typename ConstNColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
800 #else
801 inline const typename ConstNColsBlockXpr<...>::Type
802 #endif
803 leftCols(NColsType n) const
804 {
805  return typename ConstNColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
806  (derived(), 0, 0, rows(), internal::get_runtime_value(n));
807 }
808 
820 EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column-major)
824 template<int N>
825 EIGEN_DEVICE_FUNC
826 inline typename NColsBlockXpr<N>::Type leftCols(Index n = N)
827 {
828  return typename NColsBlockXpr<N>::Type(derived(), 0, 0, rows(), n);
829 }
830 
832 template<int N>
833 EIGEN_DEVICE_FUNC
834 inline typename ConstNColsBlockXpr<N>::Type leftCols(Index n = N) const
835 {
836  return typename ConstNColsBlockXpr<N>::Type(derived(), 0, 0, rows(), n);
837 }
838 
839 
840 
853 EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column-major)
857 template<typename NColsType>
858 EIGEN_DEVICE_FUNC
859 #ifndef EIGEN_PARSED_BY_DOXYGEN
860 inline typename NColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
861 #else
862 inline typename NColsBlockXpr<...>::Type
863 #endif
864 rightCols(NColsType n)
865 {
866  return typename NColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
867  (derived(), 0, cols() - internal::get_runtime_value(n), rows(), internal::get_runtime_value(n));
868 }
869 
871 template<typename NColsType>
872 EIGEN_DEVICE_FUNC
873 #ifndef EIGEN_PARSED_BY_DOXYGEN
874 inline const typename ConstNColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
875 #else
876 inline const typename ConstNColsBlockXpr<...>::Type
877 #endif
878 rightCols(NColsType n) const
879 {
880  return typename ConstNColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
881  (derived(), 0, cols() - internal::get_runtime_value(n), rows(), internal::get_runtime_value(n));
882 }
883 
895 EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column-major)
899 template<int N>
900 EIGEN_DEVICE_FUNC
901 inline typename NColsBlockXpr<N>::Type rightCols(Index n = N)
902 {
903  return typename NColsBlockXpr<N>::Type(derived(), 0, cols() - n, rows(), n);
904 }
905 
907 template<int N>
908 EIGEN_DEVICE_FUNC
909 inline typename ConstNColsBlockXpr<N>::Type rightCols(Index n = N) const
910 {
911  return typename ConstNColsBlockXpr<N>::Type(derived(), 0, cols() - n, rows(), n);
912 }
913 
914 
915 
929 EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column-major)
933 template<typename NColsType>
934 EIGEN_DEVICE_FUNC
935 #ifndef EIGEN_PARSED_BY_DOXYGEN
936 inline typename NColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
937 #else
938 inline typename NColsBlockXpr<...>::Type
939 #endif
940 middleCols(Index startCol, NColsType numCols)
941 {
942  return typename NColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
943  (derived(), 0, startCol, rows(), internal::get_runtime_value(numCols));
944 }
945 
947 template<typename NColsType>
948 EIGEN_DEVICE_FUNC
949 #ifndef EIGEN_PARSED_BY_DOXYGEN
950 inline const typename ConstNColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
951 #else
952 inline const typename ConstNColsBlockXpr<...>::Type
953 #endif
954 middleCols(Index startCol, NColsType numCols) const
955 {
956  return typename ConstNColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
957  (derived(), 0, startCol, rows(), internal::get_runtime_value(numCols));
958 }
959 
972 EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column-major)
976 template<int N>
977 EIGEN_DEVICE_FUNC
978 inline typename NColsBlockXpr<N>::Type middleCols(Index startCol, Index n = N)
979 {
980  return typename NColsBlockXpr<N>::Type(derived(), 0, startCol, rows(), n);
981 }
982 
984 template<int N>
985 EIGEN_DEVICE_FUNC
986 inline typename ConstNColsBlockXpr<N>::Type middleCols(Index startCol, Index n = N) const
987 {
988  return typename ConstNColsBlockXpr<N>::Type(derived(), 0, startCol, rows(), n);
989 }
990 
991 
992 
1013 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
1017 template<int NRows, int NCols>
1018 EIGEN_DEVICE_FUNC
1019 inline typename FixedBlockXpr<NRows,NCols>::Type block(Index startRow, Index startCol)
1020 {
1021  return typename FixedBlockXpr<NRows,NCols>::Type(derived(), startRow, startCol);
1022 }
1023 
1025 template<int NRows, int NCols>
1026 EIGEN_DEVICE_FUNC
1027 inline const typename ConstFixedBlockXpr<NRows,NCols>::Type block(Index startRow, Index startCol) const
1028 {
1029  return typename ConstFixedBlockXpr<NRows,NCols>::Type(derived(), startRow, startCol);
1030 }
1031 
1059 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
1063 template<int NRows, int NCols>
1064 EIGEN_DEVICE_FUNC
1065 inline typename FixedBlockXpr<NRows,NCols>::Type block(Index startRow, Index startCol,
1066  Index blockRows, Index blockCols)
1067 {
1068  return typename FixedBlockXpr<NRows,NCols>::Type(derived(), startRow, startCol, blockRows, blockCols);
1069 }
1070 
1072 template<int NRows, int NCols>
1073 inline const typename ConstFixedBlockXpr<NRows,NCols>::Type block(Index startRow, Index startCol,
1074  Index blockRows, Index blockCols) const
1075 {
1076  return typename ConstFixedBlockXpr<NRows,NCols>::Type(derived(), startRow, startCol, blockRows, blockCols);
1077 }
1078 
1084 EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column-major)
1087 EIGEN_DEVICE_FUNC
1088 inline ColXpr col(Index i)
1089 {
1090  return ColXpr(derived(), i);
1091 }
1092 
1094 EIGEN_DEVICE_FUNC
1095 inline ConstColXpr col(Index i) const
1096 {
1097  return ConstColXpr(derived(), i);
1098 }
1099 
1105 EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row-major)
1108 EIGEN_DEVICE_FUNC
1109 inline RowXpr row(Index i)
1110 {
1111  return RowXpr(derived(), i);
1112 }
1113 
1115 EIGEN_DEVICE_FUNC
1116 inline ConstRowXpr row(Index i) const
1117 {
1118  return ConstRowXpr(derived(), i);
1119 }
1120 
1142 template<typename NType>
1143 EIGEN_DEVICE_FUNC
1144 #ifndef EIGEN_PARSED_BY_DOXYGEN
1145 inline typename FixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
1146 #else
1147 inline typename FixedSegmentReturnType<...>::Type
1148 #endif
1149 segment(Index start, NType n)
1150 {
1151  EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
1152  return typename FixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
1153  (derived(), start, internal::get_runtime_value(n));
1154 }
1155 
1156 
1158 template<typename NType>
1159 EIGEN_DEVICE_FUNC
1160 #ifndef EIGEN_PARSED_BY_DOXYGEN
1161 inline const typename ConstFixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
1162 #else
1163 inline const typename ConstFixedSegmentReturnType<...>::Type
1164 #endif
1165 segment(Index start, NType n) const
1166 {
1167  EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
1168  return typename ConstFixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
1169  (derived(), start, internal::get_runtime_value(n));
1170 }
1171 
1192 template<typename NType>
1193 EIGEN_DEVICE_FUNC
1194 #ifndef EIGEN_PARSED_BY_DOXYGEN
1195 inline typename FixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
1196 #else
1197 inline typename FixedSegmentReturnType<...>::Type
1198 #endif
1199 head(NType n)
1200 {
1201  EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
1202  return typename FixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
1203  (derived(), 0, internal::get_runtime_value(n));
1204 }
1205 
1207 template<typename NType>
1208 EIGEN_DEVICE_FUNC
1209 #ifndef EIGEN_PARSED_BY_DOXYGEN
1210 inline const typename ConstFixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
1211 #else
1212 inline const typename ConstFixedSegmentReturnType<...>::Type
1213 #endif
1214 head(NType n) const
1215 {
1216  EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
1217  return typename ConstFixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
1218  (derived(), 0, internal::get_runtime_value(n));
1219 }
1220 
1241 template<typename NType>
1242 EIGEN_DEVICE_FUNC
1243 #ifndef EIGEN_PARSED_BY_DOXYGEN
1244 inline typename FixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
1245 #else
1246 inline typename FixedSegmentReturnType<...>::Type
1247 #endif
1248 tail(NType n)
1249 {
1250  EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
1251  return typename FixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
1252  (derived(), this->size() - internal::get_runtime_value(n), internal::get_runtime_value(n));
1253 }
1254 
1256 template<typename NType>
1257 EIGEN_DEVICE_FUNC
1258 #ifndef EIGEN_PARSED_BY_DOXYGEN
1259 inline const typename ConstFixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
1260 #else
1261 inline const typename ConstFixedSegmentReturnType<...>::Type
1262 #endif
1263 tail(NType n) const
1264 {
1265  EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
1266  return typename ConstFixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
1267  (derived(), this->size() - internal::get_runtime_value(n), internal::get_runtime_value(n));
1268 }
1269 
1286 template<int N>
1287 EIGEN_DEVICE_FUNC
1288 inline typename FixedSegmentReturnType<N>::Type segment(Index start, Index n = N)
1289 {
1290  EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
1291  return typename FixedSegmentReturnType<N>::Type(derived(), start, n);
1292 }
1293 
1295 template<int N>
1296 EIGEN_DEVICE_FUNC
1297 inline typename ConstFixedSegmentReturnType<N>::Type segment(Index start, Index n = N) const
1298 {
1299  EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
1300  return typename ConstFixedSegmentReturnType<N>::Type(derived(), start, n);
1301 }
1302 
1318 template<int N>
1319 EIGEN_DEVICE_FUNC
1320 inline typename FixedSegmentReturnType<N>::Type head(Index n = N)
1321 {
1322  EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
1323  return typename FixedSegmentReturnType<N>::Type(derived(), 0, n);
1324 }
1325 
1327 template<int N>
1328 EIGEN_DEVICE_FUNC
1329 inline typename ConstFixedSegmentReturnType<N>::Type head(Index n = N) const
1330 {
1331  EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
1332  return typename ConstFixedSegmentReturnType<N>::Type(derived(), 0, n);
1333 }
1334 
1350 template<int N>
1351 EIGEN_DEVICE_FUNC
1352 inline typename FixedSegmentReturnType<N>::Type tail(Index n = N)
1353 {
1354  EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
1355  return typename FixedSegmentReturnType<N>::Type(derived(), size() - n);
1356 }
1357 
1359 template<int N>
1360 EIGEN_DEVICE_FUNC
1361 inline typename ConstFixedSegmentReturnType<N>::Type tail(Index n = N) const
1362 {
1363  EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
1364  return typename ConstFixedSegmentReturnType<N>::Type(derived(), size() - n);
1365 }
1366 
1370 InnerVectorReturnType innerVector(Index outer)
1371 { return InnerVectorReturnType(derived(), outer); }
1372 
1376 const ConstInnerVectorReturnType innerVector(Index outer) const
1377 { return ConstInnerVectorReturnType(derived(), outer); }
1378 
1382 InnerVectorsReturnType
1383 innerVectors(Index outerStart, Index outerSize)
1384 {
1385  return Block<Derived,Dynamic,Dynamic,true>(derived(),
1386  IsRowMajor ? outerStart : 0, IsRowMajor ? 0 : outerStart,
1387  IsRowMajor ? outerSize : rows(), IsRowMajor ? cols() : outerSize);
1388 
1389 }
1390 
1394 const ConstInnerVectorsReturnType
1395 innerVectors(Index outerStart, Index outerSize) const
1396 {
1397  return Block<const Derived,Dynamic,Dynamic,true>(derived(),
1398  IsRowMajor ? outerStart : 0, IsRowMajor ? 0 : outerStart,
1399  IsRowMajor ? outerSize : rows(), IsRowMajor ? cols() : outerSize);
1400 
1401 }
const int Dynamic
Definition: Constants.h:21