shh.csparse
Class SparseEltEuc
Object
SparseElt
SparseEltEuc
- Direct Known Subclasses:
- SparseEltField, SparseEltZ
- public abstract class SparseEltEuc
- extends SparseElt
A class of SparseElts should implement this interface if
its underlying integral domain D is a Euclidean
domain.
- Author:
- Mark McConnell
| Methods inherited from class SparseElt |
add, bitLength, copy, divides, equals, getIndex, getNegOne, getOne, getPrintValue, getZero, hashCode, isEqualValue, isNegOne, isOne, isZero, multiply, multiply, negate, subtract, toString |
SparseEltEuc
public SparseEltEuc()
eucNorm
public abstract Number eucNorm()
- Returns the Euclidean norm. An implementing class may return
BigInteger, Integer, etc., as long as it's
consistent.
getEucNormComparator
public abstract Comparator getEucNormComparator()
- Returns a Comparator
C that compares by Euclidean
norm. C.compare(a,b) should give the same results
as
a.eucNorm().compareTo(b.eucNorm()),
where compareTo is the usual <, but
C.compare might be more efficient.
negClosestQuotient
public abstract SparseEltEuc negClosestQuotient(SparseEltEuc y)
- Negative of the closest quotient: returns
q such
that q * y + this is as small as possible for
eucNorm(). In other words, returns -this/y
rounded off to the nearest element of D. The index is
that of this.
- Throws:
ArithmeticException - If y is zero.