Sweep distance
The sweep distance (continuous dynamic time warping) of two curves is the smallest integral of the leash length over a morphing between them.
FrechetDist.SweepDist_compute — Function
SweepDist_compute( P, Q )A morphing between P and Q minimizing the approximate sweep price (the sum of fp_match_price over matched edges), computed by a Dijkstra search over the vertex-edge events. The minimum price is returned in m.sol_value; m.leash is the longest leash of that morphing. The morphing need not be monotone.
FrechetDist.SweepDist_compute_refine_mono — Function
SweepDist_compute_refine_mono( P, Q )A monotone morphing for the sweep distance. Runs SweepDist_compute; while the result is not monotone, and monotonizing it would move the curves by 1% or more of their total length, refines both curves along the morphing and runs it again. Returns the monotone (or monotonized) morphing, whose curves can be refinements of P and Q. Throws an error after MAX_REFINEMENT_ROUNDS rounds.
FrechetDist.SweepDist_compute_split! — Function
SweepDist_compute_split!( out, P, Q, iters, max_vertices = 1000000 )Appends to out sweep-distance morphings at increasing resolution: first SweepDist_compute_refine_mono(P, Q), then SweepDist_compute on its curves with the midpoint of every edge inserted (split_edges), repeated iters times or until the two curves have more than max_vertices vertices together. Every morphing is checked with Morphing_verify_valid. Returns nothing.
FrechetDist.Morphing_SweepDist_price — Function
Morphing_SweepDist_price( m )The sweep price of the morphing m: the sum, over its steps, of the sweep distance between the two matched segments (SweepDist_segs). Throws an ArgumentError if m is not valid (Morphing_verify_valid).
FrechetDist.Morphing_SweepDist_approx_price — Function
Morphing_SweepDist_approx_price( m )A fast estimate of Morphing_SweepDist_price(m): for every step of the morphing, the two segment lengths times the average of the leash lengths at the step's ends (fp_match_price), summed.