size method

  1. @override
int size()
override

Compute the size of the expression based on the number of nodes in its tree.

Implementation

@override
int size() {
  // The size can be the number of non-zero coefficients.
  return coefficients.where((coeff) => coeff != Complex.zero()).length;
}