public class MatrixView extends AbstractMatrix
AbstractMatrix.TransposeViewVector
COL, columnLabelBindings, columns, ROW, rowLabelBindings, rows
Constructor and Description |
---|
MatrixView(Matrix matrix,
int[] offset,
int[] size)
Construct a view of the matrix with given offset and cardinality
|
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
|
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.
|
void |
setQuick(int row,
int column,
double value)
Set the value at the given index, without checking bounds
|
Vector |
viewColumn(int column)
Returns a view of a row.
|
Matrix |
viewPart(int[] offset,
int[] size)
Return a view into part of a matrix.
|
Vector |
viewRow(int row)
Returns a view of a row.
|
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
public MatrixView(Matrix matrix, int[] offset, int[] size)
matrix
- an underlying Matrixoffset
- the int[2] offset into the underlying matrixsize
- the int[2] size of the viewpublic Matrix clone()
Matrix
clone
in interface Matrix
clone
in class AbstractMatrix
public double getQuick(int row, int column)
Matrix
row
- an int row indexcolumn
- an int column indexpublic 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 resultpublic Matrix assignColumn(int column, Vector other)
Matrix
column
- the int row to assignother
- a Vectorpublic Matrix assignRow(int row, Vector other)
Matrix
row
- the int row to assignother
- a Vectorpublic Vector viewColumn(int column)
AbstractMatrix
viewColumn
in interface Matrix
viewColumn
in class AbstractMatrix
column
- Which column to return.public Vector viewRow(int row)
AbstractMatrix
viewRow
in interface Matrix
viewRow
in class AbstractMatrix
row
- Which row to return.Copyright © 2008–2015 The Apache Software Foundation. All rights reserved.