# SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.analysis.curvefit.interpolation.univariate

## Class DividedDifferences

• java.lang.Object
• com.numericalmethod.suanshu.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.
Wikipedia: Divided differences
• ### Constructor Summary

Constructors
Constructor and 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
Modifier and Type Method and 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.
• ### Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
• ### 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