aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen
diff options
context:
space:
mode:
authorGravatar Jitse Niesen <jitse@maths.leeds.ac.uk>2010-05-24 17:43:27 +0100
committerGravatar Jitse Niesen <jitse@maths.leeds.ac.uk>2010-05-24 17:43:27 +0100
commit8a3f552e39d3fee3ada1cfc1eb75b179c77f2a78 (patch)
tree8800578d90c409f8b11bb48779a7dfc4931b21e7 /Eigen
parent7a43a4408bd3a04616bb91f9d039bdaf0ff976dd (diff)
Return matrices by constant reference where possible.
This changes the return type of: * eigenvectors() and eigenvalues() in ComplexEigenSolver * eigenvalues() in EigenSolver * eigenvectors() and eigenvalues() in SelfAdjointEigenSolver
Diffstat (limited to 'Eigen')
-rw-r--r--Eigen/src/Eigenvalues/ComplexEigenSolver.h8
-rw-r--r--Eigen/src/Eigenvalues/EigenSolver.h4
-rw-r--r--Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h8
3 files changed, 12 insertions, 8 deletions
diff --git a/Eigen/src/Eigenvalues/ComplexEigenSolver.h b/Eigen/src/Eigenvalues/ComplexEigenSolver.h
index f6b90d70e..5f956e49d 100644
--- a/Eigen/src/Eigenvalues/ComplexEigenSolver.h
+++ b/Eigen/src/Eigenvalues/ComplexEigenSolver.h
@@ -136,6 +136,8 @@ template<typename _MatrixType> class ComplexEigenSolver
/** \brief Returns the eigenvectors of given matrix.
*
+ * \returns A const reference to the matrix whose columns are the eigenvectors.
+ *
* It is assumed that either the constructor
* ComplexEigenSolver(const MatrixType& matrix) or the member
* function compute(const MatrixType& matrix) has been called
@@ -151,7 +153,7 @@ template<typename _MatrixType> class ComplexEigenSolver
* Example: \include ComplexEigenSolver_eigenvectors.cpp
* Output: \verbinclude ComplexEigenSolver_eigenvectors.out
*/
- EigenvectorType eigenvectors() const
+ const EigenvectorType& eigenvectors() const
{
ei_assert(m_isInitialized && "ComplexEigenSolver is not initialized.");
return m_eivec;
@@ -159,6 +161,8 @@ template<typename _MatrixType> class ComplexEigenSolver
/** \brief Returns the eigenvalues of given matrix.
*
+ * \returns A const reference to the column vector containing the eigenvalues.
+ *
* It is assumed that either the constructor
* ComplexEigenSolver(const MatrixType& matrix) or the member
* function compute(const MatrixType& matrix) has been called
@@ -171,7 +175,7 @@ template<typename _MatrixType> class ComplexEigenSolver
* Example: \include ComplexEigenSolver_eigenvalues.cpp
* Output: \verbinclude ComplexEigenSolver_eigenvalues.out
*/
- EigenvalueType eigenvalues() const
+ const EigenvalueType& eigenvalues() const
{
ei_assert(m_isInitialized && "ComplexEigenSolver is not initialized.");
return m_eivalues;
diff --git a/Eigen/src/Eigenvalues/EigenSolver.h b/Eigen/src/Eigenvalues/EigenSolver.h
index 7713e04b9..b619dc2eb 100644
--- a/Eigen/src/Eigenvalues/EigenSolver.h
+++ b/Eigen/src/Eigenvalues/EigenSolver.h
@@ -223,7 +223,7 @@ template<typename _MatrixType> class EigenSolver
/** \brief Returns the eigenvalues of given matrix.
*
- * \returns Column vector containing the eigenvalues.
+ * \returns A const reference to the column vector containing the eigenvalues.
*
* \pre Either the constructor EigenSolver(const MatrixType&) or the
* member function compute(const MatrixType&) has been called before.
@@ -237,7 +237,7 @@ template<typename _MatrixType> class EigenSolver
* \sa eigenvectors(), pseudoEigenvalueMatrix(),
* MatrixBase::eigenvalues()
*/
- EigenvalueType eigenvalues() const
+ const EigenvalueType& eigenvalues() const
{
ei_assert(m_isInitialized && "EigenSolver is not initialized.");
return m_eivalues;
diff --git a/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h b/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h
index 25b18dd8d..1abbed97b 100644
--- a/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h
+++ b/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h
@@ -264,7 +264,7 @@ template<typename _MatrixType> class SelfAdjointEigenSolver
/** \brief Returns the eigenvectors of given matrix (pencil).
*
- * \returns %Matrix whose columns are the eigenvectors.
+ * \returns A const reference to the matrix whose columns are the eigenvectors.
*
* \pre The eigenvectors have been computed before.
*
@@ -280,7 +280,7 @@ template<typename _MatrixType> class SelfAdjointEigenSolver
*
* \sa eigenvalues()
*/
- MatrixType eigenvectors() const
+ const MatrixType& eigenvectors() const
{
#ifndef NDEBUG
ei_assert(m_eigenvectorsOk);
@@ -290,7 +290,7 @@ template<typename _MatrixType> class SelfAdjointEigenSolver
/** \brief Returns the eigenvalues of given matrix (pencil).
*
- * \returns Column vector containing the eigenvalues.
+ * \returns A const reference to the column vector containing the eigenvalues.
*
* \pre The eigenvalues have been computed before.
*
@@ -302,7 +302,7 @@ template<typename _MatrixType> class SelfAdjointEigenSolver
*
* \sa eigenvectors(), MatrixBase::eigenvalues()
*/
- RealVectorType eigenvalues() const { return m_eivalues; }
+ const RealVectorType& eigenvalues() const { return m_eivalues; }
/** \brief Computes the positive-definite square root of the matrix.
*