Package edu.jas.arith
Class BigQuaternionRing
java.lang.Object
edu.jas.arith.BigQuaternionRing
- All Implemented Interfaces:
AbelianGroupFactory<BigQuaternion>
,ElemFactory<BigQuaternion>
,MonoidFactory<BigQuaternion>
,RingFactory<BigQuaternion>
,Serializable
BigQuaternion ring class based on BigRational implementing the RingElem
interface.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static List
<BigQuaternion> List of all 24 integral units.final BigQuaternion
The constant i.protected boolean
Flag to signal if this ring is integral.final BigQuaternion
The constant j.final BigQuaternion
The constant k.private static final org.apache.logging.log4j.Logger
final BigQuaternion
The constant 1.protected static final Random
final BigQuaternion
The constant 0. -
Constructor Summary
ConstructorsConstructorDescriptionConstructor for a BigQuaternion ring.BigQuaternionRing
(boolean i) Constructor for a BigQuaternion ring. -
Method Summary
Modifier and TypeMethodDescriptionCharacteristic of this ring.Copy BigQuaternion element c.boolean
Comparison with any other object.fromInteger
(long a) Get a BigQuaternion element from a long.fromInteger
(long[] a) Get a BigQuaternion element from a long vector.Get a BigQuaternion element from a BigInteger.Get a list of the generating elements.getONE()
Get the one element.getZERO()
Get the zero element.int
hashCode()
Hash code for this BigQuaternionRing.boolean
Query if this ring is associative.boolean
Query if this ring is commutative.boolean
isField()
Query if this ring is a field.boolean
isFinite()
Is this structure finite or infinite.Parse quaternion number from Reader.Parse quaternion number from String.random
(int n) BigQuaternion random.BigQuaternion random.toScript()
Get a scripting compatible string representation.toString()
Get the string representation.BigQuaternion units of the Hurwitzian integers.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
-
entierUnits
List of all 24 integral units. -
integral
protected boolean integralFlag to signal if this ring is integral. -
random
-
logger
private static final org.apache.logging.log4j.Logger logger -
ZERO
The constant 0. -
ONE
The constant 1. -
I
The constant i. -
J
The constant j. -
K
The constant k.
-
-
Constructor Details
-
BigQuaternionRing
public BigQuaternionRing()Constructor for a BigQuaternion ring. -
BigQuaternionRing
public BigQuaternionRing(boolean i) Constructor for a BigQuaternion ring.
-
-
Method Details
-
generators
Get a list of the generating elements.- Specified by:
generators
in interfaceElemFactory<BigQuaternion>
- 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<BigQuaternion>
- Returns:
- true if this structure is finite, else false.
- See Also:
-
copy
Copy BigQuaternion element c.- Specified by:
copy
in interfaceElemFactory<BigQuaternion>
- Parameters:
c
- BigQuaternion.- Returns:
- a copy of c.
-
getZERO
Get the zero element.- Specified by:
getZERO
in interfaceAbelianGroupFactory<BigQuaternion>
- Returns:
- 0 as BigQuaternion.
-
getONE
Get the one element.- Specified by:
getONE
in interfaceMonoidFactory<BigQuaternion>
- Returns:
- q as BigQuaternion.
-
isCommutative
public boolean isCommutative()Query if this ring is commutative.- Specified by:
isCommutative
in interfaceMonoidFactory<BigQuaternion>
- Returns:
- false.
-
isAssociative
public boolean isAssociative()Query if this ring is associative.- Specified by:
isAssociative
in interfaceMonoidFactory<BigQuaternion>
- Returns:
- true.
-
isField
public boolean isField()Query if this ring is a field.- Specified by:
isField
in interfaceRingFactory<BigQuaternion>
- Returns:
- true.
-
characteristic
Characteristic of this ring.- Specified by:
characteristic
in interfaceRingFactory<BigQuaternion>
- Returns:
- characteristic of this ring.
-
fromInteger
Get a BigQuaternion element from a BigInteger.- Specified by:
fromInteger
in interfaceElemFactory<BigQuaternion>
- Parameters:
a
- BigInteger.- Returns:
- a BigQuaternion.
-
fromInteger
Get a BigQuaternion element from a long.- Specified by:
fromInteger
in interfaceElemFactory<BigQuaternion>
- Parameters:
a
- long.- Returns:
- a BigQuaternion.
-
fromInteger
Get a BigQuaternion element from a long vector.- Parameters:
a
- long vector.- Returns:
- a BigQuaternion.
-
toString
Get the string representation. Is compatible with the string constructor. -
toScript
Get a scripting compatible string representation.- Specified by:
toScript
in interfaceElemFactory<BigQuaternion>
- Returns:
- script compatible representation for this Element.
- See Also:
-
equals
Comparison with any other object. -
hashCode
public int hashCode()Hash code for this BigQuaternionRing. -
unitsOfHurwitzian
BigQuaternion units of the Hurwitzian integers. BigQuaternion units with all integer or all 1/2 times integer components.- Returns:
- list of all 24 units.
-
random
BigQuaternion random. Random rational numbers A, B, C and D are generated using random(n). Then R is the quaternion number with real part A and imaginary parts B, C and D.- Specified by:
random
in interfaceElemFactory<BigQuaternion>
- Parameters:
n
- such that 0 ≤ A, B, C, D ≤ (2n-1).- Returns:
- R, a random BigQuaternion.
-
random
BigQuaternion random. Random rational numbers A, B, C and D are generated using RNRAND(n). Then R is the quaternion number with real part A and imaginary parts B, C and D.- Specified by:
random
in interfaceElemFactory<BigQuaternion>
- Parameters:
n
- such that 0 ≤ A, B, C, D ≤ (2n-1).rnd
- is a source for random bits.- Returns:
- R, a random BigQuaternion.
-
parse
Parse quaternion number from String.- Specified by:
parse
in interfaceElemFactory<BigQuaternion>
- Parameters:
s
- String.- Returns:
- BigQuaternion from s.
-
parse
Parse quaternion number from Reader.- Specified by:
parse
in interfaceElemFactory<BigQuaternion>
- Parameters:
r
- Reader.- Returns:
- next BigQuaternion from r.
-