17 enum { order = OtherSize == 1 ? 0 :
RowMajor };
27 Rhs1 rhs1 = Rhs1::Random(
cols, othersize), rhs12(
cols, othersize), rhs13(
cols, othersize);
28 Rhs2 rhs2 = Rhs2::Random(othersize,
rows), rhs22(othersize,
rows), rhs23(othersize,
rows);
29 Rhs3 rhs3 = Rhs3::Random(
cols, othersize), rhs32(
cols, othersize), rhs33(
cols, othersize);
31 Scalar s1 = internal::random<Scalar>(), s2 = internal::random<Scalar>();
33 m2 =
m1.template triangularView<Lower>();
34 m3 =
m2.template selfadjointView<Lower>();
36 VERIFY_IS_APPROX(rhs12 = (s1 *
m2).
template selfadjointView<Lower>() * (s2 * rhs1), rhs13 = (s1 *
m1) * (s2 * rhs1));
39 rhs13 = (s1 *
m1.transpose()) * (s2 * rhs1));
42 rhs13 = (s1 *
m1.transpose()) * (s2 * rhs1));
44 VERIFY_IS_APPROX(rhs12 = (s1 *
m2).conjugate().
template selfadjointView<Lower>() * (s2 * rhs1),
45 rhs13 = (s1 *
m1).conjugate() * (s2 * rhs1));
47 VERIFY_IS_APPROX(rhs12 = (s1 *
m2).
template selfadjointView<Lower>().conjugate() * (s2 * rhs1),
48 rhs13 = (s1 *
m1).conjugate() * (s2 * rhs1));
51 rhs13 = (s1 *
m1).
adjoint() * (s2 * rhs1));
54 rhs13 = (s1 *
m1).
adjoint() * (s2 * rhs1));
56 m2 =
m1.template triangularView<Upper>();
59 m3 =
m2.template selfadjointView<Upper>();
62 rhs13 += (s1 *
m1) * (s2 * rhs1));
64 m2 =
m1.template triangularView<Lower>();
65 VERIFY_IS_APPROX(rhs12 = (s1 *
m2).
template selfadjointView<Lower>() * (s2 * rhs2.adjoint()),
66 rhs13 = (s1 *
m1) * (s2 * rhs2.adjoint()));
68 m2 =
m1.template triangularView<Upper>();
69 VERIFY_IS_APPROX(rhs12 = (s1 *
m2).
template selfadjointView<Upper>() * (s2 * rhs2.adjoint()),
70 rhs13 = (s1 *
m1) * (s2 * rhs2.adjoint()));
72 m2 =
m1.template triangularView<Upper>();
73 VERIFY_IS_APPROX(rhs12 = (s1 *
m2.adjoint()).template selfadjointView<Lower>() * (s2 * rhs2.adjoint()),
74 rhs13 = (s1 *
m1.adjoint()) * (s2 * rhs2.adjoint()));
77 m2 =
m1.template triangularView<Lower>();
80 VERIFY_IS_APPROX(rhs32.noalias() -= (s1 *
m2).template selfadjointView<Lower>() * (s2 * rhs3),
81 rhs13 -= (s1 *
m1) * (s2 * rhs3));
83 m2 =
m1.template triangularView<Upper>();
84 VERIFY_IS_APPROX(rhs32.noalias() = (s1 *
m2.adjoint()).template selfadjointView<Lower>() * (s2 * rhs3).conjugate(),
85 rhs13 = (s1 *
m1.adjoint()) * (s2 * rhs3).conjugate());
87 m2 =
m1.template triangularView<Upper>();
89 VERIFY_IS_APPROX(rhs12.noalias() += s1 * ((
m2.adjoint()).template selfadjointView<Lower>() * (s2 * rhs3).conjugate()),
90 rhs13 += (s1 *
m1.adjoint()) * (s2 * rhs3).conjugate());
92 m2 =
m1.template triangularView<Lower>();
93 VERIFY_IS_APPROX(rhs22 = (rhs2) * (
m2).
template selfadjointView<Lower>(), rhs23 = (rhs2) * (
m1));
94 VERIFY_IS_APPROX(rhs22 = (s2 * rhs2) * (s1 *
m2).
template selfadjointView<Lower>(), rhs23 = (s2 * rhs2) * (s1 *
m1));
100 MatrixX buffer(2 *
cols, 2 * othersize);
103 VERIFY_IS_APPROX(map1.noalias() = (s1 *
m2).template selfadjointView<Lower>() * (s2 * rhs1),
104 rhs13 = (s1 *
m1) * (s2 * rhs1));
109 VERIFY_IS_APPROX(map2 = (rhs2) * (
m2).
template selfadjointView<Lower>(), rhs23 = (rhs2) * (
m1));
int rows
Definition: Tutorial_commainit_02.cpp:1
int cols
Definition: Tutorial_commainit_02.cpp:1
void adjoint(const MatrixType &m)
Definition: adjoint.cpp:85
Scalar Scalar int size
Definition: benchVecAdd.cpp:17
SCALAR Scalar
Definition: bench_gemm.cpp:45
MatrixXf MatrixType
Definition: benchmark-blocking-sizes.cpp:52
A matrix or vector expression mapping an existing array of data.
Definition: Map.h:96
The matrix class, also used for vectors and row-vectors.
Definition: Eigen/Eigen/src/Core/Matrix.h:186
Holds strides information for Map.
Definition: Stride.h:55
@ RowMajor
Definition: Constants.h:320
#define VERIFY_IS_APPROX(a, b)
Definition: integer_types.cpp:13
#define VERIFY_IS_EQUAL(a, b)
Definition: main.h:367
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:83
void transpose()
Definition: skew_symmetric_matrix3.cpp:135
internal::nested_eval< T, 1 >::type eval(const T &xpr)
Definition: sparse_permutations.cpp:47