is_same_dense.cpp
Go to the documentation of this file.
1 // This file is part of Eigen, a lightweight C++ template library
2 // for linear algebra.
3 //
4 // Copyright (C) 2015 Gael Guennebaud <gael.guennebaud@inria.fr>
5 //
6 // This Source Code Form is subject to the terms of the Mozilla
7 // Public License v. 2.0. If a copy of the MPL was not distributed
8 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 
10 #include "main.h"
11 
13 
15 {
16  typedef Matrix<double,Dynamic,Dynamic,ColMajor> ColMatrixXd;
17  ColMatrixXd m1(10,10);
18  Ref<ColMatrixXd> ref_m1(m1);
19  Ref<const ColMatrixXd> const_ref_m1(m1);
20  VERIFY(is_same_dense(m1,m1));
21  VERIFY(is_same_dense(m1,ref_m1));
22  VERIFY(is_same_dense(const_ref_m1,m1));
23  VERIFY(is_same_dense(const_ref_m1,ref_m1));
24 
25  VERIFY(is_same_dense(m1.block(0,0,m1.rows(),m1.cols()),m1));
26  VERIFY(!is_same_dense(m1.row(0),m1.col(0)));
27 
28  Ref<const ColMatrixXd> const_ref_m1_row(m1.row(1));
29  VERIFY(!is_same_dense(m1.row(1),const_ref_m1_row));
30 
31  Ref<const ColMatrixXd> const_ref_m1_col(m1.col(1));
32  VERIFY(is_same_dense(m1.col(1),const_ref_m1_col));
33 }
bool is_same_dense(const T1 &mat1, const T2 &mat2, typename enable_if< has_direct_access< T1 >::ret &&has_direct_access< T2 >::ret, T1 >::type *=0)
Definition: XprHelper.h:661
Matrix3d m1
Definition: IOFormat.cpp:2
A matrix or vector expression mapping an existing expression.
Definition: Ref.h:192
#define VERIFY(a)
Definition: main.h:325
void test_is_same_dense()
The matrix class, also used for vectors and row-vectors.


gtsam
Author(s):
autogenerated on Sat May 8 2021 02:42:16