public class FastRowAccessDoubleMatrix<R,C> extends DoubleMatrix<R,C>
Implementation note: The key difference between this and the DenseDouble2DMatrixNamed is that this delegates to a DoubleArrayList[], while DenseDouble2DMatrixNamed delegates to a DenseDoubleMatrix2D.
MAX_ROWS_TO_PRINT
Constructor and Description |
---|
FastRowAccessDoubleMatrix(double[][] t)
Implementation note: The input matrix is NOT COPIED (due to the way colt DoubleArrayList(double[]) is
implemented).F
|
FastRowAccessDoubleMatrix(int rows,
int cols) |
Modifier and Type | Method and Description |
---|---|
double[][] |
asArray() |
int |
columns()
Get the number of columns the matrix has.
|
DoubleMatrix<R,C> |
copy()
Create a deep copy of this
|
double |
get(int x,
int y) |
Double[] |
getColObj(int col) |
DoubleMatrix<R,C> |
getColRange(int startCol,
int endCol) |
double[] |
getColumn(int col) |
Double |
getObject(int row,
int col) |
double[] |
getRow(int i) |
cern.colt.list.DoubleArrayList |
getRowArrayList(int i) |
Double[] |
getRowObj(int row) |
DoubleMatrix<R,C> |
getRowRange(int startRow,
int endRow) |
boolean |
isMissing(int i,
int j)
Check if the value at a given index is missing.
|
int |
rows()
Get the number of rows the matrix has
|
void |
set(int x,
int y,
Double value) |
int |
size() |
DoubleMatrix<R,C> |
subsetColumns(List<C> columns)
Create a copy of this matrix with only the selected columns, in the selected order.
|
DoubleMatrix<R,C> |
subsetRows(List<R> rowNames)
Create a copy of this matrix with only the selected rows, in the selected order.
|
DoubleMatrix<C,R> |
transpose() |
cern.colt.matrix.DoubleMatrix1D |
viewColumn(int column) |
cern.colt.matrix.DoubleMatrix1D |
viewRow(int j) |
getByKeys, getColumnByName, getEntry, getRawMatrix, getRowByName, setByKeys, sortByColumnAbsoluteValues, toString
addColumnName, addRowName, asDoubles, assign, checkColRange, checkRowRange, containsColumnName, containsRowName, getColIndexByName, getColName, getColNames, getRowIndexByName, getRowName, getRowNameMapIterator, getRowNames, hasColNames, hasMissingValues, hasRow, hasRowNames, numMissing, setColumnName, setColumnNames, setRowName, setRowNames
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addColumnName, asDoubles, assign, containsColumnName, containsRowName, getColIndexByName, getColName, getColNames, getRowIndexByName, getRowName, getRowNameMapIterator, getRowNames, hasColNames, hasRow, hasRowNames, numMissing, setColumnName, setColumnNames, setRowName, setRowNames
public FastRowAccessDoubleMatrix(double[][] t)
t
- public FastRowAccessDoubleMatrix(int rows, int cols)
rows
- cols
- public double[][] asArray()
asArray
in class DoubleMatrix<R,C>
public int columns()
Matrix2D
public DoubleMatrix<R,C> copy()
DoubleMatrix
copy
in class DoubleMatrix<R,C>
public double get(int x, int y)
get
in class DoubleMatrix<R,C>
public Double[] getColObj(int col)
public DoubleMatrix<R,C> getColRange(int startCol, int endCol)
getColRange
in class DoubleMatrix<R,C>
startCol
- inclusive, numbered from zeroendCol
- inclusive, numbered from zeropublic double[] getColumn(int col)
getColumn
in class DoubleMatrix<R,C>
public Double getObject(int row, int col)
public double[] getRow(int i)
getRow
in class DoubleMatrix<R,C>
public cern.colt.list.DoubleArrayList getRowArrayList(int i)
getRowArrayList
in class DoubleMatrix<R,C>
public Double[] getRowObj(int row)
public DoubleMatrix<R,C> getRowRange(int startRow, int endRow)
getRowRange
in class DoubleMatrix<R,C>
startRow
- inclusive, numbered from zeroendRow
- inclusivepublic boolean isMissing(int i, int j)
Matrix2D
i
- rowj
- columnpublic int rows()
Matrix2D
public void set(int x, int y, Double value)
public int size()
size
in class AbstractMatrix<R,C,Double>
public DoubleMatrix<R,C> subsetColumns(List<C> columns)
DoubleMatrix
subsetColumns
in class DoubleMatrix<R,C>
public DoubleMatrix<R,C> subsetRows(List<R> rowNames)
DoubleMatrix
subsetRows
in class DoubleMatrix<R,C>
public DoubleMatrix<C,R> transpose()
transpose
in class DoubleMatrix<R,C>
public cern.colt.matrix.DoubleMatrix1D viewColumn(int column)
viewColumn
in class DoubleMatrix<R,C>
public cern.colt.matrix.DoubleMatrix1D viewRow(int j)
viewRow
in class DoubleMatrix<R,C>
Copyright © 2003–2023 UBC Michael Smith Laboratories. All rights reserved.