Eigen-unsupported 3.4.90
unsupported
Eigen
src
NonLinearOptimization
rwupdt.h
Go to the documentation of this file.
1
#include "
./InternalHeaderCheck.h
"
2
3
namespace
Eigen
{
4
5
namespace
internal
{
6
7
template
<
typename
Scalar>
8
void
rwupdt
(
9
Matrix< Scalar, Dynamic, Dynamic >
&r,
10
const
Matrix< Scalar, Dynamic, 1>
&w,
11
Matrix< Scalar, Dynamic, 1>
&
b
,
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
n
int n
i
int i
eigen_assert
#define eigen_assert(x)
w
RowVector3d w
Eigen::Matrix< Scalar, Dynamic, Dynamic >
Eigen::PlainObjectBase::cols
EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT
Eigen::PlainObjectBase::rows
EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT
Eigen::internal::rwupdt
void rwupdt(Matrix< Scalar, Dynamic, Dynamic > &r, const Matrix< Scalar, Dynamic, 1 > &w, Matrix< Scalar, Dynamic, 1 > &b, Scalar alpha)
Definition:
rwupdt.h:8
Eigen::numext::b
const Scalar & b
Definition:
SpecialFunctionsImpl.h:2045
Eigen
: TensorContractionSycl.h, provides various tensor contraction kernel for SYCL backend
Eigen::Index
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
Eigen::DenseIndex
EIGEN_DEFAULT_DENSE_INDEX_TYPE DenseIndex
internal
InternalHeaderCheck.h
j
std::ptrdiff_t j