Eigen  3.3.3
BlockMethods.h
00001 // This file is part of Eigen, a lightweight C++ template library
00002 // for linear algebra.
00003 //
00004 // Copyright (C) 2008-2010 Gael Guennebaud <gael.guennebaud@inria.fr>
00005 // Copyright (C) 2006-2010 Benoit Jacob <jacob.benoit.1@gmail.com>
00006 //
00007 // This Source Code Form is subject to the terms of the Mozilla
00008 // Public License v. 2.0. If a copy of the MPL was not distributed
00009 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
00010 
00011 #ifndef EIGEN_PARSED_BY_DOXYGEN
00012 
00014 typedef Block<Derived, internal::traits<Derived>::RowsAtCompileTime, 1, !IsRowMajor> ColXpr;
00015 typedef const Block<const Derived, internal::traits<Derived>::RowsAtCompileTime, 1, !IsRowMajor> ConstColXpr;
00017 typedef Block<Derived, 1, internal::traits<Derived>::ColsAtCompileTime, IsRowMajor> RowXpr;
00018 typedef const Block<const Derived, 1, internal::traits<Derived>::ColsAtCompileTime, IsRowMajor> ConstRowXpr;
00020 typedef Block<Derived, internal::traits<Derived>::RowsAtCompileTime, Dynamic, !IsRowMajor> ColsBlockXpr;
00021 typedef const Block<const Derived, internal::traits<Derived>::RowsAtCompileTime, Dynamic, !IsRowMajor> ConstColsBlockXpr;
00023 typedef Block<Derived, Dynamic, internal::traits<Derived>::ColsAtCompileTime, IsRowMajor> RowsBlockXpr;
00024 typedef const Block<const Derived, Dynamic, internal::traits<Derived>::ColsAtCompileTime, IsRowMajor> ConstRowsBlockXpr;
00026 template<int N> struct NColsBlockXpr { typedef Block<Derived, internal::traits<Derived>::RowsAtCompileTime, N, !IsRowMajor> Type; };
00027 template<int N> struct ConstNColsBlockXpr { typedef const Block<const Derived, internal::traits<Derived>::RowsAtCompileTime, N, !IsRowMajor> Type; };
00029 template<int N> struct NRowsBlockXpr { typedef Block<Derived, N, internal::traits<Derived>::ColsAtCompileTime, IsRowMajor> Type; };
00030 template<int N> struct ConstNRowsBlockXpr { typedef const Block<const Derived, N, internal::traits<Derived>::ColsAtCompileTime, IsRowMajor> Type; };
00032 typedef Block<Derived> BlockXpr;
00033 typedef const Block<const Derived> ConstBlockXpr;
00035 template<int Rows, int Cols> struct FixedBlockXpr { typedef Block<Derived,Rows,Cols> Type; };
00036 template<int Rows, int Cols> struct ConstFixedBlockXpr { typedef Block<const Derived,Rows,Cols> Type; };
00037 
00038 typedef VectorBlock<Derived> SegmentReturnType;
00039 typedef const VectorBlock<const Derived> ConstSegmentReturnType;
00040 template<int Size> struct FixedSegmentReturnType { typedef VectorBlock<Derived, Size> Type; };
00041 template<int Size> struct ConstFixedSegmentReturnType { typedef const VectorBlock<const Derived, Size> Type; };
00042 
00043 #endif // not EIGEN_PARSED_BY_DOXYGEN
00044 
00059 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
00063 EIGEN_DEVICE_FUNC
00064 inline BlockXpr block(Index startRow, Index startCol, Index blockRows, Index blockCols)
00065 {
00066   return BlockXpr(derived(), startRow, startCol, blockRows, blockCols);
00067 }
00068 
00070 EIGEN_DEVICE_FUNC
00071 inline const ConstBlockXpr block(Index startRow, Index startCol, Index blockRows, Index blockCols) const
00072 {
00073   return ConstBlockXpr(derived(), startRow, startCol, blockRows, blockCols);
00074 }
00075 
00076 
00077 
00078 
00087 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
00091 EIGEN_DEVICE_FUNC
00092 inline BlockXpr topRightCorner(Index cRows, Index cCols)
00093 {
00094   return BlockXpr(derived(), 0, cols() - cCols, cRows, cCols);
00095 }
00096 
00098 EIGEN_DEVICE_FUNC
00099 inline const ConstBlockXpr topRightCorner(Index cRows, Index cCols) const
00100 {
00101   return ConstBlockXpr(derived(), 0, cols() - cCols, cRows, cCols);
00102 }
00103 
00112 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
00116 template<int CRows, int CCols>
00117 EIGEN_DEVICE_FUNC
00118 inline typename FixedBlockXpr<CRows,CCols>::Type topRightCorner()
00119 {
00120   return typename FixedBlockXpr<CRows,CCols>::Type(derived(), 0, cols() - CCols);
00121 }
00122 
00124 template<int CRows, int CCols>
00125 EIGEN_DEVICE_FUNC
00126 inline const typename ConstFixedBlockXpr<CRows,CCols>::Type topRightCorner() const
00127 {
00128   return typename ConstFixedBlockXpr<CRows,CCols>::Type(derived(), 0, cols() - CCols);
00129 }
00130 
00146 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
00150 template<int CRows, int CCols>
00151 inline typename FixedBlockXpr<CRows,CCols>::Type topRightCorner(Index cRows, Index cCols)
00152 {
00153   return typename FixedBlockXpr<CRows,CCols>::Type(derived(), 0, cols() - cCols, cRows, cCols);
00154 }
00155 
00157 template<int CRows, int CCols>
00158 inline const typename ConstFixedBlockXpr<CRows,CCols>::Type topRightCorner(Index cRows, Index cCols) const
00159 {
00160   return typename ConstFixedBlockXpr<CRows,CCols>::Type(derived(), 0, cols() - cCols, cRows, cCols);
00161 }
00162 
00163 
00164 
00173 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
00177 EIGEN_DEVICE_FUNC
00178 inline BlockXpr topLeftCorner(Index cRows, Index cCols)
00179 {
00180   return BlockXpr(derived(), 0, 0, cRows, cCols);
00181 }
00182 
00184 EIGEN_DEVICE_FUNC
00185 inline const ConstBlockXpr topLeftCorner(Index cRows, Index cCols) const
00186 {
00187   return ConstBlockXpr(derived(), 0, 0, cRows, cCols);
00188 }
00189 
00197 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
00201 template<int CRows, int CCols>
00202 EIGEN_DEVICE_FUNC
00203 inline typename FixedBlockXpr<CRows,CCols>::Type topLeftCorner()
00204 {
00205   return typename FixedBlockXpr<CRows,CCols>::Type(derived(), 0, 0);
00206 }
00207 
00209 template<int CRows, int CCols>
00210 EIGEN_DEVICE_FUNC
00211 inline const typename ConstFixedBlockXpr<CRows,CCols>::Type topLeftCorner() const
00212 {
00213   return typename ConstFixedBlockXpr<CRows,CCols>::Type(derived(), 0, 0);
00214 }
00215 
00231 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
00235 template<int CRows, int CCols>
00236 inline typename FixedBlockXpr<CRows,CCols>::Type topLeftCorner(Index cRows, Index cCols)
00237 {
00238   return typename FixedBlockXpr<CRows,CCols>::Type(derived(), 0, 0, cRows, cCols);
00239 }
00240 
00242 template<int CRows, int CCols>
00243 inline const typename ConstFixedBlockXpr<CRows,CCols>::Type topLeftCorner(Index cRows, Index cCols) const
00244 {
00245   return typename ConstFixedBlockXpr<CRows,CCols>::Type(derived(), 0, 0, cRows, cCols);
00246 }
00247 
00248 
00249 
00258 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
00262 EIGEN_DEVICE_FUNC
00263 inline BlockXpr bottomRightCorner(Index cRows, Index cCols)
00264 {
00265   return BlockXpr(derived(), rows() - cRows, cols() - cCols, cRows, cCols);
00266 }
00267 
00269 EIGEN_DEVICE_FUNC
00270 inline const ConstBlockXpr bottomRightCorner(Index cRows, Index cCols) const
00271 {
00272   return ConstBlockXpr(derived(), rows() - cRows, cols() - cCols, cRows, cCols);
00273 }
00274 
00282 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
00286 template<int CRows, int CCols>
00287 EIGEN_DEVICE_FUNC
00288 inline typename FixedBlockXpr<CRows,CCols>::Type bottomRightCorner()
00289 {
00290   return typename FixedBlockXpr<CRows,CCols>::Type(derived(), rows() - CRows, cols() - CCols);
00291 }
00292 
00294 template<int CRows, int CCols>
00295 EIGEN_DEVICE_FUNC
00296 inline const typename ConstFixedBlockXpr<CRows,CCols>::Type bottomRightCorner() const
00297 {
00298   return typename ConstFixedBlockXpr<CRows,CCols>::Type(derived(), rows() - CRows, cols() - CCols);
00299 }
00300 
00316 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
00320 template<int CRows, int CCols>
00321 inline typename FixedBlockXpr<CRows,CCols>::Type bottomRightCorner(Index cRows, Index cCols)
00322 {
00323   return typename FixedBlockXpr<CRows,CCols>::Type(derived(), rows() - cRows, cols() - cCols, cRows, cCols);
00324 }
00325 
00327 template<int CRows, int CCols>
00328 inline const typename ConstFixedBlockXpr<CRows,CCols>::Type bottomRightCorner(Index cRows, Index cCols) const
00329 {
00330   return typename ConstFixedBlockXpr<CRows,CCols>::Type(derived(), rows() - cRows, cols() - cCols, cRows, cCols);
00331 }
00332 
00333 
00334 
00343 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
00347 EIGEN_DEVICE_FUNC
00348 inline BlockXpr bottomLeftCorner(Index cRows, Index cCols)
00349 {
00350   return BlockXpr(derived(), rows() - cRows, 0, cRows, cCols);
00351 }
00352 
00354 EIGEN_DEVICE_FUNC
00355 inline const ConstBlockXpr bottomLeftCorner(Index cRows, Index cCols) const
00356 {
00357   return ConstBlockXpr(derived(), rows() - cRows, 0, cRows, cCols);
00358 }
00359 
00367 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
00371 template<int CRows, int CCols>
00372 EIGEN_DEVICE_FUNC
00373 inline typename FixedBlockXpr<CRows,CCols>::Type bottomLeftCorner()
00374 {
00375   return typename FixedBlockXpr<CRows,CCols>::Type(derived(), rows() - CRows, 0);
00376 }
00377 
00379 template<int CRows, int CCols>
00380 EIGEN_DEVICE_FUNC
00381 inline const typename ConstFixedBlockXpr<CRows,CCols>::Type bottomLeftCorner() const
00382 {
00383   return typename ConstFixedBlockXpr<CRows,CCols>::Type(derived(), rows() - CRows, 0);
00384 }
00385 
00401 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
00405 template<int CRows, int CCols>
00406 inline typename FixedBlockXpr<CRows,CCols>::Type bottomLeftCorner(Index cRows, Index cCols)
00407 {
00408   return typename FixedBlockXpr<CRows,CCols>::Type(derived(), rows() - cRows, 0, cRows, cCols);
00409 }
00410 
00412 template<int CRows, int CCols>
00413 inline const typename ConstFixedBlockXpr<CRows,CCols>::Type bottomLeftCorner(Index cRows, Index cCols) const
00414 {
00415   return typename ConstFixedBlockXpr<CRows,CCols>::Type(derived(), rows() - cRows, 0, cRows, cCols);
00416 }
00417 
00418 
00419 
00427 EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row-major)
00431 EIGEN_DEVICE_FUNC
00432 inline RowsBlockXpr topRows(Index n)
00433 {
00434   return RowsBlockXpr(derived(), 0, 0, n, cols());
00435 }
00436 
00438 EIGEN_DEVICE_FUNC
00439 inline ConstRowsBlockXpr topRows(Index n) const
00440 {
00441   return ConstRowsBlockXpr(derived(), 0, 0, n, cols());
00442 }
00443 
00455 EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row-major)
00459 template<int N>
00460 EIGEN_DEVICE_FUNC
00461 inline typename NRowsBlockXpr<N>::Type topRows(Index n = N)
00462 {
00463   return typename NRowsBlockXpr<N>::Type(derived(), 0, 0, n, cols());
00464 }
00465 
00467 template<int N>
00468 EIGEN_DEVICE_FUNC
00469 inline typename ConstNRowsBlockXpr<N>::Type topRows(Index n = N) const
00470 {
00471   return typename ConstNRowsBlockXpr<N>::Type(derived(), 0, 0, n, cols());
00472 }
00473 
00474 
00475 
00483 EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row-major)
00487 EIGEN_DEVICE_FUNC
00488 inline RowsBlockXpr bottomRows(Index n)
00489 {
00490   return RowsBlockXpr(derived(), rows() - n, 0, n, cols());
00491 }
00492 
00494 EIGEN_DEVICE_FUNC
00495 inline ConstRowsBlockXpr bottomRows(Index n) const
00496 {
00497   return ConstRowsBlockXpr(derived(), rows() - n, 0, n, cols());
00498 }
00499 
00511 EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row-major)
00515 template<int N>
00516 EIGEN_DEVICE_FUNC
00517 inline typename NRowsBlockXpr<N>::Type bottomRows(Index n = N)
00518 {
00519   return typename NRowsBlockXpr<N>::Type(derived(), rows() - n, 0, n, cols());
00520 }
00521 
00523 template<int N>
00524 EIGEN_DEVICE_FUNC
00525 inline typename ConstNRowsBlockXpr<N>::Type bottomRows(Index n = N) const
00526 {
00527   return typename ConstNRowsBlockXpr<N>::Type(derived(), rows() - n, 0, n, cols());
00528 }
00529 
00530 
00531 
00540 EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row-major)
00544 EIGEN_DEVICE_FUNC
00545 inline RowsBlockXpr middleRows(Index startRow, Index n)
00546 {
00547   return RowsBlockXpr(derived(), startRow, 0, n, cols());
00548 }
00549 
00551 EIGEN_DEVICE_FUNC
00552 inline ConstRowsBlockXpr middleRows(Index startRow, Index n) const
00553 {
00554   return ConstRowsBlockXpr(derived(), startRow, 0, n, cols());
00555 }
00556 
00569 EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row-major)
00573 template<int N>
00574 EIGEN_DEVICE_FUNC
00575 inline typename NRowsBlockXpr<N>::Type middleRows(Index startRow, Index n = N)
00576 {
00577   return typename NRowsBlockXpr<N>::Type(derived(), startRow, 0, n, cols());
00578 }
00579 
00581 template<int N>
00582 EIGEN_DEVICE_FUNC
00583 inline typename ConstNRowsBlockXpr<N>::Type middleRows(Index startRow, Index n = N) const
00584 {
00585   return typename ConstNRowsBlockXpr<N>::Type(derived(), startRow, 0, n, cols());
00586 }
00587 
00588 
00589 
00597 EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column-major)
00601 EIGEN_DEVICE_FUNC
00602 inline ColsBlockXpr leftCols(Index n)
00603 {
00604   return ColsBlockXpr(derived(), 0, 0, rows(), n);
00605 }
00606 
00608 EIGEN_DEVICE_FUNC
00609 inline ConstColsBlockXpr leftCols(Index n) const
00610 {
00611   return ConstColsBlockXpr(derived(), 0, 0, rows(), n);
00612 }
00613 
00625 EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column-major)
00629 template<int N>
00630 EIGEN_DEVICE_FUNC
00631 inline typename NColsBlockXpr<N>::Type leftCols(Index n = N)
00632 {
00633   return typename NColsBlockXpr<N>::Type(derived(), 0, 0, rows(), n);
00634 }
00635 
00637 template<int N>
00638 EIGEN_DEVICE_FUNC
00639 inline typename ConstNColsBlockXpr<N>::Type leftCols(Index n = N) const
00640 {
00641   return typename ConstNColsBlockXpr<N>::Type(derived(), 0, 0, rows(), n);
00642 }
00643 
00644 
00645 
00653 EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column-major)
00657 EIGEN_DEVICE_FUNC
00658 inline ColsBlockXpr rightCols(Index n)
00659 {
00660   return ColsBlockXpr(derived(), 0, cols() - n, rows(), n);
00661 }
00662 
00664 EIGEN_DEVICE_FUNC
00665 inline ConstColsBlockXpr rightCols(Index n) const
00666 {
00667   return ConstColsBlockXpr(derived(), 0, cols() - n, rows(), n);
00668 }
00669 
00681 EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column-major)
00685 template<int N>
00686 EIGEN_DEVICE_FUNC
00687 inline typename NColsBlockXpr<N>::Type rightCols(Index n = N)
00688 {
00689   return typename NColsBlockXpr<N>::Type(derived(), 0, cols() - n, rows(), n);
00690 }
00691 
00693 template<int N>
00694 EIGEN_DEVICE_FUNC
00695 inline typename ConstNColsBlockXpr<N>::Type rightCols(Index n = N) const
00696 {
00697   return typename ConstNColsBlockXpr<N>::Type(derived(), 0, cols() - n, rows(), n);
00698 }
00699 
00700 
00701 
00710 EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column-major)
00714 EIGEN_DEVICE_FUNC
00715 inline ColsBlockXpr middleCols(Index startCol, Index numCols)
00716 {
00717   return ColsBlockXpr(derived(), 0, startCol, rows(), numCols);
00718 }
00719 
00721 EIGEN_DEVICE_FUNC
00722 inline ConstColsBlockXpr middleCols(Index startCol, Index numCols) const
00723 {
00724   return ConstColsBlockXpr(derived(), 0, startCol, rows(), numCols);
00725 }
00726 
00739 EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column-major)
00743 template<int N>
00744 EIGEN_DEVICE_FUNC
00745 inline typename NColsBlockXpr<N>::Type middleCols(Index startCol, Index n = N)
00746 {
00747   return typename NColsBlockXpr<N>::Type(derived(), 0, startCol, rows(), n);
00748 }
00749 
00751 template<int N>
00752 EIGEN_DEVICE_FUNC
00753 inline typename ConstNColsBlockXpr<N>::Type middleCols(Index startCol, Index n = N) const
00754 {
00755   return typename ConstNColsBlockXpr<N>::Type(derived(), 0, startCol, rows(), n);
00756 }
00757 
00758 
00759 
00774 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
00778 template<int NRows, int NCols>
00779 EIGEN_DEVICE_FUNC
00780 inline typename FixedBlockXpr<NRows,NCols>::Type block(Index startRow, Index startCol)
00781 {
00782   return typename FixedBlockXpr<NRows,NCols>::Type(derived(), startRow, startCol);
00783 }
00784 
00786 template<int NRows, int NCols>
00787 EIGEN_DEVICE_FUNC
00788 inline const typename ConstFixedBlockXpr<NRows,NCols>::Type block(Index startRow, Index startCol) const
00789 {
00790   return typename ConstFixedBlockXpr<NRows,NCols>::Type(derived(), startRow, startCol);
00791 }
00792 
00810 EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
00814 template<int NRows, int NCols>
00815 inline typename FixedBlockXpr<NRows,NCols>::Type block(Index startRow, Index startCol,
00816                                                   Index blockRows, Index blockCols)
00817 {
00818   return typename FixedBlockXpr<NRows,NCols>::Type(derived(), startRow, startCol, blockRows, blockCols);
00819 }
00820 
00822 template<int NRows, int NCols>
00823 inline const typename ConstFixedBlockXpr<NRows,NCols>::Type block(Index startRow, Index startCol,
00824                                                               Index blockRows, Index blockCols) const
00825 {
00826   return typename ConstFixedBlockXpr<NRows,NCols>::Type(derived(), startRow, startCol, blockRows, blockCols);
00827 }
00828 
00834 EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(column-major)
00837 EIGEN_DEVICE_FUNC
00838 inline ColXpr col(Index i)
00839 {
00840   return ColXpr(derived(), i);
00841 }
00842 
00844 EIGEN_DEVICE_FUNC
00845 inline ConstColXpr col(Index i) const
00846 {
00847   return ConstColXpr(derived(), i);
00848 }
00849 
00855 EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(row-major)
00858 EIGEN_DEVICE_FUNC
00859 inline RowXpr row(Index i)
00860 {
00861   return RowXpr(derived(), i);
00862 }
00863 
00865 EIGEN_DEVICE_FUNC
00866 inline ConstRowXpr row(Index i) const
00867 {
00868   return ConstRowXpr(derived(), i);
00869 }
00870 
00887 EIGEN_DEVICE_FUNC
00888 inline SegmentReturnType segment(Index start, Index n)
00889 {
00890   EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
00891   return SegmentReturnType(derived(), start, n);
00892 }
00893 
00894 
00896 EIGEN_DEVICE_FUNC
00897 inline ConstSegmentReturnType segment(Index start, Index n) const
00898 {
00899   EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
00900   return ConstSegmentReturnType(derived(), start, n);
00901 }
00902 
00918 EIGEN_DEVICE_FUNC
00919 inline SegmentReturnType head(Index n)
00920 {
00921   EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
00922   return SegmentReturnType(derived(), 0, n);
00923 }
00924 
00926 EIGEN_DEVICE_FUNC
00927 inline ConstSegmentReturnType head(Index n) const
00928 {
00929   EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
00930   return ConstSegmentReturnType(derived(), 0, n);
00931 }
00932 
00948 EIGEN_DEVICE_FUNC
00949 inline SegmentReturnType tail(Index n)
00950 {
00951   EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
00952   return SegmentReturnType(derived(), this->size() - n, n);
00953 }
00954 
00956 EIGEN_DEVICE_FUNC
00957 inline ConstSegmentReturnType tail(Index n) const
00958 {
00959   EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
00960   return ConstSegmentReturnType(derived(), this->size() - n, n);
00961 }
00962 
00979 template<int N>
00980 EIGEN_DEVICE_FUNC
00981 inline typename FixedSegmentReturnType<N>::Type segment(Index start, Index n = N)
00982 {
00983   EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
00984   return typename FixedSegmentReturnType<N>::Type(derived(), start, n);
00985 }
00986 
00988 template<int N>
00989 EIGEN_DEVICE_FUNC
00990 inline typename ConstFixedSegmentReturnType<N>::Type segment(Index start, Index n = N) const
00991 {
00992   EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
00993   return typename ConstFixedSegmentReturnType<N>::Type(derived(), start, n);
00994 }
00995 
01011 template<int N>
01012 EIGEN_DEVICE_FUNC
01013 inline typename FixedSegmentReturnType<N>::Type head(Index n = N)
01014 {
01015   EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
01016   return typename FixedSegmentReturnType<N>::Type(derived(), 0, n);
01017 }
01018 
01020 template<int N>
01021 EIGEN_DEVICE_FUNC
01022 inline typename ConstFixedSegmentReturnType<N>::Type head(Index n = N) const
01023 {
01024   EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
01025   return typename ConstFixedSegmentReturnType<N>::Type(derived(), 0, n);
01026 }
01027 
01043 template<int N>
01044 EIGEN_DEVICE_FUNC
01045 inline typename FixedSegmentReturnType<N>::Type tail(Index n = N)
01046 {
01047   EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
01048   return typename FixedSegmentReturnType<N>::Type(derived(), size() - n);
01049 }
01050 
01052 template<int N>
01053 EIGEN_DEVICE_FUNC
01054 inline typename ConstFixedSegmentReturnType<N>::Type tail(Index n = N) const
01055 {
01056   EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
01057   return typename ConstFixedSegmentReturnType<N>::Type(derived(), size() - n);
01058 }
 All Classes Functions Variables Typedefs Enumerations Enumerator Friends