def create_house(): V = np.array([[0, 0], [0, 1], [1, 2], [2, 1], [2, 0]]) cmplx = SimplicialComplex() vertices = [cmplx.create_vertex(x) for x in V] for i in range(len(V) - 1): cmplx.create_simplex([i, i+1]) m_gt = BayesMesh1D(cmplx=cmplx) return m_gt
def check_project(): # Sanity check for projections m = create_house() obs = m.sample_obs V = np.array([[0, 0], [0, 1]]) cmplx = SimplicialComplex() vertices = [cmplx.create_vertex(x) for x in V] for i in range(len(V) - 1): cmplx.create_simplex([i, i+1]) obs_pts = np.array([[1, x] for x in np.linspace(-.3, 1.3)]) # set_trace() # print cmplx.proj([1, -.3]) m_gt = BayesMesh1D(obs_pts=obs_pts, cmplx=cmplx) m_gt.draw(block=True)