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 void
addData(OrderedPairs f)
Add more points for interpolation.double
evaluate(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:OnlineInterpolator
Add more points for interpolation.- Specified by:
addData
in interfaceOnlineInterpolator
- Parameters:
f
- the points to be interpolated
-
evaluate
public double evaluate(double u)
Description copied from interface:UnivariateRealFunction
Evaluate y = f(x).- Specified by:
evaluate
in interfaceUnivariateRealFunction
- Parameters:
u
- x- Returns:
- f(x)
-
-