robustfpm.cxhull.util module

robustfpm.cxhull.util.generate_vertices_rectangle(size, dim, center=0, random_state=None)
robustfpm.cxhull.util.distance(p1, p2, p=2)
robustfpm.cxhull.util.nearest(p, S)
robustfpm.cxhull.util.farthest(p, S)
robustfpm.cxhull.util.pop_random(element_list, random_state=None)
robustfpm.cxhull.util.get_max_coordinates(x, f, z, method='interior-point', tol=1e-08, debug_mode=False, ignore_warnings=False)

Solves the problem

\[p_1 \cdot f_1 + ... + p_m \cdot f_m \rightarrow \max,\]
\[p_1 \cdot x_1 + ... p_m \cdot x_m = z,\]
\[p_1 + ... + p_m = 1,\]
\[p_1, ... p_m \geqslant 0\]

w.r.t. m-dimensional vector p and returns the optimal p. Equivalently, finds the barycentric coordinates of the points of the facet, which belongs to the concave hull of the graph of f and contains z when projected.

Parameters
  • x (numpy.ndarray) – Points and function values of the graph.

  • f (numpy.ndarray) – Points and function values of the graph.

  • z (numpy.ndarray.) – Point with the same dimansion as points in x. Must be in the convex hull of x.

Returns

Barycentric coordinates p.

Return type

numpy.ndarray

robustfpm.cxhull.util.in_hull(z, points, tol=1e-08)

Returns True or False depending on whether or not z is within the convex hull of points with the specified tolerance.