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

Assertions

parent d49dfbc1
No related branches found
No related tags found
No related merge requests found
......@@ -99,16 +99,20 @@ template <int dimension> class LocalNonlinearity {
y += tmp;
}
// TODO: do not evaluate at zero
void upperGradient(VectorType const &x, VectorType &ret) const {
double const xnorm = x.two_norm();
assert(xnorm != 0);
ret = x;
ret *= func_->rightDifferential(x.two_norm()) / x.two_norm();
ret *= func_->rightDifferential(xnorm) / xnorm;
}
// TODO: do not evaluate at zero
void lowerGradient(VectorType const &x, VectorType &ret) const {
double const xnorm = x.two_norm();
assert(xnorm != 0);
ret = x;
ret *= func_->leftDifferential(x.two_norm()) / x.two_norm();
ret *= func_->leftDifferential(xnorm) / xnorm;
}
void directionalDomain(VectorType const &, VectorType const &,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment