You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mahout.apache.org by sr...@apache.org on 2010/01/25 22:43:24 UTC

svn commit: r902987 - in /lucene/mahout/trunk/math/src: main/java/org/apache/mahout/math/Sorting.java test/java/org/apache/mahout/math/AIOOBInSortingTest.java

Author: srowen
Date: Mon Jan 25 21:43:23 2010
New Revision: 902987

URL: http://svn.apache.org/viewvc?rev=902987&view=rev
Log:
MAHOUT-266

Added:
    lucene/mahout/trunk/math/src/test/java/org/apache/mahout/math/AIOOBInSortingTest.java
Modified:
    lucene/mahout/trunk/math/src/main/java/org/apache/mahout/math/Sorting.java

Modified: lucene/mahout/trunk/math/src/main/java/org/apache/mahout/math/Sorting.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/math/src/main/java/org/apache/mahout/math/Sorting.java?rev=902987&r1=902986&r2=902987&view=diff
==============================================================================
--- lucene/mahout/trunk/math/src/main/java/org/apache/mahout/math/Sorting.java (original)
+++ lucene/mahout/trunk/math/src/main/java/org/apache/mahout/math/Sorting.java Mon Jan 25 21:43:23 2010
@@ -691,8 +691,8 @@
     while (b <= c) {
       // copy all values equal to the partition value to before a..b.  In the process, advance b
       // as long as values less than the partition or equal are found, also stop when a..b collides with c..d
-      int comparison = comp.compare(b, partitionIndex);
-      while (b <= c && comparison <= 0) {
+      int comparison;
+      while (b <= c && (comparison = comp.compare(b, partitionIndex)) <= 0) {
         if (comparison == 0) {
           if (a == partitionIndex) {
             partitionIndex = b;
@@ -704,13 +704,11 @@
           a++;
         }
         b++;
-        comparison = comp.compare(b, partitionIndex);
       }
       // at this point [start..a) has partition values, [a..b) has values < partition
       // also, either b>c or v[b] > partition value
 
-      comparison = comp.compare(c, partitionIndex);
-      while (c >= b && comparison >= 0) {
+      while (c >= b && (comparison = comp.compare(c, partitionIndex)) >= 0) {
         if (comparison == 0) {
           if (c == partitionIndex) {
             partitionIndex = d;
@@ -722,7 +720,6 @@
           d--;
         }
         c--;
-        comparison = comp.compare(c, partitionIndex);
       }
       // now we also know that [d..end] contains partition values,
       // [c..d) contains values > partition value

Added: lucene/mahout/trunk/math/src/test/java/org/apache/mahout/math/AIOOBInSortingTest.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/math/src/test/java/org/apache/mahout/math/AIOOBInSortingTest.java?rev=902987&view=auto
==============================================================================
--- lucene/mahout/trunk/math/src/test/java/org/apache/mahout/math/AIOOBInSortingTest.java (added)
+++ lucene/mahout/trunk/math/src/test/java/org/apache/mahout/math/AIOOBInSortingTest.java Mon Jan 25 21:43:23 2010
@@ -0,0 +1,338 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.mahout.math;
+
+import junit.framework.TestCase;
+import org.apache.mahout.math.matrix.DoubleMatrix2D;
+import org.apache.mahout.math.matrix.doublealgo.Sorting;
+import org.apache.mahout.math.matrix.impl.DenseDoubleMatrix2D;
+
+/** Test AIOOB in Mahout's math/ sorting routine. */
+public class AIOOBInSortingTest extends TestCase {
+
+  public void testAIOOB() {
+    long[] aggregatesRaw = {
+        -4653677303358023929L, -4652521593406282998L, -4651888464814509066L,
+        -4649565542193114190L, -4649625288634280802L, -4651542609702536890L,
+        -4651640379858770913L, -4651380896287327464L, -4650845453591639427L,
+        -4653583309026063583L, -4650340648747231910L, -4651578977156250200L,
+        -4651434909568155306L, -4650892643516977490L, -4651445038568133067L,
+        -4651399498848619877L, -4650156494728982284L, -4651860022572378568L,
+        -4652004132747119274L, -4650479555509048628L, -4650983271696143162L,
+    };
+
+    double[] aggregates = new double[aggregatesRaw.length];
+    for (int i = 0; i < aggregatesRaw.length; i++) {
+      aggregates[i] = Double.longBitsToDouble(aggregatesRaw[i]);
+    }
+
+    DoubleMatrix2D VT = new DenseDoubleMatrix2D(convert(new long[][]{
+        {4540286548932058396L, 4577864022762482570L, 4577700324701750780L, 4518480992251412349L, 4556435725689022825L,
+            4488720014619835766L, 4335660689431780693L, 4502946434618942000L, 4531841594141675072L,
+            4445484354574431038L, 4494181495103148132L, 4238500868784003636L, 4410983210480467520L,
+            4378527886946299824L, 4535843255558462101L, 4533033844134633147L, 4588065853673790470L,
+            4529714837625705005L, 4545016130375436933L, 4534987086323522839L, 4499740291369705403L,
+            4552521302356171410L, 4420932108603440081L, 4499440942028939161L, 4506564450629286049L,
+            4273008274354105958L, 4230993913782178552L, 4408674585652018514L, 4548031002500699696L,
+            4459523178201275405L, 4498018934676107144L, 4533564326567152468L, 4529072710372372321L,
+            4266145894238049074L, 4449165552240069860L, 4500218503731970720L, 4369279742283992199L,
+            4552052497891782008L, 4466019516307946574L, 4547167378645234324L, 4546111965404587842L,
+            4261849344178848741L, 4366506595545073636L, 3582309649050492732L, 4494625668207267848L,
+            4531126463289100468L, 4414316086357016751L, 4273398692058043292L, 4512662863128745104L,
+            4263988344629815127L,},
+        {4574131373098442804L, 4548083290586476046L, 4517925388637994283L, 4422663977205042996L, 4558433400263698698L,
+            4438407999222956729L, 4123443255299065032L, 4500988725457913835L, 4582345891918070532L,
+            4464796946625544923L, 4499829560191553726L, 4562727593430338068L, 4413890151366000182L,
+            4222892415371889079L, 4552126941182120440L, 4557145468379105388L, 3369478042602262599L,
+            4528641710262882948L, 4520094616897258583L, 4587960228776445876L, 4504956922871912008L,
+            4554910473774114184L, 4122289732537420549L, 4548271868497785509L, 4527449748122183324L,
+            3917034030832229253L, 3944929832460030523L, 4135929295337910475L, 4549563679008854769L,
+            4499174285602795138L, 4232236232035200789L, 4545660460162751699L, 4415575448192013501L,
+            4356320193361748196L, 4129082417332671312L, 4209550548628539185L, 4047864374710002060L,
+            4555176298156929884L, 4196602214965775443L, 4500130008039334895L, 4361364187890577600L,
+            4059279625007643065L, 4092300789634539137L, 4562761207806070287L, 4571179299138328178L,
+            4580182351506864407L, 4414125652251686976L, 4099745780547193553L, 4058420426258719084L,
+            3993161750401426476L,},
+        {4503058436140626068L, 4587297505427717523L, 4585465123771846026L, 4547702637581193995L, 4555071848900864594L,
+            4571816073077359805L, 4557919752807534711L, 4508219215781016970L, 4546120836733587251L,
+            4447690529699238932L, 4234645959092570498L, 4166344905236642240L, 4413127920513194287L,
+            4578976983584953501L, 4524155813959837563L, 4462466304194224876L, 4539781585036547169L,
+            4503386627656564273L, 4531871187444237046L, 4414299069595942936L, 4576384992828042683L,
+            4493355189295467547L, 4576221227808075719L, 4545108913153818160L, 4456230762054091275L,
+            4327112383081407641L, 3980483255052640142L, 4245535983573409712L, 4547498783905977312L,
+            4567374665852373777L, 4343203403250557056L, 4568525785172270124L, 4491763132030345847L,
+            4201575374974572074L, 4219019256706497516L, 4348317574440849306L, 4148281995200283751L,
+            4514136212163500272L, 4155029473447930762L, 4517343845869182034L, 4389352638378279597L,
+            4313504515554346645L, 4202370674715012364L, 3665164351933039439L, 4493583757829542094L,
+            4447223592377873634L, 4413819907408794729L, 4286431978844548575L, 4568804434027945423L,
+            4287455298280000018L,},
+        {4394299736546908498L, 4543451006735029787L, 4513005906063991230L, 4448720978249675866L, 4327931554265907819L,
+            4234179027658546790L, 4554259167768377832L, 4422747079664052795L, 4369580811764671622L,
+            4453241966939810910L, 4314710488909239895L, 4344641065159561405L, 4412092093105856279L,
+            4576563438007057092L, 4347269577928139708L, 4405646499932296505L, 3909406798489399351L,
+            4553432904103966287L, 4347731768724745159L, 4559373239048421556L, 4333196835825876213L,
+            4378633734557262527L, 4586465925652127717L, 4380827496437721898L, 4563214175839364084L,
+            4586768577799693780L, 4445212741718023342L, 4491368508772876434L, 4486277717178902814L,
+            4313864254808437143L, 4436666521674546894L, 4309389075571134797L, 4470888893327048122L,
+            4414469896759850446L, 4558787271673099419L, 4449578979953039951L, 4543076454786560674L,
+            4562280581152378329L, 4130710923751467252L, 4390391513646588597L, 4248804920626256146L,
+            4283348163508856162L, 4483797472636929803L, 3790001250155045037L, 4586763917479746207L,
+            4375401625673071992L, 4412178065347814049L, 4269595394533488545L, 4550830877320386359L,
+            4410268924479666181L,},
+        {4566079318159634087L, 4298538040316725909L, 4562596802585696010L, 4399299182170535734L, 4566978818645632579L,
+            4439132619926591397L, 4460349354065570172L, 4268200411038619092L, 4392883879394524873L,
+            4522895671762965845L, 4545841573755367635L, 4331513007475749275L, 4414963896211573386L,
+            4217107304115572976L, 4488041986916914804L, 4434737360937702458L, 3263497222580926911L,
+            4509074688034147512L, 4503664466602012897L, 4555589512544252175L, 4289186217641451679L,
+            4571779304188588164L, 4409673196823006253L, 4236062506498874708L, 4541294735447749468L,
+            4526677950422897065L, 4510999648473538504L, 4481161097830064314L, 4551456688224159103L,
+            4465785134487236089L, 4546326976380752073L, 4567961960407975875L, 4588244041522394564L,
+            4547003209130394014L, 4477649123137610350L, 4546706179101075236L, 4441709976902834647L,
+            4339652418888080198L, 4482515802458478512L, 4588012442751262773L, 4567790157577760837L,
+            4481600601395080441L, 4432830098030241635L, 4119022392722885902L, 4446132377194009309L,
+            4401311663266272774L, 4413266109120291430L, 4490207497646968282L, 4508673111550392108L,
+            4333802025649075609L,},
+        {4542400841461942984L, 4542482600353739298L, 4563659033801039606L, 4548828794794777775L, 4585816264594163423L,
+            4427116154982682652L, 4542187437461722624L, 4508402765998404882L, 4544889643534341244L,
+            4464496497659501429L, 4555477222742068679L, 4557182364465489454L, 4409243890969930876L,
+            4566115018263957908L, 4541314117757298868L, 4497293536818223485L, 4122550046452362820L,
+            4582639707025954758L, 4442092119065769139L, 4492027923117880398L, 4560849089991614652L,
+            4502942802421588282L, 4536327927745126623L, 4561999962488932977L, 4586122435009920200L,
+            4052031191080724671L, 4100949924561893973L, 4311173560786140947L, 4469393929773059270L,
+            4458790592496125776L, 4412699664291299506L, 4548535769444297171L, 4212443827075422957L,
+            4184593043439587969L, 4308570126337361944L, 4415129935323342887L, 4175465618369740418L,
+            4490662380988440168L, 4115760113290638203L, 4553498362766184834L, 4531220739683882675L,
+            4053518068670958707L, 4284025013725488741L, 4557210021184461279L, 4519336574283253540L,
+            4122886507808260945L, 4412193149213608939L, 4111086309452707116L, 4582988496155048417L,
+            4122678110415450801L,},
+        {4482946440088347206L, 4546661854297548261L, 4570707669024544125L, 4573766023719150565L, 4566825589275214693L,
+            4388426809297769886L, 4409992850321552679L, 4576021704537160032L, 4578619774984170434L,
+            4436362430563762481L, 4502736023603261331L, 4295993515129416752L, 4411532258020826648L,
+            4237371271083195939L, 4574120685052608015L, 4540700885604215878L, 3385136405884397314L,
+            4539289597829540330L, 4554156238039383388L, 4567207639989122260L, 4547214102492692601L,
+            4582664183421365130L, 4564510260273395949L, 4293334899806254801L, 4508849036126264927L,
+            4323633051300574255L, 4128080710749435540L, 4395736237500275578L, 4554398585324401516L,
+            4532075707678063100L, 4491200649238705111L, 4498635240363308569L, 4493725768567329228L,
+            4420074666052487641L, 4403142993826983203L, 4476914770048692568L, 4342351202510219578L,
+            4587124273344965132L, 4413011409256982715L, 4524624442180929847L, 4536232204989733201L,
+            4240017163373645065L, 4373637453669068879L, 3823626076287367080L, 4355540761315700130L,
+            4585021673155759309L, 4412129587616895660L, 4250183378578880520L, 4489834746686769416L,
+            4298955477804520359L,},
+        {4541707107635174884L, 4442045019925529186L, 4440656418846644599L, 4317922919107270115L, 4490113359759542575L,
+            4343467363254748401L, 4552994458252028993L, 4498267694562732404L, 4380547348293507342L,
+            4546883676767528544L, 4540469170536212617L, 4434937621816627195L, 4412407270960447809L,
+            4567451811614662612L, 4463845141970746824L, 4494714218339689803L, 3303675392876501215L,
+            4394677965942823313L, 4449966458014775570L, 4517137279417018047L, 4266290766514952640L,
+            4541453148184347999L, 4544564616090128114L, 4463868088403875966L, 4553745405310745534L,
+            4357771135269961077L, 4462082022829334964L, 4509092995807254622L, 4500410767550369157L,
+            4356527414166389923L, 4553282723349121247L, 4525576947894225357L, 4452912911963007330L,
+            4533884403627087566L, 4526263075835833341L, 4553242105390124009L, 4518545671792132082L,
+            4444919571203436826L, 4345320225261095429L, 4536909512237207052L, 4540108056471195872L,
+            4587088476245882936L, 4497115948242447289L, 4174293144932485339L, 4550918358101841571L,
+            4539166428119943885L, 4408397487913241663L, 4587096821702353894L, 4531908456366568603L,
+            4536594726047112268L,},
+        {4584389392703618092L, 4311276238700518192L, 4488744191643480213L, 4447091464650802585L, 4576684273887400170L,
+            4487419640491843783L, 4465061895853210679L, 4494986930085627046L, 4256048403449087166L,
+            4559002046939969890L, 4535981785525331180L, 4586603355410563319L, 4410831941326900849L,
+            4477477282959578267L, 4458737009265726930L, 4459105678410445916L, 3430023961518709098L,
+            4369069726961638934L, 4475023034476027767L, 4406760681925086635L, 4316439719119862618L,
+            4506647234826921927L, 4513167579606465534L, 4426881799845313770L, 4576635611989934044L,
+            4522189827982031761L, 4514113114725037535L, 4503633182039754970L, 4546216663725728392L,
+            4491113848255003822L, 4550294287145221492L, 4509462250802613155L, 4508801708773063443L,
+            4496366597037550265L, 4532894578904884037L, 4550292902296991733L, 4508135825635582486L,
+            4374671590059044529L, 4459112390037467619L, 4527524905957075470L, 4496515268088300394L,
+            4448038393419448232L, 4470546143871668638L, 4586602405769349095L, 4475839999008180550L,
+            4362857934085555922L, 4405806878663823705L, 4459703104549303025L, 4346388425231024188L,
+            4404730509936527391L,},
+        {4581629353412621812L, 4530282514708144615L, 4568024892126546778L, 4517146622237572343L, 4562913710216937703L,
+            4537644111772666261L, 4024787000296905918L, 4548083935692472189L, 4564185633344364891L,
+            4585062169475770448L, 4586123668600973640L, 3837628308151794170L, 4410650366325681946L,
+            4495803901496529424L, 4554753876779261491L, 4477743056965065971L, 4528149799358534427L,
+            4463622210336549488L, 4535408246392433508L, 4499999025819380135L, 4530688765809421370L,
+            4508249558478728762L, 4395017919910851434L, 4513111294573675869L, 4487867884448691199L,
+            4179749108259917197L, 4567878454649598254L, 4523555966189610776L, 4556620378816534980L,
+            4536073813996852438L, 4275758020295657980L, 4553423408549769096L, 4098913668582230932L,
+            4547887373088971211L, 4243590662386715984L, 4278492869789797614L, 4127800362891412997L,
+            4524584317642686026L, 4046320979087488991L, 4535793930681568777L, 4496509741398975460L,
+            3930317740202314000L, 4501885758890378571L, 3235324551567240044L, 4118667974595614183L,
+            4075950042976010823L, 4411613719521554020L, 4176531746367242968L, 4510047429989659217L,
+            4061501109516121041L,},
+        {4501171530831735539L, 4553371883707053499L, 4564537870729353228L, 4567962418187001352L, 4562891724865983096L,
+            4559137233244606717L, 4557131773774925075L, 4567065676446539377L, 4561933040943430303L,
+            4572405753397767478L, 4561050554035101856L, 4512682022223304074L, 4414281960740197003L,
+            4437148812571794528L, 4543660385346309146L, 4571149670506109148L, 3797631108143496217L,
+            4558617882517688286L, 4561216434977775695L, 4568230299048378657L, 4557931304546506099L,
+            4571769244650332298L, 4555353148003406084L, 4524586135897670652L, 4511058942594804131L,
+            4558332318425416381L, 4564469117349421457L, 4568062664553075870L, 4564584576974528751L,
+            4562204357939375988L, 4587577659756442099L, 4569294938567708275L, 4542448090559020018L,
+            4563061212390996030L, 4575836688007611547L, 4587577647379932889L, 4568136186706968502L,
+            4563656474748370322L, 4557542865700524770L, 4540089075813257035L, 4512367494249063988L,
+            4474895970539093100L, 4559792341785424863L, 3144211126872693934L, 4554095587448528703L,
+            4569886691405155635L, 4413442699892458529L, 4478784976848729869L, 4562719822327661745L,
+            4574075617727860553L,},
+        {4531982557229930796L, 4478490888634674267L, 4461522978860163421L, 4504544597630101185L, 4529207629049060330L,
+            4421915982993450234L, 4441895374005391954L, 4549173169571251824L, 4472784099066350840L,
+            4577800344916915844L, 4359726797801881607L, 4514901900279934099L, 4407551400894322465L,
+            4526207090325385247L, 4502438185426031328L, 4514499730993984858L, 3464342402225193644L,
+            4514346332380358597L, 4513717476381668891L, 4540935832135125755L, 4424320855242636192L,
+            4535838020194199072L, 4531085459094752322L, 4478444807697804682L, 4540852536888225684L,
+            4477411046425529175L, 4451639616122187613L, 4586842888769483074L, 4520028838581452386L,
+            4429309631935676404L, 4519634539102802182L, 4500570321999473476L, 4474880562486378344L,
+            4550636450916810325L, 4533679460142651234L, 4521784851014132234L, 4530798537442720996L,
+            4514108976549863095L, 4393306012332556327L, 4505366399802718862L, 4415299743463638509L,
+            4380154561500787304L, 4586886618885425711L, 4379125476087623866L, 4485727676633218591L,
+            4542069406380087742L, 4412782597213905506L, 4397361091275459794L, 4452758755946462952L,
+            4499844906507145045L,},
+        {4533702485792115040L, 4518094065542621091L, 4571764954225236279L, 4487470830326989199L, 4568964827900941097L,
+            4549139978915774449L, 4465867581169513088L, 4561176881317239247L, 4565614373606308297L,
+            4545500966878440014L, 4544555686666174853L, 4289958579371382946L, 4411622383274920411L,
+            4393670072772687800L, 4528652620667874707L, 4230024768494024630L, 4070977453649047649L,
+            4585517149871795555L, 4588242681392037231L, 4565447875383774209L, 4494738149008785955L,
+            4516286944571545623L, 4338138969147428188L, 4279432690590946423L, 4524496792837958015L,
+            4316722807420493057L, 4224140873907671239L, 4467643905078561450L, 4566335055722373316L,
+            4457304093969781149L, 4512320646876540552L, 4521079144406750722L, 4256102011127146891L,
+            4410430980274033456L, 4450819004461190794L, 4513982626228832943L, 4450201864297955271L,
+            4492573841679173576L, 4433835499562305372L, 4526295838022397682L, 4246483771944266803L,
+            4211477248594450365L, 4465940320361775690L, 4135802580518607875L, 4563466151852068708L,
+            4237033403019237303L, 4412150251406705924L, 4256949376600098887L, 4571722727819988937L,
+            4415425799874210982L,},
+        {4432470638974582568L, 4501276904854622469L, 4568700325661331652L, 4571574760774660624L, 4503042441001962662L,
+            4559026498258368187L, 4227107035376766721L, 4514187785795633542L, 4575304819776512299L,
+            4503963991969586837L, 4128333376213577397L, 3990638117055705196L, 4409805202197041198L,
+            4038563782441092959L, 4586034819333523725L, 4586400003748738693L, 3344536729055565712L,
+            4565825493344603057L, 4528549708807323191L, 4577032734195445223L, 4571296498156536213L,
+            4419266834456370354L, 4285935872816611320L, 4560666879094248069L, 4169629858025105572L,
+            4400606658457968397L, 4163338517547806800L, 4338709623902183390L, 4535789550895515556L,
+            4582811473615697512L, 4373030525409003777L, 4583261288277892471L, 4194191982352671882L,
+            4400280238938069726L, 4195969209927319365L, 4370534462509207062L, 4102898980192819850L,
+            4562945021450935962L, 4320575007122025608L, 4520389197782066812L, 3977941215546918263L,
+            4028559647870351160L, 4347561110167879997L, 3092748144279728812L, 4540391520953556526L,
+            4197753329102807711L, 4403118171314491296L, 4405287595590208185L, 4546312089037756687L,
+            4147311427218886881L,},
+        {4561561311207885244L, 4567356594449849411L, 4578387053673942143L, 4518475867099879550L, 4560039519171303457L,
+            4473110253014046912L, 4430323265131867077L, 4264859225654326972L, 4577231475044734641L,
+            4523268894379815826L, 4438654742861032009L, 4224580970544012830L, 4413798062002683915L,
+            4268547083553043133L, 4578689961747668401L, 4576465980346334164L, 4201008610617219286L,
+            4502786999257585785L, 4539640249439222270L, 4522412232455268276L, 4573809382334907381L,
+            4567498612961288175L, 4329337207730831834L, 4586532904720285738L, 4536215552680166344L,
+            4445832578690262148L, 4188916948680096550L, 4501404663810196796L, 4586674948323472955L,
+            4501974820401982663L, 4511668092874255547L, 4535062919043835265L, 4549769240046737783L,
+            4234548112755723190L, 4336147144108232008L, 4513020437866931219L, 4248124126722648011L,
+            4566101902474575979L, 4458381385199123383L, 4551892010820326169L, 4560336123234691625L,
+            4302545910756969959L, 4472989112071883259L, 3800050777882461689L, 4355761295204079011L,
+            4334082758711266121L, 4413803153469755470L, 4449223717083181744L, 4512062832283327663L,
+            4251937032368257834L,},
+        {4512695382863510136L, 4242602632297891359L, 4569007481688034863L, 4459556104623968303L, 4557840251532052148L,
+            4586729878290316866L, 4222423642586579069L, 4083583156929034460L, 4258558069324806588L,
+            4404589749715042692L, 4572914038139376986L, 4080528278245413959L, 4411743521398475732L,
+            4237450909849083027L, 4502717455672872677L, 4213732390275201480L, 3445538854380774265L,
+            4469076198512434486L, 4563894695940557900L, 4350542381786726734L, 4451285254172407618L,
+            4573666831304012375L, 4362194101848832722L, 4050344510936860051L, 4571469683987101890L,
+            4417355753150219149L, 4400577912942850713L, 4486939022929939909L, 4548462757217485400L,
+            4583415721512360803L, 4386558834463682075L, 4581735042980283945L, 4472533830982157746L,
+            4071034647471155037L, 4330245593324160636L, 4381058104491814237L, 4223813065786951621L,
+            4401638585336699917L, 4376914998886685107L, 4568855089067108537L, 4578486184134254010L,
+            4074371310586743563L, 4484778897012875680L, 3744777639963509712L, 4273978453562291837L,
+            4389987437309374344L, 4410496926165409708L, 4092557819912135469L, 4584950031680572014L,
+            4104459348992860926L,},
+        {4537342828012097141L, 4461022475783974429L, 4441224772722433138L, 4524568938969811038L, 4343403705292366588L,
+            4264741250224516103L, 4587889192119347344L, 4527726728421150992L, 4521480907115526157L,
+            4548767195521252025L, 4346454596752979113L, 4414421413961660239L, 4414211014891922800L,
+            4580109188304097380L, 4510653230601282128L, 4526412460284114941L, 3732165210694927440L,
+            4352228774182645131L, 4515098443660930663L, 4432278092802726131L, 4400205057668212860L,
+            4367022164686805195L, 4551481807729137502L, 4429140251113340533L, 4567338796968716894L,
+            4285370712423237844L, 4435501708116614725L, 4405332017197158849L, 4497062235062771819L,
+            4386706847473054152L, 4437804810980016539L, 4356343486101746168L, 4467670266948748047L,
+            4525696555592926221L, 4382491473998808167L, 4445062201030577052L, 4399475887288573269L,
+            4500336373327227715L, 4587469547224326445L, 4398437779322693915L, 4136246771570921084L,
+            4151643833257037157L, 4462833921906409291L, 4296586567801288980L, 4559402506958833435L,
+            4532267862203208044L, 4415202382992013520L, 4182341929181338378L, 4426513512734691322L,
+            4472547498692362055L,},
+        {4569496226029980474L, 4475792409690985831L, 4563167264396675221L, 4458856659135754115L, 4576720360856341966L,
+            4381124394480900850L, 4530465480994540858L, 4279450277583801242L, 4488634583521974687L,
+            4445338921895021106L, 4577426512854767459L, 4548956871527973872L, 4411226535397671493L,
+            4575044674034981746L, 4413695799665751550L, 4236390368113545665L, 3435681908421971806L,
+            4462664917411466790L, 4522396627140829042L, 4509923344103057768L, 4469621484479550269L,
+            4585669899290587719L, 4513439028489963829L, 4226361395646257907L, 4576844046760605476L,
+            4374747288964587331L, 4265859156135583969L, 4369347277750119158L, 4567964637425606741L,
+            4366304331219962701L, 4421421994512717377L, 4578986067091715060L, 4544480809525123342L,
+            4210629481463136411L, 4209230988505777440L, 4449329797945041425L, 4565656076156234076L,
+            4487592907346225324L, 4225594924059633348L, 4571761673781728882L, 4586256683160733387L,
+            4183171661872432672L, 4355229317054114482L, 4549022135858962609L, 4545599824395088558L,
+            4503004819489635916L, 4412472790883889649L, 4189377908036353329L, 4538078436945202928L,
+            4581270130467746732L,},
+        {4056022642525637220L, 4557199259375217244L, 4567751530629950605L, 4586612325360827255L, 4572818377471476060L,
+            4040246382922215409L, 3984144410057482304L, 4572054874414935391L, 4577529001282669992L,
+            4105603729576856958L, 4476718288532821219L, 4158492567839878562L, 4411454874437762721L,
+            4249055491148005141L, 4563807211360661878L, 4504250963927517985L, 4352781105069289462L,
+            4573980887948854663L, 4555424588063469311L, 4181260700376595555L, 4585438278222848745L,
+            4501090721718790404L, 4157191817856536482L, 4547622038248087720L, 4405465837376012129L,
+            4216620472611056976L, 4582020483396812591L, 4422924633601329855L, 4545961911520206085L,
+            4572581807268218776L, 4234475464066930557L, 4532646985507291824L, 4076676402152680972L,
+            4461641425485770468L, 4155785147438531556L, 4245728945865869933L, 4086975923956446951L,
+            4569654706027748938L, 4124433299715659027L, 4172659905299256869L, 3999956722932934626L,
+            4562686084662241160L, 4444108360473312724L, 4116846337992712914L, 4277356419327920089L,
+            4123113735312993748L, 4406926207840295368L, 4546972813584907108L, 4393943535732272745L,
+            4126548956844431410L,},
+        {4355214441848502398L, 4535818291582356047L, 4540392088218780241L, 4538414366398279090L, 4384406189962448867L,
+            4514241948233952473L, 4402414786467540324L, 4537243417540874599L, 4545764117830066127L,
+            4471973784464806835L, 4377526913543803653L, 4355065106538832636L, 4412608681284325757L,
+            4528876735428674497L, 4546597434273616133L, 4550790130224272109L, 4235194451454399880L,
+            4456746974797895856L, 4524503420273030898L, 4521706268994294310L, 4530691946515357384L,
+            4378088599226960215L, 4332549491468426216L, 4551121097577448218L, 4356757765200272979L,
+            4221320478455480372L, 4482564228210156431L, 4468650160753980071L, 4503623391750853318L,
+            4509007354110236273L, 4478102418642020447L, 4449862191586461800L, 4428096817224710335L,
+            4424363766449649892L, 4586933262693631943L, 4478739600495160850L, 4587790549508209571L,
+            4540378774578944340L, 4373189809843762915L, 4354860400240035874L, 4231106017997625724L,
+            4415851691775417834L, 4445265869662460494L, 3401536657436784002L, 4571863918462231068L,
+            4469329553277113931L, 4395696080334130101L, 4393153667230108145L, 4423582848560372531L,
+            4581295954132900010L,},
+        {4580368719727814082L, 4526828888775273373L, 4499738489730519711L, 4561300851923493804L, 4552311797118114233L,
+            4306862572689969718L, 4148504466747103758L, 4586468522198347792L, 4539619500691826505L,
+            4581952658413868777L, 4482605146936025736L, 4074644227458569031L, 4411301173197727948L,
+            4369760367985332614L, 4551067636288570634L, 4325763325519125872L, 3289390778209725598L,
+            4485941642793371496L, 4521357843608512566L, 4384230161177594115L, 4519603757794804380L,
+            4544741893193819367L, 4215640297242016933L, 4215861737564451929L, 4523879045607205862L,
+            4377271648229149775L, 4344698585865458065L, 4139614907849283326L, 4541936784244839745L,
+            4225551564708469911L, 4400388262708052897L, 4528380912447608311L, 4557121804854050420L,
+            4587096980140877555L, 4482406213229999034L, 4397155703466590292L, 4446101197965399158L,
+            4499645170326456160L, 4114678127583573388L, 4554476968497040212L, 4547884521070128729L,
+            4197436656154181681L, 4144285071369572517L, 3931469111674333115L, 4368236843420328333L,
+            4518703469189729273L, 4414736894284442799L, 4093931761820053039L, 4436453976031684638L,
+            4329758610073816904L,},
+    }));
+
+    Sorting.quickSort.sort(VT, aggregates);
+  }
+
+  /**
+   * Convert from raw representation to doubles.
+   */
+  private static double[][] convert(long[][] l) {
+    double[][] d = new double[l.length][];
+
+    for (int i = 0; i < d.length; i++) {
+      d[i] = new double[l[i].length];
+      for (int j = 0; j < d[i].length; j++) {
+        d[i][j] = Double.longBitsToDouble(l[i][j]);
+      }
+    }
+
+    return d;
+  }
+}