mahout-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sro...@apache.org
Subject svn commit: r884687 [2/2] - in /lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix: ./ doc-files/ doublealgo/ impl/ linalg/ objectalgo/
Date Thu, 26 Nov 2009 20:21:53 GMT
Modified: lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SparseDoubleMatrix2D.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SparseDoubleMatrix2D.java?rev=884687&r1=884686&r2=884687&view=diff
==============================================================================
--- lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SparseDoubleMatrix2D.java
(original)
+++ lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SparseDoubleMatrix2D.java
Thu Nov 26 20:21:47 2009
@@ -77,7 +77,7 @@
   /*
    * The elements of the matrix.
    */
-  protected AbstractIntDoubleMap elements;
+  protected final AbstractIntDoubleMap elements;
   protected int dummy;
 
   /**
@@ -535,7 +535,7 @@
               j = tmp;
             }
             zElements[zi + zStride * i] += value * yElements[yi + yStride * j];
-            //System.out.println("["+i+","+j+"]-->"+value);
+            //log.info("["+i+","+j+"]-->"+value);
             return true;
           }
         }
@@ -548,7 +548,7 @@
           if (transposeA) { int tmp=i; i=j; j=tmp; }
           zElements[zi + zStride*i] += value * yElements[yi + yStride*j];
           //z.setQuick(row,z.getQuick(row) + value * y.getQuick(column));
-          //System.out.println("["+i+","+j+"]-->"+value);
+          //log.info("["+i+","+j+"]-->"+value);
           return value;
         }
       }

Modified: lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SparseDoubleMatrix3D.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SparseDoubleMatrix3D.java?rev=884687&r1=884686&r2=884687&view=diff
==============================================================================
--- lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SparseDoubleMatrix3D.java
(original)
+++ lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SparseDoubleMatrix3D.java
Thu Nov 26 20:21:47 2009
@@ -150,7 +150,7 @@
    * @param columnZero    the position of the first element.
    * @param sliceStride   the number of elements between two slices, i.e. <tt>index(k+1,i,j)-index(k,i,j)</tt>.
    * @param rowStride     the number of elements between two rows, i.e. <tt>index(k,i+1,j)-index(k,i,j)</tt>.
-   * @param columnnStride the number of elements between two columns, i.e. <tt>index(k,i,j+1)-index(k,i,j)</tt>.
+   * @param columnStride the number of elements between two columns, i.e. <tt>index(k,i,j+1)-index(k,i,j)</tt>.
    * @throws IllegalArgumentException if <tt>(double)slices*columns*rows > Integer.MAX_VALUE</tt>.
    * @throws IllegalArgumentException if <tt>slices<0 || rows<0 || columns<0</tt>.
    */
@@ -195,7 +195,7 @@
    * number of non-zero values boosts performance, because the receiver will grow only once
instead of potentially many
    * times and hash collisions get less probable.
    *
-   * @param minNonZeros the desired minimum number of non-zero cells.
+   * @param minCapacity the desired minimum number of non-zero cells.
    */
   @Override
   public void ensureCapacity(int minCapacity) {

Modified: lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SparseObjectMatrix1D.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SparseObjectMatrix1D.java?rev=884687&r1=884686&r2=884687&view=diff
==============================================================================
--- lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SparseObjectMatrix1D.java
(original)
+++ lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SparseObjectMatrix1D.java
Thu Nov 26 20:21:47 2009
@@ -129,7 +129,7 @@
    * number of non-zero values boosts performance, because the receiver will grow only once
instead of potentially many
    * times and hash collisions get less probable.
    *
-   * @param minNonZeros the desired minimum number of non-zero cells.
+   * @param minCapacity the desired minimum number of non-zero cells.
    */
   @Override
   public void ensureCapacity(int minCapacity) {

Modified: lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SparseObjectMatrix2D.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SparseObjectMatrix2D.java?rev=884687&r1=884686&r2=884687&view=diff
==============================================================================
--- lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SparseObjectMatrix2D.java
(original)
+++ lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SparseObjectMatrix2D.java
Thu Nov 26 20:21:47 2009
@@ -162,7 +162,7 @@
    * number of non-zero values boosts performance, because the receiver will grow only once
instead of potentially many
    * times and hash collisions get less probable.
    *
-   * @param minNonZeros the desired minimum number of non-zero cells.
+   * @param minCapacity the desired minimum number of non-zero cells.
    */
   @Override
   public void ensureCapacity(int minCapacity) {

Modified: lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SparseObjectMatrix3D.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SparseObjectMatrix3D.java?rev=884687&r1=884686&r2=884687&view=diff
==============================================================================
--- lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SparseObjectMatrix3D.java
(original)
+++ lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SparseObjectMatrix3D.java
Thu Nov 26 20:21:47 2009
@@ -150,7 +150,7 @@
    * @param columnZero    the position of the first element.
    * @param sliceStride   the number of elements between two slices, i.e. <tt>index(k+1,i,j)-index(k,i,j)</tt>.
    * @param rowStride     the number of elements between two rows, i.e. <tt>index(k,i+1,j)-index(k,i,j)</tt>.
-   * @param columnnStride the number of elements between two columns, i.e. <tt>index(k,i,j+1)-index(k,i,j)</tt>.
+   * @param columnStride the number of elements between two columns, i.e. <tt>index(k,i,j+1)-index(k,i,j)</tt>.
    * @throws IllegalArgumentException if <tt>(Object)slices*columns*rows > Integer.MAX_VALUE</tt>.
    * @throws IllegalArgumentException if <tt>slices<0 || rows<0 || columns<0</tt>.
    */
@@ -178,7 +178,7 @@
    * number of non-zero values boosts performance, because the receiver will grow only once
instead of potentially many
    * times and hash collisions get less probable.
    *
-   * @param minNonZeros the desired minimum number of non-zero cells.
+   * @param minCapacity the desired minimum number of non-zero cells.
    */
   @Override
   public void ensureCapacity(int minCapacity) {

Modified: lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/TridiagonalDoubleMatrix2D.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/TridiagonalDoubleMatrix2D.java?rev=884687&r1=884686&r2=884687&view=diff
==============================================================================
--- lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/TridiagonalDoubleMatrix2D.java
(original)
+++ lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/TridiagonalDoubleMatrix2D.java
Thu Nov 26 20:21:47 2009
@@ -23,7 +23,7 @@
   /*
    * The non zero elements of the matrix: {lower, diagonal, upper}.
    */
-  protected double[] values;
+  protected final double[] values;
 
   /*
   * The startIndexes and number of non zeros: {lowerStart, diagonalStart, upperStart, values.length,
lowerNonZeros, diagonalNonZeros, upperNonZeros}.
@@ -31,7 +31,7 @@
   * diagonalStart = lowerStart + lower.length
   * upperStart = diagonalStart + diagonal.length
   */
-  protected int[] dims;
+  protected final int[] dims;
 
   protected static final int NONZERO = 4;
 
@@ -526,7 +526,7 @@
             }
             zElements[zi + zStride * i] += value * yElements[yi + yStride * j];
             //z.setQuick(row,z.getQuick(row) + value * y.getQuick(column));
-            //System.out.println("["+i+","+j+"]-->"+value);
+            //log.info("["+i+","+j+"]-->"+value);
             return value;
           }
         }

Modified: lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/WrapperDoubleMatrix1D.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/WrapperDoubleMatrix1D.java?rev=884687&r1=884686&r2=884687&view=diff
==============================================================================
--- lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/WrapperDoubleMatrix1D.java
(original)
+++ lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/WrapperDoubleMatrix1D.java
Thu Nov 26 20:21:47 2009
@@ -219,29 +219,29 @@
    * specifically, the view has size <tt>this.size()/stride</tt> holding cells
<tt>this.get(i*stride)</tt> for all <tt>i
    * = 0..size()/stride - 1</tt>.
    *
-   * @param stride the step factor.
+   * @param theStride the step factor.
    * @return the new view.
    * @throws IndexOutOfBoundsException if <tt>stride <= 0</tt>.
    */
   @Override
-  public DoubleMatrix1D viewStrides(final int _stride) {
+  public DoubleMatrix1D viewStrides(final int theStride) {
     if (stride <= 0) {
       throw new IndexOutOfBoundsException("illegal stride: " + stride);
     }
     DoubleMatrix1D view = new WrapperDoubleMatrix1D(this) {
       @Override
       public double getQuick(int index) {
-        return content.get(index * _stride);
+        return content.get(index * theStride);
       }
 
       @Override
       public void setQuick(int index, double value) {
-        content.set(index * _stride, value);
+        content.set(index * theStride, value);
       }
     };
     view.size = size;
     if (size != 0) {
-      view.size = (size - 1) / _stride + 1;
+      view.size = (size - 1) / theStride + 1;
     }
     return view;
   }

Modified: lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/WrapperDoubleMatrix2D.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/WrapperDoubleMatrix2D.java?rev=884687&r1=884686&r2=884687&view=diff
==============================================================================
--- lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/WrapperDoubleMatrix2D.java
(original)
+++ lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/WrapperDoubleMatrix2D.java
Thu Nov 26 20:21:47 2009
@@ -29,7 +29,7 @@
    * <tt>values[row][column]</tt> and have exactly the same number of columns
in every row. <p> The values are copied.
    * So subsequent changes in <tt>values</tt> are not reflected in the matrix,
and vice-versa.
    *
-   * @param values The values to be filled into the new matrix.
+   * @param newContent The values to be filled into the new matrix.
    * @throws IllegalArgumentException if <tt>for any 1 &lt;= row &lt; values.length:
values[row].length !=
    *                                  values[row-1].length</tt>.
    */
@@ -380,34 +380,34 @@
    * 0..columns()/columnStride - 1</tt>. The returned view is backed by this matrix,
so changes in the returned view are
    * reflected in this matrix, and vice-versa.
    *
-   * @param rowStride    the row step factor.
-   * @param columnStride the column step factor.
+   * @param theRowStride    the row step factor.
+   * @param theColumnStride the column step factor.
    * @return a new view.
    * @throws IndexOutOfBoundsException if <tt>rowStride<=0 || columnStride<=0</tt>.
    */
   @Override
-  public DoubleMatrix2D viewStrides(final int _rowStride, final int _columnStride) {
-    if (_rowStride <= 0 || _columnStride <= 0) {
+  public DoubleMatrix2D viewStrides(final int theRowStride, final int theColumnStride) {
+    if (theRowStride <= 0 || theColumnStride <= 0) {
       throw new IndexOutOfBoundsException("illegal stride");
     }
     DoubleMatrix2D view = new WrapperDoubleMatrix2D(this) {
       @Override
       public double getQuick(int row, int column) {
-        return content.get(_rowStride * row, _columnStride * column);
+        return content.get(theRowStride * row, theColumnStride * column);
       }
 
       @Override
       public void setQuick(int row, int column, double value) {
-        content.set(_rowStride * row, _columnStride * column, value);
+        content.set(theRowStride * row, theColumnStride * column, value);
       }
     };
     view.rows = rows;
     view.columns = columns;
     if (rows != 0) {
-      view.rows = (rows - 1) / _rowStride + 1;
+      view.rows = (rows - 1) / theRowStride + 1;
     }
     if (columns != 0) {
-      view.columns = (columns - 1) / _columnStride + 1;
+      view.columns = (columns - 1) / theColumnStride + 1;
     }
     return view;
   }

Modified: lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/Algebra.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/Algebra.java?rev=884687&r1=884686&r2=884687&view=diff
==============================================================================
--- lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/Algebra.java
(original)
+++ lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/Algebra.java
Thu Nov 26 20:21:47 2009
@@ -1011,7 +1011,6 @@
    * Modifies the matrix to be a lower trapezoidal matrix.
    *
    * @return <tt>A</tt> (for convenience only).
-   * @see #triangulateLower(DoubleMatrix2D)
    */
   protected DoubleMatrix2D trapezoidalLower(DoubleMatrix2D A) {
     int rows = A.rows();

Modified: lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/Blas.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/Blas.java?rev=884687&r1=884686&r2=884687&view=diff
==============================================================================
--- lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/Blas.java
(original)
+++ lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/Blas.java
Thu Nov 26 20:21:47 2009
@@ -213,7 +213,7 @@
    *
    * @param a        rotational elimination parameter a.
    * @param b        rotational elimination parameter b.
-   * @param rotvec[] Must be at least of length 4. On output contains the values <tt>{a,b,c,s}</tt>.
+   * @param rotvec Must be at least of length 4. On output contains the values <tt>{a,b,c,s}</tt>.
    */
   void drotg(double a, double b, double[] rotvec);
 
@@ -245,8 +245,8 @@
   /**
    * Swaps the elements of two matrices; <tt>B <==> A</tt>.
    *
-   * @param A the first matrix.
-   * @param B the second matrix.
+   * @param x the first matrix.
+   * @param y the second matrix.
    * @throws IllegalArgumentException if <tt>A.columns() != B.columns() || A.rows()
!= B.rows()</tt>.
    */
   void dswap(DoubleMatrix2D x, DoubleMatrix2D y);

Modified: lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/CholeskyDecomposition.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/CholeskyDecomposition.java?rev=884687&r1=884686&r2=884687&view=diff
==============================================================================
--- lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/CholeskyDecomposition.java
(original)
+++ lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/CholeskyDecomposition.java
Thu Nov 26 20:21:47 2009
@@ -161,7 +161,7 @@
 
     // Copy right hand side.
     DoubleMatrix2D X = B.copy();
-    int nx = B.columns();
+    //int nx = B.columns();
 
     // precompute and cache some views to avoid regenerating them time and again
     DoubleMatrix1D[] Xrows = new DoubleMatrix1D[n];

Modified: lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/LUDecomposition.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/LUDecomposition.java?rev=884687&r1=884686&r2=884687&view=diff
==============================================================================
--- lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/LUDecomposition.java
(original)
+++ lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/LUDecomposition.java
Thu Nov 26 20:21:47 2009
@@ -26,7 +26,7 @@
 @Deprecated
 public class LUDecomposition implements java.io.Serializable {
 
-  protected LUDecompositionQuick quick;
+  protected final LUDecompositionQuick quick;
 
   /**
    * Constructs and returns a new LU Decomposition object; The decomposed matrices can be
retrieved via instance methods

Modified: lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/Property.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/Property.java?rev=884687&r1=884686&r2=884687&view=diff
==============================================================================
--- lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/Property.java
(original)
+++ lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/Property.java
Thu Nov 26 20:21:47 2009
@@ -510,7 +510,7 @@
    * Ignores tolerance.
    */
   public boolean isDiagonallyDominantByColumn(DoubleMatrix2D A) {
-    double epsilon = tolerance();
+    //double epsilon = tolerance();
     int min = Math.min(A.rows(), A.columns());
     for (int i = min; --i >= 0;) {
       double diag = Math.abs(A.getQuick(i, i));
@@ -529,7 +529,7 @@
    * tolerance.
    */
   public boolean isDiagonallyDominantByRow(DoubleMatrix2D A) {
-    double epsilon = tolerance();
+    //double epsilon = tolerance();
     int min = Math.min(A.rows(), A.columns());
     for (int i = min; --i >= 0;) {
       double diag = Math.abs(A.getQuick(i, i));
@@ -661,7 +661,7 @@
     checkSquare(A);
     double epsilon = tolerance();
     int rows = A.rows();
-    int columns = A.columns();
+    //int columns = A.columns();
     for (int row = rows; --row >= 0;) {
       for (int column = rows; --column >= 0;) {
         //if (A.getQuick(row,column) != -A.getQuick(column,row)) return false;

Modified: lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/QRDecomposition.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/QRDecomposition.java?rev=884687&r1=884686&r2=884687&view=diff
==============================================================================
--- lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/QRDecomposition.java
(original)
+++ lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/QRDecomposition.java
Thu Nov 26 20:21:47 2009
@@ -57,7 +57,7 @@
     n = A.columns();
     Rdiag = A.like1D(n);
     //Rdiag = new double[n];
-    org.apache.mahout.matrix.function.DoubleDoubleFunction hypot = Algebra.hypotFunction();
+    //org.apache.mahout.matrix.function.DoubleDoubleFunction hypot = Algebra.hypotFunction();
 
     // precompute and cache some views to avoid regenerating them time and again
     DoubleMatrix1D[] QRcolumns = new DoubleMatrix1D[n];

Modified: lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/SeqBlas.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/SeqBlas.java?rev=884687&r1=884686&r2=884687&view=diff
==============================================================================
--- lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/SeqBlas.java
(original)
+++ lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/SeqBlas.java
Thu Nov 26 20:21:47 2009
@@ -22,11 +22,6 @@
 @Deprecated
 public class SeqBlas implements Blas {
 
-  /**
-   * Little trick to allow for "aliasing", that is, renaming this class. Time and again writing
code like <p>
-   * <tt>SeqBlas.blas.dgemm(...);</tt> <p> is a bit awkward. Using the
aliasing you can instead write <p> <tt>Blas B =
-   * SeqBlas.blas; <br> B.dgemm(...);</tt>
-   */
   public static final Blas seqBlas = new SeqBlas();
 
   /** Makes this class non instantiable, but still let's others inherit from it. */

Modified: lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/Smp.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/Smp.java?rev=884687&r1=884686&r2=884687&view=diff
==============================================================================
--- lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/Smp.java
(original)
+++ lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/Smp.java
Thu Nov 26 20:21:47 2009
@@ -14,9 +14,9 @@
 
 class Smp {
 
-  protected FJTaskRunnerGroup taskGroup; // a very efficient and light weight thread pool
+  protected final FJTaskRunnerGroup taskGroup; // a very efficient and light weight thread
pool
 
-  protected int maxThreads;
+  protected final int maxThreads;
 
   /** Constructs a new Smp using a maximum of <tt>maxThreads<tt> threads. */
   protected Smp(int maxThreads) {
@@ -50,7 +50,7 @@
           if (results != null) {
             results[k] = result;
           }
-          //System.out.print(".");
+          //log.info(".");
         }
       };
     }
@@ -120,7 +120,7 @@
         span = p - span * i;
       } // last span may be a bit larger
 
-      DoubleMatrix2D AA, BB, CC;
+      //DoubleMatrix2D AA, BB, CC;
       if (!splitHoriz) {   // split B along columns into blocks
         blocks[i] = A.viewPart(0, offset, A.rows(), span);
       } else { // split A along rows into blocks
@@ -189,12 +189,12 @@
     int span = p / noOfTasks;
     DoubleMatrix2D[] blocks = new DoubleMatrix2D[noOfTasks];
     for (int i = 0; i < noOfTasks; i++) {
-      int offset = i * span;
+      //int offset = i * span;
       if (i == noOfTasks - 1) {
         span = p - span * i;
       } // last span may be a bit larger
 
-      DoubleMatrix2D AA, BB, CC;
+      //DoubleMatrix2D AA, BB, CC;
       if (!splitHoriz) {
         // split B along columns into blocks
         blocks[i] = A.viewPart(0, i, A.rows(), A.columns() - i).viewStrides(1, noOfTasks);

Modified: lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/SmpBlas.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/SmpBlas.java?rev=884687&r1=884686&r2=884687&view=diff
==============================================================================
--- lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/SmpBlas.java
(original)
+++ lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/SmpBlas.java
Thu Nov 26 20:21:47 2009
@@ -67,13 +67,13 @@
    */
   private static Blas smpBlas = SeqBlas.seqBlas;
 
-  protected Blas seqBlas; // blocks are operated on in parallel; for each block this seq
algo is used.
+  protected final Blas seqBlas; // blocks are operated on in parallel; for each block this
seq algo is used.
 
-  protected Smp smp;
+  protected final Smp smp;
 
-  protected int maxThreads;
+  protected final int maxThreads;
 
-  protected static int NN_THRESHOLD = 30000;
+  protected static final int NN_THRESHOLD = 30000;
 
   public static Blas getSmpBlas() {
     return smpBlas;
@@ -260,7 +260,7 @@
         @Override
         public void run() {
           seqBlas.dgemm(transposeA, transposeB, alpha, AA, BB, beta, CC);
-          //System.out.println("Hello "+offset);
+          //log.info("Hello "+offset);
         }
       };
     }
@@ -331,7 +331,7 @@
         @Override
         public void run() {
           seqBlas.dgemv(transposeA, alpha, AA, x, beta, yy);
-          //System.out.println("Hello "+offset);
+          //log.info("Hello "+offset);
         }
       };
     }

Modified: lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/objectalgo/Formatter.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/objectalgo/Formatter.java?rev=884687&r1=884686&r2=884687&view=diff
==============================================================================
--- lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/objectalgo/Formatter.java
(original)
+++ lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/objectalgo/Formatter.java
Thu Nov 26 20:21:47 2009
@@ -97,8 +97,8 @@
     String b3 = blanks(3);
     copy.setPrintShape(false);
     copy.setColumnSeparator(", ");
-    copy.setRowSeparator("},\n" + b3 + "{");
-    String lead = "{\n" + b3 + "{";
+    copy.setRowSeparator("},\n" + b3 + '{');
+    String lead = "{\n" + b3 + '{';
     String trail = "}\n};";
     return lead + copy.toString(matrix) + trail;
   }
@@ -114,9 +114,9 @@
     String b6 = blanks(6);
     copy.setPrintShape(false);
     copy.setColumnSeparator(", ");
-    copy.setRowSeparator("},\n" + b6 + "{");
-    copy.setSliceSeparator("}\n" + b3 + "},\n" + b3 + "{\n" + b6 + "{");
-    String lead = "{\n" + b3 + "{\n" + b6 + "{";
+    copy.setRowSeparator("},\n" + b6 + '{');
+    copy.setSliceSeparator("}\n" + b3 + "},\n" + b3 + "{\n" + b6 + '{');
+    String lead = "{\n" + b3 + "{\n" + b6 + '{';
     String trail = "}\n" + b3 + "}\n}";
     return lead + copy.toString(matrix) + trail;
   }
@@ -168,7 +168,7 @@
     }
     this.printShape = oldPrintShape;
     if (printShape) {
-      buf.insert(0, shape(matrix) + "\n");
+      buf.insert(0, shape(matrix) + '\n');
     }
     return buf.toString();
   }
@@ -263,13 +263,13 @@
       if (c > 0) {
         s += "| ";
       }
-      s = s + columnAxisName + "\n";
+      s = s + columnAxisName + '\n';
       total.insert(0, s);
     }
 
     // insert title
     if (title != null) {
-      total.insert(0, title + "\n");
+      total.insert(0, title + '\n');
     }
 
     this.format = oldFormat;
@@ -303,7 +303,7 @@
         buf.append(sliceSeparator);
       }
       buf.append(toTitleString(matrix.viewSlice(i), rowNames, columnNames, rowAxisName, columnAxisName,
-          title + "\n" + sliceAxisName + "=" + sliceNames[i]));
+          title + '\n' + sliceAxisName + '=' + sliceNames[i]));
     }
     return buf.toString();
   }

Modified: lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/objectalgo/Sorting.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/objectalgo/Sorting.java?rev=884687&r1=884686&r2=884687&view=diff
==============================================================================
--- lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/objectalgo/Sorting.java
(original)
+++ lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/objectalgo/Sorting.java
Thu Nov 26 20:21:47 2009
@@ -148,7 +148,7 @@
    * matrix, and vice-versa. To sort ranges use sub-ranging views. To sort columns by rows,
use dice views. To sort
    * descending, use flip views ... <p> <b>Example:</b> <table border="1"
cellspacing="0"> <tr nowrap> <td
    * valign="top"><tt>4 x 2 matrix: <br> 7, 6<br> 5, 4<br> 3,
2<br> 1, 0 <br> </tt></td> <td align="left" valign="top">
-   * <p><tt>column = 0;<br> view = quickSort(matrix,column);<br>
System.out.println(view); </tt><tt><br> ==> </tt></p>
+   * <p><tt>column = 0;<br> view = quickSort(matrix,column);<br>
log.info(view); </tt><tt><br> ==> </tt></p>
    * </td> <td valign="top"> <p><tt>4 x 2 matrix:<br> 1, 0<br>
3, 2<br> 5, 4<br> 7, 6</tt><br> The matrix IS NOT
    * SORTED.<br> The new VIEW IS SORTED.</p> </td> </tr> </table>
    *

Modified: lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/package.html
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/package.html?rev=884687&r1=884686&r2=884687&view=diff
==============================================================================
--- lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/package.html
(original)
+++ lucene/mahout/trunk/matrix/src/main/java/org/apache/mahout/matrix/matrix/package.html
Thu Nov 26 20:21:47 2009
@@ -334,7 +334,7 @@
       has same interface<br>
     </tt><tt>//matrix </tt><tt>= new RCDoubleMatrix2D(3,4);</tt><tt>
</tt><tt>
       // has same interface<br>
-    </tt><tt></tt><tt>System.out.println(matrix); </tt></p>
+    </tt><tt></tt><tt>log.info(matrix); </tt></p>
   </td>
   <td nowrap><tt>3 x 4 matrix: <br>
     0 0 0 0 <br>
@@ -357,7 +357,7 @@
       // From now on all instantiations will go via the factory -<br>
       // No explicit constructor calls anymore</tt><tt><br>
       DoubleMatrix2D matrix = factory.make(3,4);<br>
-      System.out.println(matrix);</tt></p>
+      log.info(matrix);</tt></p>
   </td>
   <td nowrap><tt>3 x 4 matrix: <br>
     0 0 0 0 <br>
@@ -378,7 +378,7 @@
   <td>
     <p><tt>int row = 2, column = 0;<br>
     </tt><tt>matrix.set(row,column, 7);<br>
-      System.out.println(matrix.get(row,column));<br>
+      log.info(matrix.get(row,column));<br>
       // --&gt; 7</tt></p>
   </td>
   <td nowrap><tt>3 x 4 matrix <br>
@@ -400,7 +400,7 @@
       //sum += matrix.getQuick(row,column); // no bounds check
    }
 }
-System.out.println(sum); 
+log.info(sum);
 </pre>
   </tt></td>
   <td nowrap>&nbsp;</td>
@@ -414,7 +414,7 @@
 </tr>
 <tr>
   <td><tt>matrix.viewPart(1,0,2,2).assign(1);<br>
-    System.out.println(matrix); <br>
+    log.info(matrix); <br>
   </tt></td>
   <td nowrap><tt>3 x 4 matrix <br>
     0 0 0 0 <br>
@@ -429,7 +429,7 @@
   <td nowrap>&nbsp;</td>
 </tr>
 <tr>
-  <td><tt>System.out.println(matrix.viewDice())</tt></td>
+  <td><tt>log.info(matrix.viewDice())</tt></td>
   <td nowrap><tt>4 x 3 matrix <br>
     0 1 1 <br>
     0 1 1 <br>
@@ -443,7 +443,7 @@
   <td nowrap>&nbsp;</td>
 </tr>
 <tr>
-  <td><tt>System.out.println(matrix.viewColumnFlip());</tt></td>
+  <td><tt>log.info(matrix.viewColumnFlip());</tt></td>
   <td nowrap><tt>3 x 4 matrix <br>
     0 0 0 0 <br>
     0 0 1 1 <br>
@@ -456,7 +456,7 @@
   <td nowrap>&nbsp;</td>
 </tr>
 <tr>
-  <td><tt>System.out.println(matrix.viewRow(1)); </tt></td>
+  <td><tt>log.info(matrix.viewRow(1)); </tt></td>
   <td nowrap><tt>4 matrix <br>
     1 1 0 0 </tt></td>
 </tr>
@@ -487,7 +487,7 @@
   <td nowrap>&nbsp;</td>
 </tr>
 <tr>
-  <td><tt>System.out.println(matrix.viewStrides(1,2)); </tt></td>
+  <td><tt>log.info(matrix.viewStrides(1,2)); </tt></td>
   <td nowrap><tt>3 x 2 matrix <br>
     0 0<br>
     1 0<br>
@@ -505,7 +505,7 @@
 <tr>
   <td><tt>int[] rowIndexes = {0,2};<br>
     int[] columnIndexes = {2,3,1,1};<br>
-    System.out.println(matrix.viewSelection(rowIndexes,columnIndexes)); </tt></td>
+    log.info(matrix.viewSelection(rowIndexes,columnIndexes)); </tt></td>
   <td nowrap><tt>2 x 4 matrix <br>
     0 0 0 0 <br>
     0 0 1 1 </tt></td>
@@ -515,7 +515,7 @@
   <td nowrap>&nbsp;</td>
 </tr>
 <tr>
-  <td><tt>System.out.println(matrix.viewSorted(1).viewRowFlip()); </tt></td>
+  <td><tt>log.info(matrix.viewSorted(1).viewRowFlip()); </tt></td>
   <td nowrap><tt>3 x 4 matrix <br>
     1 1 0 0 <br>
     1 1 0 0 <br>
@@ -527,7 +527,7 @@
 </tr>
 <tr>
   <td><tt>matrix.viewPart(0,1,2,2).viewRowFlip().viewColumn(0).assign(2);<br>
-    System.out.println(matrix); <br>
+    log.info(matrix); <br>
   </tt></td>
   <td nowrap><tt>3 x 4 matrix <br>
     0 2 0 0 <br>



Mime
View raw message