diff options
author | 2009-03-23 14:44:44 +0000 | |
---|---|---|
committer | 2009-03-23 14:44:44 +0000 | |
commit | 70c0174bf9cb0a7dd22c47e377f9b9efc22ba4c9 (patch) | |
tree | a39078da47325e45a41c0e18c5ebb7ad53af7174 /Eigen/src/QR | |
parent | f4cf5e9b26dc633a42c02fb0e1a2fa36b2011d91 (diff) |
* allows fixed size matrix with size==0 (via a specialization of
MatrixStorage returning a null pointer). For instance this is very
useful to make Tridiagonalization compile for 1x1 matrices
* fix LLT and eigensolver for 1x1 matrix
Diffstat (limited to 'Eigen/src/QR')
-rw-r--r-- | Eigen/src/QR/SelfAdjointEigenSolver.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Eigen/src/QR/SelfAdjointEigenSolver.h b/Eigen/src/QR/SelfAdjointEigenSolver.h index 1c9ad513d..6d3bdf005 100644 --- a/Eigen/src/QR/SelfAdjointEigenSolver.h +++ b/Eigen/src/QR/SelfAdjointEigenSolver.h @@ -189,6 +189,14 @@ void SelfAdjointEigenSolver<MatrixType>::compute(const MatrixType& matrix, bool assert(matrix.cols() == matrix.rows()); int n = matrix.cols(); m_eivalues.resize(n,1); + + if(n==1) + { + m_eivalues.coeffRef(0,0) = ei_real(matrix.coeff(0,0)); + m_eivec.setOnes(); + return; + } + m_eivec = matrix; // FIXME, should tridiag be a local variable of this function or an attribute of SelfAdjointEigenSolver ? |