public class RealMatrix extends Object implements GenericMatrix<RealMatrix,Real>
Real
matrix.
Comparing to the double
-based DenseMatrix
,
this class allows arbitrary precision arithmetic at the cost of (much) slower performance.Constructor and Description |
---|
RealMatrix(double[][] data)
Construct a
Real matrix. |
RealMatrix(int nRows,
int nCols)
Construct a
Real matrix. |
RealMatrix(Real[][] data)
Construct a
Real matrix. |
Modifier and Type | Method and Description |
---|---|
RealMatrix |
add(RealMatrix that)
+ : G × G → G
|
DenseMatrix |
doubleValue()
Construct a
DenseMatrix equivalent of this Real matrix (rounded if necessary). |
boolean |
equals(Object obj) |
Real |
get(int row,
int col)
Get the matrix entry at [i,j].
|
int |
hashCode() |
RealMatrix |
minus(RealMatrix that)
- : G × G → G
The operation "-" is not in the definition of of an additive group but can be deduced.
|
RealMatrix |
multiply(RealMatrix that)
× : G × G → G
|
int |
nCols()
Gets the number of columns.
|
int |
nRows()
Gets the number of rows.
|
RealMatrix |
ONE()
The multiplicative element 1 in the group such that for any elements a in the group,
the equation 1 × a = a × 1 = a holds.
|
RealMatrix |
opposite()
For each a in G, there exists an element b in G such that
a + b = b + a = 0.
|
RealMatrix |
scaled(Real scalar)
× : F × V → V
The result of applying this function to a scalar, c, in F and v in V is denoted cv.
|
void |
set(int row,
int col,
Real value)
Set the matrix entry at [i,j] to a value.
|
String |
toString() |
RealMatrix |
ZERO()
The additive element 0 in the group, such that for all elements a in the group,
the equation 0 + a = a + 0 = a holds.
|
public RealMatrix(int nRows, int nCols)
Real
matrix.nRows
- the number of rowsnCols
- the number of columnspublic RealMatrix(Real[][] data)
Real
matrix.data
- a matrix data of Real
numbers in a 2D arraypublic RealMatrix(double[][] data)
Real
matrix.data
- a matrix data of double
s in a 2D arraypublic int nRows()
Table
public int nCols()
Table
public void set(int row, int col, Real value)
GenericMatrixAccess
set
in interface GenericMatrixAccess<Real>
row
- the row indexcol
- the column indexvalue
- the value to set A[i,j] topublic Real get(int row, int col)
GenericMatrixAccess
get
in interface GenericMatrixAccess<Real>
row
- the row indexcol
- the column indexpublic RealMatrix add(RealMatrix that)
AbelianGroup
add
in interface AbelianGroup<RealMatrix>
that
- the object to be addedpublic RealMatrix minus(RealMatrix that)
AbelianGroup
this.add(that.opposite())
.minus
in interface AbelianGroup<RealMatrix>
that
- the object to be subtracted (subtrahend)public RealMatrix multiply(RealMatrix that)
Monoid
multiply
in interface Monoid<RealMatrix>
that
- the multiplicandpublic RealMatrix scaled(Real scalar)
VectorSpace
scaled
in interface VectorSpace<RealMatrix,Real>
scalar
- a multiplierpublic RealMatrix opposite()
AbelianGroup
this.add(this.opposite()) == this.ZERO
opposite
in interface AbelianGroup<RealMatrix>
public RealMatrix ZERO()
AbelianGroup
ZERO
in interface AbelianGroup<RealMatrix>
public RealMatrix ONE()
Monoid
ONE
in interface Monoid<RealMatrix>
public DenseMatrix doubleValue()
DenseMatrix
equivalent of this Real matrix (rounded if necessary).DenseMatrix
equivalentCopyright © 2010-2020 NM FinTech Ltd.. All Rights Reserved.