From fe569b060c367d34c83624061fff407738609402 Mon Sep 17 00:00:00 2001 From: Benoit Jacob Date: Thu, 13 Mar 2008 20:36:01 +0000 Subject: get rid of MatrixRef, simplifications. --- Eigen/src/Core/Minor.h | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'Eigen/src/Core/Minor.h') diff --git a/Eigen/src/Core/Minor.h b/Eigen/src/Core/Minor.h index fbd6224aa..6c755bb74 100644 --- a/Eigen/src/Core/Minor.h +++ b/Eigen/src/Core/Minor.h @@ -60,9 +60,7 @@ template class Minor EIGEN_GENERIC_PUBLIC_INTERFACE(Minor) - typedef typename MatrixType::AsArg MatRef; - - Minor(const MatRef& matrix, + Minor(const MatrixType& matrix, int row, int col) : m_matrix(matrix), m_row(row), m_col(col) { @@ -74,13 +72,12 @@ template class Minor private: - const Minor& _asArg() const { return *this; } int _rows() const { return m_matrix.rows() - 1; } int _cols() const { return m_matrix.cols() - 1; } Scalar& _coeffRef(int row, int col) { - return m_matrix.coeffRef(row + (row >= m_row), col + (col >= m_col)); + return m_matrix.const_cast_derived().coeffRef(row + (row >= m_row), col + (col >= m_col)); } Scalar _coeff(int row, int col) const @@ -89,7 +86,7 @@ template class Minor } protected: - MatRef m_matrix; + const typename MatrixType::XprCopy m_matrix; const int m_row, m_col; }; @@ -106,7 +103,7 @@ template Minor MatrixBase::minor(int row, int col) { - return Minor(asArg(), row, col); + return Minor(derived(), row, col); } /** This is the const version of minor(). */ @@ -114,7 +111,7 @@ template const Minor MatrixBase::minor(int row, int col) const { - return Minor(asArg(), row, col); + return Minor(derived(), row, col); } #endif // EIGEN_MINOR_H -- cgit v1.2.3