NearestFunction

NearestFunction[data]

represents a function whose values give the elements closest to an element that is supplied.

Details

Examples

open allclose all

Basic Examples  (1)

Generate a NearestFunction:

Apply to a single element:

Apply to several elements using Map:

Apply to several elements directly:

Scope  (3)

Give the 3 nearest elements:

Give the elements within radius 2:

Give the at most 3 nearest elements within radius 2:

When NearestFunction is directly applied to multiple points, results are computed in parallel threads if possible:

When the NearestFunction is applied to the points separately, results are computed serially:

Introduced in 2007
 (6.0)