Module scid.util

Various useful utilities that don't really fit anywhere else.

Functions

NameDescription
chop(x, threshold) Replaces real numbers that are close to zero by exactly zero.
chop(x, threshold, buffer) Replaces all numbers in the given array that are close to zero by exactly zero. To chop the array in-place, pass the same array as both x and buffer.
limitCalls(dg, maxCalls) Limit the number of times a function can be called.
matchDigits(lhs, rhs, significantDigits, maxAbsDiff) Check whether lhs and rhs are equal to within the specified number of significant digits. Both lhs and rhs can be floating-point numbers, complex numbers, or input ranges of floating-point or complex numbers.
scopeLimitCalls(dg, maxCalls) Limit the number of times a function can be called.
staticArray(elements) Create a static array literal without any heap allocation.
staticArrayOf(elements) Create a static array literal without any heap allocation.
steps(a, b, n) Returns a range that iterates over n equally-spaced floating-point numbers in the inclusive interval [a,b].
tailConst(a) Trivially convert const(T[]) to const(T)[].

Structs

NameDescription
LimitCalls