BinaryPolynomial.fromExponents constructor
Creates a binary polynomial with coefficients at exponents set.
Implementation
factory BinaryPolynomial.fromExponents(Iterable<int> exponents) {
var coefficients = BigInt.zero;
for (final exponent in exponents) {
if (exponent < 0) {
throw RohdHclException(
'Binary polynomial exponents must be non-negative.');
}
coefficients |= BigInt.one << exponent;
}
return BinaryPolynomial(coefficients);
}