From 70c0174bf9cb0a7dd22c47e377f9b9efc22ba4c9 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Mon, 23 Mar 2009 14:44:44 +0000 Subject: * 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 --- Eigen/src/QR/SelfAdjointEigenSolver.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Eigen/src/QR') 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::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 ? -- cgit v1.2.3