GenericGFPoly constructor

GenericGFPoly(
  1. GenericGF _field,
  2. List<int> coefficients
)

@param field the GenericGF instance representing the field to use to perform computations @param coefficients coefficients as ints representing elements of GF(size), arranged from most significant (highest-power term) coefficient to least significant @throws IllegalArgumentException if argument is null or empty, or if leading coefficient is 0 and this is not a constant polynomial (that is, it is not the monomial "0")

Implementation

GenericGFPoly(this._field, List<int> coefficients) {
  if (coefficients.isEmpty) {
    throw ArgumentError();
  }
  _coefficients = coefficients.skipWhile((value) => value == 0).toList();
  if (_coefficients.isEmpty) {
    _coefficients = List.filled(1, 0);
  }
}