mahout-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sro...@apache.org
Subject svn commit: r812288 - in /lucene/mahout/trunk: core/src/main/java/org/apache/mahout/cf/taste/hadoop/ core/src/main/java/org/apache/mahout/cf/taste/impl/common/ core/src/main/java/org/apache/mahout/cf/taste/impl/eval/ core/src/main/java/org/apache/mahou...
Date Mon, 07 Sep 2009 22:03:20 GMT
Author: srowen
Date: Mon Sep  7 22:03:18 2009
New Revision: 812288

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

Added:
    lucene/mahout/trunk/core/src/main/java/org/apache/mahout/common/LongPair.java
      - copied, changed from r811845, lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/LongPair.java
    lucene/mahout/trunk/core/src/main/java/org/apache/mahout/common/Pair.java
      - copied, changed from r811845, lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/Pair.java
    lucene/mahout/trunk/core/src/main/java/org/apache/mahout/common/RandomUtils.java
      - copied, changed from r811845, lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/RandomUtils.java
Removed:
    lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/LongPair.java
    lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/Pair.java
    lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/RandomUtils.java
Modified:
    lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/ItemItemWritable.java
    lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/FastByIDMap.java
    lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/FastIDSet.java
    lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/FastMap.java
    lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/PermutingIterator.java
    lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/SamplingIterator.java
    lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/SamplingLongPrimitiveIterator.java
    lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/eval/AbstractDifferenceRecommenderEvaluator.java
    lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/eval/GenericRecommenderIRStatsEvaluator.java
    lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/CachingRecommender.java
    lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/GenericItemBasedRecommender.java
    lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/GenericRecommendedItem.java
    lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/GenericUserBasedRecommender.java
    lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/NullRescorer.java
    lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/SimilarUser.java
    lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/TreeClusteringRecommender.java
    lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/TreeClusteringRecommender2.java
    lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/knn/KnnItemBasedRecommender.java
    lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/svd/ExpectationMaximizationSVD.java
    lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/svd/SVDRecommender.java
    lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/similarity/CachingItemSimilarity.java
    lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/similarity/CachingUserSimilarity.java
    lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/similarity/GenericItemSimilarity.java
    lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/similarity/GenericUserSimilarity.java
    lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/recommender/ItemBasedRecommender.java
    lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/recommender/UserBasedRecommender.java
    lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/dirichlet/UncommonDistributions.java
    lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/kmeans/RandomSeedGenerator.java
    lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/lda/LDADriver.java
    lucene/mahout/trunk/core/src/main/java/org/apache/mahout/utils/cache/LFUCache.java
    lucene/mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/impl/LoadTest.java
    lucene/mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/impl/TasteTestCase.java
    lucene/mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/impl/common/FastIDSetTest.java
    lucene/mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/impl/common/FastMapTest.java
    lucene/mahout/trunk/core/src/test/java/org/apache/mahout/clustering/dirichlet/TestDirichletClustering.java
    lucene/mahout/trunk/core/src/test/java/org/apache/mahout/clustering/dirichlet/TestDistributions.java
    lucene/mahout/trunk/core/src/test/java/org/apache/mahout/clustering/dirichlet/TestMapReduce.java
    lucene/mahout/trunk/core/src/test/java/org/apache/mahout/clustering/lda/TestLDAInference.java
    lucene/mahout/trunk/core/src/test/java/org/apache/mahout/clustering/lda/TestMapReduce.java
    lucene/mahout/trunk/core/src/test/java/org/apache/mahout/ga/watchmaker/STFitnessEvaluatorTest.java
    lucene/mahout/trunk/core/src/test/java/org/apache/mahout/ga/watchmaker/utils/DummyEvaluator.java
    lucene/mahout/trunk/core/src/test/java/org/apache/mahout/matrix/VectorTest.java
    lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/canopy/DisplayCanopy.java
    lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/dirichlet/Display2dASNDirichlet.java
    lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/dirichlet/DisplayASNDirichlet.java
    lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/dirichlet/DisplayASNOutputState.java
    lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/dirichlet/DisplayDirichlet.java
    lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/dirichlet/DisplayNDirichlet.java
    lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/dirichlet/DisplayOutputState.java
    lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/dirichlet/DisplaySNDirichlet.java
    lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/fuzzykmeans/DisplayFuzzyKMeans.java
    lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/kmeans/DisplayKMeans.java
    lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/meanshift/DisplayMeanShift.java
    lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/cd/CDGA.java
    lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/travellingsalesman/EvolutionaryTravellingSalesman.java
    lucene/mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/CDCrossoverTest.java
    lucene/mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/CDFitnessTest.java
    lucene/mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/CDMutationTest.java
    lucene/mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/CDRuleTest.java
    lucene/mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/hadoop/CDMahoutEvaluatorTest.java
    lucene/mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/hadoop/CDReducerTest.java
    lucene/mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/hadoop/DatasetSplitTest.java
    lucene/mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/tool/CDInfosToolTest.java
    lucene/mahout/trunk/utils/src/test/java/org/apache/mahout/utils/vectors/RandomVectorIterable.java

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/ItemItemWritable.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/ItemItemWritable.java?rev=812288&r1=812287&r2=812288&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/ItemItemWritable.java (original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/hadoop/ItemItemWritable.java Mon Sep  7 22:03:18 2009
@@ -18,7 +18,7 @@
 package org.apache.mahout.cf.taste.hadoop;
 
 import org.apache.hadoop.io.WritableComparable;
-import org.apache.mahout.cf.taste.impl.common.RandomUtils;
+import org.apache.mahout.common.RandomUtils;
 
 import java.io.DataInput;
 import java.io.DataOutput;

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/FastByIDMap.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/FastByIDMap.java?rev=812288&r1=812287&r2=812288&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/FastByIDMap.java (original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/FastByIDMap.java Mon Sep  7 22:03:18 2009
@@ -17,6 +17,8 @@
 
 package org.apache.mahout.cf.taste.impl.common;
 
+import org.apache.mahout.common.RandomUtils;
+
 import java.io.Serializable;
 import java.util.AbstractSet;
 import java.util.Arrays;

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/FastIDSet.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/FastIDSet.java?rev=812288&r1=812287&r2=812288&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/FastIDSet.java (original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/FastIDSet.java Mon Sep  7 22:03:18 2009
@@ -17,6 +17,8 @@
 
 package org.apache.mahout.cf.taste.impl.common;
 
+import org.apache.mahout.common.RandomUtils;
+
 import java.io.Serializable;
 import java.util.Arrays;
 import java.util.Iterator;

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/FastMap.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/FastMap.java?rev=812288&r1=812287&r2=812288&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/FastMap.java (original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/FastMap.java Mon Sep  7 22:03:18 2009
@@ -17,6 +17,8 @@
 
 package org.apache.mahout.cf.taste.impl.common;
 
+import org.apache.mahout.common.RandomUtils;
+
 import java.io.Serializable;
 import java.util.AbstractCollection;
 import java.util.AbstractSet;

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/PermutingIterator.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/PermutingIterator.java?rev=812288&r1=812287&r2=812288&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/PermutingIterator.java (original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/PermutingIterator.java Mon Sep  7 22:03:18 2009
@@ -17,6 +17,8 @@
 
 package org.apache.mahout.cf.taste.impl.common;
 
+import org.apache.mahout.common.RandomUtils;
+
 import java.util.Iterator;
 import java.util.NoSuchElementException;
 import java.util.Random;

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/SamplingIterator.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/SamplingIterator.java?rev=812288&r1=812287&r2=812288&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/SamplingIterator.java (original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/SamplingIterator.java Mon Sep  7 22:03:18 2009
@@ -17,6 +17,8 @@
 
 package org.apache.mahout.cf.taste.impl.common;
 
+import org.apache.mahout.common.RandomUtils;
+
 import java.util.Iterator;
 import java.util.NoSuchElementException;
 import java.util.Random;

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/SamplingLongPrimitiveIterator.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/SamplingLongPrimitiveIterator.java?rev=812288&r1=812287&r2=812288&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/SamplingLongPrimitiveIterator.java (original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/SamplingLongPrimitiveIterator.java Mon Sep  7 22:03:18 2009
@@ -17,6 +17,8 @@
 
 package org.apache.mahout.cf.taste.impl.common;
 
+import org.apache.mahout.common.RandomUtils;
+
 import java.util.Iterator;
 import java.util.NoSuchElementException;
 import java.util.Random;

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/eval/AbstractDifferenceRecommenderEvaluator.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/eval/AbstractDifferenceRecommenderEvaluator.java?rev=812288&r1=812287&r2=812288&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/eval/AbstractDifferenceRecommenderEvaluator.java (original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/eval/AbstractDifferenceRecommenderEvaluator.java Mon Sep  7 22:03:18 2009
@@ -23,7 +23,7 @@
 import org.apache.mahout.cf.taste.eval.RecommenderEvaluator;
 import org.apache.mahout.cf.taste.impl.common.FastByIDMap;
 import org.apache.mahout.cf.taste.impl.common.LongPrimitiveIterator;
-import org.apache.mahout.cf.taste.impl.common.RandomUtils;
+import org.apache.mahout.common.RandomUtils;
 import org.apache.mahout.cf.taste.impl.model.GenericDataModel;
 import org.apache.mahout.cf.taste.impl.model.GenericPreference;
 import org.apache.mahout.cf.taste.impl.model.GenericUserPreferenceArray;

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/eval/GenericRecommenderIRStatsEvaluator.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/eval/GenericRecommenderIRStatsEvaluator.java?rev=812288&r1=812287&r2=812288&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/eval/GenericRecommenderIRStatsEvaluator.java (original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/eval/GenericRecommenderIRStatsEvaluator.java Mon Sep  7 22:03:18 2009
@@ -28,7 +28,7 @@
 import org.apache.mahout.cf.taste.impl.common.FullRunningAverage;
 import org.apache.mahout.cf.taste.impl.common.FullRunningAverageAndStdDev;
 import org.apache.mahout.cf.taste.impl.common.LongPrimitiveIterator;
-import org.apache.mahout.cf.taste.impl.common.RandomUtils;
+import org.apache.mahout.common.RandomUtils;
 import org.apache.mahout.cf.taste.impl.common.RunningAverage;
 import org.apache.mahout.cf.taste.impl.common.RunningAverageAndStdDev;
 import org.apache.mahout.cf.taste.impl.model.GenericDataModel;

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/CachingRecommender.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/CachingRecommender.java?rev=812288&r1=812287&r2=812288&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/CachingRecommender.java (original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/CachingRecommender.java Mon Sep  7 22:03:18 2009
@@ -20,7 +20,7 @@
 import org.apache.mahout.cf.taste.common.Refreshable;
 import org.apache.mahout.cf.taste.common.TasteException;
 import org.apache.mahout.cf.taste.impl.common.Cache;
-import org.apache.mahout.cf.taste.impl.common.LongPair;
+import org.apache.mahout.common.LongPair;
 import org.apache.mahout.cf.taste.impl.common.RefreshHelper;
 import org.apache.mahout.cf.taste.impl.common.Retriever;
 import org.apache.mahout.cf.taste.model.DataModel;

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/GenericItemBasedRecommender.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/GenericItemBasedRecommender.java?rev=812288&r1=812287&r2=812288&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/GenericItemBasedRecommender.java (original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/GenericItemBasedRecommender.java Mon Sep  7 22:03:18 2009
@@ -21,7 +21,7 @@
 import org.apache.mahout.cf.taste.common.TasteException;
 import org.apache.mahout.cf.taste.impl.common.FastIDSet;
 import org.apache.mahout.cf.taste.impl.common.FullRunningAverage;
-import org.apache.mahout.cf.taste.impl.common.LongPair;
+import org.apache.mahout.common.LongPair;
 import org.apache.mahout.cf.taste.impl.common.LongPrimitiveIterator;
 import org.apache.mahout.cf.taste.impl.common.RefreshHelper;
 import org.apache.mahout.cf.taste.impl.common.RunningAverage;

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/GenericRecommendedItem.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/GenericRecommendedItem.java?rev=812288&r1=812287&r2=812288&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/GenericRecommendedItem.java (original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/GenericRecommendedItem.java Mon Sep  7 22:03:18 2009
@@ -17,7 +17,7 @@
 
 package org.apache.mahout.cf.taste.impl.recommender;
 
-import org.apache.mahout.cf.taste.impl.common.RandomUtils;
+import org.apache.mahout.common.RandomUtils;
 import org.apache.mahout.cf.taste.recommender.RecommendedItem;
 
 import java.io.Serializable;

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/GenericUserBasedRecommender.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/GenericUserBasedRecommender.java?rev=812288&r1=812287&r2=812288&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/GenericUserBasedRecommender.java (original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/GenericUserBasedRecommender.java Mon Sep  7 22:03:18 2009
@@ -20,7 +20,7 @@
 import org.apache.mahout.cf.taste.common.Refreshable;
 import org.apache.mahout.cf.taste.common.TasteException;
 import org.apache.mahout.cf.taste.impl.common.FastIDSet;
-import org.apache.mahout.cf.taste.impl.common.LongPair;
+import org.apache.mahout.common.LongPair;
 import org.apache.mahout.cf.taste.impl.common.RefreshHelper;
 import org.apache.mahout.cf.taste.model.DataModel;
 import org.apache.mahout.cf.taste.model.PreferenceArray;

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/NullRescorer.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/NullRescorer.java?rev=812288&r1=812287&r2=812288&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/NullRescorer.java (original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/NullRescorer.java Mon Sep  7 22:03:18 2009
@@ -17,7 +17,7 @@
 
 package org.apache.mahout.cf.taste.impl.recommender;
 
-import org.apache.mahout.cf.taste.impl.common.LongPair;
+import org.apache.mahout.common.LongPair;
 import org.apache.mahout.cf.taste.recommender.Rescorer;
 
 /** <p>A simple {@link Rescorer} which always returns the original score.</p> */

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/SimilarUser.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/SimilarUser.java?rev=812288&r1=812287&r2=812288&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/SimilarUser.java (original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/SimilarUser.java Mon Sep  7 22:03:18 2009
@@ -17,7 +17,7 @@
 
 package org.apache.mahout.cf.taste.impl.recommender;
 
-import org.apache.mahout.cf.taste.impl.common.RandomUtils;
+import org.apache.mahout.common.RandomUtils;
 
 /** Simply encapsulates a user and a similarity value. */
 public final class SimilarUser implements Comparable<SimilarUser> {

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/TreeClusteringRecommender.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/TreeClusteringRecommender.java?rev=812288&r1=812287&r2=812288&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/TreeClusteringRecommender.java (original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/TreeClusteringRecommender.java Mon Sep  7 22:03:18 2009
@@ -23,8 +23,8 @@
 import org.apache.mahout.cf.taste.impl.common.FastIDSet;
 import org.apache.mahout.cf.taste.impl.common.FullRunningAverage;
 import org.apache.mahout.cf.taste.impl.common.LongPrimitiveIterator;
-import org.apache.mahout.cf.taste.impl.common.Pair;
-import org.apache.mahout.cf.taste.impl.common.RandomUtils;
+import org.apache.mahout.common.Pair;
+import org.apache.mahout.common.RandomUtils;
 import org.apache.mahout.cf.taste.impl.common.RefreshHelper;
 import org.apache.mahout.cf.taste.impl.common.RunningAverage;
 import org.apache.mahout.cf.taste.model.DataModel;

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/TreeClusteringRecommender2.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/TreeClusteringRecommender2.java?rev=812288&r1=812287&r2=812288&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/TreeClusteringRecommender2.java (original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/TreeClusteringRecommender2.java Mon Sep  7 22:03:18 2009
@@ -23,7 +23,7 @@
 import org.apache.mahout.cf.taste.impl.common.FastIDSet;
 import org.apache.mahout.cf.taste.impl.common.FullRunningAverage;
 import org.apache.mahout.cf.taste.impl.common.LongPrimitiveIterator;
-import org.apache.mahout.cf.taste.impl.common.RandomUtils;
+import org.apache.mahout.common.RandomUtils;
 import org.apache.mahout.cf.taste.impl.common.RefreshHelper;
 import org.apache.mahout.cf.taste.impl.common.RunningAverage;
 import org.apache.mahout.cf.taste.model.DataModel;

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/knn/KnnItemBasedRecommender.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/knn/KnnItemBasedRecommender.java?rev=812288&r1=812287&r2=812288&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/knn/KnnItemBasedRecommender.java (original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/knn/KnnItemBasedRecommender.java Mon Sep  7 22:03:18 2009
@@ -19,7 +19,7 @@
 
 import org.apache.mahout.cf.taste.common.TasteException;
 import org.apache.mahout.cf.taste.impl.common.FastIDSet;
-import org.apache.mahout.cf.taste.impl.common.LongPair;
+import org.apache.mahout.common.LongPair;
 import org.apache.mahout.cf.taste.impl.common.LongPrimitiveIterator;
 import org.apache.mahout.cf.taste.impl.recommender.GenericItemBasedRecommender;
 import org.apache.mahout.cf.taste.impl.recommender.TopItems;

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/svd/ExpectationMaximizationSVD.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/svd/ExpectationMaximizationSVD.java?rev=812288&r1=812287&r2=812288&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/svd/ExpectationMaximizationSVD.java (original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/svd/ExpectationMaximizationSVD.java Mon Sep  7 22:03:18 2009
@@ -17,7 +17,7 @@
 
 package org.apache.mahout.cf.taste.impl.recommender.svd;
 
-import org.apache.mahout.cf.taste.impl.common.RandomUtils;
+import org.apache.mahout.common.RandomUtils;
 
 import java.util.Random;
 

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/svd/SVDRecommender.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/svd/SVDRecommender.java?rev=812288&r1=812287&r2=812288&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/svd/SVDRecommender.java (original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/recommender/svd/SVDRecommender.java Mon Sep  7 22:03:18 2009
@@ -25,7 +25,7 @@
 import org.apache.mahout.cf.taste.impl.common.FastIDSet;
 import org.apache.mahout.cf.taste.impl.common.FullRunningAverage;
 import org.apache.mahout.cf.taste.impl.common.LongPrimitiveIterator;
-import org.apache.mahout.cf.taste.impl.common.RandomUtils;
+import org.apache.mahout.common.RandomUtils;
 import org.apache.mahout.cf.taste.impl.common.RefreshHelper;
 import org.apache.mahout.cf.taste.impl.common.RunningAverage;
 import org.apache.mahout.cf.taste.impl.recommender.AbstractRecommender;

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/similarity/CachingItemSimilarity.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/similarity/CachingItemSimilarity.java?rev=812288&r1=812287&r2=812288&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/similarity/CachingItemSimilarity.java (original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/similarity/CachingItemSimilarity.java Mon Sep  7 22:03:18 2009
@@ -20,7 +20,7 @@
 import org.apache.mahout.cf.taste.common.Refreshable;
 import org.apache.mahout.cf.taste.common.TasteException;
 import org.apache.mahout.cf.taste.impl.common.Cache;
-import org.apache.mahout.cf.taste.impl.common.LongPair;
+import org.apache.mahout.common.LongPair;
 import org.apache.mahout.cf.taste.impl.common.RefreshHelper;
 import org.apache.mahout.cf.taste.impl.common.Retriever;
 import org.apache.mahout.cf.taste.model.DataModel;

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/similarity/CachingUserSimilarity.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/similarity/CachingUserSimilarity.java?rev=812288&r1=812287&r2=812288&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/similarity/CachingUserSimilarity.java (original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/similarity/CachingUserSimilarity.java Mon Sep  7 22:03:18 2009
@@ -20,7 +20,7 @@
 import org.apache.mahout.cf.taste.common.Refreshable;
 import org.apache.mahout.cf.taste.common.TasteException;
 import org.apache.mahout.cf.taste.impl.common.Cache;
-import org.apache.mahout.cf.taste.impl.common.LongPair;
+import org.apache.mahout.common.LongPair;
 import org.apache.mahout.cf.taste.impl.common.RefreshHelper;
 import org.apache.mahout.cf.taste.impl.common.Retriever;
 import org.apache.mahout.cf.taste.model.DataModel;

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/similarity/GenericItemSimilarity.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/similarity/GenericItemSimilarity.java?rev=812288&r1=812287&r2=812288&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/similarity/GenericItemSimilarity.java (original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/similarity/GenericItemSimilarity.java Mon Sep  7 22:03:18 2009
@@ -22,7 +22,7 @@
 import org.apache.mahout.cf.taste.impl.common.FastByIDMap;
 import org.apache.mahout.cf.taste.impl.common.IteratorIterable;
 import org.apache.mahout.cf.taste.impl.common.IteratorUtils;
-import org.apache.mahout.cf.taste.impl.common.RandomUtils;
+import org.apache.mahout.common.RandomUtils;
 import org.apache.mahout.cf.taste.impl.recommender.TopItems;
 import org.apache.mahout.cf.taste.model.DataModel;
 import org.apache.mahout.cf.taste.similarity.ItemSimilarity;

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/similarity/GenericUserSimilarity.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/similarity/GenericUserSimilarity.java?rev=812288&r1=812287&r2=812288&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/similarity/GenericUserSimilarity.java (original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/similarity/GenericUserSimilarity.java Mon Sep  7 22:03:18 2009
@@ -22,7 +22,7 @@
 import org.apache.mahout.cf.taste.impl.common.FastByIDMap;
 import org.apache.mahout.cf.taste.impl.common.IteratorIterable;
 import org.apache.mahout.cf.taste.impl.common.IteratorUtils;
-import org.apache.mahout.cf.taste.impl.common.RandomUtils;
+import org.apache.mahout.common.RandomUtils;
 import org.apache.mahout.cf.taste.impl.recommender.TopItems;
 import org.apache.mahout.cf.taste.model.DataModel;
 import org.apache.mahout.cf.taste.similarity.PreferenceInferrer;

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/recommender/ItemBasedRecommender.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/recommender/ItemBasedRecommender.java?rev=812288&r1=812287&r2=812288&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/recommender/ItemBasedRecommender.java (original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/recommender/ItemBasedRecommender.java Mon Sep  7 22:03:18 2009
@@ -18,7 +18,7 @@
 package org.apache.mahout.cf.taste.recommender;
 
 import org.apache.mahout.cf.taste.common.TasteException;
-import org.apache.mahout.cf.taste.impl.common.LongPair;
+import org.apache.mahout.common.LongPair;
 
 import java.util.List;
 

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/recommender/UserBasedRecommender.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/recommender/UserBasedRecommender.java?rev=812288&r1=812287&r2=812288&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/recommender/UserBasedRecommender.java (original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/recommender/UserBasedRecommender.java Mon Sep  7 22:03:18 2009
@@ -17,7 +17,7 @@
 package org.apache.mahout.cf.taste.recommender;
 
 import org.apache.mahout.cf.taste.common.TasteException;
-import org.apache.mahout.cf.taste.impl.common.LongPair;
+import org.apache.mahout.common.LongPair;
 
 /** <p>Interface implemented by "user-based" recommenders.</p> */
 public interface UserBasedRecommender extends Recommender {

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/dirichlet/UncommonDistributions.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/dirichlet/UncommonDistributions.java?rev=812288&r1=812287&r2=812288&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/dirichlet/UncommonDistributions.java (original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/dirichlet/UncommonDistributions.java Mon Sep  7 22:03:18 2009
@@ -19,8 +19,8 @@
 
 import org.apache.mahout.matrix.DenseVector;
 import org.apache.mahout.matrix.Vector;
+import org.apache.mahout.common.RandomUtils;
 import org.uncommons.maths.random.GaussianGenerator;
-import org.uncommons.maths.random.MersenneTwisterRNG;
 
 import java.util.Random;
 
@@ -28,15 +28,11 @@
 
   private static final double sqrt2pi = Math.sqrt(2.0 * Math.PI);
 
-  private static Random random = new MersenneTwisterRNG();
+  private static final Random random = RandomUtils.getRandom();
 
   private UncommonDistributions() {
   }
 
-  public static void init(byte[] seed) {
-    random = new MersenneTwisterRNG(seed);
-  }
-
   //=============== start of BSD licensed code. See LICENSE.txt
   /**
    * Returns a double sampled according to this distribution.  Uniformly fast for all k > 0.  (Reference: Non-Uniform

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/kmeans/RandomSeedGenerator.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/kmeans/RandomSeedGenerator.java?rev=812288&r1=812287&r2=812288&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/kmeans/RandomSeedGenerator.java (original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/kmeans/RandomSeedGenerator.java Mon Sep  7 22:03:18 2009
@@ -24,6 +24,7 @@
 import org.apache.hadoop.io.Writable;
 import org.apache.hadoop.mapred.JobConf;
 import org.apache.mahout.matrix.Vector;
+import org.apache.mahout.common.RandomUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -68,7 +69,7 @@
       Writable key = (Writable) reader.getKeyClass().newInstance();
       Vector value = (Vector) reader.getValueClass().newInstance();
       SequenceFile.Writer writer = SequenceFile.createWriter(fs, conf, outFile, Text.class, Cluster.class);
-      Random random = new Random();
+      Random random = RandomUtils.getRandom();
 
       List<Text> chosenTexts = new ArrayList<Text>(k);
       List<Cluster> chosenClusters = new ArrayList<Cluster>(k);

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/lda/LDADriver.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/lda/LDADriver.java?rev=812288&r1=812287&r2=812288&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/lda/LDADriver.java (original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/lda/LDADriver.java Mon Sep  7 22:03:18 2009
@@ -42,6 +42,7 @@
 import org.apache.mahout.matrix.DenseMatrix;
 import org.apache.mahout.utils.CommandLineUtil;
 import org.apache.mahout.utils.HadoopUtil;
+import org.apache.mahout.common.RandomUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -215,7 +216,7 @@
     IntPairWritable kw = new IntPairWritable();
     DoubleWritable v = new DoubleWritable();
 
-    Random random = new Random();
+    Random random = RandomUtils.getRandom();
 
     for (int k = 0; k < numTopics; ++k) {
       Path path = new Path(dir, "part-" + k);

Copied: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/common/LongPair.java (from r811845, lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/LongPair.java)
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/common/LongPair.java?p2=lucene/mahout/trunk/core/src/main/java/org/apache/mahout/common/LongPair.java&p1=lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/LongPair.java&r1=811845&r2=812288&rev=812288&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/LongPair.java (original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/common/LongPair.java Mon Sep  7 22:03:18 2009
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.mahout.cf.taste.impl.common;
+package org.apache.mahout.common;
 
 import java.io.Serializable;
 
@@ -38,6 +38,10 @@
     return second;
   }
 
+  public LongPair swap() {
+    return new LongPair(second, first);
+  }
+
   @Override
   public boolean equals(Object obj) {
     if (!(obj instanceof LongPair)) {

Copied: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/common/Pair.java (from r811845, lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/Pair.java)
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/common/Pair.java?p2=lucene/mahout/trunk/core/src/main/java/org/apache/mahout/common/Pair.java&p1=lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/Pair.java&r1=811845&r2=812288&rev=812288&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/Pair.java (original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/common/Pair.java Mon Sep  7 22:03:18 2009
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package org.apache.mahout.cf.taste.impl.common;
+package org.apache.mahout.common;
 
 import java.io.Serializable;
 
@@ -38,6 +38,10 @@
     return second;
   }
 
+  public Pair<B, A> swap() {
+    return new Pair<B, A>(second, first);
+  }
+
   @Override
   public boolean equals(Object obj) {
     if (!(obj instanceof Pair)) {
@@ -45,7 +49,7 @@
     }
     Pair<?, ?> otherPair = (Pair<?, ?>) obj;
     return isEqualOrNulls(first, otherPair.first) &&
-        isEqualOrNulls(second, otherPair.second);
+           isEqualOrNulls(second, otherPair.second);
   }
 
   private static boolean isEqualOrNulls(Object obj1, Object obj2) {

Copied: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/common/RandomUtils.java (from r811845, lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/RandomUtils.java)
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/common/RandomUtils.java?p2=lucene/mahout/trunk/core/src/main/java/org/apache/mahout/common/RandomUtils.java&p1=lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/RandomUtils.java&r1=811845&r2=812288&rev=812288&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/common/RandomUtils.java (original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/common/RandomUtils.java Mon Sep  7 22:03:18 2009
@@ -15,9 +15,12 @@
  * limitations under the License.
  */
 
-package org.apache.mahout.cf.taste.impl.common;
+package org.apache.mahout.common;
+
+import org.uncommons.maths.random.MersenneTwisterRNG;
 
 import java.util.Random;
+import java.nio.charset.Charset;
 
 /**
  * <p>The source of random stuff for the whole project. This lets us make all randomness in the project predictable, if
@@ -27,7 +30,8 @@
  */
 public final class RandomUtils {
 
-  private static final long STANDARD_SEED = 0xCAFEBABECAFEBABEL;
+  private static final byte[] STANDARD_SEED = "Mahout=Hadoop+ML".getBytes(Charset.forName("US-ASCII"));
+
   private static boolean testSeed;
 
   /** The largest prime less than 2<sup>31</sup>-1 that is the smaller of a twin prime pair. */
@@ -41,7 +45,7 @@
   }
 
   public static Random getRandom() {
-    return testSeed ? new Random(STANDARD_SEED) : new Random();
+    return testSeed ? new MersenneTwisterRNG(STANDARD_SEED) : new MersenneTwisterRNG();
   }
 
   /** @return what {@link Double#hashCode()} would return for the same value */

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/utils/cache/LFUCache.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/utils/cache/LFUCache.java?rev=812288&r1=812287&r2=812288&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/utils/cache/LFUCache.java (original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/utils/cache/LFUCache.java Mon Sep  7 22:03:18 2009
@@ -25,16 +25,16 @@
 import java.util.Set;
 import java.util.SortedMap;
 import java.util.TreeMap;
+import java.util.concurrent.atomic.AtomicLong;
 
 import org.apache.mahout.common.Pair;
 import org.apache.mahout.utils.Cache;
 
-
 public class LFUCache<K, V> implements Cache<K, V> {
 
   SortedMap<Long, Set<K>> evictionMap = null;
 
-  Map<K, Pair<V, Long>> dataMap = null;
+  Map<K, Pair<V, AtomicLong>> dataMap = null;
 
   int capacity = 0;
 
@@ -45,7 +45,7 @@
     this.capacity = capacity;
 
     evictionMap = new TreeMap<Long, Set<K>>();
-    dataMap = new HashMap<K, Pair<V, Long>>(capacity);
+    dataMap = new HashMap<K, Pair<V, AtomicLong>>(capacity);
 
   }
 
@@ -60,28 +60,28 @@
 
   @Override
   public V get(K key) {
-    Pair<V,Long> data = dataMap.get(key);
+    Pair<V, AtomicLong> data = dataMap.get(key);
     if (data == null)
       return null;
     else {
-      V value = data.left();
-      long count = data.right();
-      data.setValue(Long.valueOf(count + 1));
-      incrementHit(key, Long.valueOf(count));
+      V value = data.getFirst();
+      AtomicLong count = data.getSecond();
+      long oldCount = count.getAndIncrement();
+      incrementHit(key, oldCount);
       return value;
     }
 
   }
   
   public V quickGet(K key){
-    Pair<V,Long> data = dataMap.get(key);
+    Pair<V, AtomicLong> data = dataMap.get(key);
     if (data == null)
       return null;
     else
-      return data.left();
+      return data.getFirst();
   }
 
-  private void incrementHit(K key, Long count) {
+  private void incrementHit(K key, long count) {
     Set<K> keys = evictionMap.get(count);
     if (keys == null)
       throw new ConcurrentModificationException();
@@ -89,7 +89,7 @@
       throw new ConcurrentModificationException();
     if (keys.isEmpty())
       evictionMap.remove(count);
-    count = Long.valueOf(count.longValue() + 1);
+    count++;
     Set<K> keysNew = evictionMap.get(count);
     if (keysNew == null) {
       keysNew = new LinkedHashSet<K>();
@@ -106,14 +106,15 @@
     {
       removeLeastFrequent();
     }
-    Long count = Long.valueOf(1);
-    Pair<V, Long> data = new Pair<V, Long>(value, count);
+    AtomicLong count = new AtomicLong(1L);
+    Pair<V, AtomicLong> data = new Pair<V, AtomicLong>(value, count);
     dataMap.put(key, data);
 
-    Set<K> keys = evictionMap.get(count);
+    Long countKey = 1L;
+    Set<K> keys = evictionMap.get(countKey);
     if (keys == null) {
       keys = new LinkedHashSet<K>();
-      evictionMap.put(count, keys);
+      evictionMap.put(countKey, keys);
     }
     keys.add(key);
 

Modified: lucene/mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/impl/LoadTest.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/impl/LoadTest.java?rev=812288&r1=812287&r2=812288&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/impl/LoadTest.java (original)
+++ lucene/mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/impl/LoadTest.java Mon Sep  7 22:03:18 2009
@@ -20,7 +20,7 @@
 import junit.textui.TestRunner;
 import org.apache.mahout.cf.taste.common.TasteException;
 import org.apache.mahout.cf.taste.impl.common.FastByIDMap;
-import org.apache.mahout.cf.taste.impl.common.RandomUtils;
+import org.apache.mahout.common.RandomUtils;
 import org.apache.mahout.cf.taste.impl.model.GenericDataModel;
 import org.apache.mahout.cf.taste.impl.model.GenericPreference;
 import org.apache.mahout.cf.taste.impl.model.GenericUserPreferenceArray;

Modified: lucene/mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/impl/TasteTestCase.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/impl/TasteTestCase.java?rev=812288&r1=812287&r2=812288&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/impl/TasteTestCase.java (original)
+++ lucene/mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/impl/TasteTestCase.java Mon Sep  7 22:03:18 2009
@@ -19,7 +19,7 @@
 
 import junit.framework.TestCase;
 import org.apache.mahout.cf.taste.impl.common.FastByIDMap;
-import org.apache.mahout.cf.taste.impl.common.RandomUtils;
+import org.apache.mahout.common.RandomUtils;
 import org.apache.mahout.cf.taste.impl.model.GenericDataModel;
 import org.apache.mahout.cf.taste.impl.model.GenericPreference;
 import org.apache.mahout.cf.taste.impl.model.GenericUserPreferenceArray;

Modified: lucene/mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/impl/common/FastIDSetTest.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/impl/common/FastIDSetTest.java?rev=812288&r1=812287&r2=812288&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/impl/common/FastIDSetTest.java (original)
+++ lucene/mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/impl/common/FastIDSetTest.java Mon Sep  7 22:03:18 2009
@@ -18,6 +18,7 @@
 package org.apache.mahout.cf.taste.impl.common;
 
 import org.apache.mahout.cf.taste.impl.TasteTestCase;
+import org.apache.mahout.common.RandomUtils;
 
 import java.util.Collection;
 import java.util.HashSet;

Modified: lucene/mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/impl/common/FastMapTest.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/impl/common/FastMapTest.java?rev=812288&r1=812287&r2=812288&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/impl/common/FastMapTest.java (original)
+++ lucene/mahout/trunk/core/src/test/java/org/apache/mahout/cf/taste/impl/common/FastMapTest.java Mon Sep  7 22:03:18 2009
@@ -18,6 +18,7 @@
 package org.apache.mahout.cf.taste.impl.common;
 
 import org.apache.mahout.cf.taste.impl.TasteTestCase;
+import org.apache.mahout.common.RandomUtils;
 
 import java.util.Collection;
 import java.util.HashMap;

Modified: lucene/mahout/trunk/core/src/test/java/org/apache/mahout/clustering/dirichlet/TestDirichletClustering.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/test/java/org/apache/mahout/clustering/dirichlet/TestDirichletClustering.java?rev=812288&r1=812287&r2=812288&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/test/java/org/apache/mahout/clustering/dirichlet/TestDirichletClustering.java (original)
+++ lucene/mahout/trunk/core/src/test/java/org/apache/mahout/clustering/dirichlet/TestDirichletClustering.java Mon Sep  7 22:03:18 2009
@@ -24,6 +24,7 @@
 import org.apache.mahout.clustering.dirichlet.models.SampledNormalDistribution;
 import org.apache.mahout.matrix.DenseVector;
 import org.apache.mahout.matrix.Vector;
+import org.apache.mahout.common.RandomUtils;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -35,7 +36,7 @@
   @Override
   protected void setUp() throws Exception {
     super.setUp();
-    UncommonDistributions.init("Mahout=Hadoop+ML".getBytes());
+    RandomUtils.useTestSeed();
     sampleData = new ArrayList<Vector>();
   }
 

Modified: lucene/mahout/trunk/core/src/test/java/org/apache/mahout/clustering/dirichlet/TestDistributions.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/test/java/org/apache/mahout/clustering/dirichlet/TestDistributions.java?rev=812288&r1=812287&r2=812288&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/test/java/org/apache/mahout/clustering/dirichlet/TestDistributions.java (original)
+++ lucene/mahout/trunk/core/src/test/java/org/apache/mahout/clustering/dirichlet/TestDistributions.java Mon Sep  7 22:03:18 2009
@@ -20,13 +20,14 @@
 import junit.framework.TestCase;
 import org.apache.mahout.matrix.DenseVector;
 import org.apache.mahout.matrix.Vector;
+import org.apache.mahout.common.RandomUtils;
 
 public class TestDistributions extends TestCase {
 
   @Override
   protected void setUp() throws Exception {
     super.setUp();
-    UncommonDistributions.init("Mahout=Hadoop+ML".getBytes());
+    RandomUtils.useTestSeed();    
   }
 
   public void testRbeta() {

Modified: lucene/mahout/trunk/core/src/test/java/org/apache/mahout/clustering/dirichlet/TestMapReduce.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/test/java/org/apache/mahout/clustering/dirichlet/TestMapReduce.java?rev=812288&r1=812287&r2=812288&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/test/java/org/apache/mahout/clustering/dirichlet/TestMapReduce.java (original)
+++ lucene/mahout/trunk/core/src/test/java/org/apache/mahout/clustering/dirichlet/TestMapReduce.java Mon Sep  7 22:03:18 2009
@@ -37,6 +37,7 @@
 import org.apache.mahout.matrix.SparseVector;
 import org.apache.mahout.matrix.Vector;
 import org.apache.mahout.utils.DummyOutputCollector;
+import org.apache.mahout.common.RandomUtils;
 
 import java.io.File;
 import java.io.IOException;
@@ -100,7 +101,7 @@
   @Override
   protected void setUp() throws Exception {
     super.setUp();
-    UncommonDistributions.init("Mahout=Hadoop+ML".getBytes());
+    RandomUtils.useTestSeed();    
     ClusteringTestUtils.rmr("output");
     ClusteringTestUtils.rmr("input");
     conf = new Configuration();

Modified: lucene/mahout/trunk/core/src/test/java/org/apache/mahout/clustering/lda/TestLDAInference.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/test/java/org/apache/mahout/clustering/lda/TestLDAInference.java?rev=812288&r1=812287&r2=812288&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/test/java/org/apache/mahout/clustering/lda/TestLDAInference.java (original)
+++ lucene/mahout/trunk/core/src/test/java/org/apache/mahout/clustering/lda/TestLDAInference.java Mon Sep  7 22:03:18 2009
@@ -30,6 +30,7 @@
 import org.apache.mahout.matrix.DenseVector;
 import org.apache.mahout.matrix.Matrix;
 import org.apache.mahout.matrix.Vector;
+import org.apache.mahout.common.RandomUtils;
 
 public class TestLDAInference extends TestCase {
 
@@ -40,7 +41,8 @@
   @Override
   protected void setUp() throws Exception {
     super.setUp();
-    random = new Random(0xCAFEBABECAFEBABEL);
+    RandomUtils.useTestSeed();
+    random = RandomUtils.getRandom();
   }
 
   /**

Modified: lucene/mahout/trunk/core/src/test/java/org/apache/mahout/clustering/lda/TestMapReduce.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/test/java/org/apache/mahout/clustering/lda/TestMapReduce.java?rev=812288&r1=812287&r2=812288&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/test/java/org/apache/mahout/clustering/lda/TestMapReduce.java (original)
+++ lucene/mahout/trunk/core/src/test/java/org/apache/mahout/clustering/lda/TestMapReduce.java Mon Sep  7 22:03:18 2009
@@ -32,6 +32,7 @@
 import org.apache.mahout.matrix.Matrix;
 import org.apache.mahout.matrix.SparseVector;
 import org.apache.mahout.matrix.Vector;
+import org.apache.mahout.common.RandomUtils;
 
 import static org.easymock.classextension.EasyMock.*;
 
@@ -80,7 +81,8 @@
   @Override
   protected void setUp() throws Exception {
     super.setUp();
-    random = new Random(0xCAFEBABECAFEBABEL);
+    RandomUtils.useTestSeed();
+    random = RandomUtils.getRandom();
     File f = new File("input");
     f.mkdir();
   }

Modified: lucene/mahout/trunk/core/src/test/java/org/apache/mahout/ga/watchmaker/STFitnessEvaluatorTest.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/test/java/org/apache/mahout/ga/watchmaker/STFitnessEvaluatorTest.java?rev=812288&r1=812287&r2=812288&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/test/java/org/apache/mahout/ga/watchmaker/STFitnessEvaluatorTest.java (original)
+++ lucene/mahout/trunk/core/src/test/java/org/apache/mahout/ga/watchmaker/STFitnessEvaluatorTest.java Mon Sep  7 22:03:18 2009
@@ -18,7 +18,7 @@
 package org.apache.mahout.ga.watchmaker;
 
 import junit.framework.TestCase;
-import org.uncommons.maths.random.MersenneTwisterRNG;
+import org.apache.mahout.common.RandomUtils;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -60,7 +60,8 @@
    */
   public void testEvaluateSamePopulation() {
     STFitnessEvaluatorMock<Integer> mock = new STFitnessEvaluatorMock<Integer>();
-    Random rng = new MersenneTwisterRNG();
+    RandomUtils.useTestSeed();
+    Random rng = RandomUtils.getRandom();
 
     int size = 100;
     List<Integer> population = randomInts(size, rng);
@@ -84,7 +85,8 @@
    */
   public void testEvaluateDifferentPopulations() {
     STFitnessEvaluatorMock<Integer> mock = new STFitnessEvaluatorMock<Integer>();
-    Random rng = new MersenneTwisterRNG();
+    RandomUtils.useTestSeed();
+    Random rng = RandomUtils.getRandom();
 
     // generate a population A
     int size = 100;

Modified: lucene/mahout/trunk/core/src/test/java/org/apache/mahout/ga/watchmaker/utils/DummyEvaluator.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/test/java/org/apache/mahout/ga/watchmaker/utils/DummyEvaluator.java?rev=812288&r1=812287&r2=812288&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/test/java/org/apache/mahout/ga/watchmaker/utils/DummyEvaluator.java (original)
+++ lucene/mahout/trunk/core/src/test/java/org/apache/mahout/ga/watchmaker/utils/DummyEvaluator.java Mon Sep  7 22:03:18 2009
@@ -18,6 +18,7 @@
 package org.apache.mahout.ga.watchmaker.utils;
 
 import org.uncommons.watchmaker.framework.FitnessEvaluator;
+import org.apache.mahout.common.RandomUtils;
 
 import java.util.HashMap;
 import java.util.List;
@@ -30,7 +31,7 @@
  */
 public class DummyEvaluator implements FitnessEvaluator<DummyCandidate> {
 
-  private final Random rng = new Random(0xCAFEBABECAFEBABEL);
+  private final Random rng = RandomUtils.getRandom();
 
   private static final Map<Integer, Double> evaluations = new HashMap<Integer, Double>();
 

Modified: lucene/mahout/trunk/core/src/test/java/org/apache/mahout/matrix/VectorTest.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/test/java/org/apache/mahout/matrix/VectorTest.java?rev=812288&r1=812287&r2=812288&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/test/java/org/apache/mahout/matrix/VectorTest.java (original)
+++ lucene/mahout/trunk/core/src/test/java/org/apache/mahout/matrix/VectorTest.java Mon Sep  7 22:03:18 2009
@@ -266,7 +266,8 @@
   }
 
   /*public void testSparseVectorTimesX() {
-    Random rnd = new Random(0xCAFEBABECAFEBABEL);
+    RandomUtils.useTestSeed();
+    Random rnd = RandomUtils.getRandom();
     Vector v1 = randomSparseVector(rnd);
     double x = rnd.nextDouble();
     long t0 = System.currentTimeMillis();
@@ -290,7 +291,8 @@
   }*/
 
   /*public void testSparseVectorTimesV() {
-    Random rnd = new Random(0xCAFEBABECAFEBABEL);
+    RandomUtils.useTestSeed();
+    Random rnd = RandomUtils.getRandom();
     Vector v1 = randomSparseVector(rnd);
     Vector v2 = randomSparseVector(rnd);
     long t0 = System.currentTimeMillis();

Modified: lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/canopy/DisplayCanopy.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/canopy/DisplayCanopy.java?rev=812288&r1=812287&r2=812288&view=diff
==============================================================================
--- lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/canopy/DisplayCanopy.java (original)
+++ lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/canopy/DisplayCanopy.java Mon Sep  7 22:03:18 2009
@@ -24,12 +24,12 @@
 import java.util.List;
 
 import org.apache.mahout.clustering.dirichlet.DisplayDirichlet;
-import org.apache.mahout.clustering.dirichlet.UncommonDistributions;
 import org.apache.mahout.clustering.dirichlet.models.NormalModelDistribution;
 import org.apache.mahout.matrix.DenseVector;
 import org.apache.mahout.matrix.Vector;
 import org.apache.mahout.utils.DistanceMeasure;
 import org.apache.mahout.utils.ManhattanDistanceMeasure;
+import org.apache.mahout.common.RandomUtils;
 
 class DisplayCanopy extends DisplayDirichlet {
   DisplayCanopy() {
@@ -107,7 +107,7 @@
   }
 
   public static void main(String[] args) {
-    UncommonDistributions.init("Mahout=Hadoop+ML".getBytes());
+    RandomUtils.useTestSeed();
     generateSamples();
     List<Vector> points = new ArrayList<Vector>();
     points.addAll(sampleData);

Modified: lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/dirichlet/Display2dASNDirichlet.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/dirichlet/Display2dASNDirichlet.java?rev=812288&r1=812287&r2=812288&view=diff
==============================================================================
--- lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/dirichlet/Display2dASNDirichlet.java (original)
+++ lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/dirichlet/Display2dASNDirichlet.java Mon Sep  7 22:03:18 2009
@@ -26,6 +26,7 @@
 import org.apache.mahout.clustering.dirichlet.models.Model;
 import org.apache.mahout.matrix.DenseVector;
 import org.apache.mahout.matrix.Vector;
+import org.apache.mahout.common.RandomUtils;
 
 class Display2dASNDirichlet extends DisplayDirichlet {
   Display2dASNDirichlet() {
@@ -55,7 +56,7 @@
   }
 
   public static void main(String[] args) {
-    UncommonDistributions.init("Mahout=Hadoop+ML".getBytes());
+    RandomUtils.useTestSeed();
     generate2dSamples();
     generateResults();
     new Display2dASNDirichlet();

Modified: lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/dirichlet/DisplayASNDirichlet.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/dirichlet/DisplayASNDirichlet.java?rev=812288&r1=812287&r2=812288&view=diff
==============================================================================
--- lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/dirichlet/DisplayASNDirichlet.java (original)
+++ lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/dirichlet/DisplayASNDirichlet.java Mon Sep  7 22:03:18 2009
@@ -26,6 +26,7 @@
 import org.apache.mahout.clustering.dirichlet.models.Model;
 import org.apache.mahout.matrix.DenseVector;
 import org.apache.mahout.matrix.Vector;
+import org.apache.mahout.common.RandomUtils;
 
 class DisplayASNDirichlet extends DisplayDirichlet {
   DisplayASNDirichlet() {
@@ -55,7 +56,7 @@
   }
 
   public static void main(String[] args) {
-    UncommonDistributions.init("Mahout=Hadoop+ML".getBytes());
+    RandomUtils.useTestSeed();
     generateSamples();
     generateResults();
     new DisplayASNDirichlet();

Modified: lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/dirichlet/DisplayASNOutputState.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/dirichlet/DisplayASNOutputState.java?rev=812288&r1=812287&r2=812288&view=diff
==============================================================================
--- lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/dirichlet/DisplayASNOutputState.java (original)
+++ lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/dirichlet/DisplayASNOutputState.java Mon Sep  7 22:03:18 2009
@@ -35,6 +35,7 @@
 import org.apache.mahout.matrix.AbstractVector;
 import org.apache.mahout.matrix.DenseVector;
 import org.apache.mahout.matrix.Vector;
+import org.apache.mahout.common.RandomUtils;
 
 class DisplayASNOutputState extends DisplayDirichlet {
   DisplayASNOutputState() {
@@ -109,7 +110,7 @@
   }
 
   public static void main(String[] args) throws IOException {
-    UncommonDistributions.init("Mahout=Hadoop+ML".getBytes());
+    RandomUtils.useTestSeed();
     getSamples();
     getResults();
     new DisplayASNOutputState();

Modified: lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/dirichlet/DisplayDirichlet.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/dirichlet/DisplayDirichlet.java?rev=812288&r1=812287&r2=812288&view=diff
==============================================================================
--- lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/dirichlet/DisplayDirichlet.java (original)
+++ lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/dirichlet/DisplayDirichlet.java Mon Sep  7 22:03:18 2009
@@ -36,6 +36,7 @@
 import org.apache.mahout.matrix.DenseVector;
 import org.apache.mahout.matrix.TimesFunction;
 import org.apache.mahout.matrix.Vector;
+import org.apache.mahout.common.RandomUtils;
 
 public class DisplayDirichlet extends Frame {
 
@@ -96,7 +97,7 @@
   }
 
   public static void main(String[] args) throws IOException {
-    UncommonDistributions.init("Mahout=Hadoop+ML".getBytes());
+    RandomUtils.useTestSeed();
     generateSamples();
     new DisplayDirichlet();
   }

Modified: lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/dirichlet/DisplayNDirichlet.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/dirichlet/DisplayNDirichlet.java?rev=812288&r1=812287&r2=812288&view=diff
==============================================================================
--- lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/dirichlet/DisplayNDirichlet.java (original)
+++ lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/dirichlet/DisplayNDirichlet.java Mon Sep  7 22:03:18 2009
@@ -26,6 +26,7 @@
 import org.apache.mahout.clustering.dirichlet.models.NormalModelDistribution;
 import org.apache.mahout.matrix.DenseVector;
 import org.apache.mahout.matrix.Vector;
+import org.apache.mahout.common.RandomUtils;
 
 class DisplayNDirichlet extends DisplayDirichlet {
   DisplayNDirichlet() {
@@ -54,7 +55,7 @@
   }
 
   public static void main(String[] args) {
-    UncommonDistributions.init("Mahout=Hadoop+ML".getBytes());
+    RandomUtils.useTestSeed();
     generateSamples();
     generateResults();
     new DisplayNDirichlet();

Modified: lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/dirichlet/DisplayOutputState.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/dirichlet/DisplayOutputState.java?rev=812288&r1=812287&r2=812288&view=diff
==============================================================================
--- lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/dirichlet/DisplayOutputState.java (original)
+++ lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/dirichlet/DisplayOutputState.java Mon Sep  7 22:03:18 2009
@@ -35,6 +35,7 @@
 import org.apache.mahout.matrix.AbstractVector;
 import org.apache.mahout.matrix.DenseVector;
 import org.apache.mahout.matrix.Vector;
+import org.apache.mahout.common.RandomUtils;
 
 class DisplayOutputState extends DisplayDirichlet {
   DisplayOutputState() {
@@ -107,7 +108,7 @@
   }
 
   public static void main(String[] args) throws IOException {
-    UncommonDistributions.init("Mahout=Hadoop+ML".getBytes());
+    RandomUtils.useTestSeed();
     getSamples();
     getResults();
     new DisplayOutputState();

Modified: lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/dirichlet/DisplaySNDirichlet.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/dirichlet/DisplaySNDirichlet.java?rev=812288&r1=812287&r2=812288&view=diff
==============================================================================
--- lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/dirichlet/DisplaySNDirichlet.java (original)
+++ lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/dirichlet/DisplaySNDirichlet.java Mon Sep  7 22:03:18 2009
@@ -26,6 +26,7 @@
 import org.apache.mahout.clustering.dirichlet.models.SampledNormalDistribution;
 import org.apache.mahout.matrix.DenseVector;
 import org.apache.mahout.matrix.Vector;
+import org.apache.mahout.common.RandomUtils;
 
 class DisplaySNDirichlet extends DisplayDirichlet {
   DisplaySNDirichlet() {
@@ -54,7 +55,7 @@
   }
 
   public static void main(String[] args) {
-    UncommonDistributions.init("Mahout=Hadoop+ML".getBytes());
+    RandomUtils.useTestSeed();
     generateSamples();
     generateResults();
     new DisplaySNDirichlet();

Modified: lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/fuzzykmeans/DisplayFuzzyKMeans.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/fuzzykmeans/DisplayFuzzyKMeans.java?rev=812288&r1=812287&r2=812288&view=diff
==============================================================================
--- lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/fuzzykmeans/DisplayFuzzyKMeans.java (original)
+++ lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/fuzzykmeans/DisplayFuzzyKMeans.java Mon Sep  7 22:03:18 2009
@@ -26,12 +26,12 @@
 
 import org.apache.mahout.clustering.canopy.Canopy;
 import org.apache.mahout.clustering.dirichlet.DisplayDirichlet;
-import org.apache.mahout.clustering.dirichlet.UncommonDistributions;
 import org.apache.mahout.clustering.kmeans.Cluster;
 import org.apache.mahout.matrix.DenseVector;
 import org.apache.mahout.matrix.Vector;
 import org.apache.mahout.utils.DistanceMeasure;
 import org.apache.mahout.utils.ManhattanDistanceMeasure;
+import org.apache.mahout.common.RandomUtils;
 
 class DisplayFuzzyKMeans extends DisplayDirichlet {
   DisplayFuzzyKMeans() {
@@ -164,7 +164,7 @@
   }
 
   public static void main(String[] args) {
-    UncommonDistributions.init("Mahout=Hadoop+ML".getBytes());
+    RandomUtils.useTestSeed();
     generateSamples();
     List<Vector> points = new ArrayList<Vector>();
     points.addAll(sampleData);

Modified: lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/kmeans/DisplayKMeans.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/kmeans/DisplayKMeans.java?rev=812288&r1=812287&r2=812288&view=diff
==============================================================================
--- lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/kmeans/DisplayKMeans.java (original)
+++ lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/kmeans/DisplayKMeans.java Mon Sep  7 22:03:18 2009
@@ -26,11 +26,11 @@
 
 import org.apache.mahout.clustering.canopy.Canopy;
 import org.apache.mahout.clustering.dirichlet.DisplayDirichlet;
-import org.apache.mahout.clustering.dirichlet.UncommonDistributions;
 import org.apache.mahout.matrix.DenseVector;
 import org.apache.mahout.matrix.Vector;
 import org.apache.mahout.utils.DistanceMeasure;
 import org.apache.mahout.utils.ManhattanDistanceMeasure;
+import org.apache.mahout.common.RandomUtils;
 
 class DisplayKMeans extends DisplayDirichlet {
   DisplayKMeans() {
@@ -171,7 +171,7 @@
   }
 
   public static void main(String[] args) {
-    UncommonDistributions.init("Mahout=Hadoop+ML".getBytes());
+    RandomUtils.useTestSeed();
     generateSamples();
     List<Vector> points = new ArrayList<Vector>();
     points.addAll(sampleData);

Modified: lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/meanshift/DisplayMeanShift.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/meanshift/DisplayMeanShift.java?rev=812288&r1=812287&r2=812288&view=diff
==============================================================================
--- lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/meanshift/DisplayMeanShift.java (original)
+++ lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/meanshift/DisplayMeanShift.java Mon Sep  7 22:03:18 2009
@@ -25,11 +25,11 @@
 import java.util.List;
 
 import org.apache.mahout.clustering.dirichlet.DisplayDirichlet;
-import org.apache.mahout.clustering.dirichlet.UncommonDistributions;
 import org.apache.mahout.clustering.dirichlet.models.NormalModelDistribution;
 import org.apache.mahout.matrix.DenseVector;
 import org.apache.mahout.matrix.Vector;
 import org.apache.mahout.utils.EuclideanDistanceMeasure;
+import org.apache.mahout.common.RandomUtils;
 
 class DisplayMeanShift extends DisplayDirichlet {
   private DisplayMeanShift() {
@@ -93,7 +93,7 @@
   }
 
   public static void main(String[] args) {
-    UncommonDistributions.init("Mahout=Hadoop+ML".getBytes());
+    RandomUtils.useTestSeed();
     generateSamples();
     testReferenceImplementation();
     for (MeanShiftCanopy canopy : canopies)

Modified: lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/cd/CDGA.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/cd/CDGA.java?rev=812288&r1=812287&r2=812288&view=diff
==============================================================================
--- lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/cd/CDGA.java (original)
+++ lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/cd/CDGA.java Mon Sep  7 22:03:18 2009
@@ -20,7 +20,7 @@
 import org.apache.hadoop.fs.Path;
 import org.apache.mahout.ga.watchmaker.cd.hadoop.CDMahoutEvaluator;
 import org.apache.mahout.ga.watchmaker.cd.hadoop.DatasetSplit;
-import org.uncommons.maths.random.MersenneTwisterRNG;
+import org.apache.mahout.common.RandomUtils;
 import org.uncommons.watchmaker.framework.CandidateFactory;
 import org.uncommons.watchmaker.framework.EvolutionEngine;
 import org.uncommons.watchmaker.framework.EvolutionObserver;
@@ -130,7 +130,7 @@
     SelectionStrategy<? super CDRule> selection = new RouletteWheelSelection();
 
     EvolutionEngine<CDRule> engine = new SequentialEvolutionEngine<CDRule>(factory,
-        pipeline, evaluator, selection, new MersenneTwisterRNG());
+        pipeline, evaluator, selection, RandomUtils.getRandom());
 
     engine.addEvolutionObserver(new EvolutionObserver<CDRule>() {
       @Override

Modified: lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/travellingsalesman/EvolutionaryTravellingSalesman.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/travellingsalesman/EvolutionaryTravellingSalesman.java?rev=812288&r1=812287&r2=812288&view=diff
==============================================================================
--- lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/travellingsalesman/EvolutionaryTravellingSalesman.java (original)
+++ lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/ga/watchmaker/travellingsalesman/EvolutionaryTravellingSalesman.java Mon Sep  7 22:03:18 2009
@@ -18,7 +18,7 @@
 package org.apache.mahout.ga.watchmaker.travellingsalesman;
 
 import org.apache.mahout.ga.watchmaker.MahoutFitnessEvaluator;
-import org.uncommons.maths.random.MersenneTwisterRNG;
+import org.apache.mahout.common.RandomUtils;
 import org.uncommons.maths.random.PoissonGenerator;
 import org.uncommons.watchmaker.framework.CandidateFactory;
 import org.uncommons.watchmaker.framework.ConcurrentEvolutionEngine;
@@ -129,7 +129,7 @@
   @Override
   public List<String> calculateShortestRoute(Collection<String> cities,
       final ProgressListener progressListener) {
-    Random rng = new MersenneTwisterRNG();
+    Random rng = RandomUtils.getRandom();
 
     // Set-up evolution pipeline (cross-over followed by mutation).
     List<EvolutionaryOperator<? super List<?>>> operators = new ArrayList<EvolutionaryOperator<? super List<?>>>(

Modified: lucene/mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/CDCrossoverTest.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/CDCrossoverTest.java?rev=812288&r1=812287&r2=812288&view=diff
==============================================================================
--- lucene/mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/CDCrossoverTest.java (original)
+++ lucene/mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/CDCrossoverTest.java Mon Sep  7 22:03:18 2009
@@ -18,20 +18,25 @@
 package org.apache.mahout.ga.watchmaker.cd;
 
 import junit.framework.TestCase;
-import org.uncommons.maths.random.MersenneTwisterRNG;
 import org.easymock.classextension.EasyMock;
+import org.apache.mahout.common.RandomUtils;
 
 import java.util.List;
 import java.util.Random;
 
 public class CDCrossoverTest extends TestCase {
 
+  @Override
+  public void setUp() {
+    RandomUtils.useTestSeed();
+  }
+
   /**
    * if the parents have different values for all their genes, then the
    * offsprings will not any common gene.
    */
   public void testMate1() {
-    Random rng = new MersenneTwisterRNG();
+    Random rng = RandomUtils.getRandom();
 
     // Initialize dataset
     DataSet dataset = EasyMock.createMock(DataSet.class);
@@ -78,7 +83,7 @@
    * areas.
    */
   public void testMate2() {
-    Random rng = new MersenneTwisterRNG();
+    Random rng = RandomUtils.getRandom();
 
     // Initialize dataset
     DataSet dataset = EasyMock.createMock(DataSet.class);

Modified: lucene/mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/CDFitnessTest.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/CDFitnessTest.java?rev=812288&r1=812287&r2=812288&view=diff
==============================================================================
--- lucene/mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/CDFitnessTest.java (original)
+++ lucene/mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/CDFitnessTest.java Mon Sep  7 22:03:18 2009
@@ -18,19 +18,23 @@
 package org.apache.mahout.ga.watchmaker.cd;
 
 import junit.framework.TestCase;
-import org.uncommons.maths.random.MersenneTwisterRNG;
+import org.apache.mahout.common.RandomUtils;
 
 import java.util.Random;
 
 public class CDFitnessTest extends TestCase {
 
+  @Override
+  public void setUp() {
+    RandomUtils.useTestSeed();
+  }
+
   /**
    * Test method for {@link org.apache.mahout.ga.watchmaker.cd.CDFitness#get()}.
    */
   public void testGet() {
     int n = 100;
-    Random rng = new MersenneTwisterRNG();
-
+    Random rng = RandomUtils.getRandom();
     for (int nloop = 0; nloop < n; nloop++) {
       int tp = rng.nextInt(1000);
       int tn = rng.nextInt(1000);

Modified: lucene/mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/CDMutationTest.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/CDMutationTest.java?rev=812288&r1=812287&r2=812288&view=diff
==============================================================================
--- lucene/mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/CDMutationTest.java (original)
+++ lucene/mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/CDMutationTest.java Mon Sep  7 22:03:18 2009
@@ -19,7 +19,7 @@
 
 import junit.framework.TestCase;
 import org.apache.mahout.ga.watchmaker.cd.utils.MockDataSet;
-import org.uncommons.maths.random.MersenneTwisterRNG;
+import org.apache.mahout.common.RandomUtils;
 
 import java.util.Random;
 
@@ -31,7 +31,8 @@
 
   @Override
   protected void setUp() {
-    rng = new MersenneTwisterRNG();
+    RandomUtils.useTestSeed();
+    rng = RandomUtils.getRandom();
     mock = new MockDataSet(rng, 100);
   }
 

Modified: lucene/mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/CDRuleTest.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/CDRuleTest.java?rev=812288&r1=812287&r2=812288&view=diff
==============================================================================
--- lucene/mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/CDRuleTest.java (original)
+++ lucene/mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/CDRuleTest.java Mon Sep  7 22:03:18 2009
@@ -20,7 +20,7 @@
 import junit.framework.TestCase;
 import junit.framework.Assert;
 import org.apache.mahout.ga.watchmaker.cd.utils.MockDataSet;
-import org.uncommons.maths.random.MersenneTwisterRNG;
+import org.apache.mahout.common.RandomUtils;
 import org.easymock.classextension.EasyMock;
 
 import java.util.Random;
@@ -68,7 +68,8 @@
 
   @Override
   protected void setUp() {
-    rng = new MersenneTwisterRNG();
+    RandomUtils.useTestSeed();
+    rng = RandomUtils.getRandom();
     mock = new MockDataSet(rng, 50);
   }
 
@@ -158,7 +159,6 @@
     EasyMock.expect(dl.getAttribut(EasyMock.anyInt())).andReturn(1.0d).atLeastOnce();
     EasyMock.replay(dl);
 
-    Random rng = new MersenneTwisterRNG();
     int n = 100; // repeat the test n times
     for (int nloop = 0; nloop < n; nloop++) {
       mock.categoricalDataset();

Modified: lucene/mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/hadoop/CDMahoutEvaluatorTest.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/hadoop/CDMahoutEvaluatorTest.java?rev=812288&r1=812287&r2=812288&view=diff
==============================================================================
--- lucene/mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/hadoop/CDMahoutEvaluatorTest.java (original)
+++ lucene/mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/hadoop/CDMahoutEvaluatorTest.java Mon Sep  7 22:03:18 2009
@@ -23,7 +23,7 @@
 import org.apache.mahout.ga.watchmaker.cd.Rule;
 import org.apache.mahout.ga.watchmaker.cd.utils.RandomRule;
 import org.apache.mahout.ga.watchmaker.cd.utils.RandomRuleResults;
-import org.uncommons.maths.random.MersenneTwisterRNG;
+import org.apache.mahout.common.RandomUtils;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -31,9 +31,14 @@
 
 public class CDMahoutEvaluatorTest extends TestCase {
 
+  @Override
+  public void setUp() {
+    RandomUtils.useTestSeed();
+  }
+
   public void testEvaluate() throws Exception {
     int nbrules = 100;
-    Random rng = new MersenneTwisterRNG();
+    Random rng = RandomUtils.getRandom();
     int target = 1;
 
     // random rules

Modified: lucene/mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/hadoop/CDReducerTest.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/hadoop/CDReducerTest.java?rev=812288&r1=812287&r2=812288&view=diff
==============================================================================
--- lucene/mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/hadoop/CDReducerTest.java (original)
+++ lucene/mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/hadoop/CDReducerTest.java Mon Sep  7 22:03:18 2009
@@ -21,6 +21,7 @@
 import org.apache.hadoop.io.LongWritable;
 import org.apache.mahout.ga.watchmaker.cd.CDFitness;
 import org.apache.mahout.utils.DummyOutputCollector;
+import org.apache.mahout.common.RandomUtils;
 
 import java.io.IOException;
 import java.util.ArrayList;
@@ -40,7 +41,8 @@
   protected void setUp() {
     // generate random evaluatons and calculate expectations
     evaluations = new ArrayList<CDFitness>();
-    Random rng = new Random();
+    RandomUtils.useTestSeed();
+    Random rng = RandomUtils.getRandom();
     int tp = 0;
     int fp = 0;
     int tn = 0;

Modified: lucene/mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/hadoop/DatasetSplitTest.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/hadoop/DatasetSplitTest.java?rev=812288&r1=812287&r2=812288&view=diff
==============================================================================
--- lucene/mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/hadoop/DatasetSplitTest.java (original)
+++ lucene/mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/hadoop/DatasetSplitTest.java Mon Sep  7 22:03:18 2009
@@ -23,6 +23,7 @@
 import org.apache.hadoop.mapred.JobConf;
 import org.apache.hadoop.mapred.RecordReader;
 import org.apache.mahout.ga.watchmaker.cd.hadoop.DatasetSplit.RndLineRecordReader;
+import org.apache.mahout.common.RandomUtils;
 import org.uncommons.maths.random.MersenneTwisterRNG;
 
 import java.io.IOException;
@@ -30,11 +31,13 @@
 import java.util.HashSet;
 import java.util.Set;
 
-/**
- * 
- */
 public class DatasetSplitTest extends TestCase {
 
+  @Override
+  public void setUp() {
+    RandomUtils.useTestSeed();
+  }
+
   /**
    * Mock RecordReader that returns a sequence of keys in the range [0, size[
    */
@@ -45,38 +48,33 @@
     private final long size;
 
     MockReader(long size) {
-      assert size > 0 : "size == 0";
-
+      if (size <= 0) {
+        throw new IllegalArgumentException("size must be positive");
+      }
       this.size = size;
     }
 
     @Override
     public void close() throws IOException {
-      // TODO Auto-generated method stub
-
     }
 
     @Override
     public LongWritable createKey() {
-      // TODO Auto-generated method stub
       return null;
     }
 
     @Override
     public Text createValue() {
-      // TODO Auto-generated method stub
       return null;
     }
 
     @Override
     public long getPos() throws IOException {
-      // TODO Auto-generated method stub
       return 0;
     }
 
     @Override
     public float getProgress() throws IOException {
-      // TODO Auto-generated method stub
       return 0;
     }
 
@@ -95,7 +93,7 @@
     int n = 20;
 
     for (int nloop = 0; nloop < n; nloop++) {
-      MersenneTwisterRNG rng = new MersenneTwisterRNG();
+      MersenneTwisterRNG rng = (MersenneTwisterRNG) RandomUtils.getRandom();
       byte[] seed = rng.getSeed();
       double threshold = rng.nextDouble();
 
@@ -130,7 +128,7 @@
     int n = 20;
 
     for (int nloop = 0; nloop < n; nloop++) {
-      MersenneTwisterRNG rng = new MersenneTwisterRNG();
+      MersenneTwisterRNG rng = (MersenneTwisterRNG) RandomUtils.getRandom();
 
       byte[] seed = rng.getSeed();
       double threshold = rng.nextDouble();

Modified: lucene/mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/tool/CDInfosToolTest.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/tool/CDInfosToolTest.java?rev=812288&r1=812287&r2=812288&view=diff
==============================================================================
--- lucene/mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/tool/CDInfosToolTest.java (original)
+++ lucene/mahout/trunk/examples/src/test/java/org/apache/mahout/ga/watchmaker/cd/tool/CDInfosToolTest.java Mon Sep  7 22:03:18 2009
@@ -23,7 +23,7 @@
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
 import org.apache.mahout.ga.watchmaker.cd.tool.DescriptionUtils.Range;
-import org.uncommons.maths.random.MersenneTwisterRNG;
+import org.apache.mahout.common.RandomUtils;
 
 import java.io.BufferedWriter;
 import java.io.IOException;
@@ -36,11 +36,12 @@
 
 public class CDInfosToolTest extends TestCase {
 
-  Random rng;
+  private Random rng;
 
   @Override
   protected void setUp() {
-    rng = new MersenneTwisterRNG();
+    RandomUtils.useTestSeed();
+    rng = RandomUtils.getRandom();
   }
 
   private Descriptors randomDescriptors(int nbattributes, double numRate, double catRate) {

Modified: lucene/mahout/trunk/utils/src/test/java/org/apache/mahout/utils/vectors/RandomVectorIterable.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/utils/src/test/java/org/apache/mahout/utils/vectors/RandomVectorIterable.java?rev=812288&r1=812287&r2=812288&view=diff
==============================================================================
--- lucene/mahout/trunk/utils/src/test/java/org/apache/mahout/utils/vectors/RandomVectorIterable.java (original)
+++ lucene/mahout/trunk/utils/src/test/java/org/apache/mahout/utils/vectors/RandomVectorIterable.java Mon Sep  7 22:03:18 2009
@@ -21,6 +21,7 @@
 import org.apache.mahout.matrix.DenseVector;
 import org.apache.mahout.matrix.UnaryFunction;
 import org.apache.mahout.matrix.SparseVector;
+import org.apache.mahout.common.RandomUtils;
 
 import java.util.Iterator;
 import java.util.Random;
@@ -51,7 +52,7 @@
 
   private class VectIterator implements Iterator<Vector>{
     int count = 0;
-    final Random random = new Random();
+    final Random random = RandomUtils.getRandom();
     @Override
     public boolean hasNext() {
       return count < numItems;



Mime
View raw message