public class NumericTable extends MutableTable<java.lang.Double> implements IterableRowsTable
rowData
Constructor and Description |
---|
NumericTable()
Default constructor.
|
NumericTable(double[][] data)
Construct a table from an 2-d array of doubles.
|
NumericTable(int numRows,
int numColumns)
Construct a table with a specified number of rows and columns.
|
Modifier and Type | Method and Description |
---|---|
double[][] |
asDoubleArray()
Returns a double array representation of the table.
|
void |
fill(java.util.List<SimbrainJTable.CellIndex> cellIndices,
double val)
Fill the table at selected indices with the indicated value.
|
int |
getCurrentRow()
Returns the current row.
|
java.lang.Class<?> |
getDataType()
Returns the datatype (T) for a given table type.
|
(package private) java.lang.Double |
getDefaultValue()
Returns the default cell value for a given table type.
|
int |
getLowerBound()
Lower bound for (e.g.) randomization.
|
int |
getUpperBound()
Upper bound for (e.g.) randomization.
|
double |
getValueCurrentRow(int column)
Get the value of the specified column in the current row.
|
double[] |
getVectorCurrentRow()
Return the current row of doubles as an array.
|
protected void |
init(int rows,
int cols)
Initialize the table.
|
boolean |
isIterationMode() |
void |
normalizeColumn(int columnIndex)
Normalize data in selected column.
|
void |
normalizeTable()
Normalize the whole table.
|
void |
randomize(java.util.List<SimbrainJTable.CellIndex> cellIndices)
Randomize neurons within specified bounds.
|
void |
readData(java.io.File file,
boolean allowRowChanges,
boolean allowColumnChanges)
Load a .csv file.
|
void |
setCurrentRow(int currentRow)
Sets the current row.
|
void |
setData(double[][] data)
Reset data using a 2-d array of doubles.
|
void |
setIterationMode(boolean iterationMode) |
void |
setLowerBound(int lowerBound)
Sets the lower bound .
|
void |
setUpperBound(int upperBound)
Sets the upper bound value.
|
void |
setValueCurrentRow(int column,
double value)
Set the values of the specified column in the current row.
|
void |
setVectorCurrentRow(double[] data)
Set the current row using an array of doubles.
|
void |
updateCurrentRow()
Increment the current row.
|
addColumn, addColumns, addColumns, addRow, addRows, addRows, checkData, createNewRow, createNewRow, insertColumn, insertColumn, insertRow, insertRow, modifyRowsColumns, removeColumn, removeColumn, removeRow, removeRow, reset, reset
addTableModelListener, asFlatList, asStringArray, fill, getColumnClass, getColumnCount, getColumnName, getLogicalColumnCount, getLogicalValueAt, getRowCount, getValueAt, getXStream, isCellEditable, setColumnHeadings, setDisplayColumnHeadings, setLogicalValue, setValue, setValue, setValueAt, shuffle
public NumericTable(int numRows, int numColumns)
numRows
- number of rows.numColumns
- number of columns.public NumericTable(double[][] data)
data
- array of doublespublic NumericTable()
protected void init(int rows, int cols)
rows
- num rowscols
- num colspublic java.lang.Class<?> getDataType()
SimbrainDataTable
getDataType
in class SimbrainDataTable<java.lang.Double>
java.lang.Double getDefaultValue()
SimbrainDataTable
getDefaultValue
in class SimbrainDataTable<java.lang.Double>
public void setData(double[][] data)
data
- the new datapublic void setVectorCurrentRow(double[] data)
data
- the values to use in setting the current rowpublic double[] getVectorCurrentRow()
public void setValueCurrentRow(int column, double value)
column
- column indexvalue
- value to setpublic double getValueCurrentRow(int column)
column
- column indexpublic int getCurrentRow()
IterableRowsTable
getCurrentRow
in interface IterableRowsTable
public void setCurrentRow(int currentRow)
IterableRowsTable
setCurrentRow
in interface IterableRowsTable
currentRow
- current row to setpublic void updateCurrentRow()
IterableRowsTable
updateCurrentRow
in interface IterableRowsTable
public boolean isIterationMode()
public void setIterationMode(boolean iterationMode)
iterationMode
- the iterationMode to setpublic int getLowerBound()
public void setLowerBound(int lowerBound)
lowerBound
- value to setpublic int getUpperBound()
public void setUpperBound(int upperBound)
upperBound
- Value to setpublic void readData(java.io.File file, boolean allowRowChanges, boolean allowColumnChanges) throws TableDataException
file
- the CSV fileallowRowChanges
- whether to allow data with a different number of
rowsallowColumnChanges
- whether to allow data with a different number
of columnsTableDataException
public double[][] asDoubleArray()
public void fill(java.util.List<SimbrainJTable.CellIndex> cellIndices, double val)
cellIndices
- list of cell indices.val
- the value to fillpublic void randomize(java.util.List<SimbrainJTable.CellIndex> cellIndices)
cellIndices
- list of cell indices.public void normalizeTable()
public void normalizeColumn(int columnIndex)
columnIndex
- column to normalize.