fix #75, and add a basic unit test for Hessenberg

(it was indirectly tested by the eigenvalue decomposition)
This commit is contained in:
Gael Guennebaud
2009-12-23 12:18:54 +01:00
parent d65c8cb60a
commit 791bac25f2
3 changed files with 53 additions and 2 deletions

View File

@@ -71,9 +71,11 @@ template<typename _MatrixType> class HessenbergDecomposition
{}
HessenbergDecomposition(const MatrixType& matrix)
: m_matrix(matrix),
m_hCoeffs(matrix.cols()-1)
: m_matrix(matrix)
{
if(matrix.rows()<=2)
return;
m_hCoeffs.resize(matrix.rows()-1,1);
_compute(m_matrix, m_hCoeffs);
}
@@ -84,6 +86,8 @@ template<typename _MatrixType> class HessenbergDecomposition
void compute(const MatrixType& matrix)
{
m_matrix = matrix;
if(matrix.rows()<=2)
return;
m_hCoeffs.resize(matrix.rows()-1,1);
_compute(m_matrix, m_hCoeffs);
}