|
||||||||||
| 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.PivotedMatrix
public class PivotedMatrix
Matrix that allows transparent row and column permutation.
| 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 | |
|---|---|
PivotedMatrix(Matrix base)
|
|
PivotedMatrix(Matrix base,
int[] pivot)
|
|
PivotedMatrix(Matrix base,
int[] rowPivot,
int[] columnPivot)
|
|
| 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 |
columnUnpivot(int k)
|
Matrix |
getBase()
|
int[] |
getColumnPivot()
|
int[] |
getInverseColumnPivot()
|
int[] |
getInverseRowPivot()
|
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 |
int[] |
getRowPivot()
|
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 |
rowUnpivot(int k)
|
void |
setQuick(int row,
int column,
double value)
Set the value at the given index, without checking bounds |
void |
swap(int i,
int j)
Swaps indexes i and j. |
void |
swapColumns(int i,
int j)
Swaps indexes i and j. |
void |
swapRows(int i,
int j)
Swaps indexes i and j. |
Vector |
viewColumn(int column)
Return the column at the given index |
Matrix |
viewPart(int[] offset,
int[] size)
Return a new matrix containing the subset of the recipient |
Vector |
viewRow(int row)
Return the row at the given index |
| 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, numSlices, plus, plus, rowSize, set, set, set, set, set, set, setColumnLabelBindings, setRowLabelBindings, times, times, times, timesSquared, toString, transpose, viewDiagonal, viewPart, zSum |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public PivotedMatrix(Matrix base,
int[] pivot)
public PivotedMatrix(Matrix base,
int[] rowPivot,
int[] columnPivot)
public PivotedMatrix(Matrix base)
| Method Detail |
|---|
public void swap(int i,
int j)
i - First index to swap.j - Second index to swap.
public void swapRows(int i,
int j)
i - First index to swap.j - Second index to swap.
public void swapColumns(int i,
int j)
i - First index to swap.j - Second index to swap.
public Matrix assignColumn(int column,
Vector other)
column - the int row to assignother - a Vector
CardinalityException - if the cardinalities differ
public Matrix assignRow(int row,
Vector other)
row - the int row to assignother - a Vector
CardinalityException - if the cardinalities differpublic Vector viewColumn(int column)
viewColumn in interface MatrixviewColumn in class AbstractMatrixcolumn - an int column index
IndexException - if the index is out of boundspublic Vector viewRow(int row)
viewRow in interface MatrixviewRow in class AbstractMatrixrow - an int row index
IndexException - if the index is out of bounds
public double getQuick(int row,
int column)
row - an int row indexcolumn - an int column index
public Matrix like()
public Matrix clone()
Matrix
clone in interface Matrixclone in class AbstractMatrix
public Matrix like(int rows,
int columns)
rows - the int number of rowscolumns - the int number of columns
public 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()
getNumNondefaultElements in interface MatrixgetNumNondefaultElements in class AbstractMatrix
public Matrix viewPart(int[] offset,
int[] size)
viewPart in interface MatrixviewPart in class AbstractMatrixoffset - 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 int rowUnpivot(int k)
public int columnUnpivot(int k)
public int[] getRowPivot()
public int[] getInverseRowPivot()
public int[] getColumnPivot()
public int[] getInverseColumnPivot()
public Matrix getBase()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||