|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.nrao.sss.math.CubicSpline
public class CubicSpline
An interpolated value calculator that uses cubic spline interpolation.
Version Info:
$Revision: 568 $ |
$Date: 2007-04-27 16:53:09 -0600 (Fri, 27 Apr 2007) $ |
$Author: dharland $ |
Constructor Summary | |
---|---|
CubicSpline()
Creates a new instance. |
Method Summary | |
---|---|
Point2D |
addPoint(Point2D newPoint)
Adds a copy of newPoint to this interpolator. |
void |
clear()
Clears all points from this interpolator. |
double |
getComputedValueFor(double x)
Called by public getValueFor(double x). |
NumberInterval |
getDomain()
Returns an interval whose endpoints are the smallest and largest independent ("x") values of the points held by this interpolator. |
List<Point2D> |
getPoints()
Returns a list containing a copy of each point held by this interpolator. |
double |
getValueFor(double x)
Returns a value, f(x), for the given value. |
Point2D |
removePoint(double xValue)
Removes from this interpolator the point, if any, with an independent variable equal to xValue . |
void |
setPoints(List<? extends Point2D> points)
Adds a copy of each of the points in the list to this interpolator. |
int |
size()
Returns the number of points held by this interpolator. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CubicSpline()
Method Detail |
---|
public double getComputedValueFor(double x)
public double getValueFor(double x)
Interpolator
If the value x
is outside the domain
of this
interpolator, and IllegalArgumentException
is thrown.
getValueFor
in interface Interpolator
x
- the independent variable for which a dependent variable,
f(x) is sought.
public void setPoints(List<? extends Point2D> points)
Interpolator
If any of the new points holds an x-value equal to that of a point already held by this interpolator, the already-held point is first removed, and then the new point is added.
setPoints
in interface Interpolator
points
- a list of new points to be added to this interpolator.public Point2D addPoint(Point2D newPoint)
Interpolator
newPoint
to this interpolator.
If this interpolator already contains a point with the same x-value as
newPoint
, that point is first removed and is also the value
returned.
addPoint
in interface Interpolator
newPoint
- a point to be added to this interpolator.
newPoint
, or null if this interpolator held
no such point.public Point2D removePoint(double xValue)
Interpolator
xValue
.
removePoint
in interface Interpolator
xValue
- the independent variable of the point to be removed.
xValue
. If this
interpolator holds no such point, null is returned.public void clear()
Interpolator
clear
in interface Interpolator
public int size()
Interpolator
size
in interface Interpolator
public List<Point2D> getPoints()
Interpolator
getPoints
in interface Interpolator
public NumberInterval getDomain()
Interpolator
getDomain
in interface Interpolator
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |