scid.util

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

Members

Functions

chop
Real chop(Real x, real threshold)

Replaces real numbers that are close to zero by exactly zero.

chop
Real[] chop(Real[] x, real threshold, Real[] 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
LimitCalls!(R, T) limitCalls(R delegate(T) dg, uint maxCalls)

Limit the number of times a function can be called.

matchDigits
bool matchDigits(L lhs, R rhs, uint significantDigits, real 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
LimitCalls!(R, T) scopeLimitCalls(R delegate(T) dg, uint maxCalls)

Limit the number of times a function can be called.

staticArray
CommonType!(T)[T.length] staticArray(T elements)
staticArrayOf
T[U.length] staticArrayOf(U elements)

Create a static array literal without any heap allocation.

steps
auto steps(T a, U b, int n)

Returns a range that iterates over n equally-spaced floating-point numbers in the inclusive interval [a,b].

tailConst
const(T)[] tailConst(T[] a)

Trivially convert const(T[]) to const(T)[].

Structs

LimitCalls
struct LimitCalls(R, T...)
Undocumented in source.

Meta

Authors

Lars Tandle Kyllingstad

License

Boost License 1.0