r1mpyq.h
Go to the documentation of this file.
2 
3 namespace Eigen {
4 
5 namespace internal {
6 
7 // TODO : move this to GivensQR once there's such a thing in Eigen
8 
9 template <typename Scalar>
10 void r1mpyq(DenseIndex m, DenseIndex n, Scalar *a, const std::vector<JacobiRotation<Scalar> > &v_givens, const std::vector<JacobiRotation<Scalar> > &w_givens)
11 {
12  typedef DenseIndex Index;
13 
14  /* apply the first set of givens rotations to a. */
15  for (Index j = n-2; j>=0; --j)
16  for (Index i = 0; i<m; ++i) {
17  Scalar temp = v_givens[j].c() * a[i+m*j] - v_givens[j].s() * a[i+m*(n-1)];
18  a[i+m*(n-1)] = v_givens[j].s() * a[i+m*j] + v_givens[j].c() * a[i+m*(n-1)];
19  a[i+m*j] = temp;
20  }
21  /* apply the second set of givens rotations to a. */
22  for (Index j = 0; j<n-1; ++j)
23  for (Index i = 0; i<m; ++i) {
24  Scalar temp = w_givens[j].c() * a[i+m*j] + w_givens[j].s() * a[i+m*(n-1)];
25  a[i+m*(n-1)] = -w_givens[j].s() * a[i+m*j] + w_givens[j].c() * a[i+m*(n-1)];
26  a[i+m*j] = temp;
27  }
28 }
29 
30 } // end namespace internal
31 
32 } // end namespace Eigen
Matrix3f m
ArrayXXi a
int n
int i
void r1mpyq(DenseIndex m, DenseIndex n, Scalar *a, const std::vector< JacobiRotation< Scalar > > &v_givens, const std::vector< JacobiRotation< Scalar > > &w_givens)
Definition: r1mpyq.h:10
: TensorContractionSycl.h, provides various tensor contraction kernel for SYCL backend
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
EIGEN_DEFAULT_DENSE_INDEX_TYPE DenseIndex
std::ptrdiff_t j