11#ifndef EIGEN_BLOCKMETHODS_H
12#define EIGEN_BLOCKMETHODS_H
14#ifndef EIGEN_PARSED_BY_DOXYGEN
17typedef Block<Derived, internal::traits<Derived>::RowsAtCompileTime, 1, !IsRowMajor> ColXpr;
18typedef const Block<const Derived, internal::traits<Derived>::RowsAtCompileTime, 1, !IsRowMajor> ConstColXpr;
20typedef Block<Derived, 1, internal::traits<Derived>::ColsAtCompileTime, IsRowMajor> RowXpr;
21typedef const Block<const Derived, 1, internal::traits<Derived>::ColsAtCompileTime, IsRowMajor> ConstRowXpr;
23typedef Block<Derived, internal::traits<Derived>::RowsAtCompileTime, Dynamic, !IsRowMajor> ColsBlockXpr;
24typedef const Block<const Derived, internal::traits<Derived>::RowsAtCompileTime, Dynamic, !IsRowMajor> ConstColsBlockXpr;
26typedef Block<Derived, Dynamic, internal::traits<Derived>::ColsAtCompileTime, IsRowMajor> RowsBlockXpr;
27typedef const Block<const Derived, Dynamic, internal::traits<Derived>::ColsAtCompileTime, IsRowMajor> ConstRowsBlockXpr;
29template<
int N>
struct NColsBlockXpr {
typedef Block<Derived, internal::traits<Derived>::RowsAtCompileTime, N, !IsRowMajor> Type; };
30template<
int N>
struct ConstNColsBlockXpr {
typedef const Block<const Derived, internal::traits<Derived>::RowsAtCompileTime, N, !IsRowMajor> Type; };
32template<
int N>
struct NRowsBlockXpr {
typedef Block<Derived, N, internal::traits<Derived>::ColsAtCompileTime, IsRowMajor> Type; };
33template<
int N>
struct ConstNRowsBlockXpr {
typedef const Block<const Derived, N, internal::traits<Derived>::ColsAtCompileTime, IsRowMajor> Type; };
54inline Block<Derived> block(Index startRow, Index startCol, Index blockRows, Index blockCols)
56 return Block<Derived>(derived(), startRow, startCol, blockRows, blockCols);
60inline const Block<const Derived> block(Index startRow, Index startCol, Index blockRows, Index blockCols)
const
62 return Block<const Derived>(derived(), startRow, startCol, blockRows, blockCols);
78inline Block<Derived> topRightCorner(Index cRows, Index cCols)
80 return Block<Derived>(derived(), 0, cols() - cCols, cRows, cCols);
84inline const Block<const Derived> topRightCorner(Index cRows, Index cCols)
const
86 return Block<const Derived>(derived(), 0, cols() - cCols, cRows, cCols);
98template<
int CRows,
int CCols>
99inline Block<Derived, CRows, CCols> topRightCorner()
101 return Block<Derived, CRows, CCols>(derived(), 0, cols() - CCols);
105template<
int CRows,
int CCols>
106inline const Block<const Derived, CRows, CCols> topRightCorner()
const
108 return Block<const Derived, CRows, CCols>(derived(), 0, cols() - CCols);
124inline Block<Derived> topLeftCorner(Index cRows, Index cCols)
126 return Block<Derived>(derived(), 0, 0, cRows, cCols);
130inline const Block<const Derived> topLeftCorner(Index cRows, Index cCols)
const
132 return Block<const Derived>(derived(), 0, 0, cRows, cCols);
144template<
int CRows,
int CCols>
145inline Block<Derived, CRows, CCols> topLeftCorner()
147 return Block<Derived, CRows, CCols>(derived(), 0, 0);
151template<
int CRows,
int CCols>
152inline const Block<const Derived, CRows, CCols> topLeftCorner()
const
154 return Block<const Derived, CRows, CCols>(derived(), 0, 0);
169inline Block<Derived> bottomRightCorner(Index cRows, Index cCols)
171 return Block<Derived>(derived(), rows() - cRows, cols() - cCols, cRows, cCols);
175inline const Block<const Derived> bottomRightCorner(Index cRows, Index cCols)
const
177 return Block<const Derived>(derived(), rows() - cRows, cols() - cCols, cRows, cCols);
189template<
int CRows,
int CCols>
190inline Block<Derived, CRows, CCols> bottomRightCorner()
192 return Block<Derived, CRows, CCols>(derived(), rows() - CRows, cols() - CCols);
196template<
int CRows,
int CCols>
197inline const Block<const Derived, CRows, CCols> bottomRightCorner()
const
199 return Block<const Derived, CRows, CCols>(derived(), rows() - CRows, cols() - CCols);
214inline Block<Derived> bottomLeftCorner(Index cRows, Index cCols)
216 return Block<Derived>(derived(), rows() - cRows, 0, cRows, cCols);
220inline const Block<const Derived> bottomLeftCorner(Index cRows, Index cCols)
const
222 return Block<const Derived>(derived(), rows() - cRows, 0, cRows, cCols);
234template<
int CRows,
int CCols>
235inline Block<Derived, CRows, CCols> bottomLeftCorner()
237 return Block<Derived, CRows, CCols>(derived(), rows() - CRows, 0);
241template<
int CRows,
int CCols>
242inline const Block<const Derived, CRows, CCols> bottomLeftCorner()
const
244 return Block<const Derived, CRows, CCols>(derived(), rows() - CRows, 0);
258inline RowsBlockXpr topRows(Index n)
260 return RowsBlockXpr(derived(), 0, 0, n, cols());
264inline ConstRowsBlockXpr topRows(Index n)
const
266 return ConstRowsBlockXpr(derived(), 0, 0, n, cols());
279inline typename NRowsBlockXpr<N>::Type topRows()
281 return typename NRowsBlockXpr<N>::Type(derived(), 0, 0, N, cols());
286inline typename ConstNRowsBlockXpr<N>::Type topRows()
const
288 return typename ConstNRowsBlockXpr<N>::Type(derived(), 0, 0, N, cols());
302inline RowsBlockXpr bottomRows(Index n)
304 return RowsBlockXpr(derived(), rows() - n, 0, n, cols());
308inline ConstRowsBlockXpr bottomRows(Index n)
const
310 return ConstRowsBlockXpr(derived(), rows() - n, 0, n, cols());
323inline typename NRowsBlockXpr<N>::Type bottomRows()
325 return typename NRowsBlockXpr<N>::Type(derived(), rows() - N, 0, N, cols());
330inline typename ConstNRowsBlockXpr<N>::Type bottomRows()
const
332 return typename ConstNRowsBlockXpr<N>::Type(derived(), rows() - N, 0, N, cols());
347inline RowsBlockXpr middleRows(Index startRow, Index numRows)
349 return RowsBlockXpr(derived(), startRow, 0, numRows, cols());
353inline ConstRowsBlockXpr middleRows(Index startRow, Index numRows)
const
355 return ConstRowsBlockXpr(derived(), startRow, 0, numRows, cols());
369inline typename NRowsBlockXpr<N>::Type middleRows(Index startRow)
371 return typename NRowsBlockXpr<N>::Type(derived(), startRow, 0, N, cols());
376inline typename ConstNRowsBlockXpr<N>::Type middleRows(Index startRow)
const
378 return typename ConstNRowsBlockXpr<N>::Type(derived(), startRow, 0, N, cols());
392inline ColsBlockXpr leftCols(Index n)
394 return ColsBlockXpr(derived(), 0, 0, rows(), n);
398inline ConstColsBlockXpr leftCols(Index n)
const
400 return ConstColsBlockXpr(derived(), 0, 0, rows(), n);
413inline typename NColsBlockXpr<N>::Type leftCols()
415 return typename NColsBlockXpr<N>::Type(derived(), 0, 0, rows(), N);
420inline typename ConstNColsBlockXpr<N>::Type leftCols()
const
422 return typename ConstNColsBlockXpr<N>::Type(derived(), 0, 0, rows(), N);
436inline ColsBlockXpr rightCols(Index n)
438 return ColsBlockXpr(derived(), 0, cols() - n, rows(), n);
442inline ConstColsBlockXpr rightCols(Index n)
const
444 return ConstColsBlockXpr(derived(), 0, cols() - n, rows(), n);
457inline typename NColsBlockXpr<N>::Type rightCols()
459 return typename NColsBlockXpr<N>::Type(derived(), 0, cols() - N, rows(), N);
464inline typename ConstNColsBlockXpr<N>::Type rightCols()
const
466 return typename ConstNColsBlockXpr<N>::Type(derived(), 0, cols() - N, rows(), N);
481inline ColsBlockXpr middleCols(Index startCol, Index numCols)
483 return ColsBlockXpr(derived(), 0, startCol, rows(), numCols);
487inline ConstColsBlockXpr middleCols(Index startCol, Index numCols)
const
489 return ConstColsBlockXpr(derived(), 0, startCol, rows(), numCols);
503inline typename NColsBlockXpr<N>::Type middleCols(Index startCol)
505 return typename NColsBlockXpr<N>::Type(derived(), 0, startCol, rows(), N);
510inline typename ConstNColsBlockXpr<N>::Type middleCols(Index startCol)
const
512 return typename ConstNColsBlockXpr<N>::Type(derived(), 0, startCol, rows(), N);
533template<
int BlockRows,
int BlockCols>
534inline Block<Derived, BlockRows, BlockCols> block(Index startRow, Index startCol)
536 return Block<Derived, BlockRows, BlockCols>(derived(), startRow, startCol);
540template<
int BlockRows,
int BlockCols>
541inline const Block<const Derived, BlockRows, BlockCols> block(Index startRow, Index startCol)
const
543 return Block<const Derived, BlockRows, BlockCols>(derived(), startRow, startCol);
552inline ColXpr col(Index i)
554 return ColXpr(derived(), i);
558inline ConstColXpr col(Index i)
const
560 return ConstColXpr(derived(), i);
569inline RowXpr row(Index i)
571 return RowXpr(derived(), i);
575inline ConstRowXpr row(Index i)
const
577 return ConstRowXpr(derived(), i);