Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/org/dive4elements/river/artifacts/math/UnivariateRealFunctionFunction.java @ 5831:bd047b71ab37
Repaired internal references
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Thu, 25 Apr 2013 12:06:39 +0200 |
parents | flys-artifacts/src/main/java/de/intevation/flys/artifacts/math/UnivariateRealFunctionFunction.java@893b2477208f |
children |
comparison
equal
deleted
inserted
replaced
5830:160f53ee0870 | 5831:bd047b71ab37 |
---|---|
1 package org.dive4elements.river.artifacts.math; | |
2 | |
3 import org.apache.commons.math.FunctionEvaluationException; | |
4 | |
5 import org.apache.commons.math.analysis.UnivariateRealFunction; | |
6 | |
7 public final class UnivariateRealFunctionFunction | |
8 implements Function | |
9 { | |
10 private UnivariateRealFunction function; | |
11 | |
12 public UnivariateRealFunctionFunction(UnivariateRealFunction function) { | |
13 this.function = function; | |
14 } | |
15 | |
16 @Override | |
17 public double value(double x) { | |
18 try { | |
19 return function.value(x); | |
20 } | |
21 catch (FunctionEvaluationException fee) { | |
22 return Double.NaN; | |
23 } | |
24 } | |
25 | |
26 public UnivariateRealFunction getFunction() { | |
27 return function; | |
28 } | |
29 | |
30 public void setFunction(UnivariateRealFunction function) { | |
31 this.function = function; | |
32 } | |
33 } | |
34 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |