<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://robowiki.net/w/index.php?action=history&amp;feed=atom&amp;title=User%3ADuyn%2FBucketKdTree</id>
	<title>User:Duyn/BucketKdTree - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://robowiki.net/w/index.php?action=history&amp;feed=atom&amp;title=User%3ADuyn%2FBucketKdTree"/>
	<link rel="alternate" type="text/html" href="http://robowiki.net/w/index.php?title=User:Duyn/BucketKdTree&amp;action=history"/>
	<updated>2026-05-03T00:46:53Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.1</generator>
	<entry>
		<id>http://robowiki.net/w/index.php?title=User:Duyn/BucketKdTree&amp;diff=15298&amp;oldid=prev</id>
		<title>Duyn: Pointer to uploaded JAR instead.</title>
		<link rel="alternate" type="text/html" href="http://robowiki.net/w/index.php?title=User:Duyn/BucketKdTree&amp;diff=15298&amp;oldid=prev"/>
		<updated>2010-03-13T12:23:13Z</updated>

		<summary type="html">&lt;p&gt;Pointer to uploaded JAR instead.&lt;/p&gt;
&lt;a href=&quot;http://robowiki.net/w/index.php?title=User:Duyn/BucketKdTree&amp;amp;diff=15298&amp;amp;oldid=15034&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>Duyn</name></author>
		
	</entry>
	<entry>
		<id>http://robowiki.net/w/index.php?title=User:Duyn/BucketKdTree&amp;diff=15034&amp;oldid=prev</id>
		<title>Duyn: Updated to latest version</title>
		<link rel="alternate" type="text/html" href="http://robowiki.net/w/index.php?title=User:Duyn/BucketKdTree&amp;diff=15034&amp;oldid=prev"/>
		<updated>2010-02-28T18:33:25Z</updated>

		<summary type="html">&lt;p&gt;Updated to latest version&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 18:33, 28 February 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l5&quot; &gt;Line 5:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 5:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;import java.util.Arrays;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;/**&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;/**&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  * A sample point in multi-dimensional space. Needed because each sample&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  * A sample point in multi-dimensional space. Needed because each sample&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l12&quot; &gt;Line 12:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 13:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  * you want to store something more than just data points.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  * you want to store something more than just data points.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  *&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  *&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  * @author &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;duyn&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  * @author &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;dnn&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  */&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  */&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;public class Exemplar {&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;public class Exemplar {&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   public final double[] domain;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   public final double[] domain;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   public Exemplar(&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;final &lt;/del&gt;double[] &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;coords&lt;/del&gt;) {&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   public Exemplar(double[] &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;domain&lt;/ins&gt;) {&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     this.domain = &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;coords&lt;/del&gt;;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     this.domain = &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;domain&lt;/ins&gt;;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   }&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   }&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l74&quot; &gt;Line 74:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 75:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  *     http://www.autonlab.org/autonweb/14665&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  *     http://www.autonlab.org/autonweb/14665&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  *  &lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  *  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  * @author &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;duyn&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  * @author &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;dnn&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  */&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  */&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;public class BucketKdTree&amp;lt;T extends Exemplar&amp;gt; {&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;public class BucketKdTree&amp;lt;T extends Exemplar&amp;gt; {&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l93&quot; &gt;Line 93:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 94:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   private double split;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   private double split;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   private &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;final &lt;/del&gt;int dimensions;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   private int dimensions &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;= 0&lt;/ins&gt;;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   // Optimisation for searches. This lets us skip a node if its&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   // Optimisation for searches. This lets us skip a node if its&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l101&quot; &gt;Line 101:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 102:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   private double[] minBounds;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   private double[] minBounds;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   public BucketKdTree(int bucketSize&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;, int dimensions&lt;/del&gt;) {&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   public BucketKdTree(int bucketSize) {&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     this.bucketSize = bucketSize;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     this.bucketSize = bucketSize;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;    this.dimensions = dimensions;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   }&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   }&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l171&quot; &gt;Line 171:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 171:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;       } else {&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;       } else {&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         // Leaf&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         // Leaf&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;        // Infer dimensions if we haven't already&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;        if (cursor.dimensions == 0)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;          cursor.dimensions = ex.domain.length;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;        // Add exemplar to leaf&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         cursor.exemplars.add(ex);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         cursor.exemplars.add(ex);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;        // Calculate running mean and sum of squared deviations&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         final int nExs = cursor.exemplars.size();&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         final int nExs = cursor.exemplars.size();&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;        final int dims = cursor.dimensions;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         if (nExs == 1) {&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         if (nExs == 1) {&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;           cursor.exMean =&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;           cursor.exMean = Arrays.copyOf(ex.domain, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;dims&lt;/ins&gt;);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;            &lt;/del&gt;Arrays.copyOf(ex.domain, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;cursor.dimensions&lt;/del&gt;);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;           cursor.exSumSqDev = new double[&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;dims&lt;/ins&gt;];&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;           cursor.exSumSqDev = new double[&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;cursor.dimensions&lt;/del&gt;];&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         } else {&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         } else {&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;           for(int d = 0; d &amp;lt; &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;cursor.dimensions&lt;/del&gt;; d++) {&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;           for(int d = 0; d &amp;lt; &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;dims&lt;/ins&gt;; d++) {&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;             final double coord = ex.domain[d];&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;             final double coord = ex.domain[d];&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;             final double &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;oldMean &lt;/ins&gt;= cursor.exMean[d]&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;, newMean&lt;/ins&gt;;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;             final double &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;oldExMean &lt;/del&gt;= cursor.exMean[d];&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;             cursor.exMean[d] &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;= newMean &lt;/ins&gt;=&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;             &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;final double newMean = &lt;/del&gt;cursor.exMean[d] =&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;               &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;oldMean &lt;/ins&gt;+ (coord - &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;oldMean&lt;/ins&gt;)/nExs;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;               &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;oldExMean &lt;/del&gt;+ (coord - &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;oldExMean&lt;/del&gt;)/nExs;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;             cursor.exSumSqDev[d] &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;= &lt;/ins&gt;cursor.exSumSqDev[d]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;               + (coord - &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;oldMean&lt;/ins&gt;)*(coord - newMean);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;             &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;final double oldSumSqDev = &lt;/del&gt;cursor.exSumSqDev[d]&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;            &lt;/del&gt;cursor.exSumSqDev[d] &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;= oldSumSqDev&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;               + (coord - &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;oldExMean&lt;/del&gt;)*(coord - newMean);&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;           }&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;           }&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         }&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         }&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;        // Check that exemplars are still uniform&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         if (cursor.exemplarsAreUniform) {&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         if (cursor.exemplarsAreUniform) {&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;           final List&amp;lt;T&amp;gt; cExs = cursor.exemplars;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;           final List&amp;lt;T&amp;gt; cExs = cursor.exemplars;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l195&quot; &gt;Line 195:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 202:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;             cursor.exemplarsAreUniform = false;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;             cursor.exemplarsAreUniform = false;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         }&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         }&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;        // Finished walking&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         return cursor;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         return cursor;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;       }&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;       }&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l203&quot; &gt;Line 203:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 212:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   private static &amp;lt;T extends Exemplar&amp;gt; void&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   private static &amp;lt;T extends Exemplar&amp;gt; void&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   updateBounds(BucketKdTree&amp;lt;T&amp;gt; tree, Exemplar ex) {&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   updateBounds(BucketKdTree&amp;lt;T&amp;gt; tree, Exemplar ex) {&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     final int dims = &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;tree&lt;/del&gt;.&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;dimensions&lt;/del&gt;;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     final int dims = &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;ex&lt;/ins&gt;.&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;domain.length&lt;/ins&gt;;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     if (tree.maxBounds == null) {&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     if (tree.maxBounds == null) {&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;       tree.maxBounds = Arrays.copyOf(ex.domain, dims);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;       tree.maxBounds = Arrays.copyOf(ex.domain, dims);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l290&quot; &gt;Line 290:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 299:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     // We have found a valid split. Start building our sub-trees&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     // We have found a valid split. Start building our sub-trees&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     final BucketKdTree&amp;lt;T&amp;gt; left =&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     final BucketKdTree&amp;lt;T&amp;gt; left =&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;       new BucketKdTree&amp;lt;T&amp;gt;(tree.bucketSize&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;, tree.dimensions&lt;/del&gt;);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;       new BucketKdTree&amp;lt;T&amp;gt;(tree.bucketSize);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     final BucketKdTree&amp;lt;T&amp;gt; right =&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     final BucketKdTree&amp;lt;T&amp;gt; right =&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;       new BucketKdTree&amp;lt;T&amp;gt;(tree.bucketSize&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;, tree.dimensions&lt;/del&gt;);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;       new BucketKdTree&amp;lt;T&amp;gt;(tree.bucketSize);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     left.addAll(leftExs);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     left.addAll(leftExs);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     right.addAll(rightExs);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     right.addAll(rightExs);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wikidb:diff::1.12:old-15009:rev-15034 --&gt;
&lt;/table&gt;</summary>
		<author><name>Duyn</name></author>
		
	</entry>
	<entry>
		<id>http://robowiki.net/w/index.php?title=User:Duyn/BucketKdTree&amp;diff=15009&amp;oldid=prev</id>
		<title>Duyn: /* BucketKdTree.java */ Removed spurious dividein finding dimension with largest variance</title>
		<link rel="alternate" type="text/html" href="http://robowiki.net/w/index.php?title=User:Duyn/BucketKdTree&amp;diff=15009&amp;oldid=prev"/>
		<updated>2010-02-27T05:02:49Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;BucketKdTree.java: &lt;/span&gt; Removed spurious dividein finding dimension with largest variance&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 05:02, 27 February 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l233&quot; &gt;Line 233:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 233:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     int splitDim = 0;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     int splitDim = 0;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     for(int d = 0; d &amp;lt; tree.dimensions; d++) {&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     for(int d = 0; d &amp;lt; tree.dimensions; d++) {&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;       final double var =&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;      // Don't need to divide by number of exemplars to find largest&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;        &lt;/del&gt;tree.exSumSqDev[d]&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;/(tree.exemplars.size() - 1)&lt;/del&gt;;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;      // variance&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;       final double var = tree.exSumSqDev[d];&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;       if (var &amp;gt; largestVar) {&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;       if (var &amp;gt; largestVar) {&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         largestVar = var;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         largestVar = var;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wikidb:diff::1.12:old-15007:rev-15009 --&gt;
&lt;/table&gt;</summary>
		<author><name>Duyn</name></author>
		
	</entry>
	<entry>
		<id>http://robowiki.net/w/index.php?title=User:Duyn/BucketKdTree&amp;diff=15007&amp;oldid=prev</id>
		<title>Duyn: Source code for upcoming tutorial. Large enough to warrant own page.</title>
		<link rel="alternate" type="text/html" href="http://robowiki.net/w/index.php?title=User:Duyn/BucketKdTree&amp;diff=15007&amp;oldid=prev"/>
		<updated>2010-02-27T04:12:34Z</updated>

		<summary type="html">&lt;p&gt;Source code for upcoming tutorial. Large enough to warrant own page.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Below is the full source code to a tree that will form the basis for a future kd tree tutorial I'm working on. This code is released under the [[RWPCL]]. It is decently optimised&amp;amp;mdash;theoretically, anyway. I don't specialise in writing fast code, but the algorithms used are designed to ensure whole trees are ruled out as early as possible.&lt;br /&gt;
&lt;br /&gt;
===Exemplar.java===&lt;br /&gt;
Base class for items to be added into the tree. Sub-classes can carry useful data like guess factors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/**&lt;br /&gt;
 * A sample point in multi-dimensional space. Needed because each sample&lt;br /&gt;
 * may contain an arbitrary payload.&lt;br /&gt;
 *&lt;br /&gt;
 * Note: this class does not make allowance for a payload. Sub-class if&lt;br /&gt;
 * you want to store something more than just data points.&lt;br /&gt;
 *&lt;br /&gt;
 * @author duyn&lt;br /&gt;
 */&lt;br /&gt;
public class Exemplar {&lt;br /&gt;
  public final double[] domain;&lt;br /&gt;
&lt;br /&gt;
  public Exemplar(final double[] coords) {&lt;br /&gt;
    this.domain = coords;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  public boolean domainEquals(final Exemplar other) {&lt;br /&gt;
    return Arrays.equals(domain, other.domain);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  @Override public String&lt;br /&gt;
  toString() {&lt;br /&gt;
    return Arrays.toString(domain);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===BucketKdTree.java===&lt;br /&gt;
Tree with k-nearest neighbour search. Does not support deletion or rebalancing&amp;amp;mdash;a re-build is required if you want to do either.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import java.util.*;&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * A k-dimensional binary partitioning tree which splits space on the&lt;br /&gt;
 * mean of the dimension with the largest variance. Points are held in&lt;br /&gt;
 * buckets so we can pick a better split point than whatever comes first.&lt;br /&gt;
 *&lt;br /&gt;
 * Does not store tree depth. If you want balance, re-build the tree&lt;br /&gt;
 * periodically.&lt;br /&gt;
 *&lt;br /&gt;
 * Optimisations in this tree assume distance metric is euclidian distance.&lt;br /&gt;
 * May work if retrofitted with other metrics, but that is purely&lt;br /&gt;
 * accidental.&lt;br /&gt;
 *&lt;br /&gt;
 * Note: results can become unpredictable if values are different but so&lt;br /&gt;
 * close together that rounding errors in computing their mean result in&lt;br /&gt;
 * all exemplars being on one side of the mean. Performance degrades when&lt;br /&gt;
 * this occurs. Nearest neighbour search tested to work up to range&lt;br /&gt;
 * [1, 1 + 5e-16).&lt;br /&gt;
 *&lt;br /&gt;
 * Ideas for path ordering and bounds come from:&lt;br /&gt;
 *   NEAL SAMPLE, MATTHEW HAINES, MARK ARNOLD, TIMOTHY PURCELL,&lt;br /&gt;
 *     'Optimizing Search Strategies in k-d Trees'&lt;br /&gt;
 *     http://ilpubs.stanford.edu:8090/723/&lt;br /&gt;
 *&lt;br /&gt;
 * Computation of variance from:&lt;br /&gt;
 *   John Cook, 'Accurately computing running variance'&lt;br /&gt;
 *     http://www.johndcook.com/standard_deviation.html&lt;br /&gt;
 *&lt;br /&gt;
 * Terminology note: points are called Exemplars. They must all be&lt;br /&gt;
 * descended from Exemplar class. Position in k-d space is stored in each&lt;br /&gt;
 * exemplar's domain member. This is to avoid conflicting with already&lt;br /&gt;
 * existing classes referring to geometric points.&lt;br /&gt;
 *&lt;br /&gt;
 * Terminology comes from:&lt;br /&gt;
 *   Andrew Moore, 'An intoductory tutorial on kd'&lt;br /&gt;
 *     http://www.autonlab.org/autonweb/14665&lt;br /&gt;
 * &lt;br /&gt;
 * @author duyn&lt;br /&gt;
 */&lt;br /&gt;
public class BucketKdTree&amp;lt;T extends Exemplar&amp;gt; {&lt;br /&gt;
&lt;br /&gt;
  // Only leaf nodes contain points&lt;br /&gt;
  private List&amp;lt;T&amp;gt; exemplars = new LinkedList&amp;lt;T&amp;gt;();&lt;br /&gt;
  // These aren't initialised until add() is called.&lt;br /&gt;
  private double[] exMean;&lt;br /&gt;
  private double[] exSumSqDev;&lt;br /&gt;
&lt;br /&gt;
  // Optimisation when tree contains large number of duplicates&lt;br /&gt;
  private boolean exemplarsAreUniform = true;&lt;br /&gt;
&lt;br /&gt;
  private int bucketSize;&lt;br /&gt;
  private BucketKdTree&amp;lt;T&amp;gt; left, right;&lt;br /&gt;
&lt;br /&gt;
  private int splitDim;&lt;br /&gt;
  private double split;&lt;br /&gt;
&lt;br /&gt;
  private final int dimensions;&lt;br /&gt;
&lt;br /&gt;
  // Optimisation for searches. This lets us skip a node if its&lt;br /&gt;
  // scope intersects with a search hypersphere but it doesn't contain&lt;br /&gt;
  // any points that actually intersect.&lt;br /&gt;
  private double[] maxBounds;&lt;br /&gt;
  private double[] minBounds;&lt;br /&gt;
&lt;br /&gt;
  public BucketKdTree(int bucketSize, int dimensions) {&lt;br /&gt;
    this.bucketSize = bucketSize;&lt;br /&gt;
    this.dimensions = dimensions;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  //&lt;br /&gt;
  // PUBLIC METHODS&lt;br /&gt;
  //&lt;br /&gt;
&lt;br /&gt;
  public void&lt;br /&gt;
  add(T ex) {&lt;br /&gt;
    BucketKdTree&amp;lt;T&amp;gt; tree = addNoSplit(this, ex);&lt;br /&gt;
    if (shouldSplit(tree)) {&lt;br /&gt;
      split(tree);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  public void&lt;br /&gt;
  addAll(Collection&amp;lt;T&amp;gt; exs) {&lt;br /&gt;
    // Some spurious function calls. Optimised for readability over&lt;br /&gt;
    // efficiency.&lt;br /&gt;
    final Set&amp;lt;BucketKdTree&amp;lt;T&amp;gt;&amp;gt; modTrees =&lt;br /&gt;
      new HashSet&amp;lt;BucketKdTree&amp;lt;T&amp;gt;&amp;gt;();&lt;br /&gt;
    for(T ex : exs) {&lt;br /&gt;
      modTrees.add(addNoSplit(this, ex));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    for(BucketKdTree&amp;lt;T&amp;gt; tree : modTrees) {&lt;br /&gt;
      if (shouldSplit(tree)) {&lt;br /&gt;
        split(tree);&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  public SortedMap&amp;lt;Double, List&amp;lt;T&amp;gt;&amp;gt;&lt;br /&gt;
  search(double[] query, int nMinResults) {&lt;br /&gt;
    // Forward to a static method to avoid accidental reference to&lt;br /&gt;
    // instance variables while descending the tree&lt;br /&gt;
    return search(this, query, nMinResults);&lt;br /&gt;
  }&lt;br /&gt;
  &lt;br /&gt;
  @Override public String&lt;br /&gt;
  toString() {&lt;br /&gt;
    return toString(&amp;quot;&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  //&lt;br /&gt;
  // IMPLEMENTATION DETAILS&lt;br /&gt;
  //&lt;br /&gt;
&lt;br /&gt;
  private boolean&lt;br /&gt;
  isTree() { return left != null; }&lt;br /&gt;
&lt;br /&gt;
  // Addition&lt;br /&gt;
&lt;br /&gt;
  // Adds an exemplar without splitting overflowing leaves.&lt;br /&gt;
  // Returns leaf to which exemplar was added.&lt;br /&gt;
  private static &amp;lt;T extends Exemplar&amp;gt; BucketKdTree&amp;lt;T&amp;gt;&lt;br /&gt;
  addNoSplit(BucketKdTree&amp;lt;T&amp;gt; tree, T ex) {&lt;br /&gt;
    // Some spurious function calls. Optimised for readability over&lt;br /&gt;
    // efficiency.&lt;br /&gt;
    BucketKdTree&amp;lt;T&amp;gt; cursor = tree;&lt;br /&gt;
    while (cursor != null) {&lt;br /&gt;
      updateBounds(cursor, ex);&lt;br /&gt;
      if (cursor.isTree()) {&lt;br /&gt;
        // Sub-tree&lt;br /&gt;
        cursor = ex.domain[cursor.splitDim] &amp;lt;= cursor.split&lt;br /&gt;
          ? cursor.left : cursor.right;&lt;br /&gt;
      } else {&lt;br /&gt;
        // Leaf&lt;br /&gt;
        cursor.exemplars.add(ex);&lt;br /&gt;
        final int nExs = cursor.exemplars.size();&lt;br /&gt;
        if (nExs == 1) {&lt;br /&gt;
          cursor.exMean =&lt;br /&gt;
            Arrays.copyOf(ex.domain, cursor.dimensions);&lt;br /&gt;
          cursor.exSumSqDev = new double[cursor.dimensions];&lt;br /&gt;
        } else {&lt;br /&gt;
          for(int d = 0; d &amp;lt; cursor.dimensions; d++) {&lt;br /&gt;
            final double coord = ex.domain[d];&lt;br /&gt;
&lt;br /&gt;
            final double oldExMean = cursor.exMean[d];&lt;br /&gt;
            final double newMean = cursor.exMean[d] =&lt;br /&gt;
              oldExMean + (coord - oldExMean)/nExs;&lt;br /&gt;
&lt;br /&gt;
            final double oldSumSqDev = cursor.exSumSqDev[d];&lt;br /&gt;
            cursor.exSumSqDev[d] = oldSumSqDev&lt;br /&gt;
              + (coord - oldExMean)*(coord - newMean);&lt;br /&gt;
          }&lt;br /&gt;
        }&lt;br /&gt;
        if (cursor.exemplarsAreUniform) {&lt;br /&gt;
          final List&amp;lt;T&amp;gt; cExs = cursor.exemplars;&lt;br /&gt;
          if (cExs.size() &amp;gt; 0 &amp;amp;&amp;amp; !ex.domainEquals(cExs.get(0)))&lt;br /&gt;
            cursor.exemplarsAreUniform = false;&lt;br /&gt;
        }&lt;br /&gt;
        return cursor;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    throw new RuntimeException(&amp;quot;Walked tree without adding anything&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  private static &amp;lt;T extends Exemplar&amp;gt; void&lt;br /&gt;
  updateBounds(BucketKdTree&amp;lt;T&amp;gt; tree, Exemplar ex) {&lt;br /&gt;
    final int dims = tree.dimensions;&lt;br /&gt;
    if (tree.maxBounds == null) {&lt;br /&gt;
      tree.maxBounds = Arrays.copyOf(ex.domain, dims);&lt;br /&gt;
      tree.minBounds = Arrays.copyOf(ex.domain, dims);&lt;br /&gt;
    } else {&lt;br /&gt;
      for(int d = 0; d &amp;lt; dims; d++) {&lt;br /&gt;
        final double dimVal = ex.domain[d];&lt;br /&gt;
        if (dimVal &amp;gt; tree.maxBounds[d])&lt;br /&gt;
          tree.maxBounds[d] = dimVal;&lt;br /&gt;
        else if (dimVal &amp;lt; tree.minBounds[d])&lt;br /&gt;
          tree.minBounds[d] = dimVal;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  // Splitting (internal operation)&lt;br /&gt;
&lt;br /&gt;
  private static &amp;lt;T extends Exemplar&amp;gt; boolean&lt;br /&gt;
  shouldSplit(BucketKdTree&amp;lt;T&amp;gt; tree) {&lt;br /&gt;
    return tree.exemplars.size() &amp;gt; tree.bucketSize&lt;br /&gt;
      &amp;amp;&amp;amp; !tree.exemplarsAreUniform;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  @SuppressWarnings(&amp;quot;unchecked&amp;quot;) private static &amp;lt;T extends Exemplar&amp;gt; void&lt;br /&gt;
  split(BucketKdTree&amp;lt;T&amp;gt; tree) {&lt;br /&gt;
    assert !tree.exemplarsAreUniform;&lt;br /&gt;
    // Find dimension with largest variance to split on&lt;br /&gt;
    double largestVar = -1;&lt;br /&gt;
    int splitDim = 0;&lt;br /&gt;
    for(int d = 0; d &amp;lt; tree.dimensions; d++) {&lt;br /&gt;
      final double var =&lt;br /&gt;
        tree.exSumSqDev[d]/(tree.exemplars.size() - 1);&lt;br /&gt;
      if (var &amp;gt; largestVar) {&lt;br /&gt;
        largestVar = var;&lt;br /&gt;
        splitDim = d;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Find mean as position for our split&lt;br /&gt;
    double splitValue = tree.exMean[splitDim];&lt;br /&gt;
&lt;br /&gt;
    // Check that our split actually splits our data. This also lets&lt;br /&gt;
    // us bulk load exemplars into sub-trees, which is more likely&lt;br /&gt;
    // to keep optimal balance.&lt;br /&gt;
    final List&amp;lt;T&amp;gt; leftExs = new LinkedList&amp;lt;T&amp;gt;();&lt;br /&gt;
    final List&amp;lt;T&amp;gt; rightExs = new LinkedList&amp;lt;T&amp;gt;();&lt;br /&gt;
    for(T s : tree.exemplars) {&lt;br /&gt;
      if (s.domain[splitDim] &amp;lt;= splitValue)&lt;br /&gt;
        leftExs.add(s);&lt;br /&gt;
      else&lt;br /&gt;
        rightExs.add(s);&lt;br /&gt;
    }&lt;br /&gt;
    int leftSize = leftExs.size();&lt;br /&gt;
    final int treeSize = tree.exemplars.size();&lt;br /&gt;
    if (leftSize == treeSize || leftSize == 0) {&lt;br /&gt;
      System.err.println(&lt;br /&gt;
        &amp;quot;WARNING: Randomly splitting non-uniform tree&amp;quot;);&lt;br /&gt;
      // We know the exemplars aren't all the same, so try picking&lt;br /&gt;
      // an exemplar and a dimension at random for our split point&lt;br /&gt;
&lt;br /&gt;
      // This might take several tries, so we copy our exemplars to&lt;br /&gt;
      // an array to speed up process of picking a random point&lt;br /&gt;
      Object[] exs = tree.exemplars.toArray();&lt;br /&gt;
      while (leftSize == treeSize || leftSize == 0) {&lt;br /&gt;
        leftExs.clear();&lt;br /&gt;
        rightExs.clear();&lt;br /&gt;
&lt;br /&gt;
        splitDim = (int)&lt;br /&gt;
          Math.floor(Math.random()*tree.dimensions);&lt;br /&gt;
        final int splitPtIdx = (int)&lt;br /&gt;
          Math.floor(Math.random()*exs.length);&lt;br /&gt;
        // Cast is inevitable consequence of java's inability to&lt;br /&gt;
        // create a generic array&lt;br /&gt;
        splitValue = ((T)exs[splitPtIdx]).domain[splitDim];&lt;br /&gt;
        for(T s : tree.exemplars) {&lt;br /&gt;
          if (s.domain[splitDim] &amp;lt;= splitValue)&lt;br /&gt;
            leftExs.add(s);&lt;br /&gt;
          else&lt;br /&gt;
            rightExs.add(s);&lt;br /&gt;
        }&lt;br /&gt;
        leftSize = leftExs.size();&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // We have found a valid split. Start building our sub-trees&lt;br /&gt;
    final BucketKdTree&amp;lt;T&amp;gt; left =&lt;br /&gt;
      new BucketKdTree&amp;lt;T&amp;gt;(tree.bucketSize, tree.dimensions);&lt;br /&gt;
    final BucketKdTree&amp;lt;T&amp;gt; right =&lt;br /&gt;
      new BucketKdTree&amp;lt;T&amp;gt;(tree.bucketSize, tree.dimensions);&lt;br /&gt;
    left.addAll(leftExs);&lt;br /&gt;
    right.addAll(rightExs);&lt;br /&gt;
&lt;br /&gt;
    // Finally, commit the split&lt;br /&gt;
    tree.splitDim = splitDim;&lt;br /&gt;
    tree.split = splitValue;&lt;br /&gt;
    tree.left = left;&lt;br /&gt;
    tree.right = right;&lt;br /&gt;
&lt;br /&gt;
    // Let go of exemplars (and their running stats) held in this leaf&lt;br /&gt;
    tree.exemplars = null;&lt;br /&gt;
    tree.exMean = tree.exSumSqDev = null;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  // Searching&lt;br /&gt;
&lt;br /&gt;
  // May return more results than requested if multiple exemplars have&lt;br /&gt;
  // same distance from target.&lt;br /&gt;
  //&lt;br /&gt;
  // Note: this function works with squared distances to avoid sqrt()&lt;br /&gt;
  // operations&lt;br /&gt;
  private static &amp;lt;T extends Exemplar&amp;gt; SortedMap&amp;lt;Double, List&amp;lt;T&amp;gt;&amp;gt;&lt;br /&gt;
  search(BucketKdTree&amp;lt;T&amp;gt; tree, double[] query, int nMinResults) {&lt;br /&gt;
    // distance =&amp;gt; list of points that distance away from query&lt;br /&gt;
    final NavigableMap&amp;lt;Double, List&amp;lt;T&amp;gt;&amp;gt; results =&lt;br /&gt;
      new TreeMap&amp;lt;Double, List&amp;lt;T&amp;gt;&amp;gt;();&lt;br /&gt;
&lt;br /&gt;
    final SearchState state = new SearchState();&lt;br /&gt;
    final Deque&amp;lt;SearchStackEntry&amp;lt;T&amp;gt;&amp;gt; stack =&lt;br /&gt;
      new LinkedList&amp;lt;SearchStackEntry&amp;lt;T&amp;gt;&amp;gt;();&lt;br /&gt;
    stack.addFirst(new SearchStackEntry&amp;lt;T&amp;gt;(state.maxDistance, tree));&lt;br /&gt;
    while (!stack.isEmpty()) {&lt;br /&gt;
      final SearchStackEntry&amp;lt;T&amp;gt; entry = stack.removeFirst();&lt;br /&gt;
      final BucketKdTree&amp;lt;T&amp;gt; cur = entry.tree;&lt;br /&gt;
&lt;br /&gt;
      if (cur.isTree()) {&lt;br /&gt;
        searchTree(query, nMinResults, cur, state, stack);&lt;br /&gt;
      } else if (entry.minDFromQ &amp;lt;= state.maxDistance&lt;br /&gt;
        || state.nResults &amp;lt; nMinResults)&lt;br /&gt;
      {&lt;br /&gt;
        searchLeaf(query, nMinResults, cur, state, results);&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    return results;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  private static &amp;lt;T extends Exemplar&amp;gt; void&lt;br /&gt;
  searchTree(double[] query, int nMinResults, BucketKdTree&amp;lt;T&amp;gt; tree,&lt;br /&gt;
    SearchState searchState, Deque&amp;lt;SearchStackEntry&amp;lt;T&amp;gt;&amp;gt; stack)&lt;br /&gt;
  {&lt;br /&gt;
    // Left is presumed near. This is verified further down.&lt;br /&gt;
    BucketKdTree&amp;lt;T&amp;gt; nearTree = tree.left, farTree = tree.right;&lt;br /&gt;
    // These variables let us skip empty sub-trees&lt;br /&gt;
    boolean nearEmpty = nearTree.minBounds == null;&lt;br /&gt;
    boolean farEmpty = farTree.minBounds == null;&lt;br /&gt;
&lt;br /&gt;
    // Find distance from nearest possible point in each&lt;br /&gt;
    // sub-tree to query. If that is greater than max distance,&lt;br /&gt;
    // we can rule out that sub-tree.&lt;br /&gt;
    double nearD = nearEmpty ? Double.POSITIVE_INFINITY&lt;br /&gt;
      : minDistanceSqFrom(query,&lt;br /&gt;
        nearTree.minBounds, nearTree.maxBounds);&lt;br /&gt;
    double farD = farEmpty ? Double.POSITIVE_INFINITY&lt;br /&gt;
      : minDistanceSqFrom(query,&lt;br /&gt;
        farTree.minBounds, farTree.maxBounds);&lt;br /&gt;
&lt;br /&gt;
    // Swap near and far if they're incorrect&lt;br /&gt;
    if (farD &amp;lt; nearD) {&lt;br /&gt;
      final double tmpD = nearD;&lt;br /&gt;
      final BucketKdTree&amp;lt;T&amp;gt; tmpTree = nearTree;&lt;br /&gt;
      final boolean tmpEmpty = nearEmpty;&lt;br /&gt;
&lt;br /&gt;
      nearD = farD;&lt;br /&gt;
      nearTree = farTree;&lt;br /&gt;
      nearEmpty = farEmpty;&lt;br /&gt;
&lt;br /&gt;
      farD = tmpD;&lt;br /&gt;
      farTree = tmpTree;&lt;br /&gt;
      farEmpty = tmpEmpty;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Add nearest sub-tree to stack later so we descend it&lt;br /&gt;
    // first. This is likely to constrict our max distance&lt;br /&gt;
    // sooner, resulting in less visited nodes&lt;br /&gt;
    if (!farEmpty &amp;amp;&amp;amp; (farD &amp;lt;= searchState.maxDistance&lt;br /&gt;
                      || searchState.nResults &amp;lt; nMinResults))&lt;br /&gt;
    {&lt;br /&gt;
      stack.addFirst(new SearchStackEntry&amp;lt;T&amp;gt;(farD, farTree));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if (!nearEmpty &amp;amp;&amp;amp; (nearD &amp;lt;= searchState.maxDistance&lt;br /&gt;
                       || searchState.nResults &amp;lt; nMinResults))&lt;br /&gt;
    {&lt;br /&gt;
      stack.addFirst(new SearchStackEntry&amp;lt;T&amp;gt;(nearD, nearTree));&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  private static &amp;lt;T extends Exemplar&amp;gt; void&lt;br /&gt;
  searchLeaf(double[] query, int nMinResults,&lt;br /&gt;
    BucketKdTree&amp;lt;T&amp;gt; leaf, SearchState searchState,&lt;br /&gt;
    NavigableMap&amp;lt;Double, List&amp;lt;T&amp;gt;&amp;gt; results)&lt;br /&gt;
  {&lt;br /&gt;
    // Keep track of elements at max distance so we know&lt;br /&gt;
    // whether we can just drop entire list of furthest&lt;br /&gt;
    // exemplars&lt;br /&gt;
    final int nMinResultsBeforeAddition = nMinResults - 1;&lt;br /&gt;
    for(T ex : leaf.exemplars) {&lt;br /&gt;
      final double exD = distanceSqFrom(query, ex.domain);&lt;br /&gt;
      if (searchState.nResults &amp;lt; nMinResults&lt;br /&gt;
        || exD == searchState.maxDistance)&lt;br /&gt;
      {&lt;br /&gt;
        // Blindly add this exemplar&lt;br /&gt;
        List&amp;lt;T&amp;gt; exsAtD = getOrElseInit(results, exD);&lt;br /&gt;
        if (leaf.exemplarsAreUniform) {&lt;br /&gt;
          // No need to go through every one if all&lt;br /&gt;
          // exemplars are the same&lt;br /&gt;
          exsAtD.addAll(leaf.exemplars);&lt;br /&gt;
          searchState.nResults += leaf.exemplars.size();&lt;br /&gt;
        } else {&lt;br /&gt;
          exsAtD.add(ex);&lt;br /&gt;
          searchState.nResults++;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        // Update information about furthest exemplars&lt;br /&gt;
        if (exD &amp;gt; searchState.maxDistance&lt;br /&gt;
          || searchState.maxDistance == Double.POSITIVE_INFINITY)&lt;br /&gt;
        {&lt;br /&gt;
          searchState.maxDistance = exD;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        if (searchState.maxDistance == exD)&lt;br /&gt;
          searchState.nExsAtMaxD = exsAtD.size();&lt;br /&gt;
&lt;br /&gt;
      } else if (exD &amp;lt; searchState.maxDistance) {&lt;br /&gt;
        // Point closer than furthest neighbour&lt;br /&gt;
&lt;br /&gt;
        if (searchState.nResults - searchState.nExsAtMaxD&lt;br /&gt;
          &amp;gt;= nMinResultsBeforeAddition)&lt;br /&gt;
        {&lt;br /&gt;
          // Dropping furthest exemplars won't leave&lt;br /&gt;
          // us with too little to meet return&lt;br /&gt;
          // minimum&lt;br /&gt;
          results.remove(searchState.maxDistance);&lt;br /&gt;
          searchState.nResults -= searchState.nExsAtMaxD;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        // Add new exemplar&lt;br /&gt;
        List&amp;lt;T&amp;gt; exsAtD = getOrElseInit(results, exD);&lt;br /&gt;
        if (leaf.exemplarsAreUniform) {&lt;br /&gt;
          // No need to go through every one if all&lt;br /&gt;
          // exemplars are the same&lt;br /&gt;
          exsAtD.addAll(leaf.exemplars);&lt;br /&gt;
          searchState.nResults += leaf.exemplars.size();&lt;br /&gt;
        } else {&lt;br /&gt;
          exsAtD.add(ex);&lt;br /&gt;
          searchState.nResults++;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        // Update information about furthest exemplars&lt;br /&gt;
        Map.Entry&amp;lt;Double, List&amp;lt;T&amp;gt;&amp;gt; lastEnt = results.lastEntry();&lt;br /&gt;
        searchState.maxDistance = lastEnt.getKey();&lt;br /&gt;
        searchState.nExsAtMaxD = lastEnt.getValue().size();&lt;br /&gt;
      } // exD &amp;lt; maxDistance&lt;br /&gt;
&lt;br /&gt;
      // No need to keep going if all exemplars are&lt;br /&gt;
      // the same&lt;br /&gt;
      if (leaf.exemplarsAreUniform) break;&lt;br /&gt;
    } // for(T ex : cur.exemplars)&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  private static &amp;lt;T extends Exemplar&amp;gt; List&amp;lt;T&amp;gt;&lt;br /&gt;
  getOrElseInit(Map&amp;lt;Double, List&amp;lt;T&amp;gt;&amp;gt; results, double dst) {&lt;br /&gt;
    List&amp;lt;T&amp;gt; lst = results.get(dst);&lt;br /&gt;
    if (lst == null) {&lt;br /&gt;
      lst = new LinkedList&amp;lt;T&amp;gt;();&lt;br /&gt;
      results.put(dst, lst);&lt;br /&gt;
    }&lt;br /&gt;
    return lst;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  // Dumping to string (debug)&lt;br /&gt;
&lt;br /&gt;
  private String&lt;br /&gt;
  toString(String indent) {&lt;br /&gt;
    if (isTree()){&lt;br /&gt;
      return String.format(&amp;quot;%s{|%d|%f|\n%s\n%s} &amp;quot;, indent,&lt;br /&gt;
        splitDim, split, left.toString(indent + &amp;quot;\t&amp;quot;),&lt;br /&gt;
        right.toString(indent + &amp;quot;\t&amp;quot;));&lt;br /&gt;
    } else {&lt;br /&gt;
      return String.format(&amp;quot;%sL%s&amp;quot;, indent,&lt;br /&gt;
        Arrays.toString(exemplars.toArray()));&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  // Distance calculations&lt;br /&gt;
&lt;br /&gt;
  // Gets distance from target of nearest point on hyper-rect defined&lt;br /&gt;
  // by supplied min and max bounds&lt;br /&gt;
  private static double&lt;br /&gt;
  minDistanceSqFrom(double[] target, double[] min, double[] max) {&lt;br /&gt;
    // Note: profiling shows this is called lots of times, so it pays&lt;br /&gt;
    // to be well optimised&lt;br /&gt;
    double distanceSq = 0;&lt;br /&gt;
    for(int d = 0; d &amp;lt; target.length; d++) {&lt;br /&gt;
      final double coord = target[d];&lt;br /&gt;
      double nearCoord;&lt;br /&gt;
      if (((nearCoord = min[d]) &amp;gt; coord)&lt;br /&gt;
        || ((nearCoord = max[d]) &amp;lt; coord))&lt;br /&gt;
      {&lt;br /&gt;
        final double dst = nearCoord - coord;&lt;br /&gt;
        distanceSq += dst*dst;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    return distanceSq;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  // Accessible to testing&lt;br /&gt;
  static double&lt;br /&gt;
  distanceSqFrom(double[] p1, double[] p2) {&lt;br /&gt;
    // Note: profiling shows this is called lots of times, so it pays&lt;br /&gt;
    // to be well optimised&lt;br /&gt;
    double dSq = 0;&lt;br /&gt;
    for(int d = 0; d &amp;lt; p1.length; d++) {&lt;br /&gt;
      final double dst = p1[d] - p2[d];&lt;br /&gt;
      if (dst != 0)&lt;br /&gt;
        dSq += dst*dst;&lt;br /&gt;
    }&lt;br /&gt;
    return dSq;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  //&lt;br /&gt;
  // class SearchStackEntry&lt;br /&gt;
  //&lt;br /&gt;
  // Stores a precomputed distance so we don't have to do it again&lt;br /&gt;
  // when we pop the tree off the search stack.&lt;br /&gt;
&lt;br /&gt;
  private static class SearchStackEntry&amp;lt;T extends Exemplar&amp;gt; {&lt;br /&gt;
    public final double minDFromQ;&lt;br /&gt;
    public final BucketKdTree&amp;lt;T&amp;gt; tree;&lt;br /&gt;
&lt;br /&gt;
    public SearchStackEntry(double minDFromQ, BucketKdTree&amp;lt;T&amp;gt; tree) {&lt;br /&gt;
      this.minDFromQ = minDFromQ;&lt;br /&gt;
      this.tree = tree;&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  //&lt;br /&gt;
  // class SearchState&lt;br /&gt;
  //&lt;br /&gt;
  // Holds data about current state of the search. Used for live updating&lt;br /&gt;
  // of pruning distance.&lt;br /&gt;
&lt;br /&gt;
  private static class SearchState {&lt;br /&gt;
    int nResults = 0;&lt;br /&gt;
    double maxDistance = Double.POSITIVE_INFINITY;&lt;br /&gt;
    int nExsAtMaxD = 0;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Duyn</name></author>
		
	</entry>
</feed>