34 if(verbose) cout <<
"Steepest descent magnitude " <<
std::sqrt(x_u_norm_sq) <<
", Newton's method magnitude " <<
std::sqrt(x_n_norm_sq) << endl;
35 if(deltaSq < x_u_norm_sq) {
38 if(verbose) cout <<
"In steepest descent region with fraction " <<
std::sqrt(deltaSq / x_u_norm_sq) <<
" of steepest descent magnitude" << endl;
40 }
else if(deltaSq < x_n_norm_sq) {
42 return ComputeBlend(
delta, dx_u, dx_n, verbose);
44 assert(deltaSq >= x_n_norm_sq);
45 if(verbose) cout <<
"In pure Newton's method region" << endl;
57 const double un =
dot(x_u, x_n);
58 const double uu =
dot(x_u, x_u);
59 const double nn =
dot(x_n, x_n);
62 const double a = uu - 2.*un +
nn;
63 const double b = 2. * (un - uu);
68 double tau1 = (-
b + sqrt_b_m4ac) / (2.*
a);
69 double tau2 = (-
b - sqrt_b_m4ac) / (2.*
a);
74 if(-eps <= tau1 && tau1 <= 1.0 + eps) {
75 assert(!(-eps <= tau2 && tau2 <= 1.0 + eps));
78 assert(-eps <= tau2 && tau2 <= 1.0 + eps);
83 if(verbose) cout <<
"In blend region with fraction " << tau <<
" of Newton's method point" << endl;