8 template <
typename Scalar>
31 for (
j =
n - 1;
j >= 0; --
j) {
34 temp = epsmch * qrfac.col(
j).head(
j + 1).maxCoeff();
35 if (temp == 0.) temp = epsmch;
40 x[
j] = (qtb[
j] - qrfac.row(
j).tail(
n -
j - 1).dot(
x.tail(
n -
j - 1))) / temp;
44 qnorm =
diag.cwiseProduct(
x).stableNorm();
45 if (qnorm <=
delta)
return;
53 for (
j = 0;
j <
n; ++
j) {
54 wa1.tail(
n -
j) += qrfac.row(
j).tail(
n -
j) * qtb[
j];
60 gnorm = wa1.stableNorm();
63 if (gnorm == 0.)
goto algo_end;
70 for (
j = 0;
j <
n; ++
j) {
72 for (
i =
j;
i <
n; ++
i) {
73 sum += qrfac(
j,
i) * wa1[
i];
77 temp = wa2.stableNorm();
78 sgnorm = gnorm / temp / temp;
82 if (sgnorm >=
delta)
goto algo_end;
87 bnorm = qtb.stableNorm();
88 temp = bnorm / gnorm * (bnorm / qnorm) * (sgnorm /
delta);
AnnoyingScalar abs(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:135
AnnoyingScalar sqrt(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:134
int i
Definition: BiCGSTAB_step_by_step.cpp:9
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
#define eigen_assert(x)
Definition: Macros.h:910
SCALAR Scalar
Definition: bench_gemm.cpp:45
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT
Definition: PlainObjectBase.h:192
#define min(a, b)
Definition: datatypes.h:22
RealScalar alpha
Definition: level1_cplx_impl.h:151
const char const char const char * diag
Definition: level2_impl.h:86
void dogleg(const Matrix< Scalar, Dynamic, Dynamic > &qrfac, const Matrix< Scalar, Dynamic, 1 > &diag, const Matrix< Scalar, Dynamic, 1 > &qtb, Scalar delta, Matrix< Scalar, Dynamic, 1 > &x)
Definition: dogleg.h:9
EIGEN_DEVICE_FUNC bool abs2(bool x)
Definition: MathFunctions.h:1102
Namespace containing all symbols from the Eigen library.
Definition: bench_norm.cpp:70
std::array< T, N > array
Definition: EmulateArray.h:231
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:83
EIGEN_DEFAULT_DENSE_INDEX_TYPE DenseIndex
Definition: Meta.h:75
int delta
Definition: MultiOpt.py:96
Definition: Eigen_Colamd.h:49
double epsilon
Definition: osc_ring_sarah_asymptotics.h:43
list x
Definition: plotDoE.py:28
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2