4
$\begingroup$

Bug introduced in 10.0.2 and fixed in 10.2


See if anyone else can reproduce this error:

 list = Join[{{0, 0}}, RandomReal[250 {-1, 1}, {3, 2}]]
 Nearest[list, RandomReal[250 {-1, 1}, 2], {1, 30}]

causes a consistent kernel crash. v10.1/windows.

making list all numeric makes it work fine:

 Nearest[N@list, RandomReal[250 {-1, 1}, 2], {1, 30}]

(Its the combination of the mixed type with that list-type third argument that seems to be the trouble )

$\endgroup$
  • $\begingroup$ Can not confirm. v10.0.1.0/Win7(64bit) $\endgroup$ – paw Nov 3 '15 at 21:58
  • $\begingroup$ No problems in 10.3. $\endgroup$ – David G. Stork Nov 3 '15 at 22:26
  • $\begingroup$ Confirm with 10.1 on Mac $\endgroup$ – Mike Honeychurch Nov 3 '15 at 23:15
4
$\begingroup$

Yes, the crash is a bug and has been fixed as of version 10.2. But I would recommend upgrading to 10.3 to avoid running into this Nearest problem.

Possible workarounds for 10.0.2 or 10.1 include applying N as shown in the question, or specifying DistanceFunction -> (Norm[#1 - #2] &).

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.