18 MatrixType::Flags&
RowMajorBit> OtherMajorMatrixType;
26 mzero = MatrixType::Zero(
rows,
cols),
27 identity = MatrixType::Identity(
rows,
rows),
30 square2 = MatrixType::Random(
cols,
cols),
31 res2 = MatrixType::Random(
cols,
cols);
32 RowVectorType
v1 = RowVectorType::Random(
rows), vrres(
rows);
33 ColVectorType vc2 = ColVectorType::Random(
cols), vcres(
cols);
34 OtherMajorMatrixType tm1 =
m1;
36 Scalar s1 = internal::random<Scalar>(),
37 s2 = internal::random<Scalar>(),
38 s3 = internal::random<Scalar>();
56 (-
m1.conjugate()*s2).eval() * (s1 * vc2).eval());
58 (-
m1*s2).eval() * (s1 * vc2.conjugate()).eval());
60 (-
m1.conjugate()*s2).eval() * (s1 * vc2.conjugate()).eval());
63 (s1 * vc2.transpose()).eval() * (-
m1.adjoint()*s2).eval());
65 (s1 * vc2.adjoint()).eval() * (-
m1.transpose()*s2).eval());
67 (s1 * vc2.adjoint()).eval() * (-
m1.adjoint()*s2).eval());
70 (-
m1.adjoint()*s2).eval() * (s1 *
v1.transpose()).eval());
72 (-
m1.transpose()*s2).eval() * (s1 *
v1.adjoint()).eval());
74 (-
m1.adjoint()*s2).eval() * (s1 *
v1.adjoint()).eval());
77 (s1 *
v1).eval() * (-
m1.conjugate()*s2).eval());
79 (s1 *
v1.conjugate()).eval() * (-
m1*s2).eval());
81 (s1 *
v1.conjugate()).eval() * (-
m1.conjugate()*s2).eval());
84 (-
m1.adjoint()*s2).eval() * (s1 *
v1.adjoint()).eval());
87 Index i = internal::random<Index>(0,
m1.rows()-2);
88 Index j = internal::random<Index>(0,
m1.cols()-2);
89 Index r = internal::random<Index>(1,
m1.rows()-
i);
90 Index c = internal::random<Index>(1,
m1.cols()-
j);
91 Index i2 = internal::random<Index>(0,
m1.rows()-1);
92 Index j2 = internal::random<Index>(0,
m1.cols()-1);
131 Eigen::Matrix2Xd dNdxy(2, 3);
132 dNdxy << -0.5, 0.5, 0,
134 double det = 6.0, wt = 0.5;
135 VERIFY_IS_APPROX(dNdxy.transpose()*dNdxy*det*wt, det*wt*dNdxy.transpose()*dNdxy);
138 template <
typename MatrixType>
143 const int PacketSize1 = PacketSize>1 ? PacketSize-1 : 1;
224 ArrayXXf
B = ArrayXXf::Random(10,10),
C;
225 VectorXf
x = VectorXf::Random(10);
226 C = (
x.transpose()*
B.matrix());
227 B = (
x.transpose()*
B.matrix());
239 for(
int m=450;
m<460;++
m)
241 for(
int n=8;
n<12;++
n)
244 VectorXf
v1(
n),
r1(500);
245 RowVectorXf
v2(
m),
r2(16);
250 for(
int o=0; o<4; ++o)
252 r1.segment(o,
m).noalias() =
M *
v1;
254 r2.segment(o,
n).noalias() =
v2 *
M;
266 internal::computeProductBlockingSizes<T,T>(kc, mc,
nc);
274 ret += test_compute_block_size<T>(0,1,1);
275 ret += test_compute_block_size<T>(1,0,1);
276 ret += test_compute_block_size<T>(1,1,0);
277 ret += test_compute_block_size<T>(0,0,1);
278 ret += test_compute_block_size<T>(0,1,0);
279 ret += test_compute_block_size<T>(1,0,0);
280 ret += test_compute_block_size<T>(0,0,0);
287 Index m = internal::random<Index>(10,50);
288 Index n = internal::random<Index>(10,50);
294 double s = internal::random<double>(1,10);
297 B =
A *
A.transpose();
298 A =
A *
A.transpose();
302 B = (
A *
A.transpose())/
s;
303 A = (
A *
A.transpose())/
s;
307 B = (
A *
A.transpose()) +
D;
308 A = (
A *
A.transpose()) +
D;
312 B =
D + (
A *
A.transpose());
313 A =
D + (
A *
A.transpose());
317 B =
s * (
A *
A.transpose());
318 A =
s * (
A *
A.transpose());
333 VectorXd
v = VectorXd::Random(
n);
334 r =
v * RowVectorXd::Ones(
n);
336 r = VectorXd::Ones(
n) *
v.transpose();
339 Matrix4d ones44 = Matrix4d::Ones();
340 Matrix4d m44 = Matrix4d::Ones() * Matrix4d::Ones();
342 VERIFY_IS_APPROX(m44.noalias()=ones44*Matrix4d::Ones(), Matrix4d::Constant(4));
343 VERIFY_IS_APPROX(m44.noalias()=ones44.transpose()*Matrix4d::Ones(), Matrix4d::Constant(4));
344 VERIFY_IS_APPROX(m44.noalias()=Matrix4d::Ones()*ones44, Matrix4d::Constant(4));
345 VERIFY_IS_APPROX(m44.noalias()=Matrix4d::Ones()*ones44.transpose(), Matrix4d::Constant(4));
348 RMatrix4d r44 = Matrix4d::Ones() * Matrix4d::Ones();
350 VERIFY_IS_APPROX(r44.noalias()=ones44*Matrix4d::Ones(), Matrix4d::Constant(4));
351 VERIFY_IS_APPROX(r44.noalias()=ones44.transpose()*Matrix4d::Ones(), Matrix4d::Constant(4));
352 VERIFY_IS_APPROX(r44.noalias()=Matrix4d::Ones()*ones44, Matrix4d::Constant(4));
353 VERIFY_IS_APPROX(r44.noalias()=Matrix4d::Ones()*ones44.transpose(), Matrix4d::Constant(4));
354 VERIFY_IS_APPROX(r44.noalias()=ones44*RMatrix4d::Ones(), Matrix4d::Constant(4));
355 VERIFY_IS_APPROX(r44.noalias()=ones44.transpose()*RMatrix4d::Ones(), Matrix4d::Constant(4));
356 VERIFY_IS_APPROX(r44.noalias()=RMatrix4d::Ones()*ones44, Matrix4d::Constant(4));
357 VERIFY_IS_APPROX(r44.noalias()=RMatrix4d::Ones()*ones44.transpose(), Matrix4d::Constant(4));
362 VERIFY_IS_APPROX(r44.noalias() += m44.row(0).transpose() * RowVector4d::Ones(), ones44);
364 VERIFY_IS_APPROX(r44.noalias() += m44.col(0) * RowVector4d::Ones(), ones44);
368 VERIFY_IS_APPROX(r44.noalias() += Vector4d::Ones() * m44.col(0).transpose(), ones44);