aboutsummaryrefslogtreecommitdiffhomepage
path: root/unsupported/Eigen/src/MatrixFunctions
diff options
context:
space:
mode:
authorGravatar Chen-Pang He <jdh8@ms63.hinet.net>2013-07-10 02:36:34 +0800
committerGravatar Chen-Pang He <jdh8@ms63.hinet.net>2013-07-10 02:36:34 +0800
commit25544dbec3429848226c9a567ccd7e82973c04e7 (patch)
treeba975fec63d0e480d5dfd2c3a659d89d8006189c /unsupported/Eigen/src/MatrixFunctions
parent04bd1e3fc003f4220e82a553c3496a4f8d509959 (diff)
Add assertion against undefined matrix power.
Diffstat (limited to 'unsupported/Eigen/src/MatrixFunctions')
-rw-r--r--unsupported/Eigen/src/MatrixFunctions/MatrixPower.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/unsupported/Eigen/src/MatrixFunctions/MatrixPower.h b/unsupported/Eigen/src/MatrixFunctions/MatrixPower.h
index e0a687978..e4f13c993 100644
--- a/unsupported/Eigen/src/MatrixFunctions/MatrixPower.h
+++ b/unsupported/Eigen/src/MatrixFunctions/MatrixPower.h
@@ -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>