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
ConstructorsConstructorDescriptionDoublesDataSet(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 TypeMethodDescriptiondoublebinWidth()Separation between points along x; should be uniform.double[]Returns copy of the array of points f(x) to integrate (y-axis).doublegetFxPoint(int index) Point f(x) at index.double[]getX()Returns copy of the array of points x (x-axis).booleanDoes this data set have half-width start/end bins.doubleLower bound of the points along x.intNumber of points along x.toString()doubleUpper 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:
getAllFxPointsin interfaceDataSet- Returns:
- an array of double values.
-
getFxPoint
public double getFxPoint(int index) Point f(x) at index.- Specified by:
getFxPointin 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:
halfWidthEndsin interfaceDataSet- Returns:
- a boolean.
-
lowerBound
public double lowerBound()Lower bound of the points along x.- Specified by:
lowerBoundin 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:
upperBoundin interfaceDataSet- Returns:
- a double.
-