12 template<
typename Scalar,
int Size,
int OtherSize>
void symm(
int size = Size,
int othersize = OtherSize)
17 enum { order = OtherSize==1 ? 0 :
RowMajor };
23 MatrixType
m1 = MatrixType::Random(rows, cols),
24 m2 = MatrixType::Random(rows, cols), m3;
26 m1 = (m1+m1.adjoint()).
eval();
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));
54 rhs13 = (s1*m1).
adjoint() * (s2*rhs1));
57 rhs13 = (s1*m1).
adjoint() * (s2*rhs1));
59 m2 = m1.template triangularView<Upper>(); rhs12.setRandom(); rhs13 = rhs12;
60 m3 = m2.template selfadjointView<Upper>();
62 VERIFY_IS_APPROX(rhs12 += (s1*m2).
template selfadjointView<Upper>() * (s2*rhs1),
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(rhs12 -= (s1*m2).
template selfadjointView<Lower>() * (s2*rhs3),
80 rhs13 -= (s1*m1) * (s2 * rhs3));
82 m2 = m1.template triangularView<Upper>();
84 rhs13 = (s1*m1.adjoint()) * (s2*rhs3).conjugate());
87 m2 = m1.template triangularView<Upper>(); rhs13 = rhs12;
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));
void symm(int size=Size, int othersize=OtherSize)
void adjoint(const MatrixType &m)
#define VERIFY_IS_APPROX(a, b)
#define VERIFY_IS_EQUAL(a, b)
EIGEN_DEVICE_FUNC ConjugateReturnType conjugate() const
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
#define EIGEN_TEST_MAX_SIZE
A triangularView< Lower >().adjoint().solveInPlace(B)
internal::nested_eval< T, 1 >::type eval(const T &xpr)
The matrix class, also used for vectors and row-vectors.