verse.utils.utils

Functions

are_polygons_intersecting(a, b, ...)

Checks if the two polygons are intersecting.

class_from_path(path)

confidence_ellipsoid(data[, lambda_, delta, ...])

Compute a confidence ellipsoid over the parameter theta, where y = theta^T phi

confidence_polytope(data, parameter_box)

Compute a confidence polytope over the parameter theta, where y = theta^T phi

constrain(x, a, b)

dedup(l[, f])

distance_to_circle(center, radius, direction)

distance_to_rect(line, rect)

Compute the intersection between a line segment and a rectangle.

do_every(duration, timer)

get_class_path(cls)

has_corner_inside(rect1, rect2)

Check if rect1 has a corner inside rect2

interval_distance(min_a, max_a, min_b, max_b)

Calculate the distance between [minA, maxA] and [minB, maxB] The distance will be negative if the intervals overlap

is_consistent_dataset(data[, parameter_box])

Check whether a dataset {phi_n, y_n} is consistent

is_valid_observation(y, phi, theta, gramian, ...)

Check if a new observation (phi, y) is valid according to a confidence ellipsoid on theta.

lmap(v, x, y)

Linear map of value v with range x to desired range y.

near_split(x[, num_bins, size_bins])

Split a number into several bins with near-even distribution.

not_zero(x[, eps])

point_in_ellipse(point, center, angle, ...)

Check if a point is inside an ellipse

point_in_rectangle(point, rect_min, rect_max)

Check if a point is inside a rectangle

point_in_rotated_rectangle(point, center, ...)

Check if a point is inside a rotated rectangle

project_polygon(polygon, axis)

rect_corners(center, length, width, angle[, ...])

Returns the positions of the corners of a rectangle.

rotated_rectangles_intersect(rect1, rect2)

Do two rotated rectangles intersect?

sample_rect(rect[, seed])

solve_trinom(a, b, c)

to_serializable(arg)

wrap_to_pi(x)