Eigen-unsupported  5.0.1-dev+284dcc12
 
Loading...
Searching...
No Matches
r1mpyq.h
1// IWYU pragma: private
2#include "./InternalHeaderCheck.h"
3
4namespace Eigen {
5
6namespace internal {
7
8// TODO : move this to GivensQR once there's such a thing in Eigen
9
10template <typename Scalar>
11void r1mpyq(DenseIndex m, DenseIndex n, Scalar *a, const std::vector<JacobiRotation<Scalar> > &v_givens,
12 const std::vector<JacobiRotation<Scalar> > &w_givens) {
13 typedef DenseIndex Index;
14
15 /* apply the first set of givens rotations to a. */
16 for (Index j = n - 2; j >= 0; --j)
17 for (Index i = 0; i < m; ++i) {
18 Scalar temp = v_givens[j].c() * a[i + m * j] - v_givens[j].s() * a[i + m * (n - 1)];
19 a[i + m * (n - 1)] = v_givens[j].s() * a[i + m * j] + v_givens[j].c() * a[i + m * (n - 1)];
20 a[i + m * j] = temp;
21 }
22 /* apply the second set of givens rotations to a. */
23 for (Index j = 0; j < n - 1; ++j)
24 for (Index i = 0; i < m; ++i) {
25 Scalar temp = w_givens[j].c() * a[i + m * j] + w_givens[j].s() * a[i + m * (n - 1)];
26 a[i + m * (n - 1)] = -w_givens[j].s() * a[i + m * j] + w_givens[j].c() * a[i + m * (n - 1)];
27 a[i + m * j] = temp;
28 }
29}
30
31} // end namespace internal
32
33} // end namespace Eigen
Namespace containing all symbols from the Eigen library.
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index