aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2015-12-11 10:06:28 +0100
committerGravatar Gael Guennebaud <g.gael@free.fr>2015-12-11 10:06:28 +0100
commit836da91b3fa6c4b2a2413268effd7e481ec8b066 (patch)
tree015e37afe7935d14752efcdd7827fb247048eb0e /test
parentdf6f54ff63fbf8ec4bd6218d9887351b30dda30f (diff)
Fix unit tests wrt EIGEN_DEFAULT_TO_ROW_MAJOR
Diffstat (limited to 'test')
-rw-r--r--test/is_same_dense.cpp11
-rw-r--r--test/nesting_ops.cpp7
-rw-r--r--test/vectorization_logic.cpp5
3 files changed, 14 insertions, 9 deletions
diff --git a/test/is_same_dense.cpp b/test/is_same_dense.cpp
index 318ba8717..6d7904bac 100644
--- a/test/is_same_dense.cpp
+++ b/test/is_same_dense.cpp
@@ -11,9 +11,10 @@
void test_is_same_dense()
{
- MatrixXd m1(10,10);
- Ref<MatrixXd> ref_m1(m1);
- Ref<const MatrixXd> const_ref_m1(m1);
+ 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));
@@ -22,9 +23,9 @@ void test_is_same_dense()
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 MatrixXd> const_ref_m1_row(m1.row(1));
+ Ref<const ColMatrixXd> const_ref_m1_row(m1.row(1));
VERIFY(!is_same_dense(m1.row(1),const_ref_m1_row));
- Ref<const MatrixXd> const_ref_m1_col(m1.col(1));
+ Ref<const ColMatrixXd> const_ref_m1_col(m1.col(1));
VERIFY(is_same_dense(m1.col(1),const_ref_m1_col));
}
diff --git a/test/nesting_ops.cpp b/test/nesting_ops.cpp
index 76a63400c..2f5025305 100644
--- a/test/nesting_ops.cpp
+++ b/test/nesting_ops.cpp
@@ -51,6 +51,7 @@ template <typename MatrixType> void run_nesting_ops_2(const MatrixType& _m)
Index rows = _m.rows();
Index cols = _m.cols();
MatrixType m1 = MatrixType::Random(rows,cols);
+ Matrix<Scalar,MatrixType::RowsAtCompileTime,MatrixType::ColsAtCompileTime,ColMajor> m2;
if((MatrixType::SizeAtCompileTime==Dynamic))
{
@@ -79,9 +80,9 @@ template <typename MatrixType> void run_nesting_ops_2(const MatrixType& _m)
}
VERIFY( verify_eval_type<2>(m1+m1, m1+m1) );
VERIFY( verify_eval_type<3>(m1+m1, m1) );
- VERIFY( verify_eval_type<1>(m1*m1.transpose(), m1) );
- VERIFY( verify_eval_type<1>(m1*(m1+m1).transpose(), m1) );
- VERIFY( verify_eval_type<2>(m1*m1.transpose(), m1) );
+ VERIFY( verify_eval_type<1>(m1*m1.transpose(), m2) );
+ VERIFY( verify_eval_type<1>(m1*(m1+m1).transpose(), m2) );
+ VERIFY( verify_eval_type<2>(m1*m1.transpose(), m2) );
VERIFY( verify_eval_type<1>(m1+m1*m1, m1) );
VERIFY( verify_eval_type<1>(m1.template triangularView<Lower>().solve(m1), m1) );
diff --git a/test/vectorization_logic.cpp b/test/vectorization_logic.cpp
index da60a2f3a..35fbb9781 100644
--- a/test/vectorization_logic.cpp
+++ b/test/vectorization_logic.cpp
@@ -1,12 +1,15 @@
// This file is part of Eigen, a lightweight C++ template library
// for linear algebra.
//
-// Copyright (C) 2008 Gael Guennebaud <gael.guennebaud@inria.fr>
+// 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/.
+#ifdef EIGEN_DEFAULT_TO_ROW_MAJOR
+#undef EIGEN_DEFAULT_TO_ROW_MAJOR
+#endif
#define EIGEN_DEBUG_ASSIGN
#include "main.h"
#include <typeinfo>