public class FastKroneckerProduct extends Object implements Matrix
get(int, int) method.
If, however, the Kronecker product is used for matrix operations frequently,
the class KroneckerProduct, which computes all entries at
construction, should be used instead.
This class is immutable.KroneckerProduct| Constructor and Description |
|---|
FastKroneckerProduct(Matrix A,
Matrix B)
Construct a Kronecker product for read-only.
|
| Modifier and Type | Method and Description |
|---|---|
Matrix |
add(Matrix that)
this + that
|
FastKroneckerProduct |
deepCopy()
Return
this as this Matrix is immutable. |
double |
get(int i,
int j)
Get the matrix entry at [i,j].
|
DenseVector |
getColumn(int j)
Get the specified column in the matrix as a vector.
|
DenseVector |
getRow(int i)
Get the specified row in the matrix as a vector.
|
Matrix |
minus(Matrix that)
this - that
|
Matrix |
multiply(Matrix that)
this * that
|
Vector |
multiply(Vector v)
Right multiply this matrix, A, by a vector.
|
int |
nCols()
Gets the number of columns.
|
int |
nRows()
Gets the number of rows.
|
DenseMatrix |
ONE()
Get an identity matrix that has the same dimension as this matrix.
|
Matrix |
opposite()
Get the opposite of this matrix.
|
Matrix |
scaled(double scalar)
Scale this matrix, A, by a constant.
|
void |
set(int i,
int j,
double value)
Set the matrix entry at [i,j] to a value.
|
Matrix |
t()
Get the transpose of this matrix.
|
DenseMatrix |
ZERO()
Get a zero matrix that has the same dimension as this matrix.
|
public int nRows()
Tablepublic int nCols()
Tablepublic void set(int i,
int j,
double value)
throws MatrixAccessException
MatrixAccessset in interface MatrixAccessi - the row indexj - the column indexvalue - the value to set A[i,j] toMatrixAccessException - if i or j is out of rangepublic double get(int i,
int j)
throws MatrixAccessException
MatrixAccessget in interface MatrixAccessi - the row indexj - the column indexMatrixAccessException - if i or j is out of rangepublic DenseVector getRow(int i) throws MatrixAccessException
MatrixgetRow in interface Matrixi - the row indexMatrixAccessException - when i < 1, or when i > the number of rowspublic DenseVector getColumn(int j) throws MatrixAccessException
MatrixgetColumn in interface Matrixj - the column indexMatrixAccessException - when j < 1, or when j > the number of columnspublic Matrix add(Matrix that)
MatrixRingadd in interface MatrixRingadd in interface AbelianGroup<Matrix>that - a matrixthis and thatpublic Matrix minus(Matrix that)
MatrixRingminus in interface MatrixRingminus in interface AbelianGroup<Matrix>that - a matrixthis and thatpublic Matrix multiply(Matrix that)
MatrixRingmultiply in interface MatrixRingmultiply in interface Monoid<Matrix>that - a matrixthis and thatpublic Vector multiply(Vector v)
Matrixpublic Matrix scaled(double scalar)
Matrixpublic Matrix opposite()
MatrixRingopposite in interface MatrixRingopposite in interface AbelianGroup<Matrix>public DenseMatrix ZERO()
MatrixRingZERO in interface MatrixRingZERO in interface AbelianGroup<Matrix>public DenseMatrix ONE()
MatrixRingONE in interface MatrixRingONE in interface Monoid<Matrix>public Matrix t()
MatrixRingt in interface MatrixRingpublic FastKroneckerProduct deepCopy()
this as this Matrix is immutable.deepCopy in interface MatrixdeepCopy in interface DeepCopyablethisCopyright © 2010-2020 NM FinTech Ltd.. All Rights Reserved.