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

Replace Dune::Identity with Dune::LinearFunction

parent 18c0b264
No related branches found
No related tags found
No related merge requests found
......@@ -16,13 +16,22 @@ class NiceFunction : public VirtualFunction<double, double> {
virtual double rightDifferential(double s) const = 0;
};
class Identity : public NiceFunction {
class LinearFunction : public NiceFunction {
public:
void virtual evaluate(double const& x, double& y) const { y = x; }
LinearFunction() {}
double virtual leftDifferential(double s) const { return 1; }
LinearFunction(double a) : coefficient(a) {}
double virtual rightDifferential(double s) const { return 1; }
void virtual evaluate(double const& x, double& y) const {
y = coefficient * x;
}
double virtual leftDifferential(double s) const { return coefficient; }
double virtual rightDifferential(double s) const { return coefficient; }
private:
double coefficient;
};
template <int slope> class SampleFunction : public NiceFunction {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment