/** * Compute <tt>this + addend</tt> (overwrite <tt>this</tt>). * * @param addend the addend */ public void addToThis(GFElement addend) throws RuntimeException { if (!(addend instanceof GF2nONBElement)) { throw new RuntimeException(); } if (!mField.equals(((GF2nONBElement)addend).mField)) { throw new RuntimeException(); } for (int i = 0; i < mLength; i++) { mPol[i] ^= ((GF2nONBElement)addend).mPol[i]; } }
/** * Compute <tt>this + addend</tt> (overwrite <tt>this</tt>). * * @param addend the addend * @throws DifferentFieldsException if the elements are of different fields. */ public void addToThis(GFElement addend) throws RuntimeException { if (!(addend instanceof GF2nONBElement)) { throw new RuntimeException(); } if (!mField.equals(((GF2nONBElement)addend).mField)) { throw new RuntimeException(); } for (int i = 0; i < mLength; i++) { mPol[i] ^= ((GF2nONBElement)addend).mPol[i]; } }
/** * Compute <tt>this + addend</tt> (overwrite <tt>this</tt>). * * @param addend the addend */ public void addToThis(GFElement addend) throws RuntimeException { if (!(addend instanceof GF2nPolynomialElement)) { throw new RuntimeException(); } if (!mField.equals(((GF2nPolynomialElement)addend).mField)) { throw new RuntimeException(); } polynomial.addToThis(((GF2nPolynomialElement)addend).polynomial); }
/** * Compute <tt>this + addend</tt> (overwrite <tt>this</tt>). * * @param addend the addend * @throws DifferentFieldsException if the elements are of different fields. */ public void addToThis(GFElement addend) throws RuntimeException { if (!(addend instanceof GF2nPolynomialElement)) { throw new RuntimeException(); } if (!mField.equals(((GF2nPolynomialElement)addend).mField)) { throw new RuntimeException(); } polynomial.addToThis(((GF2nPolynomialElement)addend).polynomial); }
/** * Compute <tt>this * factor</tt> (overwrite <tt>this</tt>). * * @param factor the factor */ public void multiplyThisBy(GFElement factor) throws RuntimeException { if (!(factor instanceof GF2nPolynomialElement)) { throw new RuntimeException(); } if (!mField.equals(((GF2nPolynomialElement)factor).mField)) { throw new RuntimeException(); } if (equals(factor)) { squareThis(); return; } polynomial = polynomial .multiply(((GF2nPolynomialElement)factor).polynomial); reduceThis(); }
/** * Compute <tt>this * factor</tt> (overwrite <tt>this</tt>). * * @param factor the factor * @throws DifferentFieldsException if the elements are of different fields. */ public void multiplyThisBy(GFElement factor) throws RuntimeException { if (!(factor instanceof GF2nPolynomialElement)) { throw new RuntimeException(); } if (!mField.equals(((GF2nPolynomialElement)factor).mField)) { throw new RuntimeException(); } if (equals(factor)) { squareThis(); return; } polynomial = polynomial .multiply(((GF2nPolynomialElement)factor).polynomial); reduceThis(); }
+ " representation: not yet" + " implemented"); if (!mField.equals(((GF2nONBElement)factor).mField))
+ " representation: not yet" + " implemented"); if (!mField.equals(((GF2nONBElement)factor).mField))