Add static assertion on selfadjoint-view's UpLo parameter.

(grafted from d820ab9edc
)
This commit is contained in:
Gael Guennebaud
2018-03-09 09:33:43 +01:00
parent c24844195d
commit 74daf12e52
3 changed files with 9 additions and 2 deletions

View File

@@ -71,7 +71,9 @@ template<typename _MatrixType, unsigned int UpLo> class SelfAdjointView
EIGEN_DEVICE_FUNC
explicit inline SelfAdjointView(MatrixType& matrix) : m_matrix(matrix)
{}
{
EIGEN_STATIC_ASSERT(UpLo==Lower || UpLo==Upper,SELFADJOINTVIEW_ACCEPTS_UPPER_AND_LOWER_MODE_ONLY);
}
EIGEN_DEVICE_FUNC
inline Index rows() const { return m_matrix.rows(); }