util

Exceptions

PiecewiseValidationError

An exception raised when validation of piecewise linear functions fail.

Functions

characterize_function(breakpoints, values)

Characterizes a piecewise linear function described by a list of breakpoints and function values.

generate_delaunay(variables[, num])

Generate a Delaunay triangulation of the D-dimensional bounded variable domain given a list of D variables.

generate_gray_code(nbits)

Generates a Gray code of nbits as list of lists

is_constant(vals)

Checks if a list of points is constant

is_nondecreasing(vals)

Checks if a list of points is nondecreasing

is_nonincreasing(vals)

Checks if a list of points is nonincreasing

is_positive_power_of_two(x)

Checks if a number is a nonzero and positive power of 2

log2floor(n)

Computes the exact value of floor(log2(n)) without using floating point calculations.