Identifies which minimum a gradient descent trajectory converges to
by finding the closest known minimum to the trajectory endpoint. This function
is useful for classifying trajectories in Morse-Smale cell construction.
Usage
destination.minimum.identify(trajectory, minima_coordinates, tolerance = 0.05)
Arguments
- trajectory
Matrix of trajectory points where each row is an (x, y) coordinate
- minima_coordinates
Matrix of known minima locations where each row is an (x, y) coordinate
- tolerance
Maximum distance between trajectory endpoint and minimum to consider a match
Value
Integer index of the destination minimum (row number in minima_coordinates),
or NA if no minimum is within tolerance