Package edu.jas.arith
Class BigQuaternionInteger
- java.lang.Object
-
- edu.jas.arith.BigQuaternion
-
- edu.jas.arith.BigQuaternionInteger
-
- All Implemented Interfaces:
AbelianGroupElem<BigQuaternion>
,Element<BigQuaternion>
,GcdRingElem<BigQuaternion>
,MonoidElem<BigQuaternion>
,RingElem<BigQuaternion>
,StarRingElem<BigQuaternion>
,java.io.Serializable
,java.lang.Comparable<BigQuaternion>
public final class BigQuaternionInteger extends BigQuaternion
Integer BigQuaternion class based on BigRational implementing the RingElem interface and with the familiar MAS static method names. Objects of this class are immutable. The integer quaternion methods are implemented after https://de.wikipedia.org/wiki/Hurwitzquaternion see also https://en.wikipedia.org/wiki/Hurwitz_quaternion- Author:
- Heinz Kredel
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description BigQuaternionInteger(BigQuaternionRing fac)
Constructor for a BigQuaternion with no arguments.BigQuaternionInteger(BigQuaternionRing fac, long r)
Constructor for a BigQuaternion from long.BigQuaternionInteger(BigQuaternionRing fac, BigComplex r)
Constructor for a BigQuaternion from BigComplex.BigQuaternionInteger(BigQuaternionRing fac, BigQuaternion q)
Constructor for a BigQuaternionInteger from BigQuaternion.BigQuaternionInteger(BigQuaternionRing fac, BigRational r)
Constructor for a BigQuaternion from BigRationals.BigQuaternionInteger(BigQuaternionRing fac, BigRational r, BigRational i)
Constructor for a BigQuaternion from BigRationals.BigQuaternionInteger(BigQuaternionRing fac, BigRational r, BigRational i, BigRational j)
Constructor for a BigQuaternion from BigRationals.BigQuaternionInteger(BigQuaternionRing fac, BigRational r, BigRational i, BigRational j, BigRational k)
Constructor for a BigQuaternion from BigRationals.BigQuaternionInteger(BigQuaternionRing fac, java.lang.String s)
The BigQuaternion string constructor accepts the following formats: empty string, "rational", or "rat i rat j rat k rat" with no blanks around i, j or k if used as polynoial coefficient.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description BigQuaternion
abs()
Quaternion number absolute value.BigQuaternionInteger
copy()
Clone this.BigQuaternion
divide(BigQuaternion b)
BigQuaternion right divide.BigQuaternion
divide(BigRational b)
BigQuaternion divide.BigQuaternion[]
egcd(BigQuaternion S)
BigQuaternion extended greatest common divisor.BigQuaternionRing
factory()
Get the corresponding element factory.BigQuaternion
gcd(BigQuaternion S)
Quaternion number greatest common divisor.BigQuaternion
inverse()
BigQuaternion inverse.boolean
isPrime()
Quaternion number test if it is a prime number.BigQuaternion
leftDivide(BigQuaternion b)
BigQuaternion left divide.BigQuaternion
leftGcd(BigQuaternion S)
Integer quaternion number left greatest common divisor.BigQuaternion[]
leftQuotientAndRemainder(BigQuaternion b)
Integral quotient and remainder by left division of this by S.BigQuaternion
leftRemainder(BigQuaternion a)
Left remainder.static BigQuaternion
QINV(BigQuaternion A)
Quaternion number inverse.static BigQuaternion
QQ(BigQuaternion A, BigQuaternion B)
Quaternion number quotient.BigQuaternion[]
quotientRemainder(BigQuaternion S)
Quotient and remainder by division of this by S.BigQuaternion
remainder(BigQuaternion S)
BigQuaternion remainder.BigQuaternion
rightDivide(BigQuaternion b)
BigQuaternion right divide.BigQuaternion
rightGcd(BigQuaternion S)
Integer quaternion number right greatest common divisor.BigQuaternion[]
rightQuotientAndRemainder(BigQuaternion b)
Integral quotient and remainder by right division of this by S.BigQuaternion
rightRemainder(BigQuaternion a)
Right remainder.-
Methods inherited from class edu.jas.arith.BigQuaternion
bitLength, ceil, compareTo, conjugate, equals, floor, getIm, getJm, getKm, getRe, hashCode, isEntier, isIMAG, isONE, isQONE, isQZERO, isUnit, isZERO, multiply, multiply, multiplyLeft, negate, norm, QABS, QCON, QDIF, QNEG, QPROD, QSUM, roundToHurwitzian, roundToLipschitzian, signum, subtract, sum, toScript, toScriptFactory, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface edu.jas.structure.MonoidElem
power, twosidedDivide, twosidedRemainder
-
-
-
-
Constructor Detail
-
BigQuaternionInteger
public BigQuaternionInteger(BigQuaternionRing fac, BigRational r, BigRational i, BigRational j, BigRational k)
Constructor for a BigQuaternion from BigRationals.- Parameters:
fac
- BigQuaternionRing.r
- BigRational.i
- BigRational.j
- BigRational.k
- BigRational.
-
BigQuaternionInteger
public BigQuaternionInteger(BigQuaternionRing fac, BigRational r, BigRational i, BigRational j)
Constructor for a BigQuaternion from BigRationals.- Parameters:
fac
- BigQuaternionRing.r
- BigRational.i
- BigRational.j
- BigRational.
-
BigQuaternionInteger
public BigQuaternionInteger(BigQuaternionRing fac, BigRational r, BigRational i)
Constructor for a BigQuaternion from BigRationals.- Parameters:
fac
- BigQuaternionRing.r
- BigRational.i
- BigRational.
-
BigQuaternionInteger
public BigQuaternionInteger(BigQuaternionRing fac, BigRational r)
Constructor for a BigQuaternion from BigRationals.- Parameters:
fac
- BigQuaternionRing.r
- BigRational.
-
BigQuaternionInteger
public BigQuaternionInteger(BigQuaternionRing fac, BigComplex r)
Constructor for a BigQuaternion from BigComplex.- Parameters:
fac
- BigQuaternionRing.r
- BigComplex.
-
BigQuaternionInteger
public BigQuaternionInteger(BigQuaternionRing fac, BigQuaternion q)
Constructor for a BigQuaternionInteger from BigQuaternion.- Parameters:
fac
- BigQuaternionRing.q
- BigQuaternion.
-
BigQuaternionInteger
public BigQuaternionInteger(BigQuaternionRing fac, long r)
Constructor for a BigQuaternion from long.- Parameters:
fac
- BigQuaternionRing.r
- long.
-
BigQuaternionInteger
public BigQuaternionInteger(BigQuaternionRing fac)
Constructor for a BigQuaternion with no arguments.- Parameters:
fac
- BigQuaternionRing.
-
BigQuaternionInteger
public BigQuaternionInteger(BigQuaternionRing fac, java.lang.String s) throws java.lang.NumberFormatException
The BigQuaternion string constructor accepts the following formats: empty string, "rational", or "rat i rat j rat k rat" with no blanks around i, j or k if used as polynoial coefficient.- Parameters:
fac
- BigQuaternionRing.s
- String.- Throws:
java.lang.NumberFormatException
-
-
Method Detail
-
factory
public BigQuaternionRing factory()
Get the corresponding element factory.- Specified by:
factory
in interfaceElement<BigQuaternion>
- Overrides:
factory
in classBigQuaternion
- Returns:
- factory for this Element.
- See Also:
Element.factory()
-
copy
public BigQuaternionInteger copy()
Clone this.- Specified by:
copy
in interfaceElement<BigQuaternion>
- Overrides:
copy
in classBigQuaternion
- Returns:
- Creates and returns a copy of this Element.
- See Also:
Object.clone()
-
abs
public BigQuaternion abs()
Quaternion number absolute value.- Specified by:
abs
in interfaceAbelianGroupElem<BigQuaternion>
- Overrides:
abs
in classBigQuaternion
- Returns:
- |this|**2. Note: returns the norm(this).
- See Also:
AbelianGroupElem.abs()
-
QINV
public static BigQuaternion QINV(BigQuaternion A)
Quaternion number inverse.- Parameters:
A
- is a non-zero quaternion number.- Returns:
- S with S * A = A * S = 1.
-
inverse
public BigQuaternion inverse()
BigQuaternion inverse.- Specified by:
inverse
in interfaceMonoidElem<BigQuaternion>
- Overrides:
inverse
in classBigQuaternion
- Returns:
- S with S * this = this * S = 1.
- See Also:
MonoidElem.inverse()
-
remainder
public BigQuaternion remainder(BigQuaternion S)
BigQuaternion remainder.- Specified by:
remainder
in interfaceMonoidElem<BigQuaternion>
- Overrides:
remainder
in classBigQuaternion
- Parameters:
S
- BigQuaternion.- Returns:
- this - this * b**(-1).
-
QQ
public static BigQuaternion QQ(BigQuaternion A, BigQuaternion B)
Quaternion number quotient.- Parameters:
A
- BigQuaternion.B
- BigQuaternion.- Returns:
- R * B**(-1).
-
divide
public BigQuaternion divide(BigQuaternion b)
BigQuaternion right divide.- Specified by:
divide
in interfaceMonoidElem<BigQuaternion>
- Overrides:
divide
in classBigQuaternion
- Parameters:
b
- BigQuaternion.- Returns:
- this * b**(-1).
-
rightDivide
public BigQuaternion rightDivide(BigQuaternion b)
BigQuaternion right divide.- Specified by:
rightDivide
in interfaceMonoidElem<BigQuaternion>
- Overrides:
rightDivide
in classBigQuaternion
- Parameters:
b
- BigQuaternion.- Returns:
- this * b**(-1).
-
leftDivide
public BigQuaternion leftDivide(BigQuaternion b)
BigQuaternion left divide.- Specified by:
leftDivide
in interfaceMonoidElem<BigQuaternion>
- Overrides:
leftDivide
in classBigQuaternion
- Parameters:
b
- BigQuaternion.- Returns:
- b**(-1) * this.
-
divide
public BigQuaternion divide(BigRational b)
BigQuaternion divide.- Overrides:
divide
in classBigQuaternion
- Parameters:
b
- BigRational.- Returns:
- this/b.
-
quotientRemainder
public BigQuaternion[] quotientRemainder(BigQuaternion S)
Quotient and remainder by division of this by S.- Specified by:
quotientRemainder
in interfaceMonoidElem<BigQuaternion>
- Overrides:
quotientRemainder
in classBigQuaternion
- Parameters:
S
- a quaternion number- Returns:
- [this*S**(-1), this - (this*S**(-1))*S].
-
gcd
public BigQuaternion gcd(BigQuaternion S)
Quaternion number greatest common divisor.- Specified by:
gcd
in interfaceRingElem<BigQuaternion>
- Overrides:
gcd
in classBigQuaternion
- Parameters:
S
- BigQuaternion.- Returns:
- gcd(this,S).
-
egcd
public BigQuaternion[] egcd(BigQuaternion S)
BigQuaternion extended greatest common divisor.- Specified by:
egcd
in interfaceRingElem<BigQuaternion>
- Overrides:
egcd
in classBigQuaternion
- Parameters:
S
- BigQuaternion.- Returns:
- [ gcd(this,S), a, b ] with a*this + b*S = gcd(this,S).
-
leftQuotientAndRemainder
public BigQuaternion[] leftQuotientAndRemainder(BigQuaternion b)
Integral quotient and remainder by left division of this by S. This must be also an integral (Hurwitz) quaternion number.- Parameters:
b
- an integral (Hurwitz) quaternion number- Returns:
- [round(b**(-1)) this, this - b * (round(b**(-1)) this)].
-
rightQuotientAndRemainder
public BigQuaternion[] rightQuotientAndRemainder(BigQuaternion b)
Integral quotient and remainder by right division of this by S. This must be also an integral (Hurwitz) quaternion number.- Parameters:
b
- an integral (Hurwitz) quaternion number- Returns:
- [this round(b**(-1)), this - this (round(b**(-1)) b)].
-
leftRemainder
public BigQuaternion leftRemainder(BigQuaternion a)
Left remainder.- Specified by:
leftRemainder
in interfaceMonoidElem<BigQuaternion>
- Overrides:
leftRemainder
in classBigQuaternion
- Parameters:
a
- element.- Returns:
- r = this - (a/left) * a, where left * a = this.
-
rightRemainder
public BigQuaternion rightRemainder(BigQuaternion a)
Right remainder.- Specified by:
rightRemainder
in interfaceMonoidElem<BigQuaternion>
- Overrides:
rightRemainder
in classBigQuaternion
- Parameters:
a
- element.- Returns:
- r = this - a * (a/right), where a * right = this.
-
leftGcd
public BigQuaternion leftGcd(BigQuaternion S)
Integer quaternion number left greatest common divisor.- Specified by:
leftGcd
in interfaceRingElem<BigQuaternion>
- Overrides:
leftGcd
in classBigQuaternion
- Parameters:
S
- integer BigQuaternion.- Returns:
- leftGcd(this,S).
-
rightGcd
public BigQuaternion rightGcd(BigQuaternion S)
Integer quaternion number right greatest common divisor.- Specified by:
rightGcd
in interfaceRingElem<BigQuaternion>
- Overrides:
rightGcd
in classBigQuaternion
- Parameters:
S
- integer BigQuaternion.- Returns:
- rightGcd(this,S).
-
isPrime
public boolean isPrime()
Quaternion number test if it is a prime number.- Returns:
- isPrime(norm(this))
-
-