public class SparseMatrix extends AbstractMatrix
AbstractMatrix.TransposeViewVectorCOL, columnLabelBindings, columns, ROW, rowLabelBindings, rows| Constructor and Description |
|---|
SparseMatrix(int rows,
int columns)
Construct a matrix with specified number of rows and columns.
|
SparseMatrix(int rows,
int columns,
Map<Integer,Vector> rowVectors)
Construct a matrix of the given cardinality with the given row map
|
SparseMatrix(int rows,
int columns,
Map<Integer,Vector> rowVectors,
boolean shallow) |
| Modifier and Type | Method and Description |
|---|---|
Matrix |
assign(Matrix other,
DoubleDoubleFunction function)
Apply the function to each element of the receiver and the corresponding element of the other argument
|
Matrix |
assignColumn(int column,
Vector other)
Assign the other vector values to the column of the receiver
|
Matrix |
assignRow(int row,
Vector other)
Assign the other vector values to the row of the receiver
|
Matrix |
clone()
Return a copy of the recipient
|
MatrixFlavor |
getFlavor()
Get matrix structural flavor (operations performance hints).
|
int[] |
getNumNondefaultElements()
Return the number of values in the recipient
|
double |
getQuick(int row,
int column)
Return the value at the given indexes, without checking bounds
|
Iterator<MatrixSlice> |
iterateNonEmpty() |
Matrix |
like()
Return an empty matrix of the same underlying class as the receiver
|
Matrix |
like(int rows,
int columns)
Returns an empty matrix of the same underlying class as the receiver and of the specified size.
|
IntArrayList |
nonZeroRowIndices()
special method necessary for efficient serialization
|
int |
numSlices()
Abstracted out for the iterator
|
void |
setQuick(int row,
int column,
double value)
Set the value at the given index, without checking bounds
|
Matrix |
viewPart(int[] offset,
int[] size)
Return a view into part of a matrix.
|
Vector |
viewRow(int row)
Returns a view of a row.
|
aggregate, aggregateColumns, aggregateRows, asFormatString, assign, assign, assign, assign, columnSize, determinant, divide, get, get, getColumnLabelBindings, getRowLabelBindings, iterateAll, iterator, minus, numCols, numRows, plus, plus, rowSize, set, set, set, set, set, set, setColumnLabelBindings, setRowLabelBindings, times, times, times, timesSquared, toString, transpose, viewColumn, viewDiagonal, viewPart, zSumpublic SparseMatrix(int rows,
int columns,
Map<Integer,Vector> rowVectors)
rows - no of rowscolumns - no of columnsrowVectors - a Mappublic SparseMatrix(int rows,
int columns,
Map<Integer,Vector> rowVectors,
boolean shallow)
public SparseMatrix(int rows,
int columns)
public Matrix clone()
Matrixclone in interface Matrixclone in class AbstractMatrixpublic int numSlices()
AbstractMatrixnumSlices in interface VectorIterablenumSlices in class AbstractMatrixpublic Iterator<MatrixSlice> iterateNonEmpty()
iterateNonEmpty in interface VectorIterableiterateNonEmpty in class AbstractMatrixpublic double getQuick(int row,
int column)
Matrixrow - an int row indexcolumn - an int column indexpublic Matrix like()
Matrixpublic Matrix like(int rows, int columns)
Matrixrows - the int number of rowscolumns - the int number of columnspublic void setQuick(int row,
int column,
double value)
Matrixrow - an int row index into the receivercolumn - an int column index into the receivervalue - a double value to setpublic int[] getNumNondefaultElements()
MatrixgetNumNondefaultElements in interface MatrixgetNumNondefaultElements in class AbstractMatrixpublic Matrix viewPart(int[] offset, int[] size)
MatrixviewPart in interface MatrixviewPart in class AbstractMatrixoffset - an int[2] offset into the receiversize - the int[2] size of the desired resultpublic Matrix assign(Matrix other, DoubleDoubleFunction function)
Matrixassign in interface Matrixassign in class AbstractMatrixother - a Matrix containing the second arguments to the functionfunction - a DoubleDoubleFunction to applypublic Matrix assignColumn(int column, Vector other)
Matrixcolumn - the int row to assignother - a Vectorpublic Matrix assignRow(int row, Vector other)
Matrixrow - the int row to assignother - a Vectorpublic Vector viewRow(int row)
AbstractMatrixviewRow in interface MatrixviewRow in class AbstractMatrixrow - Which row to return.public IntArrayList nonZeroRowIndices()
public MatrixFlavor getFlavor()
MatrixUnsupportedOperationException.getFlavor in interface MatrixgetFlavor in class AbstractMatrixCopyright © 2008–2016 The Apache Software Foundation. All rights reserved.