/** * 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); }
return new GF2mVector(field, result);
return new GF2mVector(field, result);