multiplyPoly static method

Int32List multiplyPoly(
  1. Int32List a,
  2. Int32List b
)

Implementation

static Int32List multiplyPoly(Int32List a, Int32List b) {
  if (isZero(a) || isZero(b)) return Int32List.fromList(<int>[0]);
  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] = add(product[i + j], multiply(scale, b[j]));
    }
  }
  return trim(product);
}