Class DoubleMatrix<R,C>
java.lang.Object
ubic.basecode.dataStructure.matrix.AbstractMatrix<R,C,Double>
ubic.basecode.dataStructure.matrix.DoubleMatrix<R,C>
- All Implemented Interfaces:
Serializable
,Matrix2D<R,
,C, Double> PrimitiveMatrix<R,
C, Double>
- Direct Known Subclasses:
CompressedSparseDoubleMatrix
,DenseDoubleMatrix
,FastRowAccessDoubleMatrix
,SparseDoubleMatrix
,SparseRaggedDoubleMatrix
public abstract class DoubleMatrix<R,C>
extends AbstractMatrix<R,C,Double>
implements PrimitiveMatrix<R,C,Double>
Abstract base class for 2D matrices of double values with named columns and rows.
- Author:
- 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 TypeMethodDescriptionabstract double[][]
asArray()
abstract DoubleMatrix
<R, C> copy()
Create a deep copy of thisabstract double
get
(int j, int i) abstract DoubleMatrix
<R, C> getColRange
(int startCol, int endCol) abstract double[]
getColumn
(int j) double[]
getColumnByName
(C s) getEntry
(int row, int column) double[][]
abstract double[]
getRow
(int i) abstract DoubleArrayList
getRowArrayList
(int i) double[]
getRowByName
(R s) abstract DoubleMatrix
<R, C> getRowRange
(int startRow, int endRow) void
sortByColumnAbsoluteValues
(int i, boolean descending) abstract DoubleMatrix
<R, C> subsetColumns
(List<C> columns) Create a copy of this matrix with only the selected columns, in the selected order.abstract DoubleMatrix
<R, C> subsetRows
(List<R> rowNames) Create a copy of this matrix with only the selected rows, in the selected order.final String
toString()
abstract DoubleMatrix
<C, R> abstract DoubleMatrix1D
viewColumn
(int column) abstract DoubleMatrix1D
viewRow
(int j) Methods 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, setRowNames, size
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface ubic.basecode.dataStructure.matrix.Matrix2D
addColumnName, asDoubles, assign, columns, containsColumnName, containsRowName, getColIndexByName, getColName, getColNames, getRowIndexByName, getRowName, getRowNameMapIterator, getRowNames, hasColNames, hasRow, hasRowNames, isMissing, numMissing, rows, set, setColumnName, setColumnNames, setRowName, setRowNames
Methods inherited from interface ubic.basecode.dataStructure.matrix.PrimitiveMatrix
getColObj, getObject, getRowObj
-
Constructor Details
-
DoubleMatrix
public DoubleMatrix()
-
-
Method Details
-
asArray
public abstract double[][] asArray() -
copy
Create a deep copy of this- Returns:
- a deep copy of this
-
get
public abstract double get(int j, int i) - Parameters:
j
-i
-- Returns:
-
getByKeys
-
getColRange
- Parameters:
startCol
- inclusive, numbered from zeroendCol
- inclusive, numbered from zero- Returns:
- new matrix with just the requested range of columns from this
-
getColumn
public abstract double[] getColumn(int j) -
getColumnByName
- Parameters:
s
- String- Returns:
- double[]
-
getEntry
-
getRawMatrix
public double[][] getRawMatrix() -
getRow
public abstract double[] getRow(int i) -
getRowArrayList
-
getRowByName
- Parameters:
s
- String- Returns:
- double[]
-
getRowRange
- Parameters:
startRow
- inclusive, numbered from zeroendRow
- inclusive- Returns:
-
setByKeys
-
sortByColumnAbsoluteValues
- Parameters:
i
-descending
-
-
subsetColumns
Create a copy of this matrix with only the selected columns, in the selected order.- Parameters:
columns
-- Returns:
-
subsetRows
Create a copy of this matrix with only the selected rows, in the selected order.- Parameters:
rowNames
-- Returns:
-
toString
-
transpose
-
viewColumn
-
viewRow
- Parameters:
j
-- Returns:
-