r1mpyq.h
Go to the documentation of this file.
1 namespace Eigen {
2 
3 namespace internal {
4 
5 // TODO : move this to GivensQR once there's such a thing in Eigen
6 
7 template <typename Scalar>
8 void r1mpyq(DenseIndex m, DenseIndex n, Scalar *a, const std::vector<JacobiRotation<Scalar> > &v_givens, const std::vector<JacobiRotation<Scalar> > &w_givens)
9 {
10  typedef DenseIndex Index;
11 
12  /* apply the first set of givens rotations to a. */
13  for (Index j = n-2; j>=0; --j)
14  for (Index i = 0; i<m; ++i) {
15  Scalar temp = v_givens[j].c() * a[i+m*j] - v_givens[j].s() * a[i+m*(n-1)];
16  a[i+m*(n-1)] = v_givens[j].s() * a[i+m*j] + v_givens[j].c() * a[i+m*(n-1)];
17  a[i+m*j] = temp;
18  }
19  /* apply the second set of givens rotations to a. */
20  for (Index j = 0; j<n-1; ++j)
21  for (Index i = 0; i<m; ++i) {
22  Scalar temp = w_givens[j].c() * a[i+m*j] + w_givens[j].s() * a[i+m*(n-1)];
23  a[i+m*(n-1)] = -w_givens[j].s() * a[i+m*j] + w_givens[j].c() * a[i+m*(n-1)];
24  a[i+m*j] = temp;
25  }
26 }
27 
28 } // end namespace internal
29 
30 } // end namespace Eigen
Eigen
Namespace containing all symbols from the Eigen library.
Definition: jet.h:637
s
RealScalar s
Definition: level1_cplx_impl.h:126
Eigen::JacobiRotation
Rotation given by a cosine-sine pair.
Definition: ForwardDeclarations.h:283
n
int n
Definition: BiCGSTAB_simple.cpp:1
Eigen::internal::r1mpyq
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:8
j
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2
m
Matrix3f m
Definition: AngleAxis_mimic_euler.cpp:1
a
ArrayXXi a
Definition: Array_initializer_list_23_cxx11.cpp:1
Eigen::DenseIndex
EIGEN_DEFAULT_DENSE_INDEX_TYPE DenseIndex
Definition: Meta.h:66
internal
Definition: BandTriangularSolver.h:13
i
int i
Definition: BiCGSTAB_step_by_step.cpp:9
Scalar
SCALAR Scalar
Definition: bench_gemm.cpp:46
Eigen::Index
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:74


gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:03:54