public interface DiscretizedFunc extends XY_DataSet
Description: Interface that all Discretized Functions must implement.
A Discretized Function is a collection of x and y values grouped together as the points that describe a function. A discretized form of a function is the only ways computers can represent functions. Instead of having y=x^2, you would have a sample of possible x and y values.
This functional framework is modeled after mathmatical functions such as sin(x), etc. It assumes that there are no duplicate x values, and that if two points have the same x value but different y values, they are still considered the same point. The framework also sorts the points along the x axis, so the first point contains the mimimum x-value and the last point contains the maximum value.
Since this API represents the points in a list, alot of these API functions are standard list access functions such as (paraphrasing) get(), set(), delete(). numElements(), iterator(), etc.
There are three fields along with getXXX() and setXXX() matching the field names. These javabean fields provide the basic information to describe a function. All functions have a name, information string, and a tolerance level that specifies how close two points have to be along the x axis to be considered equal.
Point2D = (x,y)
Note: This interface defines a tolerance so that you can say two x-values are the same within this tolerance limit. THERE IS NO TOLERANCE FOR THE Y-AXIS VALUES. This may be useful to add in the future.
| Modifier and Type | Method and Description |
|---|---|
DiscretizedFunc |
deepClone()
This function returns a new copy of this list, including copies of all the
points.
|
double |
getFirstInterpolatedX_inLogXLogYDomain(double y)
Given the input y value, finds the two sequential x values with the closest
y values, then calculates an interpolated x value for this y value, fitted
to the curve.
|
double |
getFirstInterpolatedX(double y)
Given the imput y value, finds the two sequential x values with the closest
y values, then calculates an interpolated x value for this y value, fitted
to the curve.
|
int |
getIndex(Point2D point)
Since the x-axis is sorted and points stored in a list, they can be
accessed by index.
|
double |
getInterpolatedY_inLogXLogYDomain(double x)
This function interpolates the Y values in the log space between x and y
values.
|
double |
getInterpolatedY_inLogYDomain(double x)
This function interpolates the Y values in the log-Y space.
|
double |
getInterpolatedY(double x)
Given the input x value, finds the two sequential x values with the closest
x values, then calculates an interpolated y value for this x value, fitted
to the curve.
|
double |
getTolerance()
Returns the tolerance of this function.
|
int |
getXIndex(double x)
Since the x-axis is sorted and points stored in a list, they can be
accessed by index.
|
double |
getY(double x)
returns the y-value given an x-value - within tolerance
|
void |
scale(double scale)
Scales (multiplies) the y-values of this function by the esupplied value.
|
void |
setTolerance(double newTolerance)
Sets the tolerance of this function.
|
areAllXValuesInteger, get, getClosestX, getClosestY, getInfo, getMaxX, getMaxY, getMetadataString, getMinX, getMinY, getNum, getX, getXAxisName, getXValuesIterator, getY, getYAxisName, getYValuesIterator, hasPoint, hasPoint, set, set, set, setInfo, setName, setXAxisName, setYAxisName, toString, xValues, yValuesforEach, iterator, spliteratorvoid setTolerance(double newTolerance)
double getTolerance()
double getY(double x)
double getFirstInterpolatedX(double y)
Since there may be multiple y values with the same value, this function just matches the first found starting at the x-min point along the x-axis.
double getInterpolatedY(double x)
double getInterpolatedY_inLogXLogYDomain(double x)
x - : X value in the linear space corresponding to which we are
required to find the interpolated y value in log space.double getInterpolatedY_inLogYDomain(double x)
x - : X value in the linear space corresponding to which we are
required to find the interpolated y value in log space.double getFirstInterpolatedX_inLogXLogYDomain(double y)
y - : Y value in the linear space corresponding to which we are
required to find the interpolated x value in the log space.int getXIndex(double x)
int getIndex(Point2D point)
void scale(double scale)
scale - DiscretizedFunc deepClone()
XY_DataSetSince this is a clone, you can modify it without changing the original.
deepClone in interface XY_DataSet