public class MpzRef extends Mpz
Mpq
objects.
A mpq_t
GMP C object contains a numerator and a denominator
which are themselves mpz_t
GMP C objects and can be manipulated
independently.
The MpzRef class proposes a similar interface for Java.
A MpzRef to reference the numerator or the denominator of a Mpq
object can be obtained using the Mpq.numRef()
and
Mpq.denRef()
methods.
The MpzRef can then be manipulated exactly as a Mpz
, from which
it inherits all methods.
This allows manipulating Mpq
numerators and denominators
in-place, without requiring any copy.
MpzRef cannot be serialized as it represents a reference to a part of a larger object.
Modifier and Type | Field and Description |
---|---|
protected java.lang.Object |
parent
We keep a pointer to the parent
Mpq object so that it is
not freed while a MpzRef on it is live. |
Modifier and Type | Method and Description |
---|---|
MpzRef |
clone()
MpzRef are not clonable.
|
protected void |
finalize()
Overrides
Mpz.finalize() to prevent deallocation. |
abs, abs, add, add, add, add, addMul, addMul, and, and, bigIntegerValue, bin, bin, byteArrayValue, cdivQ, cdivQ, cdivQ, cdivQ, cdivQ2exp, cdivQR, cdivQR, cdivR, cdivR, cdivR, cdivR2exp, clrBit, cmp, cmp, cmp, cmpAbs, cmpAbs, cmpAbs, compareTo, divExact, divExact, divExact, divExact, doubleExponentValue, doubleValue, equals, fac, fdivQ, fdivQ, fdivQ, fdivQ, fdivQ2exp, fdivQR, fdivQR, fdivR, fdivR, fdivR, fdivR2exp, fib, fib, fitsInt, gcd, gcd, gcd, hamDist, hashCode, intValue, invert, isCongruent, isCongruent, isCongruent2exp, isDivisible, isDivisible, isDivisible2exp, isEqual, isEven, isOdd, isPerfectPower, isPerfectSquare, isPhysicalEqual, isProbabPrime, jacobi, kronecker, kronecker, kronecker, lcm, lcm, legendre, lucnum, lucnum, mod, mod, mod, mod, mul, mul, mul, mul, mul2exp, mul2exp, neg, neg, nextPrime, not, not, notBit, or, or, popCount, pow, pow, pow, pow, pow, random, randomBits, remove, remove, root, root, root, rRandomBits, scan0, scan1, set, set, set, set, set, set, set, setBit, sgn, size, sizeInBase, sqrt, sqrt, sqrt, sub, sub, sub, sub, sub, subMul, subMul, subRev, tdivQ, tdivQ, tdivQ, tdivQ, tdivQ2exp, tdivQR, tdivQR, tdivR, tdivR, tdivR, tdivR2exp, toString, toString, tstBit, xor, xor
protected java.lang.Object parent
Mpq
object so that it is
not freed while a MpzRef on it is live.public MpzRef clone() throws java.lang.CloneNotSupportedException
protected void finalize()
Mpz.finalize()
to prevent deallocation.