Class VerticalDoubleDataBox

java.lang.Object
edu.cmu.tetrad.data.VerticalDoubleDataBox
All Implemented Interfaces:
DataBox, TetradSerializable, Serializable

public class VerticalDoubleDataBox extends Object implements DataBox
Stores a 2D array of double data.
Version:
$Id: $Id
Author:
josephramsey
See Also:
  • Constructor Details

    • VerticalDoubleDataBox

      public VerticalDoubleDataBox(int rows, int cols)
      Constructs an 2D double array consisting entirely of missing values (Double.NaN).
      Parameters:
      rows - a int
      cols - a int
    • VerticalDoubleDataBox

      public VerticalDoubleDataBox(double[][] data)
      Constructs a new data box using the given 2D double data array as data.
      Parameters:
      data - an array of double objects
    • VerticalDoubleDataBox

      public VerticalDoubleDataBox(DataBox dataBox)
      Copies the data from the given data box into this one.
      Parameters:
      dataBox - a DataBox object
  • Method Details

    • serializableInstance

      public static BoxDataSet serializableInstance()
      Generates a simple exemplar of this class to test serialization.
      Returns:
      a BoxDataSet object
    • numRows

      public int numRows()

      numRows.

      Specified by:
      numRows in interface DataBox
      Returns:
      the number of rows in this data box.
    • numCols

      public int numCols()

      numCols.

      Specified by:
      numCols in interface DataBox
      Returns:
      the number of columns in this data box.
    • set

      public void set(int row, int col, Number value)
      Sets the value at the given row and column to the given Number. This number may be interpreted differently depending on how values are stored. A value of null is interpreted as a missing value.

      Sets the value at the given row/column to the given Number value. The value used is number.doubleValue().

      Specified by:
      set in interface DataBox
      Parameters:
      row - the row index.
      col - the column index.
      value - the value to store.
    • get

      public Number get(int row, int col)

      get.

      Specified by:
      get in interface DataBox
      Parameters:
      row - the row index.
      col - the column index.
      Returns:
      the value at the given row and column as a Number. If the value is missing, null is uniformly returned.
    • getVariableVectors

      public double[][] getVariableVectors()

      getVariableVectors.

      Returns:
      an array of double objects
    • copy

      public DataBox copy()

      copy.

      Specified by:
      copy in interface DataBox
      Returns:
      a copy of this data box.
    • like

      public DataBox like()

      like.

      Specified by:
      like in interface DataBox
      Returns:
      a DataBox of type DoubleDataBox, but with the given dimensions.
    • viewSelection

      public DataBox viewSelection(int[] rows, int[] cols)

      viewSelection.

      Specified by:
      viewSelection in interface DataBox
      Parameters:
      rows - the row indices.
      cols - the column indices.
      Returns:
      this data box, restricted to the given rows and columns.