mahout-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sro...@apache.org
Subject svn commit: r885213 [2/6] - in /lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout: jet/math/ jet/random/ jet/random/engine/ jet/random/sampling/ jet/stat/ jet/stat/quantile/ matrix/ matrix/bitvector/ matrix/buffer/ matrix/list/ matrix/list/ada...
Date Sun, 29 Nov 2009 11:20:11 GMT
Modified: lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/jet/random/sampling/WeightedRandomSampler.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/jet/random/sampling/WeightedRandomSampler.java?rev=885213&r1=885212&r2=885213&view=diff
==============================================================================
--- lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/jet/random/sampling/WeightedRandomSampler.java (original)
+++ lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/jet/random/sampling/WeightedRandomSampler.java Sun Nov 29 11:19:58 2009
@@ -10,7 +10,8 @@
 
 import org.apache.mahout.jet.random.Uniform;
 import org.apache.mahout.jet.random.engine.RandomEngine;
-import org.apache.mahout.matrix.list.BooleanArrayList;
+import org.apache.mahout.matrix.PersistentObject;
+import org.apache.mahout.matrix.list.IntArrayList;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 /**
@@ -25,19 +26,19 @@
 
 /** @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported. */
 @Deprecated
-public class WeightedRandomSampler extends org.apache.mahout.matrix.PersistentObject {
+public class WeightedRandomSampler extends PersistentObject {
 
   private static final Logger log = LoggerFactory.getLogger(WeightedRandomSampler.class);
 
 
   //public class BlockedRandomSampler extends Object implements java.io.Serializable {
-  protected int skip;
-  protected int nextTriggerPos;
-  protected int nextSkip;
-  protected int weight;
-  protected Uniform generator;
+  private int skip;
+  private int nextTriggerPos;
+  private int nextSkip;
+  private int weight;
+  private Uniform generator;
 
-  static final int UNDEFINED = -1;
+  private static final int UNDEFINED = -1;
 
   /** Calls <tt>BlockedRandomSampler(1,null)</tt>. */
   public WeightedRandomSampler() {
@@ -129,7 +130,7 @@
     WeightedRandomSampler sampler = new WeightedRandomSampler();
     sampler.setWeight(weight);
 
-    org.apache.mahout.matrix.list.IntArrayList sample = new org.apache.mahout.matrix.list.IntArrayList();
+    IntArrayList sample = new IntArrayList();
     for (int i = 0; i < size; i++) {
       if (sampler.sampleNextElement()) {
         sample.add(i);
@@ -139,45 +140,4 @@
     log.info("Sample = " + sample);
   }
 
-  /**
-   * Chooses exactly one random element from successive blocks of <tt>weight</tt> input elements each. For example, if
-   * weight==2, and the input is 5*2=10 elements long, then chooses 5 random elements from the 10 elements such that one
-   * is chosen from the first block, one from the second, ..., one from the last block.
-   *
-   * @param acceptList a bitvector which will be filled with <tt>true</tt> where sampling shall occur and <tt>false</tt>
-   *                   where it shall not occur.
-   */
-  private void xsampleNextElements(BooleanArrayList acceptList) {
-    // manually inlined
-    int length = acceptList.size();
-    boolean[] accept = acceptList.elements();
-    for (int i = 0; i < length; i++) {
-      if (skip > 0) { //reject
-        skip--;
-        accept[i] = false;
-        continue;
-      }
-
-      if (nextTriggerPos == UNDEFINED) {
-        if (weight == 1) {
-          nextTriggerPos = 0; // tuned for speed
-        } else {
-          nextTriggerPos = generator.nextIntFromTo(0, weight - 1);
-        }
-
-        nextSkip = weight - 1 - nextTriggerPos;
-      }
-
-      if (nextTriggerPos > 0) { //reject
-        nextTriggerPos--;
-        accept[i] = false;
-        continue;
-      }
-
-      //accept
-      nextTriggerPos = UNDEFINED;
-      skip = nextSkip;
-      accept[i] = true;
-    }
-  }
 }

Modified: lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/jet/stat/Descriptive.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/jet/stat/Descriptive.java?rev=885213&r1=885212&r2=885213&view=diff
==============================================================================
--- lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/jet/stat/Descriptive.java (original)
+++ lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/jet/stat/Descriptive.java Sun Nov 29 11:19:58 2009
@@ -282,15 +282,15 @@
    * <br><tt>b(k,i) = </tt>{@link org.apache.mahout.jet.math.Arithmetic#binomial(long,long) binomial(k,i)} and
    * <br><tt>sumOfPowers(k) = Sum( data[i]<sup>k</sup> )</tt>. <p>
    *
-   * @param data  the additional elements to be incorporated into min, max, etc.
-   * @param from  the index of the first element within <tt>data</tt> to consider.
-   * @param to    the index of the last element within <tt>data</tt> to consider. The method incorporates elements
-   *              <tt>data[from], ..., data[to]</tt>.
+   * @param data        the additional elements to be incorporated into min, max, etc.
+   * @param from        the index of the first element within <tt>data</tt> to consider.
+   * @param to          the index of the last element within <tt>data</tt> to consider. The method incorporates elements
+   *                    <tt>data[from], ..., data[to]</tt>.
    * @param sumOfPowers the old values of the sums in the following format: <ul> <li><tt>sumOfPowers[0]</tt> is the old
-   *              <tt>Sum(data[i]<sup>fromSumIndex</sup>)</tt>. <li><tt>sumOfPowers[1]</tt> is the old
-   *              <tt>Sum(data[i]<sup>fromSumIndex+1</sup>)</tt>. <li>... <li><tt>sumOfPowers[toSumIndex-fromSumIndex]</tt>
-   *              is the old <tt>Sum(data[i]<sup>toSumIndex</sup>)</tt>. </ul> If no data sequence elements have so far
-   *              been recorded set all old values of the sums to <tt>0.0</tt>.
+   *                    <tt>Sum(data[i]<sup>fromSumIndex</sup>)</tt>. <li><tt>sumOfPowers[1]</tt> is the old
+   *                    <tt>Sum(data[i]<sup>fromSumIndex+1</sup>)</tt>. <li>... <li><tt>sumOfPowers[toSumIndex-fromSumIndex]</tt>
+   *                    is the old <tt>Sum(data[i]<sup>toSumIndex</sup>)</tt>. </ul> If no data sequence elements have
+   *                    so far been recorded set all old values of the sums to <tt>0.0</tt>.
    * @return the updated values filled into the <tt>sumOfPowers</tt> array.
    */
   public static void incrementalUpdateSumsOfPowers(DoubleArrayList data, int from, int to, int fromSumIndex,

Modified: lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/jet/stat/Probability.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/jet/stat/Probability.java?rev=885213&r1=885212&r2=885213&view=diff
==============================================================================
--- lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/jet/stat/Probability.java (original)
+++ lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/jet/stat/Probability.java Sun Nov 29 11:19:58 2009
@@ -29,14 +29,14 @@
    * ***********************************************
    */
   /* approximation for 0 <= |y - 0.5| <= 3/8 */
-  protected static final double[] P0 = {
+  private static final double[] P0 = {
       -5.99633501014107895267E1,
       9.80010754185999661536E1,
       -5.66762857469070293439E1,
       1.39312609387279679503E1,
       -1.23916583867381258016E0,
   };
-  protected static final double[] Q0 = {
+  private static final double[] Q0 = {
       /* 1.00000000000000000000E0,*/
       1.95448858338141759834E0,
       4.67627912898881538453E0,
@@ -52,7 +52,7 @@
   /* Approximation for interval z = sqrt(-2 log y ) between 2 and 8
    * i.e., y between exp(-2) = .135 and exp(-32) = 1.27e-14.
    */
-  protected static final double[] P1 = {
+  private static final double[] P1 = {
       4.05544892305962419923E0,
       3.15251094599893866154E1,
       5.71628192246421288162E1,
@@ -63,7 +63,7 @@
       -3.50424626827848203418E-2,
       -8.57456785154685413611E-4,
   };
-  protected static final double[] Q1 = {
+  private static final double[] Q1 = {
       /*  1.00000000000000000000E0,*/
       1.57799883256466749731E1,
       4.53907635128879210584E1,
@@ -78,7 +78,7 @@
   /* Approximation for interval z = sqrt(-2 log y ) between 8 and 64
    * i.e., y between exp(-32) = 1.27e-14 and exp(-2048) = 3.67e-890.
    */
-  protected static final double[] P2 = {
+  private static final double[] P2 = {
       3.23774891776946035970E0,
       6.91522889068984211695E0,
       3.93881025292474443415E0,
@@ -89,7 +89,7 @@
       2.65806974686737550832E-6,
       6.23974539184983293730E-9,
   };
-  protected static final double[] Q2 = {
+  private static final double[] Q2 = {
       /*  1.00000000000000000000E0,*/
       6.02427039364742014255E0,
       3.67983563856160859403E0,

Modified: lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/jet/stat/quantile/Buffer.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/jet/stat/quantile/Buffer.java?rev=885213&r1=885212&r2=885213&view=diff
==============================================================================
--- lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/jet/stat/quantile/Buffer.java (original)
+++ lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/jet/stat/quantile/Buffer.java Sun Nov 29 11:19:58 2009
@@ -8,11 +8,13 @@
 */
 package org.apache.mahout.jet.stat.quantile;
 
+import org.apache.mahout.matrix.PersistentObject;
+
 /** A buffer holding elements; internally used for computing approximate quantiles. */
-abstract class Buffer extends org.apache.mahout.matrix.PersistentObject {
+abstract class Buffer extends PersistentObject {
 
   protected int weight;
-  protected int level;
+  private int level;
   protected final int k;
   protected boolean isAllocated;
 

Modified: lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/jet/stat/quantile/BufferSet.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/jet/stat/quantile/BufferSet.java?rev=885213&r1=885212&r2=885213&view=diff
==============================================================================
--- lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/jet/stat/quantile/BufferSet.java (original)
+++ lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/jet/stat/quantile/BufferSet.java Sun Nov 29 11:19:58 2009
@@ -8,7 +8,9 @@
 */
 package org.apache.mahout.jet.stat.quantile;
 
+import org.apache.mahout.matrix.PersistentObject;
+
 /** An abstract set of buffers; internally used for computing approximate quantiles. */
-abstract class BufferSet extends org.apache.mahout.matrix.PersistentObject {
+abstract class BufferSet extends PersistentObject {
 
 }

Modified: lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/jet/stat/quantile/DoubleBufferSet.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/jet/stat/quantile/DoubleBufferSet.java?rev=885213&r1=885212&r2=885213&view=diff
==============================================================================
--- lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/jet/stat/quantile/DoubleBufferSet.java (original)
+++ lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/jet/stat/quantile/DoubleBufferSet.java Sun Nov 29 11:19:58 2009
@@ -8,6 +8,8 @@
 */
 package org.apache.mahout.jet.stat.quantile;
 
+import org.apache.mahout.matrix.function.DoubleProcedure;
+
 /** A set of buffers holding <tt>double</tt> elements; internally used for computing approximate quantiles. */
 class DoubleBufferSet extends BufferSet {
 
@@ -219,7 +221,7 @@
    * @param procedure the procedure to be applied. Stops iteration if the procedure returns <tt>false</tt>, otherwise
    *                  continues.
    */
-  public boolean forEach(org.apache.mahout.matrix.function.DoubleProcedure procedure) {
+  public boolean forEach(DoubleProcedure procedure) {
     for (int i = buffers.length; --i >= 0;) {
       for (int w = buffers[i].weight(); --w >= 0;) {
         if (!(buffers[i].values.forEach(procedure))) {

Modified: lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/jet/stat/quantile/DoubleQuantileEstimator.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/jet/stat/quantile/DoubleQuantileEstimator.java?rev=885213&r1=885212&r2=885213&view=diff
==============================================================================
--- lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/jet/stat/quantile/DoubleQuantileEstimator.java (original)
+++ lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/jet/stat/quantile/DoubleQuantileEstimator.java Sun Nov 29 11:19:58 2009
@@ -8,6 +8,8 @@
 */
 package org.apache.mahout.jet.stat.quantile;
 
+import org.apache.mahout.matrix.PersistentObject;
+import org.apache.mahout.matrix.function.DoubleProcedure;
 import org.apache.mahout.matrix.list.DoubleArrayList;
 import org.apache.mahout.matrix.list.ObjectArrayList;
 
@@ -16,7 +18,7 @@
  * elements.
  */
 //abstract class ApproximateDoubleQuantileFinder extends Object implements DoubleQuantileFinder {
-abstract class DoubleQuantileEstimator extends org.apache.mahout.matrix.PersistentObject
+abstract class DoubleQuantileEstimator extends PersistentObject
     implements DoubleQuantileFinder {
 
   protected DoubleBufferSet bufferSet;
@@ -170,7 +172,7 @@
    * @return <tt>false</tt> if the procedure stopped before all elements where iterated over, <tt>true</tt> otherwise.
    */
   @Override
-  public boolean forEach(org.apache.mahout.matrix.function.DoubleProcedure procedure) {
+  public boolean forEach(DoubleProcedure procedure) {
     return this.bufferSet.forEach(procedure);
   }
 

Modified: lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/jet/stat/quantile/DoubleQuantileFinder.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/jet/stat/quantile/DoubleQuantileFinder.java?rev=885213&r1=885212&r2=885213&view=diff
==============================================================================
--- lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/jet/stat/quantile/DoubleQuantileFinder.java (original)
+++ lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/jet/stat/quantile/DoubleQuantileFinder.java Sun Nov 29 11:19:58 2009
@@ -8,6 +8,7 @@
 */
 package org.apache.mahout.jet.stat.quantile;
 
+import org.apache.mahout.matrix.function.DoubleProcedure;
 import org.apache.mahout.matrix.list.DoubleArrayList;
 /**
  * The interface shared by all quantile finders, no matter if they are exact or approximate.
@@ -32,7 +33,7 @@
    *
    * @param values the list of which all values shall be added.
    */
-  void addAllOf(org.apache.mahout.matrix.list.DoubleArrayList values);
+  void addAllOf(DoubleArrayList values);
 
   /**
    * Adds the part of the specified list between indexes <tt>from</tt> (inclusive) and <tt>to</tt> (inclusive) to the
@@ -64,7 +65,7 @@
    *                  continues.
    * @return <tt>false</tt> if the procedure stopped before all elements where iterated over, <tt>true</tt> otherwise.
    */
-  boolean forEach(org.apache.mahout.matrix.function.DoubleProcedure procedure);
+  boolean forEach(DoubleProcedure procedure);
 
   /**
    * Returns the number of elements currently needed to store all contained elements. This number usually differs from

Modified: lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/jet/stat/quantile/EquiDepthHistogram.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/jet/stat/quantile/EquiDepthHistogram.java?rev=885213&r1=885212&r2=885213&view=diff
==============================================================================
--- lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/jet/stat/quantile/EquiDepthHistogram.java (original)
+++ lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/jet/stat/quantile/EquiDepthHistogram.java Sun Nov 29 11:19:58 2009
@@ -8,6 +8,8 @@
 */
 package org.apache.mahout.jet.stat.quantile;
 
+import org.apache.mahout.matrix.PersistentObject;
+
 /**
  * Read-only equi-depth histogram for selectivity estimation.
  * Assume you have collected statistics over a data set, among them a one-dimensional equi-depth histogram (quantiles).
@@ -26,9 +28,9 @@
 
 /** @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported. */
 @Deprecated
-public class EquiDepthHistogram extends org.apache.mahout.matrix.PersistentObject {
+public class EquiDepthHistogram extends PersistentObject {
 
-  protected final float[] binBoundaries;
+  private final float[] binBoundaries;
 
   /**
    * Constructs an equi-depth histogram with the given quantile elements. Quantile elements must be sorted ascending and

Modified: lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/jet/stat/quantile/ExactDoubleQuantileFinder.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/jet/stat/quantile/ExactDoubleQuantileFinder.java?rev=885213&r1=885212&r2=885213&view=diff
==============================================================================
--- lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/jet/stat/quantile/ExactDoubleQuantileFinder.java (original)
+++ lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/jet/stat/quantile/ExactDoubleQuantileFinder.java Sun Nov 29 11:19:58 2009
@@ -8,6 +8,8 @@
 */
 package org.apache.mahout.jet.stat.quantile;
 
+import org.apache.mahout.matrix.PersistentObject;
+import org.apache.mahout.matrix.function.DoubleProcedure;
 import org.apache.mahout.matrix.list.DoubleArrayList;
 
 /**
@@ -16,10 +18,10 @@
  * list, then picks the quantiles.
  */
 //class ExactDoubleQuantileFinder extends Object implements DoubleQuantileFinder {
-class ExactDoubleQuantileFinder extends org.apache.mahout.matrix.PersistentObject implements DoubleQuantileFinder {
+class ExactDoubleQuantileFinder extends PersistentObject implements DoubleQuantileFinder {
 
-  protected DoubleArrayList buffer;
-  protected boolean isSorted;
+  private DoubleArrayList buffer;
+  private boolean isSorted;
 
   /** Constructs an empty exact quantile finder. */
   ExactDoubleQuantileFinder() {
@@ -101,7 +103,7 @@
    * @return <tt>false</tt> if the procedure stopped before all elements where iterated over, <tt>true</tt> otherwise.
    */
   @Override
-  public boolean forEach(org.apache.mahout.matrix.function.DoubleProcedure procedure) {
+  public boolean forEach(DoubleProcedure procedure) {
     double[] theElements = buffer.elements();
     int theSize = (int) size();
 

Modified: lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/jet/stat/quantile/KnownDoubleQuantileEstimator.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/jet/stat/quantile/KnownDoubleQuantileEstimator.java?rev=885213&r1=885212&r2=885213&view=diff
==============================================================================
--- lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/jet/stat/quantile/KnownDoubleQuantileEstimator.java (original)
+++ lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/jet/stat/quantile/KnownDoubleQuantileEstimator.java Sun Nov 29 11:19:58 2009
@@ -74,7 +74,7 @@
 
   /**
    * @param missingInfinities the number of infinities to fill.
-   * @param buffer     the buffer into which the infinities shall be filled.
+   * @param buffer            the buffer into which the infinities shall be filled.
    */
   protected void addInfinities(int missingInfinities, DoubleBuffer buffer) {
     RandomSamplingAssistant oldAssistant = this.samplingAssistant;

Modified: lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/jet/stat/quantile/QuantileCalc.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/jet/stat/quantile/QuantileCalc.java?rev=885213&r1=885212&r2=885213&view=diff
==============================================================================
--- lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/jet/stat/quantile/QuantileCalc.java (original)
+++ lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/jet/stat/quantile/QuantileCalc.java Sun Nov 29 11:19:58 2009
@@ -59,13 +59,14 @@
    * Assumes that quantiles are to be computed over N values. The required sampling rate is computed and stored in the
    * first element of the provided <tt>returnSamplingRate</tt> array, which, therefore must be at least of length 1.
    *
-   * @param N            the number of values over which quantiles shall be computed (e.g <tt>10^6</tt>).
-   * @param epsilon      the approximation error which is guaranteed not to be exceeded (e.g. <tt>0.001</tt>) (<tt>0
-   *                     &lt;= epsilon &lt;= 1</tt>). To get exact result, set <tt>epsilon=0.0</tt>;
-   * @param delta        the probability that the approximation error is more than than epsilon (e.g. <tt>0.0001</tt>)
-   *                     (<tt>0 &lt;= delta &lt;= 1</tt>). To avoid probabilistic answers, set <tt>delta=0.0</tt>.
-   * @param quantiles    the number of quantiles to be computed (e.g. <tt>100</tt>) (<tt>quantiles &gt;= 1</tt>). If
-   *                     unknown in advance, set this number large, e.g. <tt>quantiles &gt;= 10000</tt>.
+   * @param N                  the number of values over which quantiles shall be computed (e.g <tt>10^6</tt>).
+   * @param epsilon            the approximation error which is guaranteed not to be exceeded (e.g. <tt>0.001</tt>)
+   *                           (<tt>0 &lt;= epsilon &lt;= 1</tt>). To get exact result, set <tt>epsilon=0.0</tt>;
+   * @param delta              the probability that the approximation error is more than than epsilon (e.g.
+   *                           <tt>0.0001</tt>) (<tt>0 &lt;= delta &lt;= 1</tt>). To avoid probabilistic answers, set
+   *                           <tt>delta=0.0</tt>.
+   * @param quantiles          the number of quantiles to be computed (e.g. <tt>100</tt>) (<tt>quantiles &gt;= 1</tt>).
+   *                           If unknown in advance, set this number large, e.g. <tt>quantiles &gt;= 10000</tt>.
    * @param returnSamplingRate a <tt>double[1]</tt> where the sampling rate is to be filled in.
    * @return <tt>long[2]</tt> - <tt>long[0]</tt>=the number of buffers, <tt>long[1]</tt>=the number of elements per
    *         buffer, <tt>returnSamplingRate[0]</tt>=the required sampling rate.
@@ -195,13 +196,14 @@
    * N values. The required sampling rate is computed and stored in the first element of the provided
    * <tt>returnSamplingRate</tt> array, which, therefore must be at least of length 1.
    *
-   * @param N            the anticipated number of values over which quantiles shall be computed (e.g 10^6).
-   * @param epsilon      the approximation error which is guaranteed not to be exceeded (e.g. <tt>0.001</tt>) (<tt>0
-   *                     &lt;= epsilon &lt;= 1</tt>). To get exact result, set <tt>epsilon=0.0</tt>;
-   * @param delta        the probability that the approximation error is more than than epsilon (e.g. <tt>0.0001</tt>)
-   *                     (<tt>0 &lt;= delta &lt;= 1</tt>). To avoid probabilistic answers, set <tt>delta=0.0</tt>.
-   * @param quantiles    the number of quantiles to be computed (e.g. <tt>100</tt>) (<tt>quantiles &gt;= 1</tt>). If
-   *                     unknown in advance, set this number large, e.g. <tt>quantiles &gt;= 10000</tt>.
+   * @param N                  the anticipated number of values over which quantiles shall be computed (e.g 10^6).
+   * @param epsilon            the approximation error which is guaranteed not to be exceeded (e.g. <tt>0.001</tt>)
+   *                           (<tt>0 &lt;= epsilon &lt;= 1</tt>). To get exact result, set <tt>epsilon=0.0</tt>;
+   * @param delta              the probability that the approximation error is more than than epsilon (e.g.
+   *                           <tt>0.0001</tt>) (<tt>0 &lt;= delta &lt;= 1</tt>). To avoid probabilistic answers, set
+   *                           <tt>delta=0.0</tt>.
+   * @param quantiles          the number of quantiles to be computed (e.g. <tt>100</tt>) (<tt>quantiles &gt;= 1</tt>).
+   *                           If unknown in advance, set this number large, e.g. <tt>quantiles &gt;= 10000</tt>.
    * @param returnSamplingRate a <tt>double[1]</tt> where the sampling rate is to be filled in.
    * @return <tt>long[2]</tt> - <tt>long[0]</tt>=the number of buffers, <tt>long[1]</tt>=the number of elements per
    *         buffer, <tt>returnSamplingRate[0]</tt>=the required sampling rate.

Modified: lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/jet/stat/quantile/QuantileFinderFactory.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/jet/stat/quantile/QuantileFinderFactory.java?rev=885213&r1=885212&r2=885213&view=diff
==============================================================================
--- lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/jet/stat/quantile/QuantileFinderFactory.java (original)
+++ lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/jet/stat/quantile/QuantileFinderFactory.java Sun Nov 29 11:19:58 2009
@@ -12,6 +12,7 @@
 
 import org.apache.mahout.jet.math.Arithmetic;
 import org.apache.mahout.jet.random.engine.RandomEngine;
+import org.apache.mahout.matrix.list.DoubleArrayList;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 /**
@@ -107,13 +108,14 @@
    * Assumes that quantiles are to be computed over N values. The required sampling rate is computed and stored in the
    * first element of the provided <tt>returnSamplingRate</tt> array, which, therefore must be at least of length 1.
    *
-   * @param N            the number of values over which quantiles shall be computed (e.g <tt>10^6</tt>).
-   * @param epsilon      the approximation error which is guaranteed not to be exceeded (e.g. <tt>0.001</tt>) (<tt>0
-   *                     &lt;= epsilon &lt;= 1</tt>). To get exact result, set <tt>epsilon=0.0</tt>;
-   * @param delta        the probability that the approximation error is more than than epsilon (e.g. <tt>0.0001</tt>)
-   *                     (<tt>0 &lt;= delta &lt;= 1</tt>). To avoid probabilistic answers, set <tt>delta=0.0</tt>.
-   * @param quantiles    the number of quantiles to be computed (e.g. <tt>100</tt>) (<tt>quantiles &gt;= 1</tt>). If
-   *                     unknown in advance, set this number large, e.g. <tt>quantiles &gt;= 10000</tt>.
+   * @param N                  the number of values over which quantiles shall be computed (e.g <tt>10^6</tt>).
+   * @param epsilon            the approximation error which is guaranteed not to be exceeded (e.g. <tt>0.001</tt>)
+   *                           (<tt>0 &lt;= epsilon &lt;= 1</tt>). To get exact result, set <tt>epsilon=0.0</tt>;
+   * @param delta              the probability that the approximation error is more than than epsilon (e.g.
+   *                           <tt>0.0001</tt>) (<tt>0 &lt;= delta &lt;= 1</tt>). To avoid probabilistic answers, set
+   *                           <tt>delta=0.0</tt>.
+   * @param quantiles          the number of quantiles to be computed (e.g. <tt>100</tt>) (<tt>quantiles &gt;= 1</tt>).
+   *                           If unknown in advance, set this number large, e.g. <tt>quantiles &gt;= 10000</tt>.
    * @param returnSamplingRate output parameter, a <tt>double[1]</tt> where the sampling rate is to be filled in.
    * @return <tt>long[2]</tt> - <tt>long[0]</tt>=the number of buffers, <tt>long[1]</tt>=the number of elements per
    *         buffer, <tt>returnSamplingRate[0]</tt>=the required sampling rate.
@@ -250,13 +252,14 @@
    * N values. The required sampling rate is computed and stored in the first element of the provided
    * <tt>returnSamplingRate</tt> array, which, therefore must be at least of length 1.
    *
-   * @param N            the anticipated number of values over which quantiles shall be computed (e.g 10^6).
-   * @param epsilon      the approximation error which is guaranteed not to be exceeded (e.g. <tt>0.001</tt>) (<tt>0
-   *                     &lt;= epsilon &lt;= 1</tt>). To get exact result, set <tt>epsilon=0.0</tt>;
-   * @param delta        the probability that the approximation error is more than than epsilon (e.g. <tt>0.0001</tt>)
-   *                     (<tt>0 &lt;= delta &lt;= 1</tt>). To avoid probabilistic answers, set <tt>delta=0.0</tt>.
-   * @param quantiles    the number of quantiles to be computed (e.g. <tt>100</tt>) (<tt>quantiles &gt;= 1</tt>). If
-   *                     unknown in advance, set this number large, e.g. <tt>quantiles &gt;= 10000</tt>.
+   * @param N                  the anticipated number of values over which quantiles shall be computed (e.g 10^6).
+   * @param epsilon            the approximation error which is guaranteed not to be exceeded (e.g. <tt>0.001</tt>)
+   *                           (<tt>0 &lt;= epsilon &lt;= 1</tt>). To get exact result, set <tt>epsilon=0.0</tt>;
+   * @param delta              the probability that the approximation error is more than than epsilon (e.g.
+   *                           <tt>0.0001</tt>) (<tt>0 &lt;= delta &lt;= 1</tt>). To avoid probabilistic answers, set
+   *                           <tt>delta=0.0</tt>.
+   * @param quantiles          the number of quantiles to be computed (e.g. <tt>100</tt>) (<tt>quantiles &gt;= 1</tt>).
+   *                           If unknown in advance, set this number large, e.g. <tt>quantiles &gt;= 10000</tt>.
    * @param returnSamplingRate a <tt>double[1]</tt> where the sampling rate is to be filled in.
    * @return <tt>long[2]</tt> - <tt>long[0]</tt>=the number of buffers, <tt>long[1]</tt>=the number of elements per
    *         buffer, <tt>returnSamplingRate[0]</tt>=the required sampling rate.
@@ -441,8 +444,8 @@
    * @return the equi-depth phi's
    */
   public static org.apache.mahout.matrix.list.DoubleArrayList newEquiDepthPhis(int quantiles) {
-    org.apache.mahout.matrix.list.DoubleArrayList phis =
-        new org.apache.mahout.matrix.list.DoubleArrayList(quantiles - 1);
+    DoubleArrayList phis =
+        new DoubleArrayList(quantiles - 1);
     for (int i = 1; i <= quantiles - 1; i++) {
       phis.add(i / (double) quantiles);
     }

Modified: lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/jet/stat/quantile/UnknownDoubleQuantileEstimator.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/jet/stat/quantile/UnknownDoubleQuantileEstimator.java?rev=885213&r1=885212&r2=885213&view=diff
==============================================================================
--- lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/jet/stat/quantile/UnknownDoubleQuantileEstimator.java (original)
+++ lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/jet/stat/quantile/UnknownDoubleQuantileEstimator.java Sun Nov 29 11:19:58 2009
@@ -42,10 +42,10 @@
  */
 class UnknownDoubleQuantileEstimator extends DoubleQuantileEstimator {
 
-  protected int currentTreeHeight;
-  protected final int treeHeightStartingSampling;
-  protected WeightedRandomSampler sampler;
-  protected final double precomputeEpsilon;
+  private int currentTreeHeight;
+  private final int treeHeightStartingSampling;
+  private WeightedRandomSampler sampler;
+  private final double precomputeEpsilon;
 
   /**
    * Constructs an approximate quantile finder with b buffers, each having k elements.
@@ -165,7 +165,7 @@
   }
 
   /** To do. This could faster be done without sorting (min and second min). */
-  protected static void sortAscendingByLevel(DoubleBuffer[] fullBuffers) {
+  private static void sortAscendingByLevel(DoubleBuffer[] fullBuffers) {
     new ObjectArrayList(fullBuffers).quickSortFromTo(0, fullBuffers.length - 1,
         new Comparator<Object>() {
           @Override

Modified: lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/GenericPermuting.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/GenericPermuting.java?rev=885213&r1=885212&r2=885213&view=diff
==============================================================================
--- lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/GenericPermuting.java (original)
+++ lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/GenericPermuting.java Sun Nov 29 11:19:58 2009
@@ -8,6 +8,9 @@
 */
 package org.apache.mahout.matrix;
 
+import org.apache.mahout.jet.random.Uniform;
+import org.apache.mahout.jet.random.engine.MersenneTwister;
+
 /**
  Generically reorders (permutes) arbitrary shaped data (for example, an array, three arrays, a 2-d matrix, two linked lists) using an <i>in-place</i> swapping algorithm.
  Imagine having a couple of apples. For some reason you decide to reorder them. The green one before the red one. The pale one after the shiny one, etc. This class helps to do the job.
@@ -153,8 +156,7 @@
       for (int i = N; --i >= 0;) {
         permutation[i] = i;
       }
-      org.apache.mahout.jet.random.Uniform gen =
-          new org.apache.mahout.jet.random.Uniform(new org.apache.mahout.jet.random.engine.MersenneTwister((int) p));
+      Uniform gen = new Uniform(new MersenneTwister((int) p));
       for (int i = 0; i < N - 1; i++) {
         int random = gen.nextIntFromTo(i, N - 1);
 

Modified: lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/Sorting.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/Sorting.java?rev=885213&r1=885212&r2=885213&view=diff
==============================================================================
--- lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/Sorting.java (original)
+++ lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/Sorting.java Sun Nov 29 11:19:58 2009
@@ -15,6 +15,8 @@
 import org.apache.mahout.matrix.function.IntComparator;
 import org.apache.mahout.matrix.function.LongComparator;
 import org.apache.mahout.matrix.function.ShortComparator;
+import org.apache.mahout.matrix.list.DoubleArrayList;
+import org.apache.mahout.matrix.list.FloatArrayList;
 
 import java.util.Comparator;
 /**
@@ -1388,7 +1390,7 @@
 
 // Postprocessing phase: change 0.0's to -0.0's as required
     if (numNegZeros != 0) {
-      int j = new org.apache.mahout.matrix.list.DoubleArrayList(a)
+      int j = new DoubleArrayList(a)
           .binarySearchFromTo(0.0d, fromIndex, n - 1); // posn of ANY zero
       do {
         j--;
@@ -1434,8 +1436,7 @@
 
 // Postprocessing phase: change 0.0's to -0.0's as required
     if (numNegZeros != 0) {
-      int j = new org.apache.mahout.matrix.list.FloatArrayList(a)
-          .binarySearchFromTo(0.0f, fromIndex, n - 1); // posn of ANY zero
+      int j = new FloatArrayList(a).binarySearchFromTo(0.0f, fromIndex, n - 1); // posn of ANY zero
       do {
         j--;
       } while (j >= 0 && a[j] == 0.0f);

Modified: lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/SparseVector.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/SparseVector.java?rev=885213&r1=885212&r2=885213&view=diff
==============================================================================
--- lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/SparseVector.java (original)
+++ lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/SparseVector.java Sun Nov 29 11:19:58 2009
@@ -336,7 +336,7 @@
 
   private class DistanceSquared implements IntDoubleProcedure {
 
-    final Vector v;
+    private final Vector v;
     private double result = 0.0;
 
     private DistanceSquared(Vector v) {

Modified: lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/VectorView.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/VectorView.java?rev=885213&r1=885212&r2=885213&view=diff
==============================================================================
--- lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/VectorView.java (original)
+++ lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/VectorView.java Sun Nov 29 11:19:58 2009
@@ -132,7 +132,7 @@
 
     private Vector.Element el;
 
-    public NonZeroIterator() {
+    private NonZeroIterator() {
       it = vector.iterateAll();
       buffer();
     }
@@ -192,7 +192,7 @@
 
     private Vector.Element el;
 
-    public AllIterator() {
+    private AllIterator() {
       it = vector.iterateAll();
       buffer();
     }
@@ -268,7 +268,7 @@
 
     private final int ind;
 
-    public Element(int ind) {
+    private Element(int ind) {
       this.ind = ind;
     }
 

Modified: lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/bitvector/BitMatrix.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/bitvector/BitMatrix.java?rev=885213&r1=885212&r2=885213&view=diff
==============================================================================
--- lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/bitvector/BitMatrix.java (original)
+++ lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/bitvector/BitMatrix.java Sun Nov 29 11:19:58 2009
@@ -40,8 +40,8 @@
 @Deprecated
 public class BitMatrix extends PersistentObject {
 
-  protected int columns;
-  protected int rows;
+  private int columns;
+  private int rows;
 
   /*
    * The bits of this matrix.
@@ -50,7 +50,7 @@
    * columnOf(bitIndex)==bitIndex%columns
    * rowOf(bitIndex)==bitIndex/columns
    */
-  protected long[] bits;
+  private long[] bits;
 
   /**
    * Constructs a bit matrix with a given number of columns and rows. All bits are initially <tt>false</tt>.
@@ -211,7 +211,7 @@
     if (size()==0) return true;
     BitVector vector = toBitVector();
     return vector.forEachIndexFromToInState(0,size()-1,state,
-      new org.apache.mahout.matrix.function.IntFunction() {
+      new IntFunction() {
         public boolean apply(int index) {
           return function.apply(index%columns, index/columns);
         }

Modified: lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/bitvector/BitVector.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/bitvector/BitVector.java?rev=885213&r1=885212&r2=885213&view=diff
==============================================================================
--- lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/bitvector/BitVector.java (original)
+++ lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/bitvector/BitVector.java Sun Nov 29 11:19:58 2009
@@ -8,6 +8,9 @@
 */
 package org.apache.mahout.matrix.bitvector;
 
+import org.apache.mahout.matrix.PersistentObject;
+import org.apache.mahout.matrix.function.IntProcedure;
+
 /**
  * Fixed sized (non resizable) bitvector.
  * Upon instance construction a bitvector is told to hold a fixed number of bits - it's size.
@@ -49,7 +52,7 @@
 
 /** @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported. */
 @Deprecated
-public class BitVector extends org.apache.mahout.matrix.PersistentObject {
+public class BitVector extends PersistentObject {
   /*
    * Bits are packed into arrays of "units."  Currently a unit is a long,
    * which consists of 64 bits, requiring 6 address bits.  The choice of unit
@@ -60,13 +63,13 @@
    * The bits of this object.  The ith bit is stored in bits[i/64] at bit position i % 64 (where bit position 0 refers
    * to the least significant bit and 63 refers to the most significant bit).
    */
-  protected long[] bits;
+  private long[] bits;
 
-  protected int nbits; //the size
+  private int nbits; //the size
 
   // IntProcedure for method indexOfFromTo(...)
 
-  private static class IndexProcedure implements org.apache.mahout.matrix.function.IntProcedure {
+  private static class IndexProcedure implements IntProcedure {
 
     private int foundPos = -1;
 
@@ -174,7 +177,7 @@
   }
 
   /** Checks if the given range is within the contained array's bounds. */
-  protected static void checkRangeFromTo(int from, int to, int theSize) {
+  private static void checkRangeFromTo(int from, int to, int theSize) {
     if (from < 0 || from > to || to >= theSize) {
       throw new IndexOutOfBoundsException("from: " + from + ", to: " + to + ", size=" + theSize);
     }
@@ -331,7 +334,7 @@
    * @throws IndexOutOfBoundsException if (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
    */
   public boolean forEachIndexFromToInState(int from, int to, boolean state,
-                                           org.apache.mahout.matrix.function.IntProcedure procedure) {
+                                           IntProcedure procedure) {
     /*
     // this version is equivalent to the low level version below, but about 100 times slower for large ranges.
     if (nbits==0) return true;

Modified: lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/bitvector/QuickBitVector.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/bitvector/QuickBitVector.java?rev=885213&r1=885212&r2=885213&view=diff
==============================================================================
--- lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/bitvector/QuickBitVector.java (original)
+++ lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/bitvector/QuickBitVector.java Sun Nov 29 11:19:58 2009
@@ -31,9 +31,9 @@
 @Deprecated
 public class QuickBitVector {
 
-  protected static final int ADDRESS_BITS_PER_UNIT = 6; // 64=2^6
+  private static final int ADDRESS_BITS_PER_UNIT = 6; // 64=2^6
   protected static final int BITS_PER_UNIT = 64; // = 1 << ADDRESS_BITS_PER_UNIT
-  protected static final int BIT_INDEX_MASK = 63; // = BITS_PER_UNIT - 1;
+  private static final int BIT_INDEX_MASK = 63; // = BITS_PER_UNIT - 1;
 
   private static final long[] pows = precomputePows(); //precompute bitmasks for speed
 
@@ -50,7 +50,7 @@
    * @param to   index of end bit (inclusive).
    * @return the bit mask having all bits between <tt>from</tt> and <tt>to</tt> set to 1.
    */
-  public static long bitMaskWithBitsSetFromTo(int from, int to) {
+  private static long bitMaskWithBitsSetFromTo(int from, int to) {
     return pows[to - from + 1] << from;
 
     // This turned out to be slower:

Modified: lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/buffer/DoubleBuffer.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/buffer/DoubleBuffer.java?rev=885213&r1=885212&r2=885213&view=diff
==============================================================================
--- lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/buffer/DoubleBuffer.java (original)
+++ lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/buffer/DoubleBuffer.java Sun Nov 29 11:19:58 2009
@@ -8,6 +8,7 @@
 */
 package org.apache.mahout.matrix.buffer;
 
+import org.apache.mahout.matrix.PersistentObject;
 import org.apache.mahout.matrix.list.DoubleArrayList;
 /**
  * Fixed sized (non resizable) streaming buffer connected to a target <tt>DoubleBufferConsumer</tt> to which data is automatically flushed upon buffer overflow.
@@ -16,15 +17,15 @@
 
 /** @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported. */
 @Deprecated
-public class DoubleBuffer extends org.apache.mahout.matrix.PersistentObject implements DoubleBufferConsumer {
+public class DoubleBuffer extends PersistentObject implements DoubleBufferConsumer {
 
-  protected DoubleBufferConsumer target;
-  protected double[] elements;
+  private final DoubleBufferConsumer target;
+  private final double[] elements;
 
   // vars cached for speed
-  protected DoubleArrayList list;
-  protected int capacity;
-  protected int size;
+  private final DoubleArrayList list;
+  private final int capacity;
+  private int size;
 
   /**
    * Constructs and returns a new buffer with the given target.

Modified: lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/buffer/DoubleBuffer2D.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/buffer/DoubleBuffer2D.java?rev=885213&r1=885212&r2=885213&view=diff
==============================================================================
--- lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/buffer/DoubleBuffer2D.java (original)
+++ lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/buffer/DoubleBuffer2D.java Sun Nov 29 11:19:58 2009
@@ -8,6 +8,7 @@
 */
 package org.apache.mahout.matrix.buffer;
 
+import org.apache.mahout.matrix.PersistentObject;
 import org.apache.mahout.matrix.list.DoubleArrayList;
 /**
  * Fixed sized (non resizable) streaming buffer connected to a target <tt>DoubleBuffer2DConsumer</tt> to which data is automatically flushed upon buffer overflow.
@@ -16,17 +17,17 @@
 
 /** @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported. */
 @Deprecated
-public class DoubleBuffer2D extends org.apache.mahout.matrix.PersistentObject implements DoubleBuffer2DConsumer {
+public class DoubleBuffer2D extends PersistentObject implements DoubleBuffer2DConsumer {
 
-  protected DoubleBuffer2DConsumer target;
-  protected double[] xElements;
-  protected double[] yElements;
+  private final DoubleBuffer2DConsumer target;
+  private final double[] xElements;
+  private final double[] yElements;
 
   // vars cached for speed
-  protected DoubleArrayList xList;
-  protected DoubleArrayList yList;
-  protected int capacity;
-  protected int size;
+  private final DoubleArrayList xList;
+  private final DoubleArrayList yList;
+  private final int capacity;
+  private int size;
 
   /**
    * Constructs and returns a new buffer with the given target.

Modified: lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/buffer/DoubleBuffer3D.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/buffer/DoubleBuffer3D.java?rev=885213&r1=885212&r2=885213&view=diff
==============================================================================
--- lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/buffer/DoubleBuffer3D.java (original)
+++ lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/buffer/DoubleBuffer3D.java Sun Nov 29 11:19:58 2009
@@ -8,6 +8,7 @@
 */
 package org.apache.mahout.matrix.buffer;
 
+import org.apache.mahout.matrix.PersistentObject;
 import org.apache.mahout.matrix.list.DoubleArrayList;
 /**
  * Fixed sized (non resizable) streaming buffer connected to a target <tt>DoubleBuffer3DConsumer</tt> to which data is automatically flushed upon buffer overflow.
@@ -16,19 +17,19 @@
 
 /** @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported. */
 @Deprecated
-public class DoubleBuffer3D extends org.apache.mahout.matrix.PersistentObject implements DoubleBuffer3DConsumer {
+public class DoubleBuffer3D extends PersistentObject implements DoubleBuffer3DConsumer {
 
-  protected DoubleBuffer3DConsumer target;
-  protected double[] xElements;
-  protected double[] yElements;
-  protected double[] zElements;
+  private final DoubleBuffer3DConsumer target;
+  private final double[] xElements;
+  private final double[] yElements;
+  private final double[] zElements;
 
   // vars cached for speed
-  protected DoubleArrayList xList;
-  protected DoubleArrayList yList;
-  protected DoubleArrayList zList;
-  protected int capacity;
-  protected int size;
+  private final DoubleArrayList xList;
+  private final DoubleArrayList yList;
+  private final DoubleArrayList zList;
+  private final int capacity;
+  private int size;
 
   /**
    * Constructs and returns a new buffer with the given target.

Modified: lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/buffer/IntBuffer.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/buffer/IntBuffer.java?rev=885213&r1=885212&r2=885213&view=diff
==============================================================================
--- lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/buffer/IntBuffer.java (original)
+++ lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/buffer/IntBuffer.java Sun Nov 29 11:19:58 2009
@@ -8,6 +8,7 @@
 */
 package org.apache.mahout.matrix.buffer;
 
+import org.apache.mahout.matrix.PersistentObject;
 import org.apache.mahout.matrix.list.IntArrayList;
 /**
  * Fixed sized (non resizable) streaming buffer connected to a target <tt>IntBufferConsumer</tt> to which data is automatically flushed upon buffer overflow.
@@ -16,15 +17,15 @@
 
 /** @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported. */
 @Deprecated
-public class IntBuffer extends org.apache.mahout.matrix.PersistentObject implements IntBufferConsumer {
+public class IntBuffer extends PersistentObject implements IntBufferConsumer {
 
-  protected IntBufferConsumer target;
-  protected int[] elements;
+  private final IntBufferConsumer target;
+  private final int[] elements;
 
   // vars cached for speed
-  protected IntArrayList list;
-  protected int capacity;
-  protected int size;
+  private final IntArrayList list;
+  private final int capacity;
+  private int size;
 
   /**
    * Constructs and returns a new buffer with the given target.

Modified: lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/buffer/IntBuffer2D.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/buffer/IntBuffer2D.java?rev=885213&r1=885212&r2=885213&view=diff
==============================================================================
--- lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/buffer/IntBuffer2D.java (original)
+++ lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/buffer/IntBuffer2D.java Sun Nov 29 11:19:58 2009
@@ -8,6 +8,7 @@
 */
 package org.apache.mahout.matrix.buffer;
 
+import org.apache.mahout.matrix.PersistentObject;
 import org.apache.mahout.matrix.list.IntArrayList;
 /**
  * Fixed sized (non resizable) streaming buffer connected to a target <tt>IntBuffer2DConsumer</tt> to which data is automatically flushed upon buffer overflow.
@@ -16,17 +17,17 @@
 
 /** @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported. */
 @Deprecated
-public class IntBuffer2D extends org.apache.mahout.matrix.PersistentObject implements IntBuffer2DConsumer {
+public class IntBuffer2D extends PersistentObject implements IntBuffer2DConsumer {
 
-  protected IntBuffer2DConsumer target;
-  protected int[] xElements;
-  protected int[] yElements;
+  private final IntBuffer2DConsumer target;
+  private final int[] xElements;
+  private final int[] yElements;
 
   // vars cached for speed
-  protected IntArrayList xList;
-  protected IntArrayList yList;
-  protected int capacity;
-  protected int size;
+  private final IntArrayList xList;
+  private final IntArrayList yList;
+  private final int capacity;
+  private int size;
 
   /**
    * Constructs and returns a new buffer with the given target.

Modified: lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/buffer/IntBuffer3D.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/buffer/IntBuffer3D.java?rev=885213&r1=885212&r2=885213&view=diff
==============================================================================
--- lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/buffer/IntBuffer3D.java (original)
+++ lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/buffer/IntBuffer3D.java Sun Nov 29 11:19:58 2009
@@ -8,6 +8,7 @@
 */
 package org.apache.mahout.matrix.buffer;
 
+import org.apache.mahout.matrix.PersistentObject;
 import org.apache.mahout.matrix.list.IntArrayList;
 /**
  * Fixed sized (non resizable) streaming buffer connected to a target <tt>IntBuffer3DConsumer</tt> to which data is automatically flushed upon buffer overflow.
@@ -16,19 +17,19 @@
 
 /** @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported. */
 @Deprecated
-public class IntBuffer3D extends org.apache.mahout.matrix.PersistentObject implements IntBuffer3DConsumer {
+public class IntBuffer3D extends PersistentObject implements IntBuffer3DConsumer {
 
-  protected IntBuffer3DConsumer target;
-  protected int[] xElements;
-  protected int[] yElements;
-  protected int[] zElements;
+  private final IntBuffer3DConsumer target;
+  private final int[] xElements;
+  private final int[] yElements;
+  private final int[] zElements;
 
   // vars cached for speed
-  protected IntArrayList xList;
-  protected IntArrayList yList;
-  protected IntArrayList zList;
-  protected int capacity;
-  protected int size;
+  private final IntArrayList xList;
+  private final IntArrayList yList;
+  private final IntArrayList zList;
+  private final int capacity;
+  private int size;
 
   /**
    * Constructs and returns a new buffer with the given target.

Modified: lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/buffer/ObjectBuffer.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/buffer/ObjectBuffer.java?rev=885213&r1=885212&r2=885213&view=diff
==============================================================================
--- lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/buffer/ObjectBuffer.java (original)
+++ lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/buffer/ObjectBuffer.java Sun Nov 29 11:19:58 2009
@@ -8,6 +8,7 @@
 */
 package org.apache.mahout.matrix.buffer;
 
+import org.apache.mahout.matrix.PersistentObject;
 import org.apache.mahout.matrix.list.ObjectArrayList;
 /**
  * Fixed sized (non resizable) streaming buffer connected to a target <tt>ObjectBufferConsumer</tt> to which data is automatically flushed upon buffer overflow.
@@ -16,15 +17,15 @@
 
 /** @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported. */
 @Deprecated
-public class ObjectBuffer extends org.apache.mahout.matrix.PersistentObject implements ObjectBufferConsumer {
+public class ObjectBuffer extends PersistentObject implements ObjectBufferConsumer {
 
-  protected ObjectBufferConsumer target;
-  protected Object[] elements;
+  private final ObjectBufferConsumer target;
+  private final Object[] elements;
 
   // vars cached for speed
-  protected ObjectArrayList list;
-  protected int capacity;
-  protected int size;
+  private final ObjectArrayList list;
+  private final int capacity;
+  private int size;
 
   /**
    * Constructs and returns a new buffer with the given target.

Modified: lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/list/AbstractBooleanList.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/list/AbstractBooleanList.java?rev=885213&r1=885212&r2=885213&view=diff
==============================================================================
--- lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/list/AbstractBooleanList.java (original)
+++ lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/list/AbstractBooleanList.java Sun Nov 29 11:19:58 2009
@@ -8,10 +8,13 @@
 */
 package org.apache.mahout.matrix.list;
 
+import org.apache.mahout.jet.random.Uniform;
+import org.apache.mahout.jet.random.engine.DRand;
 import org.apache.mahout.matrix.function.BooleanProcedure;
 
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.Date;
 import java.util.Iterator;
 import java.util.List;
 
@@ -508,32 +511,41 @@
    * @param otherTo   the last element of the other list (inclusive)
    *
    *                  <p><b>Examples:</b><pre>
-   *                                                    a=[0, 1, 2, 3, 4, 5, 6, 7]
-   *                                                    b=[50, 60, 70, 80, 90]
-   *                                                    a.R(...)=a.replaceFromToWithFromTo(...)
-   *
-   *                                                    a.R(3,5,b,0,4)-->[0, 1, 2, 50, 60, 70, 80, 90, 6, 7]
-   *                                                    a.R(1,6,b,0,4)-->[0, 50, 60, 70, 80, 90, 7]
-   *                                                    a.R(0,6,b,0,4)-->[50, 60, 70, 80, 90, 7]
-   *                                                    a.R(3,5,b,1,2)-->[0, 1, 2, 60, 70, 6, 7]
-   *                                                    a.R(1,6,b,1,2)-->[0, 60, 70, 7]
-   *                                                    a.R(0,6,b,1,2)-->[60, 70, 7]
-   *                                                    a.R(5,3,b,0,4)-->[0, 1, 2, 3, 4, 50, 60, 70, 80, 90, 5, 6, 7]
-   *                                                    a.R(5,0,b,0,4)-->[0, 1, 2, 3, 4, 50, 60, 70, 80, 90, 5, 6, 7]
-   *                                                    a.R(5,3,b,1,2)-->[0, 1, 2, 3, 4, 60, 70, 5, 6, 7]
-   *                                                    a.R(5,0,b,1,2)-->[0, 1, 2, 3, 4, 60, 70, 5, 6, 7]
-   *
-   *                                                    Extreme cases:
-   *                                                    a.R(5,3,b,0,0)-->[0, 1, 2, 3, 4, 50, 5, 6, 7]
-   *                                                    a.R(5,3,b,4,4)-->[0, 1, 2, 3, 4, 90, 5, 6, 7]
-   *                                                    a.R(3,5,a,0,1)-->[0, 1, 2, 0, 1, 6, 7]
-   *                                                    a.R(3,5,a,3,5)-->[0, 1, 2, 3, 4, 5, 6, 7]
-   *                                                    a.R(3,5,a,4,4)-->[0, 1, 2, 4, 6, 7]
-   *                                                    a.R(5,3,a,0,4)-->[0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 5, 6, 7]
-   *                                                    a.R(0,-1,b,0,4)-->[50, 60, 70, 80, 90, 0, 1, 2, 3, 4, 5, 6, 7]
-   *                                                    a.R(0,-1,a,0,4)-->[0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 5, 6, 7]
-   *                                                    a.R(8,0,a,0,4)-->[0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4]
-   *                                                    </pre>
+   *                                                                     a=[0, 1, 2, 3, 4, 5, 6, 7]
+   *                                                                     b=[50, 60, 70, 80, 90]
+   *                                                                     a.R(...)=a.replaceFromToWithFromTo(...)
+   *
+   *                                                                     a.R(3,5,b,0,4)-->[0, 1, 2, 50, 60, 70, 80, 90,
+   *                  6, 7]
+   *                                                                     a.R(1,6,b,0,4)-->[0, 50, 60, 70, 80, 90, 7]
+   *                                                                     a.R(0,6,b,0,4)-->[50, 60, 70, 80, 90, 7]
+   *                                                                     a.R(3,5,b,1,2)-->[0, 1, 2, 60, 70, 6, 7]
+   *                                                                     a.R(1,6,b,1,2)-->[0, 60, 70, 7]
+   *                                                                     a.R(0,6,b,1,2)-->[60, 70, 7]
+   *                                                                     a.R(5,3,b,0,4)-->[0, 1, 2, 3, 4, 50, 60, 70,
+   *                  80, 90, 5, 6, 7]
+   *                                                                     a.R(5,0,b,0,4)-->[0, 1, 2, 3, 4, 50, 60, 70,
+   *                  80, 90, 5, 6, 7]
+   *                                                                     a.R(5,3,b,1,2)-->[0, 1, 2, 3, 4, 60, 70, 5, 6,
+   *                  7]
+   *                                                                     a.R(5,0,b,1,2)-->[0, 1, 2, 3, 4, 60, 70, 5, 6,
+   *                  7]
+   *
+   *                                                                     Extreme cases:
+   *                                                                     a.R(5,3,b,0,0)-->[0, 1, 2, 3, 4, 50, 5, 6, 7]
+   *                                                                     a.R(5,3,b,4,4)-->[0, 1, 2, 3, 4, 90, 5, 6, 7]
+   *                                                                     a.R(3,5,a,0,1)-->[0, 1, 2, 0, 1, 6, 7]
+   *                                                                     a.R(3,5,a,3,5)-->[0, 1, 2, 3, 4, 5, 6, 7]
+   *                                                                     a.R(3,5,a,4,4)-->[0, 1, 2, 4, 6, 7]
+   *                                                                     a.R(5,3,a,0,4)-->[0, 1, 2, 3, 4, 0, 1, 2, 3, 4,
+   *                  5, 6, 7]
+   *                                                                     a.R(0,-1,b,0,4)-->[50, 60, 70, 80, 90, 0, 1, 2,
+   *                  3, 4, 5, 6, 7]
+   *                                                                     a.R(0,-1,a,0,4)-->[0, 1, 2, 3, 4, 0, 1, 2, 3,
+   *                  4, 5, 6, 7]
+   *                                                                     a.R(8,0,a,0,4)-->[0, 1, 2, 3, 4, 5, 6, 7, 0, 1,
+   *                  2, 3, 4]
+   *                                                                     </pre>
    */
   public void replaceFromToWithFromTo(int from, int to, AbstractBooleanList other, int otherFrom, int otherTo) {
     if (otherFrom > otherTo) {
@@ -683,8 +695,7 @@
   public void shuffleFromTo(int from, int to) {
     checkRangeFromTo(from, to, size());
 
-    org.apache.mahout.jet.random.Uniform gen =
-        new org.apache.mahout.jet.random.Uniform(new org.apache.mahout.jet.random.engine.DRand(new java.util.Date()));
+    Uniform gen = new Uniform(new DRand(new Date()));
     for (int i = from; i < to; i++) {
       int random = gen.nextIntFromTo(i, to);
 
@@ -715,7 +726,7 @@
   }
 
   /** Transforms a boolean value to an integer (false --> 0, true --> 1) */
-  protected static int toInt(boolean value) {
+  private static int toInt(boolean value) {
     return value ? 1 : 0;
   }
 

Modified: lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/list/AbstractByteList.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/list/AbstractByteList.java?rev=885213&r1=885212&r2=885213&view=diff
==============================================================================
--- lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/list/AbstractByteList.java (original)
+++ lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/list/AbstractByteList.java Sun Nov 29 11:19:58 2009
@@ -8,11 +8,15 @@
 */
 package org.apache.mahout.matrix.list;
 
+import org.apache.mahout.jet.random.Uniform;
+import org.apache.mahout.jet.random.engine.DRand;
+import org.apache.mahout.matrix.Sorting;
 import org.apache.mahout.matrix.function.ByteComparator;
 import org.apache.mahout.matrix.function.ByteProcedure;
 
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.Date;
 import java.util.Iterator;
 import java.util.List;
 /**
@@ -417,7 +421,7 @@
     checkRangeFromTo(from, to, mySize);
 
     byte[] myElements = elements();
-    org.apache.mahout.matrix.Sorting.mergeSort(myElements, from, to + 1);
+    Sorting.mergeSort(myElements, from, to + 1);
     elements(myElements);
     setSizeRaw(mySize);
   }
@@ -448,7 +452,7 @@
     checkRangeFromTo(from, to, mySize);
 
     byte[] myElements = elements();
-    org.apache.mahout.matrix.Sorting.mergeSort(myElements, from, to + 1, c);
+    Sorting.mergeSort(myElements, from, to + 1, c);
     elements(myElements);
     setSizeRaw(mySize);
   }
@@ -522,7 +526,7 @@
     checkRangeFromTo(from, to, mySize);
 
     byte[] myElements = elements();
-    org.apache.mahout.matrix.Sorting.quickSort(myElements, from, to + 1, c);
+    Sorting.quickSort(myElements, from, to + 1, c);
     elements(myElements);
     setSizeRaw(mySize);
   }
@@ -620,32 +624,41 @@
    * @param otherTo   the last element of the other list (inclusive)
    *
    *                  <p><b>Examples:</b><pre>
-   *                                                    a=[0, 1, 2, 3, 4, 5, 6, 7]
-   *                                                    b=[50, 60, 70, 80, 90]
-   *                                                    a.R(...)=a.replaceFromToWithFromTo(...)
-   *
-   *                                                    a.R(3,5,b,0,4)-->[0, 1, 2, 50, 60, 70, 80, 90, 6, 7]
-   *                                                    a.R(1,6,b,0,4)-->[0, 50, 60, 70, 80, 90, 7]
-   *                                                    a.R(0,6,b,0,4)-->[50, 60, 70, 80, 90, 7]
-   *                                                    a.R(3,5,b,1,2)-->[0, 1, 2, 60, 70, 6, 7]
-   *                                                    a.R(1,6,b,1,2)-->[0, 60, 70, 7]
-   *                                                    a.R(0,6,b,1,2)-->[60, 70, 7]
-   *                                                    a.R(5,3,b,0,4)-->[0, 1, 2, 3, 4, 50, 60, 70, 80, 90, 5, 6, 7]
-   *                                                    a.R(5,0,b,0,4)-->[0, 1, 2, 3, 4, 50, 60, 70, 80, 90, 5, 6, 7]
-   *                                                    a.R(5,3,b,1,2)-->[0, 1, 2, 3, 4, 60, 70, 5, 6, 7]
-   *                                                    a.R(5,0,b,1,2)-->[0, 1, 2, 3, 4, 60, 70, 5, 6, 7]
-   *
-   *                                                    Extreme cases:
-   *                                                    a.R(5,3,b,0,0)-->[0, 1, 2, 3, 4, 50, 5, 6, 7]
-   *                                                    a.R(5,3,b,4,4)-->[0, 1, 2, 3, 4, 90, 5, 6, 7]
-   *                                                    a.R(3,5,a,0,1)-->[0, 1, 2, 0, 1, 6, 7]
-   *                                                    a.R(3,5,a,3,5)-->[0, 1, 2, 3, 4, 5, 6, 7]
-   *                                                    a.R(3,5,a,4,4)-->[0, 1, 2, 4, 6, 7]
-   *                                                    a.R(5,3,a,0,4)-->[0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 5, 6, 7]
-   *                                                    a.R(0,-1,b,0,4)-->[50, 60, 70, 80, 90, 0, 1, 2, 3, 4, 5, 6, 7]
-   *                                                    a.R(0,-1,a,0,4)-->[0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 5, 6, 7]
-   *                                                    a.R(8,0,a,0,4)-->[0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4]
-   *                                                    </pre>
+   *                                                                     a=[0, 1, 2, 3, 4, 5, 6, 7]
+   *                                                                     b=[50, 60, 70, 80, 90]
+   *                                                                     a.R(...)=a.replaceFromToWithFromTo(...)
+   *
+   *                                                                     a.R(3,5,b,0,4)-->[0, 1, 2, 50, 60, 70, 80, 90,
+   *                  6, 7]
+   *                                                                     a.R(1,6,b,0,4)-->[0, 50, 60, 70, 80, 90, 7]
+   *                                                                     a.R(0,6,b,0,4)-->[50, 60, 70, 80, 90, 7]
+   *                                                                     a.R(3,5,b,1,2)-->[0, 1, 2, 60, 70, 6, 7]
+   *                                                                     a.R(1,6,b,1,2)-->[0, 60, 70, 7]
+   *                                                                     a.R(0,6,b,1,2)-->[60, 70, 7]
+   *                                                                     a.R(5,3,b,0,4)-->[0, 1, 2, 3, 4, 50, 60, 70,
+   *                  80, 90, 5, 6, 7]
+   *                                                                     a.R(5,0,b,0,4)-->[0, 1, 2, 3, 4, 50, 60, 70,
+   *                  80, 90, 5, 6, 7]
+   *                                                                     a.R(5,3,b,1,2)-->[0, 1, 2, 3, 4, 60, 70, 5, 6,
+   *                  7]
+   *                                                                     a.R(5,0,b,1,2)-->[0, 1, 2, 3, 4, 60, 70, 5, 6,
+   *                  7]
+   *
+   *                                                                     Extreme cases:
+   *                                                                     a.R(5,3,b,0,0)-->[0, 1, 2, 3, 4, 50, 5, 6, 7]
+   *                                                                     a.R(5,3,b,4,4)-->[0, 1, 2, 3, 4, 90, 5, 6, 7]
+   *                                                                     a.R(3,5,a,0,1)-->[0, 1, 2, 0, 1, 6, 7]
+   *                                                                     a.R(3,5,a,3,5)-->[0, 1, 2, 3, 4, 5, 6, 7]
+   *                                                                     a.R(3,5,a,4,4)-->[0, 1, 2, 4, 6, 7]
+   *                                                                     a.R(5,3,a,0,4)-->[0, 1, 2, 3, 4, 0, 1, 2, 3, 4,
+   *                  5, 6, 7]
+   *                                                                     a.R(0,-1,b,0,4)-->[50, 60, 70, 80, 90, 0, 1, 2,
+   *                  3, 4, 5, 6, 7]
+   *                                                                     a.R(0,-1,a,0,4)-->[0, 1, 2, 3, 4, 0, 1, 2, 3,
+   *                  4, 5, 6, 7]
+   *                                                                     a.R(8,0,a,0,4)-->[0, 1, 2, 3, 4, 5, 6, 7, 0, 1,
+   *                  2, 3, 4]
+   *                                                                     </pre>
    */
   public void replaceFromToWithFromTo(int from, int to, AbstractByteList other, int otherFrom, int otherTo) {
     if (otherFrom > otherTo) {
@@ -795,8 +808,7 @@
   public void shuffleFromTo(int from, int to) {
     checkRangeFromTo(from, to, size());
 
-    org.apache.mahout.jet.random.Uniform gen =
-        new org.apache.mahout.jet.random.Uniform(new org.apache.mahout.jet.random.engine.DRand(new java.util.Date()));
+    Uniform gen = new Uniform(new DRand(new Date()));
     for (int i = from; i < to; i++) {
       int random = gen.nextIntFromTo(i, to);
 

Modified: lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/list/AbstractCharList.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/list/AbstractCharList.java?rev=885213&r1=885212&r2=885213&view=diff
==============================================================================
--- lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/list/AbstractCharList.java (original)
+++ lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/list/AbstractCharList.java Sun Nov 29 11:19:58 2009
@@ -8,11 +8,15 @@
 */
 package org.apache.mahout.matrix.list;
 
+import org.apache.mahout.jet.random.Uniform;
+import org.apache.mahout.jet.random.engine.DRand;
+import org.apache.mahout.matrix.Sorting;
 import org.apache.mahout.matrix.function.CharComparator;
 import org.apache.mahout.matrix.function.CharProcedure;
 
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.Date;
 import java.util.Iterator;
 import java.util.List;
 /**
@@ -417,7 +421,7 @@
     checkRangeFromTo(from, to, mySize);
 
     char[] myElements = elements();
-    org.apache.mahout.matrix.Sorting.mergeSort(myElements, from, to + 1);
+    Sorting.mergeSort(myElements, from, to + 1);
     elements(myElements);
     setSizeRaw(mySize);
   }
@@ -448,7 +452,7 @@
     checkRangeFromTo(from, to, mySize);
 
     char[] myElements = elements();
-    org.apache.mahout.matrix.Sorting.mergeSort(myElements, from, to + 1, c);
+    Sorting.mergeSort(myElements, from, to + 1, c);
     elements(myElements);
     setSizeRaw(mySize);
   }
@@ -522,7 +526,7 @@
     checkRangeFromTo(from, to, mySize);
 
     char[] myElements = elements();
-    org.apache.mahout.matrix.Sorting.quickSort(myElements, from, to + 1, c);
+    Sorting.quickSort(myElements, from, to + 1, c);
     elements(myElements);
     setSizeRaw(mySize);
   }
@@ -620,32 +624,41 @@
    * @param otherTo   the last element of the other list (inclusive)
    *
    *                  <p><b>Examples:</b><pre>
-   *                                                    a=[0, 1, 2, 3, 4, 5, 6, 7]
-   *                                                    b=[50, 60, 70, 80, 90]
-   *                                                    a.R(...)=a.replaceFromToWithFromTo(...)
-   *
-   *                                                    a.R(3,5,b,0,4)-->[0, 1, 2, 50, 60, 70, 80, 90, 6, 7]
-   *                                                    a.R(1,6,b,0,4)-->[0, 50, 60, 70, 80, 90, 7]
-   *                                                    a.R(0,6,b,0,4)-->[50, 60, 70, 80, 90, 7]
-   *                                                    a.R(3,5,b,1,2)-->[0, 1, 2, 60, 70, 6, 7]
-   *                                                    a.R(1,6,b,1,2)-->[0, 60, 70, 7]
-   *                                                    a.R(0,6,b,1,2)-->[60, 70, 7]
-   *                                                    a.R(5,3,b,0,4)-->[0, 1, 2, 3, 4, 50, 60, 70, 80, 90, 5, 6, 7]
-   *                                                    a.R(5,0,b,0,4)-->[0, 1, 2, 3, 4, 50, 60, 70, 80, 90, 5, 6, 7]
-   *                                                    a.R(5,3,b,1,2)-->[0, 1, 2, 3, 4, 60, 70, 5, 6, 7]
-   *                                                    a.R(5,0,b,1,2)-->[0, 1, 2, 3, 4, 60, 70, 5, 6, 7]
-   *
-   *                                                    Extreme cases:
-   *                                                    a.R(5,3,b,0,0)-->[0, 1, 2, 3, 4, 50, 5, 6, 7]
-   *                                                    a.R(5,3,b,4,4)-->[0, 1, 2, 3, 4, 90, 5, 6, 7]
-   *                                                    a.R(3,5,a,0,1)-->[0, 1, 2, 0, 1, 6, 7]
-   *                                                    a.R(3,5,a,3,5)-->[0, 1, 2, 3, 4, 5, 6, 7]
-   *                                                    a.R(3,5,a,4,4)-->[0, 1, 2, 4, 6, 7]
-   *                                                    a.R(5,3,a,0,4)-->[0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 5, 6, 7]
-   *                                                    a.R(0,-1,b,0,4)-->[50, 60, 70, 80, 90, 0, 1, 2, 3, 4, 5, 6, 7]
-   *                                                    a.R(0,-1,a,0,4)-->[0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 5, 6, 7]
-   *                                                    a.R(8,0,a,0,4)-->[0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4]
-   *                                                    </pre>
+   *                                                                     a=[0, 1, 2, 3, 4, 5, 6, 7]
+   *                                                                     b=[50, 60, 70, 80, 90]
+   *                                                                     a.R(...)=a.replaceFromToWithFromTo(...)
+   *
+   *                                                                     a.R(3,5,b,0,4)-->[0, 1, 2, 50, 60, 70, 80, 90,
+   *                  6, 7]
+   *                                                                     a.R(1,6,b,0,4)-->[0, 50, 60, 70, 80, 90, 7]
+   *                                                                     a.R(0,6,b,0,4)-->[50, 60, 70, 80, 90, 7]
+   *                                                                     a.R(3,5,b,1,2)-->[0, 1, 2, 60, 70, 6, 7]
+   *                                                                     a.R(1,6,b,1,2)-->[0, 60, 70, 7]
+   *                                                                     a.R(0,6,b,1,2)-->[60, 70, 7]
+   *                                                                     a.R(5,3,b,0,4)-->[0, 1, 2, 3, 4, 50, 60, 70,
+   *                  80, 90, 5, 6, 7]
+   *                                                                     a.R(5,0,b,0,4)-->[0, 1, 2, 3, 4, 50, 60, 70,
+   *                  80, 90, 5, 6, 7]
+   *                                                                     a.R(5,3,b,1,2)-->[0, 1, 2, 3, 4, 60, 70, 5, 6,
+   *                  7]
+   *                                                                     a.R(5,0,b,1,2)-->[0, 1, 2, 3, 4, 60, 70, 5, 6,
+   *                  7]
+   *
+   *                                                                     Extreme cases:
+   *                                                                     a.R(5,3,b,0,0)-->[0, 1, 2, 3, 4, 50, 5, 6, 7]
+   *                                                                     a.R(5,3,b,4,4)-->[0, 1, 2, 3, 4, 90, 5, 6, 7]
+   *                                                                     a.R(3,5,a,0,1)-->[0, 1, 2, 0, 1, 6, 7]
+   *                                                                     a.R(3,5,a,3,5)-->[0, 1, 2, 3, 4, 5, 6, 7]
+   *                                                                     a.R(3,5,a,4,4)-->[0, 1, 2, 4, 6, 7]
+   *                                                                     a.R(5,3,a,0,4)-->[0, 1, 2, 3, 4, 0, 1, 2, 3, 4,
+   *                  5, 6, 7]
+   *                                                                     a.R(0,-1,b,0,4)-->[50, 60, 70, 80, 90, 0, 1, 2,
+   *                  3, 4, 5, 6, 7]
+   *                                                                     a.R(0,-1,a,0,4)-->[0, 1, 2, 3, 4, 0, 1, 2, 3,
+   *                  4, 5, 6, 7]
+   *                                                                     a.R(8,0,a,0,4)-->[0, 1, 2, 3, 4, 5, 6, 7, 0, 1,
+   *                  2, 3, 4]
+   *                                                                     </pre>
    */
   public void replaceFromToWithFromTo(int from, int to, AbstractCharList other, int otherFrom, int otherTo) {
     if (otherFrom > otherTo) {
@@ -795,8 +808,7 @@
   public void shuffleFromTo(int from, int to) {
     checkRangeFromTo(from, to, size());
 
-    org.apache.mahout.jet.random.Uniform gen =
-        new org.apache.mahout.jet.random.Uniform(new org.apache.mahout.jet.random.engine.DRand(new java.util.Date()));
+    Uniform gen = new Uniform(new DRand(new Date()));
     for (int i = from; i < to; i++) {
       int random = gen.nextIntFromTo(i, to);
 

Modified: lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/list/AbstractCollection.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/list/AbstractCollection.java?rev=885213&r1=885212&r2=885213&view=diff
==============================================================================
--- lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/list/AbstractCollection.java (original)
+++ lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/list/AbstractCollection.java Sun Nov 29 11:19:58 2009
@@ -8,6 +8,8 @@
 */
 package org.apache.mahout.matrix.list;
 
+import org.apache.mahout.matrix.PersistentObject;
+
 import java.util.List;
 
 /**
@@ -27,7 +29,7 @@
 
 /** @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported. */
 @Deprecated
-public abstract class AbstractCollection<T> extends org.apache.mahout.matrix.PersistentObject {
+public abstract class AbstractCollection<T> extends PersistentObject {
 
   /** Makes this class non instantiable, but still let's others inherit from it. */
   protected AbstractCollection() {

Modified: lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/list/AbstractDoubleList.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/list/AbstractDoubleList.java?rev=885213&r1=885212&r2=885213&view=diff
==============================================================================
--- lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/list/AbstractDoubleList.java (original)
+++ lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/list/AbstractDoubleList.java Sun Nov 29 11:19:58 2009
@@ -9,6 +9,8 @@
 package org.apache.mahout.matrix.list;
 
 import org.apache.mahout.jet.random.AbstractDistribution;
+import org.apache.mahout.jet.random.Uniform;
+import org.apache.mahout.matrix.Sorting;
 import org.apache.mahout.matrix.function.DoubleComparator;
 import org.apache.mahout.matrix.function.DoubleProcedure;
 
@@ -429,7 +431,7 @@
     checkRangeFromTo(from, to, mySize);
 
     double[] myElements = elements();
-    org.apache.mahout.matrix.Sorting.mergeSort(myElements, from, to + 1);
+    Sorting.mergeSort(myElements, from, to + 1);
     elements(myElements);
     setSizeRaw(mySize);
   }
@@ -460,7 +462,7 @@
     checkRangeFromTo(from, to, mySize);
 
     double[] myElements = elements();
-    org.apache.mahout.matrix.Sorting.mergeSort(myElements, from, to + 1, c);
+    Sorting.mergeSort(myElements, from, to + 1, c);
     elements(myElements);
     setSizeRaw(mySize);
   }
@@ -536,7 +538,7 @@
     checkRangeFromTo(from, to, mySize);
 
     double[] myElements = elements();
-    org.apache.mahout.matrix.Sorting.quickSort(myElements, from, to + 1, c);
+    Sorting.quickSort(myElements, from, to + 1, c);
     elements(myElements);
     setSizeRaw(mySize);
   }
@@ -634,32 +636,41 @@
    * @param otherTo   the last element of the other list (inclusive)
    *
    *                  <p><b>Examples:</b><pre>
-   *                                                    a=[0, 1, 2, 3, 4, 5, 6, 7]
-   *                                                    b=[50, 60, 70, 80, 90]
-   *                                                    a.R(...)=a.replaceFromToWithFromTo(...)
-   *
-   *                                                    a.R(3,5,b,0,4)-->[0, 1, 2, 50, 60, 70, 80, 90, 6, 7]
-   *                                                    a.R(1,6,b,0,4)-->[0, 50, 60, 70, 80, 90, 7]
-   *                                                    a.R(0,6,b,0,4)-->[50, 60, 70, 80, 90, 7]
-   *                                                    a.R(3,5,b,1,2)-->[0, 1, 2, 60, 70, 6, 7]
-   *                                                    a.R(1,6,b,1,2)-->[0, 60, 70, 7]
-   *                                                    a.R(0,6,b,1,2)-->[60, 70, 7]
-   *                                                    a.R(5,3,b,0,4)-->[0, 1, 2, 3, 4, 50, 60, 70, 80, 90, 5, 6, 7]
-   *                                                    a.R(5,0,b,0,4)-->[0, 1, 2, 3, 4, 50, 60, 70, 80, 90, 5, 6, 7]
-   *                                                    a.R(5,3,b,1,2)-->[0, 1, 2, 3, 4, 60, 70, 5, 6, 7]
-   *                                                    a.R(5,0,b,1,2)-->[0, 1, 2, 3, 4, 60, 70, 5, 6, 7]
-   *
-   *                                                    Extreme cases:
-   *                                                    a.R(5,3,b,0,0)-->[0, 1, 2, 3, 4, 50, 5, 6, 7]
-   *                                                    a.R(5,3,b,4,4)-->[0, 1, 2, 3, 4, 90, 5, 6, 7]
-   *                                                    a.R(3,5,a,0,1)-->[0, 1, 2, 0, 1, 6, 7]
-   *                                                    a.R(3,5,a,3,5)-->[0, 1, 2, 3, 4, 5, 6, 7]
-   *                                                    a.R(3,5,a,4,4)-->[0, 1, 2, 4, 6, 7]
-   *                                                    a.R(5,3,a,0,4)-->[0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 5, 6, 7]
-   *                                                    a.R(0,-1,b,0,4)-->[50, 60, 70, 80, 90, 0, 1, 2, 3, 4, 5, 6, 7]
-   *                                                    a.R(0,-1,a,0,4)-->[0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 5, 6, 7]
-   *                                                    a.R(8,0,a,0,4)-->[0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4]
-   *                                                    </pre>
+   *                                                                     a=[0, 1, 2, 3, 4, 5, 6, 7]
+   *                                                                     b=[50, 60, 70, 80, 90]
+   *                                                                     a.R(...)=a.replaceFromToWithFromTo(...)
+   *
+   *                                                                     a.R(3,5,b,0,4)-->[0, 1, 2, 50, 60, 70, 80, 90,
+   *                  6, 7]
+   *                                                                     a.R(1,6,b,0,4)-->[0, 50, 60, 70, 80, 90, 7]
+   *                                                                     a.R(0,6,b,0,4)-->[50, 60, 70, 80, 90, 7]
+   *                                                                     a.R(3,5,b,1,2)-->[0, 1, 2, 60, 70, 6, 7]
+   *                                                                     a.R(1,6,b,1,2)-->[0, 60, 70, 7]
+   *                                                                     a.R(0,6,b,1,2)-->[60, 70, 7]
+   *                                                                     a.R(5,3,b,0,4)-->[0, 1, 2, 3, 4, 50, 60, 70,
+   *                  80, 90, 5, 6, 7]
+   *                                                                     a.R(5,0,b,0,4)-->[0, 1, 2, 3, 4, 50, 60, 70,
+   *                  80, 90, 5, 6, 7]
+   *                                                                     a.R(5,3,b,1,2)-->[0, 1, 2, 3, 4, 60, 70, 5, 6,
+   *                  7]
+   *                                                                     a.R(5,0,b,1,2)-->[0, 1, 2, 3, 4, 60, 70, 5, 6,
+   *                  7]
+   *
+   *                                                                     Extreme cases:
+   *                                                                     a.R(5,3,b,0,0)-->[0, 1, 2, 3, 4, 50, 5, 6, 7]
+   *                                                                     a.R(5,3,b,4,4)-->[0, 1, 2, 3, 4, 90, 5, 6, 7]
+   *                                                                     a.R(3,5,a,0,1)-->[0, 1, 2, 0, 1, 6, 7]
+   *                                                                     a.R(3,5,a,3,5)-->[0, 1, 2, 3, 4, 5, 6, 7]
+   *                                                                     a.R(3,5,a,4,4)-->[0, 1, 2, 4, 6, 7]
+   *                                                                     a.R(5,3,a,0,4)-->[0, 1, 2, 3, 4, 0, 1, 2, 3, 4,
+   *                  5, 6, 7]
+   *                                                                     a.R(0,-1,b,0,4)-->[50, 60, 70, 80, 90, 0, 1, 2,
+   *                  3, 4, 5, 6, 7]
+   *                                                                     a.R(0,-1,a,0,4)-->[0, 1, 2, 3, 4, 0, 1, 2, 3,
+   *                  4, 5, 6, 7]
+   *                                                                     a.R(8,0,a,0,4)-->[0, 1, 2, 3, 4, 5, 6, 7, 0, 1,
+   *                  2, 3, 4]
+   *                                                                     </pre>
    */
   public void replaceFromToWithFromTo(int from, int to, AbstractDoubleList other, int otherFrom, int otherTo) {
     if (otherFrom > otherTo) {
@@ -809,8 +820,7 @@
   public void shuffleFromTo(int from, int to) {
     checkRangeFromTo(from, to, size());
 
-    org.apache.mahout.jet.random.Uniform gen =
-        new org.apache.mahout.jet.random.Uniform(AbstractDistribution.makeDefaultGenerator());
+    Uniform gen = new Uniform(AbstractDistribution.makeDefaultGenerator());
     for (int i = from; i < to; i++) {
       int random = gen.nextIntFromTo(i, to);
 



Mime
View raw message