diff options
author | Benoit Jacob <jacob.benoit.1@gmail.com> | 2010-04-22 14:31:39 -0400 |
---|---|---|
committer | Benoit Jacob <jacob.benoit.1@gmail.com> | 2010-04-22 14:31:39 -0400 |
commit | bc22f4da9d9c5de308e3ab9ab71ae92928438edf (patch) | |
tree | 2fee152608590df29d530ff5bc8c4fad845f6bac /Eigen/src/Core/Block.h | |
parent | 00c716d20e138c5f849851c059a7e1c1ac6da8c6 (diff) |
* fix Eigen2Support, was not including VectorBlock.h
* move the corners support stuff to a new Block.h there
* expand the unit test
Diffstat (limited to 'Eigen/src/Core/Block.h')
-rw-r--r-- | Eigen/src/Core/Block.h | 112 |
1 files changed, 0 insertions, 112 deletions
diff --git a/Eigen/src/Core/Block.h b/Eigen/src/Core/Block.h index 32f4b0ab2..f339a301d 100644 --- a/Eigen/src/Core/Block.h +++ b/Eigen/src/Core/Block.h @@ -853,116 +853,4 @@ DenseBase<Derived>::row(int i) const return RowXpr(derived(), i); } -#ifdef EIGEN2_SUPPORT - -/** \returns a dynamic-size expression of a corner of *this. - * - * \param type the type of corner. Can be \a Eigen::TopLeft, \a Eigen::TopRight, - * \a Eigen::BottomLeft, \a Eigen::BottomRight. - * \param cRows the number of rows in the corner - * \param cCols the number of columns in the corner - * - * Example: \include MatrixBase_corner_enum_int_int.cpp - * Output: \verbinclude MatrixBase_corner_enum_int_int.out - * - * \note Even though the returned expression has dynamic size, in the case - * when it is applied to a fixed-size matrix, it inherits a fixed maximal size, - * which means that evaluating it does not cause a dynamic memory allocation. - * - * \sa class Block, block(int,int,int,int) - */ -template<typename Derived> -inline Block<Derived> DenseBase<Derived> - ::corner(CornerType type, int cRows, int cCols) -{ - switch(type) - { - default: - ei_assert(false && "Bad corner type."); - case TopLeft: - return Block<Derived>(derived(), 0, 0, cRows, cCols); - case TopRight: - return Block<Derived>(derived(), 0, cols() - cCols, cRows, cCols); - case BottomLeft: - return Block<Derived>(derived(), rows() - cRows, 0, cRows, cCols); - case BottomRight: - return Block<Derived>(derived(), rows() - cRows, cols() - cCols, cRows, cCols); - } -} - -/** This is the const version of corner(CornerType, int, int).*/ -template<typename Derived> -inline const Block<Derived> -DenseBase<Derived>::corner(CornerType type, int cRows, int cCols) const -{ - switch(type) - { - default: - ei_assert(false && "Bad corner type."); - case TopLeft: - return Block<Derived>(derived(), 0, 0, cRows, cCols); - case TopRight: - return Block<Derived>(derived(), 0, cols() - cCols, cRows, cCols); - case BottomLeft: - return Block<Derived>(derived(), rows() - cRows, 0, cRows, cCols); - case BottomRight: - return Block<Derived>(derived(), rows() - cRows, cols() - cCols, cRows, cCols); - } -} - -/** \returns a fixed-size expression of a corner of *this. - * - * \param type the type of corner. Can be \a Eigen::TopLeft, \a Eigen::TopRight, - * \a Eigen::BottomLeft, \a Eigen::BottomRight. - * - * The template parameters CRows and CCols arethe number of rows and columns in the corner. - * - * Example: \include MatrixBase_template_int_int_corner_enum.cpp - * Output: \verbinclude MatrixBase_template_int_int_corner_enum.out - * - * \sa class Block, block(int,int,int,int) - */ -template<typename Derived> -template<int CRows, int CCols> -inline Block<Derived, CRows, CCols> -DenseBase<Derived>::corner(CornerType type) -{ - switch(type) - { - default: - ei_assert(false && "Bad corner type."); - case TopLeft: - return Block<Derived, CRows, CCols>(derived(), 0, 0); - case TopRight: - return Block<Derived, CRows, CCols>(derived(), 0, cols() - CCols); - case BottomLeft: - return Block<Derived, CRows, CCols>(derived(), rows() - CRows, 0); - case BottomRight: - return Block<Derived, CRows, CCols>(derived(), rows() - CRows, cols() - CCols); - } -} - -/** This is the const version of corner<int, int>(CornerType).*/ -template<typename Derived> -template<int CRows, int CCols> -inline const Block<Derived, CRows, CCols> -DenseBase<Derived>::corner(CornerType type) const -{ - switch(type) - { - default: - ei_assert(false && "Bad corner type."); - case TopLeft: - return Block<Derived, CRows, CCols>(derived(), 0, 0); - case TopRight: - return Block<Derived, CRows, CCols>(derived(), 0, cols() - CCols); - case BottomLeft: - return Block<Derived, CRows, CCols>(derived(), rows() - CRows, 0); - case BottomRight: - return Block<Derived, CRows, CCols>(derived(), rows() - CRows, cols() - CCols); - } -} - -#endif // EIGEN2_SUPPORT - #endif // EIGEN_BLOCK_H |