Class LinearInterpolator
- java.lang.Object
-
- dev.nm.analysis.function.rn2r1.AbstractRealScalarFunction
-
- dev.nm.analysis.function.rn2r1.univariate.AbstractUnivariateRealFunction
-
- dev.nm.analysis.curvefit.interpolation.LinearInterpolator
-
- All Implemented Interfaces:
OnlineInterpolator,Function<Vector,Double>,RealScalarFunction,UnivariateRealFunction
public class LinearInterpolator extends AbstractUnivariateRealFunction implements OnlineInterpolator
Define a univariate function by linearly interpolating between adjacent points.- See Also:
- Wikipedia: Linear interpolation
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface dev.nm.analysis.function.Function
Function.EvaluationException
-
-
Constructor Summary
Constructors Constructor Description LinearInterpolator(OrderedPairs f)Construct a univariate function by linearly interpolating between adjacent points.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddData(OrderedPairs f)Add more points for interpolation.doubleevaluate(double u)Evaluate y = f(x).-
Methods inherited from class dev.nm.analysis.function.rn2r1.univariate.AbstractUnivariateRealFunction
evaluate
-
Methods inherited from class dev.nm.analysis.function.rn2r1.AbstractRealScalarFunction
dimensionOfDomain, dimensionOfRange
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface dev.nm.analysis.function.Function
dimensionOfDomain, dimensionOfRange
-
-
-
-
Constructor Detail
-
LinearInterpolator
public LinearInterpolator(OrderedPairs f)
Construct a univariate function by linearly interpolating between adjacent points.- Parameters:
f- the points to be interpolated
-
-
Method Detail
-
addData
public void addData(OrderedPairs f)
Description copied from interface:OnlineInterpolatorAdd more points for interpolation.- Specified by:
addDatain interfaceOnlineInterpolator- Parameters:
f- the points to be interpolated
-
evaluate
public double evaluate(double u)
Description copied from interface:UnivariateRealFunctionEvaluate y = f(x).- Specified by:
evaluatein interfaceUnivariateRealFunction- Parameters:
u- x- Returns:
- f(x)
-
-