Eigen  3.3.90 (mercurial changeset b6d3e557dd16)
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
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 
43 #endif // not EIGEN_PARSED_BY_DOXYGEN
44 
77 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
81 template<typename NRowsType, typename NColsType>
82 EIGEN_DEVICE_FUNC
83 #ifndef EIGEN_PARSED_BY_DOXYGEN
84 inline typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
85 #else
86 inline typename FixedBlockXpr<...,...>::Type
87 #endif
88 block(Index startRow, Index startCol, NRowsType blockRows, NColsType blockCols)
89 {
90  return typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type(
91  derived(), startRow, startCol, internal::get_runtime_value(blockRows), internal::get_runtime_value(blockCols));
92 }
93 
95 template<typename NRowsType, typename NColsType>
96 EIGEN_DEVICE_FUNC
97 #ifndef EIGEN_PARSED_BY_DOXYGEN
98 inline const typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
99 #else
100 inline const typename ConstFixedBlockXpr<...,...>::Type
101 #endif
102 block(Index startRow, Index startCol, NRowsType blockRows, NColsType blockCols) const
103 {
104  return typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type(
105  derived(), startRow, startCol, internal::get_runtime_value(blockRows), internal::get_runtime_value(blockCols));
106 }
107 
108 
109 
123 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
127 template<typename NRowsType, typename NColsType>
128 EIGEN_DEVICE_FUNC
129 #ifndef EIGEN_PARSED_BY_DOXYGEN
130 inline typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
131 #else
132 inline typename FixedBlockXpr<...,...>::Type
133 #endif
134 topRightCorner(NRowsType cRows, NColsType cCols)
135 {
136  return typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
137  (derived(), 0, cols() - internal::get_runtime_value(cCols), internal::get_runtime_value(cRows), internal::get_runtime_value(cCols));
138 }
139 
141 template<typename NRowsType, typename NColsType>
142 EIGEN_DEVICE_FUNC
143 #ifndef EIGEN_PARSED_BY_DOXYGEN
144 inline const typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
145 #else
146 inline const typename ConstFixedBlockXpr<...,...>::Type
147 #endif
148 topRightCorner(NRowsType cRows, NColsType cCols) const
149 {
150  return typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
151  (derived(), 0, cols() - internal::get_runtime_value(cCols), internal::get_runtime_value(cRows), internal::get_runtime_value(cCols));
152 }
153 
162 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
166 template<int CRows, int CCols>
167 EIGEN_DEVICE_FUNC
168 inline typename FixedBlockXpr<CRows,CCols>::Type topRightCorner()
169 {
170  return typename FixedBlockXpr<CRows,CCols>::Type(derived(), 0, cols() - CCols);
171 }
172 
174 template<int CRows, int CCols>
175 EIGEN_DEVICE_FUNC
176 inline const typename ConstFixedBlockXpr<CRows,CCols>::Type topRightCorner() const
177 {
178  return typename ConstFixedBlockXpr<CRows,CCols>::Type(derived(), 0, cols() - CCols);
179 }
180 
196 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
200 template<int CRows, int CCols>
201 inline typename FixedBlockXpr<CRows,CCols>::Type topRightCorner(Index cRows, Index cCols)
202 {
203  return typename FixedBlockXpr<CRows,CCols>::Type(derived(), 0, cols() - cCols, cRows, cCols);
204 }
205 
207 template<int CRows, int CCols>
208 inline const typename ConstFixedBlockXpr<CRows,CCols>::Type topRightCorner(Index cRows, Index cCols) const
209 {
210  return typename ConstFixedBlockXpr<CRows,CCols>::Type(derived(), 0, cols() - cCols, cRows, cCols);
211 }
212 
213 
214 
228 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
232 template<typename NRowsType, typename NColsType>
233 EIGEN_DEVICE_FUNC
234 #ifndef EIGEN_PARSED_BY_DOXYGEN
235 inline typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
236 #else
237 inline typename FixedBlockXpr<...,...>::Type
238 #endif
239 topLeftCorner(NRowsType cRows, NColsType cCols)
240 {
241  return typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
242  (derived(), 0, 0, internal::get_runtime_value(cRows), internal::get_runtime_value(cCols));
243 }
244 
246 template<typename NRowsType, typename NColsType>
247 EIGEN_DEVICE_FUNC
248 #ifndef EIGEN_PARSED_BY_DOXYGEN
249 inline const typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
250 #else
251 inline const typename ConstFixedBlockXpr<...,...>::Type
252 #endif
253 topLeftCorner(NRowsType cRows, NColsType cCols) const
254 {
255  return typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
256  (derived(), 0, 0, internal::get_runtime_value(cRows), internal::get_runtime_value(cCols));
257 }
258 
266 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
270 template<int CRows, int CCols>
271 EIGEN_DEVICE_FUNC
272 inline typename FixedBlockXpr<CRows,CCols>::Type topLeftCorner()
273 {
274  return typename FixedBlockXpr<CRows,CCols>::Type(derived(), 0, 0);
275 }
276 
278 template<int CRows, int CCols>
279 EIGEN_DEVICE_FUNC
280 inline const typename ConstFixedBlockXpr<CRows,CCols>::Type topLeftCorner() const
281 {
282  return typename ConstFixedBlockXpr<CRows,CCols>::Type(derived(), 0, 0);
283 }
284 
300 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
304 template<int CRows, int CCols>
305 inline typename FixedBlockXpr<CRows,CCols>::Type topLeftCorner(Index cRows, Index cCols)
306 {
307  return typename FixedBlockXpr<CRows,CCols>::Type(derived(), 0, 0, cRows, cCols);
308 }
309 
311 template<int CRows, int CCols>
312 inline const typename ConstFixedBlockXpr<CRows,CCols>::Type topLeftCorner(Index cRows, Index cCols) const
313 {
314  return typename ConstFixedBlockXpr<CRows,CCols>::Type(derived(), 0, 0, cRows, cCols);
315 }
316 
317 
318 
332 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
336 template<typename NRowsType, typename NColsType>
337 EIGEN_DEVICE_FUNC
338 #ifndef EIGEN_PARSED_BY_DOXYGEN
339 inline typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
340 #else
341 inline typename FixedBlockXpr<...,...>::Type
342 #endif
343 bottomRightCorner(NRowsType cRows, NColsType cCols)
344 {
345  return typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
346  (derived(), rows() - internal::get_runtime_value(cRows), cols() - internal::get_runtime_value(cCols),
347  internal::get_runtime_value(cRows), internal::get_runtime_value(cCols));
348 }
349 
351 template<typename NRowsType, typename NColsType>
352 EIGEN_DEVICE_FUNC
353 #ifndef EIGEN_PARSED_BY_DOXYGEN
354 inline const typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
355 #else
356 inline const typename ConstFixedBlockXpr<...,...>::Type
357 #endif
358 bottomRightCorner(NRowsType cRows, NColsType cCols) const
359 {
360  return typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
361  (derived(), rows() - internal::get_runtime_value(cRows), cols() - internal::get_runtime_value(cCols),
362  internal::get_runtime_value(cRows), internal::get_runtime_value(cCols));
363 }
364 
372 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
376 template<int CRows, int CCols>
377 EIGEN_DEVICE_FUNC
378 inline typename FixedBlockXpr<CRows,CCols>::Type bottomRightCorner()
379 {
380  return typename FixedBlockXpr<CRows,CCols>::Type(derived(), rows() - CRows, cols() - CCols);
381 }
382 
384 template<int CRows, int CCols>
385 EIGEN_DEVICE_FUNC
386 inline const typename ConstFixedBlockXpr<CRows,CCols>::Type bottomRightCorner() const
387 {
388  return typename ConstFixedBlockXpr<CRows,CCols>::Type(derived(), rows() - CRows, cols() - CCols);
389 }
390 
406 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
410 template<int CRows, int CCols>
411 inline typename FixedBlockXpr<CRows,CCols>::Type bottomRightCorner(Index cRows, Index cCols)
412 {
413  return typename FixedBlockXpr<CRows,CCols>::Type(derived(), rows() - cRows, cols() - cCols, cRows, cCols);
414 }
415 
417 template<int CRows, int CCols>
418 inline const typename ConstFixedBlockXpr<CRows,CCols>::Type bottomRightCorner(Index cRows, Index cCols) const
419 {
420  return typename ConstFixedBlockXpr<CRows,CCols>::Type(derived(), rows() - cRows, cols() - cCols, cRows, cCols);
421 }
422 
423 
424 
438 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
442 template<typename NRowsType, typename NColsType>
443 EIGEN_DEVICE_FUNC
444 #ifndef EIGEN_PARSED_BY_DOXYGEN
445 inline typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
446 #else
447 inline typename FixedBlockXpr<...,...>::Type
448 #endif
449 bottomLeftCorner(NRowsType cRows, NColsType cCols)
450 {
451  return typename FixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
452  (derived(), rows() - internal::get_runtime_value(cRows), 0,
453  internal::get_runtime_value(cRows), internal::get_runtime_value(cCols));
454 }
455 
457 template<typename NRowsType, typename NColsType>
458 EIGEN_DEVICE_FUNC
459 #ifndef EIGEN_PARSED_BY_DOXYGEN
460 inline typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
461 #else
462 inline typename ConstFixedBlockXpr<...,...>::Type
463 #endif
464 bottomLeftCorner(NRowsType cRows, NColsType cCols) const
465 {
466  return typename ConstFixedBlockXpr<internal::get_fixed_value<NRowsType>::value,internal::get_fixed_value<NColsType>::value>::Type
467  (derived(), rows() - internal::get_runtime_value(cRows), 0,
468  internal::get_runtime_value(cRows), internal::get_runtime_value(cCols));
469 }
470 
478 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
482 template<int CRows, int CCols>
483 EIGEN_DEVICE_FUNC
484 inline typename FixedBlockXpr<CRows,CCols>::Type bottomLeftCorner()
485 {
486  return typename FixedBlockXpr<CRows,CCols>::Type(derived(), rows() - CRows, 0);
487 }
488 
490 template<int CRows, int CCols>
491 EIGEN_DEVICE_FUNC
492 inline const typename ConstFixedBlockXpr<CRows,CCols>::Type bottomLeftCorner() const
493 {
494  return typename ConstFixedBlockXpr<CRows,CCols>::Type(derived(), rows() - CRows, 0);
495 }
496 
512 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
516 template<int CRows, int CCols>
517 inline typename FixedBlockXpr<CRows,CCols>::Type bottomLeftCorner(Index cRows, Index cCols)
518 {
519  return typename FixedBlockXpr<CRows,CCols>::Type(derived(), rows() - cRows, 0, cRows, cCols);
520 }
521 
523 template<int CRows, int CCols>
524 inline const typename ConstFixedBlockXpr<CRows,CCols>::Type bottomLeftCorner(Index cRows, Index cCols) const
525 {
526  return typename ConstFixedBlockXpr<CRows,CCols>::Type(derived(), rows() - cRows, 0, cRows, cCols);
527 }
528 
529 
530 
543 EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row-major)
547 template<typename NRowsType>
548 EIGEN_DEVICE_FUNC
549 #ifndef EIGEN_PARSED_BY_DOXYGEN
550 inline typename NRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
551 #else
552 inline typename NRowsBlockXpr<...>::Type
553 #endif
554 topRows(NRowsType n)
555 {
556  return typename NRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
557  (derived(), 0, 0, internal::get_runtime_value(n), cols());
558 }
559 
561 template<typename NRowsType>
562 EIGEN_DEVICE_FUNC
563 #ifndef EIGEN_PARSED_BY_DOXYGEN
564 inline const typename ConstNRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
565 #else
566 inline const typename ConstNRowsBlockXpr<...>::Type
567 #endif
568 topRows(NRowsType n) const
569 {
570  return typename ConstNRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
571  (derived(), 0, 0, internal::get_runtime_value(n), cols());
572 }
573 
585 EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row-major)
589 template<int N>
590 EIGEN_DEVICE_FUNC
591 inline typename NRowsBlockXpr<N>::Type topRows(Index n = N)
592 {
593  return typename NRowsBlockXpr<N>::Type(derived(), 0, 0, n, cols());
594 }
595 
597 template<int N>
598 EIGEN_DEVICE_FUNC
599 inline typename ConstNRowsBlockXpr<N>::Type topRows(Index n = N) const
600 {
601  return typename ConstNRowsBlockXpr<N>::Type(derived(), 0, 0, n, cols());
602 }
603 
604 
605 
618 EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row-major)
622 template<typename NRowsType>
623 EIGEN_DEVICE_FUNC
624 #ifndef EIGEN_PARSED_BY_DOXYGEN
625 inline typename NRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
626 #else
627 inline typename NRowsBlockXpr<...>::Type
628 #endif
629 bottomRows(NRowsType n)
630 {
631  return typename NRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
632  (derived(), rows() - internal::get_runtime_value(n), 0, internal::get_runtime_value(n), cols());
633 }
634 
636 template<typename NRowsType>
637 EIGEN_DEVICE_FUNC
638 #ifndef EIGEN_PARSED_BY_DOXYGEN
639 inline const typename ConstNRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
640 #else
641 inline const typename ConstNRowsBlockXpr<...>::Type
642 #endif
643 bottomRows(NRowsType n) const
644 {
645  return typename ConstNRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
646  (derived(), rows() - internal::get_runtime_value(n), 0, internal::get_runtime_value(n), cols());
647 }
648 
660 EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row-major)
664 template<int N>
665 EIGEN_DEVICE_FUNC
666 inline typename NRowsBlockXpr<N>::Type bottomRows(Index n = N)
667 {
668  return typename NRowsBlockXpr<N>::Type(derived(), rows() - n, 0, n, cols());
669 }
670 
672 template<int N>
673 EIGEN_DEVICE_FUNC
674 inline typename ConstNRowsBlockXpr<N>::Type bottomRows(Index n = N) const
675 {
676  return typename ConstNRowsBlockXpr<N>::Type(derived(), rows() - n, 0, n, cols());
677 }
678 
679 
680 
694 EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row-major)
698 template<typename NRowsType>
699 EIGEN_DEVICE_FUNC
700 #ifndef EIGEN_PARSED_BY_DOXYGEN
701 inline typename NRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
702 #else
703 inline typename NRowsBlockXpr<...>::Type
704 #endif
705 middleRows(Index startRow, NRowsType n)
706 {
707  return typename NRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
708  (derived(), startRow, 0, internal::get_runtime_value(n), cols());
709 }
710 
712 template<typename NRowsType>
713 EIGEN_DEVICE_FUNC
714 #ifndef EIGEN_PARSED_BY_DOXYGEN
715 inline const typename ConstNRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
716 #else
717 inline const typename ConstNRowsBlockXpr<...>::Type
718 #endif
719 middleRows(Index startRow, NRowsType n) const
720 {
721  return typename ConstNRowsBlockXpr<internal::get_fixed_value<NRowsType>::value>::Type
722  (derived(), startRow, 0, internal::get_runtime_value(n), cols());
723 }
724 
737 EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row-major)
741 template<int N>
742 EIGEN_DEVICE_FUNC
743 inline typename NRowsBlockXpr<N>::Type middleRows(Index startRow, Index n = N)
744 {
745  return typename NRowsBlockXpr<N>::Type(derived(), startRow, 0, n, cols());
746 }
747 
749 template<int N>
750 EIGEN_DEVICE_FUNC
751 inline typename ConstNRowsBlockXpr<N>::Type middleRows(Index startRow, Index n = N) const
752 {
753  return typename ConstNRowsBlockXpr<N>::Type(derived(), startRow, 0, n, cols());
754 }
755 
756 
757 
770 EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column-major)
774 template<typename NColsType>
775 EIGEN_DEVICE_FUNC
776 #ifndef EIGEN_PARSED_BY_DOXYGEN
777 inline typename NColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
778 #else
779 inline typename NColsBlockXpr<...>::Type
780 #endif
781 leftCols(NColsType n)
782 {
783  return typename NColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
784  (derived(), 0, 0, rows(), internal::get_runtime_value(n));
785 }
786 
788 template<typename NColsType>
789 EIGEN_DEVICE_FUNC
790 #ifndef EIGEN_PARSED_BY_DOXYGEN
791 inline const typename ConstNColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
792 #else
793 inline const typename ConstNColsBlockXpr<...>::Type
794 #endif
795 leftCols(NColsType n) const
796 {
797  return typename ConstNColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
798  (derived(), 0, 0, rows(), internal::get_runtime_value(n));
799 }
800 
812 EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column-major)
816 template<int N>
817 EIGEN_DEVICE_FUNC
818 inline typename NColsBlockXpr<N>::Type leftCols(Index n = N)
819 {
820  return typename NColsBlockXpr<N>::Type(derived(), 0, 0, rows(), n);
821 }
822 
824 template<int N>
825 EIGEN_DEVICE_FUNC
826 inline typename ConstNColsBlockXpr<N>::Type leftCols(Index n = N) const
827 {
828  return typename ConstNColsBlockXpr<N>::Type(derived(), 0, 0, rows(), n);
829 }
830 
831 
832 
845 EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column-major)
849 template<typename NColsType>
850 EIGEN_DEVICE_FUNC
851 #ifndef EIGEN_PARSED_BY_DOXYGEN
852 inline typename NColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
853 #else
854 inline typename NColsBlockXpr<...>::Type
855 #endif
856 rightCols(NColsType n)
857 {
858  return typename NColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
859  (derived(), 0, cols() - internal::get_runtime_value(n), rows(), internal::get_runtime_value(n));
860 }
861 
863 template<typename NColsType>
864 EIGEN_DEVICE_FUNC
865 #ifndef EIGEN_PARSED_BY_DOXYGEN
866 inline const typename ConstNColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
867 #else
868 inline const typename ConstNColsBlockXpr<...>::Type
869 #endif
870 rightCols(NColsType n) const
871 {
872  return typename ConstNColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
873  (derived(), 0, cols() - internal::get_runtime_value(n), rows(), internal::get_runtime_value(n));
874 }
875 
887 EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column-major)
891 template<int N>
892 EIGEN_DEVICE_FUNC
893 inline typename NColsBlockXpr<N>::Type rightCols(Index n = N)
894 {
895  return typename NColsBlockXpr<N>::Type(derived(), 0, cols() - n, rows(), n);
896 }
897 
899 template<int N>
900 EIGEN_DEVICE_FUNC
901 inline typename ConstNColsBlockXpr<N>::Type rightCols(Index n = N) const
902 {
903  return typename ConstNColsBlockXpr<N>::Type(derived(), 0, cols() - n, rows(), n);
904 }
905 
906 
907 
921 EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column-major)
925 template<typename NColsType>
926 EIGEN_DEVICE_FUNC
927 #ifndef EIGEN_PARSED_BY_DOXYGEN
928 inline typename NColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
929 #else
930 inline typename NColsBlockXpr<...>::Type
931 #endif
932 middleCols(Index startCol, NColsType numCols)
933 {
934  return typename NColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
935  (derived(), 0, startCol, rows(), internal::get_runtime_value(numCols));
936 }
937 
939 template<typename NColsType>
940 EIGEN_DEVICE_FUNC
941 #ifndef EIGEN_PARSED_BY_DOXYGEN
942 inline const typename ConstNColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
943 #else
944 inline const typename ConstNColsBlockXpr<...>::Type
945 #endif
946 middleCols(Index startCol, NColsType numCols) const
947 {
948  return typename ConstNColsBlockXpr<internal::get_fixed_value<NColsType>::value>::Type
949  (derived(), 0, startCol, rows(), internal::get_runtime_value(numCols));
950 }
951 
964 EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column-major)
968 template<int N>
969 EIGEN_DEVICE_FUNC
970 inline typename NColsBlockXpr<N>::Type middleCols(Index startCol, Index n = N)
971 {
972  return typename NColsBlockXpr<N>::Type(derived(), 0, startCol, rows(), n);
973 }
974 
976 template<int N>
977 EIGEN_DEVICE_FUNC
978 inline typename ConstNColsBlockXpr<N>::Type middleCols(Index startCol, Index n = N) const
979 {
980  return typename ConstNColsBlockXpr<N>::Type(derived(), 0, startCol, rows(), n);
981 }
982 
983 
984 
1005 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
1009 template<int NRows, int NCols>
1010 EIGEN_DEVICE_FUNC
1011 inline typename FixedBlockXpr<NRows,NCols>::Type block(Index startRow, Index startCol)
1012 {
1013  return typename FixedBlockXpr<NRows,NCols>::Type(derived(), startRow, startCol);
1014 }
1015 
1017 template<int NRows, int NCols>
1018 EIGEN_DEVICE_FUNC
1019 inline const typename ConstFixedBlockXpr<NRows,NCols>::Type block(Index startRow, Index startCol) const
1020 {
1021  return typename ConstFixedBlockXpr<NRows,NCols>::Type(derived(), startRow, startCol);
1022 }
1023 
1051 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
1055 template<int NRows, int NCols>
1056 inline typename FixedBlockXpr<NRows,NCols>::Type block(Index startRow, Index startCol,
1057  Index blockRows, Index blockCols)
1058 {
1059  return typename FixedBlockXpr<NRows,NCols>::Type(derived(), startRow, startCol, blockRows, blockCols);
1060 }
1061 
1063 template<int NRows, int NCols>
1064 inline const typename ConstFixedBlockXpr<NRows,NCols>::Type block(Index startRow, Index startCol,
1065  Index blockRows, Index blockCols) const
1066 {
1067  return typename ConstFixedBlockXpr<NRows,NCols>::Type(derived(), startRow, startCol, blockRows, blockCols);
1068 }
1069 
1075 EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column-major)
1078 EIGEN_DEVICE_FUNC
1079 inline ColXpr col(Index i)
1080 {
1081  return ColXpr(derived(), i);
1082 }
1083 
1085 EIGEN_DEVICE_FUNC
1086 inline ConstColXpr col(Index i) const
1087 {
1088  return ConstColXpr(derived(), i);
1089 }
1090 
1096 EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row-major)
1099 EIGEN_DEVICE_FUNC
1100 inline RowXpr row(Index i)
1101 {
1102  return RowXpr(derived(), i);
1103 }
1104 
1106 EIGEN_DEVICE_FUNC
1107 inline ConstRowXpr row(Index i) const
1108 {
1109  return ConstRowXpr(derived(), i);
1110 }
1111 
1133 template<typename NType>
1134 EIGEN_DEVICE_FUNC
1135 #ifndef EIGEN_PARSED_BY_DOXYGEN
1136 inline typename FixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
1137 #else
1138 inline typename FixedSegmentReturnType<...>::Type
1139 #endif
1140 segment(Index start, NType n)
1141 {
1142  EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
1143  return typename FixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
1144  (derived(), start, internal::get_runtime_value(n));
1145 }
1146 
1147 
1149 template<typename NType>
1150 EIGEN_DEVICE_FUNC
1151 #ifndef EIGEN_PARSED_BY_DOXYGEN
1152 inline const typename ConstFixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
1153 #else
1154 inline const typename ConstFixedSegmentReturnType<...>::Type
1155 #endif
1156 segment(Index start, NType n) const
1157 {
1158  EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
1159  return typename ConstFixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
1160  (derived(), start, internal::get_runtime_value(n));
1161 }
1162 
1183 template<typename NType>
1184 EIGEN_DEVICE_FUNC
1185 #ifndef EIGEN_PARSED_BY_DOXYGEN
1186 inline typename FixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
1187 #else
1188 inline typename FixedSegmentReturnType<...>::Type
1189 #endif
1190 head(NType n)
1191 {
1192  EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
1193  return typename FixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
1194  (derived(), 0, internal::get_runtime_value(n));
1195 }
1196 
1198 template<typename NType>
1199 EIGEN_DEVICE_FUNC
1200 #ifndef EIGEN_PARSED_BY_DOXYGEN
1201 inline const typename ConstFixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
1202 #else
1203 inline const typename ConstFixedSegmentReturnType<...>::Type
1204 #endif
1205 head(NType n) const
1206 {
1207  EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
1208  return typename ConstFixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
1209  (derived(), 0, internal::get_runtime_value(n));
1210 }
1211 
1232 template<typename NType>
1233 EIGEN_DEVICE_FUNC
1234 #ifndef EIGEN_PARSED_BY_DOXYGEN
1235 inline typename FixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
1236 #else
1237 inline typename FixedSegmentReturnType<...>::Type
1238 #endif
1239 tail(NType n)
1240 {
1241  EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
1242  return typename FixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
1243  (derived(), this->size() - internal::get_runtime_value(n), internal::get_runtime_value(n));
1244 }
1245 
1247 template<typename NType>
1248 EIGEN_DEVICE_FUNC
1249 #ifndef EIGEN_PARSED_BY_DOXYGEN
1250 inline const typename ConstFixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
1251 #else
1252 inline const typename ConstFixedSegmentReturnType<...>::Type
1253 #endif
1254 tail(NType n) const
1255 {
1256  EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
1257  return typename ConstFixedSegmentReturnType<internal::get_fixed_value<NType>::value>::Type
1258  (derived(), this->size() - internal::get_runtime_value(n), internal::get_runtime_value(n));
1259 }
1260 
1277 template<int N>
1278 EIGEN_DEVICE_FUNC
1279 inline typename FixedSegmentReturnType<N>::Type segment(Index start, Index n = N)
1280 {
1281  EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
1282  return typename FixedSegmentReturnType<N>::Type(derived(), start, n);
1283 }
1284 
1286 template<int N>
1287 EIGEN_DEVICE_FUNC
1288 inline typename ConstFixedSegmentReturnType<N>::Type segment(Index start, Index n = N) const
1289 {
1290  EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
1291  return typename ConstFixedSegmentReturnType<N>::Type(derived(), start, n);
1292 }
1293 
1309 template<int N>
1310 EIGEN_DEVICE_FUNC
1311 inline typename FixedSegmentReturnType<N>::Type head(Index n = N)
1312 {
1313  EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
1314  return typename FixedSegmentReturnType<N>::Type(derived(), 0, n);
1315 }
1316 
1318 template<int N>
1319 EIGEN_DEVICE_FUNC
1320 inline typename ConstFixedSegmentReturnType<N>::Type head(Index n = N) const
1321 {
1322  EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
1323  return typename ConstFixedSegmentReturnType<N>::Type(derived(), 0, n);
1324 }
1325 
1341 template<int N>
1342 EIGEN_DEVICE_FUNC
1343 inline typename FixedSegmentReturnType<N>::Type tail(Index n = N)
1344 {
1345  EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
1346  return typename FixedSegmentReturnType<N>::Type(derived(), size() - n);
1347 }
1348 
1350 template<int N>
1351 EIGEN_DEVICE_FUNC
1352 inline typename ConstFixedSegmentReturnType<N>::Type tail(Index n = N) const
1353 {
1354  EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
1355  return typename ConstFixedSegmentReturnType<N>::Type(derived(), size() - n);
1356 }
const int Dynamic
Definition: Constants.h:21