22 Scalar s1 = internal::random<Scalar>();
26 m2.diagonal() = 2 *
m1.diagonal();
27 m2.diagonal()[0] *= 3;
32 N1 = MatrixType::RowsAtCompileTime>2 ? 2 : 0,
33 N2 = MatrixType::RowsAtCompileTime>1 ? -1 : 0
37 if(MatrixType::SizeAtCompileTime!=
Dynamic)
39 VERIFY(
m1.template diagonal<N1>().RowsAtCompileTime ==
m1.diagonal(N1).size());
40 VERIFY(
m1.template diagonal<N2>().RowsAtCompileTime ==
m1.diagonal(N2).size());
43 m2.template diagonal<N1>() = 2 *
m1.template diagonal<N1>();
45 m2.template diagonal<N1>()[0] *= 3;
49 m2.template diagonal<N2>() = 2 *
m1.template diagonal<N2>();
50 m2.template diagonal<N2>()[0] *= 3;
53 m2.diagonal(N1) = 2 *
m1.diagonal(N1);
55 m2.diagonal(N1)[0] *= 3;
58 m2.diagonal(N2) = 2 *
m1.diagonal(N2);
60 m2.diagonal(N2)[0] *= 3;
63 m2.diagonal(N2).x() = s1;
65 m2.diagonal(N2).coeffRef(0) =
Scalar(2)*s1;