WIP: Triangulation
This is an attempt to replace qhul as the triangulation generator. Optimistically it should let us avoid rebuilding an expensive Delaunay triangulation every time we add a point, and even implement an anisotropic mesh.
Right now there isn't much in the MR:
Triangulation
-
Initialize with a single triangle -
Update a triangulation by adding a point to an existing triangle or an edge -
Flip an edge -
Implement triangulation health checks to detect whether it is consistent -
Add a point outside of the triangulation (requires updating the hull and computing which new triangles are to be added) -
Rename triangles → simplices, edges → faces.
Replacing QHull (using the triangulation object inside the learner)
-
Cache the triangle or edge where the learner requested the point so that we can cheaply add points. -
Compute gradient on each triangle -
Compute deviation from a linear estimate by comparing a triangle with its neighbors -
Keep track of the interpolated point values by maintaining both a triangulation with all points, and a triangulation with only points where we already know the values. The former should be used for interpolating the function values, the latter to compute losses per triangle. -
Compute triangles badness and when adding data flip all edges neighboring the updated point. Because we use triangulation to compute interpolated values, adding points to the latter should not result in any edges being flipped, only adding data should rearrange the triangles.
Implementing anisotropic mesh
-
Define gradient-aware triangle badness, use that one to determine which edges need to be flipped.
Edited by Anton Akhmerov