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

@@ -7,6 +7,7 @@
// Public License v. 2.0. If a copy of the MPL was not distributed
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
#define EIGEN_NO_STATIC_ASSERT
#include "main.h"
// This file tests the basic selfadjointView API,
@@ -45,6 +46,9 @@ template<typename MatrixType> void selfadjoint(const MatrixType& m)
m4 = m2;
m4 -= m1.template selfadjointView<Lower>();
VERIFY_IS_APPROX(m4, m2-m3);
VERIFY_RAISES_ASSERT(m2.template selfadjointView<StrictlyUpper>());
VERIFY_RAISES_ASSERT(m2.template selfadjointView<UnitLower>());
}
void bug_159()