Class DenseDoubleMatrix<R,C>
java.lang.Object
ubic.basecode.dataStructure.matrix.AbstractMatrix<R,C,Double>
ubic.basecode.dataStructure.matrix.DoubleMatrix<R,C>
ubic.basecode.dataStructure.matrix.DenseDoubleMatrix<R,C>
- All Implemented Interfaces:
Serializable,Matrix2D<R,,C, Double> PrimitiveMatrix<R,C, Double>
A dense matrix of doubles that knows about row and column names.
- Author:
- Paul Pavlidis
- See Also:
-
Field Summary
Fields inherited from class ubic.basecode.dataStructure.matrix.AbstractMatrix
MAX_ROWS_TO_PRINT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondouble[][]asArray()intcolumns()Get the number of columns the matrix has.copy()Create a deep copy of thisdoubleget(int row, int column) double[]getColByName(C s) Return a copy of a given column.Double[]getColObj(int col) getColRange(int startCol, int endCol) double[]getColumn(int col) getObject(int row, int col) Converts to a String that can be read by read.table in R, using default parametersdouble[]getRow(int row) Return a reference to a specific row.getRowArrayList(int i) double[]getRowByName(R s) Return a reference to a specific row.Double[]getRowObj(int row) getRowRange(int startRow, int endRow) booleanisMissing(int i, int j) Check if the value at a given index is missing.introws()Get the number of rows the matrix hasvoidintsize()subsetColumns(List<C> columns) Create a copy of this matrix with only the selected columns, in the selected order.subsetRows(List<R> rowNames) Create a copy of this matrix with only the selected rows, in the selected order.viewColumn(int column) viewRow(int row) Methods inherited from class ubic.basecode.dataStructure.matrix.DoubleMatrix
getByKeys, getColumnByName, getEntry, getRawMatrix, setByKeys, sortByColumnAbsoluteValues, toStringMethods inherited from class ubic.basecode.dataStructure.matrix.AbstractMatrix
addColumnName, addRowName, asDoubles, assign, checkColRange, checkRowRange, containsColumnName, containsRowName, getColIndexByName, getColName, getColNames, getRowIndexByName, getRowName, getRowNameMapIterator, getRowNames, hasColNames, hasMissingValues, hasRow, hasRowNames, numMissing, setColumnName, setColumnNames, setRowName, setRowNamesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface ubic.basecode.dataStructure.matrix.Matrix2D
addColumnName, asDoubles, assign, containsColumnName, containsRowName, getColIndexByName, getColName, getColNames, getRowIndexByName, getRowName, getRowNameMapIterator, getRowNames, hasColNames, hasRow, hasRowNames, numMissing, setColumnName, setColumnNames, setRowName, setRowNames
-
Constructor Details
-
DenseDoubleMatrix
public DenseDoubleMatrix(double[][] T) - Parameters:
T- double[][]
-
DenseDoubleMatrix
public DenseDoubleMatrix(int rows, int cols) - Parameters:
rows- intcols- int
-
-
Method Details
-
asArray
public double[][] asArray()- Specified by:
asArrayin classDoubleMatrix<R,C> - Returns:
- double[][]
-
columns
public int columns()Description copied from interface:Matrix2DGet the number of columns the matrix has.- Returns:
- int
-
copy
Description copied from class:DoubleMatrixCreate a deep copy of this- Specified by:
copyin classDoubleMatrix<R,C> - Returns:
- basecode.dataStructure.DenseDoubleMatrix2DNamed
-
get
public double get(int row, int column) - Specified by:
getin classDoubleMatrix<R,C> - Parameters:
row- intcolumn- int- Returns:
- See Also:
-
getColByName
Return a copy of a given column.- Parameters:
col- int- Returns:
- double[]
-
getColObj
- Parameters:
col-- Returns:
-
getColRange
- Specified by:
getColRangein classDoubleMatrix<R,C> - Parameters:
startCol- inclusive, numbered from zeroendCol- inclusive, numbered from zero- Returns:
- new matrix with just the requested range of columns from this
-
getColumn
public double[] getColumn(int col) - Specified by:
getColumnin classDoubleMatrix<R,C>
-
getObject
Converts to a String that can be read by read.table in R, using default parameters- Parameters:
row-col-- Returns:
- java.lang.String
-
getRow
public double[] getRow(int row) Return a reference to a specific row.- Specified by:
getRowin classDoubleMatrix<R,C> - Parameters:
row- int- Returns:
- double[]
-
getRowArrayList
- Specified by:
getRowArrayListin classDoubleMatrix<R,C>
-
getRowByName
Return a reference to a specific row.- Overrides:
getRowByNamein classDoubleMatrix<R,C> - Parameters:
s- String- Returns:
- double[]
-
getRowObj
- Parameters:
row-- Returns:
-
getRowRange
- Specified by:
getRowRangein classDoubleMatrix<R,C> - Parameters:
startRow- inclusive, numbered from zeroendRow- inclusive- Returns:
-
isMissing
public boolean isMissing(int i, int j) Description copied from interface:Matrix2DCheck if the value at a given index is missing.- Parameters:
i- rowj- column- Returns:
- true if the value is missing, false otherwise.
-
rows
public int rows()Description copied from interface:Matrix2DGet the number of rows the matrix has- Returns:
- int
-
set
- Parameters:
row-column-value-
-
size
public int size()- Specified by:
sizein classAbstractMatrix<R,C, Double> - Returns:
- int
- See Also:
-
subsetColumns
Description copied from class:DoubleMatrixCreate a copy of this matrix with only the selected columns, in the selected order.- Specified by:
subsetColumnsin classDoubleMatrix<R,C> - Parameters:
columns-- Returns:
-
subsetRows
Description copied from class:DoubleMatrixCreate a copy of this matrix with only the selected rows, in the selected order.- Specified by:
subsetRowsin classDoubleMatrix<R,C> - Parameters:
rowNames-- Returns:
-
transpose
- Specified by:
transposein classDoubleMatrix<R,C>
-
viewColumn
- Specified by:
viewColumnin classDoubleMatrix<R,C> - Parameters:
column- int- Returns:
- cern.colt.matrix.DoubleMatrix1D
-
viewRow
- Specified by:
viewRowin classDoubleMatrix<R,C> - Parameters:
row- int- Returns:
- DoubleMatrix1D
- See Also:
-