/** * Returns the degree of this PolynomialGF2n. * * @return the degree of this PolynomialGF2n. */ public final int getDegree() { int i; for (i = size - 1; i >= 0; i--) { if (!coeff[i].isZero()) { return i; } } return -1; }
/** * Returns the degree of this PolynomialGF2n. * * @return the degree of this PolynomialGF2n. */ public final int getDegree() { int i; for (i = size - 1; i >= 0; i--) { if (!coeff[i].isZero()) { return i; } } return -1; }
/** * Returns true if all coefficients equal zero. * * @return true if all coefficients equal zero. */ public final boolean isZero() { int i; for (i = 0; i < size; i++) { if (coeff[i] != null) { if (!coeff[i].isZero()) { return false; } } } return true; }
/** * Returns true if all coefficients equal zero. * * @return true if all coefficients equal zero. */ public final boolean isZero() { int i; for (i = 0; i < size; i++) { if (coeff[i] != null) { if (!coeff[i].isZero()) { return false; } } } return true; }
public final void shrink() { int i = size - 1; while (coeff[i].isZero() && (i > 0)) { i--; } i++; if (i < size) { GF2nElement[] res = new GF2nElement[i]; System.arraycopy(coeff, 0, res, 0, i); coeff = res; size = i; } }
public final void shrink() { int i = size - 1; while (coeff[i].isZero() && (i > 0)) { i--; } i++; if (i < size) { GF2nElement[] res = new GF2nElement[i]; System.arraycopy(coeff, 0, res, 0, i); coeff = res; size = i; } }
while (u.isZero());
while (u.isZero());
while (u.isZero());
while (u.isZero());