gtsam
3rdparty
Eigen
unsupported
Eigen
src
NonLinearOptimization
rwupdt.h
Go to the documentation of this file.
1
namespace
Eigen
{
2
3
namespace
internal
{
4
5
template
<
typename
Scalar>
6
void
rwupdt
(
7
Matrix< Scalar, Dynamic, Dynamic >
&r,
8
const
Matrix< Scalar, Dynamic, 1>
&
w
,
9
Matrix< Scalar, Dynamic, 1>
&
b
,
10
Scalar
alpha
)
11
{
12
typedef
DenseIndex
Index
;
13
14
const
Index
n
= r.
cols
();
15
eigen_assert
(r.
rows
()>=
n
);
16
std::vector<JacobiRotation<Scalar> > givens(
n
);
17
18
/* Local variables */
19
Scalar
temp, rowj;
20
21
/* Function Body */
22
for
(
Index
j
= 0;
j
<
n
; ++
j
) {
23
rowj =
w
[
j
];
24
25
/* apply the previous transformations to */
26
/* r(i,j), i=0,1,...,j-1, and to w(j). */
27
for
(
Index
i
= 0;
i
<
j
; ++
i
) {
28
temp = givens[
i
].c() * r(
i
,
j
) + givens[
i
].s() * rowj;
29
rowj = -givens[
i
].s() * r(
i
,
j
) + givens[
i
].c() * rowj;
30
r(
i
,
j
) = temp;
31
}
32
33
/* determine a givens rotation which eliminates w(j). */
34
givens[
j
].makeGivens(-r(
j
,
j
), rowj);
35
36
if
(rowj == 0.)
37
continue
;
// givens[j] is identity
38
39
/* apply the current transformation to r(j,j), b(j), and alpha. */
40
r(
j
,
j
) = givens[
j
].c() * r(
j
,
j
) + givens[
j
].s() * rowj;
41
temp = givens[
j
].c() *
b
[
j
] + givens[
j
].s() *
alpha
;
42
alpha
= -givens[
j
].s() *
b
[
j
] + givens[
j
].c() *
alpha
;
43
b
[
j
] = temp;
44
}
45
}
46
47
}
// end namespace internal
48
49
}
// end namespace Eigen
w
RowVector3d w
Definition:
Matrix_resize_int.cpp:3
Eigen
Namespace containing all symbols from the Eigen library.
Definition:
jet.h:637
alpha
RealScalar alpha
Definition:
level1_cplx_impl.h:147
b
Scalar * b
Definition:
benchVecAdd.cpp:17
eigen_assert
#define eigen_assert(x)
Definition:
Macros.h:1037
n
int n
Definition:
BiCGSTAB_simple.cpp:1
j
std::ptrdiff_t j
Definition:
tut_arithmetic_redux_minmax.cpp:2
Eigen::PlainObjectBase::rows
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT
Definition:
PlainObjectBase.h:143
Eigen::PlainObjectBase::cols
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT
Definition:
PlainObjectBase.h:145
Eigen::DenseIndex
EIGEN_DEFAULT_DENSE_INDEX_TYPE DenseIndex
Definition:
Meta.h:66
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:6
Eigen::Matrix< Scalar, Dynamic, Dynamic >
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 Fri Nov 1 2024 03:35:00