mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-07-06 13:15:14 +08:00
fix typo StableNorm
-> stableNorm
This commit is contained in:
parent
3ffefcb95c
commit
cd83f34d3a
@ -35,8 +35,8 @@ template <typename Vector, typename RealScalar>
|
|||||||
typename Vector::Scalar omega(const Vector& t, const Vector& s, RealScalar angle) {
|
typename Vector::Scalar omega(const Vector& t, const Vector& s, RealScalar angle) {
|
||||||
using numext::abs;
|
using numext::abs;
|
||||||
typedef typename Vector::Scalar Scalar;
|
typedef typename Vector::Scalar Scalar;
|
||||||
const RealScalar ns = s.StableNorm();
|
const RealScalar ns = s.stableNorm();
|
||||||
const RealScalar nt = t.StableNorm();
|
const RealScalar nt = t.stableNorm();
|
||||||
const Scalar ts = t.dot(s);
|
const Scalar ts = t.dot(s);
|
||||||
const RealScalar rho = abs(ts / (nt * ns));
|
const RealScalar rho = abs(ts / (nt * ns));
|
||||||
|
|
||||||
@ -77,7 +77,7 @@ bool idrs(const MatrixType& A, const Rhs& b, Dest& x, const Preconditioner& prec
|
|||||||
P = (qr.householderQ() * DenseMatrixType::Identity(N, S));
|
P = (qr.householderQ() * DenseMatrixType::Identity(N, S));
|
||||||
}
|
}
|
||||||
|
|
||||||
const RealScalar normb = b.StableNorm();
|
const RealScalar normb = b.stableNorm();
|
||||||
|
|
||||||
if (internal::isApprox(normb, RealScalar(0))) {
|
if (internal::isApprox(normb, RealScalar(0))) {
|
||||||
// Solution is the zero vector
|
// Solution is the zero vector
|
||||||
@ -110,7 +110,7 @@ bool idrs(const MatrixType& A, const Rhs& b, Dest& x, const Preconditioner& prec
|
|||||||
r_s = r;
|
r_s = r;
|
||||||
}
|
}
|
||||||
|
|
||||||
RealScalar normr = r.StableNorm();
|
RealScalar normr = r.stableNorm();
|
||||||
|
|
||||||
if (normr <= tolb) {
|
if (normr <= tolb) {
|
||||||
// Initial guess is a good enough solution
|
// Initial guess is a good enough solution
|
||||||
@ -166,7 +166,7 @@ bool idrs(const MatrixType& A, const Rhs& b, Dest& x, const Preconditioner& prec
|
|||||||
Scalar beta = f(k) / M(k, k);
|
Scalar beta = f(k) / M(k, k);
|
||||||
r = r - beta * G.col(k);
|
r = r - beta * G.col(k);
|
||||||
x = x + beta * U.col(k);
|
x = x + beta * U.col(k);
|
||||||
normr = r.StableNorm();
|
normr = r.stableNorm();
|
||||||
|
|
||||||
if (replacement && normr > tolb / mp) {
|
if (replacement && normr > tolb / mp) {
|
||||||
trueres = true;
|
trueres = true;
|
||||||
@ -176,10 +176,10 @@ bool idrs(const MatrixType& A, const Rhs& b, Dest& x, const Preconditioner& prec
|
|||||||
if (smoothing) {
|
if (smoothing) {
|
||||||
t = r_s - r;
|
t = r_s - r;
|
||||||
// gamma is a Scalar, but the conversion is not allowed
|
// gamma is a Scalar, but the conversion is not allowed
|
||||||
Scalar gamma = t.dot(r_s) / t.StableNorm();
|
Scalar gamma = t.dot(r_s) / t.stableNorm();
|
||||||
r_s = r_s - gamma * t;
|
r_s = r_s - gamma * t;
|
||||||
x_s = x_s - gamma * (x_s - x);
|
x_s = x_s - gamma * (x_s - x);
|
||||||
normr = r_s.StableNorm();
|
normr = r_s.stableNorm();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (normr < tolb || iter == maxit) {
|
if (normr < tolb || iter == maxit) {
|
||||||
@ -214,7 +214,7 @@ bool idrs(const MatrixType& A, const Rhs& b, Dest& x, const Preconditioner& prec
|
|||||||
|
|
||||||
r = r - om * t;
|
r = r - om * t;
|
||||||
x = x + om * v;
|
x = x + om * v;
|
||||||
normr = r.StableNorm();
|
normr = r.stableNorm();
|
||||||
|
|
||||||
if (replacement && normr > tolb / mp) {
|
if (replacement && normr > tolb / mp) {
|
||||||
trueres = true;
|
trueres = true;
|
||||||
@ -230,10 +230,10 @@ bool idrs(const MatrixType& A, const Rhs& b, Dest& x, const Preconditioner& prec
|
|||||||
// Smoothing:
|
// Smoothing:
|
||||||
if (smoothing) {
|
if (smoothing) {
|
||||||
t = r_s - r;
|
t = r_s - r;
|
||||||
Scalar gamma = t.dot(r_s) / t.StableNorm();
|
Scalar gamma = t.dot(r_s) / t.stableNorm();
|
||||||
r_s = r_s - gamma * t;
|
r_s = r_s - gamma * t;
|
||||||
x_s = x_s - gamma * (x_s - x);
|
x_s = x_s - gamma * (x_s - x);
|
||||||
normr = r_s.StableNorm();
|
normr = r_s.stableNorm();
|
||||||
}
|
}
|
||||||
|
|
||||||
iter++;
|
iter++;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user