|
||||||||||
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.VectorList
public class VectorList
Provides a very flexible matrix that is based on a simple list of vectors.
Nested Class Summary | |
---|---|
protected static class |
VectorList.JsonVectorListAdapter
|
Nested classes/interfaces inherited from class org.apache.mahout.math.AbstractMatrix |
---|
AbstractMatrix.TransposeViewVector |
Field Summary |
---|
Fields inherited from class org.apache.mahout.math.AbstractMatrix |
---|
cardinality, COL, columnLabelBindings, ROW, rowLabelBindings |
Constructor Summary | |
---|---|
VectorList(int columns)
|
|
VectorList(int rows,
int columns)
|
Method Summary | |
---|---|
void |
adjoinRow(Matrix other)
|
void |
adjoinRow(Vector vector)
|
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 |
int |
columnSize()
|
Vector |
getColumn(int column)
Return the column at the given index |
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 |
Vector |
getRow(int row)
Return the row at the given index |
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 |
rowSize()
|
void |
setQuick(int row,
int column,
double value)
Set the value at the given index, without checking bounds |
int[] |
size()
Return the cardinality of the recipient (the maximum number of values) |
Matrix |
viewPart(int[] offset,
int[] size)
Return a new matrix containing the subset of the recipient |
Methods inherited from class org.apache.mahout.math.AbstractMatrix |
---|
aggregate, aggregateColumns, aggregateRows, asFormatString, assign, assign, assign, assign, assign, clone, decodeMatrix, determinant, divide, get, get, getColumnLabelBindings, getRowLabelBindings, iterateAll, iterator, minus, numCols, numRows, numSlices, plus, plus, set, set, set, set, set, set, setColumnLabelBindings, setRowLabelBindings, slice, times, times, times, timesSquared, transpose, viewColumn, viewPart, viewRow, zSum |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public VectorList(int columns)
public VectorList(int rows, int columns)
Method Detail |
---|
public int columnSize()
columnSize
in interface Matrix
columnSize
in class AbstractMatrix
public int rowSize()
rowSize
in interface Matrix
rowSize
in class AbstractMatrix
public int[] size()
Matrix
size
in interface Matrix
size
in class AbstractMatrix
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 getColumn(int column)
Matrix
column
- an int column index
public Vector getRow(int row)
row
- an int row index
IndexException
- if the index is out of boundspublic double getQuick(int row, int column)
row
- an int row indexcolumn
- an int column index
public Matrix like()
public Matrix like(int rows, int columns)
rows
- the int number of rowscolumns
- the int number of columnspublic void setQuick(int row, int column, double value)
row
- an int row index into the receivercolumn
- an int column index into the receivervalue
- a double value to setpublic int[] getNumNondefaultElements()
public Matrix viewPart(int[] offset, int[] size)
offset
- an int[2] offset into the receiversize
- the int[2] size of the desired result
CardinalityException
- if the length is greater than the cardinality of the receiver
IndexException
- if the offset is negative or the offset+length is outside of the
receiverpublic void adjoinRow(Vector vector)
public void adjoinRow(Matrix other)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |