Class GenMatrix<C extends RingElem<C>>
java.lang.Object
edu.jas.vector.GenMatrix<C>
- All Implemented Interfaces:
AbelianGroupElem<GenMatrix<C>>, AlgebraElem<GenMatrix<C>, C>, Element<GenMatrix<C>>, MonoidElem<GenMatrix<C>>, RingElem<GenMatrix<C>>, Serializable, Comparable<GenMatrix<C>>
public class GenMatrix<C extends RingElem<C>>
extends Object
implements AlgebraElem<GenMatrix<C>, C>
GenMatrix implements a generic matrix algebra over RingElem entries. Matrix
has n columns and m rows over C.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionGenMatrix(GenMatrixRing<C> r) Constructor for zero GenMatrix.GenMatrix(GenMatrixRing<C> r, C[][] m) Constructor for GenMatrix.Constructor for GenMatrix.Constructor for GenMatrix. -
Method Summary
Modifier and TypeMethodDescriptionabs()Absolute value of this matrix.intcompareTo, lexicogaphical comparison.concat(GenMatrixRing<C> cc, GenMatrix<C> b) Concat method.copy()Copy method.Divide this by S.divideLeft(GenMatrix<C> S) Divide left this by S.Extended greatest common divisor.booleanComparison with any other object.factory()Get the corresponding element factory.Greatest common divisor.get(int i, int j) Get element at row i, column j.getColumn(int i) Get column i.Get diagonal.getLower()Get lower triangular L matrix.getRow(int i) Get row i.getUpper()Get upper triangular U matrix.Get upper triangular U matrix with diagonal 1.inthashCode()Hash code for this GenMatrix.inverse()Inverse of this.booleanTest if this is a non-zero diagonal matrix.booleanisONE()Test if this is one.booleanisUnit()Test if this is a unit.booleanisZERO()Test if this is equal to a zero matrix.leftLinearCombination(C s, C t, GenMatrix<C> b) left linear compination of this matrix with scalar multiple of other matrix.Left product of this matrix with scalar.linearCombination(C t, GenMatrix<C> b) Left linear combination of this matrix with scalar multiple of other matrix.linearCombination(C s, GenMatrix<C> b, C t) Linear compination of this matrix with scalar multiple of other matrix.linearCombination(GenMatrix<C> b, C t) Linear combination of this matrix with scalar multiple of other matrix.Product of this matrix with scalar.Multiply this with S.multiplySimple(GenMatrix<C> S) Multiply this with S.negate()Negative of this matrix.Quotient and remainder by division of this by S.Remainder after division of this by S.scalarMultiply(C s) Product of this matrix with scalar.Set element at row i, column j.voidSet element at row i, column j.intsignum()sign of matrix.stack(GenMatrixRing<C> st, GenMatrix<C> b) Stack method.Difference of matrices.Sum of matrices.toScript()Get a scripting compatible string representation.Get a scripting compatible string representation of the factory.toString()Get the String representation as RingElem.trace()Trace.Transposed matrix.transpose(GenMatrixRing<C> tr) Transposed matrix.Methods inherited from interface MonoidElem
leftDivide, leftRemainder, power, rightDivide, rightRemainder, twosidedDivide, twosidedRemainder
-
Field Details
-
logger
private static final org.apache.logging.log4j.Logger logger -
ring
-
matrix
-
hashValue
private int hashValue
-
-
Constructor Details
-
GenMatrix
-
GenMatrix
Constructor for GenMatrix.- Parameters:
r- matrix ringm- matrix
-
GenMatrix
Constructor for GenMatrix.- Parameters:
r- matrix ringm- matrix
-
GenMatrix
Constructor for GenMatrix.- Parameters:
r- matrix ringm- matrix
-
-
Method Details
-
get
Get element at row i, column j.- Parameters:
i- row index.j- column index.- Returns:
- this(i,j).
-
setMutate
Set element at row i, column j. Mutates this matrix.- Parameters:
i- row index.j- column index.el- element to set.
-
set
-
getColumn
-
getRow
-
getDiagonal
-
trace
-
getUpper
-
getUpperScaled
-
getLower
-
toString
-
toScript
-
toScriptFactory
-
factory
-
copy
-
stack
-
concat
-
isZERO
public boolean isZERO()Test if this is equal to a zero matrix.- Specified by:
isZEROin interfaceAbelianGroupElem<C extends RingElem<C>>- Returns:
- true if this is 0, else false.
-
isONE
public boolean isONE()Test if this is one.- Specified by:
isONEin interfaceMonoidElem<C extends RingElem<C>>- Returns:
- true if this is 1, else false.
-
isDiagonal
public boolean isDiagonal()Test if this is a non-zero diagonal matrix.- Returns:
- true if this is non-zero diagonal, else false.
-
equals
-
hashCode
-
compareTo
-
isUnit
public boolean isUnit()Test if this is a unit. I.e. there exists x with this.multiply(x).isONE() == true. Tests if matrix is not singular. Was previously a test if all diagonal elements are units and all other elements are zero.- Specified by:
isUnitin interfaceMonoidElem<C extends RingElem<C>>- Returns:
- true if this is a unit, else false.
-
signum
public int signum()sign of matrix.- Specified by:
signumin interfaceAbelianGroupElem<C extends RingElem<C>>- Returns:
- 1 if (this < 0), 0 if (this == 0) or -1 if (this > 0).
-
sum
-
subtract
-
negate
-
abs
-
multiply
-
scalarMultiply
-
leftScalarMultiply
-
linearCombination
Linear compination of this matrix with scalar multiple of other matrix.- Specified by:
linearCombinationin interfaceAlgebraElem<GenMatrix<C extends RingElem<C>>, C extends RingElem<C>>- Parameters:
s- scalarb- other matrix.t- scalar- Returns:
- this*s+b*t
-
linearCombination
Linear combination of this matrix with scalar multiple of other matrix.- Specified by:
linearCombinationin interfaceAlgebraElem<GenMatrix<C extends RingElem<C>>, C extends RingElem<C>>- Parameters:
b- other matrix.t- scalar- Returns:
- this+b*t
-
linearCombination
-
leftLinearCombination
-
transpose
Transposed matrix.- Parameters:
tr- transposed matrix ring.- Returns:
- transpose(this)
-
transpose
-
multiply
-
multiplySimple
-
divide
-
divideLeft
-
remainder
-
quotientRemainder
Quotient and remainder by division of this by S.- Specified by:
quotientRemainderin interfaceMonoidElem<C extends RingElem<C>>- Parameters:
S- a GenMatrix- Returns:
- [this/S, this - (this/S)*S].
-
inverse
-
gcd
-
egcd
-