1 // This file is part of Eigen, a lightweight C++ template library
4 // Copyright (C) 2008 Gael Guennebaud <gael.guennebaud@inria.fr>
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/.
12 void test_commainitializer()
17 VERIFY_RAISES_ASSERT( (m3
<< 1, 2, 3, 4, 5, 6, 7, 8) );
20 VERIFY_RAISES_ASSERT( (m3
<< 1, 2, 3, 4, 5, 6, 7, 8, 9, 10) );
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
);
34 m3
= Matrix3d::Random();
35 m3
<< vec
[0], vec
[1], vec
[2];
36 VERIFY_IS_APPROX(m3
, ref
);
41 m3
= Matrix3d::Random();
42 m3
<< vec
[0].transpose(),
45 VERIFY_IS_APPROX(m3
, ref
);