commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l..@apache.org
Subject svn commit: r857590 [18/48] - in /websites/production/commons/content/proper/commons-math/xref-test: ./ org/apache/commons/math3/ org/apache/commons/math3/analysis/ org/apache/commons/math3/analysis/differentiation/ org/apache/commons/math3/analysis/fu...
Date Sun, 07 Apr 2013 07:52:13 GMT
Added: websites/production/commons/content/proper/commons-math/xref-test/org/apache/commons/math3/ml/clustering/DBSCANClustererTest.html
==============================================================================
--- websites/production/commons/content/proper/commons-math/xref-test/org/apache/commons/math3/ml/clustering/DBSCANClustererTest.html (added)
+++ websites/production/commons/content/proper/commons-math/xref-test/org/apache/commons/math3/ml/clustering/DBSCANClustererTest.html Sun Apr  7 07:52:05 2013
@@ -0,0 +1,204 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
+<title>DBSCANClustererTest xref</title>
+<link type="text/css" rel="stylesheet" href="../../../../../../stylesheet.css" />
+</head>
+<body>
+<div id="overview"><a href="../../../../../../../testapidocs/org/apache/commons/math3/ml/clustering/DBSCANClustererTest.html">View Javadoc</a></div><pre>
+
+<a class="jxr_linenumber" name="1" href="#1">1</a>   <em class="jxr_comment">/*</em>
+<a class="jxr_linenumber" name="2" href="#2">2</a>   <em class="jxr_comment"> * Licensed to the Apache Software Foundation (ASF) under one or more</em>
+<a class="jxr_linenumber" name="3" href="#3">3</a>   <em class="jxr_comment"> * contributor license agreements.  See the NOTICE file distributed with</em>
+<a class="jxr_linenumber" name="4" href="#4">4</a>   <em class="jxr_comment"> * this work for additional information regarding copyright ownership.</em>
+<a class="jxr_linenumber" name="5" href="#5">5</a>   <em class="jxr_comment"> * The ASF licenses this file to You under the Apache License, Version 2.0</em>
+<a class="jxr_linenumber" name="6" href="#6">6</a>   <em class="jxr_comment"> * (the "License"); you may not use this file except in compliance with</em>
+<a class="jxr_linenumber" name="7" href="#7">7</a>   <em class="jxr_comment"> * the License.  You may obtain a copy of the License at</em>
+<a class="jxr_linenumber" name="8" href="#8">8</a>   <em class="jxr_comment"> *</em>
+<a class="jxr_linenumber" name="9" href="#9">9</a>   <em class="jxr_comment"> *      <a href="http://www.apache.org/licenses/LICENSE-2.0" target="alexandria_uri">http://www.apache.org/licenses/LICENSE-2.0</a></em>
+<a class="jxr_linenumber" name="10" href="#10">10</a>  <em class="jxr_comment"> *</em>
+<a class="jxr_linenumber" name="11" href="#11">11</a>  <em class="jxr_comment"> * Unless required by applicable law or agreed to in writing, software</em>
+<a class="jxr_linenumber" name="12" href="#12">12</a>  <em class="jxr_comment"> * distributed under the License is distributed on an "AS IS" BASIS,</em>
+<a class="jxr_linenumber" name="13" href="#13">13</a>  <em class="jxr_comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</em>
+<a class="jxr_linenumber" name="14" href="#14">14</a>  <em class="jxr_comment"> * See the License for the specific language governing permissions and</em>
+<a class="jxr_linenumber" name="15" href="#15">15</a>  <em class="jxr_comment"> * limitations under the License.</em>
+<a class="jxr_linenumber" name="16" href="#16">16</a>  <em class="jxr_comment"> */</em>
+<a class="jxr_linenumber" name="17" href="#17">17</a>  <strong class="jxr_keyword">package</strong> org.apache.commons.math3.ml.clustering;
+<a class="jxr_linenumber" name="18" href="#18">18</a>  
+<a class="jxr_linenumber" name="19" href="#19">19</a>  <strong class="jxr_keyword">import</strong> java.util.Arrays;
+<a class="jxr_linenumber" name="20" href="#20">20</a>  <strong class="jxr_keyword">import</strong> java.util.List;
+<a class="jxr_linenumber" name="21" href="#21">21</a>  
+<a class="jxr_linenumber" name="22" href="#22">22</a>  <strong class="jxr_keyword">import</strong> org.apache.commons.math3.exception.MathIllegalArgumentException;
+<a class="jxr_linenumber" name="23" href="#23">23</a>  <strong class="jxr_keyword">import</strong> org.apache.commons.math3.exception.NullArgumentException;
+<a class="jxr_linenumber" name="24" href="#24">24</a>  <strong class="jxr_keyword">import</strong> org.junit.Assert;
+<a class="jxr_linenumber" name="25" href="#25">25</a>  <strong class="jxr_keyword">import</strong> org.junit.Test;
+<a class="jxr_linenumber" name="26" href="#26">26</a>  
+<a class="jxr_linenumber" name="27" href="#27">27</a>  <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">class</strong> <a href="../../../../../../org/apache/commons/math3/ml/clustering/DBSCANClustererTest.html">DBSCANClustererTest</a> {
+<a class="jxr_linenumber" name="28" href="#28">28</a>  
+<a class="jxr_linenumber" name="29" href="#29">29</a>      @Test
+<a class="jxr_linenumber" name="30" href="#30">30</a>      <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> testCluster() {
+<a class="jxr_linenumber" name="31" href="#31">31</a>          <em class="jxr_comment">// Test data generated using: http://people.cs.nctu.edu.tw/~rsliang/dbscan/testdatagen.html</em>
+<a class="jxr_linenumber" name="32" href="#32">32</a>          <strong class="jxr_keyword">final</strong> DoublePoint[] points = <strong class="jxr_keyword">new</strong> DoublePoint[] {
+<a class="jxr_linenumber" name="33" href="#33">33</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[] { 83.08303244924173, 58.83387754182331 }),
+<a class="jxr_linenumber" name="34" href="#34">34</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[] { 45.05445510940626, 23.469642649637535 }),
+<a class="jxr_linenumber" name="35" href="#35">35</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[] { 14.96417921432294, 69.0264096390456 }),
+<a class="jxr_linenumber" name="36" href="#36">36</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[] { 73.53189604333602, 34.896145021310076 }),
+<a class="jxr_linenumber" name="37" href="#37">37</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[] { 73.28498173551634, 33.96860806993209 }),
+<a class="jxr_linenumber" name="38" href="#38">38</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[] { 73.45828098873608, 33.92584423092194 }),
+<a class="jxr_linenumber" name="39" href="#39">39</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[] { 73.9657889183145, 35.73191006924026 }),
+<a class="jxr_linenumber" name="40" href="#40">40</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[] { 74.0074097183533, 36.81735596177168 }),
+<a class="jxr_linenumber" name="41" href="#41">41</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[] { 73.41247541410848, 34.27314856695011 }),
+<a class="jxr_linenumber" name="42" href="#42">42</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[] { 73.9156256353017, 36.83206791547127 }),
+<a class="jxr_linenumber" name="43" href="#43">43</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[] { 74.81499205809087, 37.15682749846019 }),
+<a class="jxr_linenumber" name="44" href="#44">44</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[] { 74.03144880081527, 37.57399178552441 }),
+<a class="jxr_linenumber" name="45" href="#45">45</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[] { 74.51870941207744, 38.674258946906775 }),
+<a class="jxr_linenumber" name="46" href="#46">46</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[] { 74.50754595105536, 35.58903978415765 }),
+<a class="jxr_linenumber" name="47" href="#47">47</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[] { 74.51322752749547, 36.030572259100154 }),
+<a class="jxr_linenumber" name="48" href="#48">48</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[] { 59.27900996617973, 46.41091720294207 }),
+<a class="jxr_linenumber" name="49" href="#49">49</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[] { 59.73744793841615, 46.20015558367595 }),
+<a class="jxr_linenumber" name="50" href="#50">50</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[] { 58.81134076672606, 45.71150126331486 }),
+<a class="jxr_linenumber" name="51" href="#51">51</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[] { 58.52225539437495, 47.416083617601544 }),
+<a class="jxr_linenumber" name="52" href="#52">52</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[] { 58.218626647023484, 47.36228902172297 }),
+<a class="jxr_linenumber" name="53" href="#53">53</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[] { 60.27139669447206, 46.606106348801404 }),
+<a class="jxr_linenumber" name="54" href="#54">54</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[] { 60.894962462363765, 46.976924697402865 }),
+<a class="jxr_linenumber" name="55" href="#55">55</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[] { 62.29048673878424, 47.66970563563518 }),
+<a class="jxr_linenumber" name="56" href="#56">56</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[] { 61.03857608977705, 46.212924720020965 }),
+<a class="jxr_linenumber" name="57" href="#57">57</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[] { 60.16916214139201, 45.18193661351688 }),
+<a class="jxr_linenumber" name="58" href="#58">58</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[] { 59.90036905976012, 47.555364347063005 }),
+<a class="jxr_linenumber" name="59" href="#59">59</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[] { 62.33003634144552, 47.83941489877179 }),
+<a class="jxr_linenumber" name="60" href="#60">60</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[] { 57.86035536718555, 47.31117930193432 }),
+<a class="jxr_linenumber" name="61" href="#61">61</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[] { 58.13715479685925, 48.985960494028404 }),
+<a class="jxr_linenumber" name="62" href="#62">62</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[] { 56.131923963548616, 46.8508904252667 }),
+<a class="jxr_linenumber" name="63" href="#63">63</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[] { 55.976329887053, 47.46384037658572 }),
+<a class="jxr_linenumber" name="64" href="#64">64</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[] { 56.23245975235477, 47.940035191131756 }),
+<a class="jxr_linenumber" name="65" href="#65">65</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[] { 58.51687048212625, 46.622885352699086 }),
+<a class="jxr_linenumber" name="66" href="#66">66</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[] { 57.85411081905477, 45.95394361577928 }),
+<a class="jxr_linenumber" name="67" href="#67">67</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[] { 56.445776311447844, 45.162093662656844 }),
+<a class="jxr_linenumber" name="68" href="#68">68</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[] { 57.36691949656233, 47.50097194337286 }),
+<a class="jxr_linenumber" name="69" href="#69">69</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[] { 58.243626387557015, 46.114052729681134 }),
+<a class="jxr_linenumber" name="70" href="#70">70</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[] { 56.27224595635198, 44.799080066150054 }),
+<a class="jxr_linenumber" name="71" href="#71">71</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[] { 57.606924816500396, 46.94291057763621 }),
+<a class="jxr_linenumber" name="72" href="#72">72</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[] { 30.18714230041951, 13.877149710431695 }),
+<a class="jxr_linenumber" name="73" href="#73">73</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[] { 30.449448810657486, 13.490778346545994 }),
+<a class="jxr_linenumber" name="74" href="#74">74</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[] { 30.295018390286714, 13.264889000216499 }),
+<a class="jxr_linenumber" name="75" href="#75">75</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[] { 30.160201832884923, 11.89278262341395 }),
+<a class="jxr_linenumber" name="76" href="#76">76</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[] { 31.341509791789576, 15.282655921997502 }),
+<a class="jxr_linenumber" name="77" href="#77">77</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[] { 31.68601630325429, 14.756873246748 }),
+<a class="jxr_linenumber" name="78" href="#78">78</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[] { 29.325963742565364, 12.097849250072613 }),
+<a class="jxr_linenumber" name="79" href="#79">79</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[] { 29.54820742388256, 13.613295356975868 }),
+<a class="jxr_linenumber" name="80" href="#80">80</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[] { 28.79359608888626, 10.36352064087987 }),
+<a class="jxr_linenumber" name="81" href="#81">81</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[] { 31.01284597092308, 12.788479208014905 }),
+<a class="jxr_linenumber" name="82" href="#82">82</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[] { 27.58509216737002, 11.47570110601373 }),
+<a class="jxr_linenumber" name="83" href="#83">83</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[] { 28.593799561727792, 10.780998203903437 }),
+<a class="jxr_linenumber" name="84" href="#84">84</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[] { 31.356105766724795, 15.080316198524088 }),
+<a class="jxr_linenumber" name="85" href="#85">85</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[] { 31.25948503636755, 13.674329151166603 }),
+<a class="jxr_linenumber" name="86" href="#86">86</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[] { 32.31590076372959, 14.95261758659035 }),
+<a class="jxr_linenumber" name="87" href="#87">87</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[] { 30.460413702763617, 15.88402809202671 }),
+<a class="jxr_linenumber" name="88" href="#88">88</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[] { 32.56178203062154, 14.586076852632686 }),
+<a class="jxr_linenumber" name="89" href="#89">89</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[] { 32.76138648530468, 16.239837325178087 }),
+<a class="jxr_linenumber" name="90" href="#90">90</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[] { 30.1829453331884, 14.709592407103628 }),
+<a class="jxr_linenumber" name="91" href="#91">91</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[] { 29.55088173528202, 15.0651247180067 }),
+<a class="jxr_linenumber" name="92" href="#92">92</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[] { 29.004155302187428, 14.089665298582986 }),
+<a class="jxr_linenumber" name="93" href="#93">93</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[] { 29.339624439831823, 13.29096065578051 }),
+<a class="jxr_linenumber" name="94" href="#94">94</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[] { 30.997460327576846, 14.551914158277214 }),
+<a class="jxr_linenumber" name="95" href="#95">95</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">double</strong>[] { 30.66784126125276, 16.269703107886016 })
+<a class="jxr_linenumber" name="96" href="#96">96</a>          };
+<a class="jxr_linenumber" name="97" href="#97">97</a>  
+<a class="jxr_linenumber" name="98" href="#98">98</a>          <strong class="jxr_keyword">final</strong> DBSCANClusterer&lt;DoublePoint&gt; transformer =
+<a class="jxr_linenumber" name="99" href="#99">99</a>                  <strong class="jxr_keyword">new</strong> DBSCANClusterer&lt;DoublePoint&gt;(2.0, 5);
+<a class="jxr_linenumber" name="100" href="#100">100</a>         <strong class="jxr_keyword">final</strong> List&lt;Cluster&lt;DoublePoint&gt;&gt; clusters = transformer.cluster(Arrays.asList(points));
+<a class="jxr_linenumber" name="101" href="#101">101</a> 
+<a class="jxr_linenumber" name="102" href="#102">102</a>         <strong class="jxr_keyword">final</strong> List&lt;DoublePoint&gt; clusterOne =
+<a class="jxr_linenumber" name="103" href="#103">103</a>                 Arrays.asList(points[3], points[4], points[5], points[6], points[7], points[8], points[9], points[10],
+<a class="jxr_linenumber" name="104" href="#104">104</a>                               points[11], points[12], points[13], points[14]);
+<a class="jxr_linenumber" name="105" href="#105">105</a>         <strong class="jxr_keyword">final</strong> List&lt;DoublePoint&gt; clusterTwo =
+<a class="jxr_linenumber" name="106" href="#106">106</a>                 Arrays.asList(points[15], points[16], points[17], points[18], points[19], points[20], points[21],
+<a class="jxr_linenumber" name="107" href="#107">107</a>                               points[22], points[23], points[24], points[25], points[26], points[27], points[28],
+<a class="jxr_linenumber" name="108" href="#108">108</a>                               points[29], points[30], points[31], points[32], points[33], points[34], points[35],
+<a class="jxr_linenumber" name="109" href="#109">109</a>                               points[36], points[37], points[38]);
+<a class="jxr_linenumber" name="110" href="#110">110</a>         <strong class="jxr_keyword">final</strong> List&lt;DoublePoint&gt; clusterThree =
+<a class="jxr_linenumber" name="111" href="#111">111</a>                 Arrays.asList(points[39], points[40], points[41], points[42], points[43], points[44], points[45],
+<a class="jxr_linenumber" name="112" href="#112">112</a>                               points[46], points[47], points[48], points[49], points[50], points[51], points[52],
+<a class="jxr_linenumber" name="113" href="#113">113</a>                               points[53], points[54], points[55], points[56], points[57], points[58], points[59],
+<a class="jxr_linenumber" name="114" href="#114">114</a>                               points[60], points[61], points[62]);
+<a class="jxr_linenumber" name="115" href="#115">115</a> 
+<a class="jxr_linenumber" name="116" href="#116">116</a>         <strong class="jxr_keyword">boolean</strong> cluster1Found = false;
+<a class="jxr_linenumber" name="117" href="#117">117</a>         <strong class="jxr_keyword">boolean</strong> cluster2Found = false;
+<a class="jxr_linenumber" name="118" href="#118">118</a>         <strong class="jxr_keyword">boolean</strong> cluster3Found = false;
+<a class="jxr_linenumber" name="119" href="#119">119</a>         Assert.assertEquals(3, clusters.size());
+<a class="jxr_linenumber" name="120" href="#120">120</a>         <strong class="jxr_keyword">for</strong> (<strong class="jxr_keyword">final</strong> Cluster&lt;DoublePoint&gt; cluster : clusters) {
+<a class="jxr_linenumber" name="121" href="#121">121</a>             <strong class="jxr_keyword">if</strong> (cluster.getPoints().containsAll(clusterOne)) {
+<a class="jxr_linenumber" name="122" href="#122">122</a>                 cluster1Found = <strong class="jxr_keyword">true</strong>;
+<a class="jxr_linenumber" name="123" href="#123">123</a>             }
+<a class="jxr_linenumber" name="124" href="#124">124</a>             <strong class="jxr_keyword">if</strong> (cluster.getPoints().containsAll(clusterTwo)) {
+<a class="jxr_linenumber" name="125" href="#125">125</a>                 cluster2Found = <strong class="jxr_keyword">true</strong>;
+<a class="jxr_linenumber" name="126" href="#126">126</a>             }
+<a class="jxr_linenumber" name="127" href="#127">127</a>             <strong class="jxr_keyword">if</strong> (cluster.getPoints().containsAll(clusterThree)) {
+<a class="jxr_linenumber" name="128" href="#128">128</a>                 cluster3Found = <strong class="jxr_keyword">true</strong>;
+<a class="jxr_linenumber" name="129" href="#129">129</a>             }
+<a class="jxr_linenumber" name="130" href="#130">130</a>         }
+<a class="jxr_linenumber" name="131" href="#131">131</a>         Assert.assertTrue(cluster1Found);
+<a class="jxr_linenumber" name="132" href="#132">132</a>         Assert.assertTrue(cluster2Found);
+<a class="jxr_linenumber" name="133" href="#133">133</a>         Assert.assertTrue(cluster3Found);
+<a class="jxr_linenumber" name="134" href="#134">134</a>     }
+<a class="jxr_linenumber" name="135" href="#135">135</a> 
+<a class="jxr_linenumber" name="136" href="#136">136</a>     @Test
+<a class="jxr_linenumber" name="137" href="#137">137</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> testSingleLink() {
+<a class="jxr_linenumber" name="138" href="#138">138</a>         <strong class="jxr_keyword">final</strong> DoublePoint[] points = {
+<a class="jxr_linenumber" name="139" href="#139">139</a>                 <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">int</strong>[] {10, 10}), <em class="jxr_comment">// A</em>
+<a class="jxr_linenumber" name="140" href="#140">140</a>                 <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">int</strong>[] {12, 9}),
+<a class="jxr_linenumber" name="141" href="#141">141</a>                 <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">int</strong>[] {10, 8}),
+<a class="jxr_linenumber" name="142" href="#142">142</a>                 <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">int</strong>[] {8, 8}),
+<a class="jxr_linenumber" name="143" href="#143">143</a>                 <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">int</strong>[] {8, 6}),
+<a class="jxr_linenumber" name="144" href="#144">144</a>                 <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">int</strong>[] {7, 7}),
+<a class="jxr_linenumber" name="145" href="#145">145</a>                 <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">int</strong>[] {5, 6}),  <em class="jxr_comment">// B</em>
+<a class="jxr_linenumber" name="146" href="#146">146</a>                 <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">int</strong>[] {14, 8}), <em class="jxr_comment">// C</em>
+<a class="jxr_linenumber" name="147" href="#147">147</a>                 <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">int</strong>[] {7, 15}), <em class="jxr_comment">// N - Noise, should not be present</em>
+<a class="jxr_linenumber" name="148" href="#148">148</a>                 <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">int</strong>[] {17, 8}), <em class="jxr_comment">// D - single-link connected to C should not be present</em>
+<a class="jxr_linenumber" name="149" href="#149">149</a>                 
+<a class="jxr_linenumber" name="150" href="#150">150</a>         };
+<a class="jxr_linenumber" name="151" href="#151">151</a>         
+<a class="jxr_linenumber" name="152" href="#152">152</a>         <strong class="jxr_keyword">final</strong> DBSCANClusterer&lt;DoublePoint&gt; clusterer = <strong class="jxr_keyword">new</strong> DBSCANClusterer&lt;DoublePoint&gt;(3, 3);
+<a class="jxr_linenumber" name="153" href="#153">153</a>         List&lt;Cluster&lt;DoublePoint&gt;&gt; clusters = clusterer.cluster(Arrays.asList(points));
+<a class="jxr_linenumber" name="154" href="#154">154</a>         
+<a class="jxr_linenumber" name="155" href="#155">155</a>         Assert.assertEquals(1, clusters.size());
+<a class="jxr_linenumber" name="156" href="#156">156</a>         
+<a class="jxr_linenumber" name="157" href="#157">157</a>         <strong class="jxr_keyword">final</strong> List&lt;DoublePoint&gt; clusterOne =
+<a class="jxr_linenumber" name="158" href="#158">158</a>                 Arrays.asList(points[0], points[1], points[2], points[3], points[4], points[5], points[6], points[7]);
+<a class="jxr_linenumber" name="159" href="#159">159</a>         Assert.assertTrue(clusters.get(0).getPoints().containsAll(clusterOne));
+<a class="jxr_linenumber" name="160" href="#160">160</a>     }
+<a class="jxr_linenumber" name="161" href="#161">161</a>     
+<a class="jxr_linenumber" name="162" href="#162">162</a>     @Test
+<a class="jxr_linenumber" name="163" href="#163">163</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> testGetEps() {
+<a class="jxr_linenumber" name="164" href="#164">164</a>         <strong class="jxr_keyword">final</strong> DBSCANClusterer&lt;DoublePoint&gt; transformer = <strong class="jxr_keyword">new</strong> DBSCANClusterer&lt;DoublePoint&gt;(2.0, 5);
+<a class="jxr_linenumber" name="165" href="#165">165</a>         Assert.assertEquals(2.0, transformer.getEps(), 0.0);
+<a class="jxr_linenumber" name="166" href="#166">166</a>     }
+<a class="jxr_linenumber" name="167" href="#167">167</a> 
+<a class="jxr_linenumber" name="168" href="#168">168</a>     @Test
+<a class="jxr_linenumber" name="169" href="#169">169</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> testGetMinPts() {
+<a class="jxr_linenumber" name="170" href="#170">170</a>         <strong class="jxr_keyword">final</strong> DBSCANClusterer&lt;DoublePoint&gt; transformer = <strong class="jxr_keyword">new</strong> DBSCANClusterer&lt;DoublePoint&gt;(2.0, 5);
+<a class="jxr_linenumber" name="171" href="#171">171</a>         Assert.assertEquals(5, transformer.getMinPts());
+<a class="jxr_linenumber" name="172" href="#172">172</a>     }
+<a class="jxr_linenumber" name="173" href="#173">173</a> 
+<a class="jxr_linenumber" name="174" href="#174">174</a>     @Test(expected = MathIllegalArgumentException.<strong class="jxr_keyword">class</strong>)
+<a class="jxr_linenumber" name="175" href="#175">175</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> testNegativeEps() {
+<a class="jxr_linenumber" name="176" href="#176">176</a>         <strong class="jxr_keyword">new</strong> DBSCANClusterer&lt;DoublePoint&gt;(-2.0, 5);
+<a class="jxr_linenumber" name="177" href="#177">177</a>     }
+<a class="jxr_linenumber" name="178" href="#178">178</a> 
+<a class="jxr_linenumber" name="179" href="#179">179</a>     @Test(expected = MathIllegalArgumentException.<strong class="jxr_keyword">class</strong>)
+<a class="jxr_linenumber" name="180" href="#180">180</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> testNegativeMinPts() {
+<a class="jxr_linenumber" name="181" href="#181">181</a>         <strong class="jxr_keyword">new</strong> DBSCANClusterer&lt;DoublePoint&gt;(2.0, -5);
+<a class="jxr_linenumber" name="182" href="#182">182</a>     }
+<a class="jxr_linenumber" name="183" href="#183">183</a> 
+<a class="jxr_linenumber" name="184" href="#184">184</a>     @Test(expected = NullArgumentException.<strong class="jxr_keyword">class</strong>)
+<a class="jxr_linenumber" name="185" href="#185">185</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> testNullDataset() {
+<a class="jxr_linenumber" name="186" href="#186">186</a>         DBSCANClusterer&lt;DoublePoint&gt; clusterer = <strong class="jxr_keyword">new</strong> DBSCANClusterer&lt;DoublePoint&gt;(2.0, 5);
+<a class="jxr_linenumber" name="187" href="#187">187</a>         clusterer.cluster(<strong class="jxr_keyword">null</strong>);
+<a class="jxr_linenumber" name="188" href="#188">188</a>     }
+<a class="jxr_linenumber" name="189" href="#189">189</a> 
+<a class="jxr_linenumber" name="190" href="#190">190</a> }
+</pre>
+<hr/><div id="footer">This page was automatically generated by <a href="http://maven.apache.org/">Maven</a></div></body>
+</html>
+

Propchange: websites/production/commons/content/proper/commons-math/xref-test/org/apache/commons/math3/ml/clustering/DBSCANClustererTest.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: websites/production/commons/content/proper/commons-math/xref-test/org/apache/commons/math3/ml/clustering/DBSCANClustererTest.html
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: websites/production/commons/content/proper/commons-math/xref-test/org/apache/commons/math3/ml/clustering/KMeansPlusPlusClustererTest.html
==============================================================================
--- websites/production/commons/content/proper/commons-math/xref-test/org/apache/commons/math3/ml/clustering/KMeansPlusPlusClustererTest.html (added)
+++ websites/production/commons/content/proper/commons-math/xref-test/org/apache/commons/math3/ml/clustering/KMeansPlusPlusClustererTest.html Sun Apr  7 07:52:05 2013
@@ -0,0 +1,205 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
+<title>KMeansPlusPlusClustererTest xref</title>
+<link type="text/css" rel="stylesheet" href="../../../../../../stylesheet.css" />
+</head>
+<body>
+<div id="overview"><a href="../../../../../../../testapidocs/org/apache/commons/math3/ml/clustering/KMeansPlusPlusClustererTest.html">View Javadoc</a></div><pre>
+
+<a class="jxr_linenumber" name="1" href="#1">1</a>   <em class="jxr_comment">/*</em>
+<a class="jxr_linenumber" name="2" href="#2">2</a>   <em class="jxr_comment"> * Licensed to the Apache Software Foundation (ASF) under one or more</em>
+<a class="jxr_linenumber" name="3" href="#3">3</a>   <em class="jxr_comment"> * contributor license agreements.  See the NOTICE file distributed with</em>
+<a class="jxr_linenumber" name="4" href="#4">4</a>   <em class="jxr_comment"> * this work for additional information regarding copyright ownership.</em>
+<a class="jxr_linenumber" name="5" href="#5">5</a>   <em class="jxr_comment"> * The ASF licenses this file to You under the Apache License, Version 2.0</em>
+<a class="jxr_linenumber" name="6" href="#6">6</a>   <em class="jxr_comment"> * (the "License"); you may not use this file except in compliance with</em>
+<a class="jxr_linenumber" name="7" href="#7">7</a>   <em class="jxr_comment"> * the License.  You may obtain a copy of the License at</em>
+<a class="jxr_linenumber" name="8" href="#8">8</a>   <em class="jxr_comment"> *</em>
+<a class="jxr_linenumber" name="9" href="#9">9</a>   <em class="jxr_comment"> *      <a href="http://www.apache.org/licenses/LICENSE-2.0" target="alexandria_uri">http://www.apache.org/licenses/LICENSE-2.0</a></em>
+<a class="jxr_linenumber" name="10" href="#10">10</a>  <em class="jxr_comment"> *</em>
+<a class="jxr_linenumber" name="11" href="#11">11</a>  <em class="jxr_comment"> * Unless required by applicable law or agreed to in writing, software</em>
+<a class="jxr_linenumber" name="12" href="#12">12</a>  <em class="jxr_comment"> * distributed under the License is distributed on an "AS IS" BASIS,</em>
+<a class="jxr_linenumber" name="13" href="#13">13</a>  <em class="jxr_comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</em>
+<a class="jxr_linenumber" name="14" href="#14">14</a>  <em class="jxr_comment"> * See the License for the specific language governing permissions and</em>
+<a class="jxr_linenumber" name="15" href="#15">15</a>  <em class="jxr_comment"> * limitations under the License.</em>
+<a class="jxr_linenumber" name="16" href="#16">16</a>  <em class="jxr_comment"> */</em>
+<a class="jxr_linenumber" name="17" href="#17">17</a>  
+<a class="jxr_linenumber" name="18" href="#18">18</a>  <strong class="jxr_keyword">package</strong> org.apache.commons.math3.ml.clustering;
+<a class="jxr_linenumber" name="19" href="#19">19</a>  
+<a class="jxr_linenumber" name="20" href="#20">20</a>  <strong class="jxr_keyword">import</strong> java.util.ArrayList;
+<a class="jxr_linenumber" name="21" href="#21">21</a>  <strong class="jxr_keyword">import</strong> java.util.Arrays;
+<a class="jxr_linenumber" name="22" href="#22">22</a>  <strong class="jxr_keyword">import</strong> java.util.Collection;
+<a class="jxr_linenumber" name="23" href="#23">23</a>  <strong class="jxr_keyword">import</strong> java.util.List;
+<a class="jxr_linenumber" name="24" href="#24">24</a>  
+<a class="jxr_linenumber" name="25" href="#25">25</a>  <strong class="jxr_keyword">import</strong> org.apache.commons.math3.exception.NumberIsTooSmallException;
+<a class="jxr_linenumber" name="26" href="#26">26</a>  <strong class="jxr_keyword">import</strong> org.apache.commons.math3.ml.distance.EuclideanDistance;
+<a class="jxr_linenumber" name="27" href="#27">27</a>  <strong class="jxr_keyword">import</strong> org.apache.commons.math3.random.JDKRandomGenerator;
+<a class="jxr_linenumber" name="28" href="#28">28</a>  <strong class="jxr_keyword">import</strong> org.apache.commons.math3.random.RandomGenerator;
+<a class="jxr_linenumber" name="29" href="#29">29</a>  <strong class="jxr_keyword">import</strong> org.junit.Assert;
+<a class="jxr_linenumber" name="30" href="#30">30</a>  <strong class="jxr_keyword">import</strong> org.junit.Before;
+<a class="jxr_linenumber" name="31" href="#31">31</a>  <strong class="jxr_keyword">import</strong> org.junit.Test;
+<a class="jxr_linenumber" name="32" href="#32">32</a>  
+<a class="jxr_linenumber" name="33" href="#33">33</a>  <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">class</strong> <a href="../../../../../../org/apache/commons/math3/ml/clustering/KMeansPlusPlusClustererTest.html">KMeansPlusPlusClustererTest</a> {
+<a class="jxr_linenumber" name="34" href="#34">34</a>  
+<a class="jxr_linenumber" name="35" href="#35">35</a>      <strong class="jxr_keyword">private</strong> RandomGenerator random;
+<a class="jxr_linenumber" name="36" href="#36">36</a>  
+<a class="jxr_linenumber" name="37" href="#37">37</a>      @Before
+<a class="jxr_linenumber" name="38" href="#38">38</a>      <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> setUp() {
+<a class="jxr_linenumber" name="39" href="#39">39</a>          random = <strong class="jxr_keyword">new</strong> JDKRandomGenerator();
+<a class="jxr_linenumber" name="40" href="#40">40</a>          random.setSeed(1746432956321l);        
+<a class="jxr_linenumber" name="41" href="#41">41</a>      }
+<a class="jxr_linenumber" name="42" href="#42">42</a>  
+<a class="jxr_linenumber" name="43" href="#43">43</a>      <em class="jxr_javadoccomment">/**</em>
+<a class="jxr_linenumber" name="44" href="#44">44</a>  <em class="jxr_javadoccomment">     * JIRA: MATH-305</em>
+<a class="jxr_linenumber" name="45" href="#45">45</a>  <em class="jxr_javadoccomment">     *</em>
+<a class="jxr_linenumber" name="46" href="#46">46</a>  <em class="jxr_javadoccomment">     * Two points, one cluster, one iteration</em>
+<a class="jxr_linenumber" name="47" href="#47">47</a>  <em class="jxr_javadoccomment">     */</em>
+<a class="jxr_linenumber" name="48" href="#48">48</a>      @Test
+<a class="jxr_linenumber" name="49" href="#49">49</a>      <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> testPerformClusterAnalysisDegenerate() {
+<a class="jxr_linenumber" name="50" href="#50">50</a>          KMeansPlusPlusClusterer&lt;DoublePoint&gt; transformer =
+<a class="jxr_linenumber" name="51" href="#51">51</a>                  <strong class="jxr_keyword">new</strong> KMeansPlusPlusClusterer&lt;DoublePoint&gt;(1, 1);
+<a class="jxr_linenumber" name="52" href="#52">52</a>  
+<a class="jxr_linenumber" name="53" href="#53">53</a>          DoublePoint[] points = <strong class="jxr_keyword">new</strong> DoublePoint[] {
+<a class="jxr_linenumber" name="54" href="#54">54</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">int</strong>[] { 1959, 325100 }),
+<a class="jxr_linenumber" name="55" href="#55">55</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">int</strong>[] { 1960, 373200 }), };
+<a class="jxr_linenumber" name="56" href="#56">56</a>          List&lt;? <strong class="jxr_keyword">extends</strong> Cluster&lt;DoublePoint&gt;&gt; clusters = transformer.cluster(Arrays.asList(points));
+<a class="jxr_linenumber" name="57" href="#57">57</a>          Assert.assertEquals(1, clusters.size());
+<a class="jxr_linenumber" name="58" href="#58">58</a>          Assert.assertEquals(2, (clusters.get(0).getPoints().size()));
+<a class="jxr_linenumber" name="59" href="#59">59</a>          DoublePoint pt1 = <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">int</strong>[] { 1959, 325100 });
+<a class="jxr_linenumber" name="60" href="#60">60</a>          DoublePoint pt2 = <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">int</strong>[] { 1960, 373200 });
+<a class="jxr_linenumber" name="61" href="#61">61</a>          Assert.assertTrue(clusters.get(0).getPoints().contains(pt1));
+<a class="jxr_linenumber" name="62" href="#62">62</a>          Assert.assertTrue(clusters.get(0).getPoints().contains(pt2));
+<a class="jxr_linenumber" name="63" href="#63">63</a>  
+<a class="jxr_linenumber" name="64" href="#64">64</a>      }
+<a class="jxr_linenumber" name="65" href="#65">65</a>  
+<a class="jxr_linenumber" name="66" href="#66">66</a>      @Test
+<a class="jxr_linenumber" name="67" href="#67">67</a>      <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> testCertainSpace() {
+<a class="jxr_linenumber" name="68" href="#68">68</a>          KMeansPlusPlusClusterer.EmptyClusterStrategy[] strategies = {
+<a class="jxr_linenumber" name="69" href="#69">69</a>              KMeansPlusPlusClusterer.EmptyClusterStrategy.LARGEST_VARIANCE,
+<a class="jxr_linenumber" name="70" href="#70">70</a>              KMeansPlusPlusClusterer.EmptyClusterStrategy.LARGEST_POINTS_NUMBER,
+<a class="jxr_linenumber" name="71" href="#71">71</a>              KMeansPlusPlusClusterer.EmptyClusterStrategy.FARTHEST_POINT
+<a class="jxr_linenumber" name="72" href="#72">72</a>          };
+<a class="jxr_linenumber" name="73" href="#73">73</a>          <strong class="jxr_keyword">for</strong> (KMeansPlusPlusClusterer.EmptyClusterStrategy strategy : strategies) {
+<a class="jxr_linenumber" name="74" href="#74">74</a>              <strong class="jxr_keyword">int</strong> numberOfVariables = 27;
+<a class="jxr_linenumber" name="75" href="#75">75</a>              <em class="jxr_comment">// initialise testvalues</em>
+<a class="jxr_linenumber" name="76" href="#76">76</a>              <strong class="jxr_keyword">int</strong> position1 = 1;
+<a class="jxr_linenumber" name="77" href="#77">77</a>              <strong class="jxr_keyword">int</strong> position2 = position1 + numberOfVariables;
+<a class="jxr_linenumber" name="78" href="#78">78</a>              <strong class="jxr_keyword">int</strong> position3 = position2 + numberOfVariables;
+<a class="jxr_linenumber" name="79" href="#79">79</a>              <strong class="jxr_keyword">int</strong> position4 = position3 + numberOfVariables;
+<a class="jxr_linenumber" name="80" href="#80">80</a>              <em class="jxr_comment">// testvalues will be multiplied</em>
+<a class="jxr_linenumber" name="81" href="#81">81</a>              <strong class="jxr_keyword">int</strong> multiplier = 1000000;
+<a class="jxr_linenumber" name="82" href="#82">82</a>  
+<a class="jxr_linenumber" name="83" href="#83">83</a>              DoublePoint[] breakingPoints = <strong class="jxr_keyword">new</strong> DoublePoint[numberOfVariables];
+<a class="jxr_linenumber" name="84" href="#84">84</a>              <em class="jxr_comment">// define the space which will break the cluster algorithm</em>
+<a class="jxr_linenumber" name="85" href="#85">85</a>              <strong class="jxr_keyword">for</strong> (<strong class="jxr_keyword">int</strong> i = 0; i &lt; numberOfVariables; i++) {
+<a class="jxr_linenumber" name="86" href="#86">86</a>                  <strong class="jxr_keyword">int</strong> points[] = { position1, position2, position3, position4 };
+<a class="jxr_linenumber" name="87" href="#87">87</a>                  <em class="jxr_comment">// multiply the values</em>
+<a class="jxr_linenumber" name="88" href="#88">88</a>                  <strong class="jxr_keyword">for</strong> (<strong class="jxr_keyword">int</strong> j = 0; j &lt; points.length; j++) {
+<a class="jxr_linenumber" name="89" href="#89">89</a>                      points[j] = points[j] * multiplier;
+<a class="jxr_linenumber" name="90" href="#90">90</a>                  }
+<a class="jxr_linenumber" name="91" href="#91">91</a>                  DoublePoint DoublePoint = <strong class="jxr_keyword">new</strong> DoublePoint(points);
+<a class="jxr_linenumber" name="92" href="#92">92</a>                  breakingPoints[i] = DoublePoint;
+<a class="jxr_linenumber" name="93" href="#93">93</a>                  position1 = position1 + numberOfVariables;
+<a class="jxr_linenumber" name="94" href="#94">94</a>                  position2 = position2 + numberOfVariables;
+<a class="jxr_linenumber" name="95" href="#95">95</a>                  position3 = position3 + numberOfVariables;
+<a class="jxr_linenumber" name="96" href="#96">96</a>                  position4 = position4 + numberOfVariables;
+<a class="jxr_linenumber" name="97" href="#97">97</a>              }
+<a class="jxr_linenumber" name="98" href="#98">98</a>  
+<a class="jxr_linenumber" name="99" href="#99">99</a>              <strong class="jxr_keyword">for</strong> (<strong class="jxr_keyword">int</strong> n = 2; n &lt; 27; ++n) {
+<a class="jxr_linenumber" name="100" href="#100">100</a>                 KMeansPlusPlusClusterer&lt;DoublePoint&gt; transformer =
+<a class="jxr_linenumber" name="101" href="#101">101</a>                     <strong class="jxr_keyword">new</strong> KMeansPlusPlusClusterer&lt;DoublePoint&gt;(n, 100, <strong class="jxr_keyword">new</strong> EuclideanDistance(), random, strategy);
+<a class="jxr_linenumber" name="102" href="#102">102</a> 
+<a class="jxr_linenumber" name="103" href="#103">103</a>                 List&lt;? <strong class="jxr_keyword">extends</strong> Cluster&lt;DoublePoint&gt;&gt; clusters =
+<a class="jxr_linenumber" name="104" href="#104">104</a>                         transformer.cluster(Arrays.asList(breakingPoints));
+<a class="jxr_linenumber" name="105" href="#105">105</a> 
+<a class="jxr_linenumber" name="106" href="#106">106</a>                 Assert.assertEquals(n, clusters.size());
+<a class="jxr_linenumber" name="107" href="#107">107</a>                 <strong class="jxr_keyword">int</strong> sum = 0;
+<a class="jxr_linenumber" name="108" href="#108">108</a>                 <strong class="jxr_keyword">for</strong> (Cluster&lt;DoublePoint&gt; cluster : clusters) {
+<a class="jxr_linenumber" name="109" href="#109">109</a>                     sum += cluster.getPoints().size();
+<a class="jxr_linenumber" name="110" href="#110">110</a>                 }
+<a class="jxr_linenumber" name="111" href="#111">111</a>                 Assert.assertEquals(numberOfVariables, sum);
+<a class="jxr_linenumber" name="112" href="#112">112</a>             }
+<a class="jxr_linenumber" name="113" href="#113">113</a>         }
+<a class="jxr_linenumber" name="114" href="#114">114</a> 
+<a class="jxr_linenumber" name="115" href="#115">115</a>     }
+<a class="jxr_linenumber" name="116" href="#116">116</a> 
+<a class="jxr_linenumber" name="117" href="#117">117</a>     <em class="jxr_javadoccomment">/**</em>
+<a class="jxr_linenumber" name="118" href="#118">118</a> <em class="jxr_javadoccomment">     * A helper class for testSmallDistances(). This class is similar to DoublePoint, but</em>
+<a class="jxr_linenumber" name="119" href="#119">119</a> <em class="jxr_javadoccomment">     * it defines a different distanceFrom() method that tends to return distances less than 1.</em>
+<a class="jxr_linenumber" name="120" href="#120">120</a> <em class="jxr_javadoccomment">     */</em>
+<a class="jxr_linenumber" name="121" href="#121">121</a>     <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">class</strong> <a href="../../../../../../org/apache/commons/math3/ml/clustering/KMeansPlusPlusClustererTest.html">CloseDistance</a> <strong class="jxr_keyword">extends</strong> EuclideanDistance {
+<a class="jxr_linenumber" name="122" href="#122">122</a>         <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">static</strong> <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">long</strong> serialVersionUID = 1L;
+<a class="jxr_linenumber" name="123" href="#123">123</a> 
+<a class="jxr_linenumber" name="124" href="#124">124</a>         @Override
+<a class="jxr_linenumber" name="125" href="#125">125</a>         <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">double</strong> compute(<strong class="jxr_keyword">double</strong>[] a, <strong class="jxr_keyword">double</strong>[] b) {
+<a class="jxr_linenumber" name="126" href="#126">126</a>             <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">super</strong>.compute(a, b) * 0.001;
+<a class="jxr_linenumber" name="127" href="#127">127</a>         }
+<a class="jxr_linenumber" name="128" href="#128">128</a>     }
+<a class="jxr_linenumber" name="129" href="#129">129</a> 
+<a class="jxr_linenumber" name="130" href="#130">130</a>     <em class="jxr_javadoccomment">/**</em>
+<a class="jxr_linenumber" name="131" href="#131">131</a> <em class="jxr_javadoccomment">     * Test points that are very close together. See issue MATH-546.</em>
+<a class="jxr_linenumber" name="132" href="#132">132</a> <em class="jxr_javadoccomment">     */</em>
+<a class="jxr_linenumber" name="133" href="#133">133</a>     @Test
+<a class="jxr_linenumber" name="134" href="#134">134</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> testSmallDistances() {
+<a class="jxr_linenumber" name="135" href="#135">135</a>         <em class="jxr_comment">// Create a bunch of CloseDoublePoints. Most are identical, but one is different by a</em>
+<a class="jxr_linenumber" name="136" href="#136">136</a>         <em class="jxr_comment">// small distance.</em>
+<a class="jxr_linenumber" name="137" href="#137">137</a>         <strong class="jxr_keyword">int</strong>[] repeatedArray = { 0 };
+<a class="jxr_linenumber" name="138" href="#138">138</a>         <strong class="jxr_keyword">int</strong>[] uniqueArray = { 1 };
+<a class="jxr_linenumber" name="139" href="#139">139</a>         DoublePoint repeatedPoint = <strong class="jxr_keyword">new</strong> DoublePoint(repeatedArray);
+<a class="jxr_linenumber" name="140" href="#140">140</a>         DoublePoint uniquePoint = <strong class="jxr_keyword">new</strong> DoublePoint(uniqueArray);
+<a class="jxr_linenumber" name="141" href="#141">141</a> 
+<a class="jxr_linenumber" name="142" href="#142">142</a>         Collection&lt;DoublePoint&gt; points = <strong class="jxr_keyword">new</strong> ArrayList&lt;DoublePoint&gt;();
+<a class="jxr_linenumber" name="143" href="#143">143</a>         <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong> NUM_REPEATED_POINTS = 10 * 1000;
+<a class="jxr_linenumber" name="144" href="#144">144</a>         <strong class="jxr_keyword">for</strong> (<strong class="jxr_keyword">int</strong> i = 0; i &lt; NUM_REPEATED_POINTS; ++i) {
+<a class="jxr_linenumber" name="145" href="#145">145</a>             points.add(repeatedPoint);
+<a class="jxr_linenumber" name="146" href="#146">146</a>         }
+<a class="jxr_linenumber" name="147" href="#147">147</a>         points.add(uniquePoint);
+<a class="jxr_linenumber" name="148" href="#148">148</a> 
+<a class="jxr_linenumber" name="149" href="#149">149</a>         <em class="jxr_comment">// Ask a KMeansPlusPlusClusterer to run zero iterations (i.e., to simply choose initial</em>
+<a class="jxr_linenumber" name="150" href="#150">150</a>         <em class="jxr_comment">// cluster centers).</em>
+<a class="jxr_linenumber" name="151" href="#151">151</a>         <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">long</strong> RANDOM_SEED = 0;
+<a class="jxr_linenumber" name="152" href="#152">152</a>         <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong> NUM_CLUSTERS = 2;
+<a class="jxr_linenumber" name="153" href="#153">153</a>         <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">int</strong> NUM_ITERATIONS = 0;
+<a class="jxr_linenumber" name="154" href="#154">154</a>         random.setSeed(RANDOM_SEED);
+<a class="jxr_linenumber" name="155" href="#155">155</a>         
+<a class="jxr_linenumber" name="156" href="#156">156</a>         KMeansPlusPlusClusterer&lt;DoublePoint&gt; clusterer =
+<a class="jxr_linenumber" name="157" href="#157">157</a>             <strong class="jxr_keyword">new</strong> KMeansPlusPlusClusterer&lt;DoublePoint&gt;(NUM_CLUSTERS, NUM_ITERATIONS,
+<a class="jxr_linenumber" name="158" href="#158">158</a>                     <strong class="jxr_keyword">new</strong> <a href="../../../../../../org/apache/commons/math3/ml/clustering/KMeansPlusPlusClustererTest.html">CloseDistance</a>(), random);
+<a class="jxr_linenumber" name="159" href="#159">159</a>         List&lt;CentroidCluster&lt;DoublePoint&gt;&gt; clusters = clusterer.cluster(points);
+<a class="jxr_linenumber" name="160" href="#160">160</a> 
+<a class="jxr_linenumber" name="161" href="#161">161</a>         <em class="jxr_comment">// Check that one of the chosen centers is the unique point.</em>
+<a class="jxr_linenumber" name="162" href="#162">162</a>         <strong class="jxr_keyword">boolean</strong> uniquePointIsCenter = false;
+<a class="jxr_linenumber" name="163" href="#163">163</a>         <strong class="jxr_keyword">for</strong> (CentroidCluster&lt;DoublePoint&gt; cluster : clusters) {
+<a class="jxr_linenumber" name="164" href="#164">164</a>             <strong class="jxr_keyword">if</strong> (cluster.getCenter().equals(uniquePoint)) {
+<a class="jxr_linenumber" name="165" href="#165">165</a>                 uniquePointIsCenter = <strong class="jxr_keyword">true</strong>;
+<a class="jxr_linenumber" name="166" href="#166">166</a>             }
+<a class="jxr_linenumber" name="167" href="#167">167</a>         }
+<a class="jxr_linenumber" name="168" href="#168">168</a>         Assert.assertTrue(uniquePointIsCenter);
+<a class="jxr_linenumber" name="169" href="#169">169</a>     }
+<a class="jxr_linenumber" name="170" href="#170">170</a>     
+<a class="jxr_linenumber" name="171" href="#171">171</a>     <em class="jxr_javadoccomment">/**</em>
+<a class="jxr_linenumber" name="172" href="#172">172</a> <em class="jxr_javadoccomment">     * 2 variables cannot be clustered into 3 clusters. See issue MATH-436.</em>
+<a class="jxr_linenumber" name="173" href="#173">173</a> <em class="jxr_javadoccomment">     */</em>
+<a class="jxr_linenumber" name="174" href="#174">174</a>     @Test(expected=NumberIsTooSmallException.<strong class="jxr_keyword">class</strong>)
+<a class="jxr_linenumber" name="175" href="#175">175</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> testPerformClusterAnalysisToManyClusters() {
+<a class="jxr_linenumber" name="176" href="#176">176</a>         KMeansPlusPlusClusterer&lt;DoublePoint&gt; transformer = 
+<a class="jxr_linenumber" name="177" href="#177">177</a>             <strong class="jxr_keyword">new</strong> KMeansPlusPlusClusterer&lt;DoublePoint&gt;(3, 1, <strong class="jxr_keyword">new</strong> EuclideanDistance(), random);
+<a class="jxr_linenumber" name="178" href="#178">178</a>         
+<a class="jxr_linenumber" name="179" href="#179">179</a>         DoublePoint[] points = <strong class="jxr_keyword">new</strong> DoublePoint[] {
+<a class="jxr_linenumber" name="180" href="#180">180</a>             <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">int</strong>[] {
+<a class="jxr_linenumber" name="181" href="#181">181</a>                 1959, 325100
+<a class="jxr_linenumber" name="182" href="#182">182</a>             }), <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">int</strong>[] {
+<a class="jxr_linenumber" name="183" href="#183">183</a>                 1960, 373200
+<a class="jxr_linenumber" name="184" href="#184">184</a>             })
+<a class="jxr_linenumber" name="185" href="#185">185</a>         };
+<a class="jxr_linenumber" name="186" href="#186">186</a>         
+<a class="jxr_linenumber" name="187" href="#187">187</a>         transformer.cluster(Arrays.asList(points));
+<a class="jxr_linenumber" name="188" href="#188">188</a> 
+<a class="jxr_linenumber" name="189" href="#189">189</a>     }
+<a class="jxr_linenumber" name="190" href="#190">190</a> 
+<a class="jxr_linenumber" name="191" href="#191">191</a> }
+</pre>
+<hr/><div id="footer">This page was automatically generated by <a href="http://maven.apache.org/">Maven</a></div></body>
+</html>
+

Propchange: websites/production/commons/content/proper/commons-math/xref-test/org/apache/commons/math3/ml/clustering/KMeansPlusPlusClustererTest.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: websites/production/commons/content/proper/commons-math/xref-test/org/apache/commons/math3/ml/clustering/KMeansPlusPlusClustererTest.html
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: websites/production/commons/content/proper/commons-math/xref-test/org/apache/commons/math3/ml/clustering/MultiKMeansPlusPlusClustererTest.html
==============================================================================
--- websites/production/commons/content/proper/commons-math/xref-test/org/apache/commons/math3/ml/clustering/MultiKMeansPlusPlusClustererTest.html (added)
+++ websites/production/commons/content/proper/commons-math/xref-test/org/apache/commons/math3/ml/clustering/MultiKMeansPlusPlusClustererTest.html Sun Apr  7 07:52:05 2013
@@ -0,0 +1,112 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
+<title>MultiKMeansPlusPlusClustererTest xref</title>
+<link type="text/css" rel="stylesheet" href="../../../../../../stylesheet.css" />
+</head>
+<body>
+<div id="overview"><a href="../../../../../../../testapidocs/org/apache/commons/math3/ml/clustering/MultiKMeansPlusPlusClustererTest.html">View Javadoc</a></div><pre>
+
+<a class="jxr_linenumber" name="1" href="#1">1</a>   <em class="jxr_comment">/*</em>
+<a class="jxr_linenumber" name="2" href="#2">2</a>   <em class="jxr_comment"> * Licensed to the Apache Software Foundation (ASF) under one or more</em>
+<a class="jxr_linenumber" name="3" href="#3">3</a>   <em class="jxr_comment"> * contributor license agreements.  See the NOTICE file distributed with</em>
+<a class="jxr_linenumber" name="4" href="#4">4</a>   <em class="jxr_comment"> * this work for additional information regarding copyright ownership.</em>
+<a class="jxr_linenumber" name="5" href="#5">5</a>   <em class="jxr_comment"> * The ASF licenses this file to You under the Apache License, Version 2.0</em>
+<a class="jxr_linenumber" name="6" href="#6">6</a>   <em class="jxr_comment"> * (the "License"); you may not use this file except in compliance with</em>
+<a class="jxr_linenumber" name="7" href="#7">7</a>   <em class="jxr_comment"> * the License.  You may obtain a copy of the License at</em>
+<a class="jxr_linenumber" name="8" href="#8">8</a>   <em class="jxr_comment"> *</em>
+<a class="jxr_linenumber" name="9" href="#9">9</a>   <em class="jxr_comment"> *      <a href="http://www.apache.org/licenses/LICENSE-2.0" target="alexandria_uri">http://www.apache.org/licenses/LICENSE-2.0</a></em>
+<a class="jxr_linenumber" name="10" href="#10">10</a>  <em class="jxr_comment"> *</em>
+<a class="jxr_linenumber" name="11" href="#11">11</a>  <em class="jxr_comment"> * Unless required by applicable law or agreed to in writing, software</em>
+<a class="jxr_linenumber" name="12" href="#12">12</a>  <em class="jxr_comment"> * distributed under the License is distributed on an "AS IS" BASIS,</em>
+<a class="jxr_linenumber" name="13" href="#13">13</a>  <em class="jxr_comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</em>
+<a class="jxr_linenumber" name="14" href="#14">14</a>  <em class="jxr_comment"> * See the License for the specific language governing permissions and</em>
+<a class="jxr_linenumber" name="15" href="#15">15</a>  <em class="jxr_comment"> * limitations under the License.</em>
+<a class="jxr_linenumber" name="16" href="#16">16</a>  <em class="jxr_comment"> */</em>
+<a class="jxr_linenumber" name="17" href="#17">17</a>  
+<a class="jxr_linenumber" name="18" href="#18">18</a>  <strong class="jxr_keyword">package</strong> org.apache.commons.math3.ml.clustering;
+<a class="jxr_linenumber" name="19" href="#19">19</a>  
+<a class="jxr_linenumber" name="20" href="#20">20</a>  
+<a class="jxr_linenumber" name="21" href="#21">21</a>  <strong class="jxr_keyword">import</strong> java.util.Arrays;
+<a class="jxr_linenumber" name="22" href="#22">22</a>  <strong class="jxr_keyword">import</strong> java.util.List;
+<a class="jxr_linenumber" name="23" href="#23">23</a>  
+<a class="jxr_linenumber" name="24" href="#24">24</a>  <strong class="jxr_keyword">import</strong> org.junit.Assert;
+<a class="jxr_linenumber" name="25" href="#25">25</a>  <strong class="jxr_keyword">import</strong> org.junit.Test;
+<a class="jxr_linenumber" name="26" href="#26">26</a>  
+<a class="jxr_linenumber" name="27" href="#27">27</a>  <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">class</strong> <a href="../../../../../../org/apache/commons/math3/ml/clustering/MultiKMeansPlusPlusClustererTest.html">MultiKMeansPlusPlusClustererTest</a> {
+<a class="jxr_linenumber" name="28" href="#28">28</a>  
+<a class="jxr_linenumber" name="29" href="#29">29</a>      @Test
+<a class="jxr_linenumber" name="30" href="#30">30</a>      <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> dimension2() {
+<a class="jxr_linenumber" name="31" href="#31">31</a>          MultiKMeansPlusPlusClusterer&lt;DoublePoint&gt; transformer =
+<a class="jxr_linenumber" name="32" href="#32">32</a>              <strong class="jxr_keyword">new</strong> MultiKMeansPlusPlusClusterer&lt;DoublePoint&gt;(
+<a class="jxr_linenumber" name="33" href="#33">33</a>                      <strong class="jxr_keyword">new</strong> KMeansPlusPlusClusterer&lt;DoublePoint&gt;(3, 10), 5);
+<a class="jxr_linenumber" name="34" href="#34">34</a>          
+<a class="jxr_linenumber" name="35" href="#35">35</a>          DoublePoint[] points = <strong class="jxr_keyword">new</strong> DoublePoint[] {
+<a class="jxr_linenumber" name="36" href="#36">36</a>  
+<a class="jxr_linenumber" name="37" href="#37">37</a>                  <em class="jxr_comment">// first expected cluster</em>
+<a class="jxr_linenumber" name="38" href="#38">38</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">int</strong>[] { -15,  3 }),
+<a class="jxr_linenumber" name="39" href="#39">39</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">int</strong>[] { -15,  4 }),
+<a class="jxr_linenumber" name="40" href="#40">40</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">int</strong>[] { -15,  5 }),
+<a class="jxr_linenumber" name="41" href="#41">41</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">int</strong>[] { -14,  3 }),
+<a class="jxr_linenumber" name="42" href="#42">42</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">int</strong>[] { -14,  5 }),
+<a class="jxr_linenumber" name="43" href="#43">43</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">int</strong>[] { -13,  3 }),
+<a class="jxr_linenumber" name="44" href="#44">44</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">int</strong>[] { -13,  4 }),
+<a class="jxr_linenumber" name="45" href="#45">45</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">int</strong>[] { -13,  5 }),
+<a class="jxr_linenumber" name="46" href="#46">46</a>  
+<a class="jxr_linenumber" name="47" href="#47">47</a>                  <em class="jxr_comment">// second expected cluster</em>
+<a class="jxr_linenumber" name="48" href="#48">48</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">int</strong>[] { -1,  0 }),
+<a class="jxr_linenumber" name="49" href="#49">49</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">int</strong>[] { -1, -1 }),
+<a class="jxr_linenumber" name="50" href="#50">50</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">int</strong>[] {  0, -1 }),
+<a class="jxr_linenumber" name="51" href="#51">51</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">int</strong>[] {  1, -1 }),
+<a class="jxr_linenumber" name="52" href="#52">52</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">int</strong>[] {  1, -2 }),
+<a class="jxr_linenumber" name="53" href="#53">53</a>  
+<a class="jxr_linenumber" name="54" href="#54">54</a>                  <em class="jxr_comment">// third expected cluster</em>
+<a class="jxr_linenumber" name="55" href="#55">55</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">int</strong>[] { 13,  3 }),
+<a class="jxr_linenumber" name="56" href="#56">56</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">int</strong>[] { 13,  4 }),
+<a class="jxr_linenumber" name="57" href="#57">57</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">int</strong>[] { 14,  4 }),
+<a class="jxr_linenumber" name="58" href="#58">58</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">int</strong>[] { 14,  7 }),
+<a class="jxr_linenumber" name="59" href="#59">59</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">int</strong>[] { 16,  5 }),
+<a class="jxr_linenumber" name="60" href="#60">60</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">int</strong>[] { 16,  6 }),
+<a class="jxr_linenumber" name="61" href="#61">61</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">int</strong>[] { 17,  4 }),
+<a class="jxr_linenumber" name="62" href="#62">62</a>                  <strong class="jxr_keyword">new</strong> DoublePoint(<strong class="jxr_keyword">new</strong> <strong class="jxr_keyword">int</strong>[] { 17,  7 })
+<a class="jxr_linenumber" name="63" href="#63">63</a>  
+<a class="jxr_linenumber" name="64" href="#64">64</a>          };
+<a class="jxr_linenumber" name="65" href="#65">65</a>          List&lt;CentroidCluster&lt;DoublePoint&gt;&gt; clusters = transformer.cluster(Arrays.asList(points));
+<a class="jxr_linenumber" name="66" href="#66">66</a>  
+<a class="jxr_linenumber" name="67" href="#67">67</a>          Assert.assertEquals(3, clusters.size());
+<a class="jxr_linenumber" name="68" href="#68">68</a>          <strong class="jxr_keyword">boolean</strong> cluster1Found = false;
+<a class="jxr_linenumber" name="69" href="#69">69</a>          <strong class="jxr_keyword">boolean</strong> cluster2Found = false;
+<a class="jxr_linenumber" name="70" href="#70">70</a>          <strong class="jxr_keyword">boolean</strong> cluster3Found = false;
+<a class="jxr_linenumber" name="71" href="#71">71</a>          <strong class="jxr_keyword">double</strong> epsilon = 1e-6;
+<a class="jxr_linenumber" name="72" href="#72">72</a>          <strong class="jxr_keyword">for</strong> (CentroidCluster&lt;DoublePoint&gt; cluster : clusters) {
+<a class="jxr_linenumber" name="73" href="#73">73</a>              Clusterable center = cluster.getCenter();
+<a class="jxr_linenumber" name="74" href="#74">74</a>              <strong class="jxr_keyword">double</strong>[] point = center.getPoint();
+<a class="jxr_linenumber" name="75" href="#75">75</a>              <strong class="jxr_keyword">if</strong> (point[0] &lt; 0) {
+<a class="jxr_linenumber" name="76" href="#76">76</a>                  cluster1Found = <strong class="jxr_keyword">true</strong>;
+<a class="jxr_linenumber" name="77" href="#77">77</a>                  Assert.assertEquals(8, cluster.getPoints().size());
+<a class="jxr_linenumber" name="78" href="#78">78</a>                  Assert.assertEquals(-14, point[0], epsilon);
+<a class="jxr_linenumber" name="79" href="#79">79</a>                  Assert.assertEquals( 4, point[1], epsilon);
+<a class="jxr_linenumber" name="80" href="#80">80</a>              } <strong class="jxr_keyword">else</strong> <strong class="jxr_keyword">if</strong> (point[1] &lt; 0) {
+<a class="jxr_linenumber" name="81" href="#81">81</a>                  cluster2Found = <strong class="jxr_keyword">true</strong>;
+<a class="jxr_linenumber" name="82" href="#82">82</a>                  Assert.assertEquals(5, cluster.getPoints().size());
+<a class="jxr_linenumber" name="83" href="#83">83</a>                  Assert.assertEquals( 0, point[0], epsilon);
+<a class="jxr_linenumber" name="84" href="#84">84</a>                  Assert.assertEquals(-1, point[1], epsilon);
+<a class="jxr_linenumber" name="85" href="#85">85</a>              } <strong class="jxr_keyword">else</strong> {
+<a class="jxr_linenumber" name="86" href="#86">86</a>                  cluster3Found = <strong class="jxr_keyword">true</strong>;
+<a class="jxr_linenumber" name="87" href="#87">87</a>                  Assert.assertEquals(8, cluster.getPoints().size());
+<a class="jxr_linenumber" name="88" href="#88">88</a>                  Assert.assertEquals(15, point[0], epsilon);
+<a class="jxr_linenumber" name="89" href="#89">89</a>                  Assert.assertEquals(5, point[1], epsilon);
+<a class="jxr_linenumber" name="90" href="#90">90</a>              }
+<a class="jxr_linenumber" name="91" href="#91">91</a>          }
+<a class="jxr_linenumber" name="92" href="#92">92</a>          Assert.assertTrue(cluster1Found);
+<a class="jxr_linenumber" name="93" href="#93">93</a>          Assert.assertTrue(cluster2Found);
+<a class="jxr_linenumber" name="94" href="#94">94</a>          Assert.assertTrue(cluster3Found);
+<a class="jxr_linenumber" name="95" href="#95">95</a>  
+<a class="jxr_linenumber" name="96" href="#96">96</a>      }
+<a class="jxr_linenumber" name="97" href="#97">97</a>  
+<a class="jxr_linenumber" name="98" href="#98">98</a>  }
+</pre>
+<hr/><div id="footer">This page was automatically generated by <a href="http://maven.apache.org/">Maven</a></div></body>
+</html>
+

Propchange: websites/production/commons/content/proper/commons-math/xref-test/org/apache/commons/math3/ml/clustering/MultiKMeansPlusPlusClustererTest.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: websites/production/commons/content/proper/commons-math/xref-test/org/apache/commons/math3/ml/clustering/MultiKMeansPlusPlusClustererTest.html
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: websites/production/commons/content/proper/commons-math/xref-test/org/apache/commons/math3/ml/clustering/package-frame.html
==============================================================================
--- websites/production/commons/content/proper/commons-math/xref-test/org/apache/commons/math3/ml/clustering/package-frame.html (added)
+++ websites/production/commons/content/proper/commons-math/xref-test/org/apache/commons/math3/ml/clustering/package-frame.html Sun Apr  7 07:52:05 2013
@@ -0,0 +1,33 @@
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
+<html xml:lang="en" lang="en">
+	<head>
+		<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
+		<title>Commons Math 3.2 Reference Package org.apache.commons.math3.ml.clustering</title>
+		<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="style" />
+	</head>
+	<body>
+
+		<h3>
+        	<a href="package-summary.html" target="classFrame">org.apache.commons.math3.ml.clustering</a>
+      	</h3>
+
+      	<h3>Classes</h3>
+
+      	<ul>
+      		          	<li>
+            	<a href="KMeansPlusPlusClustererTest.html" target="classFrame">CloseDistance</a>
+          	</li>
+          	          	<li>
+            	<a href="DBSCANClustererTest.html" target="classFrame">DBSCANClustererTest</a>
+          	</li>
+          	          	<li>
+            	<a href="KMeansPlusPlusClustererTest.html" target="classFrame">KMeansPlusPlusClustererTest</a>
+          	</li>
+          	          	<li>
+            	<a href="MultiKMeansPlusPlusClustererTest.html" target="classFrame">MultiKMeansPlusPlusClustererTest</a>
+          	</li>
+          	      	</ul>
+
+	</body>
+</html>
\ No newline at end of file

Propchange: websites/production/commons/content/proper/commons-math/xref-test/org/apache/commons/math3/ml/clustering/package-frame.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: websites/production/commons/content/proper/commons-math/xref-test/org/apache/commons/math3/ml/clustering/package-frame.html
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: websites/production/commons/content/proper/commons-math/xref-test/org/apache/commons/math3/ml/clustering/package-summary.html
==============================================================================
--- websites/production/commons/content/proper/commons-math/xref-test/org/apache/commons/math3/ml/clustering/package-summary.html (added)
+++ websites/production/commons/content/proper/commons-math/xref-test/org/apache/commons/math3/ml/clustering/package-summary.html Sun Apr  7 07:52:05 2013
@@ -0,0 +1,82 @@
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
+<html xml:lang="en" lang="en">
+	<head>
+		<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
+		<title>Commons Math 3.2 Reference Package org.apache.commons.math3.ml.clustering</title>
+		<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="style" />
+	</head>
+	<body>
+		      	<div class="overview">
+        	<ul>
+          		<li>
+            		<a href="../../../../../../overview-summary.html">Overview</a>
+          		</li>
+          		<li class="selected">Package</li>
+        	</ul>
+      	</div>
+      	<div class="framenoframe">
+        	<ul>
+          		<li>
+            		<a href="../../../../../../index.html" target="_top">FRAMES</a>
+          		</li>
+          		<li>
+            		<a href="package-summary.html" target="_top">NO FRAMES</a>
+          		</li>
+        	</ul>
+      	</div>
+		
+		      	<h2>Package org.apache.commons.math3.ml.clustering</h2>
+
+		<table class="summary">
+        	<thead>
+          		<tr>
+            		<th>Class Summary</th>
+          		</tr>
+        	</thead>
+        	<tbody>
+        		            	<tr>
+              		<td>
+                		<a href="KMeansPlusPlusClustererTest.html" target="classFrame">CloseDistance</a>
+              		</td>
+            	</tr>
+				            	<tr>
+              		<td>
+                		<a href="DBSCANClustererTest.html" target="classFrame">DBSCANClustererTest</a>
+              		</td>
+            	</tr>
+				            	<tr>
+              		<td>
+                		<a href="KMeansPlusPlusClustererTest.html" target="classFrame">KMeansPlusPlusClustererTest</a>
+              		</td>
+            	</tr>
+				            	<tr>
+              		<td>
+                		<a href="MultiKMeansPlusPlusClustererTest.html" target="classFrame">MultiKMeansPlusPlusClustererTest</a>
+              		</td>
+            	</tr>
+				        	</tbody>
+      	</table>
+		
+		      	<div class="overview">
+        	<ul>
+          		<li>
+            		<a href="../../../../../../overview-summary.html">Overview</a>
+          		</li>
+          		<li class="selected">Package</li>
+        	</ul>
+      	</div>
+      	<div class="framenoframe">
+        	<ul>
+          		<li>
+            		<a href="../../../../../../index.html" target="_top">FRAMES</a>
+          		</li>
+          		<li>
+            		<a href="package-summary.html" target="_top">NO FRAMES</a>
+          		</li>
+        	</ul>
+      	</div>
+				<hr />
+		Copyright &#169; 2003-2013 The Apache Software Foundation. All Rights Reserved.
+	</body>
+</html>
\ No newline at end of file

Propchange: websites/production/commons/content/proper/commons-math/xref-test/org/apache/commons/math3/ml/clustering/package-summary.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: websites/production/commons/content/proper/commons-math/xref-test/org/apache/commons/math3/ml/clustering/package-summary.html
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: websites/production/commons/content/proper/commons-math/xref-test/org/apache/commons/math3/ml/distance/CanberraDistanceTest.html
==============================================================================
--- websites/production/commons/content/proper/commons-math/xref-test/org/apache/commons/math3/ml/distance/CanberraDistanceTest.html (added)
+++ websites/production/commons/content/proper/commons-math/xref-test/org/apache/commons/math3/ml/distance/CanberraDistanceTest.html Sun Apr  7 07:52:05 2013
@@ -0,0 +1,62 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
+<title>CanberraDistanceTest xref</title>
+<link type="text/css" rel="stylesheet" href="../../../../../../stylesheet.css" />
+</head>
+<body>
+<div id="overview"><a href="../../../../../../../testapidocs/org/apache/commons/math3/ml/distance/CanberraDistanceTest.html">View Javadoc</a></div><pre>
+
+<a class="jxr_linenumber" name="1" href="#1">1</a>   <em class="jxr_comment">/*</em>
+<a class="jxr_linenumber" name="2" href="#2">2</a>   <em class="jxr_comment"> * Licensed to the Apache Software Foundation (ASF) under one or more</em>
+<a class="jxr_linenumber" name="3" href="#3">3</a>   <em class="jxr_comment"> * contributor license agreements.  See the NOTICE file distributed with</em>
+<a class="jxr_linenumber" name="4" href="#4">4</a>   <em class="jxr_comment"> * this work for additional information regarding copyright ownership.</em>
+<a class="jxr_linenumber" name="5" href="#5">5</a>   <em class="jxr_comment"> * The ASF licenses this file to You under the Apache License, Version 2.0</em>
+<a class="jxr_linenumber" name="6" href="#6">6</a>   <em class="jxr_comment"> * (the "License"); you may not use this file except in compliance with</em>
+<a class="jxr_linenumber" name="7" href="#7">7</a>   <em class="jxr_comment"> * the License.  You may obtain a copy of the License at</em>
+<a class="jxr_linenumber" name="8" href="#8">8</a>   <em class="jxr_comment"> *</em>
+<a class="jxr_linenumber" name="9" href="#9">9</a>   <em class="jxr_comment"> *      <a href="http://www.apache.org/licenses/LICENSE-2.0" target="alexandria_uri">http://www.apache.org/licenses/LICENSE-2.0</a></em>
+<a class="jxr_linenumber" name="10" href="#10">10</a>  <em class="jxr_comment"> *</em>
+<a class="jxr_linenumber" name="11" href="#11">11</a>  <em class="jxr_comment"> * Unless required by applicable law or agreed to in writing, software</em>
+<a class="jxr_linenumber" name="12" href="#12">12</a>  <em class="jxr_comment"> * distributed under the License is distributed on an "AS IS" BASIS,</em>
+<a class="jxr_linenumber" name="13" href="#13">13</a>  <em class="jxr_comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</em>
+<a class="jxr_linenumber" name="14" href="#14">14</a>  <em class="jxr_comment"> * See the License for the specific language governing permissions and</em>
+<a class="jxr_linenumber" name="15" href="#15">15</a>  <em class="jxr_comment"> * limitations under the License.</em>
+<a class="jxr_linenumber" name="16" href="#16">16</a>  <em class="jxr_comment"> */</em>
+<a class="jxr_linenumber" name="17" href="#17">17</a>  <strong class="jxr_keyword">package</strong> org.apache.commons.math3.ml.distance;
+<a class="jxr_linenumber" name="18" href="#18">18</a>  
+<a class="jxr_linenumber" name="19" href="#19">19</a>  <strong class="jxr_keyword">import</strong> org.junit.Assert;
+<a class="jxr_linenumber" name="20" href="#20">20</a>  <strong class="jxr_keyword">import</strong> org.junit.Test;
+<a class="jxr_linenumber" name="21" href="#21">21</a>  
+<a class="jxr_linenumber" name="22" href="#22">22</a>  <em class="jxr_javadoccomment">/**</em>
+<a class="jxr_linenumber" name="23" href="#23">23</a>  <em class="jxr_javadoccomment"> * Tests for {@link CanberraDistance} class.</em>
+<a class="jxr_linenumber" name="24" href="#24">24</a>  <em class="jxr_javadoccomment"> */</em>
+<a class="jxr_linenumber" name="25" href="#25">25</a>  <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">class</strong> <a href="../../../../../../org/apache/commons/math3/ml/distance/CanberraDistanceTest.html">CanberraDistanceTest</a> {
+<a class="jxr_linenumber" name="26" href="#26">26</a>      <strong class="jxr_keyword">final</strong> DistanceMeasure distance = <strong class="jxr_keyword">new</strong> CanberraDistance();
+<a class="jxr_linenumber" name="27" href="#27">27</a>  
+<a class="jxr_linenumber" name="28" href="#28">28</a>      @Test
+<a class="jxr_linenumber" name="29" href="#29">29</a>      <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> testZero() {
+<a class="jxr_linenumber" name="30" href="#30">30</a>          <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">double</strong>[] a = { 0, 1, -2, 3.4, 5, -6.7, 89 };
+<a class="jxr_linenumber" name="31" href="#31">31</a>          Assert.assertEquals(0, distance.compute(a, a), 0d);
+<a class="jxr_linenumber" name="32" href="#32">32</a>      }
+<a class="jxr_linenumber" name="33" href="#33">33</a>  
+<a class="jxr_linenumber" name="34" href="#34">34</a>      @Test
+<a class="jxr_linenumber" name="35" href="#35">35</a>      <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> testZero2() {
+<a class="jxr_linenumber" name="36" href="#36">36</a>          <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">double</strong>[] a = { 0, 0 };
+<a class="jxr_linenumber" name="37" href="#37">37</a>          Assert.assertEquals(0, distance.compute(a, a), 0d);
+<a class="jxr_linenumber" name="38" href="#38">38</a>      }
+<a class="jxr_linenumber" name="39" href="#39">39</a>  
+<a class="jxr_linenumber" name="40" href="#40">40</a>      @Test
+<a class="jxr_linenumber" name="41" href="#41">41</a>      <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> test() {
+<a class="jxr_linenumber" name="42" href="#42">42</a>          <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">double</strong>[] a = { 1, 2, 3, 4, 9 };
+<a class="jxr_linenumber" name="43" href="#43">43</a>          <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">double</strong>[] b = { -5, -6, 7, 4, 3 };
+<a class="jxr_linenumber" name="44" href="#44">44</a>          <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">double</strong> expected = 2.9;
+<a class="jxr_linenumber" name="45" href="#45">45</a>          Assert.assertEquals(expected, distance.compute(a, b), 0d);
+<a class="jxr_linenumber" name="46" href="#46">46</a>          Assert.assertEquals(expected, distance.compute(b, a), 0d);
+<a class="jxr_linenumber" name="47" href="#47">47</a>      }
+<a class="jxr_linenumber" name="48" href="#48">48</a>  }
+</pre>
+<hr/><div id="footer">This page was automatically generated by <a href="http://maven.apache.org/">Maven</a></div></body>
+</html>
+

Propchange: websites/production/commons/content/proper/commons-math/xref-test/org/apache/commons/math3/ml/distance/CanberraDistanceTest.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: websites/production/commons/content/proper/commons-math/xref-test/org/apache/commons/math3/ml/distance/CanberraDistanceTest.html
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision



Mime
View raw message