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

Use references

parent 9560cff7
No related branches found
No related tags found
No related merge requests found
......@@ -21,7 +21,7 @@ template <int dimension> class LocalNonlinearity {
LocalNonlinearity(shared_ptr<NiceFunction const> func) : func_(func) {}
double operator()(VectorType const x) const {
double operator()(VectorType const &x) const {
double ret;
func_->evaluate(x.two_norm(), ret);
return ret;
......@@ -29,7 +29,7 @@ template <int dimension> class LocalNonlinearity {
// directional subdifferential: at u on the line u + t*v
// u and v are assumed to be non-zero
void directionalSubDiff(VectorType const u, VectorType const v,
void directionalSubDiff(VectorType const &u, VectorType const &v,
Interval<double> &D) const {
if (u.two_norm() == 0) {
D[0] = D[1] = func_->rightDifferential(0) * v.two_norm();
......@@ -47,12 +47,12 @@ template <int dimension> class LocalNonlinearity {
}
}
void upperGradient(VectorType const x, VectorType &ret) const {
void upperGradient(VectorType const &x, VectorType &ret) const {
ret = x;
ret *= func_->rightDifferential(x.two_norm()) / x.two_norm();
}
void lowerGradient(VectorType const x, VectorType &ret) const {
void lowerGradient(VectorType const &x, VectorType &ret) const {
ret = x;
ret *= func_->leftDifferential(x.two_norm()) / x.two_norm();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment