mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
the Index types change.
As discussed on the list (too long to explain here).
This commit is contained in:
@@ -40,11 +40,11 @@
|
||||
* 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)
|
||||
* \sa class Block, block(Index,Index,Index,Index)
|
||||
*/
|
||||
template<typename Derived>
|
||||
inline Block<Derived> DenseBase<Derived>
|
||||
::corner(CornerType type, int cRows, int cCols)
|
||||
::corner(CornerType type, Index cRows, Index cCols)
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
@@ -61,10 +61,10 @@ inline Block<Derived> DenseBase<Derived>
|
||||
}
|
||||
}
|
||||
|
||||
/** This is the const version of corner(CornerType, int, int).*/
|
||||
/** This is the const version of corner(CornerType, Index, Index).*/
|
||||
template<typename Derived>
|
||||
inline const Block<Derived>
|
||||
DenseBase<Derived>::corner(CornerType type, int cRows, int cCols) const
|
||||
DenseBase<Derived>::corner(CornerType type, Index cRows, Index cCols) const
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
@@ -91,7 +91,7 @@ DenseBase<Derived>::corner(CornerType type, int cRows, int cCols) const
|
||||
* 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)
|
||||
* \sa class Block, block(Index,Index,Index,Index)
|
||||
*/
|
||||
template<typename Derived>
|
||||
template<int CRows, int CCols>
|
||||
|
||||
@@ -44,6 +44,7 @@ struct ei_traits<Minor<MatrixType> >
|
||||
{
|
||||
typedef typename ei_nested<MatrixType>::type MatrixTypeNested;
|
||||
typedef typename ei_unref<MatrixTypeNested>::type _MatrixTypeNested;
|
||||
typedef typename MatrixType::StorageKind StorageKind;
|
||||
enum {
|
||||
RowsAtCompileTime = (MatrixType::RowsAtCompileTime != Dynamic) ?
|
||||
int(MatrixType::RowsAtCompileTime) - 1 : Dynamic,
|
||||
@@ -68,7 +69,7 @@ template<typename MatrixType> class Minor
|
||||
EIGEN_DENSE_PUBLIC_INTERFACE(Minor)
|
||||
|
||||
inline Minor(const MatrixType& matrix,
|
||||
int row, int col)
|
||||
Index row, Index col)
|
||||
: m_matrix(matrix), m_row(row), m_col(col)
|
||||
{
|
||||
ei_assert(row >= 0 && row < matrix.rows()
|
||||
@@ -77,22 +78,22 @@ template<typename MatrixType> class Minor
|
||||
|
||||
EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Minor)
|
||||
|
||||
inline int rows() const { return m_matrix.rows() - 1; }
|
||||
inline int cols() const { return m_matrix.cols() - 1; }
|
||||
inline Index rows() const { return m_matrix.rows() - 1; }
|
||||
inline Index cols() const { return m_matrix.cols() - 1; }
|
||||
|
||||
inline Scalar& coeffRef(int row, int col)
|
||||
inline Scalar& coeffRef(Index row, Index col)
|
||||
{
|
||||
return m_matrix.const_cast_derived().coeffRef(row + (row >= m_row), col + (col >= m_col));
|
||||
}
|
||||
|
||||
inline const Scalar coeff(int row, int col) const
|
||||
inline const Scalar coeff(Index row, Index col) const
|
||||
{
|
||||
return m_matrix.coeff(row + (row >= m_row), col + (col >= m_col));
|
||||
}
|
||||
|
||||
protected:
|
||||
const typename MatrixType::Nested m_matrix;
|
||||
const int m_row, m_col;
|
||||
const Index m_row, m_col;
|
||||
};
|
||||
|
||||
/** \nonstableyet
|
||||
@@ -107,7 +108,7 @@ template<typename MatrixType> class Minor
|
||||
*/
|
||||
template<typename Derived>
|
||||
inline Minor<Derived>
|
||||
MatrixBase<Derived>::minor(int row, int col)
|
||||
MatrixBase<Derived>::minor(Index row, Index col)
|
||||
{
|
||||
return Minor<Derived>(derived(), row, col);
|
||||
}
|
||||
@@ -116,7 +117,7 @@ MatrixBase<Derived>::minor(int row, int col)
|
||||
* This is the const version of minor(). */
|
||||
template<typename Derived>
|
||||
inline const Minor<Derived>
|
||||
MatrixBase<Derived>::minor(int row, int col) const
|
||||
MatrixBase<Derived>::minor(Index row, Index col) const
|
||||
{
|
||||
return Minor<Derived>(derived(), row, col);
|
||||
}
|
||||
|
||||
@@ -26,37 +26,37 @@
|
||||
#ifndef EIGEN_VECTORBLOCK2_H
|
||||
#define EIGEN_VECTORBLOCK2_H
|
||||
|
||||
/** \deprecated use DenseMase::head(int) */
|
||||
/** \deprecated use DenseMase::head(Index) */
|
||||
template<typename Derived>
|
||||
inline VectorBlock<Derived>
|
||||
MatrixBase<Derived>::start(int size)
|
||||
MatrixBase<Derived>::start(Index size)
|
||||
{
|
||||
EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
|
||||
return VectorBlock<Derived>(derived(), 0, size);
|
||||
}
|
||||
|
||||
/** \deprecated use DenseMase::head(int) */
|
||||
/** \deprecated use DenseMase::head(Index) */
|
||||
template<typename Derived>
|
||||
inline const VectorBlock<Derived>
|
||||
MatrixBase<Derived>::start(int size) const
|
||||
MatrixBase<Derived>::start(Index size) const
|
||||
{
|
||||
EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
|
||||
return VectorBlock<Derived>(derived(), 0, size);
|
||||
}
|
||||
|
||||
/** \deprecated use DenseMase::tail(int) */
|
||||
/** \deprecated use DenseMase::tail(Index) */
|
||||
template<typename Derived>
|
||||
inline VectorBlock<Derived>
|
||||
MatrixBase<Derived>::end(int size)
|
||||
MatrixBase<Derived>::end(Index size)
|
||||
{
|
||||
EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
|
||||
return VectorBlock<Derived>(derived(), this->size() - size, size);
|
||||
}
|
||||
|
||||
/** \deprecated use DenseMase::tail(int) */
|
||||
/** \deprecated use DenseMase::tail(Index) */
|
||||
template<typename Derived>
|
||||
inline const VectorBlock<Derived>
|
||||
MatrixBase<Derived>::end(int size) const
|
||||
MatrixBase<Derived>::end(Index size) const
|
||||
{
|
||||
EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
|
||||
return VectorBlock<Derived>(derived(), this->size() - size, size);
|
||||
|
||||
Reference in New Issue
Block a user