/** * Create a polynomial over the finite field GF(2^m) out of the given * coefficient vector. The finite field is also obtained from the * {@link GF2mVector}. * * @param vect the coefficient vector */ public PolynomialGF2mSmallM(GF2mVector vect) { this(vect.getField(), vect.getIntArrayForm()); }
/** * Multiply this vector with a permutation. * * @param p the permutation * @return <tt>this*p = p*this</tt> */ public Vector multiply(Permutation p) { int[] pVec = p.getVector(); if (length != pVec.length) { throw new ArithmeticException( "permutation size and vector size mismatch"); } int[] result = new int[length]; for (int i = 0; i < pVec.length; i++) { result[i] = vector[pVec[i]]; } return new GF2mVector(field, result); }
/** * Multiply this vector with a permutation. * * @param p the permutation * @return <tt>this*p = p*this</tt> */ public Vector multiply(Permutation p) { int[] pVec = p.getVector(); if (length != pVec.length) { throw new ArithmeticException( "permutation size and vector size mismatch"); } int[] result = new int[length]; for (int i = 0; i < pVec.length; i++) { result[i] = vector[pVec[i]]; } return new GF2mVector(field, result); }
/** * Create a polynomial over the finite field GF(2^m) out of the given * coefficient vector. The finite field is also obtained from the * {@link GF2mVector}. * * @param vect the coefficient vector */ public PolynomialGF2mSmallM(GF2mVector vect) { this(vect.getField(), vect.getIntArrayForm()); }
return new GF2mVector(field, result);
return new GF2mVector(field, result);