copyInto method

Polynomial<T> copyInto(
  1. Polynomial<T> target
)

Returns the target polynomial with all elements of this polynomial copied into it.

Implementation

Polynomial<T> copyInto(Polynomial<T> target) {
  if (this != target) {
    for (var i = math.max(degree, target.degree); i >= 0; i--) {
      target.setUnchecked(i, getUnchecked(i));
    }
  }
  return target;
}