def get_all_delaunay_2d(vertices, N_s, k, w, r): tangents = find_tangents(vertices, k) curve = find_curve(vertices, tangents, k, w) edges, v_s, sparse = delaunay_complex_2d(vertices, N_s) t_s = tangents[sparse] c_s = curve[sparse] return v_s, t_s, c_s, edges
def get_all_witness_4d(vertices, N_s, k, w, r): tangents = find_tangents(vertices, k) curve = find_curve(vertices, tangents, k, w) edges, v_s, sparse = witness_complex_4d(vertices, tangents, w=w, N_s=N_s) t_s = tangents[sparse] c_s = curve[sparse] return v_s, t_s, c_s, edges
def get_all_rips_2d(vertices, N_s, k, w, r): tangents = find_tangents(vertices, k) curve = find_curve(vertices, tangents, k, w) sparse = sparse_sample(vertices, N_s) v_s = vertices[sparse, :] t_s = tangents[sparse] c_s = curve[sparse] edges = rips_complex_2d(v_s, r=r) return v_s, t_s, c_s, edges
def test_curve_for_point(): N = 500 k = 20 w = 1 vertices = get_image('U', 0, size=200, sample_size=N)[0] plt.scatter(vertices[:,0], vertices[:,1], marker = '.', c='gray') tangents = tg.find_tangents(vertices, k) point = vertices[78,:] plt.scatter(point[0], point[1], marker = '+', c = 'red') std_plot(plt) plt.show()