|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Integrator
This interface defines calculus of numerical integration. It may be used in
different ways. Either you can set a list of x/y values using the
setData(double[], double[]) method, or you can start the integrator with
initData(double, double) and then add values during the life-time of the
integrator using the add(double, double) method. Calling getIntegral()
returns the numerical integral over all values added. Limiting the
integration borders can be done either by calling getIntegral()
twice with different x-values, or by ereasing all previously added
values with a call to initData(double, double).
For performance issues, the differentiator uses primitive data types instead
of Double objects.
| Method Summary | |
|---|---|
void |
add(double y)
Adds a new point to the data set, stating only a y value for an equally-spaced data set. |
void |
add(double x,
double y)
Adds a new point to the data set, stating both, the x and y value. |
double |
getIntegral()
Calculates the numerical integral over the entire set. |
double |
getIntegral(double upper)
Calculates the numerical integral from the start of the set up to the desired upper-boundary. |
void |
initData(double xfirst,
double yfirst)
Erases all previously added data points, starting a new data set. |
void |
setData(double[] y)
Sets an equally-spaced y-data set. |
void |
setData(double[] x,
double[] y)
Sets an entire list of x/y data points. |
| Method Detail |
|---|
void setData(double[] x,
double[] y)
x - A double-array representing the x-axis values.y - A double-array representing the y-axis values.void setData(double[] y)
y - A double-array representing the y-axis values.
void add(double x,
double y)
initData(double, double).
Note that not
necessarily all integrators must implement both methods, i.e.
the equally-spaced and the x/y independently settable.
x - A newly added x-value.y - A newly added y-value.void add(double y)
initData(double, double). Note that not
necessarily all integrators must implement both methods, i.e.
the equally-spaced and the x/y independently settable.
y - A newly added y-value.
void initData(double xfirst,
double yfirst)
getIntegral().
double getIntegral()
double getIntegral(double upper)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||