multiply method

UGfPoly multiply(
  1. UGfPoly other
)

Implementation

UGfPoly multiply(UGfPoly other) {
  if (isZero || other.isZero) return UGfPoly(field, Int32List.fromList(<int>[0]));
  final Int32List a = _coefficients;
  final Int32List b = other._coefficients;
  final Int32List product = Int32List(a.length + b.length - 1);
  for (int i = 0; i < a.length; i++) {
    final int scale = a[i];
    for (int j = 0; j < b.length; j++) {
      product[i + j] = UGaloisField.addOrSubtract(product[i + j], field.multiply(scale, b[j]));
    }
  }
  return UGfPoly(field, product);
}