public class DenseMatrix extends AbstractMatrix
AbstractMatrix.TransposeViewVector
COL, columnLabelBindings, columns, ROW, rowLabelBindings, rows
Constructor and Description |
---|
DenseMatrix(double[][] values)
Construct a matrix from the given values
|
DenseMatrix(double[][] values,
boolean shallowCopy)
Construct a matrix from the given values
|
DenseMatrix(int rows,
int columns)
Constructs an empty matrix of the given size.
|
Modifier and Type | Method and Description |
---|---|
Matrix |
assign(DenseMatrix matrix) |
Matrix |
assign(double value)
Assign the value to all elements of the receiver
|
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
|
double[][] |
getBackingStructure()
Returns the backing array
|
MatrixFlavor |
getFlavor()
Get matrix structural flavor (operations performance hints).
|
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
|
Matrix |
viewPart(int[] offset,
int[] size)
Return a view into part of a matrix.
|
Matrix |
viewPart(int rowOffset,
int rowsRequested,
int columnOffset,
int columnsRequested)
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, columnSize, determinant, divide, get, get, getColumnLabelBindings, getNumNondefaultElements, getRowLabelBindings, iterateAll, iterateNonEmpty, iterator, minus, numCols, numRows, numSlices, plus, plus, rowSize, set, set, set, set, set, set, setColumnLabelBindings, setRowLabelBindings, times, times, times, timesSquared, toString, transpose, viewColumn, viewDiagonal, zSum
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
public DenseMatrix(double[][] values)
values
- a double[][]public DenseMatrix(double[][] values, boolean shallowCopy)
values
- a double[][]shallowCopy
- directly use the supplied array?public DenseMatrix(int rows, int columns)
rows
- The number of rows in the result.columns
- The number of columns in the result.public double[][] getBackingStructure()
public 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 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 viewPart(int rowOffset, int rowsRequested, int columnOffset, int columnsRequested)
Matrix
viewPart
in interface Matrix
viewPart
in class AbstractMatrix
rowOffset
- The first row of the viewrowsRequested
- The number of rows in the viewcolumnOffset
- The first column in the viewcolumnsRequested
- The number of columns in the viewpublic Matrix assign(double value)
Matrix
assign
in interface Matrix
assign
in class AbstractMatrix
value
- a double valuepublic Matrix assign(DenseMatrix matrix)
public 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 viewRow(int row)
AbstractMatrix
viewRow
in interface Matrix
viewRow
in class AbstractMatrix
row
- Which row to return.public MatrixFlavor getFlavor()
Matrix
UnsupportedOperationException
.getFlavor
in interface Matrix
getFlavor
in class AbstractMatrix
Copyright © 2008–2017 The Apache Software Foundation. All rights reserved.