toPolynomial method

Polynomial<T> toPolynomial({
  1. DataType<T>? dataType,
  2. PolynomialFormat? format,
})

Converts this list to a corresponding polynomial.

If format is provided the list data will be copied into a native format, otherwise a view onto the (possibly mutable) underlying list will be returned.

Implementation

Polynomial<T> toPolynomial(
    {DataType<T>? dataType, PolynomialFormat? format}) {
  dataType ??= DataType.fromType<T>();
  return format == null
      ? ExternalPolynomial<T>.fromList(dataType, this)
      : Polynomial.fromList(dataType, this, format: format);
}