Skip to content
Snippets Groups Projects
Commit ea23ff25 authored by Elias Pipping's avatar Elias Pipping Committed by Elias Pipping
Browse files

normX -> xnorm

parent 569cf70d
No related branches found
No related tags found
No related merge requests found
......@@ -69,17 +69,17 @@ template <int dimension> class LocalFriction {
\f}
*/
void addHessian(VectorType const &x, MatrixType &A) const {
double const normX2 = x.two_norm2();
double const normX = std::sqrt(normX2);
double const normX3 = normX * normX2;
double const xnorm2 = x.two_norm2();
double const xnorm = std::sqrt(xnorm2);
double const xnorm3 = xnorm * xnorm2;
double const H1 = func->rightDifferential(normX);
double const H2 = func->second_deriv(normX);
double const H1 = func->rightDifferential(xnorm);
double const H2 = func->second_deriv(xnorm);
// TODO: potential optimisation: factor out (H1 / normX), get rid of normX3
double const weight1 = H2 / normX2;
double const weight2 = -H1 / normX3;
double const weight3 = H1 / normX;
// TODO: potential optimisation: factor out (H1 / xnorm), get rid of xnorm3
double const weight1 = H2 / xnorm2;
double const weight2 = -H1 / xnorm3;
double const weight3 = H1 / xnorm;
// {{{ In what follows, we handle the case 0 * (1/x) = 0 with x
// close to 0.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment