Class DoublesDataSet

java.lang.Object
ffx.numerics.integrate.DoublesDataSet
All Implemented Interfaces:
DataSet

public class DoublesDataSet extends Object implements DataSet
Describes a set of x, f(x) obtained by some mechanism; intended for numerical integration.
Author:
Jacob M. Litman
  • Constructor Summary

    Constructors
    Constructor
    Description
    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).
    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).
    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 Type
    Method
    Description
    double
    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[]
    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.
    double
    Upper bound of the points along x.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • 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 known
      fX - 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 known
      fX - Values/estimates of f(x)
      halvedEnds - Whether the first and last bins are half-width (such as OST)
    • DoublesDataSet

      public 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. Used primarily for testing purposes.
      Parameters:
      set - DataSet to cast
  • Method Details

    • binWidth

      public double binWidth()
      Separation between points along x; should be uniform.
      Specified by:
      binWidth in interface DataSet
      Returns:
      a double.
    • getAllFxPoints

      public double[] getAllFxPoints()
      Returns copy of the array of points f(x) to integrate (y-axis).
      Specified by:
      getAllFxPoints in interface DataSet
      Returns:
      an array of
      invalid reference
      double
      objects.
    • getFxPoint

      public double getFxPoint(int index)
      Point f(x) at index.
      Specified by:
      getFxPoint in interface DataSet
      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).
      Specified by:
      getX in interface DataSet
      Returns:
      an array of
      invalid reference
      double
      objects.
    • 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 interface DataSet
      Returns:
      a boolean.
    • lowerBound

      public double lowerBound()
      Lower bound of the points along x.
      Specified by:
      lowerBound in interface DataSet
      Returns:
      a double.
    • numPoints

      public int numPoints()
      Number of points along x.
      Specified by:
      numPoints in interface DataSet
      Returns:
      the number of points.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • upperBound

      public double upperBound()
      Upper bound of the points along x.
      Specified by:
      upperBound in interface DataSet
      Returns:
      a double.