|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
ObjectSparseElt
SparseEltEuc
SparseEltField
SparseEltMod2
Elements of a sparse vector over the finite field F2 = Z/(2) of two elements.
We expect that any SparseElt arguments to methods in this
class are from SparseEltMod2. Otherwise, expect ClassCastExceptions. We do support
| Field Summary | |
static SparseEltMod2 |
ONE
A constant with value 1 and unspecified index. |
protected boolean |
val
The value: true means 1, false means 0. |
static SparseEltMod2 |
ZERO
A constant with value 0 and unspecified index. |
| Fields inherited from class SparseElt |
INDEX_SORTER, NEG_ONE |
| Constructor Summary | |
SparseEltMod2(int index,
boolean val)
Constructs an element whose value is 1 if val is
true and 0 if val is false. |
|
SparseEltMod2(int index,
int val)
Constructs an element whose value is val mod 2. |
|
| Method Summary | |
SparseElt |
add(SparseElt y)
Returns a SparseElt whose value is the sum of the values in this and y, and whose index is that
of this. |
int |
bitLength()
If the value is a BigInteger, returns its BigInteger.bitLength(); if the value is stored in a primitive
type, returns the bit length of the type. |
SparseElt |
copy(int indexOfCopy)
Returns a SparseElt with the same value as this,
and with index indexOfCopy. |
SparseEltField |
dividedBy(SparseEltField y)
Returns this/y. |
boolean |
divides(SparseElt y)
Whether the value of this divides the value of
y; that is, whether there is an x
such that x * this = y. |
SparseElt |
getNegOne()
Returns a SparseElt from the same integral domain as this, with value -1 and unspecified index. |
SparseElt |
getOne()
Returns a SparseElt from the same integral domain as this, with value 1 and unspecified index. |
String |
getPrintValue()
Returns the value in human-readable form. |
SparseElt |
getZero()
Returns a SparseElt from the same integral domain as this, with value 0 and unspecified index. |
int |
hashCode()
Is consistent with SparseElt.equals(java.lang.Object). |
boolean |
isEqualValue(SparseElt y)
Tests whether the values are equal, ignoring the indices. |
boolean |
isNegOne()
Whether the value is -1. |
boolean |
isOne()
Whether the value is one. |
boolean |
isZero()
Whether the value is zero. |
SparseElt |
multiply(int newIndex,
SparseElt y)
Returns a SparseElt with index newIndex and whose
value is the product of the values in this and
y. |
SparseElt |
multiply(SparseElt y)
Returns a SparseElt whose value is the product of the values in this and y, and whose index is that
of this. |
SparseElt |
negate()
Returns a SparseElt whose value is the negative of the value of this, and whose index is that of
this. |
SparseEltEuc |
negClosestQuotient(SparseEltEuc y)
Negative of the closest quotient: returns q such
that q * y + this is as small as possible for
SparseEltField.eucNorm(). |
SparseElt |
subtract(SparseElt y)
Returns a SparseElt whose value is (value of this)
minus (value of y), and whose index is that of
this. |
| Methods inherited from class SparseEltField |
eucNorm, getEucNormComparator |
| Methods inherited from class SparseElt |
equals, getIndex, toString |
| Methods inherited from class Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected boolean val
public static final SparseEltMod2 ZERO
SparseElt.ZERO if you are working over
F2.
public static final SparseEltMod2 ONE
SparseElt.ONE if you are working over
F2.
| Constructor Detail |
public SparseEltMod2(int index,
int val)
val mod 2.
public SparseEltMod2(int index,
boolean val)
val is
true and 0 if val is false.
| Method Detail |
public SparseElt add(SparseElt y)
SparseEltthis and y, and whose index is that
of this.
add in class SparseEltpublic int bitLength()
SparseEltBigInteger.bitLength(); if the value is stored in a primitive
type, returns the bit length of the type.
bitLength in class SparseEltpublic SparseElt copy(int indexOfCopy)
SparseEltthis,
and with index indexOfCopy.
copy in class SparseEltpublic SparseEltField dividedBy(SparseEltField y)
SparseEltFieldthis/y. The index is that of
this.
dividedBy in class SparseEltFieldpublic boolean divides(SparseElt y)
SparseEltthis divides the value of
y; that is, whether there is an x
such that x * this = y.
divides in class SparseEltpublic SparseElt getNegOne()
SparseEltthis, with value -1 and unspecified index.
getNegOne in class SparseEltpublic SparseElt getOne()
SparseEltthis, with value 1 and unspecified index.
getOne in class SparseEltpublic String getPrintValue()
SparseElt
getPrintValue in class SparseEltpublic SparseElt getZero()
SparseEltthis, with value 0 and unspecified index.
getZero in class SparseEltpublic final int hashCode()
SparseElt.equals(java.lang.Object).
hashCode in class SparseEltpublic final boolean isEqualValue(SparseElt y)
SparseElt
isEqualValue in class SparseEltpublic boolean isNegOne()
SparseElt
isNegOne in class SparseEltpublic boolean isOne()
SparseElt
isOne in class SparseEltpublic boolean isZero()
SparseElt
isZero in class SparseEltpublic SparseElt multiply(SparseElt y)
SparseEltthis and y, and whose index is that
of this.
multiply in class SparseElt
public SparseElt multiply(int newIndex,
SparseElt y)
SparseEltnewIndex and whose
value is the product of the values in this and
y.
multiply in class SparseEltpublic SparseElt negate()
SparseEltthis, and whose index is that of
this.
negate in class SparseEltpublic SparseEltEuc negClosestQuotient(SparseEltEuc y)
SparseEltEucq such
that q * y + this is as small as possible for
SparseEltEuc.eucNorm(). In other words, returns -this/y
rounded off to the nearest element of D. The index is
that of this.
negClosestQuotient in class SparseEltEucpublic SparseElt subtract(SparseElt y)
SparseEltthis)
minus (value of y), and whose index is that of
this.
subtract in class SparseElt
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||