Package edu.jas.vector
Class GenMatrixRing<C extends RingElem<C>>
java.lang.Object
edu.jas.vector.GenMatrixRing<C>
- All Implemented Interfaces:
AbelianGroupFactory<GenMatrix<C>>
,AlgebraFactory<GenMatrix<C>,
,C> ElemFactory<GenMatrix<C>>
,MonoidFactory<GenMatrix<C>>
,RingFactory<GenMatrix<C>>
,Serializable
public class GenMatrixRing<C extends RingElem<C>>
extends Object
implements AlgebraFactory<GenMatrix<C>,C>
GenMatrixRing implements a generic matrix algebra factory with RingFactory.
Matrices of n rows and m columns over C.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal int
final RingFactory
<C> final int
static final int
static final float
private final float
private static final org.apache.logging.log4j.Logger
private static final Random
final int
-
Constructor Summary
ConstructorsConstructorDescriptionGenMatrixRing
(RingFactory<C> b, int r, int c) Constructors for GenMatrixRing.GenMatrixRing
(RingFactory<C> b, int r, int c, int s) Constructors for GenMatrixRing. -
Method Summary
Modifier and TypeMethodDescriptionCharacteristic of this ring.concat
(GenMatrixRing<C> other) Concat matrix ring.Copy matrix.boolean
Comparison with any other object.fromInteger
(long a) Get the matrix for a.Get the matrix for a.From List of coefficients.fromVectors
(List<GenVector<C>> om) From List of GenVectors.generate
(BiFunction<Integer, Integer, C> gener) Generate matrix via lambda expression.Get a list of the generating elements.getONE()
Get the constant one for the GenMatrix.getZERO()
Get the constant one for the GenMatrix.int
hashCode()
Hash code for this matrix ring.boolean
Query if this ring is associative.boolean
Query if this monoid is commutative.boolean
isField()
Query if this ring is a field.boolean
isFinite()
Is this structure finite or infinite.Parse a matrix from a Reader.Parse a matrix from a String.product
(GenMatrixRing<C> other) Product matrix ring for multiplication.random
(int k) Random matrix.random
(int k, float q) Random matrix.Random matrix.Random matrix.randomLower
(int k, float q) Random lower triangular matrix.randomLower
(int k, float q, Random random) Random lower triangular matrix.randomUpper
(int k, float q) Random upper triangular matrix.randomUpper
(int k, float q, Random random) Random upper triangular matrix.stack
(GenMatrixRing<C> other) Stack matrix ring.toScript()
Get a scripting compatible string representation.toString()
Get the String representation as RingElem.Transposed matrix ring.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface edu.jas.structure.ElemFactory
valueOf
-
Field Details
-
logger
private static final org.apache.logging.log4j.Logger logger -
coFac
-
rows
public final int rows -
cols
public final int cols -
blocksize
public final int blocksize -
DEFAULT_BSIZE
public static final int DEFAULT_BSIZE- See Also:
-
ZERO
-
ONE
-
random
-
DEFAULT_DENSITY
public static final float DEFAULT_DENSITY- See Also:
-
density
private final float density- See Also:
-
-
Constructor Details
-
GenMatrixRing
Constructors for GenMatrixRing.- Parameters:
b
- coefficient factory.r
- number of rows.c
- number of columns.
-
GenMatrixRing
Constructors for GenMatrixRing.- Parameters:
b
- coefficient factory.r
- number of rows.c
- number of columns.s
- block size for blocked operations.
-
-
Method Details
-
toString
Get the String representation as RingElem. -
toScript
Get a scripting compatible string representation.- Specified by:
toScript
in interfaceElemFactory<C extends RingElem<C>>
- Returns:
- script compatible representation for this ElemFactory.
- See Also:
-
getZERO
Get the constant one for the GenMatrix.- Specified by:
getZERO
in interfaceAbelianGroupFactory<C extends RingElem<C>>
- Returns:
- ZERO.
-
getONE
Get the constant one for the GenMatrix.- Specified by:
getONE
in interfaceMonoidFactory<C extends RingElem<C>>
- Returns:
- 1.
-
generators
Get a list of the generating elements.- Specified by:
generators
in interfaceElemFactory<C extends RingElem<C>>
- Returns:
- list of generators for the algebraic structure.
- See Also:
-
isFinite
public boolean isFinite()Is this structure finite or infinite.- Specified by:
isFinite
in interfaceElemFactory<C extends RingElem<C>>
- Returns:
- true if this structure is finite, else false.
- See Also:
-
equals
Comparison with any other object. -
hashCode
public int hashCode()Hash code for this matrix ring. -
isField
public boolean isField()Query if this ring is a field. May return false if it is to hard to determine if this ring is a field.- Specified by:
isField
in interfaceRingFactory<C extends RingElem<C>>
- Returns:
- true if it is known that this ring is a field, else false.
-
isCommutative
public boolean isCommutative()Query if this monoid is commutative.- Specified by:
isCommutative
in interfaceMonoidFactory<C extends RingElem<C>>
- Returns:
- true if this monoid is commutative, else false.
-
isAssociative
public boolean isAssociative()Query if this ring is associative.- Specified by:
isAssociative
in interfaceMonoidFactory<C extends RingElem<C>>
- Returns:
- true if this monoid is associative, else false.
-
characteristic
Characteristic of this ring.- Specified by:
characteristic
in interfaceRingFactory<C extends RingElem<C>>
- Returns:
- characteristic of this ring.
-
transpose
Transposed matrix ring.- Returns:
- transposed ring factory.
-
product
Product matrix ring for multiplication.- Parameters:
other
- matrix ring factory.- Returns:
- product ring factory.
-
stack
Stack matrix ring. this on top of other.- Parameters:
other
- matrix ring factory.- Returns:
- stack ring factory.
-
concat
Concat matrix ring. this before of other.- Parameters:
other
- matrix ring factory.- Returns:
- concat ring factory.
-
fromInteger
Get the matrix for a.- Specified by:
fromInteger
in interfaceElemFactory<C extends RingElem<C>>
- Parameters:
a
- long- Returns:
- matrix corresponding to a.
-
fromInteger
Get the matrix for a.- Specified by:
fromInteger
in interfaceElemFactory<C extends RingElem<C>>
- Parameters:
a
- long- Returns:
- matrix corresponding to a.
-
fromList
From List of coefficients. -
fromVectors
From List of GenVectors.- Parameters:
om
- list of GenVectors.
-
random
Random matrix.- Specified by:
random
in interfaceElemFactory<C extends RingElem<C>>
- Parameters:
k
- size of random coefficients.- Returns:
- a random element.
-
random
Random matrix. -
random
Random matrix.- Specified by:
random
in interfaceElemFactory<C extends RingElem<C>>
- Parameters:
k
- size of random coefficients.random
- is a source for random bits.- Returns:
- a random element.
-
random
Random matrix.- Parameters:
k
- size of random coefficients.q
- density of nozero coefficients.random
- is a source for random bits.- Returns:
- a random element.
-
randomUpper
Random upper triangular matrix.- Parameters:
k
- size of random coefficients.q
- density of nozero coefficients.
-
randomUpper
Random upper triangular matrix.- Parameters:
k
- size of random coefficients.q
- density of nozero coefficients.random
- is a source for random bits.- Returns:
- a random element.
-
randomLower
Random lower triangular matrix.- Parameters:
k
- size of random coefficients.q
- density of nozero coefficients.
-
randomLower
Random lower triangular matrix.- Parameters:
k
- size of random coefficients.q
- density of nozero coefficients.random
- is a source for random bits.- Returns:
- a random element.
-
copy
Copy matrix.- Specified by:
copy
in interfaceElemFactory<C extends RingElem<C>>
- Parameters:
c
- matrix to copy.- Returns:
- copy of the matrix
-
generate
Generate matrix via lambda expression.- Parameters:
gener
- lambda expression.- Returns:
- the generated matrix.
-
parse
Parse a matrix from a String. Syntax: [ [ c, ..., c ], ..., [ c, ..., c ] ]- Specified by:
parse
in interfaceElemFactory<C extends RingElem<C>>
- Parameters:
s
- input String.- Returns:
- parsed matrix
-
parse
Parse a matrix from a Reader.- Specified by:
parse
in interfaceElemFactory<C extends RingElem<C>>
- Parameters:
r
- Reader.- Returns:
- parsed matrix
-