Add assertion on the input matrix size in factorizations relying on permutations of 32bits int

This commit is contained in:
Gael Guennebaud
2013-02-26 11:42:32 +01:00
parent b73baa1ea4
commit 5dda7842ca
3 changed files with 9 additions and 0 deletions

View File

@@ -401,6 +401,9 @@ ColPivHouseholderQR<MatrixType>& ColPivHouseholderQR<MatrixType>::compute(const
Index rows = matrix.rows();
Index cols = matrix.cols();
Index size = matrix.diagonalSize();
// the column permutation is stored as int indices, so just to be sure:
eigen_assert(cols<=NumTraits<int>::highest());
m_qr = matrix;
m_hCoeffs.resize(size);