24 m2 = MatrixType::Random(rows, cols),
25 m3 = MatrixType::Random(rows, cols);
26 RMatrixType rm2 = MatrixType::Random(rows, cols);
28 Rhs1 rhs1 = Rhs1::Random(internal::random<int>(1,320), cols); Rhs1 rhs11 = Rhs1::Random(rhs1.rows(),
cols);
29 Rhs2 rhs2 = Rhs2::Random(rows, internal::random<int>(1,320)); Rhs2 rhs22 = Rhs2::Random(rows, rhs2.cols());
30 Rhs3 rhs3 = Rhs3::Random(internal::random<int>(1,320), rows);
32 Scalar s1 = internal::random<Scalar>();
34 Index c = internal::random<Index>(0,cols-1);
37 VERIFY_IS_APPROX((
m2.template selfadjointView<Lower>().rankUpdate(rhs2,s1)._expression()),
45 VERIFY_IS_APPROX(
m2.template selfadjointView<Upper>().rankUpdate(rhs2,s1)._expression(),
46 (s1 * rhs2 * rhs2.adjoint()).
eval().template triangularView<Upper>().toDenseMatrix());
48 VERIFY_IS_APPROX((
m2.template triangularView<Upper>() += s1 * rhs22 * rhs2.adjoint()).nestedExpression(),
49 (s1 * rhs22 * rhs2.adjoint()).
eval().template triangularView<Upper>().toDenseMatrix());
53 VERIFY_IS_APPROX(
m2.template selfadjointView<Lower>().rankUpdate(rhs1.adjoint(),s1)._expression(),
61 VERIFY_IS_APPROX(
m2.template selfadjointView<Upper>().rankUpdate(rhs1.adjoint(),s1)._expression(),
62 (s1 * rhs1.adjoint() * rhs1).
eval().template triangularView<Upper>().toDenseMatrix());
63 VERIFY_IS_APPROX((
m2.template triangularView<Upper>() = s1 * rhs1.adjoint() * rhs11).nestedExpression(),
64 (s1 * rhs1.adjoint() * rhs11).
eval().template triangularView<Upper>().toDenseMatrix());
68 VERIFY_IS_APPROX(
m2.template selfadjointView<Lower>().rankUpdate(rhs3.adjoint(),s1)._expression(),
72 VERIFY_IS_APPROX(
m2.template selfadjointView<Upper>().rankUpdate(rhs3.adjoint(),s1)._expression(),
73 (s1 * rhs3.adjoint() * rhs3).
eval().template triangularView<Upper>().toDenseMatrix());
76 VERIFY_IS_APPROX((
m2.template selfadjointView<Lower>().rankUpdate(m1.col(c),s1)._expression()),
80 VERIFY_IS_APPROX((
m2.template selfadjointView<Upper>().rankUpdate(m1.col(c),s1)._expression()),
81 ((s1 * m1.col(c) * m1.col(c).adjoint()).
eval().template triangularView<Upper>().toDenseMatrix()));
83 VERIFY_IS_APPROX((rm2.template selfadjointView<Upper>().rankUpdate(m1.col(c),s1)._expression()),
84 ((s1 * m1.col(c) * m1.col(c).adjoint()).
eval().template triangularView<Upper>().toDenseMatrix()));
86 VERIFY_IS_APPROX((
m2.template triangularView<Upper>() += s1 * m3.col(c) * m1.col(c).adjoint()).nestedExpression(),
87 ((s1 * m3.col(c) * m1.col(c).adjoint()).
eval().template triangularView<Upper>().toDenseMatrix()));
89 VERIFY_IS_APPROX((rm2.template triangularView<Upper>() += s1 * m1.col(c) * m3.col(c).adjoint()).nestedExpression(),
90 ((s1 * m1.col(c) * m3.col(c).adjoint()).
eval().template triangularView<Upper>().toDenseMatrix()));
93 VERIFY_IS_APPROX((
m2.template selfadjointView<Lower>().rankUpdate(m1.col(c).conjugate(),s1)._expression()),
94 ((s1 * m1.col(c).conjugate() * m1.col(c).conjugate().adjoint()).
eval().template
triangularView<Lower>().toDenseMatrix()));
97 VERIFY_IS_APPROX((
m2.template selfadjointView<Upper>().rankUpdate(m1.col(c).conjugate(),s1)._expression()),
98 ((s1 * m1.col(c).conjugate() * m1.col(c).conjugate().adjoint()).
eval().template triangularView<Upper>().toDenseMatrix()));
102 VERIFY_IS_APPROX((
m2.template selfadjointView<Lower>().rankUpdate(m1.row(c),s1)._expression()),
103 ((s1 * m1.row(c).transpose() * m1.row(c).transpose().adjoint()).
eval().template
triangularView<Lower>().toDenseMatrix()));
105 VERIFY_IS_APPROX((rm2.template selfadjointView<Lower>().rankUpdate(m1.row(c),s1)._expression()),
106 ((s1 * m1.row(c).transpose() * m1.row(c).transpose().adjoint()).
eval().template
triangularView<Lower>().toDenseMatrix()));
109 ((s1 * m3.row(c).transpose() * m1.row(c).transpose().adjoint()).
eval().template
triangularView<Lower>().toDenseMatrix()));
112 ((s1 * m3.row(c).transpose() * m1.row(c).transpose().adjoint()).
eval().template
triangularView<Lower>().toDenseMatrix()));
116 VERIFY_IS_APPROX((
m2.template selfadjointView<Upper>().rankUpdate(m1.row(c).adjoint(),s1)._expression()),
117 ((s1 * m1.row(c).adjoint() * m1.row(c).adjoint().adjoint()).
eval().template triangularView<Upper>().toDenseMatrix()));
123 MatrixX
buffer(2*rows,2*cols);
126 VERIFY_IS_APPROX((map1.template selfadjointView<Lower>().rankUpdate(rhs2,s1)._expression()),
#define CALL_SUBTEST_4(FUNC)
A matrix or vector expression mapping an existing array of data.
#define CALL_SUBTEST_3(FUNC)
EIGEN_DECLARE_TEST(product_syrk)
Holds strides information for Map.
#define VERIFY_IS_APPROX(a, b)
#define CALL_SUBTEST_1(FUNC)
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
#define TEST_SET_BUT_UNUSED_VARIABLE(X)
#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.
void syrk(const MatrixType &m)