jsci.maths.matrices
Class RingMatrix
- java.lang.Object
-
- jsci.maths.matrices.Matrix
-
- jsci.maths.matrices.RingMatrix
-
- All Implemented Interfaces:
- java.io.Serializable, Algebra.Member, Module.Member, VectorSpace.Member, Ring.Member, AbelianGroup.Member, Member
public class RingMatrix extends Matrix
The RingMatrix class provides an object for encapsulating matrices over an arbitrary ring.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description RingMatrix(Ring.Member[][] array)Constructs a matrix by wrapping an array.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description AbelianGroup.Memberadd(AbelianGroup.Member m)Returns the addition of this matrix and another.RingMatrixadd(RingMatrix m)Returns the addition of this matrix and another.RingMatrixdirectSum(RingMatrix m)Returns the direct sum of this matrix and another.booleanequals(java.lang.Object m)Compares two matrices for equality.Ring.MembergetElement(int i, int j)Returns an element of the matrix.java.lang.ObjectgetSet()Ring.Membermultiply(Ring.Member m)Returns the multiplication of this matrix and another.RingMatrixmultiply(RingMatrix m)Returns the multiplication of this matrix and another.AbelianGroup.Membernegate()Returns the negative of this matrix.VectorSpace.MemberscalarDivide(Field.Member x)Returns the division of this matrix by a scalar.Module.MemberscalarMultiply(Ring.Member r)Returns the multiplication of this matrix by a scalar.voidsetElement(int i, int j, Ring.Member r)Sets the value of an element of the matrix.AbelianGroup.Membersubtract(AbelianGroup.Member m)Returns the subtraction of this matrix and another.RingMatrixsubtract(RingMatrix m)Returns the subtraction of this matrix and another.RingMatrixtensor(RingMatrix m)Returns the tensor product of this matrix and another.java.lang.StringtoString()Returns a string representing this matrix.Matrixtranspose()Returns the transpose of this matrix.
-
-
-
Constructor Detail
-
RingMatrix
public RingMatrix(Ring.Member[][] array)
Constructs a matrix by wrapping an array.- Parameters:
array- an assigned value
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object m)
Compares two matrices for equality.- Overrides:
equalsin classjava.lang.Object- Parameters:
m- a matrix
-
toString
public java.lang.String toString()
Returns a string representing this matrix.- Overrides:
toStringin classjava.lang.Object
-
getElement
public Ring.Member getElement(int i, int j)
Returns an element of the matrix.- Parameters:
i- row index of the elementj- column index of the element- Throws:
MatrixDimensionException- If attempting to access an invalid element.
-
setElement
public void setElement(int i, int j, Ring.Member r)Sets the value of an element of the matrix.- Parameters:
i- row index of the elementj- column index of the elementr- a ring element- Throws:
MatrixDimensionException- If attempting to access an invalid element.
-
getSet
public java.lang.Object getSet()
-
negate
public AbelianGroup.Member negate()
Returns the negative of this matrix.
-
add
public final AbelianGroup.Member add(AbelianGroup.Member m)
Returns the addition of this matrix and another.- Parameters:
m- a group member
-
add
public RingMatrix add(RingMatrix m)
Returns the addition of this matrix and another.- Parameters:
m- a matrix- Throws:
MatrixDimensionException- If the matrices are different sizes.
-
subtract
public final AbelianGroup.Member subtract(AbelianGroup.Member m)
Returns the subtraction of this matrix and another.- Parameters:
m- a group member
-
subtract
public RingMatrix subtract(RingMatrix m)
Returns the subtraction of this matrix and another.- Parameters:
m- a matrix- Throws:
MatrixDimensionException- If the matrices are different sizes.
-
scalarMultiply
public Module.Member scalarMultiply(Ring.Member r)
Returns the multiplication of this matrix by a scalar.- Parameters:
r- a ring element.
-
scalarDivide
public VectorSpace.Member scalarDivide(Field.Member x)
Returns the division of this matrix by a scalar.- Parameters:
x- a field element.
-
multiply
public final Ring.Member multiply(Ring.Member m)
Returns the multiplication of this matrix and another.- Parameters:
m- a ring member
-
multiply
public RingMatrix multiply(RingMatrix m)
Returns the multiplication of this matrix and another.- Parameters:
m- a matrix- Throws:
MatrixDimensionException- If the matrices are incompatible.
-
directSum
public RingMatrix directSum(RingMatrix m)
Returns the direct sum of this matrix and another.
-
tensor
public RingMatrix tensor(RingMatrix m)
Returns the tensor product of this matrix and another.
-
-
DMelt 3.0 © DataMelt by jWork.ORG