commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From er...@apache.org
Subject svn commit: r1027952 [2/5] - in /commons/proper/math/trunk/src: main/java/org/apache/commons/math/exception/ main/java/org/apache/commons/math/exception/util/ main/java/org/apache/commons/math/linear/ main/resources/META-INF/localization/ test/java/org...
Date Wed, 27 Oct 2010 13:16:58 GMT
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=1027952&r1=1027951&r2=1027952&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 Wed Oct 27 13:16:57 2010
@@ -20,7 +20,10 @@ import java.io.Serializable;
 import java.util.Arrays;
 import java.util.Iterator;
 
-import org.apache.commons.math.MathRuntimeException;
+import org.apache.commons.math.exception.NullArgumentException;
+import org.apache.commons.math.exception.DimensionMismatchException;
+import org.apache.commons.math.exception.NumberIsTooLargeException;
+import org.apache.commons.math.exception.MathArithmeticException;
 import org.apache.commons.math.exception.util.LocalizedFormats;
 import org.apache.commons.math.util.MathUtils;
 import org.apache.commons.math.util.FastMath;
@@ -31,42 +34,41 @@ import org.apache.commons.math.util.Fast
  * @since 2.0
  */
 public class ArrayRealVector extends AbstractRealVector implements Serializable {
-
     /** Serializable version identifier. */
     private static final long serialVersionUID = -1097961340710804027L;
-
     /** Default format. */
     private static final RealVectorFormat DEFAULT_FORMAT =
         RealVectorFormat.getInstance();
-
     /** Entries of the vector. */
     protected double data[];
 
     /**
      * Build a 0-length vector.
-     * <p>Zero-length vectors may be used to initialized construction of vectors
+     * Zero-length vectors may be used to initialized construction of vectors
      * by data gathering. We start with zero-length and use either the {@link
      * #ArrayRealVector(ArrayRealVector, ArrayRealVector)} constructor
-     * or one of the <code>append</code> method ({@link #append(double)}, {@link
+     * or one of the {@code append} method ({@link #append(double)}, {@link
      * #append(double[])}, {@link #append(ArrayRealVector)}) to gather data
-     * into this vector.</p>
+     * into this vector.
      */
     public ArrayRealVector() {
         data = new double[0];
     }
 
     /**
-     * Construct a (size)-length vector of zeros.
-     * @param size size of the vector
+     * Construct a vector of zeroes.
+     *
+     * @param size Size of the vector.
      */
     public ArrayRealVector(int size) {
         data = new double[size];
     }
 
     /**
-     * Construct an (size)-length vector with preset values.
-     * @param size size of the vector
-     * @param preset fill the vector with this scalar value
+     * Construct a vector with preset values.
+     *
+     * @param size Size of the vector
+     * @param preset All entries will be set with this value.
      */
     public ArrayRealVector(int size, double preset) {
         data = new double[size];
@@ -75,7 +77,9 @@ public class ArrayRealVector extends Abs
 
     /**
      * Construct a vector from an array, copying the input array.
-     * @param d array of doubles.
+     *
+     * @param d Array.
+     * @throws NullArgumentException if {@code d} is {@code null}.
      */
     public ArrayRealVector(double[] d) {
         data = d.clone();
@@ -84,29 +88,40 @@ public class ArrayRealVector extends Abs
     /**
      * Create a new ArrayRealVector using the input array as the underlying
      * data array.
-     * <p>If an array is built specially in order to be embedded in a
-     * ArrayRealVector and not used directly, the <code>copyArray</code> may be
-     * set to <code>false</code. This will prevent the copying and improve
-     * performance as no new array will be built and no data will be copied.</p>
-     * @param d data for new vector
-     * @param copyArray if true, the input array will be copied, otherwise
-     * it will be referenced
+     * If an array is built specially in order to be embedded in a
+     * ArrayRealVector and not used directly, the {@code copyArray} may be
+     * set to {@code false}. This will prevent the copying and improve
+     * performance as no new array will be built and no data will be copied.
+     *
+     * @param d Data for the new vector.
+     * @param copyArray if {@code true}, the input array will be copied,
+     * otherwise it will be referenced.
+     * @throws NullArgumentException if {@code d} is {@code null}.
      * @see #ArrayRealVector(double[])
      */
     public ArrayRealVector(double[] d, boolean copyArray) {
+        if (d == null) {
+            throw new NullArgumentException();
+        }
         data = copyArray ? d.clone() :  d;
     }
 
     /**
      * Construct a vector from part of a array.
-     * @param d array of doubles.
-     * @param pos position of first entry
-     * @param size number of entries to copy
+     *
+     * @param d Array.
+     * @param pos Position of first entry.
+     * @param size Number of entries to copy.
+     * @throws NullArgumentException if {@code d} is {@code null}.
+     * @throws NumberIsTooLargeException if the size of {@code d} is less
+     * than {@code pos + size}.
      */
     public ArrayRealVector(double[] d, int pos, int size) {
+        if (d == null) {
+            throw new NullArgumentException();
+        }
         if (d.length < pos + size) {
-            throw MathRuntimeException.createIllegalArgumentException(
-                  LocalizedFormats.POSITION_SIZE_MISMATCH_INPUT_ARRAY, pos, size, d.length);
+            throw new NumberIsTooLargeException(pos + size, d.length, true);
         }
         data = new double[size];
         System.arraycopy(d, pos, data, 0, size);
@@ -124,27 +139,38 @@ public class ArrayRealVector extends Abs
     }
 
     /**
-     * Construct a vector from part of a Double array
-     * @param d array of Doubles.
-     * @param pos position of first entry
-     * @param size number of entries to copy
+     * Construct a vector from part of an array.
+     *
+     * @param d Array.
+     * @param pos Position of first entry.
+     * @param size Number of entries to copy.
+     * @throws NullArgumentException if {@code d} is {@code null}.
+     * @throws NumberIsTooLargeException if the size of {@code d} is less
+     * than {@code pos + size}.
      */
     public ArrayRealVector(Double[] d, int pos, int size) {
+        if (d == null) {
+            throw new NullArgumentException();
+        }
         if (d.length < pos + size) {
-            throw MathRuntimeException.createIllegalArgumentException(
-                  LocalizedFormats.POSITION_SIZE_MISMATCH_INPUT_ARRAY, pos, size, d.length);
+            throw new NumberIsTooLargeException(pos + size, d.length, true);
         }
         data = new double[size];
         for (int i = pos; i < pos + size; i++) {
-            data[i-pos] = d[i].doubleValue();
+            data[i - pos] = d[i].doubleValue();
         }
     }
 
     /**
      * Construct a vector from another vector, using a deep copy.
-     * @param v vector to copy
+     *
+     * @param v vector to copy.
+     * @throws NullArgumentException if {@code v} is {@code null}.
      */
     public ArrayRealVector(RealVector v) {
+        if (v == null) {
+            throw new NullArgumentException();
+        }
         data = new double[v.getDimension()];
         for (int i = 0; i < data.length; ++i) {
             data[i] = v.getEntry(i);
@@ -153,7 +179,9 @@ public class ArrayRealVector extends Abs
 
     /**
      * Construct a vector from another vector, using a deep copy.
-     * @param v vector to copy
+     *
+     * @param v Vector to copy.
+     * @throws NullArgumentException if {@code v} is {@code null}.
      */
     public ArrayRealVector(ArrayRealVector v) {
         this(v, true);
@@ -161,8 +189,10 @@ public class ArrayRealVector extends Abs
 
     /**
      * Construct a vector from another vector.
-     * @param v vector to copy
-     * @param deep if true perform a deep copy otherwise perform a shallow copy
+     *
+     * @param v Vector to copy.
+     * @param deep If {@code true} perform a deep copy, otherwise perform a
+     * shallow copy.
      */
     public ArrayRealVector(ArrayRealVector v, boolean deep) {
         data = deep ? v.data.clone() : v.data;
@@ -711,12 +741,13 @@ public class ArrayRealVector extends Abs
 
     /**
      * Compute the dot product.
-     * @param v vector with which dot product should be computed
-     * @return the scalar dot product between instance and v
-     * @exception IllegalArgumentException if v is not the same size as this
+     *
+     * @param v Vector with which dot product should be computed
+     * @return the scalar dot product between instance and {@code v}.
+     * @throws DimensionMismatchException if {@code v} is not the same
+     * size as this vector.
      */
-    public double dotProduct(ArrayRealVector v)
-        throws IllegalArgumentException {
+    public double dotProduct(ArrayRealVector v) {
         return dotProduct(v.data);
     }
 
@@ -782,26 +813,26 @@ public class ArrayRealVector extends Abs
 
    /**
      * Distance between two vectors.
-     * <p>This method computes the distance consistent with the
+     * This method computes the distance consistent with the
      * L<sub>2</sub> norm, i.e. the square root of the sum of
-     * elements differences, or euclidian distance.</p>
+     * elements differences, or euclidian distance.
+     *
      * @param v vector to which distance is requested
-     * @return distance between two vectors.
-     * @exception IllegalArgumentException if v is not the same size as this
+     * @return the distance between two vectors.
+     * @throws DimensionMismatchException if {@code v} is not the same size as
+     * this vector.
      * @see #getDistance(RealVector)
      * @see #getL1Distance(ArrayRealVector)
      * @see #getLInfDistance(ArrayRealVector)
      * @see #getNorm()
      */
-    public double getDistance(ArrayRealVector v)
-        throws IllegalArgumentException {
+    public double getDistance(ArrayRealVector v) {
         return getDistance(v.data);
     }
 
     /** {@inheritDoc} */
     @Override
-    public double getL1Distance(RealVector v)
-        throws IllegalArgumentException {
+    public double getL1Distance(RealVector v) {
         if (v instanceof ArrayRealVector) {
             return getL1Distance((ArrayRealVector) v);
         } else {
@@ -830,26 +861,26 @@ public class ArrayRealVector extends Abs
 
     /**
      * Distance between two vectors.
-     * <p>This method computes the distance consistent with
+     * This method computes the distance consistent with
      * L<sub>1</sub> norm, i.e. the sum of the absolute values of
-     * elements differences.</p>
-     * @param v vector to which distance is requested
-     * @return distance between two vectors.
-     * @exception IllegalArgumentException if v is not the same size as this
+     * elements differences.
+     *
+     * @param v Vector to which distance is requested.
+     * @return the distance between two vectors.
+     * @throws DimensionMismatchException if {@code v} is not the same size
+     * as this vector.
      * @see #getDistance(RealVector)
      * @see #getL1Distance(ArrayRealVector)
      * @see #getLInfDistance(ArrayRealVector)
      * @see #getNorm()
      */
-    public double getL1Distance(ArrayRealVector v)
-        throws IllegalArgumentException {
+    public double getL1Distance(ArrayRealVector v) {
         return getL1Distance(v.data);
     }
 
     /** {@inheritDoc} */
     @Override
-    public double getLInfDistance(RealVector v)
-        throws IllegalArgumentException {
+    public double getLInfDistance(RealVector v) {
         if (v instanceof ArrayRealVector) {
             return getLInfDistance((ArrayRealVector) v);
         } else {
@@ -878,38 +909,38 @@ public class ArrayRealVector extends Abs
 
     /**
      * Distance between two vectors.
-     * <p>This method computes the distance consistent with
+     * This method computes the distance consistent with
      * L<sub>&infin;</sub> norm, i.e. the max of the absolute values of
-     * elements differences.</p>
-     * @param v vector to which distance is requested
-     * @return distance between two vectors.
-     * @exception IllegalArgumentException if v is not the same size as this
+     * elements differences.
+     *
+     * @param v Vector to which distance is requested.
+     * @return the distance between two vectors.
+     * @exception IllegalArgumentException if {@code v} is not the same size as this
      * @see #getDistance(RealVector)
      * @see #getL1Distance(ArrayRealVector)
      * @see #getLInfDistance(ArrayRealVector)
      * @see #getNorm()
      */
-    public double getLInfDistance(ArrayRealVector v)
-        throws IllegalArgumentException {
+    public double getLInfDistance(ArrayRealVector v) {
         return getLInfDistance(v.data);
     }
 
     /** {@inheritDoc} */
     @Override
-    public RealVector unitVector() throws ArithmeticException {
+    public RealVector unitVector() {
         final double norm = getNorm();
         if (norm == 0) {
-            throw MathRuntimeException.createArithmeticException(LocalizedFormats.ZERO_NORM);
+            throw new MathArithmeticException(LocalizedFormats.ZERO_NORM);
         }
         return mapDivide(norm);
     }
 
     /** {@inheritDoc} */
     @Override
-    public void unitize() throws ArithmeticException {
+    public void unitize() {
         final double norm = getNorm();
         if (norm == 0) {
-            throw MathRuntimeException.createArithmeticException(LocalizedFormats.CANNOT_NORMALIZE_A_ZERO_NORM_VECTOR);
+            throw new MathArithmeticException(LocalizedFormats.ZERO_NORM);
         }
         mapDivideToSelf(norm);
     }
@@ -925,10 +956,13 @@ public class ArrayRealVector extends Abs
         return projection(new ArrayRealVector(v, false));
     }
 
-   /** Find the orthogonal projection of this vector onto another vector.
-     * @param v vector onto which instance must be projected
-     * @return projection of the instance onto v
-     * @throws IllegalArgumentException if v is not the same size as this
+    /**
+     * Find the orthogonal projection of this vector onto another vector.
+     *
+     * @param v Vector onto which instance must be projected.
+     * @return Projection of this instance onto {@code v}.
+     * @throws DimensionMismatchException if {@code v} is not the same size as
+     * this vector.
      */
     public ArrayRealVector projection(ArrayRealVector v) {
         return (ArrayRealVector) v.mapMultiply(dotProduct(v) / v.dotProduct(v));
@@ -980,7 +1014,7 @@ public class ArrayRealVector extends Abs
     }
 
     /** {@inheritDoc} */
-    public double getEntry(int index) throws MatrixIndexException {
+    public double getEntry(int index) {
         return data[index];
     }
 
@@ -1000,8 +1034,9 @@ public class ArrayRealVector extends Abs
 
     /**
      * Construct a vector by appending a vector to this vector.
-     * @param v vector to append to this one.
-     * @return a new vector
+     *
+     * @param v Vector to append to this one.
+     * @return a new vector.
      */
     public ArrayRealVector append(ArrayRealVector v) {
         return new ArrayRealVector(this, v);
@@ -1072,13 +1107,12 @@ public class ArrayRealVector extends Abs
     /**
      * 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
-     * inconsistent with vector size
+     * @param index Index of first element to be set.
+     * @param v Vector containing the values to set.
+     * @throws org.apache.commons.math.exception.OutOfRangeException
+     * if the index is inconsistent with vector size.
      */
-    public void set(int index, ArrayRealVector v)
-        throws MatrixIndexException {
+    public void set(int index, ArrayRealVector v) {
         setSubVector(index, v.data);
     }
 
@@ -1102,36 +1136,35 @@ public class ArrayRealVector extends Abs
 
     /**
      * Check if instance and specified vectors have the same dimension.
-     * @param v vector to compare instance with
-     * @exception IllegalArgumentException if the vectors do not
-     * have the same dimension
+     *
+     * @param v Vector to compare instance with.
+     * @throws DimensionMismatchException if the vectors do not
+     * have the same dimension.
      */
     @Override
-    protected void checkVectorDimensions(RealVector v)
-        throws IllegalArgumentException {
+    protected void checkVectorDimensions(RealVector v) {
         checkVectorDimensions(v.getDimension());
     }
 
     /**
      * Check if instance dimension is equal to some expected value.
      *
-     * @param n expected dimension.
-     * @exception IllegalArgumentException if the dimension is
-     * inconsistent with vector size
+     * @param n Expected dimension.
+     * @throws DimensionMismatchException if the dimension is
+     * inconsistent with vector size.
      */
     @Override
-    protected void checkVectorDimensions(int n)
-        throws IllegalArgumentException {
+    protected void checkVectorDimensions(int n) {
         if (data.length != n) {
-            throw MathRuntimeException.createIllegalArgumentException(
-                    LocalizedFormats.VECTOR_LENGTH_MISMATCH,
-                    data.length, n);
+            throw new DimensionMismatchException(data.length, n);
         }
     }
 
     /**
-     * Returns true if any coordinate of this vector is NaN; false otherwise
-     * @return  true if any coordinate of this vector is NaN; false otherwise
+     * Check if any coordinate of this vector is {@code NaN}.
+     *
+     * @return {@code true} if any coordinate of this vector is {@code NaN},
+     * {@code false} otherwise.
      */
     public boolean isNaN() {
         for (double v : data) {
@@ -1143,13 +1176,13 @@ public class ArrayRealVector extends Abs
     }
 
     /**
-     * Returns true if any coordinate of this vector is infinite and none are NaN;
-     * false otherwise
-     * @return  true if any coordinate of this vector is infinite and none are NaN;
-     * false otherwise
+     * Check whether any coordinate of this vector is infinite and none
+     * are {@code NaN}.
+     *
+     * @return {@code true} if any coordinate of this vector is infinite and
+     * none are {@code NaN}, {@code false} otherwise.
      */
     public boolean isInfinite() {
-
         if (isNaN()) {
             return false;
         }
@@ -1161,61 +1194,54 @@ public class ArrayRealVector extends Abs
         }
 
         return false;
-
     }
 
     /**
      * Test for the equality of two real vectors.
-     * <p>
      * If all coordinates of two real vectors are exactly the same, and none are
-     * <code>Double.NaN</code>, the two real vectors are considered to be equal.
-     * </p>
-     * <p>
-     * <code>NaN</code> coordinates are considered to affect globally the vector
+     * {@code NaN}, the two real vectors are considered to be equal.
+     * {@code NaN} coordinates are considered to affect globally the vector
      * and be equals to each other - i.e, if either (or all) coordinates of the
-     * real vector are equal to <code>Double.NaN</code>, the real vector is equal to
-     * a vector with all <code>Double.NaN</code> coordinates.
-     * </p>
-     *
-     * @param other Object to test for equality to this
-     * @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
+     * real vector are equal to {@code NaN}, the real vector is equal to
+     * a vector with all {@code NaN} coordinates.
      *
+     * @param other Object to test for equality.
+     * @return {@code true} if two vector objects are equal, {@code false} if
+     * {@code other} is null, not an instance of {@code RealVector}, or
+     * not equal to this {@code RealVector} instance.
      */
     @Override
     public boolean equals(Object other) {
+        if (this == other) {
+            return true;
+        }
 
-      if (this == other) {
-        return true;
-      }
-
-      if (other == null || !(other instanceof RealVector)) {
-        return false;
-      }
+        if (other == null || !(other instanceof RealVector)) {
+            return false;
+        }
 
+        RealVector rhs = (RealVector) other;
+        if (data.length != rhs.getDimension()) {
+            return false;
+        }
 
-      RealVector rhs = (RealVector) other;
-      if (data.length != rhs.getDimension()) {
-        return false;
-      }
+        if (rhs.isNaN()) {
+            return this.isNaN();
+        }
 
-      if (rhs.isNaN()) {
-        return this.isNaN();
-      }
-
-      for (int i = 0; i < data.length; ++i) {
-        if (data[i] != rhs.getEntry(i)) {
-          return false;
+        for (int i = 0; i < data.length; ++i) {
+            if (data[i] != rhs.getEntry(i)) {
+                return false;
+            }
         }
-      }
-      return true;
+        return true;
     }
 
     /**
      * Get a hashCode for the real vector.
-     * <p>All NaN values have the same hash code.</p>
-     * @return a hash code value for this object
+     * All {@code NaN} values have the same hash code.
+     *
+     * @return a hash code.
      */
     @Override
     public int hashCode() {
@@ -1224,5 +1250,4 @@ public class ArrayRealVector extends Abs
         }
         return MathUtils.hash(data);
     }
-
 }

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=1027952&r1=1027951&r2=1027952&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 Wed Oct 27 13:16:57 2010
@@ -66,25 +66,18 @@ import org.apache.commons.math.util.Fast
  * @since 2.0
  */
 public class BlockRealMatrix extends AbstractRealMatrix implements Serializable {
-
     /** Block size. */
     public static final int BLOCK_SIZE = 52;
-
     /** Serializable version identifier */
     private static final long serialVersionUID = 4991895511313664478L;
-
     /** Blocks of matrix entries. */
     private final double blocks[][];
-
     /** Number of rows of the matrix. */
     private final int rows;
-
     /** Number of columns of the matrix. */
     private final int columns;
-
     /** Number of block rows of the matrix. */
     private final int blockRows;
-
     /** Number of block columns of the matrix. */
     private final int blockColumns;
 
@@ -94,22 +87,19 @@ public class BlockRealMatrix extends Abs
      * @param rows  the number of rows in the new matrix
      * @param columns  the number of columns in the new matrix
      * @throws IllegalArgumentException if row or column dimension is not
-     *  positive
+     * positive.
      */
-    public BlockRealMatrix(final int rows, final int columns)
-        throws IllegalArgumentException {
-
+    public BlockRealMatrix(final int rows, final int columns) {
         super(rows, columns);
-        this.rows    = rows;
+        this.rows = rows;
         this.columns = columns;
 
         // number of blocks
-        blockRows    = (rows    + BLOCK_SIZE - 1) / BLOCK_SIZE;
+        blockRows = (rows + BLOCK_SIZE - 1) / BLOCK_SIZE;
         blockColumns = (columns + BLOCK_SIZE - 1) / BLOCK_SIZE;
 
         // allocate storage blocks, taking care of smaller ones at right and bottom
         blocks = createBlocksLayout(rows, columns);
-
     }
 
     /**
@@ -146,15 +136,13 @@ public class BlockRealMatrix extends Abs
      * @see #BlockRealMatrix(double[][])
      */
     public BlockRealMatrix(final int rows, final int columns,
-                           final double[][] blockData, final boolean copyArray)
-        throws IllegalArgumentException {
-
+                           final double[][] blockData, final boolean copyArray) {
         super(rows, columns);
-        this.rows    = rows;
+        this.rows = rows;
         this.columns = columns;
 
         // number of blocks
-        blockRows    = (rows    + BLOCK_SIZE - 1) / BLOCK_SIZE;
+        blockRows = (rows + BLOCK_SIZE - 1) / BLOCK_SIZE;
         blockColumns = (columns + BLOCK_SIZE - 1) / BLOCK_SIZE;
 
         if (copyArray) {
@@ -202,12 +190,10 @@ public class BlockRealMatrix extends Abs
      * @see #createBlocksLayout(int, int)
      * @see #BlockRealMatrix(int, int, double[][], boolean)
      */
-    public static double[][] toBlocksLayout(final double[][] rawData)
-        throws IllegalArgumentException {
-
-        final int rows         = rawData.length;
-        final int columns      = rawData[0].length;
-        final int blockRows    = (rows    + BLOCK_SIZE - 1) / BLOCK_SIZE;
+    public static double[][] toBlocksLayout(final double[][] rawData) {
+        final int rows = rawData.length;
+        final int columns = rawData[0].length;
+        final int blockRows = (rows    + BLOCK_SIZE - 1) / BLOCK_SIZE;
         final int blockColumns = (columns + BLOCK_SIZE - 1) / BLOCK_SIZE;
 
         // safety checks
@@ -222,12 +208,12 @@ public class BlockRealMatrix extends Abs
         final double[][] blocks = new double[blockRows * blockColumns][];
         int blockIndex = 0;
         for (int iBlock = 0; iBlock < blockRows; ++iBlock) {
-            final int pStart  = iBlock * BLOCK_SIZE;
-            final int pEnd    = FastMath.min(pStart + BLOCK_SIZE, rows);
+            final int pStart = iBlock * BLOCK_SIZE;
+            final int pEnd = FastMath.min(pStart + BLOCK_SIZE, rows);
             final int iHeight = pEnd - pStart;
             for (int jBlock = 0; jBlock < blockColumns; ++jBlock) {
                 final int qStart = jBlock * BLOCK_SIZE;
-                final int qEnd   = FastMath.min(qStart + BLOCK_SIZE, columns);
+                final int qEnd = FastMath.min(qStart + BLOCK_SIZE, columns);
                 final int jWidth = qEnd - qStart;
 
                 // allocate new block
@@ -240,9 +226,7 @@ public class BlockRealMatrix extends Abs
                     System.arraycopy(rawData[p], qStart, block, index, jWidth);
                     index += jWidth;
                 }
-
                 ++blockIndex;
-
             }
         }
 
@@ -262,19 +246,18 @@ public class BlockRealMatrix extends Abs
      * @see #BlockRealMatrix(int, int, double[][], boolean)
      */
     public static double[][] createBlocksLayout(final int rows, final int columns) {
-
-        final int blockRows    = (rows    + BLOCK_SIZE - 1) / BLOCK_SIZE;
+        final int blockRows = (rows    + BLOCK_SIZE - 1) / BLOCK_SIZE;
         final int blockColumns = (columns + BLOCK_SIZE - 1) / BLOCK_SIZE;
 
         final double[][] blocks = new double[blockRows * blockColumns][];
         int blockIndex = 0;
         for (int iBlock = 0; iBlock < blockRows; ++iBlock) {
-            final int pStart  = iBlock * BLOCK_SIZE;
-            final int pEnd    = FastMath.min(pStart + BLOCK_SIZE, rows);
+            final int pStart = iBlock * BLOCK_SIZE;
+            final int pEnd = FastMath.min(pStart + BLOCK_SIZE, rows);
             final int iHeight = pEnd - pStart;
             for (int jBlock = 0; jBlock < blockColumns; ++jBlock) {
                 final int qStart = jBlock * BLOCK_SIZE;
-                final int qEnd   = FastMath.min(qStart + BLOCK_SIZE, columns);
+                final int qEnd = FastMath.min(qStart + BLOCK_SIZE, columns);
                 final int jWidth = qEnd - qStart;
                 blocks[blockIndex] = new double[iHeight * jWidth];
                 ++blockIndex;
@@ -286,15 +269,13 @@ public class BlockRealMatrix extends Abs
 
     /** {@inheritDoc} */
     @Override
-    public BlockRealMatrix createMatrix(final int rowDimension, final int columnDimension)
-        throws IllegalArgumentException {
+    public BlockRealMatrix createMatrix(final int rowDimension, final int columnDimension) {
         return new BlockRealMatrix(rowDimension, columnDimension);
     }
 
     /** {@inheritDoc} */
     @Override
     public BlockRealMatrix copy() {
-
         // create an empty matrix
         BlockRealMatrix copied = new BlockRealMatrix(rows, columns);
 
@@ -308,12 +289,10 @@ public class BlockRealMatrix extends Abs
 
     /** {@inheritDoc} */
     @Override
-    public BlockRealMatrix add(final RealMatrix m)
-        throws IllegalArgumentException {
+    public BlockRealMatrix add(final RealMatrix m) {
         try {
             return add((BlockRealMatrix) m);
         } catch (ClassCastException cce) {
-
             // safety check
             MatrixUtils.checkAdditionCompatible(this, m);
 
@@ -327,10 +306,10 @@ public class BlockRealMatrix extends Abs
                     // perform addition on the current block
                     final double[] outBlock = out.blocks[blockIndex];
                     final double[] tBlock   = blocks[blockIndex];
-                    final int      pStart   = iBlock * BLOCK_SIZE;
-                    final int      pEnd     = FastMath.min(pStart + BLOCK_SIZE, rows);
-                    final int      qStart   = jBlock * BLOCK_SIZE;
-                    final int      qEnd     = FastMath.min(qStart + BLOCK_SIZE, columns);
+                    final int pStart = iBlock * BLOCK_SIZE;
+                    final int pEnd = FastMath.min(pStart + BLOCK_SIZE, rows);
+                    final int qStart = jBlock * BLOCK_SIZE;
+                    final int qEnd = FastMath.min(qStart + BLOCK_SIZE, columns);
                     int k = 0;
                     for (int p = pStart; p < pEnd; ++p) {
                         for (int q = qStart; q < qEnd; ++q) {
@@ -338,10 +317,8 @@ public class BlockRealMatrix extends Abs
                             ++k;
                         }
                     }
-
                     // go to next block
                     ++blockIndex;
-
                 }
             }
 
@@ -350,15 +327,14 @@ public class BlockRealMatrix extends Abs
     }
 
     /**
-     * Compute the sum of this and <code>m</code>.
+     * Compute the sum of this matrix and {@code m}.
      *
-     * @param m    matrix to be added
-     * @return     this + m
-     * @throws  IllegalArgumentException if m is not the same size as this
+     * @param m Matrix to be added.
+     * @return {@code this} + m.
+     * @throws MatrixDimensionMismatchException if {@code m} is not the same
+     * size as this matrix.
      */
-    public BlockRealMatrix add(final BlockRealMatrix m)
-        throws IllegalArgumentException {
-
+    public BlockRealMatrix add(final BlockRealMatrix m) {
         // safety check
         MatrixUtils.checkAdditionCompatible(this, m);
 
@@ -367,8 +343,8 @@ public class BlockRealMatrix extends Abs
         // perform addition block-wise, to ensure good cache behavior
         for (int blockIndex = 0; blockIndex < out.blocks.length; ++blockIndex) {
             final double[] outBlock = out.blocks[blockIndex];
-            final double[] tBlock   = blocks[blockIndex];
-            final double[] mBlock   = m.blocks[blockIndex];
+            final double[] tBlock = blocks[blockIndex];
+            final double[] mBlock = m.blocks[blockIndex];
             for (int k = 0; k < outBlock.length; ++k) {
                 outBlock[k] = tBlock[k] + mBlock[k];
             }
@@ -379,12 +355,10 @@ public class BlockRealMatrix extends Abs
 
     /** {@inheritDoc} */
     @Override
-    public BlockRealMatrix subtract(final RealMatrix m)
-        throws IllegalArgumentException {
+    public BlockRealMatrix subtract(final RealMatrix m) {
         try {
             return subtract((BlockRealMatrix) m);
         } catch (ClassCastException cce) {
-
             // safety check
             MatrixUtils.checkSubtractionCompatible(this, m);
 
@@ -397,11 +371,11 @@ public class BlockRealMatrix extends Abs
 
                     // perform subtraction on the current block
                     final double[] outBlock = out.blocks[blockIndex];
-                    final double[] tBlock   = blocks[blockIndex];
-                    final int      pStart   = iBlock * BLOCK_SIZE;
-                    final int      pEnd     = FastMath.min(pStart + BLOCK_SIZE, rows);
-                    final int      qStart   = jBlock * BLOCK_SIZE;
-                    final int      qEnd     = FastMath.min(qStart + BLOCK_SIZE, columns);
+                    final double[] tBlock = blocks[blockIndex];
+                    final int pStart = iBlock * BLOCK_SIZE;
+                    final int pEnd = FastMath.min(pStart + BLOCK_SIZE, rows);
+                    final int qStart = jBlock * BLOCK_SIZE;
+                    final int qEnd = FastMath.min(qStart + BLOCK_SIZE, columns);
                     int k = 0;
                     for (int p = pStart; p < pEnd; ++p) {
                         for (int q = qStart; q < qEnd; ++q) {
@@ -409,10 +383,8 @@ public class BlockRealMatrix extends Abs
                             ++k;
                         }
                     }
-
                     // go to next block
                     ++blockIndex;
-
                 }
             }
 
@@ -421,15 +393,14 @@ public class BlockRealMatrix extends Abs
     }
 
     /**
-     * Compute this minus <code>m</code>.
+     * Subtract {@code m} from this matrix.
      *
-     * @param m    matrix to be subtracted
-     * @return     this - m
-     * @throws  IllegalArgumentException if m is not the same size as this
+     * @param m Matrix to be subtracted.
+     * @return {@code this} - m.
+     * @throws MatrixDimensionMismatchException if {@code m} is not the
+     * same size as this matrix.
      */
-    public BlockRealMatrix subtract(final BlockRealMatrix m)
-        throws IllegalArgumentException {
-
+    public BlockRealMatrix subtract(final BlockRealMatrix m) {
         // safety check
         MatrixUtils.checkSubtractionCompatible(this, m);
 
@@ -438,8 +409,8 @@ public class BlockRealMatrix extends Abs
         // perform subtraction block-wise, to ensure good cache behavior
         for (int blockIndex = 0; blockIndex < out.blocks.length; ++blockIndex) {
             final double[] outBlock = out.blocks[blockIndex];
-            final double[] tBlock   = blocks[blockIndex];
-            final double[] mBlock   = m.blocks[blockIndex];
+            final double[] tBlock = blocks[blockIndex];
+            final double[] mBlock = m.blocks[blockIndex];
             for (int k = 0; k < outBlock.length; ++k) {
                 outBlock[k] = tBlock[k] - mBlock[k];
             }
@@ -450,15 +421,14 @@ public class BlockRealMatrix extends Abs
 
     /** {@inheritDoc} */
     @Override
-    public BlockRealMatrix scalarAdd(final double d)
-        throws IllegalArgumentException {
+    public BlockRealMatrix scalarAdd(final double d) {
 
         final BlockRealMatrix out = new BlockRealMatrix(rows, columns);
 
         // perform subtraction block-wise, to ensure good cache behavior
         for (int blockIndex = 0; blockIndex < out.blocks.length; ++blockIndex) {
             final double[] outBlock = out.blocks[blockIndex];
-            final double[] tBlock   = blocks[blockIndex];
+            final double[] tBlock = blocks[blockIndex];
             for (int k = 0; k < outBlock.length; ++k) {
                 outBlock[k] = tBlock[k] + d;
             }
@@ -469,15 +439,13 @@ public class BlockRealMatrix extends Abs
 
     /** {@inheritDoc} */
     @Override
-    public RealMatrix scalarMultiply(final double d)
-        throws IllegalArgumentException {
-
+    public RealMatrix scalarMultiply(final double d) {
         final BlockRealMatrix out = new BlockRealMatrix(rows, columns);
 
         // perform subtraction block-wise, to ensure good cache behavior
         for (int blockIndex = 0; blockIndex < out.blocks.length; ++blockIndex) {
             final double[] outBlock = out.blocks[blockIndex];
-            final double[] tBlock   = blocks[blockIndex];
+            final double[] tBlock = blocks[blockIndex];
             for (int k = 0; k < outBlock.length; ++k) {
                 outBlock[k] = tBlock[k] * d;
             }
@@ -488,12 +456,10 @@ public class BlockRealMatrix extends Abs
 
     /** {@inheritDoc} */
     @Override
-    public BlockRealMatrix multiply(final RealMatrix m)
-        throws IllegalArgumentException {
+    public BlockRealMatrix multiply(final RealMatrix m) {
         try {
             return multiply((BlockRealMatrix) m);
         } catch (ClassCastException cce) {
-
             // safety check
             MatrixUtils.checkMultiplicationCompatible(this, m);
 
@@ -502,27 +468,25 @@ public class BlockRealMatrix extends Abs
             // perform multiplication block-wise, to ensure good cache behavior
             int blockIndex = 0;
             for (int iBlock = 0; iBlock < out.blockRows; ++iBlock) {
-
                 final int pStart = iBlock * BLOCK_SIZE;
-                final int pEnd   = FastMath.min(pStart + BLOCK_SIZE, rows);
+                final int pEnd = FastMath.min(pStart + BLOCK_SIZE, rows);
 
                 for (int jBlock = 0; jBlock < out.blockColumns; ++jBlock) {
-
                     final int qStart = jBlock * BLOCK_SIZE;
-                    final int qEnd   = FastMath.min(qStart + BLOCK_SIZE, m.getColumnDimension());
+                    final int qEnd = FastMath.min(qStart + BLOCK_SIZE, m.getColumnDimension());
 
                     // select current block
                     final double[] outBlock = out.blocks[blockIndex];
 
                     // perform multiplication on current block
                     for (int kBlock = 0; kBlock < blockColumns; ++kBlock) {
-                        final int kWidth      = blockWidth(kBlock);
+                        final int kWidth = blockWidth(kBlock);
                         final double[] tBlock = blocks[iBlock * blockColumns + kBlock];
-                        final int rStart      = kBlock * BLOCK_SIZE;
+                        final int rStart = kBlock * BLOCK_SIZE;
                         int k = 0;
                         for (int p = pStart; p < pEnd; ++p) {
                             final int lStart = (p - pStart) * kWidth;
-                            final int lEnd   = lStart + kWidth;
+                            final int lEnd = lStart + kWidth;
                             for (int q = qStart; q < qEnd; ++q) {
                                 double sum = 0;
                                 int r = rStart;
@@ -535,10 +499,8 @@ public class BlockRealMatrix extends Abs
                             }
                         }
                     }
-
                     // go to next block
                     ++blockIndex;
-
                 }
             }
 
@@ -547,15 +509,14 @@ public class BlockRealMatrix extends Abs
     }
 
     /**
-     * Returns the result of postmultiplying this by m.
+     * Returns the result of postmultiplying this by {@code m}.
      *
-     * @param m    matrix to postmultiply by
-     * @return     this * m
-     * @throws     IllegalArgumentException
-     *             if columnDimension(this) != rowDimension(m)
+     * @param m Matrix to postmultiply by.
+     * @return {@code this} * m.
+     * @throws MatrixDimensionMismatchException if the matrices are not
+     * compatible.
      */
-    public BlockRealMatrix multiply(BlockRealMatrix m) throws IllegalArgumentException {
-
+    public BlockRealMatrix multiply(BlockRealMatrix m) {
         // safety check
         MatrixUtils.checkMultiplicationCompatible(this, m);
 
@@ -566,7 +527,7 @@ public class BlockRealMatrix extends Abs
         for (int iBlock = 0; iBlock < out.blockRows; ++iBlock) {
 
             final int pStart = iBlock * BLOCK_SIZE;
-            final int pEnd   = FastMath.min(pStart + BLOCK_SIZE, rows);
+            final int pEnd = FastMath.min(pStart + BLOCK_SIZE, rows);
 
             for (int jBlock = 0; jBlock < out.blockColumns; ++jBlock) {
                 final int jWidth = out.blockWidth(jBlock);
@@ -585,7 +546,7 @@ public class BlockRealMatrix extends Abs
                     int k = 0;
                     for (int p = pStart; p < pEnd; ++p) {
                         final int lStart = (p - pStart) * kWidth;
-                        final int lEnd   = lStart + kWidth;
+                        final int lEnd = lStart + kWidth;
                         for (int nStart = 0; nStart < jWidth; ++nStart) {
                             double sum = 0;
                             int l = lStart;
@@ -607,10 +568,8 @@ public class BlockRealMatrix extends Abs
                         }
                     }
                 }
-
                 // go to next block
                 ++blockIndex;
-
             }
         }
 
@@ -620,19 +579,18 @@ public class BlockRealMatrix extends Abs
     /** {@inheritDoc} */
     @Override
     public double[][] getData() {
-
         final double[][] data = new double[getRowDimension()][getColumnDimension()];
         final int lastColumns = columns - (blockColumns - 1) * BLOCK_SIZE;
 
         for (int iBlock = 0; iBlock < blockRows; ++iBlock) {
             final int pStart = iBlock * BLOCK_SIZE;
-            final int pEnd   = FastMath.min(pStart + BLOCK_SIZE, rows);
-            int regularPos   = 0;
-            int lastPos      = 0;
+            final int pEnd = FastMath.min(pStart + BLOCK_SIZE, rows);
+            int regularPos = 0;
+            int lastPos = 0;
             for (int p = pStart; p < pEnd; ++p) {
                 final double[] dataP = data[p];
                 int blockIndex = iBlock * blockColumns;
-                int dataPos    = 0;
+                int dataPos = 0;
                 for (int jBlock = 0; jBlock < blockColumns - 1; ++jBlock) {
                     System.arraycopy(blocks[blockIndex++], regularPos, dataP, dataPos, BLOCK_SIZE);
                     dataPos += BLOCK_SIZE;
@@ -687,9 +645,7 @@ public class BlockRealMatrix extends Abs
     /** {@inheritDoc} */
     @Override
     public BlockRealMatrix getSubMatrix(final int startRow, final int endRow,
-                                   final int startColumn, final int endColumn)
-        throws MatrixIndexException {
-
+                                        final int startColumn, final int endColumn) {
         // safety checks
         MatrixUtils.checkSubMatrixIndex(this, startRow, endRow, startColumn, endColumn);
 
@@ -698,10 +654,10 @@ public class BlockRealMatrix extends Abs
             new BlockRealMatrix(endRow - startRow + 1, endColumn - startColumn + 1);
 
         // compute blocks shifts
-        final int blockStartRow    = startRow    / BLOCK_SIZE;
-        final int rowsShift        = startRow    % BLOCK_SIZE;
+        final int blockStartRow = startRow / BLOCK_SIZE;
+        final int rowsShift = startRow % BLOCK_SIZE;
         final int blockStartColumn = startColumn / BLOCK_SIZE;
-        final int columnsShift     = startColumn % BLOCK_SIZE;
+        final int columnsShift = startColumn % BLOCK_SIZE;
 
         // perform extraction block-wise, to ensure good cache behavior
         int pBlock = blockStartRow;
@@ -712,13 +668,13 @@ public class BlockRealMatrix extends Abs
                 final int jWidth = out.blockWidth(jBlock);
 
                 // handle one block of the output matrix
-                final int      outIndex = iBlock * out.blockColumns + jBlock;
+                final int outIndex = iBlock * out.blockColumns + jBlock;
                 final double[] outBlock = out.blocks[outIndex];
-                final int      index    = pBlock * blockColumns + qBlock;
-                final int      width    = blockWidth(qBlock);
+                final int index = pBlock * blockColumns + qBlock;
+                final int width = blockWidth(qBlock);
 
                 final int heightExcess = iHeight + rowsShift - BLOCK_SIZE;
-                final int widthExcess  = jWidth + columnsShift - BLOCK_SIZE;
+                final int widthExcess = jWidth + columnsShift - BLOCK_SIZE;
                 if (heightExcess > 0) {
                     // the submatrix block spans on two blocks rows from the original matrix
                     if (widthExcess > 0) {
@@ -772,13 +728,9 @@ public class BlockRealMatrix extends Abs
                                       outBlock, jWidth, 0, 0);
                     }
                }
-
                 ++qBlock;
-
             }
-
             ++pBlock;
-
         }
 
         return out;
@@ -816,15 +768,13 @@ public class BlockRealMatrix extends Abs
 
     /** {@inheritDoc} */
     @Override
-    public void setSubMatrix(final double[][] subMatrix, final int row, final int column)
-        throws MatrixIndexException {
-
+    public void setSubMatrix(final double[][] subMatrix, final int row, final int column) {
         // safety checks
         final int refLength = subMatrix[0].length;
         if (refLength == 0) {
             throw new NoDataException(LocalizedFormats.AT_LEAST_ONE_COLUMN);
         }
-        final int endRow    = row + subMatrix.length - 1;
+        final int endRow = row + subMatrix.length - 1;
         final int endColumn = column + refLength - 1;
         MatrixUtils.checkSubMatrixIndex(this, row, endRow, column, endColumn);
         for (final double[] subRow : subMatrix) {
@@ -834,24 +784,24 @@ public class BlockRealMatrix extends Abs
         }
 
         // compute blocks bounds
-        final int blockStartRow    = row / BLOCK_SIZE;
-        final int blockEndRow      = (endRow + BLOCK_SIZE) / BLOCK_SIZE;
+        final int blockStartRow = row / BLOCK_SIZE;
+        final int blockEndRow = (endRow + BLOCK_SIZE) / BLOCK_SIZE;
         final int blockStartColumn = column / BLOCK_SIZE;
-        final int blockEndColumn   = (endColumn + BLOCK_SIZE) / BLOCK_SIZE;
+        final int blockEndColumn = (endColumn + BLOCK_SIZE) / BLOCK_SIZE;
 
         // perform copy block-wise, to ensure good cache behavior
         for (int iBlock = blockStartRow; iBlock < blockEndRow; ++iBlock) {
-            final int iHeight  = blockHeight(iBlock);
+            final int iHeight = blockHeight(iBlock);
             final int firstRow = iBlock * BLOCK_SIZE;
-            final int iStart   = FastMath.max(row,    firstRow);
-            final int iEnd     = FastMath.min(endRow + 1, firstRow + iHeight);
+            final int iStart = FastMath.max(row,    firstRow);
+            final int iEnd = FastMath.min(endRow + 1, firstRow + iHeight);
 
             for (int jBlock = blockStartColumn; jBlock < blockEndColumn; ++jBlock) {
-                final int jWidth      = blockWidth(jBlock);
+                final int jWidth = blockWidth(jBlock);
                 final int firstColumn = jBlock * BLOCK_SIZE;
-                final int jStart      = FastMath.max(column,    firstColumn);
-                final int jEnd        = FastMath.min(endColumn + 1, firstColumn + jWidth);
-                final int jLength     = jEnd - jStart;
+                final int jStart = FastMath.max(column,    firstColumn);
+                final int jEnd = FastMath.min(endColumn + 1, firstColumn + jWidth);
+                final int jLength = jEnd - jStart;
 
                 // handle one block, row by row
                 final double[] block = blocks[iBlock * blockColumns + jBlock];
@@ -867,22 +817,20 @@ public class BlockRealMatrix extends Abs
 
     /** {@inheritDoc} */
     @Override
-    public BlockRealMatrix getRowMatrix(final int row)
-        throws MatrixIndexException {
-
+    public BlockRealMatrix getRowMatrix(final int row) {
         MatrixUtils.checkRowIndex(this, row);
         final BlockRealMatrix out = new BlockRealMatrix(1, columns);
 
         // perform copy block-wise, to ensure good cache behavior
-        final int iBlock  = row / BLOCK_SIZE;
-        final int iRow    = row - iBlock * BLOCK_SIZE;
+        final int iBlock = row / BLOCK_SIZE;
+        final int iRow = row - iBlock * BLOCK_SIZE;
         int outBlockIndex = 0;
-        int outIndex      = 0;
+        int outIndex = 0;
         double[] outBlock = out.blocks[outBlockIndex];
         for (int jBlock = 0; jBlock < blockColumns; ++jBlock) {
-            final int jWidth     = blockWidth(jBlock);
+            final int jWidth = blockWidth(jBlock);
             final double[] block = blocks[iBlock * blockColumns + jBlock];
-            final int available  = outBlock.length - outIndex;
+            final int available = outBlock.length - outIndex;
             if (jWidth > available) {
                 System.arraycopy(block, iRow * jWidth, outBlock, outIndex, available);
                 outBlock = out.blocks[++outBlockIndex];
@@ -914,9 +862,10 @@ public class BlockRealMatrix extends Abs
      * @param row the row to be set
      * @param matrix row matrix (must have one row and the same number of columns
      * as the instance)
-     * @throws MatrixIndexException if the specified row index is invalid
-     * @throws MatrixDimensionMismatchException if the matrix dimensions do not match one
-     * instance row
+     * @throws org.apache.commons.math.exception.OutOfRangeException
+     * if the specified row index is invalid.
+     * @throws MatrixDimensionMismatchException if the matrix dimensions do
+     * not match one instance row.
      */
     public void setRowMatrix(final int row, final BlockRealMatrix matrix) {
         MatrixUtils.checkRowIndex(this, row);
@@ -930,12 +879,12 @@ public class BlockRealMatrix extends Abs
 
         // perform copy block-wise, to ensure good cache behavior
         final int iBlock = row / BLOCK_SIZE;
-        final int iRow   = row - iBlock * BLOCK_SIZE;
-        int mBlockIndex  = 0;
-        int mIndex       = 0;
-        double[] mBlock  = matrix.blocks[mBlockIndex];
+        final int iRow = row - iBlock * BLOCK_SIZE;
+        int mBlockIndex = 0;
+        int mIndex = 0;
+        double[] mBlock = matrix.blocks[mBlockIndex];
         for (int jBlock = 0; jBlock < blockColumns; ++jBlock) {
-            final int jWidth     = blockWidth(jBlock);
+            final int jWidth = blockWidth(jBlock);
             final double[] block = blocks[iBlock * blockColumns + jBlock];
             final int available  = mBlock.length - mIndex;
             if (jWidth > available) {
@@ -952,18 +901,16 @@ public class BlockRealMatrix extends Abs
 
     /** {@inheritDoc} */
     @Override
-    public BlockRealMatrix getColumnMatrix(final int column)
-        throws MatrixIndexException {
-
+    public BlockRealMatrix getColumnMatrix(final int column) {
         MatrixUtils.checkColumnIndex(this, column);
         final BlockRealMatrix out = new BlockRealMatrix(rows, 1);
 
         // perform copy block-wise, to ensure good cache behavior
-        final int jBlock  = column / BLOCK_SIZE;
+        final int jBlock = column / BLOCK_SIZE;
         final int jColumn = column - jBlock * BLOCK_SIZE;
-        final int jWidth  = blockWidth(jBlock);
+        final int jWidth = blockWidth(jBlock);
         int outBlockIndex = 0;
-        int outIndex      = 0;
+        int outIndex = 0;
         double[] outBlock = out.blocks[outBlockIndex];
         for (int iBlock = 0; iBlock < blockRows; ++iBlock) {
             final int iHeight = blockHeight(iBlock);
@@ -997,9 +944,10 @@ public class BlockRealMatrix extends Abs
      * @param column the column to be set
      * @param matrix column matrix (must have one column and the same number of rows
      * as the instance)
-     * @throws MatrixIndexException if the specified column index is invalid
-     * @throws MatrixDimensionMismatchException if the matrix dimensions do not match one
-     * instance column
+     * @throws org.apache.commons.math.exception.OutOfRangeException
+     * if the specified column index is invalid.
+     * @throws MatrixDimensionMismatchException if the matrix dimensions do
+     * not match one instance column.
      */
     void setColumnMatrix(final int column, final BlockRealMatrix matrix) {
         MatrixUtils.checkColumnIndex(this, column);
@@ -1012,11 +960,11 @@ public class BlockRealMatrix extends Abs
         }
 
         // perform copy block-wise, to ensure good cache behavior
-        final int jBlock  = column / BLOCK_SIZE;
+        final int jBlock = column / BLOCK_SIZE;
         final int jColumn = column - jBlock * BLOCK_SIZE;
-        final int jWidth  = blockWidth(jBlock);
+        final int jWidth = blockWidth(jBlock);
         int mBlockIndex = 0;
-        int mIndex      = 0;
+        int mIndex = 0;
         double[] mBlock = matrix.blocks[mBlockIndex];
         for (int iBlock = 0; iBlock < blockRows; ++iBlock) {
             final int iHeight = blockHeight(iBlock);
@@ -1033,18 +981,16 @@ public class BlockRealMatrix extends Abs
 
     /** {@inheritDoc} */
     @Override
-    public RealVector getRowVector(final int row)
-        throws MatrixIndexException {
-
+    public RealVector getRowVector(final int row) {
         MatrixUtils.checkRowIndex(this, row);
         final double[] outData = new double[columns];
 
         // perform copy block-wise, to ensure good cache behavior
-        final int iBlock  = row / BLOCK_SIZE;
-        final int iRow    = row - iBlock * BLOCK_SIZE;
-        int outIndex      = 0;
+        final int iBlock = row / BLOCK_SIZE;
+        final int iRow = row - iBlock * BLOCK_SIZE;
+        int outIndex = 0;
         for (int jBlock = 0; jBlock < blockColumns; ++jBlock) {
-            final int jWidth     = blockWidth(jBlock);
+            final int jWidth = blockWidth(jBlock);
             final double[] block = blocks[iBlock * blockColumns + jBlock];
             System.arraycopy(block, iRow * jWidth, outData, outIndex, jWidth);
             outIndex += jWidth;
@@ -1065,17 +1011,15 @@ public class BlockRealMatrix extends Abs
 
     /** {@inheritDoc} */
     @Override
-    public RealVector getColumnVector(final int column)
-        throws MatrixIndexException {
-
+    public RealVector getColumnVector(final int column) {
         MatrixUtils.checkColumnIndex(this, column);
         final double[] outData = new double[rows];
 
         // perform copy block-wise, to ensure good cache behavior
-        final int jBlock  = column / BLOCK_SIZE;
+        final int jBlock = column / BLOCK_SIZE;
         final int jColumn = column - jBlock * BLOCK_SIZE;
-        final int jWidth  = blockWidth(jBlock);
-        int outIndex      = 0;
+        final int jWidth = blockWidth(jBlock);
+        int outIndex = 0;
         for (int iBlock = 0; iBlock < blockRows; ++iBlock) {
             final int iHeight = blockHeight(iBlock);
             final double[] block = blocks[iBlock * blockColumns + jBlock];
@@ -1099,16 +1043,14 @@ public class BlockRealMatrix extends Abs
 
     /** {@inheritDoc} */
     @Override
-    public double[] getRow(final int row)
-        throws MatrixIndexException {
-
+    public double[] getRow(final int row) {
         MatrixUtils.checkRowIndex(this, row);
         final double[] out = new double[columns];
 
         // perform copy block-wise, to ensure good cache behavior
-        final int iBlock  = row / BLOCK_SIZE;
-        final int iRow    = row - iBlock * BLOCK_SIZE;
-        int outIndex      = 0;
+        final int iBlock = row / BLOCK_SIZE;
+        final int iRow = row - iBlock * BLOCK_SIZE;
+        int outIndex = 0;
         for (int jBlock = 0; jBlock < blockColumns; ++jBlock) {
             final int jWidth     = blockWidth(jBlock);
             final double[] block = blocks[iBlock * blockColumns + jBlock];
@@ -1129,9 +1071,9 @@ public class BlockRealMatrix extends Abs
         }
 
         // perform copy block-wise, to ensure good cache behavior
-        final int iBlock  = row / BLOCK_SIZE;
-        final int iRow    = row - iBlock * BLOCK_SIZE;
-        int outIndex      = 0;
+        final int iBlock = row / BLOCK_SIZE;
+        final int iRow = row - iBlock * BLOCK_SIZE;
+        int outIndex = 0;
         for (int jBlock = 0; jBlock < blockColumns; ++jBlock) {
             final int jWidth     = blockWidth(jBlock);
             final double[] block = blocks[iBlock * blockColumns + jBlock];
@@ -1142,9 +1084,7 @@ public class BlockRealMatrix extends Abs
 
     /** {@inheritDoc} */
     @Override
-    public double[] getColumn(final int column)
-        throws MatrixIndexException {
-
+    public double[] getColumn(final int column) {
         MatrixUtils.checkColumnIndex(this, column);
         final double[] out = new double[rows];
 
@@ -1152,7 +1092,7 @@ public class BlockRealMatrix extends Abs
         final int jBlock  = column / BLOCK_SIZE;
         final int jColumn = column - jBlock * BLOCK_SIZE;
         final int jWidth  = blockWidth(jBlock);
-        int outIndex      = 0;
+        int outIndex = 0;
         for (int iBlock = 0; iBlock < blockRows; ++iBlock) {
             final int iHeight = blockHeight(iBlock);
             final double[] block = blocks[iBlock * blockColumns + jBlock];
@@ -1176,8 +1116,8 @@ public class BlockRealMatrix extends Abs
         // perform copy block-wise, to ensure good cache behavior
         final int jBlock  = column / BLOCK_SIZE;
         final int jColumn = column - jBlock * BLOCK_SIZE;
-        final int jWidth  = blockWidth(jBlock);
-        int outIndex      = 0;
+        final int jWidth = blockWidth(jBlock);
+        int outIndex = 0;
         for (int iBlock = 0; iBlock < blockRows; ++iBlock) {
             final int iHeight = blockHeight(iBlock);
             final double[] block = blocks[iBlock * blockColumns + jBlock];
@@ -1189,76 +1129,51 @@ public class BlockRealMatrix extends Abs
 
     /** {@inheritDoc} */
     @Override
-    public double getEntry(final int row, final int column)
-        throws MatrixIndexException {
-        try {
-            final int iBlock = row    / BLOCK_SIZE;
-            final int jBlock = column / BLOCK_SIZE;
-            final int k      = (row    - iBlock * BLOCK_SIZE) * blockWidth(jBlock) +
-                               (column - jBlock * BLOCK_SIZE);
-            return blocks[iBlock * blockColumns + jBlock][k];
-        } catch (ArrayIndexOutOfBoundsException e) {
-            throw new MatrixIndexException(
-                    LocalizedFormats.NO_SUCH_MATRIX_ENTRY,
-                    row, column, getRowDimension(), getColumnDimension());
-        }
+    public double getEntry(final int row, final int column) {
+        MatrixUtils.checkMatrixIndex(this, row, column);
+        final int iBlock = row / BLOCK_SIZE;
+        final int jBlock = column / BLOCK_SIZE;
+        final int k = (row - iBlock * BLOCK_SIZE) * blockWidth(jBlock) +
+            (column - jBlock * BLOCK_SIZE);
+        return blocks[iBlock * blockColumns + jBlock][k];
     }
 
     /** {@inheritDoc} */
     @Override
-    public void setEntry(final int row, final int column, final double value)
-        throws MatrixIndexException {
-        try {
-            final int iBlock = row    / BLOCK_SIZE;
-            final int jBlock = column / BLOCK_SIZE;
-            final int k      = (row    - iBlock * BLOCK_SIZE) * blockWidth(jBlock) +
-                               (column - jBlock * BLOCK_SIZE);
-            blocks[iBlock * blockColumns + jBlock][k] = value;
-        } catch (ArrayIndexOutOfBoundsException e) {
-            throw new MatrixIndexException(
-                    LocalizedFormats.NO_SUCH_MATRIX_ENTRY,
-                    row, column, getRowDimension(), getColumnDimension());
-        }
+    public void setEntry(final int row, final int column, final double value) {
+        MatrixUtils.checkMatrixIndex(this, row, column);
+        final int iBlock = row / BLOCK_SIZE;
+        final int jBlock = column / BLOCK_SIZE;
+        final int k = (row - iBlock * BLOCK_SIZE) * blockWidth(jBlock) +
+            (column - jBlock * BLOCK_SIZE);
+        blocks[iBlock * blockColumns + jBlock][k] = value;
     }
 
     /** {@inheritDoc} */
     @Override
-    public void addToEntry(final int row, final int column, final double increment)
-        throws MatrixIndexException {
-        try {
-            final int iBlock = row    / BLOCK_SIZE;
-            final int jBlock = column / BLOCK_SIZE;
-            final int k      = (row    - iBlock * BLOCK_SIZE) * blockWidth(jBlock) +
-                               (column - jBlock * BLOCK_SIZE);
-            blocks[iBlock * blockColumns + jBlock][k] += increment;
-        } catch (ArrayIndexOutOfBoundsException e) {
-            throw new MatrixIndexException(
-                    LocalizedFormats.NO_SUCH_MATRIX_ENTRY,
-                    row, column, getRowDimension(), getColumnDimension());
-        }
+    public void addToEntry(final int row, final int column, final double increment) {
+        MatrixUtils.checkMatrixIndex(this, row, column);
+        final int iBlock = row    / BLOCK_SIZE;
+        final int jBlock = column / BLOCK_SIZE;
+        final int k = (row    - iBlock * BLOCK_SIZE) * blockWidth(jBlock) +
+            (column - jBlock * BLOCK_SIZE);
+        blocks[iBlock * blockColumns + jBlock][k] += increment;
     }
 
     /** {@inheritDoc} */
     @Override
-    public void multiplyEntry(final int row, final int column, final double factor)
-        throws MatrixIndexException {
-        try {
-            final int iBlock = row    / BLOCK_SIZE;
-            final int jBlock = column / BLOCK_SIZE;
-            final int k      = (row    - iBlock * BLOCK_SIZE) * blockWidth(jBlock) +
-                               (column - jBlock * BLOCK_SIZE);
-            blocks[iBlock * blockColumns + jBlock][k] *= factor;
-        } catch (ArrayIndexOutOfBoundsException e) {
-            throw new MatrixIndexException(
-                    LocalizedFormats.NO_SUCH_MATRIX_ENTRY,
-                    row, column, getRowDimension(), getColumnDimension());
-        }
+    public void multiplyEntry(final int row, final int column, final double factor) {
+        MatrixUtils.checkMatrixIndex(this, row, column);
+        final int iBlock = row / BLOCK_SIZE;
+        final int jBlock = column / BLOCK_SIZE;
+        final int k = (row - iBlock * BLOCK_SIZE) * blockWidth(jBlock) +
+            (column - jBlock * BLOCK_SIZE);
+        blocks[iBlock * blockColumns + jBlock][k] *= factor;
     }
 
     /** {@inheritDoc} */
     @Override
     public BlockRealMatrix transpose() {
-
         final int nRows = getRowDimension();
         final int nCols = getColumnDimension();
         final BlockRealMatrix out = new BlockRealMatrix(nCols, nRows);
@@ -1267,14 +1182,13 @@ public class BlockRealMatrix extends Abs
         int blockIndex = 0;
         for (int iBlock = 0; iBlock < blockColumns; ++iBlock) {
             for (int jBlock = 0; jBlock < blockRows; ++jBlock) {
-
                 // transpose current block
                 final double[] outBlock = out.blocks[blockIndex];
-                final double[] tBlock   = blocks[jBlock * blockColumns + iBlock];
-                final int      pStart   = iBlock * BLOCK_SIZE;
-                final int      pEnd     = FastMath.min(pStart + BLOCK_SIZE, columns);
-                final int      qStart   = jBlock * BLOCK_SIZE;
-                final int      qEnd     = FastMath.min(qStart + BLOCK_SIZE, rows);
+                final double[] tBlock = blocks[jBlock * blockColumns + iBlock];
+                final int pStart = iBlock * BLOCK_SIZE;
+                final int pEnd = FastMath.min(pStart + BLOCK_SIZE, columns);
+                final int qStart = jBlock * BLOCK_SIZE;
+                final int qEnd = FastMath.min(qStart + BLOCK_SIZE, rows);
                 int k = 0;
                 for (int p = pStart; p < pEnd; ++p) {
                     final int lInc = pEnd - pStart;
@@ -1285,10 +1199,8 @@ public class BlockRealMatrix extends Abs
                         l+= lInc;
                     }
                 }
-
                 // go to next block
                 ++blockIndex;
-
             }
         }
 
@@ -1309,9 +1221,7 @@ public class BlockRealMatrix extends Abs
 
     /** {@inheritDoc} */
     @Override
-    public double[] operate(final double[] v)
-        throws IllegalArgumentException {
-
+    public double[] operate(final double[] v) {
         if (v.length != columns) {
             throw new DimensionMismatchException(v.length, columns);
         }
@@ -1320,11 +1230,11 @@ public class BlockRealMatrix extends Abs
         // perform multiplication block-wise, to ensure good cache behavior
         for (int iBlock = 0; iBlock < blockRows; ++iBlock) {
             final int pStart = iBlock * BLOCK_SIZE;
-            final int pEnd   = FastMath.min(pStart + BLOCK_SIZE, rows);
+            final int pEnd = FastMath.min(pStart + BLOCK_SIZE, rows);
             for (int jBlock = 0; jBlock < blockColumns; ++jBlock) {
                 final double[] block  = blocks[iBlock * blockColumns + jBlock];
-                final int      qStart = jBlock * BLOCK_SIZE;
-                final int      qEnd   = FastMath.min(qStart + BLOCK_SIZE, columns);
+                final int qStart = jBlock * BLOCK_SIZE;
+                final int qEnd = FastMath.min(qStart + BLOCK_SIZE, columns);
                 int k = 0;
                 for (int p = pStart; p < pEnd; ++p) {
                     double sum = 0;
@@ -1350,9 +1260,7 @@ public class BlockRealMatrix extends Abs
 
     /** {@inheritDoc} */
     @Override
-    public double[] preMultiply(final double[] v)
-        throws IllegalArgumentException {
-
+    public double[] preMultiply(final double[] v) {
         if (v.length != rows) {
             throw new DimensionMismatchException(v.length, rows);
         }
@@ -1365,11 +1273,11 @@ public class BlockRealMatrix extends Abs
             final int jWidth3 = jWidth2 + jWidth;
             final int jWidth4 = jWidth3 + jWidth;
             final int qStart = jBlock * BLOCK_SIZE;
-            final int qEnd   = FastMath.min(qStart + BLOCK_SIZE, columns);
+            final int qEnd = FastMath.min(qStart + BLOCK_SIZE, columns);
             for (int iBlock = 0; iBlock < blockRows; ++iBlock) {
                 final double[] block  = blocks[iBlock * blockColumns + jBlock];
-                final int      pStart = iBlock * BLOCK_SIZE;
-                final int      pEnd   = FastMath.min(pStart + BLOCK_SIZE, rows);
+                final int pStart = iBlock * BLOCK_SIZE;
+                final int pEnd = FastMath.min(pStart + BLOCK_SIZE, rows);
                 for (int q = qStart; q < qEnd; ++q) {
                     int k = q - qStart;
                     double sum = 0;
@@ -1401,12 +1309,12 @@ public class BlockRealMatrix extends Abs
         visitor.start(rows, columns, 0, rows - 1, 0, columns - 1);
         for (int iBlock = 0; iBlock < blockRows; ++iBlock) {
             final int pStart = iBlock * BLOCK_SIZE;
-            final int pEnd   = FastMath.min(pStart + BLOCK_SIZE, rows);
+            final int pEnd = FastMath.min(pStart + BLOCK_SIZE, rows);
             for (int p = pStart; p < pEnd; ++p) {
                 for (int jBlock = 0; jBlock < blockColumns; ++jBlock) {
                     final int jWidth = blockWidth(jBlock);
                     final int qStart = jBlock * BLOCK_SIZE;
-                    final int qEnd   = FastMath.min(qStart + BLOCK_SIZE, columns);
+                    final int qEnd = FastMath.min(qStart + BLOCK_SIZE, columns);
                     final double[] block = blocks[iBlock * blockColumns + jBlock];
                     int k = (p - pStart) * jWidth;
                     for (int q = qStart; q < qEnd; ++q) {
@@ -1426,12 +1334,12 @@ public class BlockRealMatrix extends Abs
         visitor.start(rows, columns, 0, rows - 1, 0, columns - 1);
         for (int iBlock = 0; iBlock < blockRows; ++iBlock) {
             final int pStart = iBlock * BLOCK_SIZE;
-            final int pEnd   = FastMath.min(pStart + BLOCK_SIZE, rows);
+            final int pEnd = FastMath.min(pStart + BLOCK_SIZE, rows);
             for (int p = pStart; p < pEnd; ++p) {
                 for (int jBlock = 0; jBlock < blockColumns; ++jBlock) {
                     final int jWidth = blockWidth(jBlock);
                     final int qStart = jBlock * BLOCK_SIZE;
-                    final int qEnd   = FastMath.min(qStart + BLOCK_SIZE, columns);
+                    final int qEnd = FastMath.min(qStart + BLOCK_SIZE, columns);
                     final double[] block = blocks[iBlock * blockColumns + jBlock];
                     int k = (p - pStart) * jWidth;
                     for (int q = qStart; q < qEnd; ++q) {
@@ -1449,19 +1357,19 @@ public class BlockRealMatrix extends Abs
     public double walkInRowOrder(final RealMatrixChangingVisitor visitor,
                                  final int startRow, final int endRow,
                                  final int startColumn, final int endColumn)
-        throws MatrixIndexException, MatrixVisitorException {
+        throws MatrixVisitorException {
         MatrixUtils.checkSubMatrixIndex(this, startRow, endRow, startColumn, endColumn);
         visitor.start(rows, columns, startRow, endRow, startColumn, endColumn);
         for (int iBlock = startRow / BLOCK_SIZE; iBlock < 1 + endRow / BLOCK_SIZE; ++iBlock) {
-            final int p0     = iBlock * BLOCK_SIZE;
+            final int p0 = iBlock * BLOCK_SIZE;
             final int pStart = FastMath.max(startRow, p0);
-            final int pEnd   = FastMath.min((iBlock + 1) * BLOCK_SIZE, 1 + endRow);
+            final int pEnd = FastMath.min((iBlock + 1) * BLOCK_SIZE, 1 + endRow);
             for (int p = pStart; p < pEnd; ++p) {
                 for (int jBlock = startColumn / BLOCK_SIZE; jBlock < 1 + endColumn / BLOCK_SIZE; ++jBlock) {
                     final int jWidth = blockWidth(jBlock);
-                    final int q0     = jBlock * BLOCK_SIZE;
+                    final int q0 = jBlock * BLOCK_SIZE;
                     final int qStart = FastMath.max(startColumn, q0);
-                    final int qEnd   = FastMath.min((jBlock + 1) * BLOCK_SIZE, 1 + endColumn);
+                    final int qEnd = FastMath.min((jBlock + 1) * BLOCK_SIZE, 1 + endColumn);
                     final double[] block = blocks[iBlock * blockColumns + jBlock];
                     int k = (p - p0) * jWidth + qStart - q0;
                     for (int q = qStart; q < qEnd; ++q) {
@@ -1479,19 +1387,19 @@ public class BlockRealMatrix extends Abs
     public double walkInRowOrder(final RealMatrixPreservingVisitor visitor,
                                  final int startRow, final int endRow,
                                  final int startColumn, final int endColumn)
-        throws MatrixIndexException, MatrixVisitorException {
+        throws MatrixVisitorException {
         MatrixUtils.checkSubMatrixIndex(this, startRow, endRow, startColumn, endColumn);
         visitor.start(rows, columns, startRow, endRow, startColumn, endColumn);
         for (int iBlock = startRow / BLOCK_SIZE; iBlock < 1 + endRow / BLOCK_SIZE; ++iBlock) {
-            final int p0     = iBlock * BLOCK_SIZE;
+            final int p0 = iBlock * BLOCK_SIZE;
             final int pStart = FastMath.max(startRow, p0);
-            final int pEnd   = FastMath.min((iBlock + 1) * BLOCK_SIZE, 1 + endRow);
+            final int pEnd = FastMath.min((iBlock + 1) * BLOCK_SIZE, 1 + endRow);
             for (int p = pStart; p < pEnd; ++p) {
                 for (int jBlock = startColumn / BLOCK_SIZE; jBlock < 1 + endColumn / BLOCK_SIZE; ++jBlock) {
                     final int jWidth = blockWidth(jBlock);
-                    final int q0     = jBlock * BLOCK_SIZE;
+                    final int q0 = jBlock * BLOCK_SIZE;
                     final int qStart = FastMath.max(startColumn, q0);
-                    final int qEnd   = FastMath.min((jBlock + 1) * BLOCK_SIZE, 1 + endColumn);
+                    final int qEnd = FastMath.min((jBlock + 1) * BLOCK_SIZE, 1 + endColumn);
                     final double[] block = blocks[iBlock * blockColumns + jBlock];
                     int k = (p - p0) * jWidth + qStart - q0;
                     for (int q = qStart; q < qEnd; ++q) {
@@ -1512,10 +1420,10 @@ public class BlockRealMatrix extends Abs
         int blockIndex = 0;
         for (int iBlock = 0; iBlock < blockRows; ++iBlock) {
             final int pStart = iBlock * BLOCK_SIZE;
-            final int pEnd   = FastMath.min(pStart + BLOCK_SIZE, rows);
+            final int pEnd = FastMath.min(pStart + BLOCK_SIZE, rows);
             for (int jBlock = 0; jBlock < blockColumns; ++jBlock) {
                 final int qStart = jBlock * BLOCK_SIZE;
-                final int qEnd   = FastMath.min(qStart + BLOCK_SIZE, columns);
+                final int qEnd = FastMath.min(qStart + BLOCK_SIZE, columns);
                 final double[] block = blocks[blockIndex];
                 int k = 0;
                 for (int p = pStart; p < pEnd; ++p) {
@@ -1538,10 +1446,10 @@ public class BlockRealMatrix extends Abs
         int blockIndex = 0;
         for (int iBlock = 0; iBlock < blockRows; ++iBlock) {
             final int pStart = iBlock * BLOCK_SIZE;
-            final int pEnd   = FastMath.min(pStart + BLOCK_SIZE, rows);
+            final int pEnd = FastMath.min(pStart + BLOCK_SIZE, rows);
             for (int jBlock = 0; jBlock < blockColumns; ++jBlock) {
                 final int qStart = jBlock * BLOCK_SIZE;
-                final int qEnd   = FastMath.min(qStart + BLOCK_SIZE, columns);
+                final int qEnd = FastMath.min(qStart + BLOCK_SIZE, columns);
                 final double[] block = blocks[blockIndex];
                 int k = 0;
                 for (int p = pStart; p < pEnd; ++p) {
@@ -1561,18 +1469,18 @@ public class BlockRealMatrix extends Abs
     public double walkInOptimizedOrder(final RealMatrixChangingVisitor visitor,
                                        final int startRow, final int endRow,
                                        final int startColumn, final int endColumn)
-        throws MatrixIndexException, MatrixVisitorException {
+        throws MatrixVisitorException {
         MatrixUtils.checkSubMatrixIndex(this, startRow, endRow, startColumn, endColumn);
         visitor.start(rows, columns, startRow, endRow, startColumn, endColumn);
         for (int iBlock = startRow / BLOCK_SIZE; iBlock < 1 + endRow / BLOCK_SIZE; ++iBlock) {
-            final int p0     = iBlock * BLOCK_SIZE;
+            final int p0 = iBlock * BLOCK_SIZE;
             final int pStart = FastMath.max(startRow, p0);
-            final int pEnd   = FastMath.min((iBlock + 1) * BLOCK_SIZE, 1 + endRow);
+            final int pEnd = FastMath.min((iBlock + 1) * BLOCK_SIZE, 1 + endRow);
             for (int jBlock = startColumn / BLOCK_SIZE; jBlock < 1 + endColumn / BLOCK_SIZE; ++jBlock) {
                 final int jWidth = blockWidth(jBlock);
-                final int q0     = jBlock * BLOCK_SIZE;
+                final int q0 = jBlock * BLOCK_SIZE;
                 final int qStart = FastMath.max(startColumn, q0);
-                final int qEnd   = FastMath.min((jBlock + 1) * BLOCK_SIZE, 1 + endColumn);
+                final int qEnd = FastMath.min((jBlock + 1) * BLOCK_SIZE, 1 + endColumn);
                 final double[] block = blocks[iBlock * blockColumns + jBlock];
                 for (int p = pStart; p < pEnd; ++p) {
                     int k = (p - p0) * jWidth + qStart - q0;
@@ -1591,18 +1499,18 @@ public class BlockRealMatrix extends Abs
     public double walkInOptimizedOrder(final RealMatrixPreservingVisitor visitor,
                                        final int startRow, final int endRow,
                                        final int startColumn, final int endColumn)
-        throws MatrixIndexException, MatrixVisitorException {
+        throws MatrixVisitorException {
         MatrixUtils.checkSubMatrixIndex(this, startRow, endRow, startColumn, endColumn);
         visitor.start(rows, columns, startRow, endRow, startColumn, endColumn);
         for (int iBlock = startRow / BLOCK_SIZE; iBlock < 1 + endRow / BLOCK_SIZE; ++iBlock) {
-            final int p0     = iBlock * BLOCK_SIZE;
+            final int p0 = iBlock * BLOCK_SIZE;
             final int pStart = FastMath.max(startRow, p0);
-            final int pEnd   = FastMath.min((iBlock + 1) * BLOCK_SIZE, 1 + endRow);
+            final int pEnd = FastMath.min((iBlock + 1) * BLOCK_SIZE, 1 + endRow);
             for (int jBlock = startColumn / BLOCK_SIZE; jBlock < 1 + endColumn / BLOCK_SIZE; ++jBlock) {
                 final int jWidth = blockWidth(jBlock);
-                final int q0     = jBlock * BLOCK_SIZE;
+                final int q0 = jBlock * BLOCK_SIZE;
                 final int qStart = FastMath.max(startColumn, q0);
-                final int qEnd   = FastMath.min((jBlock + 1) * BLOCK_SIZE, 1 + endColumn);
+                final int qEnd = FastMath.min((jBlock + 1) * BLOCK_SIZE, 1 + endColumn);
                 final double[] block = blocks[iBlock * blockColumns + jBlock];
                 for (int p = pStart; p < pEnd; ++p) {
                     int k = (p - p0) * jWidth + qStart - q0;



Mime
View raw message