|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.mahout.math.AbstractMatrix
org.apache.mahout.math.SparseColumnMatrix
public class SparseColumnMatrix
sparse matrix with general element values whose columns are accessible quickly. Implemented as a column array of SparseVectors.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.apache.mahout.math.AbstractMatrix |
---|
AbstractMatrix.TransposeViewVector |
Field Summary |
---|
Fields inherited from class org.apache.mahout.math.AbstractMatrix |
---|
COL, columnLabelBindings, columns, ROW, rowLabelBindings, rows |
Constructor Summary | |
---|---|
SparseColumnMatrix(int rows,
int columns)
Construct a matrix of the given cardinality |
|
SparseColumnMatrix(int rows,
int columns,
RandomAccessSparseVector[] columnVectors)
Construct a matrix of the given cardinality with the given data columns |
Method Summary | |
---|---|
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 |
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 |
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. |
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 |
transpose()
Return a new matrix that is the transpose of the receiver |
Vector |
viewColumn(int column)
Returns a view of a row. |
Matrix |
viewPart(int[] offset,
int[] size)
Return a view into part of a matrix. |
Methods inherited from class org.apache.mahout.math.AbstractMatrix |
---|
aggregate, aggregateColumns, aggregateRows, asFormatString, assign, 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, viewDiagonal, viewPart, viewRow, zSum |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SparseColumnMatrix(int rows, int columns, RandomAccessSparseVector[] columnVectors)
columns
- a RandomAccessSparseVector[] array of columnscolumnVectors
- public SparseColumnMatrix(int rows, int columns)
rows
- columns
- Method Detail |
---|
public Matrix clone()
Matrix
clone
in interface Matrix
clone
in class AbstractMatrix
public int numSlices()
numSlices
in interface VectorIterable
numSlices
in class AbstractMatrix
AbstractMatrix.numCols()
public double getQuick(int row, int column)
Matrix
row
- an int row indexcolumn
- an int column index
public Matrix like()
Matrix
public Matrix like(int rows, int columns)
Matrix
rows
- the int number of rowscolumns
- the int number of columnspublic void setQuick(int row, int column, double value)
Matrix
row
- an int row index into the receivercolumn
- an int column index into the receivervalue
- a double value to setpublic int[] getNumNondefaultElements()
Matrix
getNumNondefaultElements
in interface Matrix
getNumNondefaultElements
in class AbstractMatrix
public Matrix viewPart(int[] offset, int[] size)
Matrix
viewPart
in interface Matrix
viewPart
in class AbstractMatrix
offset
- an int[2] offset into the receiversize
- the int[2] size of the desired result
public Matrix assignColumn(int column, Vector other)
Matrix
column
- the int row to assignother
- a Vector
public Matrix assignRow(int row, Vector other)
Matrix
row
- the int row to assignother
- a Vector
public Vector viewColumn(int column)
AbstractMatrix
viewColumn
in interface Matrix
viewColumn
in class AbstractMatrix
column
- Which column to return.
public Matrix transpose()
Matrix
transpose
in interface Matrix
transpose
in class AbstractMatrix
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |