diff --git a/Eigen/src/Eigenvalues/Tridiagonalization.h b/Eigen/src/Eigenvalues/Tridiagonalization.h index 755bca1aa..ae4cdce7a 100644 --- a/Eigen/src/Eigenvalues/Tridiagonalization.h +++ b/Eigen/src/Eigenvalues/Tridiagonalization.h @@ -97,15 +97,15 @@ template class Tridiagonalization typedef internal::TridiagonalizationMatrixTReturnType MatrixTReturnType; typedef typename internal::conditional::IsComplex, - typename Diagonal::RealReturnType, - Diagonal + const typename Diagonal::RealReturnType, + const Diagonal >::type DiagonalReturnType; typedef typename internal::conditional::IsComplex, - typename Diagonal< - Block,0 >::RealReturnType, - Diagonal< - Block,0 > + const typename Diagonal< + Block >::RealReturnType, + const Diagonal< + Block > >::type SubDiagonalReturnType; /** \brief Return type of matrixQ() */ @@ -292,7 +292,7 @@ template class Tridiagonalization * * \sa matrixT(), subDiagonal() */ - const DiagonalReturnType diagonal() const; + DiagonalReturnType diagonal() const; /** \brief Returns the subdiagonal of the tridiagonal matrix T in the decomposition. * @@ -304,7 +304,7 @@ template class Tridiagonalization * * \sa diagonal() for an example, matrixT() */ - const SubDiagonalReturnType subDiagonal() const; + SubDiagonalReturnType subDiagonal() const; protected: @@ -314,7 +314,7 @@ template class Tridiagonalization }; template -const typename Tridiagonalization::DiagonalReturnType +typename Tridiagonalization::DiagonalReturnType Tridiagonalization::diagonal() const { eigen_assert(m_isInitialized && "Tridiagonalization is not initialized."); @@ -322,12 +322,12 @@ Tridiagonalization::diagonal() const } template -const typename Tridiagonalization::SubDiagonalReturnType +typename Tridiagonalization::SubDiagonalReturnType Tridiagonalization::subDiagonal() const { eigen_assert(m_isInitialized && "Tridiagonalization is not initialized."); Index n = m_matrix.rows(); - return Block(m_matrix, 1, 0, n-1,n-1).diagonal(); + return Block(m_matrix, 1, 0, n-1,n-1).diagonal(); } namespace internal { diff --git a/doc/examples/class_FixedVectorBlock.cpp b/doc/examples/class_FixedVectorBlock.cpp index 9be7d8d71..c88c9fbf1 100644 --- a/doc/examples/class_FixedVectorBlock.cpp +++ b/doc/examples/class_FixedVectorBlock.cpp @@ -11,10 +11,10 @@ firstTwo(MatrixBase& v) } template -const Eigen::VectorBlock +const Eigen::VectorBlock firstTwo(const MatrixBase& v) { - return Eigen::VectorBlock(v.derived(), 0); + return Eigen::VectorBlock(v.derived(), 0); } int main(int, char**) diff --git a/doc/examples/class_VectorBlock.cpp b/doc/examples/class_VectorBlock.cpp index 2f02c8f69..dc213df20 100644 --- a/doc/examples/class_VectorBlock.cpp +++ b/doc/examples/class_VectorBlock.cpp @@ -11,10 +11,10 @@ segmentFromRange(MatrixBase& v, int start, int end) } template -const Eigen::VectorBlock +const Eigen::VectorBlock segmentFromRange(const MatrixBase& v, int start, int end) { - return Eigen::VectorBlock(v.derived(), start, end-start); + return Eigen::VectorBlock(v.derived(), start, end-start); } int main(int, char**) diff --git a/doc/snippets/Tridiagonalization_diagonal.cpp b/doc/snippets/Tridiagonalization_diagonal.cpp index a4a5a9c5a..6eec82169 100644 --- a/doc/snippets/Tridiagonalization_diagonal.cpp +++ b/doc/snippets/Tridiagonalization_diagonal.cpp @@ -4,7 +4,7 @@ cout << "Here is a random self-adjoint 4x4 matrix:" << endl << A << endl << endl Tridiagonalization triOfA(A); MatrixXd T = triOfA.matrixT(); -cout << "The tridiagonal matrix T is:" << endl << triOfA.matrixT() << endl << endl; +cout << "The tridiagonal matrix T is:" << endl << T << endl << endl; cout << "We can also extract the diagonals of T directly ..." << endl; VectorXd diag = triOfA.diagonal();