Class DividedDifferences
- java.lang.Object
-
- dev.nm.analysis.curvefit.interpolation.univariate.DividedDifferences
-
public class DividedDifferences extends Object
Divided differences is recursive division process for calculating the coefficients in the interpolation polynomial in the Newton form.- See Also:
- Wikipedia: Divided differences
-
-
Constructor Summary
Constructors Constructor Description DividedDifferences(OrderedPairs pairs)
Construct divided differences from a given collection of ordered pairs.DividedDifferences(SortedOrderedPairs sortedPairs)
Construct divided differences from a given sorted collection of ordered pairs.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
getDifference(int order)
Get the divided difference of the given order.int
maxOrder()
Get the maximum order which is limited by the number of points given for the computation.
-
-
-
Constructor Detail
-
DividedDifferences
public DividedDifferences(OrderedPairs pairs)
Construct divided differences from a given collection of ordered pairs.- Parameters:
pairs
- the collection of ordered pairs
-
DividedDifferences
public DividedDifferences(SortedOrderedPairs sortedPairs)
Construct divided differences from a given sorted collection of ordered pairs.- Parameters:
sortedPairs
- the sorted collection of ordered pairs
-
-
Method Detail
-
getDifference
public double getDifference(int order)
Get the divided difference of the given order.- Parameters:
order
- the order of divided difference- Returns:
- the divided difference
-
maxOrder
public int maxOrder()
Get the maximum order which is limited by the number of points given for the computation.- Returns:
- the maximum order of difference
-
-