mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-14 04:35:57 +08:00
Fix unit tests wrt EIGEN_DEFAULT_TO_ROW_MAJOR
This commit is contained in:
parent
df6f54ff63
commit
836da91b3f
@ -11,9 +11,10 @@
|
|||||||
|
|
||||||
void test_is_same_dense()
|
void test_is_same_dense()
|
||||||
{
|
{
|
||||||
MatrixXd m1(10,10);
|
typedef Matrix<double,Dynamic,Dynamic,ColMajor> ColMatrixXd;
|
||||||
Ref<MatrixXd> ref_m1(m1);
|
ColMatrixXd m1(10,10);
|
||||||
Ref<const MatrixXd> const_ref_m1(m1);
|
Ref<ColMatrixXd> ref_m1(m1);
|
||||||
|
Ref<const ColMatrixXd> const_ref_m1(m1);
|
||||||
VERIFY(is_same_dense(m1,m1));
|
VERIFY(is_same_dense(m1,m1));
|
||||||
VERIFY(is_same_dense(m1,ref_m1));
|
VERIFY(is_same_dense(m1,ref_m1));
|
||||||
VERIFY(is_same_dense(const_ref_m1,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.block(0,0,m1.rows(),m1.cols()),m1));
|
||||||
VERIFY(!is_same_dense(m1.row(0),m1.col(0)));
|
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));
|
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));
|
VERIFY(is_same_dense(m1.col(1),const_ref_m1_col));
|
||||||
}
|
}
|
||||||
|
@ -51,6 +51,7 @@ template <typename MatrixType> void run_nesting_ops_2(const MatrixType& _m)
|
|||||||
Index rows = _m.rows();
|
Index rows = _m.rows();
|
||||||
Index cols = _m.cols();
|
Index cols = _m.cols();
|
||||||
MatrixType m1 = MatrixType::Random(rows,cols);
|
MatrixType m1 = MatrixType::Random(rows,cols);
|
||||||
|
Matrix<Scalar,MatrixType::RowsAtCompileTime,MatrixType::ColsAtCompileTime,ColMajor> m2;
|
||||||
|
|
||||||
if((MatrixType::SizeAtCompileTime==Dynamic))
|
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<2>(m1+m1, m1+m1) );
|
||||||
VERIFY( verify_eval_type<3>(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.transpose(), m2) );
|
||||||
VERIFY( verify_eval_type<1>(m1*(m1+m1).transpose(), m1) );
|
VERIFY( verify_eval_type<1>(m1*(m1+m1).transpose(), m2) );
|
||||||
VERIFY( verify_eval_type<2>(m1*m1.transpose(), m1) );
|
VERIFY( verify_eval_type<2>(m1*m1.transpose(), m2) );
|
||||||
VERIFY( verify_eval_type<1>(m1+m1*m1, m1) );
|
VERIFY( verify_eval_type<1>(m1+m1*m1, m1) );
|
||||||
|
|
||||||
VERIFY( verify_eval_type<1>(m1.template triangularView<Lower>().solve(m1), m1) );
|
VERIFY( verify_eval_type<1>(m1.template triangularView<Lower>().solve(m1), m1) );
|
||||||
|
@ -1,12 +1,15 @@
|
|||||||
// This file is part of Eigen, a lightweight C++ template library
|
// This file is part of Eigen, a lightweight C++ template library
|
||||||
// for linear algebra.
|
// 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
|
// 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
|
// 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/.
|
// 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
|
#define EIGEN_DEBUG_ASSIGN
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include <typeinfo>
|
#include <typeinfo>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user