|
SuanShu, a Java numerical and statistical library | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.numericalmethod.suanshu.matrix.generic.matrixtype.GenericMatrix<F>
F - the number Fieldpublic class GenericMatrix<F extends Field<F>>
This class represents a generic Matrix of which the entries can be in any Field.
| Constructor Summary | |
|---|---|
GenericMatrix(F[][] data)
Create an instance of Matrix from a given 2D array. |
|
GenericMatrix(int nRows,
int nCols,
F init)
Create an instance of Matrix with nRows rows and nCols columns,
initialized with value init. |
|
| Method Summary | |
|---|---|
GenericMatrix<F> |
add(GenericMatrix<F> that)
+ : G × G → G |
boolean |
equals(java.lang.Object obj)
|
F |
get(int row,
int col)
Get the matrix element at [row, col]. |
int |
hashCode()
|
GenericMatrix<F> |
minus(GenericMatrix<F> that)
- : G × G → G
- is not in the definition of of an additive group but can be deduced. |
GenericMatrix<F> |
multiply(GenericMatrix<F> that)
· : G × G → G |
int |
nCols()
Get the number of columns. |
int |
nRows()
Get the number of rows. |
GenericMatrix<F> |
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. |
GenericMatrix<F> |
opposite()
For each a in G, there exists an element b in G such that a + b = b + a = 0
That is, it is the object such as
this.add(this.opposite()) == this.ZERO |
GenericMatrix<F> |
scaled(F scalar)
* : F × V → V
The result of applying this function to scalar, c, in F and v in V is denoted cv. |
void |
set(int row,
int col,
F value)
Set the matrix element at [row, col] to value. |
java.lang.String |
toString()
|
GenericMatrix<F> |
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public GenericMatrix(int nRows,
int nCols,
F init)
nRows rows and nCols columns,
initialized with value init.
nRows - number of rowsnCols - number of columnsinit - initial value for the entriespublic GenericMatrix(F[][] data)
data - the matrix entries| Method Detail |
|---|
public int nRows()
MatrixDimension
nRows in interface MatrixDimensionpublic int nCols()
MatrixDimension
nCols in interface MatrixDimension
public void set(int row,
int col,
F value)
throws MatrixAccessException
MatrixAccessor[row, col] to value.
This is the only function that may change the entries of a matrix.
set in interface MatrixAccessor<F extends Field<F>>row - the row indexcol - the column indexvalue - the value to set A[row, col] to
MatrixAccessException - if row or col is out of range
public F get(int row,
int col)
throws MatrixAccessException
MatrixAccessor[row, col].
get in interface MatrixAccessor<F extends Field<F>>row - the row indexcol - the column index
A[row, col]
MatrixAccessException - if row or col is out of rangepublic GenericMatrix<F> add(GenericMatrix<F> that)
AbelianGroup+ : G × G → G
add in interface AbelianGroup<GenericMatrix<F extends Field<F>>>that - the object to be added
this + thatpublic GenericMatrix<F> minus(GenericMatrix<F> that)
AbelianGroup- : G × G → G
- is not in the definition of of an additive group but can be deduced.
This function is provided for convenience purpose.
It is equivalent to
this.add(that.opposite())
minus in interface AbelianGroup<GenericMatrix<F extends Field<F>>>that - the object to be subtracted (subtrahend)
this - thatpublic GenericMatrix<F> multiply(GenericMatrix<F> that)
Monoid· : G × G → G
multiply in interface Monoid<GenericMatrix<F extends Field<F>>>that - the multiplicand
this × thatpublic GenericMatrix<F> scaled(F scalar)
VectorSpace* : F × V → V
The result of applying this function to scalar, c, in F and v in V is denoted cv.
scaled in interface VectorSpace<GenericMatrix<F extends Field<F>>,F extends Field<F>>scalar - a multiplier
scalar * thispublic GenericMatrix<F> opposite()
AbelianGroupa + b = b + a = 0
That is, it is the object such as
this.add(this.opposite()) == this.ZERO
opposite in interface AbelianGroup<GenericMatrix<F extends Field<F>>>-thispublic GenericMatrix<F> ZERO()
AbelianGroupa in the group,
the equation 0 + a = a + 0 = a holds.
ZERO in interface AbelianGroup<GenericMatrix<F extends Field<F>>>0public GenericMatrix<F> ONE()
Monoida in the group,
the equation
1 × a = a × 1 = a
holds.
ONE in interface Monoid<GenericMatrix<F extends Field<F>>>1public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object
|
SuanShu, a Java numerical and statistical library | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||