LP-311 Remove basic/advanced stabilization tab auto-switch (autotune/txpid lock issues)
[librepilot.git] / ground / gcs / src / libs / eigen / test / commainitializer.cpp
blob99102b966bf3a3527efab7c90fa8c25c5b77840d
1 // This file is part of Eigen, a lightweight C++ template library
2 // for linear algebra.
3 //
4 // Copyright (C) 2008 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/.
10 #include "main.h"
12 void test_commainitializer()
14 Matrix3d m3;
15 Matrix4d m4;
17 VERIFY_RAISES_ASSERT( (m3 << 1, 2, 3, 4, 5, 6, 7, 8) );
19 #ifndef _MSC_VER
20 VERIFY_RAISES_ASSERT( (m3 << 1, 2, 3, 4, 5, 6, 7, 8, 9, 10) );
21 #endif
23 double data[] = {1, 2, 3, 4, 5, 6, 7, 8, 9};
24 Matrix3d ref = Map<Matrix<double,3,3,RowMajor> >(data);
26 m3 = Matrix3d::Random();
27 m3 << 1, 2, 3, 4, 5, 6, 7, 8, 9;
28 VERIFY_IS_APPROX(m3, ref );
30 Vector3d vec[3];
31 vec[0] << 1, 4, 7;
32 vec[1] << 2, 5, 8;
33 vec[2] << 3, 6, 9;
34 m3 = Matrix3d::Random();
35 m3 << vec[0], vec[1], vec[2];
36 VERIFY_IS_APPROX(m3, ref);
38 vec[0] << 1, 2, 3;
39 vec[1] << 4, 5, 6;
40 vec[2] << 7, 8, 9;
41 m3 = Matrix3d::Random();
42 m3 << vec[0].transpose(),
43 4, 5, 6,
44 vec[2].transpose();
45 VERIFY_IS_APPROX(m3, ref);