|
SuanShu, a Java numerical and statistical library | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.numericalmethod.suanshu.analysis.function.rn2r1.UnivariateRealFunction
com.numericalmethod.suanshu.analysis.interpolation.NevilleTable
public class NevilleTable
Neville's algorithm is an algorithm for polynomial interpolation.
Given n + 1 points, there is a unique polynomial of degree ≤ n which associates with them.
Neville's algorithm evaluates this polynomial for a given input x.
This implementation is based on filling out the Neville table. This table can be used in two ways.
First, it can be used as a function to compute f(x).
Second, it can be used in an incremental manner by adding a few, say one, data points at a time. The user can examine the values in the table.
| Nested Class Summary | |
|---|---|
static class |
NevilleTable.DuplicatedAbscissae
RuntimeException thrown when there are duplicated abscissae. |
| Nested classes/interfaces inherited from interface com.numericalmethod.suanshu.analysis.function.Function |
|---|
Function.EvaluationException |
| Constructor Summary | |
|---|---|
NevilleTable()
Construct an empty Neville Table. |
|
NevilleTable(double[] x,
double[] y)
Construct an instance of a Neville Table, initialized with data {(x, y)}. |
|
NevilleTable(int n,
double[] x,
double[] y)
Construct an instance of a Neville Table with size n,
initialized with data {(x, y)}. |
|
| Method Summary | |
|---|---|
void |
addData(double[] x,
double[] y)
Add more data points for interpolation. |
double |
evaluate(double x)
Compute f(x). |
double |
get(int row,
int col)
Get the value of a table entry. |
int |
N()
Get the number of data points. |
double[][] |
table()
Get a copy of the Neville table. |
double[] |
X()
Get a copy of the x's. |
| Methods inherited from class com.numericalmethod.suanshu.analysis.function.rn2r1.UnivariateRealFunction |
|---|
dimension4Domain, dimension4Range, evaluate |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public NevilleTable(int n,
double[] x,
double[] y)
n,
initialized with data {(x, y)}.
The size n is only indicative. If there are more data points than n,
the table size will increase accordingly.
n - indicative size; make this big for reservation to add new data pointsx - the abscissaey - the ordinates
public NevilleTable(double[] x,
double[] y)
{(x, y)}.
x - the abscissaey - the ordinatespublic NevilleTable()
| Method Detail |
|---|
public void addData(double[] x,
double[] y)
addData in interface UnivariateRealInterpolatorx - the abscissaey - the ordinatespublic int N()
public double[][] table()
The returned value is independent and can be modified anyhow.
public double[] X()
The returned value is independent and can be modified anyhow.
public double get(int row,
int col)
row - row index, counting from 0col - column index, counting from 0
public double evaluate(double x)
UnivariateRealFunctionf(x).
evaluate in interface UnivariateRealInterpolatorevaluate in class UnivariateRealFunctionx - x
f(x)
|
SuanShu, a Java numerical and statistical library | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||