From 836da91b3fa6c4b2a2413268effd7e481ec8b066 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Fri, 11 Dec 2015 10:06:28 +0100 Subject: [PATCH] Fix unit tests wrt EIGEN_DEFAULT_TO_ROW_MAJOR --- test/is_same_dense.cpp | 11 ++++++----- test/nesting_ops.cpp | 7 ++++--- test/vectorization_logic.cpp | 5 ++++- 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 ref_m1(m1); - Ref const_ref_m1(m1); + typedef Matrix ColMatrixXd; + ColMatrixXd m1(10,10); + Ref ref_m1(m1); + Ref 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_ref_m1_row(m1.row(1)); + Ref const_ref_m1_row(m1.row(1)); VERIFY(!is_same_dense(m1.row(1),const_ref_m1_row)); - Ref const_ref_m1_col(m1.col(1)); + Ref 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 void run_nesting_ops_2(const MatrixType& _m) Index rows = _m.rows(); Index cols = _m.cols(); MatrixType m1 = MatrixType::Random(rows,cols); + Matrix m2; if((MatrixType::SizeAtCompileTime==Dynamic)) { @@ -79,9 +80,9 @@ template 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().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 +// Copyright (C) 2015 Gael Guennebaud // // 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