From cf7e2e277f76d965fe37dac5a3fecf588f58e3b7 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Sun, 17 Mar 2019 21:59:30 +0100 Subject: bug #1692: enable enum as sizes of Matrix and Array --- test/constructor.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'test/constructor.cpp') diff --git a/test/constructor.cpp b/test/constructor.cpp index 1dd3bc3c0..e793dfca1 100644 --- a/test/constructor.cpp +++ b/test/constructor.cpp @@ -81,4 +81,17 @@ EIGEN_DECLARE_TEST(constructor) Array a(123); VERIFY_IS_EQUAL(a(4), 123.f); } + { + enum { M = 12, N = 7}; + MatrixXi m1(M,N); + VERIFY_IS_EQUAL(m1.rows(),M); + VERIFY_IS_EQUAL(m1.cols(),N); + ArrayXXi a1(M,N); + VERIFY_IS_EQUAL(a1.rows(),M); + VERIFY_IS_EQUAL(a1.cols(),N); + VectorXi v1(M); + VERIFY_IS_EQUAL(v1.size(),M); + ArrayXi a2(M); + VERIFY_IS_EQUAL(a2.size(),M); + } } -- cgit v1.2.3