This bugzilla service is closed. All entries have been migrated to https://gitlab.com/libeigen/eigen
View | Details | Raw Unified | Return to bug 1516 | Differences between
and this patch

Collapse All | Expand All

(-)a/Eigen/src/Core/Diagonal.h (-1 / +3 lines)
Lines 65-81 template<typename MatrixType, int _DiagI Link Here
65
{
65
{
66
  public:
66
  public:
67
67
68
    enum { DiagIndex = _DiagIndex };
68
    enum { DiagIndex = _DiagIndex };
69
    typedef typename internal::dense_xpr_base<Diagonal>::type Base;
69
    typedef typename internal::dense_xpr_base<Diagonal>::type Base;
70
    EIGEN_DENSE_PUBLIC_INTERFACE(Diagonal)
70
    EIGEN_DENSE_PUBLIC_INTERFACE(Diagonal)
71
71
72
    EIGEN_DEVICE_FUNC
72
    EIGEN_DEVICE_FUNC
73
    explicit inline Diagonal(MatrixType& matrix, Index a_index = DiagIndex) : m_matrix(matrix), m_index(a_index) {}
73
    explicit inline Diagonal(MatrixType& matrix, Index a_index = DiagIndex) : m_matrix(matrix), m_index(a_index) {
74
      eigen_assert(a_index <= this->cols() &&  (-a_index) <= this->rows());
75
    }
74
76
75
    EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Diagonal)
77
    EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Diagonal)
76
78
77
    EIGEN_DEVICE_FUNC
79
    EIGEN_DEVICE_FUNC
78
    inline Index rows() const
80
    inline Index rows() const
79
    {
81
    {
80
      return m_index.value()<0 ? numext::mini<Index>(m_matrix.cols(),m_matrix.rows()+m_index.value())
82
      return m_index.value()<0 ? numext::mini<Index>(m_matrix.cols(),m_matrix.rows()+m_index.value())
81
                               : numext::mini<Index>(m_matrix.rows(),m_matrix.cols()-m_index.value());
83
                               : numext::mini<Index>(m_matrix.rows(),m_matrix.cols()-m_index.value());

Return to bug 1516