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(rhs32.noalias() -= (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));
99 MatrixX
buffer(2*cols,2*othersize);
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));
void symm(int size=Size, int othersize=OtherSize)
#define CALL_SUBTEST_6(FUNC)
#define CALL_SUBTEST_4(FUNC)
void adjoint(const MatrixType &m)
A matrix or vector expression mapping an existing array of data.
#define CALL_SUBTEST_3(FUNC)
#define CALL_SUBTEST_7(FUNC)
Holds strides information for Map.
#define VERIFY_IS_APPROX(a, b)
#define VERIFY_IS_EQUAL(a, b)
#define CALL_SUBTEST_1(FUNC)
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
#define CALL_SUBTEST_8(FUNC)
EIGEN_DEVICE_FUNC ConjugateReturnType conjugate() const
EIGEN_DECLARE_TEST(product_symm)
#define CALL_SUBTEST_5(FUNC)
#define EIGEN_TEST_MAX_SIZE
A triangularView< Lower >().adjoint().solveInPlace(B)
#define CALL_SUBTEST_2(FUNC)
internal::nested_eval< T, 1 >::type eval(const T &xpr)
The matrix class, also used for vectors and row-vectors.