multiplyByMonomial method

GenericGFPoly multiplyByMonomial(
  1. int degree,
  2. int coefficient
)

Implementation

GenericGFPoly multiplyByMonomial(int degree, int coefficient) {
  if (degree < 0) {
    throw ArgumentError('IllegalArgument');
  }
  if (coefficient == 0) {
    return _field.zero;
  }
  final size = _coefficients.length;
  final product = Int32List(size + degree);
  for (int i = 0; i < size; i++) {
    product[i] = _field.multiply(_coefficients[i], coefficient);
  }
  return GenericGFPoly(_field, product);
}