org.broadinstitute.genee.matrix
Class RowMajorArray2DDataset

java.lang.Object
  extended by org.broadinstitute.genee.matrix.AbstractDataset
      extended by org.broadinstitute.genee.matrix.FixedSizeAbstractDataset
          extended by org.broadinstitute.genee.matrix.RowMajorArray2DDataset
All Implemented Interfaces:
Dataset

public class RowMajorArray2DDataset
extends FixedSizeAbstractDataset

Dataset implementation using two-dimensional float array.


Constructor Summary
RowMajorArray2DDataset(String name, float[][] array)
          Creates a new dataset with the specified name and array.
RowMajorArray2DDataset(String name, int rows, int columns)
          Creates a new dataset
 
Method Summary
 float[][] getArray()
          Gets the underlying float[][] array
 float getValue(int row, int column)
          Returns the value at the given row and column.
 void setArray(float[][] array)
          Sets the underlying float[][] array
 void setValue(int rowIndex, int columnIndex, float value)
          Sets the value at the given row and column indices.
 
Methods inherited from class org.broadinstitute.genee.matrix.FixedSizeAbstractDataset
addSeries, getColumnCount, getColumnMetadata, getRowCount, getRowMetadata, setColumnMetadata, setRowMetadata
 
Methods inherited from class org.broadinstitute.genee.matrix.AbstractDataset
addSeries, getName, getObjectValue, getProperty, getPropertyKeys, getSeriesClass, getSeriesCount, getSeriesName, getValue, removeSeries, setName, setObjectValue, setProperty
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RowMajorArray2DDataset

public RowMajorArray2DDataset(String name,
                              float[][] array)
Creates a new dataset with the specified name and array.

Parameters:
the - dataset name
array - the data array

RowMajorArray2DDataset

public RowMajorArray2DDataset(String name,
                              int rows,
                              int columns)
Creates a new dataset

Parameters:
name - the dataset name
rows - the number of rows
columns - the number of columns
Method Detail

getArray

public float[][] getArray()
Gets the underlying float[][] array

Returns:
the array

getValue

public float getValue(int row,
                      int column)
Description copied from interface: Dataset
Returns the value at the given row and column.

Parameters:
row - the row index.
column - the column index.
Returns:
the value.

setArray

public void setArray(float[][] array)
Sets the underlying float[][] array

Parameters:
array - the array

setValue

public void setValue(int rowIndex,
                     int columnIndex,
                     float value)
Description copied from interface: Dataset
Sets the value at the given row and column indices.

Parameters:
rowIndex - the row index
columnIndex - the column index
value - the value