numeric library

Numeric algorithms and solutions.

Classes

CurveFit
Curve fitting is the process of constructing a curve, or mathematical function, that has the best fit to a series of data points, possibly subject to constraints.
CurveFitResult
Generic result of a curve fitting.
LevenbergMarquardt
The Levenberg–Marquardt algorithm, also known as the damped least-squares method, is used to solve non-linear least squares problems.
LevenbergMarquardtResult
ParametrizedUnaryFunction<T>
Abstract factory of parametrized unary functions of type UnaryFunction<T>.
PolynomialRegression
Polynomial least-squares regression, in which the relationship between the independent elements xs and the dependent elements ys is modelled as a polynomial of a given degree.
PolynomialRegressionResult

Enums

IntegrateWarning
Integration warnings that can be triggered for badly behaving functions or ill defined parameters.

Functions

derivative(UnaryFunction<double> function, double x, {int derivative = 1, int accuracy = 2, double epsilon = 1e-5}) double
Returns the numerical derivative of the provided function function at x.
fft(List<Complex> values, {bool inverse = false}) List<Complex>
Performs an in-place Discrete Fast Fourier transformation on the provided values. If necessary, extends the size the provided list to a power of two. Returns the modified collection of transformed values.
geometricSpaced(double start, double stop, {int count = 10, bool includeEndpoint = true, DataType<double>? dataType, VectorFormat? format}) Vector<double>
Generates a Vector with a sequence of count evenly spaced values on a log scale (a geometric progression) on the interval between start and stop.
integrate(UnaryFunction<double> function, double a, double b, {int depth = 6, double epsilon = 1e-6, Iterable<double> poles = const [], void onWarning(IntegrateWarning type, double x)?}) double
Returns the numerical integration of the provided function from a to b, that is the result of int(f(x), dx=a..b).
lagrangeInterpolation<T>(DataType<T> dataType, {required Vector<T> xs, required Vector<T> ys}) UnaryFunction<T>
A function providing a Lagrange polynomial interpolation through the unique sample points xs and ys. Related to Polynomial.lagrange.
linearInterpolation<T>(DataType<T> dataType, {required Vector<T> xs, required Vector<T> ys, T? left, T? right}) UnaryFunction<T>
A function providing linear interpolation of a discrete monotonically increasing set of sample points xs and ys. Returns left or right, if the point is outside the data range, by default extrapolate linearly.
linearSpaced(double start, double stop, {int count = 10, bool includeEndpoint = true, DataType<double>? dataType, VectorFormat? format}) Vector<double>
Generates a Vector with a sequence of count evenly spaced values over an interval between start and stop.
logarithmicSpaced(double start, double stop, {int count = 10, double base = 10.0, bool includeEndpoint = true, DataType<double>? dataType, VectorFormat? format}) Vector<double>
Generates a Vector with a sequence of count evenly spaced values on a log scale (a geometric progression) on the interval between base ^ start and base ^ stop.
nearestInterpolation({required Vector<double> xs, required Vector<double> ys, bool preferLower = true}) UnaryFunction<double>
A function providing the nearest value of a discrete monotonically increasing set of sample points xs and ys.
nextInterpolation({required Vector<double> xs, required Vector<double> ys, double right = double.nan}) UnaryFunction<double>
A function providing the next value of a discrete monotonically increasing set of sample points xs and ys. Returns right if there is no next sample point.
previousInterpolation({required Vector<double> xs, required Vector<double> ys, double left = double.nan}) UnaryFunction<double>
A function providing the previous value of a discrete monotonically increasing set of sample points xs and ys. Returns left if there is no previous sample point.
solve(UnaryFunction<double> function, double a, double b, {double bracketEpsilon = 1e-10, double solutionEpsilon = 1e-50, int maxIterations = 50}) double
Returns the root of the provided function bracketed between a and b, that is f(x) = 0 is solved for x in the range of a, b.

Typedefs

UnaryFunction<T> = T Function(T x)
A function with a single argument and an identical return type. Typically used for numerical functions like f(x) where xT and f(x)T.

Exceptions / Errors

IntegrateError
Integration error that is thrown when warnings are not handled explicitly.