Polynomial<T> class abstract mixin

Abstract polynomial type.

Available Extensions

Constructors

Polynomial(DataType<T> dataType, {int desiredDegree = -1, PolynomialFormat? format})
Constructs a default vector of the desired dataType, and possibly a custom format.
factory
Polynomial.fromCoefficients(DataType<T> dataType, List<T> source, {PolynomialFormat? format})
Constructs a polynomial from a list of coefficients.
factory
Polynomial.fromList(DataType<T> dataType, List<T> source, {PolynomialFormat? format})
Constructs a polynomial from a list of values.
factory
Polynomial.fromRoots(DataType<T> dataType, List<T> roots, {PolynomialFormat? format})
Builds a polynomial from a list of roots.
factory
Polynomial.generate(DataType<T> dataType, int degree, PolynomialGeneratorCallback<T> callback, {PolynomialFormat? format})
Generates a polynomial from calling a callback on every value. If format is specified the resulting polynomial is mutable, otherwise this is a read-only view.
factory
Polynomial.lagrange(DataType<T> dataType, {required Vector<T> xs, required Vector<T> ys, PolynomialFormat? format})
Builds a Lagrange Polynomial through the unique sample points xs and ys. Related to lagrangeInterpolation.
factory

Properties

dataType DataType<T>
Returns the data type of this polynomial.
no setter
degree int
Returns the degree this polynomial, that is the highest coefficient.
no setter
hashCode int
The hash code for this object.
no setterinherited
iterable List<T>
Returns a list iterable over the polynomial.
no setter
lead → T
Returns the leading term of this polynomial.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shape List<int>
Returns the shape of this polynomial.
no setter
storage Set<Storage>
Returns the underlying storage containers of this object.
no setterinherited

Methods

call(T value) → T
Evaluates the polynomial at value.
copyInto(Polynomial<T> target) Polynomial<T>
Returns the target polynomial with all elements of this polynomial copied into it.
forEach(void callback(int exponent, T value)) → void
Iterates over each element of the polynomial from the largest exponent down to the smallest exponent. This way of iteration is more efficient on sparse data structure and skips over neutral elements.
format({bool limit = true, int leadingItems = 3, int trailingItems = 3, Printer<String>? ellipsesPrinter, Printer<String>? paddingPrinter, Printer<T>? valuePrinter, String addition = ' + ', String ellipses = '\u2026', String multiplication = '', String power = '^', String variable = 'x', bool skipNulls = true, bool skipValues = true}) String
Returns a human readable representation of the polynomial.
getUnchecked(int exponent) → T
Returns the coefficient at the provided exponent. The behavior is undefined if exponent is outside of bounds.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setUnchecked(int exponent, T value) → void
Sets the coefficient at the provided exponent to value. The behavior is undefined if exponent is outside of bounds.
toPolynomial({PolynomialFormat? format}) Polynomial<T>
Creates a new Polynomial containing the same elements as this one.
toString() String
Returns the string representation of this polynomial.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited
operator [](int exponent) → T
Returns the coefficient at the provided exponent.
operator []=(int exponent, T value) → void
Sets the coefficient at the provided exponent to value.