15 enum { Rows = MatrixType::RowsAtCompileTime,
Cols = MatrixType::ColsAtCompileTime };
29 v2 = VectorType::Random(
rows);
30 RowVectorType rv1 = RowVectorType::Random(
cols),
31 rv2 = RowVectorType::Random(
cols);
33 LeftDiagonalMatrix ldm1(
v1), ldm2(
v2);
34 RightDiagonalMatrix rdm1(rv1), rdm2(rv2);
36 Scalar s1 = internal::random<Scalar>();
38 SquareMatrixType sq_m1 (
v1.asDiagonal());
40 sq_m1 =
v1.asDiagonal();
42 SquareMatrixType sq_m2 =
v1.asDiagonal();
45 ldm1 =
v1.asDiagonal();
46 LeftDiagonalMatrix ldm3(
v1);
48 LeftDiagonalMatrix ldm4 =
v1.asDiagonal();
53 sq_m1.transpose() = ldm1;
71 DynMatrixType tmp =
m1.topRows(
rows/2),
res;
99 VERIFY_IS_APPROX( (sq_m1 += (s1*
v1).asDiagonal()), sq_m2 += (s1*
v1).asDiagonal().toDenseMatrix() );
100 VERIFY_IS_APPROX( (sq_m1 -= (s1*
v1).asDiagonal()), sq_m2 -= (s1*
v1).asDiagonal().toDenseMatrix() );
104 sq_m2 =
v1.asDiagonal();
105 sq_m2 = sq_m1 * sq_m2;
109 sq_m1 =
v1.asDiagonal();
110 sq_m2 =
v2.asDiagonal();
111 SquareMatrixType sq_m3 =
v1.asDiagonal();
114 VERIFY_IS_APPROX( sq_m3 =
v1.asDiagonal() - 2*
v2.asDiagonal() +
v1.asDiagonal(), sq_m1 - 2*sq_m2 + sq_m1);
129 DynVectorType dv1 = DynVectorType::Random(
depth);
130 DynRowVectorType drv1 = DynRowVectorType::Random(
depth);
131 DynMatrixType dm1 = dv1;
132 DynMatrixType drm1 = drv1;
146 Matrix3Xd points = Matrix3Xd::Random(3, 3);
147 Vector2d
diag = Vector2d::Random();
148 Matrix2Xd tmp1 = points.topRows<2>(), res1, res2;
150 Matrix2d tmp2 = points.topLeftCorner<2,2>();