aboutsummaryrefslogtreecommitdiff
path: root/test/is_same_dense.cpp
diff options
context:
space:
mode:
authorMiao Wang <miaowang@google.com>2017-03-06 13:45:08 -0800
committerMiao Wang <miaowang@google.com>2017-03-07 16:30:11 -0800
commit2b8756b6f1de65d3f8bffab45be6c44ceb7411fc (patch)
tree0488797fc544fe977bec6418c73445759f052482 /test/is_same_dense.cpp
parent353bba589de58014a35f8f3666b7b96353c300f8 (diff)
downloadeigen-2b8756b6f1de65d3f8bffab45be6c44ceb7411fc.tar.gz
Rebase Eigen to 3.3.3.
Bug: 34161771 Test: mm and RenderScript BLAS tests pass on bullhead. Change-Id: Ia448b3202708e395fed9c783ea4323289d69dbef
Diffstat (limited to 'test/is_same_dense.cpp')
-rw-r--r--test/is_same_dense.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/test/is_same_dense.cpp b/test/is_same_dense.cpp
new file mode 100644
index 000000000..2c7838ce9
--- /dev/null
+++ b/test/is_same_dense.cpp
@@ -0,0 +1,33 @@
+// This file is part of Eigen, a lightweight C++ template library
+// for linear algebra.
+//
+// Copyright (C) 2015 Gael Guennebaud <gael.guennebaud@inria.fr>
+//
+// This Source Code Form is subject to the terms of the Mozilla
+// 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/.
+
+#include "main.h"
+
+using internal::is_same_dense;
+
+void test_is_same_dense()
+{
+ typedef Matrix<double,Dynamic,Dynamic,ColMajor> ColMatrixXd;
+ ColMatrixXd m1(10,10);
+ Ref<ColMatrixXd> ref_m1(m1);
+ Ref<const ColMatrixXd> const_ref_m1(m1);
+ VERIFY(is_same_dense(m1,m1));
+ VERIFY(is_same_dense(m1,ref_m1));
+ VERIFY(is_same_dense(const_ref_m1,m1));
+ VERIFY(is_same_dense(const_ref_m1,ref_m1));
+
+ VERIFY(is_same_dense(m1.block(0,0,m1.rows(),m1.cols()),m1));
+ VERIFY(!is_same_dense(m1.row(0),m1.col(0)));
+
+ Ref<const ColMatrixXd> const_ref_m1_row(m1.row(1));
+ VERIFY(!is_same_dense(m1.row(1),const_ref_m1_row));
+
+ Ref<const ColMatrixXd> const_ref_m1_col(m1.col(1));
+ VERIFY(is_same_dense(m1.col(1),const_ref_m1_col));
+}