|
||||||||||
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.DiagonalMatrix
public class DiagonalMatrix
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 | |
---|---|
DiagonalMatrix(double[] values)
|
|
DiagonalMatrix(double value,
int size)
|
|
DiagonalMatrix(Matrix values)
|
|
DiagonalMatrix(Vector values)
|
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 |
int[] |
getNumNondefaultElements()
Return the number of values in the recipient |
double |
getQuick(int row,
int column)
Return the value at the given location, without checking bounds |
static DiagonalMatrix |
identity(int size)
|
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. |
void |
setQuick(int row,
int column,
double value)
Set the value at the given index, without checking bounds |
Matrix |
times(Matrix other)
Return a new matrix containing the product of the recipient and the argument |
Matrix |
timesLeft(Matrix that)
Computes matrix product of (that * this) |
Matrix |
timesRight(Matrix that)
computes matrix product of (this * that) |
Vector |
viewDiagonal()
Provides a view of the diagonal of a matrix. |
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, 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, timesSquared, toString, transpose, viewColumn, viewPart, viewRow, zSum |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public DiagonalMatrix(Vector values)
public DiagonalMatrix(Matrix values)
public DiagonalMatrix(double value, int size)
public DiagonalMatrix(double[] values)
Method Detail |
---|
public static DiagonalMatrix identity(int size)
public Matrix assignColumn(int column, Vector other)
Matrix
assignColumn
in interface Matrix
column
- the int row to assignother
- a Vector
public Matrix assignRow(int row, Vector other)
assignRow
in interface Matrix
row
- the int row to assignother
- a Vector
CardinalityException
- if the cardinalities differpublic Vector viewDiagonal()
viewDiagonal
in interface Matrix
viewDiagonal
in class AbstractMatrix
public double getQuick(int row, int column)
getQuick
in interface Matrix
row
- an int row indexcolumn
- an int column index
public Matrix like()
like
in interface Matrix
public Matrix like(int rows, int columns)
like
in interface Matrix
rows
- the int number of rowscolumns
- the int number of columnspublic void setQuick(int row, int column, double value)
Matrix
setQuick
in interface Matrix
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 Matrix
getNumNondefaultElements
in class AbstractMatrix
public Matrix viewPart(int[] offset, int[] size)
viewPart
in interface Matrix
viewPart
in class AbstractMatrix
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 Matrix times(Matrix other)
Matrix
times
in interface Matrix
times
in class AbstractMatrix
other
- a Matrix argument
public Matrix timesRight(Matrix that)
MatrixTimesOps
timesRight
in interface MatrixTimesOps
public Matrix timesLeft(Matrix that)
MatrixTimesOps
timesLeft
in interface MatrixTimesOps
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |