edu.rit.numeric
Class SampledXYSeries
- java.lang.Object
-
- edu.rit.numeric.XYSeries
-
- edu.rit.numeric.SampledXYSeries
-
public class SampledXYSeries extends XYSeries
Class SampledXYSeries provides a series of (x,y) pairs of real values (type double) where the Y values are computed by sampling a Function for a series of X values.Class SampledXYSeries is implemented to minimize space rather than time. Each time x() is called, the x value is computed anew. Each time y() is called, the x value is computed anew, then the y value is computed anew by evaluating the function at x.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class edu.rit.numeric.XYSeries
XYSeries.Regression
-
-
Constructor Summary
Constructors Constructor and Description SampledXYSeries(Function theFunction, double xinit, double delta, int len)Construct a new sampled series sampling values of the given function.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description intlength()Returns the number of values in this series.doublex(int i)Returns the given X value in this series.doubley(int i)Returns the given Y value in this series.
-
-
-
Constructor Detail
-
SampledXYSeries
public SampledXYSeries(Function theFunction, double xinit, double delta, int len)
Construct a new sampled series sampling values of the given function. The y values at indexes 0, 1, 2, ... len-1 are computed by evaluating theFunction at the x values xinit, xinit+delta, xinit+2*delta, ... xinit+(len-1)*delta.- Parameters:
theFunction- Function to sample.xinit- Initial x value.delta- Difference between successive x values.len- Length (number of (x,y) pairs).- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if theFunction is null.java.lang.IllegalArgumentException- (unchecked exception) Thrown if len is less than 0.
-
-
DMelt 3.0 © DataMelt by jWork.ORG