$darkmode
Eigen-unsupported  5.0.1-dev
rwupdt.h
1 // IWYU pragma: private
2 #include "./InternalHeaderCheck.h"
3 
4 namespace Eigen {
5 
6 namespace internal {
7 
8 template <typename Scalar>
9 void rwupdt(Matrix<Scalar, Dynamic, Dynamic> &r, const Matrix<Scalar, Dynamic, 1> &w, Matrix<Scalar, Dynamic, 1> &b,
10  Scalar alpha) {
11  typedef DenseIndex Index;
12 
13  const Index n = r.cols();
14  eigen_assert(r.rows() >= n);
15  std::vector<JacobiRotation<Scalar> > givens(n);
16 
17  /* Local variables */
18  Scalar temp, rowj;
19 
20  /* Function Body */
21  for (Index j = 0; j < n; ++j) {
22  rowj = w[j];
23 
24  /* apply the previous transformations to */
25  /* r(i,j), i=0,1,...,j-1, and to w(j). */
26  for (Index i = 0; i < j; ++i) {
27  temp = givens[i].c() * r(i, j) + givens[i].s() * rowj;
28  rowj = -givens[i].s() * r(i, j) + givens[i].c() * rowj;
29  r(i, j) = temp;
30  }
31 
32  /* determine a givens rotation which eliminates w(j). */
33  givens[j].makeGivens(-r(j, j), rowj);
34 
35  if (rowj == 0.) continue; // givens[j] is identity
36 
37  /* apply the current transformation to r(j,j), b(j), and alpha. */
38  r(j, j) = givens[j].c() * r(j, j) + givens[j].s() * rowj;
39  temp = givens[j].c() * b[j] + givens[j].s() * alpha;
40  alpha = -givens[j].s() * b[j] + givens[j].c() * alpha;
41  b[j] = temp;
42  }
43 }
44 
45 } // end namespace internal
46 
47 } // end namespace Eigen
Namespace containing all symbols from the Eigen library.
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index