public class DiagonalMatrix extends AbstractMatrix implements MatrixTimesOps
| Modifier and Type | Class and Description |
|---|---|
class |
DiagonalMatrix.SingleElementVector
Special class to implement views of rows and columns of a diagonal matrix.
|
AbstractMatrix.TransposeViewVectorCOL, columnLabelBindings, columns, ROW, rowLabelBindings, rows| Constructor and Description |
|---|
DiagonalMatrix(double[] values) |
DiagonalMatrix(double value,
int size) |
DiagonalMatrix(Matrix values) |
DiagonalMatrix(Vector values) |
| Modifier and Type | Method and Description |
|---|---|
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
|
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 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 |
viewColumn(int row)
Returns a view of a row.
|
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
|
Vector |
viewRow(int row)
Returns a view of a row.
|
aggregate, aggregateColumns, aggregateRows, asFormatString, assign, assign, assign, assign, assign, clone, columnSize, determinant, divide, get, get, getColumnLabelBindings, getRowLabelBindings, iterateAll, iterateNonEmpty, iterator, minus, numCols, numRows, numSlices, plus, plus, rowSize, set, set, set, set, set, set, setColumnLabelBindings, setRowLabelBindings, times, times, timesSquared, toString, transpose, viewPart, zSumpublic DiagonalMatrix(Vector values)
public DiagonalMatrix(Matrix values)
public DiagonalMatrix(double value,
int size)
public DiagonalMatrix(double[] values)
public static DiagonalMatrix identity(int size)
public Matrix assignColumn(int column, Vector other)
MatrixassignColumn in interface Matrixcolumn - the int row to assignother - a Vectorpublic Matrix assignRow(int row, Vector other)
assignRow in interface Matrixrow - the int row to assignother - a VectorCardinalityException - if the cardinalities differpublic Vector viewRow(int row)
AbstractMatrixviewRow in interface MatrixviewRow in class AbstractMatrixrow - Which row to return.public Vector viewColumn(int row)
AbstractMatrixviewColumn in interface MatrixviewColumn in class AbstractMatrixrow - Which column to return.public Vector viewDiagonal()
viewDiagonal in interface MatrixviewDiagonal in class AbstractMatrixpublic double getQuick(int row,
int column)
public Matrix like()
public Matrix like(int rows, int columns)
public void setQuick(int row,
int column,
double value)
Matrixpublic int[] getNumNondefaultElements()
getNumNondefaultElements in interface MatrixgetNumNondefaultElements in class AbstractMatrixpublic 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 resultCardinalityException - if the length is greater than the cardinality of the receiverIndexException - if the offset is negative or the offset+length is outside of the
receiverpublic Matrix times(Matrix other)
Matrixtimes in interface Matrixtimes in class AbstractMatrixother - a Matrix argumentpublic Matrix timesRight(Matrix that)
MatrixTimesOpstimesRight in interface MatrixTimesOpspublic Matrix timesLeft(Matrix that)
MatrixTimesOpstimesLeft in interface MatrixTimesOpspublic MatrixFlavor getFlavor()
MatrixUnsupportedOperationException.getFlavor in interface MatrixgetFlavor in class AbstractMatrixCopyright © 2008–2015 The Apache Software Foundation. All rights reserved.