|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--de.flexiprovider.common.math.polynomials.ModQConvolutionPolynomial
This class implements convolution polynomials in the ring (Z/qZ)/(X^N-1) and their arithmetic , where q and N lie in the interval [2, Integer.MAX_VALUE].
| Constructor Summary | |
ModQConvolutionPolynomial(int N,
int q)
Construct the default polynomial (the zero polynomial f(x) = 0). |
|
ModQConvolutionPolynomial(int N,
int q,
int[] coefficients)
Construct a polynomial out of the given coefficient array. |
|
ModQConvolutionPolynomial(int N,
int q,
int degree,
int headCoef)
Construct a polynomial of the given degree. |
|
ModQConvolutionPolynomial(ModQConvolutionPolynomial other)
Copy constructor |
|
ModQConvolutionPolynomial(SparseBinaryConvolutionPolynomial other,
int q,
int p)
Construct a full form polynomial out of the given sparse binary polynomial, setting the non-zero coefficients to an integer p. |
|
| Method Summary | |
ModQConvolutionPolynomial |
add(ModQConvolutionPolynomial addend)
Add the addend to this polynomial. |
void |
addThis(ModQConvolutionPolynomial addend)
Add the addend to this polynomial (overwriting this polynomial). |
byte[] |
BRE2OSP()
Encode a binary ring element as a byte array. |
boolean |
equals(java.lang.Object other)
Compare this polynomial with the given object. |
int |
evaluateAtOne()
Evaluate this polynomial at value 1. |
int |
hashCode()
|
ModQConvolutionPolynomial |
invert()
Compute the inverse of this polynomial in the ring (Z/qZ)[X]/(X^N-1). |
ModQConvolutionPolynomial |
multiply(ConvolutionPolynomial factor)
Adapter method: multiply this polynomial with the factor. |
ModQConvolutionPolynomial |
multiply(ModQConvolutionPolynomial factor)
Multiply this polynomial with the factor. |
ModQConvolutionPolynomial |
multiply(ProductFormConvolutionPolynomial factor)
Multiply this polynomial with the factor and reduce the result modulo X^N-1. |
ModQConvolutionPolynomial |
multiply(SparseBinaryConvolutionPolynomial factor)
Multiply this polynomial with the factor and reduce the result modulo X^N-1. |
ModQConvolutionPolynomial |
multiplyInteger(int a)
Multiply this polynomial with an integer. |
void |
multiplyIntegerThis(int a)
Multiply this polynomial with an integer. |
ModQConvolutionPolynomial |
multiplyPatterns(ProductFormConvolutionPolynomial factor)
Multiply this polynomial with a ProductFormConvolutionPolynomial making use of bit patterns of the three binary polynomials constituting the product form polynomial. |
ModQConvolutionPolynomial |
multiplyPatterns(SparseBinaryConvolutionPolynomial factor)
Multiply this polynomial with a SparseBinaryConvolutionPolynomial making use of bit patterns of the binary polynomial. |
ModQConvolutionPolynomial |
multiplySlidingWindow(BinaryConvolutionPolynomial factor)
Multiply this polynomial with the factor according to Algorithm 3 of M.-K. |
ModQConvolutionPolynomial |
multiplySlidingWindow(SparseBinaryConvolutionPolynomial factor)
Multiply this polynomial with the factor according to Algorithm 3 of M.-K. |
void |
multiplyThis(ModQConvolutionPolynomial factor)
Multiply this polynomial with the factor (overwriting this polynomial). |
static ModQConvolutionPolynomial |
OS2BREP(int N,
int q,
byte[] encoded)
Decode a byte array into a binary polynomial. |
static ModQConvolutionPolynomial |
OS2REP(int N,
int q,
byte[] encoded)
Decode a byte array into a polynomial. |
byte[] |
RE2OSP()
Encode this polynomial as a byte array if it is an element of (Z/qZ)/(X^N-1). |
ModQConvolutionPolynomial |
reduceCoeffModP(int p)
Reduce the coefficients of this polynomial modulo an integer p into the interval [0, p). |
void |
reduceCoeffModPThis(int p)
Reduce the coefficients of this polynomial modulo an integer p into the interval [0, p), overwriting this polynomial. |
void |
shiftCoeffThis(int A)
Shift the coefficients of this polynomial by an integer A. |
ModQConvolutionPolynomial |
subtract(ModQConvolutionPolynomial minuend)
Subtract the minuend from this polynomial. |
void |
subtractThis(ModQConvolutionPolynomial minuend)
Subtract the minuend from this polynomial (overwriting this polynomial). |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|
| Constructor Detail |
public ModQConvolutionPolynomial(int N,
int q)
throws java.lang.IllegalArgumentException
N - the degree of the reduction polynomialq - the modulusjava.lang.IllegalArgumentException - if the parameters are invalid.
public ModQConvolutionPolynomial(int N,
int q,
int degree,
int headCoef)
throws java.lang.IllegalArgumentException
N - the degree of the reduction polynomialq - the modulusdegree - the degreeheadCoef - the head coefficientjava.lang.IllegalArgumentException - if the parameters are invalid.
public ModQConvolutionPolynomial(int N,
int q,
int[] coefficients)
throws java.lang.IllegalArgumentException
N - the degree of the reduction polynomialq - the moduluscoefficients - the coefficient arrayjava.lang.IllegalArgumentException - if the parameters are invalid.
public ModQConvolutionPolynomial(SparseBinaryConvolutionPolynomial other,
int q,
int p)
other - the sparse binary polynomialq - the modulusp - the value of the non-zero coefficientspublic ModQConvolutionPolynomial(ModQConvolutionPolynomial other)
other - another ModQPolynomial| Method Detail |
public ModQConvolutionPolynomial add(ModQConvolutionPolynomial addend)
addend - the addendjava.lang.ArithmeticException - if this polynomial and the factor are not elements of the
same ring.public void addThis(ModQConvolutionPolynomial addend)
addend - the addendjava.lang.ArithmeticException - if this polynomial and the factor are not elements of the
same ring.public ModQConvolutionPolynomial subtract(ModQConvolutionPolynomial minuend)
minuend - the minuendjava.lang.ArithmeticException - if this polynomial and the factor are not elements of the
same ring.public void subtractThis(ModQConvolutionPolynomial minuend)
minuend - the minuendjava.lang.ArithmeticException - if this polynomial and the factor are not elements of the
same ring.public ModQConvolutionPolynomial multiplyInteger(int a)
a - the integerpublic void multiplyIntegerThis(int a)
a - the integer
public ModQConvolutionPolynomial multiply(ConvolutionPolynomial factor)
throws java.lang.ArithmeticException
factor - the factorjava.lang.ArithmeticException - if this polynomial and the factor are not elements of the
same ring or if the type of the factor is unknown.public ModQConvolutionPolynomial multiply(SparseBinaryConvolutionPolynomial factor)
factor - the factorjava.lang.ArithmeticException - if this polynomial and the factor are not elements of the
same ring.public ModQConvolutionPolynomial multiply(ProductFormConvolutionPolynomial factor)
factor - the factorjava.lang.ArithmeticException - if this polynomial and the factor are not elements of the
same ring.
public ModQConvolutionPolynomial multiply(ModQConvolutionPolynomial factor)
throws java.lang.ArithmeticException
factor - the factorjava.lang.ArithmeticException - if this polynomial and the factor are not elements of the
same ring.
public void multiplyThis(ModQConvolutionPolynomial factor)
throws java.lang.ArithmeticException
factor - the factorjava.lang.ArithmeticException - if this polynomial and the factor are not elements of the
same ring.
public ModQConvolutionPolynomial multiplySlidingWindow(BinaryConvolutionPolynomial factor)
throws java.lang.ArithmeticException
factor - the factorjava.lang.ArithmeticException - if this polynomial and the factor are not elements of the
same ring.
public ModQConvolutionPolynomial multiplySlidingWindow(SparseBinaryConvolutionPolynomial factor)
throws java.lang.ArithmeticException
factor - the factorjava.lang.ArithmeticException - if this polynomial and the factor are not elements of the
same ring.
public ModQConvolutionPolynomial multiplyPatterns(SparseBinaryConvolutionPolynomial factor)
throws java.lang.ArithmeticException
factor - the factorjava.lang.ArithmeticException - if this polynomial and the factor are not elements of the
same ring.
public ModQConvolutionPolynomial multiplyPatterns(ProductFormConvolutionPolynomial factor)
throws java.lang.ArithmeticException
factor - the factorjava.lang.ArithmeticException - if this polynomial and the factor are not elements of the
same ring.public ModQConvolutionPolynomial invert()
public ModQConvolutionPolynomial reduceCoeffModP(int p)
p - the moduluspublic void reduceCoeffModPThis(int p)
p - the moduluspublic void shiftCoeffThis(int A)
A - the shiftpublic int evaluateAtOne()
public byte[] RE2OSP()
public static ModQConvolutionPolynomial OS2REP(int N,
int q,
byte[] encoded)
throws java.lang.IllegalArgumentException
N - the degree of the reduction polynomialq - the modulusencoded - the encoded polynomialjava.lang.IllegalArgumentException - if the encoded polynomial has the wrong length.
public byte[] BRE2OSP()
throws java.lang.ArithmeticException
java.lang.ArithmeticException - if this polynomial is not a binary polynomial.
public static ModQConvolutionPolynomial OS2BREP(int N,
int q,
byte[] encoded)
throws java.lang.IllegalArgumentException
N - the degree of the reduction polynomialq - the modulusencoded - the encoded binary polynomialjava.lang.IllegalArgumentException - if the encoded polynomial has the wrong length.public boolean equals(java.lang.Object other)
equals in class java.lang.Objectother - the other objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||