TernaryPolynomial with a "low" number of nonzero coefficients.
| Modifier and Type | Field and Description |
|---|---|
| private static final int | BITS_PER_INDEX
Number of bits to use for each coefficient. |
| private int | |
| private int[] | |
| private int[] |
| Access | Constructor and Description |
|---|---|
| pack-priv | SparseTernaryPolynomial(int
total number of coefficients including zeros N, int[] indices of coefficients equal to 1 ones, int[] indices of coefficients equal to -1 negOnes)Constructs a new polynomial. |
| public | SparseTernaryPolynomial(IntegerPolynomial
the original polynomial intPoly)Constructs a |
| public | SparseTernaryPolynomial(int[]
the coefficients coeffs)Constructs a new |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public boolean | equals(Object
the reference object with which to compare. obj)Overrides java. Indicates whether some other object is "equal to" this one. |
| public static SparseTernaryPolynomial | Returns: the decoded polynomialan input stream containing an encoded polynomial is, int number of coefficients including zeros N, int number of coefficients equal to 1 numOnes, int number of coefficients equal to -1 numNegOnes)Decodes a byte array encoded with |
| public static SparseTernaryPolynomial | generateRandom(int
number of coefficients N, int number of 1's numOnes, int number of -1's numNegOnes, SecureRandom random)Generates a random polynomial with |
| public int[] | |
| public int[] | |
| public int | |
| public IntegerPolynomial | mult(IntegerPolynomial
a polynomial poly2)Implements org. Multiplies the polynomial by an |
| public IntegerPolynomial | mult(IntegerPolynomial
a polynomial poly2, int a modulus to apply modulus)Implements org. Multiplies the polynomial by an |
| public BigIntPolynomial | mult(BigIntPolynomial
the polynomial to multiply by poly2)Implements org. Multiplies the polynomial by a |
| public int | size()
Implements org. Returns the maximum number of coefficients the polynomial can have |
| public byte[] | Returns: the encoded polynomialEncodes the polynomial to a byte array writing |
| public IntegerPolynomial | toIntegerPolynomial()
Implements org. Returns a polynomial that is equal to this polynomial (in the sense that |
| BITS_PER_INDEX | back to summary |
|---|---|
| private static final int BITS_PER_INDEX Number of bits to use for each coefficient. Determines the upper bound for | |
| N | back to summary |
|---|---|
| private int N | |
| negOnes | back to summary |
|---|---|
| private int[] negOnes | |
| ones | back to summary |
|---|---|
| private int[] ones | |
| SparseTernaryPolynomial | back to summary |
|---|---|
| pack-priv SparseTernaryPolynomial(int N, int[] ones, int[] negOnes) Constructs a new polynomial.
| |
| SparseTernaryPolynomial | back to summary |
|---|---|
| public SparseTernaryPolynomial(IntegerPolynomial intPoly) Constructs a
| |
| SparseTernaryPolynomial | back to summary |
|---|---|
| public SparseTernaryPolynomial(int[] coeffs) Constructs a new
| |
| clear | back to summary |
|---|---|
| public void clear() Implements org. | |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.
| |
| fromBinary | back to summary |
|---|---|
| public static SparseTernaryPolynomial fromBinary(InputStream is, int N, int numOnes, int numNegOnes) throws IOException Decodes a byte array encoded with
| |
| generateRandom | back to summary |
|---|---|
| public static SparseTernaryPolynomial generateRandom(int N, int numOnes, int numNegOnes, SecureRandom random) Generates a random polynomial with
| |
| getNegOnes | back to summary |
|---|---|
| public int[] getNegOnes() Implements org. | |
| getOnes | back to summary |
|---|---|
| public int[] getOnes() Implements org. | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. 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
| |
| mult | back to summary |
|---|---|
| public IntegerPolynomial mult(IntegerPolynomial poly2) Implements org. Doc from org. Multiplies the polynomial by an
| |
| mult | back to summary |
|---|---|
| public IntegerPolynomial mult(IntegerPolynomial poly2, int modulus) Implements org. Doc from org. Multiplies the polynomial by an
| |
| mult | back to summary |
|---|---|
| public BigIntPolynomial mult(BigIntPolynomial poly2) Implements org. Doc from org. Multiplies the polynomial by a
| |
| size | back to summary |
|---|---|
| public int size() Implements org. Doc from org. Returns the maximum number of coefficients the polynomial can have | |
| toBinary | back to summary |
|---|---|
| public byte[] toBinary() Encodes the polynomial to a byte array writing
| |
| toIntegerPolynomial | back to summary |
|---|---|
| public IntegerPolynomial toIntegerPolynomial() Implements org. Doc from org. Returns a polynomial that is equal to this polynomial (in the sense that
| |