public class ElementaryOperation extends Object implements MatrixTable
| Constructor and Description |
|---|
ElementaryOperation(int dim)
Construct a transformation matrix of elementary operations.
|
ElementaryOperation(int nRows,
int nCols)
Construct a transformation matrix of elementary operations.
|
ElementaryOperation(Matrix A)
Transform A by elementary operations.
|
| Modifier and Type | Method and Description |
|---|---|
ElementaryOperation |
addColumn(int j1,
int j2,
double c)
Column addition:
A[, j1] = A[, j1] + c * A[, j2]
|
ElementaryOperation |
addRow(int i1,
int i2,
double c)
Row addition:
A[i1, ] = A[i1, ] + c * A[i2, ]
|
double |
get(int i,
int j)
Get the matrix entry at [i,j].
|
int |
nCols()
Gets the number of columns.
|
int |
nRows()
Gets the number of rows.
|
ElementaryOperation |
scaleColumn(int j,
double c)
Scale a column:
A[, j] = c * A[, j]
|
ElementaryOperation |
scaleRow(int i,
double c)
Scale a row:
A[i, ] = c * A[i, ]
|
void |
set(int i,
int j,
double value)
Deprecated.
|
ElementaryOperation |
swapColumn(int j1,
int j2)
Swap columns:
|
ElementaryOperation |
swapRow(int i1,
int i2)
Swap rows:
|
Matrix |
T()
Get the transformed matrix T.
|
String |
toString() |
public ElementaryOperation(int dim)
dim - the dimension of Tpublic ElementaryOperation(int nRows,
int nCols)
nRows - the number of rows of TnCols - the number of columns of Tpublic ElementaryOperation(Matrix A)
A - a matrixpublic int nRows()
Tablepublic int nCols()
Tablepublic double get(int i,
int j)
MatrixAccessget in interface MatrixAccessi - the row indexj - the column indexpublic Matrix T()
public ElementaryOperation swapRow(int i1, int i2)
A[i1, ] = A[i2, ] A[i2, ] = A[i1, ]
i1 - becoming row i2i2 - becoming row i1public ElementaryOperation scaleRow(int i, double c)
A[i, ] = c * A[i, ]
i - the row to be scaledc - the scaling factorpublic ElementaryOperation addRow(int i1, int i2, double c)
A[i1, ] = A[i1, ] + c * A[i2, ]
i1 - addend; the row to add to; the row is modified afterwardi2 - the row to add withc - the scaling factor for row i2public ElementaryOperation swapColumn(int j1, int j2)
A[, j1] = A[, j2] A[, j2] = A[, j1]
j1 - becoming column j2j2 - becoming column j1public ElementaryOperation scaleColumn(int j, double c)
A[, j] = c * A[, j]
j - the column to be scaledc - the scaling factorpublic ElementaryOperation addColumn(int j1, int j2, double c)
A[, j1] = A[, j1] + c * A[, j2]
j1 - addend; the column to add to; the column is modified afterwardj2 - the column to add withc - the scaling factor for
col2@Deprecated public 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 rangeCopyright © 2010-2020 NM FinTech Ltd.. All Rights Reserved.