public class DenseTernaryPolynomial extends IntegerPolynomial implements TernaryPolynomial
TernaryPolynomial
with a "high" number of nonzero coefficients.coeffs
Constructor and Description |
---|
DenseTernaryPolynomial(int[] coeffs)
Constructs a new
DenseTernaryPolynomial with a given set of coefficients. |
DenseTernaryPolynomial(IntegerPolynomial intPoly)
Constructs a
DenseTernaryPolynomial from a IntegerPolynomial . |
Modifier and Type | Method and Description |
---|---|
static DenseTernaryPolynomial |
generateRandom(int N,
int numOnes,
int numNegOnes,
java.security.SecureRandom random)
Generates a random polynomial with
numOnes coefficients equal to 1,
numNegOnes coefficients equal to -1, and the rest equal to 0. |
static DenseTernaryPolynomial |
generateRandom(int N,
java.security.SecureRandom random)
Generates a polynomial with coefficients randomly selected from
{-1, 0, 1} . |
int[] |
getNegOnes() |
int[] |
getOnes() |
IntegerPolynomial |
mult(IntegerPolynomial poly2,
int modulus)
Multiplies the polynomial with another, taking the values mod modulus and the indices mod N
|
int |
size()
Returns the maximum number of coefficients the polynomial can have
|
add, add, center0, centeredNormSq, clear, clone, count, div, ensurePositive, equals, equalsOne, fromBinary, fromBinary, fromBinary3Sves, fromBinary3Tight, fromBinary3Tight, invertF3, invertFq, mod, mod3, modPositive, mult, mult, mult, mult3, resultant, resultant, resultantMultiThread, rotate1, sub, sub, sumCoeffs, toBinary, toBinary3Sves, toBinary3Tight, toIntegerPolynomial
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clear, mult
mult, toIntegerPolynomial
public DenseTernaryPolynomial(IntegerPolynomial intPoly)
DenseTernaryPolynomial
from a IntegerPolynomial
. The two polynomials are
independent of each other.intPoly
- the original polynomialpublic DenseTernaryPolynomial(int[] coeffs)
DenseTernaryPolynomial
with a given set of coefficients.coeffs
- the coefficientspublic static DenseTernaryPolynomial generateRandom(int N, int numOnes, int numNegOnes, java.security.SecureRandom random)
numOnes
coefficients equal to 1,
numNegOnes
coefficients equal to -1, and the rest equal to 0.N
- number of coefficientsnumOnes
- number of 1'snumNegOnes
- number of -1'spublic static DenseTernaryPolynomial generateRandom(int N, java.security.SecureRandom random)
{-1, 0, 1}
.N
- number of coefficientspublic IntegerPolynomial mult(IntegerPolynomial poly2, int modulus)
IntegerPolynomial
mult
in interface Polynomial
mult
in class IntegerPolynomial
poly2
- a polynomialmodulus
- a modulus to applypublic int[] getOnes()
getOnes
in interface TernaryPolynomial
public int[] getNegOnes()
getNegOnes
in interface TernaryPolynomial
public int size()
TernaryPolynomial
size
in interface TernaryPolynomial