Add assertion against undefined matrix power.

This commit is contained in:
Chen-Pang He 2013-07-10 02:36:34 +08:00
parent 04bd1e3fc0
commit 25544dbec3

View File

@ -398,8 +398,11 @@ void MatrixPower<MatrixType>::initialize()
}
m_nulls = rows() - m_rank;
if (m_nulls)
if (m_nulls) {
eigen_assert(m_T.bottomRightCorner(m_nulls, m_nulls).isZero()
&& "Base of matrix power should be invertible or with a semisimple zero eigenvalue.");
m_fT.bottomRows(m_nulls).fill(RealScalar(0));
}
}
template<typename MatrixType>