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:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class ubic.basecode.dataStructure.matrix.AbstractMatrix
MAX_ROWS_TO_PRINT
-
-
Constructor Summary
Constructors Constructor Description DoubleMatrix()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract double[][]
asArray()
abstract DoubleMatrix<R,C>
copy()
Create a deep copy of thisabstract double
get(int j, int i)
Double
getByKeys(R r, C c)
abstract DoubleMatrix<R,C>
getColRange(int startCol, int endCol)
abstract double[]
getColumn(int j)
double[]
getColumnByName(C s)
Double
getEntry(int row, int column)
double[][]
getRawMatrix()
abstract double[]
getRow(int i)
abstract cern.colt.list.DoubleArrayList
getRowArrayList(int i)
double[]
getRowByName(R s)
abstract DoubleMatrix<R,C>
getRowRange(int startRow, int endRow)
void
setByKeys(R r, C c, Double v)
List<R>
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.String
toString()
abstract DoubleMatrix<C,R>
transpose()
abstract cern.colt.matrix.DoubleMatrix1D
viewColumn(int column)
abstract cern.colt.matrix.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
-
-
-
-
Method Detail
-
asArray
public abstract double[][] asArray()
-
copy
public abstract DoubleMatrix<R,C> 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:
-
getColRange
public abstract DoubleMatrix<R,C> getColRange(int startCol, int endCol)
- 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
public double[] getColumnByName(C s)
- Parameters:
s
- String- Returns:
- double[]
-
getEntry
public Double getEntry(int row, int column)
-
getRawMatrix
public double[][] getRawMatrix()
-
getRow
public abstract double[] getRow(int i)
-
getRowArrayList
public abstract cern.colt.list.DoubleArrayList getRowArrayList(int i)
-
getRowByName
public double[] getRowByName(R s)
- Parameters:
s
- String- Returns:
- double[]
-
getRowRange
public abstract DoubleMatrix<R,C> getRowRange(int startRow, int endRow)
- Parameters:
startRow
- inclusive, numbered from zeroendRow
- inclusive- Returns:
-
sortByColumnAbsoluteValues
public List<R> sortByColumnAbsoluteValues(int i, boolean descending)
- Parameters:
i
-descending
-
-
subsetColumns
public abstract DoubleMatrix<R,C> subsetColumns(List<C> columns)
Create a copy of this matrix with only the selected columns, in the selected order.- Parameters:
columns
-- Returns:
-
subsetRows
public abstract DoubleMatrix<R,C> subsetRows(List<R> rowNames)
Create a copy of this matrix with only the selected rows, in the selected order.- Parameters:
rowNames
-- Returns:
-
transpose
public abstract DoubleMatrix<C,R> transpose()
-
viewColumn
public abstract cern.colt.matrix.DoubleMatrix1D viewColumn(int column)
-
viewRow
public abstract cern.colt.matrix.DoubleMatrix1D viewRow(int j)
- Parameters:
j
-- Returns:
-
-