commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pste...@apache.org
Subject svn commit: r811685 [6/24] - in /commons/proper/math/trunk: ./ src/main/java/org/apache/commons/math/ src/main/java/org/apache/commons/math/analysis/ src/main/java/org/apache/commons/math/analysis/integration/ src/main/java/org/apache/commons/math/anal...
Date Sat, 05 Sep 2009 17:37:05 GMT
Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/AbstractRealMatrix.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/AbstractRealMatrix.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/AbstractRealMatrix.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/AbstractRealMatrix.java Sat Sep  5 17:36:48 2009
@@ -29,8 +29,8 @@
  * @since 2.0
  */
 public abstract class AbstractRealMatrix implements RealMatrix {
-    
-    
+
+
     /** Cached LU solver.
      * @deprecated as of release 2.0, since all methods using this are deprecated
      */
@@ -85,7 +85,7 @@
         for (int row = 0; row < rowCount; ++row) {
             for (int col = 0; col < columnCount; ++col) {
                 out.setEntry(row, col, getEntry(row, col) + m.getEntry(row, col));
-            }  
+            }
         }
 
         return out;
@@ -104,7 +104,7 @@
         for (int row = 0; row < rowCount; ++row) {
             for (int col = 0; col < columnCount; ++col) {
                 out.setEntry(row, col, getEntry(row, col) - m.getEntry(row, col));
-            }  
+            }
         }
 
         return out;
@@ -228,7 +228,7 @@
 
         });
     }
-    
+
     /** {@inheritDoc} */
     public double getFrobeniusNorm() {
         return walkInOptimizedOrder(new RealMatrixPreservingVisitor() {
@@ -255,7 +255,7 @@
 
         });
     }
-    
+
     /** {@inheritDoc} */
     public RealMatrix getSubMatrix(final int startRow, final int endRow,
                                    final int startColumn, final int endColumn)
@@ -297,7 +297,7 @@
 
         return subMatrix;
 
-    } 
+    }
 
     /** {@inheritDoc} */
     public void copySubMatrix(final int startRow, final int endRow,
@@ -369,24 +369,24 @@
     }
 
     /** {@inheritDoc} */
-    public void setSubMatrix(final double[][] subMatrix, final int row, final int column) 
+    public void setSubMatrix(final double[][] subMatrix, final int row, final int column)
         throws MatrixIndexException {
 
         final int nRows = subMatrix.length;
         if (nRows == 0) {
-            throw MathRuntimeException.createIllegalArgumentException("matrix must have at least one row"); 
+            throw MathRuntimeException.createIllegalArgumentException("matrix must have at least one row");
         }
 
         final int nCols = subMatrix[0].length;
         if (nCols == 0) {
-            throw MathRuntimeException.createIllegalArgumentException("matrix must have at least one column"); 
+            throw MathRuntimeException.createIllegalArgumentException("matrix must have at least one column");
         }
 
         for (int r = 1; r < nRows; ++r) {
             if (subMatrix[r].length != nCols) {
                 throw MathRuntimeException.createIllegalArgumentException(
                         "some rows have length {0} while others have length {1}",
-                        nCols, subMatrix[r].length); 
+                        nCols, subMatrix[r].length);
             }
         }
 
@@ -399,7 +399,7 @@
             for (int j = 0; j < nCols; ++j) {
                 setEntry(row + i, column + j, subMatrix[i][j]);
             }
-        } 
+        }
 
         lu = null;
 
@@ -419,7 +419,7 @@
         return out;
 
     }
-    
+
     /** {@inheritDoc} */
     public void setRowMatrix(final int row, final RealMatrix matrix)
         throws MatrixIndexException, InvalidMatrixException {
@@ -437,7 +437,7 @@
         }
 
     }
-    
+
     /** {@inheritDoc} */
     public RealMatrix getColumnMatrix(final int column)
         throws MatrixIndexException {
@@ -470,7 +470,7 @@
         }
 
     }
-    
+
     /** {@inheritDoc} */
     public RealVector getRowVector(final int row)
         throws MatrixIndexException {
@@ -493,7 +493,7 @@
         }
 
     }
-    
+
     /** {@inheritDoc} */
     public RealVector getColumnVector(final int column)
         throws MatrixIndexException {
@@ -516,7 +516,7 @@
         }
 
     }
-    
+
     /** {@inheritDoc} */
     public double[] getRow(final int row)
         throws MatrixIndexException {
@@ -548,7 +548,7 @@
         }
 
     }
-    
+
     /** {@inheritDoc} */
     public double[] getColumn(final int column)
         throws MatrixIndexException {
@@ -580,7 +580,7 @@
         }
 
     }
-    
+
     /** {@inheritDoc} */
     public abstract double getEntry(int row, int column)
         throws MatrixIndexException;
@@ -1005,20 +1005,20 @@
                     res.append(",");
                 }
                 res.append(getEntry(i, j));
-            } 
+            }
             res.append("}");
-        } 
+        }
 
         res.append("}");
         return res.toString();
 
-    } 
-    
+    }
+
     /**
      * Returns true iff <code>object</code> is a
      * <code>RealMatrix</code> instance with the same dimensions as this
      * and all corresponding matrix entries are equal.
-     * 
+     *
      * @param object the object to test equality against.
      * @return true if object equals this
      */
@@ -1045,10 +1045,10 @@
         }
         return true;
     }
-    
+
     /**
      * Computes a hashcode for the matrix.
-     * 
+     *
      * @return hashcode for matrix
      */
     @Override
@@ -1060,7 +1060,7 @@
         ret = ret * 31 + nCols;
         for (int row = 0; row < nRows; ++row) {
             for (int col = 0; col < nCols; ++col) {
-               ret = ret * 31 + (11 * (row+1) + 17 * (col+1)) * 
+               ret = ret * 31 + (11 * (row+1) + 17 * (col+1)) *
                    MathUtils.hash(getEntry(row, col));
            }
         }

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/Array2DRowFieldMatrix.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/Array2DRowFieldMatrix.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/Array2DRowFieldMatrix.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/Array2DRowFieldMatrix.java Sat Sep  5 17:36:48 2009
@@ -35,7 +35,7 @@
  * @version $Revision$ $Date$
  */
 public class Array2DRowFieldMatrix<T extends FieldElement<T>> extends AbstractFieldMatrix<T> implements Serializable {
-    
+
     /** Serializable version identifier */
     private static final long serialVersionUID = 7260756672015356458L;
 
@@ -108,14 +108,14 @@
         } else {
             if (d == null) {
                 throw new NullPointerException();
-            }   
+            }
             final int nRows = d.length;
             if (nRows == 0) {
-                throw MathRuntimeException.createIllegalArgumentException("matrix must have at least one row"); 
+                throw MathRuntimeException.createIllegalArgumentException("matrix must have at least one row");
             }
             final int nCols = d[0].length;
             if (nCols == 0) {
-                throw MathRuntimeException.createIllegalArgumentException("matrix must have at least one column"); 
+                throw MathRuntimeException.createIllegalArgumentException("matrix must have at least one column");
             }
             for (int r = 1; r < nRows; r++) {
                 if (d[r].length != nCols) {
@@ -123,7 +123,7 @@
                             "some rows have length {0} while others have length {1}",
                             nCols, d[r].length);
                 }
-            }       
+            }
             data = d;
         }
     }
@@ -301,7 +301,7 @@
 
     /** {@inheritDoc} */
     @Override
-    public void setSubMatrix(final T[][] subMatrix, final int row, final int column) 
+    public void setSubMatrix(final T[][] subMatrix, final int row, final int column)
     throws MatrixIndexException {
         if (data == null) {
             if (row > 0) {
@@ -316,19 +316,19 @@
             }
             final int nRows = subMatrix.length;
             if (nRows == 0) {
-                throw MathRuntimeException.createIllegalArgumentException("matrix must have at least one row"); 
+                throw MathRuntimeException.createIllegalArgumentException("matrix must have at least one row");
             }
 
             final int nCols = subMatrix[0].length;
             if (nCols == 0) {
-                throw MathRuntimeException.createIllegalArgumentException("matrix must have at least one column"); 
+                throw MathRuntimeException.createIllegalArgumentException("matrix must have at least one column");
             }
             data = buildArray(getField(), subMatrix.length, nCols);
             for (int i = 0; i < data.length; ++i) {
                 if (subMatrix[i].length != nCols) {
                     throw MathRuntimeException.createIllegalArgumentException(
                             "some rows have length {0} while others have length {1}",
-                            nCols, subMatrix[i].length); 
+                            nCols, subMatrix[i].length);
                 }
                 System.arraycopy(subMatrix[i], 0, data[i + row], column, nCols);
             }
@@ -374,7 +374,7 @@
             throw new MatrixIndexException(
                     "no entry at indices ({0}, {1}) in a {2}x{3} matrix",
                     row, column, getRowDimension(), getColumnDimension());
-        }      
+        }
     }
 
     /** {@inheritDoc} */
@@ -387,7 +387,7 @@
             throw new MatrixIndexException(
                     "no entry at indices ({0}, {1}) in a {2}x{3} matrix",
                     row, column, getRowDimension(), getColumnDimension());
-        }      
+        }
     }
 
     /** {@inheritDoc} */

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/Array2DRowRealMatrix.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/Array2DRowRealMatrix.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/Array2DRowRealMatrix.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/Array2DRowRealMatrix.java Sat Sep  5 17:36:48 2009
@@ -35,10 +35,10 @@
  * <p>
  * <strong>Usage notes</strong>:<br>
  * <ul><li>
- * The LU decomposition is cached and reused on subsequent calls.   
+ * The LU decomposition is cached and reused on subsequent calls.
  * If data are modified via references to the underlying array obtained using
  * <code>getDataRef()</code>, then the stored LU decomposition will not be
- * discarded.  In this case, you need to explicitly invoke 
+ * discarded.  In this case, you need to explicitly invoke
  * <code>LUDecompose()</code> to recompute the decomposition
  * before using any of the methods above.</li>
  * <li>
@@ -50,7 +50,7 @@
  * @version $Revision$ $Date$
  */
 public class Array2DRowRealMatrix extends AbstractRealMatrix implements Serializable {
-    
+
     /** Serializable version identifier */
     private static final long serialVersionUID = -1067294169172445528L;
 
@@ -117,14 +117,14 @@
         } else {
             if (d == null) {
                 throw new NullPointerException();
-            }   
+            }
             final int nRows = d.length;
             if (nRows == 0) {
-                throw MathRuntimeException.createIllegalArgumentException("matrix must have at least one row"); 
+                throw MathRuntimeException.createIllegalArgumentException("matrix must have at least one row");
             }
             final int nCols = d[0].length;
             if (nCols == 0) {
-                throw MathRuntimeException.createIllegalArgumentException("matrix must have at least one column"); 
+                throw MathRuntimeException.createIllegalArgumentException("matrix must have at least one column");
             }
             for (int r = 1; r < nRows; r++) {
                 if (d[r].length != nCols) {
@@ -132,7 +132,7 @@
                             "some rows have length {0} while others have length {1}",
                             nCols, d[r].length);
                 }
-            }       
+            }
             data = d;
         }
     }
@@ -309,7 +309,7 @@
 
     /** {@inheritDoc} */
     @Override
-    public void setSubMatrix(final double[][] subMatrix, final int row, final int column) 
+    public void setSubMatrix(final double[][] subMatrix, final int row, final int column)
     throws MatrixIndexException {
         if (data == null) {
             if (row > 0) {
@@ -324,19 +324,19 @@
             }
             final int nRows = subMatrix.length;
             if (nRows == 0) {
-                throw MathRuntimeException.createIllegalArgumentException("matrix must have at least one row"); 
+                throw MathRuntimeException.createIllegalArgumentException("matrix must have at least one row");
             }
 
             final int nCols = subMatrix[0].length;
             if (nCols == 0) {
-                throw MathRuntimeException.createIllegalArgumentException("matrix must have at least one column"); 
+                throw MathRuntimeException.createIllegalArgumentException("matrix must have at least one column");
             }
             data = new double[subMatrix.length][nCols];
             for (int i = 0; i < data.length; ++i) {
                 if (subMatrix[i].length != nCols) {
                     throw MathRuntimeException.createIllegalArgumentException(
                             "some rows have length {0} while others have length {1}",
-                            nCols, subMatrix[i].length); 
+                            nCols, subMatrix[i].length);
                 }
                 System.arraycopy(subMatrix[i], 0, data[i + row], column, nCols);
             }
@@ -382,7 +382,7 @@
             throw new MatrixIndexException(
                     "no entry at indices ({0}, {1}) in a {2}x{3} matrix",
                     row, column, getRowDimension(), getColumnDimension());
-        }      
+        }
     }
 
     /** {@inheritDoc} */
@@ -395,7 +395,7 @@
             throw new MatrixIndexException(
                     "no entry at indices ({0}, {1}) in a {2}x{3} matrix",
                     row, column, getRowDimension(), getColumnDimension());
-        }      
+        }
     }
 
     /** {@inheritDoc} */

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/ArrayFieldVector.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/ArrayFieldVector.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/ArrayFieldVector.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/ArrayFieldVector.java Sat Sep  5 17:36:48 2009
@@ -97,7 +97,7 @@
             data = d.clone();
         } catch (ArrayIndexOutOfBoundsException e) {
             throw MathRuntimeException.createIllegalArgumentException(
-                      "vector must have at least one element"); 
+                      "vector must have at least one element");
         }
     }
 
@@ -672,7 +672,7 @@
 
     /**
      * Set a set of consecutive elements.
-     * 
+     *
      * @param index index of first element to be set.
      * @param v vector containing the values to set.
      * @exception MatrixIndexException if the index is
@@ -706,7 +706,7 @@
 
     /**
      * Check if instance dimension is equal to some expected value.
-     * 
+     *
      * @param n expected dimension.
      * @exception IllegalArgumentException if the dimension is
      * inconsistent with vector size
@@ -737,13 +737,13 @@
      * @return true if two 3D vector objects are equal, false if
      *         object is null, not an instance of Vector3D, or
      *         not equal to this Vector3D instance
-     * 
+     *
      */
     @SuppressWarnings("unchecked")
     @Override
     public boolean equals(Object other) {
 
-      if (this == other) { 
+      if (this == other) {
         return true;
       }
 
@@ -771,7 +771,7 @@
       }
 
     }
-    
+
     /**
      * Get a hashCode for the real vector.
      * <p>All NaN values have the same hash code.</p>

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/ArrayRealVector.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/ArrayRealVector.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/ArrayRealVector.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/ArrayRealVector.java Sat Sep  5 17:36:48 2009
@@ -96,9 +96,9 @@
         throws NullPointerException, IllegalArgumentException {
         if (d == null) {
             throw new NullPointerException();
-        }   
+        }
         if (d.length == 0) {
-            throw MathRuntimeException.createIllegalArgumentException("vector must have at least one element"); 
+            throw MathRuntimeException.createIllegalArgumentException("vector must have at least one element");
         }
         data = copyArray ? d.clone() :  d;
     }
@@ -936,7 +936,7 @@
             checkVectorDimensions(v);
             double sum = 0;
             for (int i = 0; i < data.length; ++i) {
-                final double delta = data[i] - v.getEntry(i); 
+                final double delta = data[i] - v.getEntry(i);
                 sum += delta * delta;
             }
             return Math.sqrt(sum);
@@ -982,7 +982,7 @@
             checkVectorDimensions(v);
             double sum = 0;
             for (int i = 0; i < data.length; ++i) {
-                final double delta = data[i] - v.getEntry(i); 
+                final double delta = data[i] - v.getEntry(i);
                 sum += Math.abs(delta);
             }
             return sum;
@@ -1028,7 +1028,7 @@
             checkVectorDimensions(v);
             double max = 0;
             for (int i = 0; i < data.length; ++i) {
-                final double delta = data[i] - v.getEntry(i); 
+                final double delta = data[i] - v.getEntry(i);
                 max = Math.max(max, Math.abs(delta));
             }
             return max;
@@ -1237,7 +1237,7 @@
 
     /**
      * Set a set of consecutive elements.
-     * 
+     *
      * @param index index of first element to be set.
      * @param v vector containing the values to set.
      * @exception MatrixIndexException if the index is
@@ -1277,7 +1277,7 @@
 
     /**
      * Check if instance dimension is equal to some expected value.
-     * 
+     *
      * @param n expected dimension.
      * @exception IllegalArgumentException if the dimension is
      * inconsistent with vector size
@@ -1303,7 +1303,7 @@
         }
         return false;
     }
-    
+
     /**
      * Returns true if any coordinate of this vector is infinite and none are NaN;
      * false otherwise
@@ -1325,7 +1325,7 @@
         return false;
 
     }
-    
+
     /**
      * Test for the equality of two real vectors.
      * <p>
@@ -1343,12 +1343,12 @@
      * @return true if two vector objects are equal, false if
      *         object is null, not an instance of RealVector, or
      *         not equal to this RealVector instance
-     * 
+     *
      */
     @Override
     public boolean equals(Object other) {
 
-      if (this == other) { 
+      if (this == other) {
         return true;
       }
 
@@ -1380,7 +1380,7 @@
       }
 
     }
-    
+
     /**
      * Get a hashCode for the real vector.
      * <p>All NaN values have the same hash code.</p>

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/BiDiagonalTransformer.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/BiDiagonalTransformer.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/BiDiagonalTransformer.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/BiDiagonalTransformer.java Sat Sep  5 17:36:48 2009
@@ -54,7 +54,7 @@
     private RealMatrix cachedV;
 
     /**
-     * Build the transformation to bi-diagonal shape of a matrix. 
+     * Build the transformation to bi-diagonal shape of a matrix.
      * @param matrix the matrix to transform.
      */
     public BiDiagonalTransformer(RealMatrix matrix) {
@@ -79,7 +79,7 @@
     }
 
     /**
-     * Returns the matrix U of the transform. 
+     * Returns the matrix U of the transform.
      * <p>U is an orthogonal matrix, i.e. its transpose is also its inverse.</p>
      * @return the U matrix
      */
@@ -129,7 +129,7 @@
     }
 
     /**
-     * Returns the bi-diagonal matrix B of the transform. 
+     * Returns the bi-diagonal matrix B of the transform.
      * @return the B matrix
      */
     public RealMatrix getB() {
@@ -160,7 +160,7 @@
     }
 
     /**
-     * Returns the matrix V of the transform. 
+     * Returns the matrix V of the transform.
      * <p>V is an orthogonal matrix, i.e. its transpose is also its inverse.</p>
      * @return the V matrix
      */

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/BigMatrix.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/BigMatrix.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/BigMatrix.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/BigMatrix.java Sat Sep  5 17:36:48 2009
@@ -39,7 +39,7 @@
      * @return matrix copy
      */
     BigMatrix copy();
-    
+
     /**
      * Compute the sum of this and m.
      *
@@ -48,7 +48,7 @@
      * @exception  IllegalArgumentException if m is not the same size as this
      */
     BigMatrix add(BigMatrix m) throws IllegalArgumentException;
-    
+
     /**
      * Compute this minus m.
      *
@@ -57,7 +57,7 @@
      * @exception  IllegalArgumentException if m is not the same size as this
      */
     BigMatrix subtract(BigMatrix m) throws IllegalArgumentException;
-    
+
      /**
      * Returns the result of adding d to each entry of this.
      *
@@ -65,7 +65,7 @@
      * @return     d + this
      */
     BigMatrix scalarAdd(BigDecimal d);
-    
+
     /**
      * Returns the result multiplying each entry of this by d.
      *
@@ -73,17 +73,17 @@
      * @return     d * this
      */
     BigMatrix scalarMultiply(BigDecimal d);
-    
+
     /**
      * Returns the result of postmultiplying this by m.
      *
      * @param m    matrix to postmultiply by
      * @return     this * m
-     * @throws     IllegalArgumentException 
+     * @throws     IllegalArgumentException
      *             if columnDimension(this) != rowDimension(m)
      */
     BigMatrix multiply(BigMatrix m) throws IllegalArgumentException;
-    
+
     /**
      * Returns the result premultiplying this by <code>m</code>.
      * @param m    matrix to premultiply by
@@ -92,7 +92,7 @@
      *             if rowDimension(this) != columnDimension(m)
      */
     public BigMatrix preMultiply(BigMatrix m) throws IllegalArgumentException;
-    
+
     /**
      * Returns matrix entries as a two-dimensional array.
      *
@@ -120,7 +120,7 @@
      * @return norm
      */
     BigDecimal getNorm();
-    
+
     /**
      * Gets a submatrix. Rows and columns are indicated
      * counting from 0 to n-1.
@@ -135,7 +135,7 @@
      */
     BigMatrix getSubMatrix(int startRow, int endRow, int startColumn,
             int endColumn) throws MatrixIndexException;
-    
+
     /**
      * Gets a submatrix. Rows and columns are indicated
      * counting from 0 to n-1.
@@ -148,7 +148,7 @@
      */
     BigMatrix getSubMatrix(int[] selectedRows, int[] selectedColumns)
     throws MatrixIndexException;
-    
+
     /**
      * Returns the entries in row number <code>row</code>
      * as a row matrix.  Row indices start at 0.
@@ -158,7 +158,7 @@
      * @throws MatrixIndexException if the specified row index is invalid
      */
     BigMatrix getRowMatrix(int row) throws MatrixIndexException;
-    
+
     /**
      * Returns the entries in column number <code>column</code>
      * as a column matrix.  Column indices start at 0.
@@ -168,7 +168,7 @@
      * @throws MatrixIndexException if the specified column index is invalid
      */
     BigMatrix getColumnMatrix(int column) throws MatrixIndexException;
-    
+
     /**
      * Returns the entries in row number <code>row</code> as an array.
      * <p>
@@ -222,24 +222,24 @@
     /**
      * Returns the entry in the specified row and column.
      * <p>
-     * Row and column indices start at 0 and must satisfy 
+     * Row and column indices start at 0 and must satisfy
      * <ul>
      * <li><code>0 <= row < rowDimension</code></li>
      * <li><code> 0 <= column < columnDimension</code></li>
      * </ul>
      * otherwise a <code>MatrixIndexException</code> is thrown.</p>
      *
-     * @param row  row location of entry to be fetched  
+     * @param row  row location of entry to be fetched
      * @param column  column location of entry to be fetched
      * @return matrix entry in row,column
      * @throws MatrixIndexException if the row or column index is not valid
      */
     BigDecimal getEntry(int row, int column) throws MatrixIndexException;
-    
+
     /**
      * Returns the entry in the specified row and column as a double.
      * <p>
-     * Row and column indices start at 0 and must satisfy 
+     * Row and column indices start at 0 and must satisfy
      * <ul>
      * <li><code>0 <= row < rowDimension</code></li>
      * <li><code> 0 <= column < columnDimension</code></li>
@@ -259,25 +259,25 @@
      * @return transpose matrix
      */
     BigMatrix transpose();
-    
+
     /**
      * Returns the inverse of this matrix.
      *
      * @return inverse matrix
-     * @throws org.apache.commons.math.linear.InvalidMatrixException if 
+     * @throws org.apache.commons.math.linear.InvalidMatrixException if
      *     this is not invertible
      */
     BigMatrix inverse() throws InvalidMatrixException;
-    
+
     /**
      * Returns the determinant of this matrix.
      *
      * @return determinant
-      *@throws org.apache.commons.math.linear.InvalidMatrixException if 
+      *@throws org.apache.commons.math.linear.InvalidMatrixException if
       *    matrix is not square
      */
     BigDecimal getDeterminant() throws InvalidMatrixException;
-    
+
     /**
      * Returns the <a href="http://mathworld.wolfram.com/MatrixTrace.html">
      * trace</a> of the matrix (the sum of the elements on the main diagonal).
@@ -285,7 +285,7 @@
      * @return trace
      */
     BigDecimal getTrace();
-    
+
     /**
      * Returns the result of multiplying this by the vector <code>v</code>.
      *
@@ -303,14 +303,14 @@
      * @throws IllegalArgumentException if rowDimension != v.size()
      */
     BigDecimal[] preMultiply(BigDecimal[] v) throws IllegalArgumentException;
-    
+
     /**
      * Returns the solution vector for a linear system with coefficient
      * matrix = this and constant vector = <code>b</code>.
      *
      * @param b  constant vector
      * @return vector of solution values to AX = b, where A is *this
-     * @throws IllegalArgumentException if this.rowDimension != b.length 
+     * @throws IllegalArgumentException if this.rowDimension != b.length
      * @throws org.apache.commons.math.linear.InvalidMatrixException if this matrix is not square or is singular
      */
     BigDecimal[] solve(BigDecimal[] b) throws IllegalArgumentException, InvalidMatrixException;
@@ -318,7 +318,7 @@
     /**
      * Returns a matrix of (column) solution vectors for linear systems with
      * coefficient matrix = this and constant vectors = columns of
-     * <code>b</code>. 
+     * <code>b</code>.
      *
      * @param b  matrix of constant vectors forming RHS of linear systems to
      * to solve

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/BigMatrixImpl.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/BigMatrixImpl.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/BigMatrixImpl.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/BigMatrixImpl.java Sat Sep  5 17:36:48 2009
@@ -24,7 +24,7 @@
 /**
  * Implementation of {@link BigMatrix} using a BigDecimal[][] array to store entries
  * and <a href="http://www.math.gatech.edu/~bourbaki/math2601/Web-notes/2num.pdf">
- * LU decompostion</a> to support linear system 
+ * LU decompostion</a> to support linear system
  * solution and inverse.
  * <p>
  * The LU decompostion is performed as needed, to support the following operations: <ul>
@@ -46,51 +46,51 @@
  * As specified in the {@link BigMatrix} interface, matrix element indexing
  * is 0-based -- e.g., <code>getEntry(0, 0)</code>
  * returns the element in the first row, first column of the matrix.</li></ul></p>
- * 
+ *
  * @deprecated as of 2.0, replaced by {@link Array2DRowFieldMatrix} with a {@link
  * org.apache.commons.math.util.BigReal} parameter
  * @version $Revision$ $Date$
  */
 @Deprecated
 public class BigMatrixImpl implements BigMatrix, Serializable {
-    
+
     /** Serialization id */
     private static final long serialVersionUID = -1011428905656140431L;
-    
+
     /** Entries of the matrix */
     protected BigDecimal data[][] = null;
-    
+
     /** Entries of cached LU decomposition.
      *  All updates to data (other than luDecompose()) *must* set this to null
      */
     protected BigDecimal lu[][] = null;
-    
+
     /** Permutation associated with LU decomposition */
     protected int[] permutation = null;
-    
+
     /** Parity of the permutation associated with the LU decomposition */
     protected int parity = 1;
-    
+
     /** Rounding mode for divisions **/
     private int roundingMode = BigDecimal.ROUND_HALF_UP;
-    
+
     /*** BigDecimal scale ***/
     private int scale = 64;
-    
+
     /** Bound to determine effective singularity in LU decomposition */
     private static final BigDecimal TOO_SMALL = new BigDecimal(10E-12);
-    
+
     /** BigDecimal 0 */
     static final BigDecimal ZERO = new BigDecimal(0);
     /** BigDecimal 1 */
     static final BigDecimal ONE = new BigDecimal(1);
-    
-    /** 
+
+    /**
      * Creates a matrix with no data
      */
     public BigMatrixImpl() {
     }
-    
+
     /**
      * Create a new BigMatrix with the supplied row and column dimensions.
      *
@@ -113,7 +113,7 @@
         data = new BigDecimal[rowDimension][columnDimension];
         lu = null;
     }
-    
+
     /**
      * Create a new BigMatrix using <code>d</code> as the underlying
      * data array.
@@ -152,23 +152,23 @@
         } else {
             if (d == null) {
                 throw new NullPointerException();
-            }   
+            }
             final int nRows = d.length;
             if (nRows == 0) {
-                throw MathRuntimeException.createIllegalArgumentException("matrix must have at least one row"); 
+                throw MathRuntimeException.createIllegalArgumentException("matrix must have at least one row");
             }
 
             final int nCols = d[0].length;
             if (nCols == 0) {
-                throw MathRuntimeException.createIllegalArgumentException("matrix must have at least one column"); 
+                throw MathRuntimeException.createIllegalArgumentException("matrix must have at least one column");
             }
             for (int r = 1; r < nRows; r++) {
                 if (d[r].length != nCols) {
                     throw MathRuntimeException.createIllegalArgumentException(
                           "some rows have length {0} while others have length {1}",
-                          nCols, d[r].length); 
+                          nCols, d[r].length);
                 }
-            }       
+            }
             data = d;
         }
         lu = null;
@@ -188,26 +188,26 @@
     public BigMatrixImpl(double[][] d) {
         final int nRows = d.length;
         if (nRows == 0) {
-            throw MathRuntimeException.createIllegalArgumentException("matrix must have at least one row"); 
+            throw MathRuntimeException.createIllegalArgumentException("matrix must have at least one row");
         }
 
         final int nCols = d[0].length;
         if (nCols == 0) {
-            throw MathRuntimeException.createIllegalArgumentException("matrix must have at least one column"); 
+            throw MathRuntimeException.createIllegalArgumentException("matrix must have at least one column");
         }
         for (int row = 1; row < nRows; row++) {
             if (d[row].length != nCols) {
                 throw MathRuntimeException.createIllegalArgumentException(
                       "some rows have length {0} while others have length {1}",
-                      nCols, d[row].length); 
+                      nCols, d[row].length);
             }
         }
         this.copyIn(d);
         lu = null;
     }
-    
+
     /**
-     * Create a new BigMatrix using the values represented by the strings in 
+     * Create a new BigMatrix using the values represented by the strings in
      * <code>d</code> as the underlying data array.
      *
      * @param d data for new matrix
@@ -218,27 +218,27 @@
     public BigMatrixImpl(String[][] d) {
         final int nRows = d.length;
         if (nRows == 0) {
-            throw MathRuntimeException.createIllegalArgumentException("matrix must have at least one row"); 
+            throw MathRuntimeException.createIllegalArgumentException("matrix must have at least one row");
         }
 
         final int nCols = d[0].length;
         if (nCols == 0) {
-            throw MathRuntimeException.createIllegalArgumentException("matrix must have at least one column"); 
+            throw MathRuntimeException.createIllegalArgumentException("matrix must have at least one column");
         }
         for (int row = 1; row < nRows; row++) {
             if (d[row].length != nCols) {
                 throw MathRuntimeException.createIllegalArgumentException(
                       "some rows have length {0} while others have length {1}",
-                      nCols, d[row].length); 
+                      nCols, d[row].length);
             }
         }
         this.copyIn(d);
         lu = null;
     }
-    
+
     /**
      * Create a new (column) BigMatrix using <code>v</code> as the
-     * data for the unique column of the <code>v.length x 1</code> matrix 
+     * data for the unique column of the <code>v.length x 1</code> matrix
      * created.
      * <p>
      * The input array is copied, not referenced.</p>
@@ -252,7 +252,7 @@
             data[row][0] = v[row];
         }
     }
-    
+
     /**
      * Create a new BigMatrix which is a copy of this.
      *
@@ -261,7 +261,7 @@
     public BigMatrix copy() {
         return new BigMatrixImpl(this.copyOut(), false);
     }
-    
+
     /**
      * Compute the sum of this and <code>m</code>.
      *
@@ -285,7 +285,7 @@
                 final BigDecimal[] outDataRow = outData[row];
                 for (int col = 0; col < columnCount; col++) {
                     outDataRow[col] = dataRow[col].add(m.getEntry(row, col));
-                }  
+                }
             }
             return new BigMatrixImpl(outData, false);
         }
@@ -312,7 +312,7 @@
             final BigDecimal[] outDataRow = outData[row];
             for (int col = 0; col < columnCount; col++) {
                 outDataRow[col] = dataRow[col].add(mRow[col]);
-            }  
+            }
         }
         return new BigMatrixImpl(outData, false);
     }
@@ -340,7 +340,7 @@
                 final BigDecimal[] outDataRow = outData[row];
                 for (int col = 0; col < columnCount; col++) {
                     outDataRow[col] = dataRow[col].subtract(getEntry(row, col));
-                }  
+                }
             }
             return new BigMatrixImpl(outData, false);
         }
@@ -367,7 +367,7 @@
             final BigDecimal[] outDataRow = outData[row];
             for (int col = 0; col < columnCount; col++) {
                 outDataRow[col] = dataRow[col].subtract(mRow[col]);
-            }  
+            }
         }
         return new BigMatrixImpl(outData, false);
     }
@@ -471,7 +471,7 @@
                 }
                 outDataRow[col] = sum;
             }
-        }            
+        }
         return new BigMatrixImpl(outData, false);
     }
 
@@ -496,7 +496,7 @@
     public BigDecimal[][] getData() {
         return copyOut();
     }
-    
+
     /**
      * Returns matrix entries as a two-dimensional array.
      * <p>
@@ -516,7 +516,7 @@
         }
         return d;
     }
-    
+
     /**
      * Returns a reference to the underlying data array.
      * <p>
@@ -527,17 +527,17 @@
     public BigDecimal[][] getDataRef() {
         return data;
     }
-    
+
     /***
      * Gets the rounding mode for division operations
      * The default is {@link java.math.BigDecimal#ROUND_HALF_UP}
      * @see BigDecimal
      * @return the rounding mode.
-     */ 
+     */
     public int getRoundingMode() {
         return roundingMode;
     }
-    
+
     /***
      * Sets the rounding mode for decimal divisions.
      * @see BigDecimal
@@ -546,7 +546,7 @@
     public void setRoundingMode(int roundingMode) {
         this.roundingMode = roundingMode;
     }
-    
+
     /***
      * Sets the scale for division operations.
      * The default is 64
@@ -556,7 +556,7 @@
     public int getScale() {
         return scale;
     }
-    
+
     /***
      * Sets the scale for division operations.
      * @see BigDecimal
@@ -565,7 +565,7 @@
     public void setScale(int scale) {
         this.scale = scale;
     }
-    
+
     /**
      * Returns the <a href="http://mathworld.wolfram.com/MaximumAbsoluteRowSumNorm.html">
      * maximum absolute row sum norm</a> of the matrix.
@@ -583,7 +583,7 @@
         }
         return maxColSum;
     }
-    
+
     /**
      * Gets a submatrix. Rows and columns are indicated
      * counting from 0 to n-1.
@@ -625,7 +625,7 @@
         return new BigMatrixImpl(subMatrixData, false);
 
     }
-    
+
     /**
      * Gets a submatrix. Rows and columns are indicated
      * counting from 0 to n-1.
@@ -668,53 +668,53 @@
             }
         }
         return new BigMatrixImpl(subMatrixData, false);
-    } 
-    
+    }
+
     /**
      * Replace the submatrix starting at <code>row, column</code> using data in
      * the input <code>subMatrix</code> array. Indexes are 0-based.
-     * <p> 
+     * <p>
      * Example:<br>
      * Starting with <pre>
      * 1  2  3  4
      * 5  6  7  8
      * 9  0  1  2
      * </pre>
-     * and <code>subMatrix = {{3, 4} {5,6}}</code>, invoking 
+     * and <code>subMatrix = {{3, 4} {5,6}}</code>, invoking
      * <code>setSubMatrix(subMatrix,1,1))</code> will result in <pre>
      * 1  2  3  4
      * 5  3  4  8
      * 9  5  6  2
      * </pre></p>
-     * 
+     *
      * @param subMatrix  array containing the submatrix replacement data
      * @param row  row coordinate of the top, left element to be replaced
      * @param column  column coordinate of the top, left element to be replaced
-     * @throws MatrixIndexException  if subMatrix does not fit into this 
-     *    matrix from element in (row, column) 
+     * @throws MatrixIndexException  if subMatrix does not fit into this
+     *    matrix from element in (row, column)
      * @throws IllegalArgumentException if <code>subMatrix</code> is not rectangular
      *  (not all rows have the same length) or empty
      * @throws NullPointerException if <code>subMatrix</code> is null
      * @since 1.1
      */
-    public void setSubMatrix(BigDecimal[][] subMatrix, int row, int column) 
+    public void setSubMatrix(BigDecimal[][] subMatrix, int row, int column)
     throws MatrixIndexException {
 
         final int nRows = subMatrix.length;
         if (nRows == 0) {
-            throw MathRuntimeException.createIllegalArgumentException("matrix must have at least one row"); 
+            throw MathRuntimeException.createIllegalArgumentException("matrix must have at least one row");
         }
 
         final int nCols = subMatrix[0].length;
         if (nCols == 0) {
-            throw MathRuntimeException.createIllegalArgumentException("matrix must have at least one column"); 
+            throw MathRuntimeException.createIllegalArgumentException("matrix must have at least one column");
         }
 
         for (int r = 1; r < nRows; r++) {
             if (subMatrix[r].length != nCols) {
                 throw MathRuntimeException.createIllegalArgumentException(
                       "some rows have length {0} while others have length {1}",
-                      nCols, subMatrix[r].length); 
+                      nCols, subMatrix[r].length);
             }
         }
 
@@ -730,7 +730,7 @@
                         column);
             }
             data = new BigDecimal[nRows][nCols];
-            System.arraycopy(subMatrix, 0, data, 0, subMatrix.length);          
+            System.arraycopy(subMatrix, 0, data, 0, subMatrix.length);
         } else {
             MatrixUtils.checkRowIndex(this, row);
             MatrixUtils.checkColumnIndex(this, column);
@@ -739,12 +739,12 @@
         }
         for (int i = 0; i < nRows; i++) {
             System.arraycopy(subMatrix[i], 0, data[row + i], column, nCols);
-        } 
+        }
 
         lu = null;
 
     }
-    
+
     /**
      * Returns the entries in row number <code>row</code>
      * as a row matrix.  Row indices start at 0.
@@ -756,11 +756,11 @@
     public BigMatrix getRowMatrix(int row) throws MatrixIndexException {
         MatrixUtils.checkRowIndex(this, row);
         final int ncols = this.getColumnDimension();
-        final BigDecimal[][] out = new BigDecimal[1][ncols]; 
+        final BigDecimal[][] out = new BigDecimal[1][ncols];
         System.arraycopy(data[row], 0, out[0], 0, ncols);
         return new BigMatrixImpl(out, false);
-    } 
-    
+    }
+
     /**
      * Returns the entries in column number <code>column</code>
      * as a column matrix.  Column indices start at 0.
@@ -772,13 +772,13 @@
     public BigMatrix getColumnMatrix(int column) throws MatrixIndexException {
         MatrixUtils.checkColumnIndex(this, column);
         final int nRows = this.getRowDimension();
-        final BigDecimal[][] out = new BigDecimal[nRows][1]; 
+        final BigDecimal[][] out = new BigDecimal[nRows][1];
         for (int row = 0; row < nRows; row++) {
             out[row][0] = data[row][column];
         }
         return new BigMatrixImpl(out, false);
     }
-    
+
     /**
      * Returns the entries in row number <code>row</code> as an array.
      * <p>
@@ -796,7 +796,7 @@
         System.arraycopy(data[row], 0, out, 0, ncols);
         return out;
     }
-    
+
      /**
      * Returns the entries in row number <code>row</code> as an array
      * of double values.
@@ -817,7 +817,7 @@
         }
         return out;
     }
-    
+
      /**
      * Returns the entries in column number <code>col</code> as an array.
      * <p>
@@ -837,7 +837,7 @@
         }
         return out;
     }
-    
+
     /**
      * Returns the entries in column number <code>col</code> as an array
      * of double values.
@@ -858,18 +858,18 @@
         }
         return out;
     }
-    
+
      /**
      * Returns the entry in the specified row and column.
      * <p>
-     * Row and column indices start at 0 and must satisfy 
+     * Row and column indices start at 0 and must satisfy
      * <ul>
      * <li><code>0 <= row < rowDimension</code></li>
      * <li><code> 0 <= column < columnDimension</code></li>
      * </ul>
      * otherwise a <code>MatrixIndexException</code> is thrown.</p>
      *
-     * @param row  row location of entry to be fetched  
+     * @param row  row location of entry to be fetched
      * @param column  column location of entry to be fetched
      * @return matrix entry in row,column
      * @throws MatrixIndexException if the row or column index is not valid
@@ -884,11 +884,11 @@
                     row, column, getRowDimension(), getColumnDimension());
         }
     }
-    
+
     /**
      * Returns the entry in the specified row and column as a double.
      * <p>
-     * Row and column indices start at 0 and must satisfy 
+     * Row and column indices start at 0 and must satisfy
      * <ul>
      * <li><code>0 <= row < rowDimension</code></li>
      * <li><code> 0 <= column < columnDimension</code></li>
@@ -904,7 +904,7 @@
     public double getEntryAsDouble(int row, int column) throws MatrixIndexException {
         return getEntry(row,column).doubleValue();
     }
-    
+
     /**
      * Returns the transpose matrix.
      *
@@ -922,17 +922,17 @@
         }
         return new BigMatrixImpl(outData, false);
     }
-    
+
     /**
      * Returns the inverse matrix if this matrix is invertible.
-     * 
+     *
      * @return inverse matrix
      * @throws InvalidMatrixException if this is not invertible
      */
     public BigMatrix inverse() throws InvalidMatrixException {
         return solve(MatrixUtils.createBigIdentityMatrix(getRowDimension()));
     }
-    
+
     /**
      * Returns the determinant of this matrix.
      *
@@ -953,7 +953,7 @@
             return det;
         }
     }
-    
+
      /**
      * Is this a square matrix?
      * @return true if the matrix is square (rowDimension = columnDimension)
@@ -961,7 +961,7 @@
     public boolean isSquare() {
         return (this.getColumnDimension() == this.getRowDimension());
     }
-    
+
     /**
      * Is this a singular matrix?
      * @return true if the matrix is singular
@@ -978,7 +978,7 @@
             return false; // so the matrix is not singular
         }
     }
-    
+
     /**
      * Returns the number of rows in the matrix.
      *
@@ -987,7 +987,7 @@
     public int getRowDimension() {
         return data.length;
     }
-    
+
     /**
      * Returns the number of columns in the matrix.
      *
@@ -996,13 +996,13 @@
     public int getColumnDimension() {
         return data[0].length;
     }
-    
+
      /**
      * Returns the <a href="http://mathworld.wolfram.com/MatrixTrace.html">
      * trace</a> of the matrix (the sum of the elements on the main diagonal).
      *
      * @return trace
-     * 
+     *
      * @throws IllegalArgumentException if this matrix is not square.
      */
     public BigDecimal getTrace() throws IllegalArgumentException {
@@ -1015,7 +1015,7 @@
         }
         return trace;
     }
-    
+
     /**
      * Returns the result of multiplying this by the vector <code>v</code>.
      *
@@ -1041,7 +1041,7 @@
         }
         return out;
     }
-    
+
     /**
      * Returns the result of multiplying this by the vector <code>v</code>.
      *
@@ -1056,7 +1056,7 @@
         }
         return operate(bd);
     }
-    
+
     /**
      * Returns the (row) vector result of premultiplying this by the vector <code>v</code>.
      *
@@ -1082,11 +1082,11 @@
         }
         return out;
     }
-    
+
     /**
      * Returns a matrix of (column) solution vectors for linear systems with
      * coefficient matrix = this and constant vectors = columns of
-     * <code>b</code>. 
+     * <code>b</code>.
      *
      * @param b  array of constants forming RHS of linear systems to
      * to solve
@@ -1109,11 +1109,11 @@
         }
         return out;
     }
-    
+
     /**
      * Returns a matrix of (column) solution vectors for linear systems with
      * coefficient matrix = this and constant vectors = columns of
-     * <code>b</code>. 
+     * <code>b</code>.
      *
      * @param b  array of constants forming RHS of linear systems to
      * to solve
@@ -1128,11 +1128,11 @@
         }
         return solve(bd);
     }
-    
+
     /**
      * Returns a matrix of (column) solution vectors for linear systems with
      * coefficient matrix = this and constant vectors = columns of
-     * <code>b</code>. 
+     * <code>b</code>.
      *
      * @param b  matrix of constant vectors forming RHS of linear systems to
      * to solve
@@ -1152,11 +1152,11 @@
         if (this.isSingular()) { // side effect: compute LU decomp
             throw new SingularMatrixException();
         }
-        
+
         final int nCol = this.getColumnDimension();
         final int nColB = b.getColumnDimension();
         final int nRowB = b.getRowDimension();
-        
+
         // Apply permutations to b
         final BigDecimal[][] bp = new BigDecimal[nRowB][nColB];
         for (int row = 0; row < nRowB; row++) {
@@ -1165,7 +1165,7 @@
                 bpRow[col] = b.getEntry(permutation[row], col);
             }
         }
-        
+
         // Solve LY = b
         for (int col = 0; col < nCol; col++) {
             for (int i = col + 1; i < nCol; i++) {
@@ -1176,7 +1176,7 @@
                 }
             }
         }
-        
+
         // Solve UX = Y
         for (int col = nCol - 1; col >= 0; col--) {
             final BigDecimal[] bpCol = bp[col];
@@ -1196,11 +1196,11 @@
         return new BigMatrixImpl(bp, false);
 
     }
-    
+
     /**
-     * Computes a new 
+     * Computes a new
      * <a href="http://www.math.gatech.edu/~bourbaki/math2601/Web-notes/2num.pdf">
-     * LU decompostion</a> for this matrix, storing the result for use by other methods. 
+     * LU decompostion</a> for this matrix, storing the result for use by other methods.
      * <p>
      * <strong>Implementation Note</strong>:<br>
      * Uses <a href="http://www.damtp.cam.ac.uk/user/fdl/people/sd/lectures/nummeth98/linear.htm">
@@ -1216,26 +1216,26 @@
      * @throws InvalidMatrixException if the matrix is non-square or singular.
      */
     public void luDecompose() throws InvalidMatrixException {
-        
+
         final int nRows = this.getRowDimension();
         final int nCols = this.getColumnDimension();
         if (nRows != nCols) {
             throw new NonSquareMatrixException(getRowDimension(), getColumnDimension());
         }
         lu = this.getData();
-        
+
         // Initialize permutation array and parity
         permutation = new int[nRows];
         for (int row = 0; row < nRows; row++) {
             permutation[row] = row;
         }
         parity = 1;
-        
+
         // Loop over columns
         for (int col = 0; col < nCols; col++) {
-            
+
             BigDecimal sum = ZERO;
-            
+
             // upper
             for (int row = 0; row < col; row++) {
                 final BigDecimal[] luRow = lu[row];
@@ -1245,7 +1245,7 @@
                 }
                 luRow[col] = sum;
             }
-            
+
             // lower
             int max = col; // permutation row
             BigDecimal largest = ZERO;
@@ -1256,20 +1256,20 @@
                     sum = sum.subtract(luRow[i].multiply(lu[i][col]));
                 }
                 luRow[col] = sum;
-                
+
                 // maintain best permutation choice
                 if (sum.abs().compareTo(largest) == 1) {
                     largest = sum.abs();
                     max = row;
                 }
             }
-            
+
             // Singularity check
             if (lu[max][col].abs().compareTo(TOO_SMALL) <= 0) {
                 lu = null;
                 throw new SingularMatrixException();
             }
-            
+
             // Pivot if necessary
             if (max != col) {
                 BigDecimal tmp = ZERO;
@@ -1283,18 +1283,18 @@
                 permutation[col] = temp;
                 parity = -parity;
             }
-            
+
             // Divide the lower elements by the "winning" diagonal elt.
             final BigDecimal luDiag = lu[col][col];
             for (int row = col + 1; row < nRows; row++) {
                 final BigDecimal[] luRow = lu[row];
                 luRow[col] = luRow[col].divide(luDiag, scale, roundingMode);
             }
-            
+
         }
-        
+
     }
-    
+
     /**
      * Get a string representation for this matrix.
      * @return a string representation for this matrix
@@ -1314,20 +1314,20 @@
                         res.append(",");
                     }
                     res.append(data[i][j]);
-                } 
+                }
                 res.append("}");
-            } 
+            }
         }
         res.append("}");
         return res.toString();
-    } 
-    
+    }
+
     /**
-     * Returns true iff <code>object</code> is a 
+     * Returns true iff <code>object</code> is a
      * <code>BigMatrixImpl</code> instance with the same dimensions as this
      * and all corresponding matrix entries are equal.  BigDecimal.equals
      * is used to compare corresponding entries.
-     * 
+     *
      * @param object the object to test equality against.
      * @return true if object equals this
      */
@@ -1355,10 +1355,10 @@
         }
         return true;
     }
-    
+
     /**
      * Computes a hashcode for the matrix.
-     * 
+     *
      * @return hashcode for matrix
      */
     @Override
@@ -1371,39 +1371,39 @@
         for (int row = 0; row < nRows; row++) {
             final BigDecimal[] dataRow = data[row];
             for (int col = 0; col < nCols; col++) {
-                ret = ret * 31 + (11 * (row+1) + 17 * (col+1)) * 
+                ret = ret * 31 + (11 * (row+1) + 17 * (col+1)) *
                 dataRow[col].hashCode();
             }
-        }   
+        }
         return ret;
     }
-    
+
     //------------------------ Protected methods
-    
+
     /**
      *  Returns the LU decomposition as a BigMatrix.
-     *  Returns a fresh copy of the cached LU matrix if this has been computed; 
-     *  otherwise the composition is computed and cached for use by other methods.   
-     *  Since a copy is returned in either case, changes to the returned matrix do not 
-     *  affect the LU decomposition property. 
+     *  Returns a fresh copy of the cached LU matrix if this has been computed;
+     *  otherwise the composition is computed and cached for use by other methods.
+     *  Since a copy is returned in either case, changes to the returned matrix do not
+     *  affect the LU decomposition property.
      * <p>
-     * The matrix returned is a compact representation of the LU decomposition. 
-     * Elements below the main diagonal correspond to entries of the "L" matrix;   
+     * The matrix returned is a compact representation of the LU decomposition.
+     * Elements below the main diagonal correspond to entries of the "L" matrix;
      * elements on and above the main diagonal correspond to entries of the "U"
      * matrix.</p>
      * <p>
      * Example: <pre>
-     * 
+     *
      *     Returned matrix                L                  U
-     *         2  3  1                   1  0  0            2  3  1          
+     *         2  3  1                   1  0  0            2  3  1
      *         5  4  6                   5  1  0            0  4  6
-     *         1  7  8                   1  7  1            0  0  8          
+     *         1  7  8                   1  7  1            0  0  8
      * </pre>
-     * 
+     *
      * The L and U matrices satisfy the matrix equation LU = permuteRows(this), <br>
      *  where permuteRows reorders the rows of the matrix to follow the order determined
      *  by the <a href=#getPermutation()>permutation</a> property.</p>
-     * 
+     *
      * @return LU decomposition matrix
      * @throws InvalidMatrixException if the matrix is non-square or singular.
      */
@@ -1413,7 +1413,7 @@
         }
         return new BigMatrixImpl(lu);
     }
-    
+
     /**
      * Returns the permutation associated with the lu decomposition.
      * The entries of the array represent a permutation of the numbers 0, ... , nRows - 1.
@@ -1423,7 +1423,7 @@
      * and current first row is last.</p>
      * <p>
      * Returns a fresh copy of the array.</p>
-     * 
+     *
      * @return the permutation
      */
     protected int[] getPermutation() {
@@ -1431,9 +1431,9 @@
         System.arraycopy(permutation, 0, out, 0, permutation.length);
         return out;
     }
-    
+
     //------------------------ Private methods
-    
+
     /**
      * Returns a fresh copy of the underlying data array.
      *
@@ -1448,7 +1448,7 @@
         }
         return out;
     }
-    
+
     /**
      * Replaces data with a fresh copy of the input array.
      * <p>
@@ -1462,7 +1462,7 @@
     private void copyIn(BigDecimal[][] in) {
         setSubMatrix(in,0,0);
     }
-    
+
     /**
      * Replaces data with a fresh copy of the input array.
      *
@@ -1481,7 +1481,7 @@
         }
         lu = null;
     }
-    
+
     /**
      * Replaces data with BigDecimals represented by the strings in the input
      * array.

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/BlockFieldMatrix.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/BlockFieldMatrix.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/BlockFieldMatrix.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/BlockFieldMatrix.java Sat Sep  5 17:36:48 2009
@@ -64,7 +64,7 @@
  * @since 2.0
  */
 public class BlockFieldMatrix<T extends FieldElement<T>> extends AbstractFieldMatrix<T> implements Serializable {
-    
+
     /** Serializable version identifier */
     private static final long serialVersionUID = -4602336630143123183L;
 
@@ -219,7 +219,7 @@
             if (length != columns) {
                 throw MathRuntimeException.createIllegalArgumentException(
                         "some rows have length {0} while others have length {1}",
-                        columns, length); 
+                        columns, length);
             }
         }
 
@@ -653,7 +653,7 @@
         }
 
         return data;
-        
+
     }
 
     /** {@inheritDoc} */
@@ -788,7 +788,7 @@
         // safety checks
         final int refLength = subMatrix[0].length;
         if (refLength < 1) {
-            throw MathRuntimeException.createIllegalArgumentException("matrix must have at least one column");             
+            throw MathRuntimeException.createIllegalArgumentException("matrix must have at least one column");
         }
         final int endRow    = row + subMatrix.length - 1;
         final int endColumn = column + refLength - 1;
@@ -797,7 +797,7 @@
             if (subRow.length != refLength) {
                 throw MathRuntimeException.createIllegalArgumentException(
                         "some rows have length {0} while others have length {1}",
-                        refLength, subRow.length); 
+                        refLength, subRow.length);
             }
         }
 
@@ -923,7 +923,7 @@
         }
 
     }
-    
+
     /** {@inheritDoc} */
     @Override
     public FieldMatrix<T> getColumnMatrix(final int column)

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/BlockRealMatrix.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/BlockRealMatrix.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/BlockRealMatrix.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/BlockRealMatrix.java Sat Sep  5 17:36:48 2009
@@ -62,7 +62,7 @@
  * @since 2.0
  */
 public class BlockRealMatrix extends AbstractRealMatrix implements Serializable {
-    
+
     /** Serializable version identifier */
     private static final long serialVersionUID = 4991895511313664478L;
 
@@ -214,7 +214,7 @@
             if (length != columns) {
                 throw MathRuntimeException.createIllegalArgumentException(
                         "some rows have length {0} while others have length {1}",
-                        columns, length); 
+                        columns, length);
             }
         }
 
@@ -638,7 +638,7 @@
         }
 
         return data;
-        
+
     }
 
     /** {@inheritDoc} */
@@ -666,7 +666,7 @@
         }
         return maxColSum;
     }
-    
+
     /** {@inheritDoc} */
     @Override
     public double getFrobeniusNorm() {
@@ -811,7 +811,7 @@
         // safety checks
         final int refLength = subMatrix[0].length;
         if (refLength < 1) {
-            throw MathRuntimeException.createIllegalArgumentException("matrix must have at least one column");             
+            throw MathRuntimeException.createIllegalArgumentException("matrix must have at least one column");
         }
         final int endRow    = row + subMatrix.length - 1;
         final int endColumn = column + refLength - 1;
@@ -820,7 +820,7 @@
             if (subRow.length != refLength) {
                 throw MathRuntimeException.createIllegalArgumentException(
                         "some rows have length {0} while others have length {1}",
-                        refLength, subRow.length); 
+                        refLength, subRow.length);
             }
         }
 
@@ -946,7 +946,7 @@
         }
 
     }
-    
+
     /** {@inheritDoc} */
     @Override
     public BlockRealMatrix getColumnMatrix(final int column)

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/CholeskyDecomposition.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/CholeskyDecomposition.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/CholeskyDecomposition.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/CholeskyDecomposition.java Sat Sep  5 17:36:48 2009
@@ -19,7 +19,7 @@
 
 
 /**
- * An interface to classes that implement an algorithm to calculate the 
+ * An interface to classes that implement an algorithm to calculate the
  * Cholesky decomposition of a real symmetric positive-definite matrix.
  * <p>This interface is based on the class with similar name from the now defunct
  * <a href="http://math.nist.gov/javanumerics/jama/">JAMA</a> library, with the
@@ -34,7 +34,7 @@
  *   #getSolver() getSolver} method and the equivalent method provided by
  *   the returned {@link DecompositionSolver}.</li>
  * </ul>
- *   
+ *
  * @see <a href="http://mathworld.wolfram.com/CholeskyDecomposition.html">MathWorld</a>
  * @see <a href="http://en.wikipedia.org/wiki/Cholesky_decomposition">Wikipedia</a>
  * @version $Revision$ $Date$
@@ -43,7 +43,7 @@
 public interface CholeskyDecomposition {
 
     /**
-     * Returns the matrix L of the decomposition. 
+     * Returns the matrix L of the decomposition.
      * <p>L is an lower-triangular matrix</p>
      * @return the L matrix
      */

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/CholeskyDecompositionImpl.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/CholeskyDecompositionImpl.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/CholeskyDecompositionImpl.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/CholeskyDecompositionImpl.java Sat Sep  5 17:36:48 2009
@@ -187,7 +187,7 @@
 
     /** Specialized solver. */
     private static class Solver implements DecompositionSolver {
-    
+
         /** Row-oriented storage for L<sup>T</sup> matrix data. */
         private final double[][] lTData;
 

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/DecompositionSolver.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/DecompositionSolver.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/DecompositionSolver.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/DecompositionSolver.java Sat Sep  5 17:36:48 2009
@@ -29,7 +29,7 @@
  * ||A &times; X - B|| is exactly 0. Other solvers can also find solutions
  * with non-square matrix A and with non-null minimal norm. If an exact linear
  * solution exists it is also the minimal norm solution.</p>
- *   
+ *
  * @version $Revision$ $Date$
  * @since 2.0
  */

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/DefaultFieldMatrixChangingVisitor.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/DefaultFieldMatrixChangingVisitor.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/DefaultFieldMatrixChangingVisitor.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/DefaultFieldMatrixChangingVisitor.java Sat Sep  5 17:36:48 2009
@@ -25,7 +25,7 @@
  * This class is a convenience to create custom visitors without defining all
  * methods. This class provides default implementations that do nothing.
  * </p>
- * 
+ *
  * @param <T> the type of the field elements
  * @version $Revision$ $Date$
  * @since 2.0

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/DefaultFieldMatrixPreservingVisitor.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/DefaultFieldMatrixPreservingVisitor.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/DefaultFieldMatrixPreservingVisitor.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/DefaultFieldMatrixPreservingVisitor.java Sat Sep  5 17:36:48 2009
@@ -25,7 +25,7 @@
  * This class is a convenience to create custom visitors without defining all
  * methods. This class provides default implementations that do nothing.
  * </p>
- * 
+ *
  * @param <T> the type of the field elements
  * @version $Revision$ $Date$
  * @since 2.0

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/DefaultRealMatrixChangingVisitor.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/DefaultRealMatrixChangingVisitor.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/DefaultRealMatrixChangingVisitor.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/DefaultRealMatrixChangingVisitor.java Sat Sep  5 17:36:48 2009
@@ -23,7 +23,7 @@
  * This class is a convenience to create custom visitors without defining all
  * methods. This class provides default implementations that do nothing.
  * </p>
- * 
+ *
  * @version $Revision$ $Date$
  * @since 2.0
  */

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/DefaultRealMatrixPreservingVisitor.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/DefaultRealMatrixPreservingVisitor.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/DefaultRealMatrixPreservingVisitor.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/DefaultRealMatrixPreservingVisitor.java Sat Sep  5 17:36:48 2009
@@ -23,7 +23,7 @@
  * This class is a convenience to create custom visitors without defining all
  * methods. This class provides default implementations that do nothing.
  * </p>
- * 
+ *
  * @version $Revision$ $Date$
  * @since 2.0
  */

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/EigenDecomposition.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/EigenDecomposition.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/EigenDecomposition.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/EigenDecomposition.java Sat Sep  5 17:36:48 2009
@@ -19,7 +19,7 @@
 
 
 /**
- * An interface to classes that implement an algorithm to calculate the 
+ * An interface to classes that implement an algorithm to calculate the
  * eigen decomposition of a real matrix.
  * <p>The eigen decomposition of matrix A is a set of two matrices:
  * V and D such that A = V &times; D &times; V<sup>T</sup>.
@@ -44,7 +44,7 @@
 public interface EigenDecomposition {
 
     /**
-     * Returns the matrix V of the decomposition. 
+     * Returns the matrix V of the decomposition.
      * <p>V is an orthogonal matrix, i.e. its transpose is also its inverse.</p>
      * <p>The columns of V are the eigenvectors of the original matrix.</p>
      * @return the V matrix
@@ -52,7 +52,7 @@
     RealMatrix getV();
 
     /**
-     * Returns the block diagonal matrix D of the decomposition. 
+     * Returns the block diagonal matrix D of the decomposition.
      * <p>D is a block diagonal matrix.</p>
      * <p>Real eigenvalues are on the diagonal while complex values are on
      * 2x2 blocks { {real +imaginary}, {-imaginary, real} }.</p>
@@ -63,7 +63,7 @@
     RealMatrix getD();
 
     /**
-     * Returns the transpose of the matrix V of the decomposition. 
+     * Returns the transpose of the matrix V of the decomposition.
      * <p>V is an orthogonal matrix, i.e. its transpose is also its inverse.</p>
      * <p>The columns of V are the eigenvectors of the original matrix.</p>
      * @return the transpose of the V matrix

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/EigenDecompositionImpl.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/EigenDecompositionImpl.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/EigenDecompositionImpl.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/EigenDecompositionImpl.java Sat Sep  5 17:36:48 2009
@@ -150,7 +150,7 @@
     private RealMatrix cachedVt;
 
     /**
-     * Calculates the eigen decomposition of the given symmetric matrix. 
+     * Calculates the eigen decomposition of the given symmetric matrix.
      * @param matrix The <strong>symmetric</strong> matrix to decompose.
      * @param splitTolerance tolerance on the off-diagonal elements relative to the
      * geometric mean to split the tridiagonal matrix (a suggested value is
@@ -173,7 +173,7 @@
     }
 
     /**
-     * Calculates the eigen decomposition of the given tridiagonal symmetric matrix. 
+     * Calculates the eigen decomposition of the given tridiagonal symmetric matrix.
      * @param main the main diagonal of the matrix (will be copied)
      * @param secondary the secondary diagonal of the matrix (will be copied)
      * @param splitTolerance tolerance on the off-diagonal elements relative to the
@@ -224,7 +224,7 @@
     }
 
     /**
-     * Decompose a tridiagonal symmetric matrix. 
+     * Decompose a tridiagonal symmetric matrix.
      * @exception InvalidMatrixException (wrapping a {@link
      * org.apache.commons.math.ConvergenceException} if algorithm fails to converge
      */
@@ -357,7 +357,7 @@
 
     /** Specialized solver. */
     private static class Solver implements DecompositionSolver {
-    
+
         /** Real part of the realEigenvalues. */
         private double[] realEigenvalues;
 
@@ -377,7 +377,7 @@
                        final ArrayRealVector[] eigenvectors) {
             this.realEigenvalues = realEigenvalues;
             this.imagEigenvalues = imagEigenvalues;
-            this.eigenvectors    = eigenvectors; 
+            this.eigenvectors    = eigenvectors;
         }
 
         /** Solve the linear equation A &times; X = B for symmetric matrices A.
@@ -587,7 +587,7 @@
             final double upper = dCurrent + radius;
             work[upperStart + i] = upper;
             upperSpectra = Math.max(upperSpectra, upper);
-            
+
         }
 
         final double dCurrent = main[m - 1];
@@ -657,7 +657,7 @@
                 } else {
                     for (int i = 0; i < n; ++i) {
                         realEigenvalues[begin + i] = lambda - work[4 * i];
-                    }                    
+                    }
                 }
 
             }
@@ -768,7 +768,7 @@
             // in fact, there are solutions to the equation, but in the context
             // of symmetric realEigenvalues problem, there should be three distinct
             // real roots, so we throw an error if this condition is not met
-            throw new InvalidMatrixException("cannot solve degree {0} equation", 3);           
+            throw new InvalidMatrixException("cannot solve degree {0} equation", 3);
         }
         final double sqrtMq = Math.sqrt(-q);
         final double theta  = Math.acos(r / (-q * sqrtMq));
@@ -1019,7 +1019,7 @@
                     if (s <= t) {
                         s = work[k - 3] * work[k - 5] / (t * (1 + Math.sqrt(1 + s / t)));
                     } else {
-                        s = work[k - 3] * work[k - 5] / (t + Math.sqrt(t * (t + s)));                      
+                        s = work[k - 3] * work[k - 5] / (t + Math.sqrt(t * (t + s)));
                     }
                     t = work[k - 7] + (s + work[k - 5]);
                     work[k - 3] *= work[k - 7] / t;
@@ -1433,7 +1433,7 @@
         int nn = 4 * end + pingPong - 1;
         switch (deflated) {
 
-        case 0 : // no realEigenvalues deflated. 
+        case 0 : // no realEigenvalues deflated.
             if (dMin == dN || dMin == dN1) {
 
                 double b1 = Math.sqrt(work[nn - 3]) * Math.sqrt(work[nn - 5]);
@@ -1441,7 +1441,7 @@
                 double a2 = work[nn - 7] + work[nn - 5];
 
                 if (dMin == dN && dMin1 == dN1) {
-                    // cases 2 and 3. 
+                    // cases 2 and 3.
                     final double gap2 = dMin2 - a2 - dMin2 * 0.25;
                     final double gap1 = a2 - dN - ((gap2 > 0.0 && gap2 > b2) ? (b2 / gap2) * b2 : (b1 + b2));
                     if (gap1 > 0.0 && gap1 > b1) {
@@ -1572,7 +1572,7 @@
             break;
 
         case 1 : // one eigenvalue just deflated. use dMin1, dN1 for dMin and dN.
-            if (dMin1 == dN1 && dMin2 == dN2) { 
+            if (dMin1 == dN1 && dMin2 == dN2) {
 
                 // cases 7 and 8.
                 tType = -7;
@@ -1618,7 +1618,7 @@
         case 2 : // two realEigenvalues deflated. use dMin2, dN2 for dMin and dN.
 
             // cases 10 and 11.
-            if (dMin2 == dN2 && 2 * work[nn - 5] < work[nn - 7]) { 
+            if (dMin2 == dN2 && 2 * work[nn - 5] < work[nn - 7]) {
                 tType = -10;
                 final double s = 0.333 * dMin2;
                 if (work[nn - 5] > work[nn - 7]) {
@@ -1711,7 +1711,7 @@
     /**
      * Find an eigenvector corresponding to an eigenvalue, using bidiagonals.
      * <p>This method corresponds to algorithm X from Dhillon's thesis.</p>
-     * 
+     *
      * @param eigenvalue eigenvalue for which eigenvector is desired
      * @param d diagonal elements of the initial non-shifted D matrix
      * @param l off-diagonal elements of the initial non-shifted L matrix

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/FieldLUDecomposition.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/FieldLUDecomposition.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/FieldLUDecomposition.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/FieldLUDecomposition.java Sat Sep  5 17:36:48 2009
@@ -20,7 +20,7 @@
 import org.apache.commons.math.FieldElement;
 
 /**
- * An interface to classes that implement an algorithm to calculate the 
+ * An interface to classes that implement an algorithm to calculate the
  * LU-decomposition of a real matrix.
  * <p>The LU-decomposition of matrix A is a set of three matrices: P, L and U
  * such that P&times;A = L&times;U. P is a rows permutation matrix that is used
@@ -38,7 +38,7 @@
  *   by a {@link #getSolver() getSolver} method and the equivalent methods provided by
  *   the returned {@link DecompositionSolver}.</li>
  * </ul>
- *   
+ *
  * @param <T> the type of the field elements
  * @see <a href="http://mathworld.wolfram.com/LUDecomposition.html">MathWorld</a>
  * @see <a href="http://en.wikipedia.org/wiki/LU_decomposition">Wikipedia</a>
@@ -48,14 +48,14 @@
 public interface FieldLUDecomposition<T extends FieldElement<T>> {
 
     /**
-     * Returns the matrix L of the decomposition. 
+     * Returns the matrix L of the decomposition.
      * <p>L is an lower-triangular matrix</p>
      * @return the L matrix (or null if decomposed matrix is singular)
      */
     FieldMatrix<T> getL();
 
     /**
-     * Returns the matrix U of the decomposition. 
+     * Returns the matrix U of the decomposition.
      * <p>U is an upper-triangular matrix</p>
      * @return the U matrix (or null if decomposed matrix is singular)
      */

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/FieldLUDecompositionImpl.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/FieldLUDecompositionImpl.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/FieldLUDecompositionImpl.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/FieldLUDecompositionImpl.java Sat Sep  5 17:36:48 2009
@@ -64,7 +64,7 @@
     private FieldMatrix<T> cachedP;
 
     /**
-     * Calculates the LU-decomposition of the given matrix. 
+     * Calculates the LU-decomposition of the given matrix.
      * @param matrix The matrix to decompose.
      * @exception NonSquareMatrixException if matrix is not square
      */

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/FieldMatrix.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/FieldMatrix.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/FieldMatrix.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/FieldMatrix.java Sat Sep  5 17:36:48 2009
@@ -26,7 +26,7 @@
  * <p>
  * Matrix element indexing is 0-based -- e.g., <code>getEntry(0, 0)</code>
  * returns the element in the first row, first column of the matrix.</p>
- * 
+ *
  * @param <T> the type of the field elements
  * @version $Revision$ $Date$
  */
@@ -131,7 +131,7 @@
      */
    FieldMatrix<T> getSubMatrix(int startRow, int endRow, int startColumn, int endColumn)
        throws MatrixIndexException;
-   
+
    /**
     * Gets a submatrix. Rows and columns are indicated
     * counting from 0 to n-1.
@@ -161,7 +161,7 @@
   void copySubMatrix(int startRow, int endRow, int startColumn, int endColumn,
                      T[][] destination)
       throws MatrixIndexException, IllegalArgumentException;
-  
+
   /**
    * Copy a submatrix. Rows and columns are indicated
    * counting from 0 to n-1.
@@ -175,35 +175,35 @@
    */
   void copySubMatrix(int[] selectedRows, int[] selectedColumns, T[][] destination)
       throws MatrixIndexException, IllegalArgumentException;
- 
+
    /**
     * Replace the submatrix starting at <code>row, column</code> using data in
     * the input <code>subMatrix</code> array. Indexes are 0-based.
-    * <p> 
+    * <p>
     * Example:<br>
     * Starting with <pre>
     * 1  2  3  4
     * 5  6  7  8
     * 9  0  1  2
     * </pre>
-    * and <code>subMatrix = {{3, 4} {5,6}}</code>, invoking 
+    * and <code>subMatrix = {{3, 4} {5,6}}</code>, invoking
     * <code>setSubMatrix(subMatrix,1,1))</code> will result in <pre>
     * 1  2  3  4
     * 5  3  4  8
     * 9  5  6  2
     * </pre></p>
-    * 
+    *
     * @param subMatrix  array containing the submatrix replacement data
     * @param row  row coordinate of the top, left element to be replaced
     * @param column  column coordinate of the top, left element to be replaced
-    * @throws MatrixIndexException  if subMatrix does not fit into this 
-    *    matrix from element in (row, column) 
+    * @throws MatrixIndexException  if subMatrix does not fit into this
+    *    matrix from element in (row, column)
     * @throws IllegalArgumentException if <code>subMatrix</code> is not rectangular
     *  (not all rows have the same length) or empty
     * @throws NullPointerException if <code>subMatrix</code> is null
     * @since 2.0
     */
-   void setSubMatrix(T[][] subMatrix, int row, int column) 
+   void setSubMatrix(T[][] subMatrix, int row, int column)
        throws MatrixIndexException;
 
    /**
@@ -215,7 +215,7 @@
     * @throws MatrixIndexException if the specified row index is invalid
     */
    FieldMatrix<T> getRowMatrix(int row) throws MatrixIndexException;
-   
+
    /**
     * Sets the entries in row number <code>row</code>
     * as a row matrix.  Row indices start at 0.
@@ -229,7 +229,7 @@
     */
    void setRowMatrix(int row, FieldMatrix<T> matrix)
        throws MatrixIndexException, InvalidMatrixException;
-   
+
    /**
     * Returns the entries in column number <code>column</code>
     * as a column matrix.  Column indices start at 0.
@@ -253,7 +253,7 @@
     */
    void setColumnMatrix(int column, FieldMatrix<T> matrix)
        throws MatrixIndexException, InvalidMatrixException;
-   
+
    /**
     * Returns the entries in row number <code>row</code>
     * as a vector.  Row indices start at 0.
@@ -277,7 +277,7 @@
     */
    void setRowVector(int row, FieldVector<T> vector)
        throws MatrixIndexException, InvalidMatrixException;
-   
+
    /**
     * Returns the entries in column number <code>column</code>
     * as a vector.  Column indices start at 0.
@@ -300,7 +300,7 @@
     */
    void setColumnVector(int column, FieldVector<T> vector)
        throws MatrixIndexException, InvalidMatrixException;
-   
+
     /**
      * Returns the entries in row number <code>row</code> as an array.
      * <p>
@@ -325,7 +325,7 @@
      */
     void setRow(int row, T[] array)
         throws MatrixIndexException, InvalidMatrixException;
-    
+
     /**
      * Returns the entries in column number <code>col</code> as an array.
      * <p>
@@ -350,17 +350,17 @@
      */
     void setColumn(int column, T[] array)
         throws MatrixIndexException, InvalidMatrixException;
-    
+
     /**
      * Returns the entry in the specified row and column.
      * <p>
-     * Row and column indices start at 0 and must satisfy 
+     * Row and column indices start at 0 and must satisfy
      * <ul>
      * <li><code>0 <= row < rowDimension</code></li>
      * <li><code> 0 <= column < columnDimension</code></li>
      * </ul>
      * otherwise a <code>MatrixIndexException</code> is thrown.</p>
-     * 
+     *
      * @param row  row location of entry to be fetched
      * @param column  column location of entry to be fetched
      * @return matrix entry in row,column
@@ -371,13 +371,13 @@
     /**
      * Set the entry in the specified row and column.
      * <p>
-     * Row and column indices start at 0 and must satisfy 
+     * Row and column indices start at 0 and must satisfy
      * <ul>
      * <li><code>0 <= row < rowDimension</code></li>
      * <li><code> 0 <= column < columnDimension</code></li>
      * </ul>
      * otherwise a <code>MatrixIndexException</code> is thrown.</p>
-     * 
+     *
      * @param row  row location of entry to be set
      * @param column  column location of entry to be set
      * @param value matrix entry to be set in row,column
@@ -389,13 +389,13 @@
     /**
      * Change an entry in the specified row and column.
      * <p>
-     * Row and column indices start at 0 and must satisfy 
+     * Row and column indices start at 0 and must satisfy
      * <ul>
      * <li><code>0 <= row < rowDimension</code></li>
      * <li><code> 0 <= column < columnDimension</code></li>
      * </ul>
      * otherwise a <code>MatrixIndexException</code> is thrown.</p>
-     * 
+     *
      * @param row  row location of entry to be set
      * @param column  column location of entry to be set
      * @param increment value to add to the current matrix entry in row,column
@@ -407,13 +407,13 @@
     /**
      * Change an entry in the specified row and column.
      * <p>
-     * Row and column indices start at 0 and must satisfy 
+     * Row and column indices start at 0 and must satisfy
      * <ul>
      * <li><code>0 <= row < rowDimension</code></li>
      * <li><code> 0 <= column < columnDimension</code></li>
      * </ul>
      * otherwise a <code>MatrixIndexException</code> is thrown.</p>
-     * 
+     *
      * @param row  row location of entry to be set
      * @param column  column location of entry to be set
      * @param factor multiplication factor for the current matrix entry in row,column

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/FieldMatrixChangingVisitor.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/FieldMatrixChangingVisitor.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/FieldMatrixChangingVisitor.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/FieldMatrixChangingVisitor.java Sat Sep  5 17:36:48 2009
@@ -21,7 +21,7 @@
 
 /**
  * Interface defining a visitor for matrix entries.
- * 
+ *
  * @param <T> the type of the field elements
  * @version $Revision$ $Date$
  * @since 2.0

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/FieldMatrixPreservingVisitor.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/FieldMatrixPreservingVisitor.java?rev=811685&r1=811684&r2=811685&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/FieldMatrixPreservingVisitor.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/FieldMatrixPreservingVisitor.java Sat Sep  5 17:36:48 2009
@@ -21,7 +21,7 @@
 
 /**
  * Interface defining a visitor for matrix entries.
- * 
+ *
  * @param <T> the type of the field elements
  * @version $Revision$ $Date$
  * @since 2.0



Mime
View raw message