Package ffx.numerics.integrate
Class DoublesDataSet
java.lang.Object
ffx.numerics.integrate.DoublesDataSet
- All Implemented Interfaces:
DataSet
Describes a set of x, f(x) obtained by some mechanism; intended for numerical integration.
- Author:
- Jacob M. Litman
-
Constructor Summary
ConstructorDescriptionDoublesDataSet
(double[] x, double[] fX) Constructs a DataSet from actual data, with no known underlying function (or at least none with an analytically solved integral).DoublesDataSet
(double[] x, double[] fX, boolean halvedEnds) Constructs a DataSet from actual data, with no known underlying function (or at least none with an analytically solved integral).DoublesDataSet
(DataSet set) Constructs a DataSet from another DataSet, effectively masquerading a test set such as a sine wave as data from an "unknown" function. -
Method Summary
Modifier and TypeMethodDescriptiondouble
binWidth()
Separation between points along x; should be uniform.double[]
Returns copy of the array of points f(x) to integrate (y-axis).double
getFxPoint
(int index) Point f(x) at index.double[]
getX()
Returns copy of the array of points x (x-axis).boolean
Does this data set have half-width start/end bins.double
Lower bound of the points along x.int
Number of points along x.toString()
double
Upper bound of the points along x.
-
Constructor Details
-
DoublesDataSet
public DoublesDataSet(double[] x, double[] fX) Constructs a DataSet from actual data, with no known underlying function (or at least none with an analytically solved integral). Assumes no half-width end bins (such as found in OST).- Parameters:
x
- Points where f(x) is knownfX
- Values/estimates of f(x)
-
DoublesDataSet
public DoublesDataSet(double[] x, double[] fX, boolean halvedEnds) Constructs a DataSet from actual data, with no known underlying function (or at least none with an analytically solved integral).- Parameters:
x
- Points where f(x) is knownfX
- Values/estimates of f(x)halvedEnds
- Whether the first and last bins are half-width (such as OST)
-
DoublesDataSet
Constructs a DataSet from another DataSet, effectively masquerading a test set such as a sine wave as data from an "unknown" function. Used primarily for testing purposes.- Parameters:
set
- DataSet to cast
-
-
Method Details
-
binWidth
public double binWidth()Separation between points along x; should be uniform. -
getAllFxPoints
public double[] getAllFxPoints()Returns copy of the array of points f(x) to integrate (y-axis).- Specified by:
getAllFxPoints
in interfaceDataSet
- Returns:
- an array of
invalid reference
double
-
getFxPoint
public double getFxPoint(int index) Point f(x) at index.- Specified by:
getFxPoint
in interfaceDataSet
- Parameters:
index
- the index of the point to return.- Returns:
- a double.
-
getX
public double[] getX()Returns copy of the array of points x (x-axis). -
halfWidthEnds
public boolean halfWidthEnds()Does this data set have half-width start/end bins. Intended for OST, where the first and last bins are half the regular width.- Specified by:
halfWidthEnds
in interfaceDataSet
- Returns:
- a boolean.
-
lowerBound
public double lowerBound()Lower bound of the points along x.- Specified by:
lowerBound
in interfaceDataSet
- Returns:
- a double.
-
numPoints
public int numPoints()Number of points along x. -
toString
-
upperBound
public double upperBound()Upper bound of the points along x.- Specified by:
upperBound
in interfaceDataSet
- Returns:
- a double.
-