rwupdt.h
Go to the documentation of this file.
2 
3 namespace Eigen {
4 
5 namespace internal {
6 
7 template <typename Scalar>
8 void rwupdt(
12  Scalar alpha)
13 {
14  typedef DenseIndex Index;
15 
16  const Index n = r.cols();
17  eigen_assert(r.rows()>=n);
18  std::vector<JacobiRotation<Scalar> > givens(n);
19 
20  /* Local variables */
21  Scalar temp, rowj;
22 
23  /* Function Body */
24  for (Index j = 0; j < n; ++j) {
25  rowj = w[j];
26 
27  /* apply the previous transformations to */
28  /* r(i,j), i=0,1,...,j-1, and to w(j). */
29  for (Index i = 0; i < j; ++i) {
30  temp = givens[i].c() * r(i,j) + givens[i].s() * rowj;
31  rowj = -givens[i].s() * r(i,j) + givens[i].c() * rowj;
32  r(i,j) = temp;
33  }
34 
35  /* determine a givens rotation which eliminates w(j). */
36  givens[j].makeGivens(-r(j,j), rowj);
37 
38  if (rowj == 0.)
39  continue; // givens[j] is identity
40 
41  /* apply the current transformation to r(j,j), b(j), and alpha. */
42  r(j,j) = givens[j].c() * r(j,j) + givens[j].s() * rowj;
43  temp = givens[j].c() * b[j] + givens[j].s() * alpha;
44  alpha = -givens[j].s() * b[j] + givens[j].c() * alpha;
45  b[j] = temp;
46  }
47 }
48 
49 } // end namespace internal
50 
51 } // end namespace Eigen
int n
int i
#define eigen_assert(x)
RowVector3d w
EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT
EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT
void rwupdt(Matrix< Scalar, Dynamic, Dynamic > &r, const Matrix< Scalar, Dynamic, 1 > &w, Matrix< Scalar, Dynamic, 1 > &b, Scalar alpha)
Definition: rwupdt.h:8
: 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