Vector
| Modifier and Type | Field and Description |
|---|---|
| private int[] | v
holds the elements of this vector |
| Access | Constructor and Description |
|---|---|
| public | |
| public | GF2Vector(int
the length of the vector length, SecureRandom the source of randomness sr)Construct a random GF2Vector of the given length. |
| public | GF2Vector(int
the length of the vector length, int the number of non-zero coefficients t, SecureRandom the source of randomness sr)Construct a random GF2Vector of the given length with the specified number of non-zero coefficients. |
| public | GF2Vector(int
the length of the vector length, int[] the element array v)Construct a GF2Vector of the given length and with elements from the given array. |
| public | |
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public Vector | Returns: this + otheranother GF2Vector other)Implements abstract org. Adds another GF2Vector to this vector. |
| public boolean | Returns: the result of the comparisonvector other)Implements abstract org. Check if the given object is equal to this vector. |
| public GF2Vector | Returns: a newGF2Vector consisting of the first k
elements of this vectorthe number of elements to extract k)Return a new vector consisting of the first k elements of this vector. |
| public GF2Vector | Returns: a newGF2Vector consisting of the last k
elements of this vectorthe number of elements to extract k)Return a new vector consisting of the last k elements of this vector. |
| public GF2Vector | Returns: the newGF2Vector
[this_setJ[0], this_setJ[1], ..., this_setJ[#setJ-1]]the set of indices of elements to extract setJ)Return a new vector consisting of the elements of this vector with the indices given by the set setJ. |
| public int | Returns: the value of the bit (0 or 1)the index index)Return the value of the bit of this vector at the specified index. |
| public byte[] | Returns: the encoded vectorImplements abstract org. Encode this vector as byte array. |
| public int | Returns: the Hamming weight of this vectorReturn the Hamming weight of this vector, i.e., compute the number of units of this vector. |
| public int[] | |
| public int | Returns: the hash code of this vectorImplements abstract org. Returns a hash code value for this object. |
| public boolean | Returns: whether this is the zero vector (i.e., all elements are zero)Implements abstract org. Return whether this is the zero vector (i.e., all elements are zero). |
| public Vector | Returns: this*p = p*thisthe permutation p)Implements abstract org. Multiply this vector with a permutation. |
| public static GF2Vector | Returns: the decoded vectorthe length of the vector length, byte[] the encoded vector encVec)Construct a new GF2Vector with the given length out of the encoded vector. |
| public void | |
| public GF2mVector | Returns: the converted vector over GF(2m)the finite field GF(2m) field)Rewrite this vector as a vector over GF(2m) with t elements. |
| public String | Returns: a human readable form of this vectorImplements abstract org. Returns a string representation of the object. |
| v | back to summary |
|---|---|
| private int[] v holds the elements of this vector | |
| GF2Vector | back to summary |
|---|---|
| public GF2Vector(int length) Construct the zero vector of the given length.
| |
| GF2Vector | back to summary |
|---|---|
| public GF2Vector(int length, SecureRandom sr) Construct a random GF2Vector of the given length.
| |
| GF2Vector | back to summary |
|---|---|
| public GF2Vector(int length, int t, SecureRandom sr) Construct a random GF2Vector of the given length with the specified number of non-zero coefficients.
| |
| GF2Vector | back to summary |
|---|---|
| public GF2Vector(int length, int[] v) Construct a GF2Vector of the given length and with elements from the given array. The array is copied and unused bits are masked out.
| |
| GF2Vector | back to summary |
|---|---|
| public GF2Vector(GF2Vector other) Copy constructor. | |
| GF2Vector | back to summary |
|---|---|
| protected GF2Vector(int[] v, int length) Construct a new
| |
| add | back to summary |
|---|---|
| public Vector add(Vector other) Implements abstract org. Adds another GF2Vector to this vector.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object other) Implements abstract org. Check if the given object is equal to this vector.
| |
| extractLeftVector | back to summary |
|---|---|
| public GF2Vector extractLeftVector(int k) Return a new vector consisting of the first k elements of this vector. | |
| extractRightVector | back to summary |
|---|---|
| public GF2Vector extractRightVector(int k) Return a new vector consisting of the last k elements of this vector. | |
| extractVector | back to summary |
|---|---|
| public GF2Vector extractVector(int[] setJ) Return a new vector consisting of the elements of this vector with the indices given by the set setJ. | |
| getBit | back to summary |
|---|---|
| public int getBit(int index) Return the value of the bit of this vector at the specified index.
| |
| getEncoded | back to summary |
|---|---|
| public byte[] getEncoded() Implements abstract org. Encode this vector as byte array.
| |
| getHammingWeight | back to summary |
|---|---|
| public int getHammingWeight() Return the Hamming weight of this vector, i.e., compute the number of units of this vector.
| |
| getVecArray | back to summary |
|---|---|
public int[] getVecArray()
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Implements abstract org. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| isZero | back to summary |
|---|---|
| public boolean isZero() Implements abstract org. Doc from org. Return whether this is the zero vector (i.e., all elements are zero).
| |
| multiply | back to summary |
|---|---|
| public Vector multiply(Permutation p) Implements abstract org. Multiply this vector with a permutation.
| |
| OS2VP | back to summary |
|---|---|
| public static GF2Vector OS2VP(int length, byte[] encVec) Construct a new GF2Vector with the given length out of the encoded vector.
| |
| setBit | back to summary |
|---|---|
| public void setBit(int index) Set the coefficient at the given index to 1. If the index is out of bounds, do nothing.
| |
| toExtensionFieldVector | back to summary |
|---|---|
| public GF2mVector toExtensionFieldVector(GF2mField field) Rewrite this vector as a vector over GF(2m) with t elements.
| |
| toString | back to summary |
|---|---|
| public String toString() Implements abstract org. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
| |