aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/QR
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2009-03-23 14:44:44 +0000
committerGravatar Gael Guennebaud <g.gael@free.fr>2009-03-23 14:44:44 +0000
commit70c0174bf9cb0a7dd22c47e377f9b9efc22ba4c9 (patch)
treea39078da47325e45a41c0e18c5ebb7ad53af7174 /Eigen/src/QR
parentf4cf5e9b26dc633a42c02fb0e1a2fa36b2011d91 (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.h8
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 ?