Skip to content
Christian d'Heureuse edited this page Sep 25, 2026 · 1 revision

commons-math-interpolation / Utils

Utils

Utility functions and types used by the other modules of this package.

Type Aliases

Type Alias Description
UniFunction A univariate numeric function, i.e. a function that maps a number to a number.

Functions

Function Description
assert Throws an exception if the passed condition is not true.
binarySearch Searches a sorted array for a value, using the binary search algorithm.
checkFinite Checks that all values of a number sequence are finite.
checkMonotonicallyIncreasing Checks that all values of a number sequence are finite and that the sequence is monotonically increasing (non-decreasing). Adjacent values may be equal.
checkStrictlyIncreasing Checks that all values of a number sequence are finite and that the sequence is strictly increasing. Adjacent values must not be equal.
createDomainRestrictedUniFunction Wraps a function in another function that returns NaN when the argument is outside the domain xMin ... xMax.
evaluatePoly Evaluates a polynomial, using Horner's method.
evaluatePolySegment Evaluates a piecewise polynomial function (e.g. a spline) at the specified argument value.
getMedian Returns the median of an array of numbers.
trimPoly Removes the zero-valued coefficients of the highest orders from a polynomial.

Clone this wiki locally