12 template<
typename Scalar,
int Size,
int OtherSize>
void symm(
int size = Size,
int othersize = OtherSize)
17 enum { order = OtherSize==1 ? 0 :
RowMajor };
28 Rhs1 rhs1 = Rhs1::Random(
cols, othersize), rhs12(
cols, othersize), rhs13(
cols, othersize);
29 Rhs2 rhs2 = Rhs2::Random(othersize,
rows), rhs22(othersize,
rows), rhs23(othersize,
rows);
30 Rhs3 rhs3 = Rhs3::Random(
cols, othersize), rhs32(
cols, othersize), rhs33(
cols, othersize);
32 Scalar s1 = internal::random<Scalar>(),
33 s2 = internal::random<Scalar>();
36 m3 =
m2.template selfadjointView<Lower>();
39 rhs13 = (s1*
m1) * (s2*rhs1));
41 VERIFY_IS_APPROX(rhs12 = (s1*
m2).transpose().
template selfadjointView<Upper>() * (s2*rhs1),
42 rhs13 = (s1*
m1.transpose()) * (s2*rhs1));
44 VERIFY_IS_APPROX(rhs12 = (s1*
m2).
template selfadjointView<Lower>().transpose() * (s2*rhs1),
45 rhs13 = (s1*
m1.transpose()) * (s2*rhs1));
59 m2 =
m1.template triangularView<Upper>(); rhs12.setRandom(); rhs13 = rhs12;
60 m3 =
m2.template selfadjointView<Upper>();
63 rhs13 += (s1*
m1) * (s2*rhs1));
66 VERIFY_IS_APPROX(rhs12 = (s1*
m2).
template selfadjointView<Lower>() * (s2*rhs2.adjoint()),
67 rhs13 = (s1*
m1) * (s2*rhs2.adjoint()));
69 m2 =
m1.template triangularView<Upper>();
70 VERIFY_IS_APPROX(rhs12 = (s1*
m2).
template selfadjointView<Upper>() * (s2*rhs2.adjoint()),
71 rhs13 = (s1*
m1) * (s2*rhs2.adjoint()));
73 m2 =
m1.template triangularView<Upper>();
74 VERIFY_IS_APPROX(rhs12 = (s1*
m2.adjoint()).template selfadjointView<Lower>() * (s2*rhs2.adjoint()),
75 rhs13 = (s1*
m1.adjoint()) * (s2*rhs2.adjoint()));
79 VERIFY_IS_APPROX(rhs32.noalias() -= (s1*
m2).template selfadjointView<Lower>() * (s2*rhs3),
80 rhs13 -= (s1*
m1) * (s2 * rhs3));
82 m2 =
m1.template triangularView<Upper>();
83 VERIFY_IS_APPROX(rhs32.noalias() = (s1*
m2.adjoint()).template selfadjointView<Lower>() * (s2*rhs3).conjugate(),
84 rhs13 = (s1*
m1.adjoint()) * (s2*rhs3).conjugate());
87 m2 =
m1.template triangularView<Upper>(); rhs13 = rhs12;
88 VERIFY_IS_APPROX(rhs12.noalias() += s1 * ((
m2.adjoint()).template selfadjointView<Lower>() * (s2*rhs3).conjugate()),
89 rhs13 += (s1*
m1.adjoint()) * (s2*rhs3).conjugate());
92 VERIFY_IS_APPROX(rhs22 = (rhs2) * (
m2).
template selfadjointView<Lower>(), rhs23 = (rhs2) * (
m1));
93 VERIFY_IS_APPROX(rhs22 = (s2*rhs2) * (s1*
m2).
template selfadjointView<Lower>(), rhs23 = (s2*rhs2) * (s1*
m1));
102 VERIFY_IS_APPROX( map1.noalias() = (s1*
m2).template selfadjointView<Lower>() * (s2*rhs1),
103 rhs13 = (s1*
m1) * (s2*rhs1));
107 VERIFY_IS_APPROX(map2 = (rhs2) * (
m2).
template selfadjointView<Lower>(), rhs23 = (rhs2) * (
m1));