13 template<
typename Derived1,
typename Derived2>
17 * (
std::max)(
m1.cwiseAbs2().maxCoeff(),
m2.cwiseAbs2().maxCoeff()));
30 typedef Matrix<
Scalar, MatrixType::RowsAtCompileTime, MatrixType::ColsAtCompileTime,
42 identity = RowSquareMatrixType::Identity(
rows,
rows),
46 square2 = ColSquareMatrixType::Random(
cols,
cols),
47 res2 = ColSquareMatrixType::Random(
cols,
cols);
48 RowVectorType
v1 = RowVectorType::Random(
rows);
49 ColVectorType vc2 = ColVectorType::Random(
cols), vcres(
cols);
50 OtherMajorMatrixType tm1 =
m1;
52 Scalar s1 = internal::random<Scalar>();
54 Index r = internal::random<Index>(0,
rows-1),
55 c = internal::random<Index>(0,
cols-1),
56 c2 = internal::random<Index>(0,
cols-1);
92 res.noalias() +=
m1 *
m2.transpose();
99 vcres.noalias() +=
m1.transpose() *
v1;
104 res.noalias() -=
m1 *
m2.transpose();
111 vcres.noalias() -=
m1.transpose() *
v1;
116 res.noalias() = s1 *
m1 *
m2.transpose();
119 res.noalias() += s1 *
m1 *
m2.transpose();
122 res.noalias() -= s1 *
m1 *
m2.transpose();
156 res2.noalias() +=
m1.transpose() *
m2;
169 ColSquareMatrixType ref2(square2);
175 ref2 = res2 = square2;
176 VERIFY_IS_APPROX(res2.block(0,0,1,
cols).noalias() =
m1.row(0) * square2.transpose(), (ref2.row(0) =
m1.row(0) * square2.transpose()));
177 VERIFY_IS_APPROX(res2.block(0,0,1,
cols).noalias() =
m1.block(0,0,1,
cols) * square2.transpose(), (ref2.row(0) =
m1.row(0) * square2.transpose()));
184 RowVectorType w1(
rows);
191 VERIFY_IS_APPROX(w2.noalias() = vc2.block(0,0,
cols,1).transpose() * square2, vc2.transpose() * square2);
192 VERIFY_IS_APPROX(w2.block(0,0,1,
cols).noalias() = vc2.block(0,0,
cols,1).transpose() * square2, vc2.transpose() * square2);
194 vc2 = square2.block(0,0,1,
cols).transpose();
196 VERIFY_IS_APPROX(w2.noalias() = square2.block(0,0,1,
cols) * square2, vc2.transpose() * square2);
199 vc2 = square2.block(0,0,
cols,1);
201 VERIFY_IS_APPROX(w2.noalias() = square2.block(0,0,
cols,1).transpose() * square2, vc2.transpose() * square2);
202 VERIFY_IS_APPROX(w2.block(0,0,1,
cols).noalias() = square2.block(0,0,
cols,1).transpose() * square2, vc2.transpose() * square2);
215 VERIFY_IS_APPROX(
m1.block(0,
c,
rows,1) *
m1.row(r),
m1.block(0,
c,
rows,1) *
m1.block(r,0,1,
cols));
216 VERIFY_IS_APPROX(
m1.col(
c) *
m1.block(r,0,1,
cols),
m1.block(0,
c,
rows,1) *
m1.block(r,0,1,
cols));
223 ColVectorType
x(
cols);
x.setRandom();
225 ColVectorType
y(
cols);
y.setZero();
226 ColSquareMatrixType
A(
cols,
cols);
A.setRandom();
246 if(!MatrixType::IsRowMajor)