Index: matrix/src/main/java/org/apache/mahout/jet/random/PoissonSlow.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/jet/random/PoissonSlow.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/jet/random/PoissonSlow.java	(working copy)
@@ -26,38 +26,36 @@
  * This is a port of <A HREF="http://wwwinfo.cern.ch/asd/lhc++/clhep/manual/RefGuide/Random/RandPoisson.html">RandPoisson</A> used in <A HREF="http://wwwinfo.cern.ch/asd/lhc++/clhep">CLHEP 1.4.0</A> (C++).
  * CLHEP's implementation, in turn, is based upon "W.H.Press et al., Numerical Recipes in C, Second Edition".
  *
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 09/24/99
  */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
  */
 @Deprecated
 public class PoissonSlow extends AbstractDiscreteDistribution {
-	protected double mean;
+  protected double mean;
 
-	// precomputed and cached values (for performance only)
-	protected double cached_sq;
-	protected double cached_alxm;
-	protected double cached_g;
+  // precomputed and cached values (for performance only)
+  protected double cached_sq;
+  protected double cached_alxm;
+  protected double cached_g;
 
-	protected static final double MEAN_MAX = Integer.MAX_VALUE; // for all means larger than that, we don't try to compute a poisson deviation, but return the mean.
-	protected static final double SWITCH_MEAN = 12.0; // switch from method A to method B
-	
-	protected static final double[] cof = { // for method logGamma() 
-		76.18009172947146,-86.50532032941677,
-		24.01409824083091, -1.231739572450155,
-		0.1208650973866179e-2, -0.5395239384953e-5};
+  protected static final double MEAN_MAX = Integer.MAX_VALUE; // for all means larger than that, we don't try to compute a poisson deviation, but return the mean.
+  protected static final double SWITCH_MEAN = 12.0; // switch from method A to method B
+  
+  protected static final double[] cof = { // for method logGamma() 
+    76.18009172947146,-86.50532032941677,
+    24.01409824083091, -1.231739572450155,
+    0.1208650973866179e-2, -0.5395239384953e-5};
 
- 	// The uniform random number generated shared by all <b>static</b> methods.
-	protected static PoissonSlow shared = new PoissonSlow(0.0,makeDefaultGenerator());
+   // The uniform random number generated shared by all <b>static</b> methods.
+  protected static PoissonSlow shared = new PoissonSlow(0.0,makeDefaultGenerator());
 /**
  * Constructs a poisson distribution.
  * Example: mean=1.0.
  */
 public PoissonSlow(double mean, RandomEngine randomGenerator) {
-	setRandomGenerator(randomGenerator);
-	setMean(mean);
+  setRandomGenerator(randomGenerator);
+  setMean(mean);
 }
 /**
  * Returns the value ln(Gamma(xx) for xx > 0.  Full accuracy is obtained for 
@@ -65,119 +63,119 @@
  * (Adapted from Numerical Recipes in C)
  */
 public static double logGamma(double xx) {
-	double x = xx - 1.0;
-	double tmp = x + 5.5;
-	tmp -= (x + 0.5) * Math.log(tmp);
-	double ser = 1.000000000190015;
+  double x = xx - 1.0;
+  double tmp = x + 5.5;
+  tmp -= (x + 0.5) * Math.log(tmp);
+  double ser = 1.000000000190015;
 
-	double[] coeff = cof;
-	for (int j = 0; j <= 5; j++ ) {
-		x++;
-		ser += coeff[j]/x;
-	}
-	return -tmp + Math.log(2.5066282746310005*ser);
+  double[] coeff = cof;
+  for (int j = 0; j <= 5; j++ ) {
+    x++;
+    ser += coeff[j]/x;
+  }
+  return -tmp + Math.log(2.5066282746310005*ser);
 }
 /**
  * Returns a random number from the distribution.
  */
 public int nextInt() {
-	return nextInt(this.mean);
+  return nextInt(this.mean);
 }
 /**
  * Returns a random number from the distribution; bypasses the internal state.
  */
 private int nextInt(double theMean) {
-	/* 
-	 * Adapted from "Numerical Recipes in C".
-	 */
-  	double xm = theMean;
-  	double g = this.cached_g;
+  /* 
+   * Adapted from "Numerical Recipes in C".
+   */
+    double xm = theMean;
+    double g = this.cached_g;
 
-	if (xm == -1.0 ) return 0; // not defined
-	if (xm < SWITCH_MEAN ) {
-		int poisson = -1;
-		double product = 1;
-		do {
-			poisson++;
-			product *= randomGenerator.raw();
-		} while ( product >= g );
-		// bug in CLHEP 1.4.0: was "} while ( product > g );"
-		return poisson;
-	}
-	else if (xm < MEAN_MAX ) {
-		double t;
-		double em;
-	  	double sq = this.cached_sq;
-	  	double alxm = this.cached_alxm;
+  if (xm == -1.0 ) return 0; // not defined
+  if (xm < SWITCH_MEAN ) {
+    int poisson = -1;
+    double product = 1;
+    do {
+      poisson++;
+      product *= randomGenerator.raw();
+    } while ( product >= g );
+    // bug in CLHEP 1.4.0: was "} while ( product > g );"
+    return poisson;
+  }
+  else if (xm < MEAN_MAX ) {
+    double t;
+    double em;
+      double sq = this.cached_sq;
+      double alxm = this.cached_alxm;
 
-		RandomEngine rand = this.randomGenerator;
-		do { 
-			double y;
-			do {
-				y = Math.tan(Math.PI*rand.raw());
-				em = sq*y + xm;
-			} while (em < 0.0);
-			em = (double) (int)(em); // faster than em = Math.floor(em); (em>=0.0)
-			t = 0.9*(1.0 + y*y)* Math.exp(em*alxm - logGamma(em + 1.0) - g);
-		} while (rand.raw() > t);
-		return (int) em;
-	}
-	else { // mean is too large
-		return (int) xm;
-	}
+    RandomEngine rand = this.randomGenerator;
+    do { 
+      double y;
+      do {
+        y = Math.tan(Math.PI*rand.raw());
+        em = sq*y + xm;
+      } while (em < 0.0);
+      em = (double) (int)(em); // faster than em = Math.floor(em); (em>=0.0)
+      t = 0.9*(1.0 + y*y)* Math.exp(em*alxm - logGamma(em + 1.0) - g);
+    } while (rand.raw() > t);
+    return (int) em;
+  }
+  else { // mean is too large
+    return (int) xm;
+  }
 }
 /**
  * Returns a random number from the distribution.
  */
 protected int nextIntSlow() {
-	final double bound = Math.exp( - mean);
-	int count = 0;
-	double product;
-	for (product = 1.0; product >= bound && product > 0.0; count++) {
-		product *= randomGenerator.raw();
-	}
-	if (product<=0.0 && bound>0.0) return (int) Math.round(mean); // detected endless loop due to rounding errors
-	return count-1;
+  final double bound = Math.exp( - mean);
+  int count = 0;
+  double product;
+  for (product = 1.0; product >= bound && product > 0.0; count++) {
+    product *= randomGenerator.raw();
+  }
+  if (product<=0.0 && bound>0.0) return (int) Math.round(mean); // detected endless loop due to rounding errors
+  return count-1;
 }
 /**
  * Sets the mean.
  */
 public void setMean(double mean) {
-	if (mean != this.mean) {
-		this.mean = mean;
-		if (mean == -1.0) return; // not defined
-		if (mean < SWITCH_MEAN) {
-			this.cached_g = Math.exp(-mean);
-		}
-		else {
-			this.cached_sq = Math.sqrt(2.0*mean);
-			this.cached_alxm = Math.log(mean);
-			this.cached_g = mean*cached_alxm - logGamma(mean + 1.0);
-		}
-	}
+  if (mean != this.mean) {
+    this.mean = mean;
+    if (mean == -1.0) return; // not defined
+    if (mean < SWITCH_MEAN) {
+      this.cached_g = Math.exp(-mean);
+    }
+    else {
+      this.cached_sq = Math.sqrt(2.0*mean);
+      this.cached_alxm = Math.log(mean);
+      this.cached_g = mean*cached_alxm - logGamma(mean + 1.0);
+    }
+  }
 }
 /**
  * Returns a random number from the distribution with the given mean.
  */
 public static int staticNextInt(double mean) {
-	synchronized (shared) {
-		shared.setMean(mean);
-		return shared.nextInt();
-	}
+  synchronized (shared) {
+    shared.setMean(mean);
+    return shared.nextInt();
+  }
 }
 /**
  * Returns a String representation of the receiver.
  */
 public String toString() {
-	return this.getClass().getName()+"("+mean+")";
+  return this.getClass().getName()+"("+mean+")";
 }
 /**
  * Sets the uniform random number generated shared by all <b>static</b> methods.
  * @param randomGenerator the new uniform random number generator to be shared.
  */
 private static void xstaticSetRandomGenerator(RandomEngine randomGenerator) {
-	synchronized (shared) {
-		shared.setRandomGenerator(randomGenerator);
-	}
+  synchronized (shared) {
+    shared.setRandomGenerator(randomGenerator);
+  }
 }
 }
Index: matrix/src/main/java/org/apache/mahout/jet/random/Hyperbolic.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/jet/random/Hyperbolic.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/jet/random/Hyperbolic.java	(working copy)
@@ -26,37 +26,35 @@
  * <p>
  * L. Devroye (1986): Non-Uniform Random Variate Generation, Springer Verlag, New York.
  *
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 09/24/99
  */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
  */
 @Deprecated
 public class Hyperbolic extends AbstractContinousDistribution {
-	protected double alpha;
-	protected double beta;
+  protected double alpha;
+  protected double beta;
 
-	// cached values shared for generateHyperbolic(...)
-	protected double a_setup =  0.0, b_setup = -1.0;
-	protected double x, u, v, e;
-	protected double hr, hl, s, pm, pr, samb, pmr, mpa_1, mmb_1; 
+  // cached values shared for generateHyperbolic(...)
+  protected double a_setup =  0.0, b_setup = -1.0;
+  protected double x, u, v, e;
+  protected double hr, hl, s, pm, pr, samb, pmr, mpa_1, mmb_1; 
 
 
-	// The uniform random number generated shared by all <b>static</b> methods.
-	protected static Hyperbolic shared = new Hyperbolic(10.0,10.0,makeDefaultGenerator());
+  // The uniform random number generated shared by all <b>static</b> methods.
+  protected static Hyperbolic shared = new Hyperbolic(10.0,10.0,makeDefaultGenerator());
 /**
  * Constructs a Beta distribution.
  */
 public Hyperbolic(double alpha, double beta, RandomEngine randomGenerator) {
-	setRandomGenerator(randomGenerator);
-	setState(alpha,beta);
+  setRandomGenerator(randomGenerator);
+  setState(alpha,beta);
 }
 /**
  * Returns a random number from the distribution.
  */
 public double nextDouble() {
-	return nextDouble(alpha, beta);
+  return nextDouble(alpha, beta);
 }
 /**
  * Returns a hyperbolic distributed random number; bypasses the internal state.
@@ -79,94 +77,94 @@
  *                unsigned long integer *seed.                    *
  *                                                                *
  ******************************************************************/
-	double a = alpha;
-	double b = beta;
+  double a = alpha;
+  double b = beta;
 
-	if ((a_setup != a) || (b_setup != b)) { // SET-UP 
-		double mpa, mmb, mode;
-		double amb;
-		double a_, b_,  a_1, b_1, pl;
-		double help_1, help_2;
-		amb = a*a - b*b;                                        // a^2 - b^2 
-		samb = Math.sqrt(amb);                                  // -log(f(mode)) 
-		mode = b/samb;                                          // mode 
-		help_1 = a*Math.sqrt(2.0*samb + 1.0);
-		help_2 = b*(samb + 1.0);
-		mpa = (help_2 + help_1)/amb;   // fr^-1(exp(-sqrt(a^2 - b^2) - 1.0)) 
-		mmb = (help_2 - help_1)/amb;   // fl^-1(exp(-sqrt(a^2 - b^2) - 1.0))
-		a_ =   mpa - mode;
-		b_ =  -mmb + mode;
-		hr = -1.0/(-a*mpa/Math.sqrt(1.0 + mpa*mpa) + b);
-		hl =  1.0/(-a*mmb/Math.sqrt(1.0 + mmb*mmb) + b);
-		a_1 = a_ - hr;
-		b_1 = b_ - hl;
-		mmb_1 = mode - b_1;                                     // lower border
-		mpa_1 = mode + a_1;                                     // upper border 
+  if ((a_setup != a) || (b_setup != b)) { // SET-UP 
+    double mpa, mmb, mode;
+    double amb;
+    double a_, b_,  a_1, b_1, pl;
+    double help_1, help_2;
+    amb = a*a - b*b;                                        // a^2 - b^2 
+    samb = Math.sqrt(amb);                                  // -log(f(mode)) 
+    mode = b/samb;                                          // mode 
+    help_1 = a*Math.sqrt(2.0*samb + 1.0);
+    help_2 = b*(samb + 1.0);
+    mpa = (help_2 + help_1)/amb;   // fr^-1(exp(-sqrt(a^2 - b^2) - 1.0)) 
+    mmb = (help_2 - help_1)/amb;   // fl^-1(exp(-sqrt(a^2 - b^2) - 1.0))
+    a_ =   mpa - mode;
+    b_ =  -mmb + mode;
+    hr = -1.0/(-a*mpa/Math.sqrt(1.0 + mpa*mpa) + b);
+    hl =  1.0/(-a*mmb/Math.sqrt(1.0 + mmb*mmb) + b);
+    a_1 = a_ - hr;
+    b_1 = b_ - hl;
+    mmb_1 = mode - b_1;                                     // lower border
+    mpa_1 = mode + a_1;                                     // upper border 
 
-		s = (a_ + b_);
-		pm = (a_1 + b_1)/s;
-		pr = hr/s;
-		pmr = pm + pr;
+    s = (a_ + b_);
+    pm = (a_1 + b_1)/s;
+    pr = hr/s;
+    pmr = pm + pr;
 
-		a_setup = a;
-		b_setup = b;
-	}
+    a_setup = a;
+    b_setup = b;
+  }
 
-	// GENERATOR 
-	for(;;)	{
-		u = randomGenerator.raw();
-		v = randomGenerator.raw();
-		if (u <= pm) { // Rejection with a uniform majorizing function
-					   // over the body of the distribution 
-			x = mmb_1 + u*s;
-			if (Math.log(v)  <= (-a*Math.sqrt(1.0 + x*x) + b*x + samb)) break;
-		}
-		else {
-			if (u <= pmr) {  // Rejection with an exponential envelope on the
-							 // right side of the mode 
-				e = -Math.log((u-pm)/pr);
-				x = mpa_1 + hr*e;
-				if ((Math.log(v) - e) <= (-a*Math.sqrt(1.0 + x*x) + b*x + samb)) break;
-			}
-			else {           // Rejection with an exponential envelope on the
-							 // left side of the mode 
-				e = Math.log((u-pmr)/(1.0 - pmr));
-				x = mmb_1 + hl*e;
-				if ((Math.log(v) + e) <= (-a*Math.sqrt(1.0 + x*x) + b*x + samb)) break;
-			}
-		}
-	}
+  // GENERATOR 
+  for(;;)  {
+    u = randomGenerator.raw();
+    v = randomGenerator.raw();
+    if (u <= pm) { // Rejection with a uniform majorizing function
+             // over the body of the distribution 
+      x = mmb_1 + u*s;
+      if (Math.log(v)  <= (-a*Math.sqrt(1.0 + x*x) + b*x + samb)) break;
+    }
+    else {
+      if (u <= pmr) {  // Rejection with an exponential envelope on the
+               // right side of the mode 
+        e = -Math.log((u-pm)/pr);
+        x = mpa_1 + hr*e;
+        if ((Math.log(v) - e) <= (-a*Math.sqrt(1.0 + x*x) + b*x + samb)) break;
+      }
+      else {           // Rejection with an exponential envelope on the
+               // left side of the mode 
+        e = Math.log((u-pmr)/(1.0 - pmr));
+        x = mmb_1 + hl*e;
+        if ((Math.log(v) + e) <= (-a*Math.sqrt(1.0 + x*x) + b*x + samb)) break;
+      }
+    }
+  }
 
-	return(x);
+  return(x);
 }
 /**
  * Sets the parameters.
  */
 public void setState(double alpha, double beta) {
-	this.alpha = alpha;
-	this.beta = beta;
+  this.alpha = alpha;
+  this.beta = beta;
 }
 /**
  * Returns a random number from the distribution.
  */
 public static double staticNextDouble(double alpha, double beta) {
-	synchronized (shared) {
-		return shared.nextDouble(alpha,beta);
-	}
+  synchronized (shared) {
+    return shared.nextDouble(alpha,beta);
+  }
 }
 /**
  * Returns a String representation of the receiver.
  */
 public String toString() {
-	return this.getClass().getName()+"("+alpha+","+beta+")";
+  return this.getClass().getName()+"("+alpha+","+beta+")";
 }
 /**
  * Sets the uniform random number generated shared by all <b>static</b> methods.
  * @param randomGenerator the new uniform random number generator to be shared.
  */
 private static void xstaticSetRandomGenerator(RandomEngine randomGenerator) {
-	synchronized (shared) {
-		shared.setRandomGenerator(randomGenerator);
-	}
+  synchronized (shared) {
+    shared.setRandomGenerator(randomGenerator);
+  }
 }
 }
Index: matrix/src/main/java/org/apache/mahout/jet/random/VonMises.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/jet/random/VonMises.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/jet/random/VonMises.java	(working copy)
@@ -27,36 +27,34 @@
  * <p>
  * D.J. Best, N.I. Fisher (1979): Efficient simulation of the von Mises distribution, Appl. Statist. 28, 152-157.
  *
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 09/24/99
  */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
  */
 @Deprecated
 public class VonMises extends AbstractContinousDistribution {
-	protected double my_k;
+  protected double my_k;
 
-	// cached vars for method nextDouble(a) (for performance only)
-	private double k_set = -1.0;
-	private double tau,rho,r;
+  // cached vars for method nextDouble(a) (for performance only)
+  private double k_set = -1.0;
+  private double tau,rho,r;
 
- 	// The uniform random number generated shared by all <b>static</b> methods. 
-	protected static VonMises shared = new VonMises(1.0,makeDefaultGenerator());
+   // The uniform random number generated shared by all <b>static</b> methods. 
+  protected static VonMises shared = new VonMises(1.0,makeDefaultGenerator());
 /**
  * Constructs a Von Mises distribution.
  * Example: k=1.0.
  * @throws IllegalArgumentException if <tt>k &lt;= 0.0</tt>.
  */
 public VonMises(double freedom, RandomEngine randomGenerator) {
-	setRandomGenerator(randomGenerator);
-	setState(freedom);
+  setRandomGenerator(randomGenerator);
+  setState(freedom);
 }
 /**
  * Returns a random number from the distribution.
  */
 public double nextDouble() {
-	return nextDouble(this.my_k);
+  return nextDouble(this.my_k);
 }
 /**
  * Returns a random number from the distribution; bypasses the internal state.
@@ -81,59 +79,59 @@
  *                                                                *
  * Implemented by F. Niederl, August 1992                         *
  ******************************************************************/
-	double u,v,w,c,z;
+  double u,v,w,c,z;
 
-	if (k<=0.0) throw new IllegalArgumentException();
-	
-	if (k_set!=k) {                                               // SET-UP
-		tau = 1.0 + Math.sqrt(1.0 + 4.0*k*k);
-		rho = (tau-Math.sqrt(2.0*tau)) / (2.0*k);
-		r = (1.0+rho*rho) / (2.0*rho);
-		k_set = k;
-	}
+  if (k<=0.0) throw new IllegalArgumentException();
+  
+  if (k_set!=k) {                                               // SET-UP
+    tau = 1.0 + Math.sqrt(1.0 + 4.0*k*k);
+    rho = (tau-Math.sqrt(2.0*tau)) / (2.0*k);
+    r = (1.0+rho*rho) / (2.0*rho);
+    k_set = k;
+  }
 
-	// GENERATOR 
-	do {  
-		u = randomGenerator.raw();                                // U(0/1) 
-		v = randomGenerator.raw();                                // U(0/1) 
-		z = Math.cos(Math.PI * u);
-		w = (1.0+r*z) / (r+z);
-		c = k*(r-w);
-	} while ((c*(2.0-c) < v) && (Math.log(c/v)+1.0 < c));         // Acceptance/Rejection 
-		
-	return (randomGenerator.raw() > 0.5)? Math.acos(w): -Math.acos(w);        // Random sign //
-					// 0 <= x <= Pi : -Pi <= x <= 0 //
+  // GENERATOR 
+  do {  
+    u = randomGenerator.raw();                                // U(0/1) 
+    v = randomGenerator.raw();                                // U(0/1) 
+    z = Math.cos(Math.PI * u);
+    w = (1.0+r*z) / (r+z);
+    c = k*(r-w);
+  } while ((c*(2.0-c) < v) && (Math.log(c/v)+1.0 < c));         // Acceptance/Rejection 
+    
+  return (randomGenerator.raw() > 0.5)? Math.acos(w): -Math.acos(w);        // Random sign //
+          // 0 <= x <= Pi : -Pi <= x <= 0 //
 }
 /**
  * Sets the distribution parameter.
  * @throws IllegalArgumentException if <tt>k &lt;= 0.0</tt>.
  */
 public void setState(double k) {
-	if (k<=0.0) throw new IllegalArgumentException();
-	this.my_k = k;
+  if (k<=0.0) throw new IllegalArgumentException();
+  this.my_k = k;
 }
 /**
  * Returns a random number from the distribution.
  * @throws IllegalArgumentException if <tt>k &lt;= 0.0</tt>.
  */
 public static double staticNextDouble(double freedom) {
-	synchronized (shared) {
-		return shared.nextDouble(freedom);
-	}
+  synchronized (shared) {
+    return shared.nextDouble(freedom);
+  }
 }
 /**
  * Returns a String representation of the receiver.
  */
 public String toString() {
-	return this.getClass().getName()+"("+my_k+")";
+  return this.getClass().getName()+"("+my_k+")";
 }
 /**
  * Sets the uniform random number generated shared by all <b>static</b> methods.
  * @param randomGenerator the new uniform random number generator to be shared.
  */
 private static void xstaticSetRandomGenerator(RandomEngine randomGenerator) {
-	synchronized (shared) {
-		shared.setRandomGenerator(randomGenerator);
-	}
+  synchronized (shared) {
+    shared.setRandomGenerator(randomGenerator);
+  }
 }
 }
Index: matrix/src/main/java/org/apache/mahout/jet/random/StudentT.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/jet/random/StudentT.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/jet/random/StudentT.java	(working copy)
@@ -31,19 +31,17 @@
  * C-RAND's implementation, in turn, is based upon
  * <p>R.W. Bailey (1994): Polar generation of random variates with the t-distribution, Mathematics of Computation 62, 779-781.
  *
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 09/24/99
  */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
  */
 @Deprecated
 public class StudentT extends AbstractContinousDistribution {
-	protected double freedom;
+  protected double freedom;
 
-	protected double TERM; // performance cache for pdf()
- 	// The uniform random number generated shared by all <b>static</b> methods. 
-	protected static StudentT shared = new StudentT(1.0,makeDefaultGenerator());
+  protected double TERM; // performance cache for pdf()
+   // The uniform random number generated shared by all <b>static</b> methods. 
+  protected static StudentT shared = new StudentT(1.0,makeDefaultGenerator());
 /**
  * Constructs a StudentT distribution.
  * Example: freedom=1.0.
@@ -51,20 +49,20 @@
  * @throws IllegalArgumentException if <tt>freedom &lt;= 0.0</tt>.
  */
 public StudentT(double freedom, RandomEngine randomGenerator) {
-	setRandomGenerator(randomGenerator);
-	setState(freedom);
+  setRandomGenerator(randomGenerator);
+  setState(freedom);
 }
 /**
  * Returns the cumulative distribution function.
  */
 public double cdf(double x) {
-	return Probability.studentT(freedom,x);
+  return Probability.studentT(freedom,x);
 }
 /**
  * Returns a random number from the distribution.
  */
 public double nextDouble() {
-	return nextDouble(this.freedom);
+  return nextDouble(this.freedom);
 }
 /**
  * Returns a random number from the distribution; bypasses the internal state.
@@ -72,32 +70,32 @@
  * @throws IllegalArgumentException if <tt>a &lt;= 0.0</tt>.
  */
 public double nextDouble(double degreesOfFreedom) {
-	/*
-	 * The polar method of Box/Muller for generating Normal variates 
-	 * is adapted to the Student-t distribution. The two generated   
-	 * variates are not independent and the expected no. of uniforms 
-	 * per variate is 2.5464.
-	 *
-	 * REFERENCE :  - R.W. Bailey (1994): Polar generation of random  
-	 *                variates with the t-distribution, Mathematics   
-	 *                of Computation 62, 779-781.
-	 */
-	if (degreesOfFreedom<=0.0) throw new IllegalArgumentException();
-	double u,v,w;
+  /*
+   * The polar method of Box/Muller for generating Normal variates 
+   * is adapted to the Student-t distribution. The two generated   
+   * variates are not independent and the expected no. of uniforms 
+   * per variate is 2.5464.
+   *
+   * REFERENCE :  - R.W. Bailey (1994): Polar generation of random  
+   *                variates with the t-distribution, Mathematics   
+   *                of Computation 62, 779-781.
+   */
+  if (degreesOfFreedom<=0.0) throw new IllegalArgumentException();
+  double u,v,w;
 
-	do {
-		u = 2.0 * randomGenerator.raw() - 1.0;
-		v = 2.0 * randomGenerator.raw() - 1.0;
-	}
-	while ((w = u * u + v * v) > 1.0);
+  do {
+    u = 2.0 * randomGenerator.raw() - 1.0;
+    v = 2.0 * randomGenerator.raw() - 1.0;
+  }
+  while ((w = u * u + v * v) > 1.0);
 
-	return(u * Math.sqrt( degreesOfFreedom * ( Math.exp(- 2.0 / degreesOfFreedom * Math.log(w)) - 1.0) / w));
+  return(u * Math.sqrt( degreesOfFreedom * ( Math.exp(- 2.0 / degreesOfFreedom * Math.log(w)) - 1.0) / w));
 }
 /**
  * Returns the probability distribution function.
  */
 public double pdf(double x) {
-	return this.TERM * Math.pow((1+ x*x/freedom), -(freedom+1) * 0.5);
+  return this.TERM * Math.pow((1+ x*x/freedom), -(freedom+1) * 0.5);
 }
 /**
  * Sets the distribution parameter.
@@ -105,11 +103,11 @@
  * @throws IllegalArgumentException if <tt>freedom &lt;= 0.0</tt>.
  */
 public void setState(double freedom) {
-	if (freedom<=0.0) throw new IllegalArgumentException();
-	this.freedom = freedom;
-	
-	double val = Fun.logGamma((freedom+1)/2) - Fun.logGamma(freedom/2);
-	this.TERM = Math.exp(val)/Math.sqrt(Math.PI*freedom);
+  if (freedom<=0.0) throw new IllegalArgumentException();
+  this.freedom = freedom;
+  
+  double val = Fun.logGamma((freedom+1)/2) - Fun.logGamma(freedom/2);
+  this.TERM = Math.exp(val)/Math.sqrt(Math.PI*freedom);
 }
 /**
  * Returns a random number from the distribution.
@@ -117,23 +115,23 @@
  * @throws IllegalArgumentException if <tt>freedom &lt;= 0.0</tt>.
  */
 public static double staticNextDouble(double freedom) {
-	synchronized (shared) {
-		return shared.nextDouble(freedom);
-	}
+  synchronized (shared) {
+    return shared.nextDouble(freedom);
+  }
 }
 /**
  * Returns a String representation of the receiver.
  */
 public String toString() {
-	return this.getClass().getName()+"("+freedom+")";
+  return this.getClass().getName()+"("+freedom+")";
 }
 /**
  * Sets the uniform random number generated shared by all <b>static</b> methods.
  * @param randomGenerator the new uniform random number generator to be shared.
  */
 private static void xstaticSetRandomGenerator(RandomEngine randomGenerator) {
-	synchronized (shared) {
-		shared.setRandomGenerator(randomGenerator);
-	}
+  synchronized (shared) {
+    shared.setRandomGenerator(randomGenerator);
+  }
 }
 }
Index: matrix/src/main/java/org/apache/mahout/jet/random/Beta.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/jet/random/Beta.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/jet/random/Beta.java	(working copy)
@@ -36,268 +36,266 @@
  * Stadlober E., H. Zechner (1993), <A HREF="http://www.cis.tu-graz.ac.at/stat/stadl/random.html"> Generating beta variates via patchwork rejection,</A>,
  * Computing 50, 1-18.
  *
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 09/24/99
  */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
  */
 @Deprecated
 public class Beta extends AbstractContinousDistribution {
-	protected double alpha;
-	protected double beta;
+  protected double alpha;
+  protected double beta;
 
- 	double PDF_CONST; // cache to speed up pdf()
+   double PDF_CONST; // cache to speed up pdf()
 
- 	// cached values shared by bXX
-	double a_last = 0.0, b_last = 0.0;
-	double a_, b_, t, fa, fb, p1, p2;
-	
-	// cached values for b00
-	double c ;
+   // cached values shared by bXX
+  double a_last = 0.0, b_last = 0.0;
+  double a_, b_, t, fa, fb, p1, p2;
+  
+  // cached values for b00
+  double c ;
 
-	// chached values for b01
-	double ml, mu;
+  // chached values for b01
+  double ml, mu;
 
-	// chached values for b1prs
-	double p_last = 0.0, q_last = 0.0;
-	double a, b, s, m, D, Dl, x1, x2, x4, x5, f1, f2, f4, f5;
-	double ll, lr, z2, z4, p3, p4;
+  // chached values for b1prs
+  double p_last = 0.0, q_last = 0.0;
+  double a, b, s, m, D, Dl, x1, x2, x4, x5, f1, f2, f4, f5;
+  double ll, lr, z2, z4, p3, p4;
 
 
-	// The uniform random number generated shared by all <b>static</b> methods.
-	protected static Beta shared = new Beta(10.0,10.0,makeDefaultGenerator());
+  // The uniform random number generated shared by all <b>static</b> methods.
+  protected static Beta shared = new Beta(10.0,10.0,makeDefaultGenerator());
 /**
  * Constructs a Beta distribution.
  */
 public Beta(double alpha, double beta, RandomEngine randomGenerator) {
-	setRandomGenerator(randomGenerator);
-	setState(alpha,beta);
+  setRandomGenerator(randomGenerator);
+  setState(alpha,beta);
 }
 /**
  * 
  */
 protected double b00(double a, double b, RandomEngine randomGenerator) {
-	double             U, V, X, Z;
+  double             U, V, X, Z;
 
-	if (a != a_last || b != b_last) {
-		a_last = a;
-		b_last = b;
+  if (a != a_last || b != b_last) {
+    a_last = a;
+    b_last = b;
 
-		a_ = a - 1.0;
-		b_ = b - 1.0;
-		c = (b * b_) / (a * a_);                            // b(1-b) / a(1-a) 
-		t = (c == 1.0) ? 0.5 : (1.0 - Math.sqrt(c))/(1.0 - c);  // t = t_opt      
-		fa = Math.exp(a_ * Math.log(t));
-		fb = Math.exp(b_ * Math.log(1.0 - t));              // f(t) = fa * fb  
+    a_ = a - 1.0;
+    b_ = b - 1.0;
+    c = (b * b_) / (a * a_);                            // b(1-b) / a(1-a) 
+    t = (c == 1.0) ? 0.5 : (1.0 - Math.sqrt(c))/(1.0 - c);  // t = t_opt      
+    fa = Math.exp(a_ * Math.log(t));
+    fb = Math.exp(b_ * Math.log(1.0 - t));              // f(t) = fa * fb  
 
-		p1 = t/a;                                           // 0 < X < t       
-		p2 = (1.0 - t)/b + p1;                              // t < X < 1       
-	}
+    p1 = t/a;                                           // 0 < X < t       
+    p2 = (1.0 - t)/b + p1;                              // t < X < 1       
+  }
 
-	for (;;) {
-		if ((U = randomGenerator.raw() * p2) <= p1) {       //  X < t  
-			Z = Math.exp(Math.log(U/p1) / a);  X = t*Z;
-			// squeeze accept:   L(x) = 1 + (1 - b)x                                 
-			if ((V = randomGenerator.raw() * fb) <= 1.0 - b_*X)  break;
-			// squeeze reject:   U(x) = 1 + ((1 - t)^(b-1) - 1)/t * x                
-			if (V <= 1.0 + (fb - 1.0)*Z) {
-				// quotient accept:  q(x) = (1 - x)^(b-1) / fb                           
-				if (Math.log(V) <= b_ * Math.log(1.0 - X))  break;
-			}
-		}
-		else {                                                      //  X > t  
-			Z = Math.exp(Math.log((U-p1)/(p2-p1)) / b);  X = 1.0 - (1.0 - t)*Z;
-			// squeeze accept:   L(x) = 1 + (1 - a)(1 - x)                           
-			if ((V = randomGenerator.raw() * fa) <= 1.0 - a_*(1.0 - X))  break;
-			// squeeze reject:   U(x) = 1 + (t^(a-1) - 1)/(1 - t) * (1 - x)          
-			if (V <= 1.0 + (fa - 1.0)*Z) {
-				// quotient accept:  q(x) = x^(a-1) / fa                                 
-				if (Math.log(V) <= a_ * Math.log(X))  break;
-			}
-		}
-	}
-	return(X);
+  for (;;) {
+    if ((U = randomGenerator.raw() * p2) <= p1) {       //  X < t  
+      Z = Math.exp(Math.log(U/p1) / a);  X = t*Z;
+      // squeeze accept:   L(x) = 1 + (1 - b)x                                 
+      if ((V = randomGenerator.raw() * fb) <= 1.0 - b_*X)  break;
+      // squeeze reject:   U(x) = 1 + ((1 - t)^(b-1) - 1)/t * x                
+      if (V <= 1.0 + (fb - 1.0)*Z) {
+        // quotient accept:  q(x) = (1 - x)^(b-1) / fb                           
+        if (Math.log(V) <= b_ * Math.log(1.0 - X))  break;
+      }
+    }
+    else {                                                      //  X > t  
+      Z = Math.exp(Math.log((U-p1)/(p2-p1)) / b);  X = 1.0 - (1.0 - t)*Z;
+      // squeeze accept:   L(x) = 1 + (1 - a)(1 - x)                           
+      if ((V = randomGenerator.raw() * fa) <= 1.0 - a_*(1.0 - X))  break;
+      // squeeze reject:   U(x) = 1 + (t^(a-1) - 1)/(1 - t) * (1 - x)          
+      if (V <= 1.0 + (fa - 1.0)*Z) {
+        // quotient accept:  q(x) = x^(a-1) / fa                                 
+        if (Math.log(V) <= a_ * Math.log(X))  break;
+      }
+    }
+  }
+  return(X);
 }
 /**
  * 
  */
 protected double b01(double a, double b, RandomEngine randomGenerator) {
-	double             U, V, X, Z;
+  double             U, V, X, Z;
 
-	if (a != a_last || b != b_last) {
-		a_last = a;
-		b_last = b;
+  if (a != a_last || b != b_last) {
+    a_last = a;
+    b_last = b;
 
-		a_ = a - 1.0;
-		b_ = b - 1.0;
-		t = a_/(a - b);                   // one step Newton * start value t   
-		fb = Math.exp((b_ - 1.0) * Math.log(1.0 - t));  fa = a - (a + b_)*t;
-		t -= (t - (1.0 - fa) * (1.0 - t)*fb / b) / (1.0 - fa*fb);
-		fa = Math.exp(a_ * Math.log(t));
-		fb = Math.exp(b_ * Math.log(1.0 - t));             // f(t) = fa * fb  
-		if (b_ <= 1.0) {
-			ml = (1.0 - fb) / t;                           //   ml = -m1     
-			mu = b_ * t;                                   //   mu = -m2 * t 
-		}
-		else {
-			ml = b_;
-			mu = 1.0 - fb;
-		}
-		p1 = t/a;                                           //  0 < X < t     
-		p2 = fb * (1.0 - t)/b + p1;                         //  t < X < 1      
-	}
+    a_ = a - 1.0;
+    b_ = b - 1.0;
+    t = a_/(a - b);                   // one step Newton * start value t   
+    fb = Math.exp((b_ - 1.0) * Math.log(1.0 - t));  fa = a - (a + b_)*t;
+    t -= (t - (1.0 - fa) * (1.0 - t)*fb / b) / (1.0 - fa*fb);
+    fa = Math.exp(a_ * Math.log(t));
+    fb = Math.exp(b_ * Math.log(1.0 - t));             // f(t) = fa * fb  
+    if (b_ <= 1.0) {
+      ml = (1.0 - fb) / t;                           //   ml = -m1     
+      mu = b_ * t;                                   //   mu = -m2 * t 
+    }
+    else {
+      ml = b_;
+      mu = 1.0 - fb;
+    }
+    p1 = t/a;                                           //  0 < X < t     
+    p2 = fb * (1.0 - t)/b + p1;                         //  t < X < 1      
+  }
 
-	for (;;) {
-		if ((U = randomGenerator.raw() * p2) <= p1) {       //  X < t  
-			Z = Math.exp(Math.log(U/p1) / a);  X = t*Z;
-			// squeeze accept:   L(x) = 1 + m1*x,  ml = -m1                          
-			if ((V = randomGenerator.raw() ) <= 1.0 - ml*X)  break;
-			// squeeze reject:   U(x) = 1 + m2*x,  mu = -m2 * t                      
-			if (V <= 1.0 - mu*Z) {
-				// quotient accept:  q(x) = (1 - x)^(b-1)                                
-				if (Math.log(V) <= b_ * Math.log(1.0 - X))  break;
-			}
-		}
-		else {                                                      //  X > t  
-			Z = Math.exp(Math.log((U-p1)/(p2-p1)) / b);  X = 1.0 - (1.0 - t)*Z;
-			// squeeze accept:   L(x) = 1 + (1 - a)(1 - x)                           
-			if ((V = randomGenerator.raw()  * fa) <= 1.0 - a_*(1.0 - X))  break;
-			// squeeze reject:   U(x) = 1 + (t^(a-1) - 1)/(1 - t) * (1 - x)          
-			if (V <= 1.0 + (fa - 1.0)*Z) {
-				// quotient accept:  q(x) = (x)^(a-1) / fa                               
-				if (Math.log(V) <= a_ * Math.log(X))  break;
-			}
-		}
-	}
-	return(X);
+  for (;;) {
+    if ((U = randomGenerator.raw() * p2) <= p1) {       //  X < t  
+      Z = Math.exp(Math.log(U/p1) / a);  X = t*Z;
+      // squeeze accept:   L(x) = 1 + m1*x,  ml = -m1                          
+      if ((V = randomGenerator.raw() ) <= 1.0 - ml*X)  break;
+      // squeeze reject:   U(x) = 1 + m2*x,  mu = -m2 * t                      
+      if (V <= 1.0 - mu*Z) {
+        // quotient accept:  q(x) = (1 - x)^(b-1)                                
+        if (Math.log(V) <= b_ * Math.log(1.0 - X))  break;
+      }
+    }
+    else {                                                      //  X > t  
+      Z = Math.exp(Math.log((U-p1)/(p2-p1)) / b);  X = 1.0 - (1.0 - t)*Z;
+      // squeeze accept:   L(x) = 1 + (1 - a)(1 - x)                           
+      if ((V = randomGenerator.raw()  * fa) <= 1.0 - a_*(1.0 - X))  break;
+      // squeeze reject:   U(x) = 1 + (t^(a-1) - 1)/(1 - t) * (1 - x)          
+      if (V <= 1.0 + (fa - 1.0)*Z) {
+        // quotient accept:  q(x) = (x)^(a-1) / fa                               
+        if (Math.log(V) <= a_ * Math.log(X))  break;
+      }
+    }
+  }
+  return(X);
 }
 /**
  * 
  */
 protected double b1prs(double p, double q, RandomEngine randomGenerator) {
-	double            U, V, W, X, Y;
+  double            U, V, W, X, Y;
 
-	if (p != p_last || q != q_last) {
-		p_last = p;
-		q_last = q;
+  if (p != p_last || q != q_last) {
+    p_last = p;
+    q_last = q;
 
-		a = p - 1.0;
-		b = q - 1.0;
-		s = a + b;   m = a / s;
-		if (a > 1.0 || b > 1.0)  D = Math.sqrt(m * (1.0 - m) / (s - 1.0));
+    a = p - 1.0;
+    b = q - 1.0;
+    s = a + b;   m = a / s;
+    if (a > 1.0 || b > 1.0)  D = Math.sqrt(m * (1.0 - m) / (s - 1.0));
 
-		if (a <= 1.0) {
-			x2 = (Dl = m * 0.5);  x1 = z2 = 0.0;  f1 = ll = 0.0;
-		}
-		else {
-			x2 = m - D;  x1 = x2 - D;
-			z2 = x2 * (1.0 - (1.0 - x2)/(s * D));
-			if (x1 <= 0.0 || (s - 6.0) * x2 - a + 3.0 > 0.0) {
-	x1 = z2;  x2 = (x1 + m) * 0.5;
-	Dl = m - x2;
-			}
-			else {
-	Dl = D;
-			}
-			f1 = f(x1, a, b, m);
-			ll = x1 * (1.0 - x1) / (s * (m - x1));          // z1 = x1 - ll  
-		}
-		f2 = f(x2, a, b, m);
+    if (a <= 1.0) {
+      x2 = (Dl = m * 0.5);  x1 = z2 = 0.0;  f1 = ll = 0.0;
+    }
+    else {
+      x2 = m - D;  x1 = x2 - D;
+      z2 = x2 * (1.0 - (1.0 - x2)/(s * D));
+      if (x1 <= 0.0 || (s - 6.0) * x2 - a + 3.0 > 0.0) {
+  x1 = z2;  x2 = (x1 + m) * 0.5;
+  Dl = m - x2;
+      }
+      else {
+  Dl = D;
+      }
+      f1 = f(x1, a, b, m);
+      ll = x1 * (1.0 - x1) / (s * (m - x1));          // z1 = x1 - ll  
+    }
+    f2 = f(x2, a, b, m);
 
-		if (b <= 1.0) {
-			x4 = 1.0 - (D = (1.0 - m) * 0.5);  x5 = z4 = 1.0;  f5 = lr = 0.0;
-		}
-		else {
-			x4 = m + D;  x5 = x4 + D;
-			z4 = x4 * (1.0 + (1.0 - x4)/(s * D));
-			if (x5 >= 1.0 || (s - 6.0) * x4 - a + 3.0 < 0.0) {
-	x5 = z4;  x4 = (m + x5) * 0.5;
-	D = x4 - m;
-			}
-			f5 = f(x5, a, b, m);
-			lr = x5 * (1.0 - x5) / (s * (x5 - m));          // z5 = x5 + lr   
-		}
-		f4 = f(x4, a, b, m);
+    if (b <= 1.0) {
+      x4 = 1.0 - (D = (1.0 - m) * 0.5);  x5 = z4 = 1.0;  f5 = lr = 0.0;
+    }
+    else {
+      x4 = m + D;  x5 = x4 + D;
+      z4 = x4 * (1.0 + (1.0 - x4)/(s * D));
+      if (x5 >= 1.0 || (s - 6.0) * x4 - a + 3.0 < 0.0) {
+  x5 = z4;  x4 = (m + x5) * 0.5;
+  D = x4 - m;
+      }
+      f5 = f(x5, a, b, m);
+      lr = x5 * (1.0 - x5) / (s * (x5 - m));          // z5 = x5 + lr   
+    }
+    f4 = f(x4, a, b, m);
 
-		p1 = f2 * (Dl + Dl);                                //  x1 < X < m    
-		p2 = f4 * (D  + D) + p1;                            //  m  < X < x5   
-		p3 = f1 * ll       + p2;                            //       X < x1   
-		p4 = f5 * lr       + p3;                            //  x5 < X        
-	}
+    p1 = f2 * (Dl + Dl);                                //  x1 < X < m    
+    p2 = f4 * (D  + D) + p1;                            //  m  < X < x5   
+    p3 = f1 * ll       + p2;                            //       X < x1   
+    p4 = f5 * lr       + p3;                            //  x5 < X        
+  }
 
-	for (;;) {
-		if ((U = randomGenerator.raw() * p4) <= p1) {
-	 // immediate accept:  x2 < X < m, - f(x2) < W < 0                      
-			if ((W = U/Dl - f2) <= 0.0)  return(m - U/f2);
-	 // immediate accept:  x1 < X < x2, 0 < W < f(x1)                       
-			if (W <= f1)  return(x2 - W/f1 * Dl);
-	 // candidates for acceptance-rejection-test                            
-			V = Dl * (U = randomGenerator.raw());
-			X = x2 - V;  Y = x2 + V;
-	 // squeeze accept:    L(x) = f(x2) (x - z2) / (x2 - z2)                
-			if (W * (x2 - z2) <= f2 * (X - z2))  return(X);
-			if ((V = f2 + f2 - W) < 1.0) {
-	 // squeeze accept:    L(x) = f(x2) + (1 - f(x2))(x - x2)/(m - x2)      
-	if (V <= f2 + (1.0 - f2) * U)  return(Y);
-	 // quotient accept:   x2 < Y < m,   W >= 2f2 - f(Y)                    
-	if (V <= f(Y, a, b, m))  return(Y);
-			}
-		}
-		else if (U <= p2) {
-			U -= p1;
-	 // immediate accept:  m < X < x4, - f(x4) < W < 0                      
-			if ((W = U/D - f4) <= 0.0)  return(m + U/f4);
-	 // immediate accept:  x4 < X < x5, 0 < W < f(x5)                     
-			if (W <= f5)  return(x4 + W/f5 * D);
-	 // candidates for acceptance-rejection-test                         
-			V = D * (U = randomGenerator.raw());
-			X = x4 + V;  Y = x4 - V;
-	 // squeeze accept:    L(x) = f(x4) (z4 - x) / (z4 - x4)             
-			if (W * (z4 - x4) <= f4 * (z4 - X))  return(X);
-			if ((V = f4 + f4 - W) < 1.0) {
-	 // squeeze accept:    L(x) = f(x4) + (1 - f(x4))(x4 - x)/(x4 - m)     
-	if (V <= f4 + (1.0 - f4) * U)  return(Y);
-		// quotient accept:   m < Y < x4,   W >= 2f4 - f(Y)                   
-	if (V <= f(Y, a, b, m))  return(Y);
-			}
-		}
-		else if (U <= p3) {                                     // X < x1  
-			Y = Math.log(U = (U - p2)/(p3 - p2));
-			if ((X = x1 + ll * Y) <= 0.0)  continue;            // X > 0!! 
-			W = randomGenerator.raw() * U;
-	 // squeeze accept:    L(x) = f(x1) (x - z1) / (x1 - z1)                
-	 //                    z1 = x1 - ll,   W <= 1 + (X - x1)/ll          
-			if (W <= 1.0 + Y)  return(X);
-			W *= f1;
-		}
-		else {                                                  // x5 < X      
-			Y = Math.log(U = (U - p3)/(p4 - p3));
-			if ((X = x5 - lr * Y) >= 1.0)  continue;            // X < 1!! 
-			W = randomGenerator.raw() * U;
-	 // squeeze accept:    L(x) = f(x5) (z5 - x) / (z5 - x5)                
-	 //                    z5 = x5 + lr,   W <= 1 + (x5 - X)/lr             
-			if (W <= 1.0 + Y)  return(X);
-			W *= f5;
-		}
-	 // density accept:  f(x) = (x/m)^a ((1 - x)/(1 - m))^b                 
-		if (Math.log(W) <= a*Math.log(X/m) + b*Math.log((1.0 - X)/(1.0 - m)))  return(X);
-	}
+  for (;;) {
+    if ((U = randomGenerator.raw() * p4) <= p1) {
+   // immediate accept:  x2 < X < m, - f(x2) < W < 0                      
+      if ((W = U/Dl - f2) <= 0.0)  return(m - U/f2);
+   // immediate accept:  x1 < X < x2, 0 < W < f(x1)                       
+      if (W <= f1)  return(x2 - W/f1 * Dl);
+   // candidates for acceptance-rejection-test                            
+      V = Dl * (U = randomGenerator.raw());
+      X = x2 - V;  Y = x2 + V;
+   // squeeze accept:    L(x) = f(x2) (x - z2) / (x2 - z2)                
+      if (W * (x2 - z2) <= f2 * (X - z2))  return(X);
+      if ((V = f2 + f2 - W) < 1.0) {
+   // squeeze accept:    L(x) = f(x2) + (1 - f(x2))(x - x2)/(m - x2)      
+  if (V <= f2 + (1.0 - f2) * U)  return(Y);
+   // quotient accept:   x2 < Y < m,   W >= 2f2 - f(Y)                    
+  if (V <= f(Y, a, b, m))  return(Y);
+      }
+    }
+    else if (U <= p2) {
+      U -= p1;
+   // immediate accept:  m < X < x4, - f(x4) < W < 0                      
+      if ((W = U/D - f4) <= 0.0)  return(m + U/f4);
+   // immediate accept:  x4 < X < x5, 0 < W < f(x5)                     
+      if (W <= f5)  return(x4 + W/f5 * D);
+   // candidates for acceptance-rejection-test                         
+      V = D * (U = randomGenerator.raw());
+      X = x4 + V;  Y = x4 - V;
+   // squeeze accept:    L(x) = f(x4) (z4 - x) / (z4 - x4)             
+      if (W * (z4 - x4) <= f4 * (z4 - X))  return(X);
+      if ((V = f4 + f4 - W) < 1.0) {
+   // squeeze accept:    L(x) = f(x4) + (1 - f(x4))(x4 - x)/(x4 - m)     
+  if (V <= f4 + (1.0 - f4) * U)  return(Y);
+    // quotient accept:   m < Y < x4,   W >= 2f4 - f(Y)                   
+  if (V <= f(Y, a, b, m))  return(Y);
+      }
+    }
+    else if (U <= p3) {                                     // X < x1  
+      Y = Math.log(U = (U - p2)/(p3 - p2));
+      if ((X = x1 + ll * Y) <= 0.0)  continue;            // X > 0!! 
+      W = randomGenerator.raw() * U;
+   // squeeze accept:    L(x) = f(x1) (x - z1) / (x1 - z1)                
+   //                    z1 = x1 - ll,   W <= 1 + (X - x1)/ll          
+      if (W <= 1.0 + Y)  return(X);
+      W *= f1;
+    }
+    else {                                                  // x5 < X      
+      Y = Math.log(U = (U - p3)/(p4 - p3));
+      if ((X = x5 - lr * Y) >= 1.0)  continue;            // X < 1!! 
+      W = randomGenerator.raw() * U;
+   // squeeze accept:    L(x) = f(x5) (z5 - x) / (z5 - x5)                
+   //                    z5 = x5 + lr,   W <= 1 + (x5 - X)/lr             
+      if (W <= 1.0 + Y)  return(X);
+      W *= f5;
+    }
+   // density accept:  f(x) = (x/m)^a ((1 - x)/(1 - m))^b                 
+    if (Math.log(W) <= a*Math.log(X/m) + b*Math.log((1.0 - X)/(1.0 - m)))  return(X);
+  }
 }
 /**
  * Returns the cumulative distribution function.
  */
 public double cdf(double x) {
-	return Probability.beta(alpha,beta,x);
+  return Probability.beta(alpha,beta,x);
 }
 private static double f(double x, double a, double b, double m) {
-	return  Math.exp(a*Math.log(x/m) + b*Math.log((1.0 - x)/(1.0 - m)));
+  return  Math.exp(a*Math.log(x/m) + b*Math.log((1.0 - x)/(1.0 - m)));
 }
 /**
  * Returns a random number from the distribution.
  */
 public double nextDouble() {
-	return nextDouble(alpha, beta);
+  return nextDouble(alpha, beta);
 }
 /**
  * Returns a beta distributed random number; bypasses the internal state.
@@ -345,67 +343,67 @@
  *                with unsigned long integer *seed, double a, b.  *
  *                                                                *
  ******************************************************************/
-	double a = alpha;
-	double b = beta;
-	if (a  > 1.0) {
-		if (b  > 1.0)  return(b1prs(a, b, randomGenerator));
-		if (b  < 1.0)  return(1.0 - b01(b, a, randomGenerator));
-		if (b == 1.0) {
-			return(Math.exp(Math.log( randomGenerator.raw()) / a));
-		}
-	}
+  double a = alpha;
+  double b = beta;
+  if (a  > 1.0) {
+    if (b  > 1.0)  return(b1prs(a, b, randomGenerator));
+    if (b  < 1.0)  return(1.0 - b01(b, a, randomGenerator));
+    if (b == 1.0) {
+      return(Math.exp(Math.log( randomGenerator.raw()) / a));
+    }
+  }
 
-	if (a  < 1.0) {
-		if (b  > 1.0)  return(b01(a, b, randomGenerator));
-		if (b  < 1.0)  return(b00(a, b, randomGenerator));
-		if (b == 1.0) {
-			return(Math.exp(Math.log(randomGenerator.raw()) / a));
-		}
-	}
+  if (a  < 1.0) {
+    if (b  > 1.0)  return(b01(a, b, randomGenerator));
+    if (b  < 1.0)  return(b00(a, b, randomGenerator));
+    if (b == 1.0) {
+      return(Math.exp(Math.log(randomGenerator.raw()) / a));
+    }
+  }
 
-	if (a == 1.0) {
-		if (b != 1.0)  return(1.0 - Math.exp(Math.log(randomGenerator.raw()) / b));
-		if (b == 1.0)  return(randomGenerator.raw());
-	}
+  if (a == 1.0) {
+    if (b != 1.0)  return(1.0 - Math.exp(Math.log(randomGenerator.raw()) / b));
+    if (b == 1.0)  return(randomGenerator.raw());
+  }
 
-	return 0.0;
+  return 0.0;
 }
 /**
  * Returns the cumulative distribution function.
  */
 public double pdf(double x) {
-	if (x < 0 || x > 1) return 0.0 ;
-	return Math.exp(PDF_CONST) * Math.pow(x, alpha-1) * Math.pow(1-x, beta-1);
+  if (x < 0 || x > 1) return 0.0 ;
+  return Math.exp(PDF_CONST) * Math.pow(x, alpha-1) * Math.pow(1-x, beta-1);
 }
 /**
  * Sets the parameters.
  */
 public void setState(double alpha, double beta) {
-	this.alpha = alpha;
-	this.beta = beta;
-	this.PDF_CONST = Fun.logGamma(alpha+beta) - Fun.logGamma(alpha) - Fun.logGamma(beta);
+  this.alpha = alpha;
+  this.beta = beta;
+  this.PDF_CONST = Fun.logGamma(alpha+beta) - Fun.logGamma(alpha) - Fun.logGamma(beta);
 }
 /**
  * Returns a random number from the distribution.
  */
 public static double staticNextDouble(double alpha, double beta) {
-	synchronized (shared) {
-		return shared.nextDouble(alpha,beta);
-	}
+  synchronized (shared) {
+    return shared.nextDouble(alpha,beta);
+  }
 }
 /**
  * Returns a String representation of the receiver.
  */
 public String toString() {
-	return this.getClass().getName()+"("+alpha+","+beta+")";
+  return this.getClass().getName()+"("+alpha+","+beta+")";
 }
 /**
  * Sets the uniform random number generated shared by all <b>static</b> methods.
  * @param randomGenerator the new uniform random number generator to be shared.
  */
 private static void xstaticSetRandomGenerator(RandomEngine randomGenerator) {
-	synchronized (shared) {
-		shared.setRandomGenerator(randomGenerator);
-	}
+  synchronized (shared) {
+    shared.setRandomGenerator(randomGenerator);
+  }
 }
 }
Index: matrix/src/main/java/org/apache/mahout/jet/random/EmpiricalWalker.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/jet/random/EmpiricalWalker.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/jet/random/EmpiricalWalker.java	(working copy)
@@ -37,19 +37,17 @@
  * Computer Programming, Volume 2 (Seminumerical algorithms), 3rd
  * edition, Addison-Wesley (1997), p120.
  *
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 09/24/99
  */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
  */
 @Deprecated
 public class EmpiricalWalker extends AbstractDiscreteDistribution {
-	protected int K;
-	protected int[] A;
-	protected double[] F;
+  protected int K;
+  protected int[] A;
+  protected double[] F;
 
-	protected double[] cdf; // cumulative distribution function
+  protected double[] cdf; // cumulative distribution function
 /*
  * James Theiler, jt@lanl.gov, the author of the GSL routine this port is based on, describes his approach as follows:
  * 
@@ -169,17 +167,17 @@
  * @throws IllegalArgumentException if at least one of the three conditions above is violated.
  */
 public EmpiricalWalker(double[] pdf, int interpolationType, RandomEngine randomGenerator) {
-	setRandomGenerator(randomGenerator);
-	setState(pdf,interpolationType);	
-	setState2(pdf);	
+  setRandomGenerator(randomGenerator);
+  setState(pdf,interpolationType);  
+  setState2(pdf);  
 }
 /**
  * Returns the cumulative distribution function.
  */
 public double cdf(int k) {
-	if (k < 0) return 0.0;
-	if (k >= cdf.length-1) return 1.0;
-	return cdf[k];
+  if (k < 0) return 0.0;
+  if (k >= cdf.length-1) return 1.0;
+  return cdf[k];
 }
 /**
  * Returns a deep copy of the receiver; the copy will produce identical sequences.
@@ -188,42 +186,42 @@
  * @return a copy of the receiver.
  */
 public Object clone() {
-	EmpiricalWalker copy = (EmpiricalWalker) super.clone();
-	if (this.cdf != null) copy.cdf = (double[]) this.cdf.clone();
-	if (this.A != null) copy.A = (int[]) this.A.clone();
-	if (this.F != null) copy.F = (double[]) this.F.clone();
-	return copy;
+  EmpiricalWalker copy = (EmpiricalWalker) super.clone();
+  if (this.cdf != null) copy.cdf = (double[]) this.cdf.clone();
+  if (this.A != null) copy.A = (int[]) this.A.clone();
+  if (this.F != null) copy.F = (double[]) this.F.clone();
+  return copy;
 }
 /**
  * Returns a random integer <tt>k</tt> with probability <tt>pdf(k)</tt>.
  */
 public int nextInt() {
-	int c=0;
-	double u,f;
-	u = this.randomGenerator.raw();
+  int c=0;
+  double u,f;
+  u = this.randomGenerator.raw();
 //#if KNUTH_CONVENTION
 //    c = (int)(u*(g->K));
 //#else
-	u *= this.K;
-	c = (int)u;
-	u -= c;
+  u *= this.K;
+  c = (int)u;
+  u -= c;
 //#endif
-	f = this.F[c];
-	// fprintf(stderr,"c,f,u: %d %.4f %f\n",c,f,u); 
-	if (f == 1.0) return c;
-	if (u < f) {
-		return c;
-	}
-	else {
-		return this.A[c];
-	}
+  f = this.F[c];
+  // fprintf(stderr,"c,f,u: %d %.4f %f\n",c,f,u); 
+  if (f == 1.0) return c;
+  if (u < f) {
+    return c;
+  }
+  else {
+    return this.A[c];
+  }
 }
 /**
  * Returns the probability distribution function.
  */
 public double pdf(int k) {
-	if (k < 0 || k >= cdf.length-1) return 0.0;
-	return cdf[k-1] - cdf[k];
+  if (k < 0 || k >= cdf.length-1) return 0.0;
+  return cdf[k-1] - cdf[k];
 }
 /**
  * Sets the distribution parameters.
@@ -237,25 +235,25 @@
  * @throws IllegalArgumentException if at least one of the three conditions above is violated.
  */
 public void setState(double[] pdf, int interpolationType) {
-	if (pdf==null || pdf.length==0) {
-		throw new IllegalArgumentException("Non-existing pdf");
-	}
+  if (pdf==null || pdf.length==0) {
+    throw new IllegalArgumentException("Non-existing pdf");
+  }
 
-	// compute cumulative distribution function (cdf) from probability distribution function (pdf)
-	int nBins = pdf.length;
-	this.cdf = new double[nBins+1];
-	
-	cdf[0] = 0;
-	for (int i = 0; i<nBins; i++ ) {
-		if (pdf[i] < 0.0) throw new IllegalArgumentException("Negative probability");
-		cdf[i+1] = cdf[i] + pdf[i];
-	}
-	if (cdf[nBins] <= 0.0) throw new IllegalArgumentException("At leat one probability must be > 0.0");
-	// now normalize to 1 (relative probabilities).
-	for (int i = 0; i < nBins+1; i++ ) {
-		cdf[i] /= cdf[nBins];
-	}
-	// cdf is now cached...
+  // compute cumulative distribution function (cdf) from probability distribution function (pdf)
+  int nBins = pdf.length;
+  this.cdf = new double[nBins+1];
+  
+  cdf[0] = 0;
+  for (int i = 0; i<nBins; i++ ) {
+    if (pdf[i] < 0.0) throw new IllegalArgumentException("Negative probability");
+    cdf[i+1] = cdf[i] + pdf[i];
+  }
+  if (cdf[nBins] <= 0.0) throw new IllegalArgumentException("At leat one probability must be > 0.0");
+  // now normalize to 1 (relative probabilities).
+  for (int i = 0; i < nBins+1; i++ ) {
+    cdf[i] /= cdf[nBins];
+  }
+  // cdf is now cached...
 }
 /**
  * Sets the distribution parameters.
@@ -268,136 +266,136 @@
  * @throws IllegalArgumentException if at least one of the three conditions above is violated.
  */
 public void setState2(double[] pdf) {
-	int size = pdf.length;
-	int k,s,b;
-	int nBigs, nSmalls;
-	Stack Bigs;
-	Stack Smalls;
-	double[] E;
-	double pTotal=0;
-	double mean,d;
-	
-	//if (size < 1) {
-	//	throw new IllegalArgumentException("must have size greater than zero");
-	//}
-	/* Make sure elements of ProbArray[] are positive.
-	 * Won't enforce that sum is unity; instead will just normalize
-	 */
-	for (k=0; k<size; ++k) {
-		//if (pdf[k] < 0) {
-			//throw new IllegalArgumentException("Probabilities must be >= 0: "+pdf[k]);
-		//}
-		pTotal += pdf[k];
-	}
+  int size = pdf.length;
+  int k,s,b;
+  int nBigs, nSmalls;
+  Stack Bigs;
+  Stack Smalls;
+  double[] E;
+  double pTotal=0;
+  double mean,d;
+  
+  //if (size < 1) {
+  //  throw new IllegalArgumentException("must have size greater than zero");
+  //}
+  /* Make sure elements of ProbArray[] are positive.
+   * Won't enforce that sum is unity; instead will just normalize
+   */
+  for (k=0; k<size; ++k) {
+    //if (pdf[k] < 0) {
+      //throw new IllegalArgumentException("Probabilities must be >= 0: "+pdf[k]);
+    //}
+    pTotal += pdf[k];
+  }
 
-	/* Begin setting up the internal state */
-	this.K = size;
-	this.F = new double[size];
-	this.A = new int[size];
+  /* Begin setting up the internal state */
+  this.K = size;
+  this.F = new double[size];
+  this.A = new int[size];
 
-	// normalize to relative probability
-	E = new double[size];
-	for (k=0; k<size; ++k) { 
-		E[k] = pdf[k]/pTotal;
-	}
+  // normalize to relative probability
+  E = new double[size];
+  for (k=0; k<size; ++k) { 
+    E[k] = pdf[k]/pTotal;
+  }
 
-	/* Now create the Bigs and the Smalls */
-	mean = 1.0/size;
-	nSmalls=0;
-	nBigs=0;
-	for (k=0; k<size; ++k) {
-		if (E[k] < mean) ++nSmalls;
-		else             ++nBigs;
-	}
-	Bigs   = new Stack(nBigs);
-	Smalls = new Stack(nSmalls);
-	for (k=0; k<size; ++k) {
-		if (E[k] < mean) {
-			Smalls.push(k);
-		}
-		else {
-			Bigs.push(k);
-		}
-	}
-	/* Now work through the smalls */
-	while (Smalls.size() > 0) {
-		s = Smalls.pop();
-		if (Bigs.size() == 0) {
-			/* Then we are on our last value */
-			this.A[s]=s;
-			this.F[s]=1.0;
-			break;
-		}
-		b = Bigs.pop();
-		this.A[s]=b;
-		this.F[s]=size*E[s];
+  /* Now create the Bigs and the Smalls */
+  mean = 1.0/size;
+  nSmalls=0;
+  nBigs=0;
+  for (k=0; k<size; ++k) {
+    if (E[k] < mean) ++nSmalls;
+    else             ++nBigs;
+  }
+  Bigs   = new Stack(nBigs);
+  Smalls = new Stack(nSmalls);
+  for (k=0; k<size; ++k) {
+    if (E[k] < mean) {
+      Smalls.push(k);
+    }
+    else {
+      Bigs.push(k);
+    }
+  }
+  /* Now work through the smalls */
+  while (Smalls.size() > 0) {
+    s = Smalls.pop();
+    if (Bigs.size() == 0) {
+      /* Then we are on our last value */
+      this.A[s]=s;
+      this.F[s]=1.0;
+      break;
+    }
+    b = Bigs.pop();
+    this.A[s]=b;
+    this.F[s]=size*E[s];
 /*
 #if DEBUG
-		fprintf(stderr,"s=%2d, A=%2d, F=%.4f\n",s,(g->A)[s],(g->F)[s]);
+    fprintf(stderr,"s=%2d, A=%2d, F=%.4f\n",s,(g->A)[s],(g->F)[s]);
 #endif
 */
-		d = mean - E[s];
-		E[s] += d;              /* now E[s] == mean */
-		E[b] -= d;
-		if (E[b] < mean) {
-			Smalls.push(b); /* no longer big, join ranks of the small */
-		}
-		else if (E[b] > mean) {
-			Bigs.push(b); /* still big, put it back where you found it */
-		}
-		else {
-			/* E[b]==mean implies it is finished too */
-			this.A[b]=b;
-			this.F[b]=1.0;
-		}
-	}
-	while (Bigs.size() > 0) {
-		b = Bigs.pop();
-		this.A[b]=b;
-		this.F[b]=1.0;
-	}
-	/* Stacks have been emptied, and A and F have been filled */
+    d = mean - E[s];
+    E[s] += d;              /* now E[s] == mean */
+    E[b] -= d;
+    if (E[b] < mean) {
+      Smalls.push(b); /* no longer big, join ranks of the small */
+    }
+    else if (E[b] > mean) {
+      Bigs.push(b); /* still big, put it back where you found it */
+    }
+    else {
+      /* E[b]==mean implies it is finished too */
+      this.A[b]=b;
+      this.F[b]=1.0;
+    }
+  }
+  while (Bigs.size() > 0) {
+    b = Bigs.pop();
+    this.A[b]=b;
+    this.F[b]=1.0;
+  }
+  /* Stacks have been emptied, and A and F have been filled */
 
-	
+  
 //#if 0
-	/* if 1, then artificially set all F[k]'s to unity.  This will
-	 * give wrong answers, but you'll get them faster.  But, not
-	 * that much faster (I get maybe 20%); that's an upper bound
-	 * on what the optimal preprocessing would give.
-	 */
+  /* if 1, then artificially set all F[k]'s to unity.  This will
+   * give wrong answers, but you'll get them faster.  But, not
+   * that much faster (I get maybe 20%); that's an upper bound
+   * on what the optimal preprocessing would give.
+   */
 /*     
-	for (k=0; k<size; ++k) {
-		F[k] = 1.0;
-	}
+  for (k=0; k<size; ++k) {
+    F[k] = 1.0;
+  }
 //#endif
 */
 
 //#if KNUTH_CONVENTION
-	/* For convenience, set F'[k]=(k+F[k])/K */
-	/* This saves some arithmetic in gsl_ran_discrete(); I find that
-	 * it doesn't actually make much difference.
-	 */
-	 /*
-	for (k=0; k<size; ++k) {
-		F[k] += k;
-		F[k] /= size;
-	}
+  /* For convenience, set F'[k]=(k+F[k])/K */
+  /* This saves some arithmetic in gsl_ran_discrete(); I find that
+   * it doesn't actually make much difference.
+   */
+   /*
+  for (k=0; k<size; ++k) {
+    F[k] += k;
+    F[k] /= size;
+  }
 #endif
 */
-	/*
-	free_stack(Bigs);
-	free_stack(Smalls);
-	free((char *)E);
+  /*
+  free_stack(Bigs);
+  free_stack(Smalls);
+  free((char *)E);
 
-	return g;
-	*/
+  return g;
+  */
 
 }
 /**
  * Returns a String representation of the receiver.
  */
 public String toString() {
-	String interpolation = null;
-	return this.getClass().getName()+"("+ ((cdf!=null) ? cdf.length : 0)+")";
+  String interpolation = null;
+  return this.getClass().getName()+"("+ ((cdf!=null) ? cdf.length : 0)+")";
 }
 }
Index: matrix/src/main/java/org/apache/mahout/jet/random/NegativeBinomial.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/jet/random/NegativeBinomial.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/jet/random/NegativeBinomial.java	(working copy)
@@ -24,22 +24,20 @@
  * <p>
  * J.H. Ahrens, U. Dieter (1974): Computer methods for sampling from gamma, beta, Poisson and binomial distributions, Computing 12, 223--246.
  *
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 09/24/99
  */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
  */
 @Deprecated
 public class NegativeBinomial extends AbstractDiscreteDistribution {
-	protected int n;
-	protected double p;
+  protected int n;
+  protected double p;
 
-	protected Gamma gamma;
-	protected Poisson poisson;
-	
- 	// The uniform random number generated shared by all <b>static</b> methods. 
-	protected static NegativeBinomial shared = new NegativeBinomial(1,0.5,makeDefaultGenerator());
+  protected Gamma gamma;
+  protected Poisson poisson;
+  
+   // The uniform random number generated shared by all <b>static</b> methods. 
+  protected static NegativeBinomial shared = new NegativeBinomial(1,0.5,makeDefaultGenerator());
 /**
  * Constructs a Negative Binomial distribution.
  * Example: n=1, p=0.5.
@@ -48,16 +46,16 @@
  * @param randomGenerator a uniform random number generator.
  */
 public NegativeBinomial(int n, double p, RandomEngine randomGenerator) {
-	setRandomGenerator(randomGenerator);
-	setNandP(n,p);
-	this.gamma = new Gamma(n,1.0,randomGenerator);
-	this.poisson = new Poisson(0.0,randomGenerator);
+  setRandomGenerator(randomGenerator);
+  setNandP(n,p);
+  this.gamma = new Gamma(n,1.0,randomGenerator);
+  this.poisson = new Poisson(0.0,randomGenerator);
 }
 /**
  * Returns the cumulative distribution function.
  */
 public double cdf(int k) {
-	return Probability.negativeBinomial(k,n,p);
+  return Probability.negativeBinomial(k,n,p);
 }
 /**
  * Returns a deep copy of the receiver; the copy will produce identical sequences.
@@ -66,18 +64,18 @@
  * @return a copy of the receiver.
  */
 public Object clone() {
-	NegativeBinomial copy = (NegativeBinomial) super.clone();
-	if (this.poisson != null) copy.poisson = (Poisson) this.poisson.clone();
-	copy.poisson.setRandomGenerator(copy.getRandomGenerator());
-	if (this.gamma != null) copy.gamma = (Gamma) this.gamma.clone();
-	copy.gamma.setRandomGenerator(copy.getRandomGenerator());
-	return copy;
+  NegativeBinomial copy = (NegativeBinomial) super.clone();
+  if (this.poisson != null) copy.poisson = (Poisson) this.poisson.clone();
+  copy.poisson.setRandomGenerator(copy.getRandomGenerator());
+  if (this.gamma != null) copy.gamma = (Gamma) this.gamma.clone();
+  copy.gamma.setRandomGenerator(copy.getRandomGenerator());
+  return copy;
 }
 /**
  * Returns a random number from the distribution.
  */
 public int nextInt() {
-	return nextInt(n,p);
+  return nextInt(n,p);
 }
 /**
  * Returns a random number from the distribution; bypasses the internal state.
@@ -107,17 +105,17 @@
  *                                                                *
  ******************************************************************/
 
-	double x = p /(1.0 - p);
-	double p1 = p;  
-	double y = x * this.gamma.nextDouble(n,1.0);
-	return this.poisson.nextInt(y);
+  double x = p /(1.0 - p);
+  double p1 = p;  
+  double y = x * this.gamma.nextDouble(n,1.0);
+  return this.poisson.nextInt(y);
 }
 /**
  * Returns the probability distribution function.
  */
 public double pdf(int k) {
-	if (k > n) throw new IllegalArgumentException();
-	return org.apache.mahout.jet.math.Arithmetic.binomial(n,k) * Math.pow(p,k) * Math.pow(1.0-p,n-k);
+  if (k > n) throw new IllegalArgumentException();
+  return org.apache.mahout.jet.math.Arithmetic.binomial(n,k) * Math.pow(p,k) * Math.pow(1.0-p,n-k);
 }
 /**
  * Sets the parameters number of trials and the probability of success.
@@ -125,8 +123,8 @@
  * @param p the probability of success.
  */
 public void setNandP(int n, double p) {
-	this.n = n;
-	this.p = p;
+  this.n = n;
+  this.p = p;
 }
 /**
  * Returns a random number from the distribution with the given parameters n and p.
@@ -134,23 +132,23 @@
  * @param p the probability of success.
  */
 public static int staticNextInt(int n, double p) {
-	synchronized (shared) {
-		return shared.nextInt(n,p);
-	}
+  synchronized (shared) {
+    return shared.nextInt(n,p);
+  }
 }
 /**
  * Returns a String representation of the receiver.
  */
 public String toString() {
-	return this.getClass().getName()+"("+n+","+p+")";
+  return this.getClass().getName()+"("+n+","+p+")";
 }
 /**
  * Sets the uniform random number generated shared by all <b>static</b> methods.
  * @param randomGenerator the new uniform random number generator to be shared.
  */
 private static void xstaticSetRandomGenerator(RandomEngine randomGenerator) {
-	synchronized (shared) {
-		shared.setRandomGenerator(randomGenerator);
-	}
+  synchronized (shared) {
+    shared.setRandomGenerator(randomGenerator);
+  }
 }
 }
Index: matrix/src/main/java/org/apache/mahout/jet/random/Gamma.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/jet/random/Gamma.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/jet/random/Gamma.java	(working copy)
@@ -44,39 +44,37 @@
  * J.H. Ahrens, U. Dieter (1982): Generating gamma variates by a modified rejection technique,
  * Communications of the ACM 25, 47-54.
  *
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 09/24/99
  */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
  */
 @Deprecated
 public class Gamma extends AbstractContinousDistribution { 
-	protected double alpha;
-	protected double lambda;
+  protected double alpha;
+  protected double lambda;
 
- 	// The uniform random number generated shared by all <b>static</b> methods.
-	protected static Gamma shared = new Gamma(1.0,1.0,makeDefaultGenerator());
+   // The uniform random number generated shared by all <b>static</b> methods.
+  protected static Gamma shared = new Gamma(1.0,1.0,makeDefaultGenerator());
 /**
  * Constructs a Gamma distribution.
  * Example: alpha=1.0, lambda=1.0.
  * @throws IllegalArgumentException if <tt>alpha &lt;= 0.0 || lambda &lt;= 0.0</tt>.
  */
 public Gamma(double alpha, double lambda, RandomEngine randomGenerator) {
-	setRandomGenerator(randomGenerator);
-	setState(alpha,lambda);
+  setRandomGenerator(randomGenerator);
+  setState(alpha,lambda);
 }
 /**
  * Returns the cumulative distribution function.
  */
 public double cdf(double x) {
-	return Probability.gamma(alpha,lambda,x);
+  return Probability.gamma(alpha,lambda,x);
 }
 /**
  * Returns a random number from the distribution.
  */
 public double nextDouble() {
-	return nextDouble(alpha, lambda);
+  return nextDouble(alpha, lambda);
 }
 /**
  * Returns a random number from the distribution; bypasses the internal state.
@@ -104,174 +102,174 @@
  *              - NORMAL(seed) ... Normal generator N(0,1).       *
  *                                                                *
  ******************************************************************/
- 	double a = alpha;
-	double aa = -1.0, aaa = -1.0, 
-		b=0.0, c=0.0, d=0.0, e, r, s=0.0, si=0.0, ss=0.0, q0=0.0,
-		q1 = 0.0416666664, q2 =  0.0208333723, q3 = 0.0079849875,
-		q4 = 0.0015746717, q5 = -0.0003349403, q6 = 0.0003340332,
-		q7 = 0.0006053049, q8 = -0.0004701849, q9 = 0.0001710320,
-		a1 = 0.333333333,  a2 = -0.249999949,  a3 = 0.199999867,
-		a4 =-0.166677482,  a5 =  0.142873973,  a6 =-0.124385581,
-		a7 = 0.110368310,  a8 = -0.112750886,  a9 = 0.104089866,
-		e1 = 1.000000000,  e2 =  0.499999994,  e3 = 0.166666848,
-		e4 = 0.041664508,  e5 =  0.008345522,  e6 = 0.001353826,
-		e7 = 0.000247453;
+   double a = alpha;
+  double aa = -1.0, aaa = -1.0, 
+    b=0.0, c=0.0, d=0.0, e, r, s=0.0, si=0.0, ss=0.0, q0=0.0,
+    q1 = 0.0416666664, q2 =  0.0208333723, q3 = 0.0079849875,
+    q4 = 0.0015746717, q5 = -0.0003349403, q6 = 0.0003340332,
+    q7 = 0.0006053049, q8 = -0.0004701849, q9 = 0.0001710320,
+    a1 = 0.333333333,  a2 = -0.249999949,  a3 = 0.199999867,
+    a4 =-0.166677482,  a5 =  0.142873973,  a6 =-0.124385581,
+    a7 = 0.110368310,  a8 = -0.112750886,  a9 = 0.104089866,
+    e1 = 1.000000000,  e2 =  0.499999994,  e3 = 0.166666848,
+    e4 = 0.041664508,  e5 =  0.008345522,  e6 = 0.001353826,
+    e7 = 0.000247453;
 
-	double gds,p,q,t,sign_u,u,v,w,x;
-	double v1,v2,v12;
+  double gds,p,q,t,sign_u,u,v,w,x;
+  double v1,v2,v12;
 
-	// Check for invalid input values
+  // Check for invalid input values
 
-	if (a <= 0.0) throw new IllegalArgumentException(); 
-	if (lambda <= 0.0) new IllegalArgumentException(); 
+  if (a <= 0.0) throw new IllegalArgumentException(); 
+  if (lambda <= 0.0) new IllegalArgumentException(); 
 
-	if (a < 1.0) { // CASE A: Acceptance rejection algorithm gs
-		b = 1.0 + 0.36788794412 * a;              // Step 1
-		for(;;) {
-			p = b * randomGenerator.raw();
-			if (p <= 1.0) {                       // Step 2. Case gds <= 1
-				gds = Math.exp(Math.log(p) / a);
-				if (Math.log(randomGenerator.raw()) <= -gds) return(gds/lambda);
-			}
-			else {                                // Step 3. Case gds > 1
-				gds = - Math.log ((b - p) / a);
-				if (Math.log(randomGenerator.raw()) <= ((a - 1.0) * Math.log(gds))) return(gds/lambda);
-			}
-		}
-	}
+  if (a < 1.0) { // CASE A: Acceptance rejection algorithm gs
+    b = 1.0 + 0.36788794412 * a;              // Step 1
+    for(;;) {
+      p = b * randomGenerator.raw();
+      if (p <= 1.0) {                       // Step 2. Case gds <= 1
+        gds = Math.exp(Math.log(p) / a);
+        if (Math.log(randomGenerator.raw()) <= -gds) return(gds/lambda);
+      }
+      else {                                // Step 3. Case gds > 1
+        gds = - Math.log ((b - p) / a);
+        if (Math.log(randomGenerator.raw()) <= ((a - 1.0) * Math.log(gds))) return(gds/lambda);
+      }
+    }
+  }
 
-	else {        // CASE B: Acceptance complement algorithm gd (gaussian distribution, box muller transformation)
-		if (a != aa) {                        // Step 1. Preparations
-			aa = a;
-			ss = a - 0.5;
-			s = Math.sqrt(ss);
-			d = 5.656854249 - 12.0 * s;
-		}
-												  // Step 2. Normal deviate
-		do {
-			v1 = 2.0 * randomGenerator.raw() - 1.0;
-			v2 = 2.0 * randomGenerator.raw() - 1.0;
-			v12 = v1*v1 + v2*v2;
-		} while ( v12 > 1.0 );
-		t = v1*Math.sqrt(-2.0*Math.log(v12)/v12);
-		x = s + 0.5 * t;
-		gds = x * x;
-		if (t >= 0.0) return(gds/lambda);         // Immediate acceptance
+  else {        // CASE B: Acceptance complement algorithm gd (gaussian distribution, box muller transformation)
+    if (a != aa) {                        // Step 1. Preparations
+      aa = a;
+      ss = a - 0.5;
+      s = Math.sqrt(ss);
+      d = 5.656854249 - 12.0 * s;
+    }
+                          // Step 2. Normal deviate
+    do {
+      v1 = 2.0 * randomGenerator.raw() - 1.0;
+      v2 = 2.0 * randomGenerator.raw() - 1.0;
+      v12 = v1*v1 + v2*v2;
+    } while ( v12 > 1.0 );
+    t = v1*Math.sqrt(-2.0*Math.log(v12)/v12);
+    x = s + 0.5 * t;
+    gds = x * x;
+    if (t >= 0.0) return(gds/lambda);         // Immediate acceptance
 
-		u = randomGenerator.raw();                // Step 3. Uniform random number
-		if (d * u <= t * t * t) return(gds/lambda); // Squeeze acceptance
+    u = randomGenerator.raw();                // Step 3. Uniform random number
+    if (d * u <= t * t * t) return(gds/lambda); // Squeeze acceptance
 
-		if (a != aaa) {                           // Step 4. Set-up for hat case
-			aaa = a;
-			r = 1.0 / a;
-			q0 = ((((((((q9 * r + q8) * r + q7) * r + q6) * r + q5) * r + q4) *
-					  r + q3) * r + q2) * r + q1) * r;
-			if (a > 3.686) {
-				if (a > 13.022) {
-					b = 1.77;
-					si = 0.75;
-					c = 0.1515 / s;
-				}
-			    else {
-					b = 1.654 + 0.0076 * ss;
-					si = 1.68 / s + 0.275;
-					c = 0.062 / s + 0.024;
-				}
-			}
-			else {
-				b = 0.463 + s - 0.178 * ss;
-				si = 1.235;
-				c = 0.195 / s - 0.079 + 0.016 * s;
-			}
-		}
-		if (x > 0.0) {                        // Step 5. Calculation of q
-			v = t / (s + s);                  // Step 6.
-			if (Math.abs(v) > 0.25) {
-				q = q0 - s * t + 0.25 * t * t + (ss + ss) * Math.log(1.0 + v);
-			}
-			else {
-				q = q0 + 0.5 * t * t * ((((((((a9 * v + a8) * v + a7) * v + a6) *
-				    v + a5) * v + a4) * v + a3) * v + a2) * v + a1) * v;
-			}								  // Step 7. Quotient acceptance
-			if (Math.log(1.0 - u) <= q) return(gds/lambda);
-		}
+    if (a != aaa) {                           // Step 4. Set-up for hat case
+      aaa = a;
+      r = 1.0 / a;
+      q0 = ((((((((q9 * r + q8) * r + q7) * r + q6) * r + q5) * r + q4) *
+            r + q3) * r + q2) * r + q1) * r;
+      if (a > 3.686) {
+        if (a > 13.022) {
+          b = 1.77;
+          si = 0.75;
+          c = 0.1515 / s;
+        }
+          else {
+          b = 1.654 + 0.0076 * ss;
+          si = 1.68 / s + 0.275;
+          c = 0.062 / s + 0.024;
+        }
+      }
+      else {
+        b = 0.463 + s - 0.178 * ss;
+        si = 1.235;
+        c = 0.195 / s - 0.079 + 0.016 * s;
+      }
+    }
+    if (x > 0.0) {                        // Step 5. Calculation of q
+      v = t / (s + s);                  // Step 6.
+      if (Math.abs(v) > 0.25) {
+        q = q0 - s * t + 0.25 * t * t + (ss + ss) * Math.log(1.0 + v);
+      }
+      else {
+        q = q0 + 0.5 * t * t * ((((((((a9 * v + a8) * v + a7) * v + a6) *
+            v + a5) * v + a4) * v + a3) * v + a2) * v + a1) * v;
+      }                  // Step 7. Quotient acceptance
+      if (Math.log(1.0 - u) <= q) return(gds/lambda);
+    }
 
-		for(;;) {              			      // Step 8. Double exponential deviate t
-			do {
-				e = -Math.log(randomGenerator.raw());
-				u = randomGenerator.raw();
-				u = u + u - 1.0;
-				sign_u = (u > 0)? 1.0 : -1.0;
-				t = b + (e * si) * sign_u;
-			} while (t <= -0.71874483771719); // Step 9. Rejection of t
-			v = t / (s + s);                  // Step 10. New q(t)
-			if (Math.abs(v) > 0.25) {
-				q = q0 - s * t + 0.25 * t * t + (ss + ss) * Math.log(1.0 + v);
-			}
-			else {
-				q = q0 + 0.5 * t * t * ((((((((a9 * v + a8) * v + a7) * v + a6) *
-				    v + a5) * v + a4) * v + a3) * v + a2) * v + a1) * v;
-			}
-			if (q <= 0.0) continue;           // Step 11.
-			if (q > 0.5) {
-				w = Math.exp(q) - 1.0;
-			}
-			else {
-				w = ((((((e7 * q + e6) * q + e5) * q + e4) * q + e3) * q + e2) *
-					     q + e1) * q;
-			}                    			  // Step 12. Hat acceptance
-			if ( c * u * sign_u <= w * Math.exp(e - 0.5 * t * t)) {
-				x = s + 0.5 * t;
-				return(x*x/lambda);
-			}
-		}
-	}
+    for(;;) {                          // Step 8. Double exponential deviate t
+      do {
+        e = -Math.log(randomGenerator.raw());
+        u = randomGenerator.raw();
+        u = u + u - 1.0;
+        sign_u = (u > 0)? 1.0 : -1.0;
+        t = b + (e * si) * sign_u;
+      } while (t <= -0.71874483771719); // Step 9. Rejection of t
+      v = t / (s + s);                  // Step 10. New q(t)
+      if (Math.abs(v) > 0.25) {
+        q = q0 - s * t + 0.25 * t * t + (ss + ss) * Math.log(1.0 + v);
+      }
+      else {
+        q = q0 + 0.5 * t * t * ((((((((a9 * v + a8) * v + a7) * v + a6) *
+            v + a5) * v + a4) * v + a3) * v + a2) * v + a1) * v;
+      }
+      if (q <= 0.0) continue;           // Step 11.
+      if (q > 0.5) {
+        w = Math.exp(q) - 1.0;
+      }
+      else {
+        w = ((((((e7 * q + e6) * q + e5) * q + e4) * q + e3) * q + e2) *
+               q + e1) * q;
+      }                            // Step 12. Hat acceptance
+      if ( c * u * sign_u <= w * Math.exp(e - 0.5 * t * t)) {
+        x = s + 0.5 * t;
+        return(x*x/lambda);
+      }
+    }
+  }
 }
 /**
  * Returns the probability distribution function.
  */
 public double pdf(double x) {
-	if (x < 0) throw new IllegalArgumentException();
-	if (x == 0) {
-		if (alpha == 1.0) return 1.0/lambda;
-		else return 0.0;
-	}
-	if (alpha == 1.0) return Math.exp(-x/lambda)/lambda;
+  if (x < 0) throw new IllegalArgumentException();
+  if (x == 0) {
+    if (alpha == 1.0) return 1.0/lambda;
+    else return 0.0;
+  }
+  if (alpha == 1.0) return Math.exp(-x/lambda)/lambda;
 
-	return Math.exp((alpha-1.0) * Math.log(x/lambda) - x/lambda - Fun.logGamma(alpha)) / lambda;
+  return Math.exp((alpha-1.0) * Math.log(x/lambda) - x/lambda - Fun.logGamma(alpha)) / lambda;
 }
 /**
  * Sets the mean and variance.
  * @throws IllegalArgumentException if <tt>alpha &lt;= 0.0 || lambda &lt;= 0.0</tt>.
  */
 public void setState(double alpha, double lambda) {
-	if (alpha <= 0.0) throw new IllegalArgumentException();
-	if (lambda <= 0.0) throw new IllegalArgumentException();
-	this.alpha = alpha;
-	this.lambda = lambda;
+  if (alpha <= 0.0) throw new IllegalArgumentException();
+  if (lambda <= 0.0) throw new IllegalArgumentException();
+  this.alpha = alpha;
+  this.lambda = lambda;
 }
 /**
  * Returns a random number from the distribution.
  * @throws IllegalArgumentException if <tt>alpha &lt;= 0.0 || lambda &lt;= 0.0</tt>.
  */
 public static double staticNextDouble(double alpha, double lambda) {
-	synchronized (shared) {
-		return shared.nextDouble(alpha,lambda);
-	}
+  synchronized (shared) {
+    return shared.nextDouble(alpha,lambda);
+  }
 }
 /**
  * Returns a String representation of the receiver.
  */
 public String toString() {
-	return this.getClass().getName()+"("+alpha+","+lambda+")";
+  return this.getClass().getName()+"("+alpha+","+lambda+")";
 }
 /**
  * Sets the uniform random number generated shared by all <b>static</b> methods.
  * @param randomGenerator the new uniform random number generator to be shared.
  */
 private static void xstaticSetRandomGenerator(RandomEngine randomGenerator) {
-	synchronized (shared) {
-		shared.setRandomGenerator(randomGenerator);
-	}
+  synchronized (shared) {
+    shared.setRandomGenerator(randomGenerator);
+  }
 }
 }
Index: matrix/src/main/java/org/apache/mahout/jet/random/AbstractDiscreteDistribution.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/jet/random/AbstractDiscreteDistribution.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/jet/random/AbstractDiscreteDistribution.java	(working copy)
@@ -11,8 +11,6 @@
 /**
  * Abstract base class for all discrete distributions.
  *
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 09/24/99
  */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
@@ -27,7 +25,7 @@
  * Returns a random number from the distribution; returns <tt>(double) nextInt()</tt>.
  */
 public double nextDouble() {
-	return (double) nextInt();
+  return (double) nextInt();
 }
 /**
  * Returns a random number from the distribution.
Index: matrix/src/main/java/org/apache/mahout/jet/random/Exponential.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/jet/random/Exponential.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/jet/random/Exponential.java	(working copy)
@@ -20,78 +20,76 @@
  * Static methods operate on a default uniform random number generator; they are synchronized.
  * <p>
  *
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 09/24/99
  */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
  */
 @Deprecated
 public class Exponential extends AbstractContinousDistribution { 
-	protected double lambda;
+  protected double lambda;
 
- 	// The uniform random number generated shared by all <b>static</b> methods.
-	protected static Exponential shared = new Exponential(1.0,makeDefaultGenerator());
+   // The uniform random number generated shared by all <b>static</b> methods.
+  protected static Exponential shared = new Exponential(1.0,makeDefaultGenerator());
 /**
  * Constructs a Negative Exponential distribution.
  */
 public Exponential(double lambda, RandomEngine randomGenerator) {
-	setRandomGenerator(randomGenerator);
-	setState(lambda);
+  setRandomGenerator(randomGenerator);
+  setState(lambda);
 }
 /**
  * Returns the cumulative distribution function.
  */
 public double cdf(double x) {
-	if (x <= 0.0) return 0.0;
-	return 1.0 - Math.exp(-x * lambda);
+  if (x <= 0.0) return 0.0;
+  return 1.0 - Math.exp(-x * lambda);
 }
 /**
  * Returns a random number from the distribution.
  */
 public double nextDouble() {
-	return nextDouble(lambda);
+  return nextDouble(lambda);
 }
 /**
  * Returns a random number from the distribution; bypasses the internal state.
  */
 public double nextDouble(double lambda) {
-	return - Math.log(randomGenerator.raw()) / lambda;
+  return - Math.log(randomGenerator.raw()) / lambda;
 }
 /**
  * Returns the probability distribution function.
  */
 public double pdf(double x) {
-	if (x < 0.0) return 0.0;
-	return lambda*Math.exp(-x*lambda);
+  if (x < 0.0) return 0.0;
+  return lambda*Math.exp(-x*lambda);
 }
 /**
  * Sets the mean.
  */
 public void setState(double lambda) {
-	this.lambda = lambda;
+  this.lambda = lambda;
 }
 /**
  * Returns a random number from the distribution with the given lambda.
  */
 public static double staticNextDouble(double lambda) {
-	synchronized (shared) {
-		return shared.nextDouble(lambda);
-	}
+  synchronized (shared) {
+    return shared.nextDouble(lambda);
+  }
 }
 /**
  * Returns a String representation of the receiver.
  */
 public String toString() {
-	return this.getClass().getName()+"("+lambda+")";
+  return this.getClass().getName()+"("+lambda+")";
 }
 /**
  * Sets the uniform random number generated shared by all <b>static</b> methods.
  * @param randomGenerator the new uniform random number generator to be shared.
  */
 private static void xstaticSetRandomGenerator(RandomEngine randomGenerator) {
-	synchronized (shared) {
-		shared.setRandomGenerator(randomGenerator);
-	}
+  synchronized (shared) {
+    shared.setRandomGenerator(randomGenerator);
+  }
 }
 }
Index: matrix/src/main/java/org/apache/mahout/jet/random/sampling/RandomSampler.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/jet/random/sampling/RandomSampler.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/jet/random/sampling/RandomSampler.java	(working copy)
@@ -103,8 +103,6 @@
  * Paper available <A HREF="http://www.cs.duke.edu/~jsv"> here</A>.
  * 
  * @see RandomSamplingAssistant
- * @author  wolfgang.hoschek@cern.ch
- * @version 1.1 05/26/99
  */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
@@ -112,11 +110,11 @@
 @Deprecated
 public class RandomSampler extends org.apache.mahout.matrix.PersistentObject {
 //public class RandomSampler extends Object implements java.io.Serializable {
-	long my_n;
-	long my_N;
-	long my_low;
-	RandomEngine my_RandomGenerator;
-	//static long negalphainv; // just to determine once and for all the best value for negalphainv
+  long my_n;
+  long my_N;
+  long my_low;
+  RandomEngine my_RandomGenerator;
+  //static long negalphainv; // just to determine once and for all the best value for negalphainv
 /**
  * Constructs a random sampler that computes and delivers sorted random sets in blocks.
  * A set block can be retrieved with method <tt>nextBlock</tt>.
@@ -128,35 +126,35 @@
  * @param randomGenerator a random number generator. Set this parameter to <tt>null</tt> to use the default random number generator.
  */
 public RandomSampler(long n, long N, long low, RandomEngine randomGenerator) {
-	if (n<0) throw new IllegalArgumentException("n must be >= 0");
-	if (n>N) throw new IllegalArgumentException("n must by <= N");
-	this.my_n=n;
-	this.my_N=N;
-	this.my_low=low;
+  if (n<0) throw new IllegalArgumentException("n must be >= 0");
+  if (n>N) throw new IllegalArgumentException("n must by <= N");
+  this.my_n=n;
+  this.my_N=N;
+  this.my_low=low;
 
-	if (randomGenerator==null) randomGenerator = org.apache.mahout.jet.random.AbstractDistribution.makeDefaultGenerator();
-	this.my_RandomGenerator=randomGenerator;
+  if (randomGenerator==null) randomGenerator = org.apache.mahout.jet.random.AbstractDistribution.makeDefaultGenerator();
+  this.my_RandomGenerator=randomGenerator;
 }
 /**
  * Returns a deep copy of the receiver.
  */
 public Object clone() {
-	RandomSampler copy = (RandomSampler) super.clone();
-	copy.my_RandomGenerator = (RandomEngine) this.my_RandomGenerator.clone();
-	return copy;
+  RandomSampler copy = (RandomSampler) super.clone();
+  copy.my_RandomGenerator = (RandomEngine) this.my_RandomGenerator.clone();
+  return copy;
 }
 /**
  * Tests this class.
  */
 public static void main(String args[]) {
-	long n = Long.parseLong(args[0]);
-	long N = Long.parseLong(args[1]);
-	long low = Long.parseLong(args[2]);
-	int chunkSize = Integer.parseInt(args[3]);
-	int times = Integer.parseInt(args[4]);
+  long n = Long.parseLong(args[0]);
+  long N = Long.parseLong(args[1]);
+  long low = Long.parseLong(args[2]);
+  int chunkSize = Integer.parseInt(args[3]);
+  int times = Integer.parseInt(args[4]);
 
-	test(n,N,low,chunkSize,times);
-	//testNegAlphaInv(args);
+  test(n,N,low,chunkSize,times);
+  //testNegAlphaInv(args);
 }
 /**
  * Computes the next <tt>count</tt> random numbers of the sorted random set specified on instance construction
@@ -170,17 +168,17 @@
  * @param fromIndex the first index within <tt>values</tt> to be filled with numbers (inclusive).
  */
 public void nextBlock(int count, long[] values, int fromIndex) {
-	if (count > my_n) throw new IllegalArgumentException("Random sample exhausted.");
-	if (count < 0) throw new IllegalArgumentException("Negative count.");
+  if (count > my_n) throw new IllegalArgumentException("Random sample exhausted.");
+  if (count < 0) throw new IllegalArgumentException("Negative count.");
 
-	if (count==0) return; //nothing to do
+  if (count==0) return; //nothing to do
 
-	sample(my_n,my_N,count,my_low,values,fromIndex,my_RandomGenerator);
-		
-	long lastSample=values[fromIndex+count-1];
-	my_n -= count;
-	my_N = my_N - lastSample - 1 + my_low ;
-	my_low = lastSample+1;
+  sample(my_n,my_N,count,my_low,values,fromIndex,my_RandomGenerator);
+    
+  long lastSample=values[fromIndex+count-1];
+  my_n -= count;
+  my_N = my_N - lastSample - 1 + my_low ;
+  my_low = lastSample+1;
 }
 /**
  * Efficiently computes a sorted random set of <tt>count</tt> elements from the interval <tt>[low,low+N-1]</tt>.
@@ -200,96 +198,96 @@
  * @param randomGenerator a random number generator.
  */
 protected static void rejectMethodD(long n, long N, int count, long low, long[] values, int fromIndex, RandomEngine randomGenerator) {
-	/*  This algorithm is applicable if a large percentage (90%..100%) of N shall be sampled.
-		In such cases it is more efficient than sampleMethodA() and sampleMethodD().
-	    The idea is that it is more efficient to express
-		sample(n,N,count) in terms of reject(N-n,N,count)
-	 	and then invert the result.
-		For example, sampling 99% turns into sampling 1% plus inversion.
+  /*  This algorithm is applicable if a large percentage (90%..100%) of N shall be sampled.
+    In such cases it is more efficient than sampleMethodA() and sampleMethodD().
+      The idea is that it is more efficient to express
+    sample(n,N,count) in terms of reject(N-n,N,count)
+     and then invert the result.
+    For example, sampling 99% turns into sampling 1% plus inversion.
 
-		This algorithm is the same as method sampleMethodD(...) with the exception that sampled elements are rejected, and not sampled elements included in the result set.
-	*/
-	n = N-n; // IMPORTANT !!!
-	
-	double nreal, Nreal, ninv, nmin1inv, U, X, Vprime, y1, y2, top, bottom, negSreal, qu1real;
-	long qu1, t, limit;
-	//long threshold;
-	long S;
-	long chosen = -1+low;
-	
-	long negalphainv = -13;  //tuning paramter, determines when to switch from method D to method A. Dependent on programming language, platform, etc.
+    This algorithm is the same as method sampleMethodD(...) with the exception that sampled elements are rejected, and not sampled elements included in the result set.
+  */
+  n = N-n; // IMPORTANT !!!
+  
+  double nreal, Nreal, ninv, nmin1inv, U, X, Vprime, y1, y2, top, bottom, negSreal, qu1real;
+  long qu1, t, limit;
+  //long threshold;
+  long S;
+  long chosen = -1+low;
+  
+  long negalphainv = -13;  //tuning paramter, determines when to switch from method D to method A. Dependent on programming language, platform, etc.
 
-	nreal = n; ninv = 1.0/nreal; Nreal = N;
-	Vprime = Math.exp(Math.log(randomGenerator.raw())*ninv);
-	qu1 = -n + 1 + N; qu1real = -nreal + 1.0 + Nreal;
-	//threshold = -negalphainv * n;
-	
-	while (n>1 && count>0) { //&& threshold<N) {
-		nmin1inv = 1.0/(-1.0 + nreal);
-		for (;;) {
-			for (;;) { // step D2: generate U and X
-				X = Nreal * (-Vprime + 1.0); S = (long) X;
-				if (S<qu1) break;
-				Vprime = Math.exp(Math.log(randomGenerator.raw())*ninv);
-			}
-			U = randomGenerator.raw(); negSreal = -S;
-			
-			//step D3: Accept?
-			y1 = Math.exp(Math.log(U*Nreal/qu1real) * nmin1inv);
-			Vprime = y1*(-X/Nreal + 1.0) * (qu1real/(negSreal + qu1real));
-			if (Vprime <= 1.0) break; //break inner loop
+  nreal = n; ninv = 1.0/nreal; Nreal = N;
+  Vprime = Math.exp(Math.log(randomGenerator.raw())*ninv);
+  qu1 = -n + 1 + N; qu1real = -nreal + 1.0 + Nreal;
+  //threshold = -negalphainv * n;
+  
+  while (n>1 && count>0) { //&& threshold<N) {
+    nmin1inv = 1.0/(-1.0 + nreal);
+    for (;;) {
+      for (;;) { // step D2: generate U and X
+        X = Nreal * (-Vprime + 1.0); S = (long) X;
+        if (S<qu1) break;
+        Vprime = Math.exp(Math.log(randomGenerator.raw())*ninv);
+      }
+      U = randomGenerator.raw(); negSreal = -S;
+      
+      //step D3: Accept?
+      y1 = Math.exp(Math.log(U*Nreal/qu1real) * nmin1inv);
+      Vprime = y1*(-X/Nreal + 1.0) * (qu1real/(negSreal + qu1real));
+      if (Vprime <= 1.0) break; //break inner loop
 
-			//step D4: Accept?
-			y2 = 1.0; top = -1.0 + Nreal;
-			if (n-1>S) {
-				bottom = -nreal + Nreal; limit = -S+N;
-			}
-			else {
-				bottom = -1.0 + negSreal + Nreal; limit=qu1;
-			}
-			for (t=N-1; t>=limit; t--) {
-				y2 = (y2*top)/bottom;
-				top--;
-				bottom--;
-			}
-			if (Nreal/(-X+Nreal) >= y1*Math.exp(Math.log(y2)*nmin1inv)) {
-				// accept !
-				Vprime = Math.exp(Math.log(randomGenerator.raw())*nmin1inv);
-				break; //break inner loop
-			}
-			Vprime = Math.exp(Math.log(randomGenerator.raw())*ninv);
-		} //end for
+      //step D4: Accept?
+      y2 = 1.0; top = -1.0 + Nreal;
+      if (n-1>S) {
+        bottom = -nreal + Nreal; limit = -S+N;
+      }
+      else {
+        bottom = -1.0 + negSreal + Nreal; limit=qu1;
+      }
+      for (t=N-1; t>=limit; t--) {
+        y2 = (y2*top)/bottom;
+        top--;
+        bottom--;
+      }
+      if (Nreal/(-X+Nreal) >= y1*Math.exp(Math.log(y2)*nmin1inv)) {
+        // accept !
+        Vprime = Math.exp(Math.log(randomGenerator.raw())*nmin1inv);
+        break; //break inner loop
+      }
+      Vprime = Math.exp(Math.log(randomGenerator.raw())*ninv);
+    } //end for
 
-		//step D5: reject the (S+1)st record !			
-		int iter = count; //int iter = (int) (Math.min(S,count));
-		if (S<iter) iter=(int)S;
-		
-		count -= iter;
-		for (; --iter >= 0 ;) values[fromIndex++] = ++chosen;
-		chosen++;
+    //step D5: reject the (S+1)st record !      
+    int iter = count; //int iter = (int) (Math.min(S,count));
+    if (S<iter) iter=(int)S;
+    
+    count -= iter;
+    for (; --iter >= 0 ;) values[fromIndex++] = ++chosen;
+    chosen++;
 
-		N -= S+1; Nreal=negSreal+(-1.0+Nreal);
-		n--; nreal--; ninv = nmin1inv;
-		qu1 = -S+qu1; qu1real = negSreal+qu1real;
-		//threshold += negalphainv;
-	} //end while
+    N -= S+1; Nreal=negSreal+(-1.0+Nreal);
+    n--; nreal--; ninv = nmin1inv;
+    qu1 = -S+qu1; qu1real = negSreal+qu1real;
+    //threshold += negalphainv;
+  } //end while
 
 
-	if (count>0) { //special case n==1
-		//reject the (S+1)st record !
-		S = (long) (N*Vprime);
-		
-		int iter = count; //int iter = (int) (Math.min(S,count));
-		if (S<iter) iter=(int)S;
-		
-		count -= iter;
-		for (; --iter >= 0 ;) values[fromIndex++] = ++chosen;
+  if (count>0) { //special case n==1
+    //reject the (S+1)st record !
+    S = (long) (N*Vprime);
+    
+    int iter = count; //int iter = (int) (Math.min(S,count));
+    if (S<iter) iter=(int)S;
+    
+    count -= iter;
+    for (; --iter >= 0 ;) values[fromIndex++] = ++chosen;
 
-		chosen++;
+    chosen++;
 
-		// fill the rest
-		for (; --count >= 0; ) values[fromIndex++] = ++chosen;
-	}
+    // fill the rest
+    for (; --count >= 0; ) values[fromIndex++] = ++chosen;
+  }
 }
 /**
  * Efficiently computes a sorted random set of <tt>count</tt> elements from the interval <tt>[low,low+N-1]</tt>.
@@ -313,25 +311,25 @@
  * @param randomGenerator a random number generator. Set this parameter to <tt>null</tt> to use the default random number generator.
  */
 public static void sample(long n, long N, int count, long low, long[] values, int fromIndex, RandomEngine randomGenerator) {
-	if (n<=0 || count<=0) return;
-	if (count>n) throw new IllegalArgumentException("count must not be greater than n");
-	if (randomGenerator==null) randomGenerator = org.apache.mahout.jet.random.AbstractDistribution.makeDefaultGenerator();
+  if (n<=0 || count<=0) return;
+  if (count>n) throw new IllegalArgumentException("count must not be greater than n");
+  if (randomGenerator==null) randomGenerator = org.apache.mahout.jet.random.AbstractDistribution.makeDefaultGenerator();
 
-	if (count==N) { // rare case treated quickly
-		long val = low;
-		int limit= fromIndex+count;
-		for (int i=fromIndex; i<limit; ) values[i++] = val++;
-		return;
-	} 
+  if (count==N) { // rare case treated quickly
+    long val = low;
+    int limit= fromIndex+count;
+    for (int i=fromIndex; i<limit; ) values[i++] = val++;
+    return;
+  } 
 
-	if (n<N*0.95) { // || Math.min(count,N-n)>maxTmpMemoryAllowed) {
-		sampleMethodD(n,N,count,low,values,fromIndex,randomGenerator);
-	}  
-	else { // More than 95% of all numbers shall be sampled.	
-		rejectMethodD(n,N,count,low,values,fromIndex,randomGenerator);
-	}
-	
-	
+  if (n<N*0.95) { // || Math.min(count,N-n)>maxTmpMemoryAllowed) {
+    sampleMethodD(n,N,count,low,values,fromIndex,randomGenerator);
+  }  
+  else { // More than 95% of all numbers shall be sampled.  
+    rejectMethodD(n,N,count,low,values,fromIndex,randomGenerator);
+  }
+  
+  
 }
 /**
  * Computes a sorted random set of <tt>count</tt> elements from the interval <tt>[low,low+N-1]</tt>.
@@ -351,35 +349,35 @@
  * @param randomGenerator a random number generator.
  */
 protected static void sampleMethodA(long n, long N, int count, long low, long[] values, int fromIndex, RandomEngine randomGenerator) {
-	double V, quot, Nreal, top;
-	long S;
-	long chosen = -1+low;
-	
-	top = N-n;
-	Nreal = N;
-	while (n>=2 && count>0) {
-		V = randomGenerator.raw();
-		S = 0;
-		quot = top/Nreal;
-		while (quot > V) {
-			S++;
-			top--;
-			Nreal--;
-			quot = (quot*top)/Nreal;
-		}
-		chosen += S+1;
-		values[fromIndex++]=chosen;
-		count--;
-		Nreal--;
-		n--;
-	}
+  double V, quot, Nreal, top;
+  long S;
+  long chosen = -1+low;
+  
+  top = N-n;
+  Nreal = N;
+  while (n>=2 && count>0) {
+    V = randomGenerator.raw();
+    S = 0;
+    quot = top/Nreal;
+    while (quot > V) {
+      S++;
+      top--;
+      Nreal--;
+      quot = (quot*top)/Nreal;
+    }
+    chosen += S+1;
+    values[fromIndex++]=chosen;
+    count--;
+    Nreal--;
+    n--;
+  }
 
-	if (count>0) {
-		// special case n==1
-		S = (long) (Math.round(Nreal) * randomGenerator.raw());
-		chosen += S+1;
-		values[fromIndex]=chosen;
-	}
+  if (count>0) {
+    // special case n==1
+    S = (long) (Math.round(Nreal) * randomGenerator.raw());
+    chosen += S+1;
+    values[fromIndex]=chosen;
+  }
 }
 /**
  * Efficiently computes a sorted random set of <tt>count</tt> elements from the interval <tt>[low,low+N-1]</tt>.
@@ -399,162 +397,162 @@
  * @param randomGenerator a random number generator.
  */
 protected static void sampleMethodD(long n, long N, int count, long low, long[] values, int fromIndex, RandomEngine randomGenerator) {
-	double nreal, Nreal, ninv, nmin1inv, U, X, Vprime, y1, y2, top, bottom, negSreal, qu1real;
-	long qu1, threshold, t, limit;
-	long S;
-	long chosen = -1+low;
-	
-	long negalphainv = -13;  //tuning paramter, determines when to switch from method D to method A. Dependent on programming language, platform, etc.
+  double nreal, Nreal, ninv, nmin1inv, U, X, Vprime, y1, y2, top, bottom, negSreal, qu1real;
+  long qu1, threshold, t, limit;
+  long S;
+  long chosen = -1+low;
+  
+  long negalphainv = -13;  //tuning paramter, determines when to switch from method D to method A. Dependent on programming language, platform, etc.
 
-	nreal = n; ninv = 1.0/nreal; Nreal = N;
-	Vprime = Math.exp(Math.log(randomGenerator.raw())*ninv);
-	qu1 = -n + 1 + N; qu1real = -nreal + 1.0 + Nreal;
-	threshold = -negalphainv * n;
-	
-	while (n>1 && count>0 && threshold<N) {
-		nmin1inv = 1.0/(-1.0 + nreal);
-		for (;;) {
-			for (;;) { // step D2: generate U and X
-				X = Nreal * (-Vprime + 1.0); S = (long) X;
-				if (S<qu1) break;
-				Vprime = Math.exp(Math.log(randomGenerator.raw())*ninv);
-			}
-			U = randomGenerator.raw(); negSreal = -S;
-			
-			//step D3: Accept?
-			y1 = Math.exp(Math.log(U*Nreal/qu1real) * nmin1inv);
-			Vprime = y1*(-X/Nreal + 1.0) * (qu1real/(negSreal + qu1real));
-			if (Vprime <= 1.0) break; //break inner loop
+  nreal = n; ninv = 1.0/nreal; Nreal = N;
+  Vprime = Math.exp(Math.log(randomGenerator.raw())*ninv);
+  qu1 = -n + 1 + N; qu1real = -nreal + 1.0 + Nreal;
+  threshold = -negalphainv * n;
+  
+  while (n>1 && count>0 && threshold<N) {
+    nmin1inv = 1.0/(-1.0 + nreal);
+    for (;;) {
+      for (;;) { // step D2: generate U and X
+        X = Nreal * (-Vprime + 1.0); S = (long) X;
+        if (S<qu1) break;
+        Vprime = Math.exp(Math.log(randomGenerator.raw())*ninv);
+      }
+      U = randomGenerator.raw(); negSreal = -S;
+      
+      //step D3: Accept?
+      y1 = Math.exp(Math.log(U*Nreal/qu1real) * nmin1inv);
+      Vprime = y1*(-X/Nreal + 1.0) * (qu1real/(negSreal + qu1real));
+      if (Vprime <= 1.0) break; //break inner loop
 
-			//step D4: Accept?
-			y2 = 1.0; top = -1.0 + Nreal;
-			if (n-1>S) {
-				bottom = -nreal + Nreal; limit = -S+N;
-			}
-			else {
-				bottom = -1.0 + negSreal + Nreal; limit=qu1;
-			}
-			for (t=N-1; t>=limit; t--) {
-				y2 = (y2*top)/bottom;
-				top--;
-				bottom--;
-			}
-			if (Nreal/(-X+Nreal) >= y1*Math.exp(Math.log(y2)*nmin1inv)) {
-				// accept !
-				Vprime = Math.exp(Math.log(randomGenerator.raw())*nmin1inv);
-				break; //break inner loop
-			}
-			Vprime = Math.exp(Math.log(randomGenerator.raw())*ninv);
-		} //end for
+      //step D4: Accept?
+      y2 = 1.0; top = -1.0 + Nreal;
+      if (n-1>S) {
+        bottom = -nreal + Nreal; limit = -S+N;
+      }
+      else {
+        bottom = -1.0 + negSreal + Nreal; limit=qu1;
+      }
+      for (t=N-1; t>=limit; t--) {
+        y2 = (y2*top)/bottom;
+        top--;
+        bottom--;
+      }
+      if (Nreal/(-X+Nreal) >= y1*Math.exp(Math.log(y2)*nmin1inv)) {
+        // accept !
+        Vprime = Math.exp(Math.log(randomGenerator.raw())*nmin1inv);
+        break; //break inner loop
+      }
+      Vprime = Math.exp(Math.log(randomGenerator.raw())*ninv);
+    } //end for
 
-		//step D5: select the (S+1)st record !
-		chosen += S+1;
-		values[fromIndex++] = chosen;
-		/*
-		// invert
-		for (int iter=0; iter<S && count > 0; iter++) {
-			values[fromIndex++] = ++chosen;
-			count--;
-		}
-		chosen++;
-		*/
-		count--;
+    //step D5: select the (S+1)st record !
+    chosen += S+1;
+    values[fromIndex++] = chosen;
+    /*
+    // invert
+    for (int iter=0; iter<S && count > 0; iter++) {
+      values[fromIndex++] = ++chosen;
+      count--;
+    }
+    chosen++;
+    */
+    count--;
 
-		N -= S+1; Nreal=negSreal+(-1.0+Nreal);
-		n--; nreal--; ninv = nmin1inv;
-		qu1 = -S+qu1; qu1real = negSreal+qu1real;
-		threshold += negalphainv;
-	} //end while
+    N -= S+1; Nreal=negSreal+(-1.0+Nreal);
+    n--; nreal--; ninv = nmin1inv;
+    qu1 = -S+qu1; qu1real = negSreal+qu1real;
+    threshold += negalphainv;
+  } //end while
 
 
-	if (count>0) {
-		if (n>1) { //faster to use method A to finish the sampling
-			sampleMethodA(n,N,count,chosen+1,values,fromIndex,randomGenerator);
-		}
-		else {
-			//special case n==1
-			S = (long) (N*Vprime);
-			chosen += S+1;
-			values[fromIndex++] = chosen;
-		}
-	}
+  if (count>0) {
+    if (n>1) { //faster to use method A to finish the sampling
+      sampleMethodA(n,N,count,chosen+1,values,fromIndex,randomGenerator);
+    }
+    else {
+      //special case n==1
+      S = (long) (N*Vprime);
+      chosen += S+1;
+      values[fromIndex++] = chosen;
+    }
+  }
 }
 /**
  * Tests the methods of this class.
  * To do benchmarking, comment the lines printing stuff to the console.
  */
 public static void test(long n, long N, long low, int chunkSize, int times) {
-	long[] values = new long[chunkSize];
-	long chunks = n/chunkSize;
-	
-	org.apache.mahout.matrix.Timer timer = new org.apache.mahout.matrix.Timer().start();
-	for (long t=times; --t >=0;) {
-		RandomSampler sampler = new RandomSampler(n,N,low, org.apache.mahout.jet.random.AbstractDistribution.makeDefaultGenerator());
-		for (long i=0; i<chunks; i++) {
-			sampler.nextBlock(chunkSize,values,0);
+  long[] values = new long[chunkSize];
+  long chunks = n/chunkSize;
+  
+  org.apache.mahout.matrix.Timer timer = new org.apache.mahout.matrix.Timer().start();
+  for (long t=times; --t >=0;) {
+    RandomSampler sampler = new RandomSampler(n,N,low, org.apache.mahout.jet.random.AbstractDistribution.makeDefaultGenerator());
+    for (long i=0; i<chunks; i++) {
+      sampler.nextBlock(chunkSize,values,0);
 
-			/*
-			Log.print("Chunk #"+i+" = [");
-			for (int j=0; j<chunkSize-1; j++) Log.print(values[j]+", ");
-			Log.print(String.valueOf(values[chunkSize-1]));
-			Log.println("]");
-			*/
-			
-		}
-		
-		int toDo=(int) (n-chunkSize*chunks);
-		if (toDo > 0) { // sample remaining part, if necessary
-			sampler.nextBlock(toDo,values,0);	
-			
-			/*	
-			Log.print("Chunk #"+chunks+" = [");
-			for (int j=0; j<toDo-1; j++) Log.print(values[j]+", ");
-			Log.print(String.valueOf(values[toDo-1]));
-			Log.println("]");
-			*/
-			
-			
-		}
-	}
-	timer.stop();
-	System.out.println("single run took "+timer.elapsedTime()/times);
-	System.out.println("Good bye.\n");
+      /*
+      Log.print("Chunk #"+i+" = [");
+      for (int j=0; j<chunkSize-1; j++) Log.print(values[j]+", ");
+      Log.print(String.valueOf(values[chunkSize-1]));
+      Log.println("]");
+      */
+      
+    }
+    
+    int toDo=(int) (n-chunkSize*chunks);
+    if (toDo > 0) { // sample remaining part, if necessary
+      sampler.nextBlock(toDo,values,0);  
+      
+      /*  
+      Log.print("Chunk #"+chunks+" = [");
+      for (int j=0; j<toDo-1; j++) Log.print(values[j]+", ");
+      Log.print(String.valueOf(values[toDo-1]));
+      Log.println("]");
+      */
+      
+      
+    }
+  }
+  timer.stop();
+  System.out.println("single run took "+timer.elapsedTime()/times);
+  System.out.println("Good bye.\n");
 }
 /**
  * Tests different values for negaalphainv.
  * Result: J.S. Vitter's recommendation for negalphainv=-13 is also good in the JDK 1.2 environment.
  */
 protected static void testNegAlphaInv(String args[]) {
-	/*
-	long N = Long.parseLong(args[0]);
-	int chunkSize = Integer.parseInt(args[1]);
+  /*
+  long N = Long.parseLong(args[0]);
+  int chunkSize = Integer.parseInt(args[1]);
 
-	long[] alphas = {-104, -52, -26, -13, -8, -4, -2};
-	for (int i=0; i<alphas.length; i++) {
-		negalphainv = alphas[i];
-		System.out.println("\n\nnegalphainv="+negalphainv);
+  long[] alphas = {-104, -52, -26, -13, -8, -4, -2};
+  for (int i=0; i<alphas.length; i++) {
+    negalphainv = alphas[i];
+    System.out.println("\n\nnegalphainv="+negalphainv);
 
-		System.out.print(" n="+N/80+" --> ");
-		test(N/80,N,0,chunkSize);
+    System.out.print(" n="+N/80+" --> ");
+    test(N/80,N,0,chunkSize);
 
-		System.out.print(" n="+N/40+" --> ");
-		test(N/40,N,0,chunkSize);
+    System.out.print(" n="+N/40+" --> ");
+    test(N/40,N,0,chunkSize);
 
-		System.out.print(" n="+N/20+" --> ");
-		test(N/20,N,0,chunkSize);
+    System.out.print(" n="+N/20+" --> ");
+    test(N/20,N,0,chunkSize);
 
-		System.out.print(" n="+N/10+" --> ");
-		test(N/10,N,0,chunkSize);
+    System.out.print(" n="+N/10+" --> ");
+    test(N/10,N,0,chunkSize);
 
-		System.out.print(" n="+N/5+" --> ");
-		test(N/5,N,0,chunkSize);
+    System.out.print(" n="+N/5+" --> ");
+    test(N/5,N,0,chunkSize);
 
-		System.out.print(" n="+N/2+" --> ");
-		test(N/2,N,0,chunkSize);
+    System.out.print(" n="+N/2+" --> ");
+    test(N/2,N,0,chunkSize);
 
-		System.out.print(" n="+(N-3)+" --> ");
-		test(N-3,N,0,chunkSize);
-	}
-	*/
+    System.out.print(" n="+(N-3)+" --> ");
+    test(N-3,N,0,chunkSize);
+  }
+  */
 }
 }
Index: matrix/src/main/java/org/apache/mahout/jet/random/sampling/RandomSamplingAssistant.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/jet/random/sampling/RandomSamplingAssistant.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/jet/random/sampling/RandomSamplingAssistant.java	(working copy)
@@ -18,8 +18,6 @@
  * This class is a convenience adapter for <tt>RandomSampler</tt> using blocks.
  *
  * @see RandomSampler
- * @author  wolfgang.hoschek@cern.ch
- * @version 1.0, 02/05/99
  */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
@@ -27,14 +25,14 @@
 @Deprecated
 public class RandomSamplingAssistant extends org.apache.mahout.matrix.PersistentObject {
 //public class RandomSamplingAssistant extends Object implements java.io.Serializable {
-	protected RandomSampler sampler;
-	protected long[] buffer;
-	protected int bufferPosition;
+  protected RandomSampler sampler;
+  protected long[] buffer;
+  protected int bufferPosition;
 
-	protected long skip;
-	protected long n;
+  protected long skip;
+  protected long n;
 
-	static final int MAX_BUFFER_SIZE = 200;
+  static final int MAX_BUFFER_SIZE = 200;
 /**
  * Constructs a random sampler that samples <tt>n</tt> random elements from an input sequence of <tt>N</tt> elements.
  *
@@ -43,129 +41,129 @@
  * @param randomGenerator a random number generator. Set this parameter to <tt>null</tt> to use the default random number generator.
  */
 public RandomSamplingAssistant(long n, long N, RandomEngine randomGenerator) {
-	this.n = n;
-	this.sampler = new RandomSampler(n, N, 0, randomGenerator);
-	this.buffer = new long[(int)Math.min(n,MAX_BUFFER_SIZE)];
-	if (n>0) this.buffer[0] = -1; // start with the right offset
-	
-	fetchNextBlock();
+  this.n = n;
+  this.sampler = new RandomSampler(n, N, 0, randomGenerator);
+  this.buffer = new long[(int)Math.min(n,MAX_BUFFER_SIZE)];
+  if (n>0) this.buffer[0] = -1; // start with the right offset
+  
+  fetchNextBlock();
 }
 /**
  * Returns a deep copy of the receiver.
  */
 public Object clone() {
-	RandomSamplingAssistant copy = (RandomSamplingAssistant) super.clone();
-	copy.sampler = (RandomSampler) this.sampler.clone();
-	return copy;
+  RandomSamplingAssistant copy = (RandomSamplingAssistant) super.clone();
+  copy.sampler = (RandomSampler) this.sampler.clone();
+  return copy;
 }
 /**
  * Not yet commented.
  */
 protected void fetchNextBlock() {
-	if (n>0) {
-		long last = buffer[bufferPosition];
-		sampler.nextBlock((int)Math.min(n,MAX_BUFFER_SIZE), buffer, 0);
-		skip = buffer[0] - last - 1;
-		bufferPosition=0;
-	}
+  if (n>0) {
+    long last = buffer[bufferPosition];
+    sampler.nextBlock((int)Math.min(n,MAX_BUFFER_SIZE), buffer, 0);
+    skip = buffer[0] - last - 1;
+    bufferPosition=0;
+  }
 }
 /**
  * Returns the used random generator.
  */
 public RandomEngine getRandomGenerator() {
-	return this.sampler.my_RandomGenerator;
+  return this.sampler.my_RandomGenerator;
 }
 /**
  * Tests random sampling.
  */
 public static void main(String args[]) {
-	long n = Long.parseLong(args[0]);
-	long N = Long.parseLong(args[1]);
-	//test(n,N);
-	testArraySampling((int)n,(int)N);
+  long n = Long.parseLong(args[0]);
+  long N = Long.parseLong(args[1]);
+  //test(n,N);
+  testArraySampling((int)n,(int)N);
 }
 /**
  * Just shows how this class can be used; samples n elements from and int[] array.
  */
 public static int[] sampleArray(int n, int[] elements) {
-	RandomSamplingAssistant assistant = new RandomSamplingAssistant(n, elements.length, null);
-	int[] sample = new int[n];
-	int j=0;
-	int length = elements.length;
-	for (int i=0; i<length; i++) {
-		if (assistant.sampleNextElement()) sample[j++] = elements[i];
-	}
-	return sample;
+  RandomSamplingAssistant assistant = new RandomSamplingAssistant(n, elements.length, null);
+  int[] sample = new int[n];
+  int j=0;
+  int length = elements.length;
+  for (int i=0; i<length; i++) {
+    if (assistant.sampleNextElement()) sample[j++] = elements[i];
+  }
+  return sample;
 }
 /**
  * Returns whether the next element of the input sequence shall be sampled (picked) or not.
  * @return <tt>true</tt> if the next element shall be sampled (picked), <tt>false</tt> otherwise.
  */
 public boolean sampleNextElement() {
-	if (n==0) return false; //reject
-	if (skip-- > 0) return false; //reject
+  if (n==0) return false; //reject
+  if (skip-- > 0) return false; //reject
 
-	//accept
-	n--;
-	if (bufferPosition < buffer.length-1) {
-		skip = buffer[bufferPosition+1] - buffer[bufferPosition++];
-		--skip;
-	}
-	else {
-		fetchNextBlock();
-	}
-		
-	return true;
+  //accept
+  n--;
+  if (bufferPosition < buffer.length-1) {
+    skip = buffer[bufferPosition+1] - buffer[bufferPosition++];
+    --skip;
+  }
+  else {
+    fetchNextBlock();
+  }
+    
+  return true;
 }
 /**
  * Tests the methods of this class.
  * To do benchmarking, comment the lines printing stuff to the console.
  */
 public static void test(long n, long N) {
-	RandomSamplingAssistant assistant = new RandomSamplingAssistant(n,N,null);
+  RandomSamplingAssistant assistant = new RandomSamplingAssistant(n,N,null);
 
-	org.apache.mahout.matrix.list.LongArrayList sample = new org.apache.mahout.matrix.list.LongArrayList((int)n);
-	org.apache.mahout.matrix.Timer timer = new org.apache.mahout.matrix.Timer().start();
+  org.apache.mahout.matrix.list.LongArrayList sample = new org.apache.mahout.matrix.list.LongArrayList((int)n);
+  org.apache.mahout.matrix.Timer timer = new org.apache.mahout.matrix.Timer().start();
 
-	for (long i=0; i<N; i++) {
-		if (assistant.sampleNextElement()) {
-			sample.add(i);
-		}
-		
-	}
+  for (long i=0; i<N; i++) {
+    if (assistant.sampleNextElement()) {
+      sample.add(i);
+    }
+    
+  }
 
-	timer.stop().display();
-	System.out.println("sample="+sample);
-	System.out.println("Good bye.\n");
+  timer.stop().display();
+  System.out.println("sample="+sample);
+  System.out.println("Good bye.\n");
 }
 /**
  * Tests the methods of this class.
  * To do benchmarking, comment the lines printing stuff to the console.
  */
 public static void testArraySampling(int n, int N) {
-	int[] elements = new int[N];
-	for (int i=0; i<N; i++) elements[i]=i;
+  int[] elements = new int[N];
+  for (int i=0; i<N; i++) elements[i]=i;
 
-	org.apache.mahout.matrix.Timer timer = new org.apache.mahout.matrix.Timer().start();
+  org.apache.mahout.matrix.Timer timer = new org.apache.mahout.matrix.Timer().start();
 
-	int[] sample = sampleArray(n, elements);
+  int[] sample = sampleArray(n, elements);
 
-	timer.stop().display();
+  timer.stop().display();
 
-	/*
-	System.out.print("\nElements = [");
-	for (int i=0; i<N-1; i++) System.out.print(elements[i]+", ");
-	System.out.print(elements[N-1]);
-	System.out.println("]");
+  /*
+  System.out.print("\nElements = [");
+  for (int i=0; i<N-1; i++) System.out.print(elements[i]+", ");
+  System.out.print(elements[N-1]);
+  System.out.println("]");
 
 
-	System.out.print("\nSample = [");
-	for (int i=0; i<n-1; i++) System.out.print(sample[i]+", ");
-	System.out.print(sample[n-1]);
-	System.out.println("]");
-	*/
+  System.out.print("\nSample = [");
+  for (int i=0; i<n-1; i++) System.out.print(sample[i]+", ");
+  System.out.print(sample[n-1]);
+  System.out.println("]");
+  */
 
-	System.out.println("Good bye.\n");
+  System.out.println("Good bye.\n");
 }
 /**
  * Returns whether the next elements of the input sequence shall be sampled (picked) or not.
@@ -173,30 +171,30 @@
  * @param acceptList a bitvector which will be filled with <tt>true</tt> where sampling shall occur and <tt>false</tt> where it shall not occur.
  */
 private void xsampleNextElements(BooleanArrayList acceptList) {
-	// manually inlined
-	int length = acceptList.size();
-	boolean[] accept = acceptList.elements();
-	for (int i=0; i<length; i++) {
-		if (n==0) {
-			accept[i] = false;
-			continue;
-		} //reject
-		if (skip-- > 0) {
-			accept[i] = false;
-			continue;
-		} //reject
+  // manually inlined
+  int length = acceptList.size();
+  boolean[] accept = acceptList.elements();
+  for (int i=0; i<length; i++) {
+    if (n==0) {
+      accept[i] = false;
+      continue;
+    } //reject
+    if (skip-- > 0) {
+      accept[i] = false;
+      continue;
+    } //reject
 
-		//accept
-		n--;
-		if (bufferPosition < buffer.length-1) {
-			skip = buffer[bufferPosition+1] - buffer[bufferPosition++];
-			--skip;
-		}
-		else {
-			fetchNextBlock();
-		}
-			
-		accept[i] = true;
-	}
+    //accept
+    n--;
+    if (bufferPosition < buffer.length-1) {
+      skip = buffer[bufferPosition+1] - buffer[bufferPosition++];
+      --skip;
+    }
+    else {
+      fetchNextBlock();
+    }
+      
+    accept[i] = true;
+  }
 }
 }
Index: matrix/src/main/java/org/apache/mahout/jet/random/sampling/WeightedRandomSampler.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/jet/random/sampling/WeightedRandomSampler.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/jet/random/sampling/WeightedRandomSampler.java	(working copy)
@@ -19,8 +19,6 @@
  * weight == 1.0 --> all elements are picked (sampled). weight == 10.0 --> Picks one random element from successive blocks of 10 elements each. Etc.
  * The subsequence is guaranteed to be <i>stable</i>, i.e. elements never change position relative to each other.
  *
- * @author  wolfgang.hoschek@cern.ch
- * @version 1.0, 02/05/99
  */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
@@ -28,18 +26,18 @@
 @Deprecated
 public class WeightedRandomSampler extends org.apache.mahout.matrix.PersistentObject {
 //public class BlockedRandomSampler extends Object implements java.io.Serializable {
-	protected int skip;
-	protected int nextTriggerPos;
-	protected int nextSkip;
-	protected int weight;
-	protected Uniform generator;
+  protected int skip;
+  protected int nextTriggerPos;
+  protected int nextSkip;
+  protected int weight;
+  protected Uniform generator;
 
-	static final int UNDEFINED = -1;
+  static final int UNDEFINED = -1;
 /**
  * Calls <tt>BlockedRandomSampler(1,null)</tt>.
  */
 public WeightedRandomSampler() {
-	this(1,null);
+  this(1,null);
 }
 /**
  * Chooses exactly one random element from successive blocks of <tt>weight</tt> input elements each.
@@ -50,24 +48,24 @@
  * @param randomGenerator a random number generator. Set this parameter to <tt>null</tt> to use the default random number generator.
  */
 public WeightedRandomSampler(int weight, RandomEngine randomGenerator) {
-	if (randomGenerator==null) randomGenerator = org.apache.mahout.jet.random.AbstractDistribution.makeDefaultGenerator();
-	this.generator = new Uniform(randomGenerator);
-	setWeight(weight);
+  if (randomGenerator==null) randomGenerator = org.apache.mahout.jet.random.AbstractDistribution.makeDefaultGenerator();
+  this.generator = new Uniform(randomGenerator);
+  setWeight(weight);
 }
 /**
  * Returns a deep copy of the receiver.
  */
 public Object clone() {
-	WeightedRandomSampler copy = (WeightedRandomSampler) super.clone();
-	copy.generator = (Uniform) this.generator.clone();
-	return copy;
+  WeightedRandomSampler copy = (WeightedRandomSampler) super.clone();
+  copy.generator = (Uniform) this.generator.clone();
+  return copy;
 }
 /**
  * Not yet commented.
  * @param weight int
  */
 public int getWeight() {
-	return this.weight;
+  return this.weight;
 }
 /**
  * Chooses exactly one random element from successive blocks of <tt>weight</tt> input elements each.
@@ -76,53 +74,53 @@
  * @return <tt>true</tt> if the next element shall be sampled (picked), <tt>false</tt> otherwise.
  */
 public boolean sampleNextElement() {
-	if (skip>0) { //reject
-		skip--; 
-		return false;
-	}
+  if (skip>0) { //reject
+    skip--; 
+    return false;
+  }
 
-	if (nextTriggerPos == UNDEFINED) {
-		if (weight == 1) nextTriggerPos = 0; // tuned for speed
-		else nextTriggerPos = generator.nextIntFromTo(0,weight-1);
+  if (nextTriggerPos == UNDEFINED) {
+    if (weight == 1) nextTriggerPos = 0; // tuned for speed
+    else nextTriggerPos = generator.nextIntFromTo(0,weight-1);
 
-		nextSkip = weight - 1 - nextTriggerPos;
-	}
+    nextSkip = weight - 1 - nextTriggerPos;
+  }
 
-	if (nextTriggerPos>0) { //reject
-		nextTriggerPos--; 
-		return false;
-	}
+  if (nextTriggerPos>0) { //reject
+    nextTriggerPos--; 
+    return false;
+  }
 
-	//accept
-	nextTriggerPos = UNDEFINED;
-	skip = nextSkip;
+  //accept
+  nextTriggerPos = UNDEFINED;
+  skip = nextSkip;
 
-	return true;
+  return true;
 }
 /**
  * Not yet commented.
  * @param weight int
  */
 public void setWeight(int weight) {
-	if (weight<1) throw new IllegalArgumentException("bad weight");
-	this.weight = weight;
-	this.skip = 0;
-	this.nextTriggerPos = UNDEFINED;
-	this.nextSkip = 0;
+  if (weight<1) throw new IllegalArgumentException("bad weight");
+  this.weight = weight;
+  this.skip = 0;
+  this.nextTriggerPos = UNDEFINED;
+  this.nextSkip = 0;
 }
 /**
  * Not yet commented.
  */
 public static void test(int weight, int size) {
-	WeightedRandomSampler sampler = new WeightedRandomSampler();
-	sampler.setWeight(weight);
+  WeightedRandomSampler sampler = new WeightedRandomSampler();
+  sampler.setWeight(weight);
 
-	org.apache.mahout.matrix.list.IntArrayList sample = new org.apache.mahout.matrix.list.IntArrayList();
-	for (int i=0; i<size; i++) {
-		if (sampler.sampleNextElement()) sample.add(i);
-	}
+  org.apache.mahout.matrix.list.IntArrayList sample = new org.apache.mahout.matrix.list.IntArrayList();
+  for (int i=0; i<size; i++) {
+    if (sampler.sampleNextElement()) sample.add(i);
+  }
 
-	System.out.println("Sample = "+sample);
+  System.out.println("Sample = "+sample);
 }
 /**
  * Chooses exactly one random element from successive blocks of <tt>weight</tt> input elements each.
@@ -131,33 +129,33 @@
  * @param acceptList a bitvector which will be filled with <tt>true</tt> where sampling shall occur and <tt>false</tt> where it shall not occur.
  */
 private void xsampleNextElements(BooleanArrayList acceptList) {
-	// manually inlined
-	int length = acceptList.size();
-	boolean[] accept = acceptList.elements();
-	for (int i=0; i<length; i++) {
-		if (skip>0) { //reject
-			skip--;
-			accept[i] = false;
-			continue;
-		}
+  // manually inlined
+  int length = acceptList.size();
+  boolean[] accept = acceptList.elements();
+  for (int i=0; i<length; i++) {
+    if (skip>0) { //reject
+      skip--;
+      accept[i] = false;
+      continue;
+    }
 
-		if (nextTriggerPos == UNDEFINED) {
-			if (weight == 1) nextTriggerPos = 0; // tuned for speed
-			else nextTriggerPos = generator.nextIntFromTo(0,weight-1);
+    if (nextTriggerPos == UNDEFINED) {
+      if (weight == 1) nextTriggerPos = 0; // tuned for speed
+      else nextTriggerPos = generator.nextIntFromTo(0,weight-1);
 
-			nextSkip = weight - 1 - nextTriggerPos;
-		}
+      nextSkip = weight - 1 - nextTriggerPos;
+    }
 
-		if (nextTriggerPos>0) { //reject
-			nextTriggerPos--; 
-			accept[i] = false;
-			continue;
-		}
+    if (nextTriggerPos>0) { //reject
+      nextTriggerPos--; 
+      accept[i] = false;
+      continue;
+    }
 
-		//accept
-		nextTriggerPos = UNDEFINED;
-		skip = nextSkip;
-		accept[i] = true;
-	}
+    //accept
+    nextTriggerPos = UNDEFINED;
+    skip = nextSkip;
+    accept[i] = true;
+  }
 }
 }
Index: matrix/src/main/java/org/apache/mahout/jet/random/Benchmark.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/jet/random/Benchmark.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/jet/random/Benchmark.java	(working copy)
@@ -12,20 +12,18 @@
 /**
  * Benchmarks random number generation from various distributions as well as PDF and CDF lookups.
  *
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 09/24/99
  */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
  */
 @Deprecated
 public class Benchmark extends org.apache.mahout.matrix.PersistentObject {
-	protected RandomEngine randomGenerator;
+  protected RandomEngine randomGenerator;
 /**
  * Makes this class non instantiable, but still let's others inherit from it.
  */
 protected Benchmark() {
-	throw new RuntimeException("Non instantiable");
+  throw new RuntimeException("Non instantiable");
 }
 /**
  * Prints the first <tt>size</tt> random numbers generated by the distribution.
@@ -60,11 +58,11 @@
  * @param args[1] <tt>true</tt> prints each generated number, <tt>false</tt> does not print generated numbers (use this setting for benchmarking).
  */
 public static void main(String args[]) {
-	int size = Integer.parseInt(args[0]);
-	boolean print = new Boolean(args[1]).booleanValue();
-	double mean = new Double(args[2]).doubleValue();
-	String generatorName = args[3];
-	random(size,print,mean,generatorName);
+  int size = Integer.parseInt(args[0]);
+  boolean print = new Boolean(args[1]).booleanValue();
+  double mean = new Double(args[2]).doubleValue();
+  String generatorName = args[3];
+  random(size,print,mean,generatorName);
 }
 /**
  * Benchmarks all subclasses
@@ -73,172 +71,172 @@
  * @param mean the mean for distributions that require a mean.
  */
 public static void random(int size, boolean print, double mean, String generatorName) {
-	System.out.println("Generating "+size+" random numbers per distribution...\n");
+  System.out.println("Generating "+size+" random numbers per distribution...\n");
 
-	//int large = 100000000;
-	int largeVariance = 100;
-	RandomEngine gen; // = new MersenneTwister();
-	try {
-		gen = (RandomEngine) Class.forName(generatorName).newInstance();
-	} catch (Exception exc) {
-		throw new InternalError(exc.getMessage());
-	}
+  //int large = 100000000;
+  int largeVariance = 100;
+  RandomEngine gen; // = new MersenneTwister();
+  try {
+    gen = (RandomEngine) Class.forName(generatorName).newInstance();
+  } catch (Exception exc) {
+    throw new InternalError(exc.getMessage());
+  }
 
-	/*
-	randomInstance(size,print,new Zeta(10.0, 10.0,(RandomEngine)gen.clone()));
-	randomInstance(size,print,new Zeta(1.0, 1.0, (RandomEngine)gen.clone()));
-	randomInstance(size,print,new Zeta(mean, mean, (RandomEngine)gen.clone()));
-	randomInstance(size,print,new Zeta(mean, 1/mean, (RandomEngine)gen.clone()));
-	//randomInstance(size,print,new Zeta(1/mean, mean, (RandomEngine)gen.clone()));
+  /*
+  randomInstance(size,print,new Zeta(10.0, 10.0,(RandomEngine)gen.clone()));
+  randomInstance(size,print,new Zeta(1.0, 1.0, (RandomEngine)gen.clone()));
+  randomInstance(size,print,new Zeta(mean, mean, (RandomEngine)gen.clone()));
+  randomInstance(size,print,new Zeta(mean, 1/mean, (RandomEngine)gen.clone()));
+  //randomInstance(size,print,new Zeta(1/mean, mean, (RandomEngine)gen.clone()));
 */
 
-	/*
-	
-	randomInstance(size,print,new Beta(10.0, 10.0,(RandomEngine)gen.clone()));
-	randomInstance(size,print,new Beta(1.0, 1.0, (RandomEngine)gen.clone()));
-	randomInstance(size,print,new Beta(mean, mean, (RandomEngine)gen.clone()));
-	randomInstance(size,print,new Beta(mean, 1/mean, (RandomEngine)gen.clone()));
-	randomInstance(size,print,new Beta(1/mean, mean, (RandomEngine)gen.clone()));
-	
-	randomInstance(size,print,new Uniform((RandomEngine)gen.clone()));
-	*/
-	randomInstance(size,print,new Poisson(mean,(RandomEngine)gen.clone()));
-	/*
-	randomInstance(size,print,new PoissonSlow(mean,(RandomEngine)gen.clone()));
-	
-	randomInstance(size,print,new Poisson(3.0,(RandomEngine)gen.clone()));
-	randomInstance(size,print,new PoissonSlow(3.0,(RandomEngine)gen.clone()));
-	
-	randomInstance(size,print,new Binomial(1,0.5,(RandomEngine)gen.clone()));
-	randomInstance(size,print,new Binomial(5,0.3,(RandomEngine)gen.clone()));
-	randomInstance(size,print,new Binomial((int)mean,0.999999999,(RandomEngine)gen.clone()));
-	randomInstance(size,print,new Binomial((int)mean,1.0/mean,(RandomEngine)gen.clone()));
-	
-	randomInstance(size,print,new Exponential(1.0,(RandomEngine)gen.clone()));
-	randomInstance(size,print,new Exponential(3.0,(RandomEngine)gen.clone()));
-	
-	randomInstance(size,print,new Normal(0.0,1.0,(RandomEngine)gen.clone()));
-	randomInstance(size,print,new Normal(3.0,1.0,(RandomEngine)gen.clone()));
-	randomInstance(size,print,new Normal(mean,largeVariance,(RandomEngine)gen.clone()));
-	
-	randomInstance(size,print,new BreitWigner(1.0, 0.2, Double.NEGATIVE_INFINITY, (RandomEngine)gen.clone()));
-	randomInstance(size,print,new BreitWigner(1.0, 0.2, 1.0, (RandomEngine)gen.clone()));
-	
-	randomInstance(size,print,new BreitWignerMeanSquare(1.0, 0.2, Double.NEGATIVE_INFINITY, (RandomEngine)gen.clone()));	
-	randomInstance(size,print,new BreitWignerMeanSquare(1.0, 0.2, 1.0, (RandomEngine)gen.clone()));
-	
-	randomInstance(size,print,new ChiSquare(1.0,(RandomEngine)gen.clone()));
-	randomInstance(size,print,new ChiSquare(5.0,(RandomEngine)gen.clone()));
-	randomInstance(size,print,new ChiSquare(mean,(RandomEngine)gen.clone()));
-	
-	randomInstance(size,print,new Gamma(0.2,1.0,(RandomEngine)gen.clone()));
-	randomInstance(size,print,new Gamma(1.0,1.0,(RandomEngine)gen.clone()));
-	randomInstance(size,print,new Gamma(3.0,0.5,(RandomEngine)gen.clone()));
-	randomInstance(size,print,new Gamma(mean,0.5,(RandomEngine)gen.clone()));
-	randomInstance(size,print,new Gamma(mean,1.0/mean,(RandomEngine)gen.clone()));
-	randomInstance(size,print,new Gamma(mean,mean,(RandomEngine)gen.clone()));
-	
-	randomInstance(size,print,new StudentT(1.0,(RandomEngine)gen.clone()));
-	randomInstance(size,print,new StudentT(2.5,(RandomEngine)gen.clone()));
-	randomInstance(size,print,new StudentT(mean,(RandomEngine)gen.clone()));
-	randomInstance(size,print,new StudentT(1.0/mean,(RandomEngine)gen.clone()));
+  /*
+  
+  randomInstance(size,print,new Beta(10.0, 10.0,(RandomEngine)gen.clone()));
+  randomInstance(size,print,new Beta(1.0, 1.0, (RandomEngine)gen.clone()));
+  randomInstance(size,print,new Beta(mean, mean, (RandomEngine)gen.clone()));
+  randomInstance(size,print,new Beta(mean, 1/mean, (RandomEngine)gen.clone()));
+  randomInstance(size,print,new Beta(1/mean, mean, (RandomEngine)gen.clone()));
+  
+  randomInstance(size,print,new Uniform((RandomEngine)gen.clone()));
+  */
+  randomInstance(size,print,new Poisson(mean,(RandomEngine)gen.clone()));
+  /*
+  randomInstance(size,print,new PoissonSlow(mean,(RandomEngine)gen.clone()));
+  
+  randomInstance(size,print,new Poisson(3.0,(RandomEngine)gen.clone()));
+  randomInstance(size,print,new PoissonSlow(3.0,(RandomEngine)gen.clone()));
+  
+  randomInstance(size,print,new Binomial(1,0.5,(RandomEngine)gen.clone()));
+  randomInstance(size,print,new Binomial(5,0.3,(RandomEngine)gen.clone()));
+  randomInstance(size,print,new Binomial((int)mean,0.999999999,(RandomEngine)gen.clone()));
+  randomInstance(size,print,new Binomial((int)mean,1.0/mean,(RandomEngine)gen.clone()));
+  
+  randomInstance(size,print,new Exponential(1.0,(RandomEngine)gen.clone()));
+  randomInstance(size,print,new Exponential(3.0,(RandomEngine)gen.clone()));
+  
+  randomInstance(size,print,new Normal(0.0,1.0,(RandomEngine)gen.clone()));
+  randomInstance(size,print,new Normal(3.0,1.0,(RandomEngine)gen.clone()));
+  randomInstance(size,print,new Normal(mean,largeVariance,(RandomEngine)gen.clone()));
+  
+  randomInstance(size,print,new BreitWigner(1.0, 0.2, Double.NEGATIVE_INFINITY, (RandomEngine)gen.clone()));
+  randomInstance(size,print,new BreitWigner(1.0, 0.2, 1.0, (RandomEngine)gen.clone()));
+  
+  randomInstance(size,print,new BreitWignerMeanSquare(1.0, 0.2, Double.NEGATIVE_INFINITY, (RandomEngine)gen.clone()));  
+  randomInstance(size,print,new BreitWignerMeanSquare(1.0, 0.2, 1.0, (RandomEngine)gen.clone()));
+  
+  randomInstance(size,print,new ChiSquare(1.0,(RandomEngine)gen.clone()));
+  randomInstance(size,print,new ChiSquare(5.0,(RandomEngine)gen.clone()));
+  randomInstance(size,print,new ChiSquare(mean,(RandomEngine)gen.clone()));
+  
+  randomInstance(size,print,new Gamma(0.2,1.0,(RandomEngine)gen.clone()));
+  randomInstance(size,print,new Gamma(1.0,1.0,(RandomEngine)gen.clone()));
+  randomInstance(size,print,new Gamma(3.0,0.5,(RandomEngine)gen.clone()));
+  randomInstance(size,print,new Gamma(mean,0.5,(RandomEngine)gen.clone()));
+  randomInstance(size,print,new Gamma(mean,1.0/mean,(RandomEngine)gen.clone()));
+  randomInstance(size,print,new Gamma(mean,mean,(RandomEngine)gen.clone()));
+  
+  randomInstance(size,print,new StudentT(1.0,(RandomEngine)gen.clone()));
+  randomInstance(size,print,new StudentT(2.5,(RandomEngine)gen.clone()));
+  randomInstance(size,print,new StudentT(mean,(RandomEngine)gen.clone()));
+  randomInstance(size,print,new StudentT(1.0/mean,(RandomEngine)gen.clone()));
 
-	int probs = 10000;
-	double[] pdf = new double[probs];
-	for (int i=0; i<probs; i++) pdf[i]=i*i; // prepare f(x)=x^2 distrib.
-	randomInstance(size,print,new Empirical(pdf,Empirical.NO_INTERPOLATION, (RandomEngine)gen.clone()));
-	randomInstance(size,print,new Empirical(pdf,Empirical.LINEAR_INTERPOLATION, (RandomEngine)gen.clone()));
-	*/
+  int probs = 10000;
+  double[] pdf = new double[probs];
+  for (int i=0; i<probs; i++) pdf[i]=i*i; // prepare f(x)=x^2 distrib.
+  randomInstance(size,print,new Empirical(pdf,Empirical.NO_INTERPOLATION, (RandomEngine)gen.clone()));
+  randomInstance(size,print,new Empirical(pdf,Empirical.LINEAR_INTERPOLATION, (RandomEngine)gen.clone()));
+  */
 }
 /**
  * generates <size> random numbers from <dist>
  */
 public static void randomInstance(int size, boolean print, AbstractDistribution dist) {
-	System.out.print("\n"+dist+" ...");
-	org.apache.mahout.matrix.Timer timer = new org.apache.mahout.matrix.Timer().start();
+  System.out.print("\n"+dist+" ...");
+  org.apache.mahout.matrix.Timer timer = new org.apache.mahout.matrix.Timer().start();
 
-	for (int i=size; --i >= 0;) {
-		double rand = dist.nextDouble();
-		if (print) {
-			if ((size-i-1)%8 == 0) System.out.println();
-			System.out.print((float)rand+", ");
-		}
-	}
+  for (int i=size; --i >= 0;) {
+    double rand = dist.nextDouble();
+    if (print) {
+      if ((size-i-1)%8 == 0) System.out.println();
+      System.out.print((float)rand+", ");
+    }
+  }
 
-	timer.stop();
-	System.out.println("\n"+timer);
+  timer.stop();
+  System.out.println("\n"+timer);
 }
 /**
  * Prints the first <tt>size</tt> random numbers generated by the distribution.
  */
 public static void test(int size, AbstractDistribution distribution) {
-	for (int j=0, i=size; --i>=0; j++) {
-		System.out.print(" "+distribution.nextDouble());
-		if (j%8==7) System.out.println();
-	}
-	System.out.println("\n\nGood bye.\n");
+  for (int j=0, i=size; --i>=0; j++) {
+    System.out.print(" "+distribution.nextDouble());
+    if (j%8==7) System.out.println();
+  }
+  System.out.println("\n\nGood bye.\n");
 }
 /**
  * Prints the first <tt>size</tt> random numbers generated by the distribution.
  *
 public static void test2(int size, AbstractDistribution distribution) {
-	hep.aida.bin.DynamicBin1D bin = new hep.aida.bin.DynamicBin1D();
-	for (int j=0, i=size; --i>=0; j++) {
-		bin.add(distribution.nextDouble());
-	}
-	System.out.println(bin);
-	System.out.println("\n\nGood bye.\n");
+  hep.aida.bin.DynamicBin1D bin = new hep.aida.bin.DynamicBin1D();
+  for (int j=0, i=size; --i>=0; j++) {
+    bin.add(distribution.nextDouble());
+  }
+  System.out.println(bin);
+  System.out.println("\n\nGood bye.\n");
 }
 **
  * Prints the first <tt>size</tt> random numbers generated by the distribution.
  *
 public static void test2(int size, AbstractDistribution a, AbstractDistribution b) {
-	hep.aida.bin.DynamicBin1D binA = new hep.aida.bin.DynamicBin1D();
-	hep.aida.bin.DynamicBin1D binB = new hep.aida.bin.DynamicBin1D();
-	for (int j=0, i=size; --i>=0; j++) {
-		binA.add(a.nextDouble());
-		binB.add(b.nextDouble());
-	}
-	//System.out.println(binA);
-	//System.out.println(binB);
-	//System.out.println(binA.compareWith(binB));
+  hep.aida.bin.DynamicBin1D binA = new hep.aida.bin.DynamicBin1D();
+  hep.aida.bin.DynamicBin1D binB = new hep.aida.bin.DynamicBin1D();
+  for (int j=0, i=size; --i>=0; j++) {
+    binA.add(a.nextDouble());
+    binB.add(b.nextDouble());
+  }
+  //System.out.println(binA);
+  //System.out.println(binB);
+  //System.out.println(binA.compareWith(binB));
 
-	System.out.println("\n\nBenchmarking frequencies...\n");
-	IntArrayList freq = new IntArrayList();
-	DoubleArrayList distinct = new DoubleArrayList();
-	org.apache.mahout.matrix.Timer timer = new org.apache.mahout.matrix.Timer();
-	timer.reset();
-	timer.start();
-	binA.frequencies(distinct,freq);
-	timer.stop().display();
-	//System.out.println(distinct);
-	//System.out.println(freq);
+  System.out.println("\n\nBenchmarking frequencies...\n");
+  IntArrayList freq = new IntArrayList();
+  DoubleArrayList distinct = new DoubleArrayList();
+  org.apache.mahout.matrix.Timer timer = new org.apache.mahout.matrix.Timer();
+  timer.reset();
+  timer.start();
+  binA.frequencies(distinct,freq);
+  timer.stop().display();
+  //System.out.println(distinct);
+  //System.out.println(freq);
 
-	/*
-	timer.reset();
-	timer.start();
-	binA.xfrequencies2(distinct,freq);
-	timer.stop().display();
-	//System.out.println(distinct);
-	//System.out.println(freq);
-	/
-	
-	/
-	distinct.shuffle();
-	timer.reset().start();
-	distinct.sort();
-	timer.stop().display();
+  /*
+  timer.reset();
+  timer.start();
+  binA.xfrequencies2(distinct,freq);
+  timer.stop().display();
+  //System.out.println(distinct);
+  //System.out.println(freq);
+  /
+  
+  /
+  distinct.shuffle();
+  timer.reset().start();
+  distinct.sort();
+  timer.stop().display();
 
-	timer.reset().start();
-	binA.frequencies(distinct,freq);
-	timer.stop().display();
-	//System.out.println(distinct);
-	//System.out.println(freq);
-	*
+  timer.reset().start();
+  binA.frequencies(distinct,freq);
+  timer.stop().display();
+  //System.out.println(distinct);
+  //System.out.println(freq);
+  *
 
 
-	
-	System.out.println("\n\nGood bye.\n");
+  
+  System.out.println("\n\nGood bye.\n");
 }
 */
 }
Index: matrix/src/main/java/org/apache/mahout/jet/random/Binomial.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/jet/random/Binomial.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/jet/random/Binomial.java	(working copy)
@@ -26,28 +26,26 @@
  * CLHEP's implementation is, in turn, based on 
  * <p>V. Kachitvichyanukul, B.W. Schmeiser (1988): Binomial random variate generation, Communications of the ACM 31, 216-222.
  *
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 09/24/99
  */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
  */
 @Deprecated
 public class Binomial extends AbstractDiscreteDistribution {
-	protected int n;
-	protected double p;
+  protected int n;
+  protected double p;
 
-	// cache vars for method generateBinomial(...)
-	private int    n_last = -1,  n_prev = -1;
-	private double par,np,p0,q,p_last = -1.0, p_prev = -1.0;
-	private int    b,m,nm;
-	private double pq, rc, ss, xm, xl, xr, ll, lr, c, p1, p2, p3, p4, ch;
+  // cache vars for method generateBinomial(...)
+  private int    n_last = -1,  n_prev = -1;
+  private double par,np,p0,q,p_last = -1.0, p_prev = -1.0;
+  private int    b,m,nm;
+  private double pq, rc, ss, xm, xl, xr, ll, lr, c, p1, p2, p3, p4, ch;
 
-	// cache vars for method pdf(...)
-	private double log_p, log_q, log_n;
+  // cache vars for method pdf(...)
+  private double log_p, log_q, log_n;
  
- 	// The uniform random number generated shared by all <b>static</b> methods.
-	protected static Binomial shared = new Binomial(1,0.5,makeDefaultGenerator());
+   // The uniform random number generated shared by all <b>static</b> methods.
+  protected static Binomial shared = new Binomial(1,0.5,makeDefaultGenerator());
 /**
  * Constructs a binomial distribution.
  * Example: n=1, p=0.5.
@@ -57,25 +55,25 @@
  * @throws IllegalArgumentException if <tt>n*Math.min(p,1-p) &lt;= 0.0</tt>
  */
 public Binomial(int n, double p, RandomEngine randomGenerator) {
-	setRandomGenerator(randomGenerator);
-	setNandP(n,p);
+  setRandomGenerator(randomGenerator);
+  setNandP(n,p);
 }
 /**
  * Returns the cumulative distribution function.
  */
 public double cdf(int k) {
-	return Probability.binomial(k,n,p);
+  return Probability.binomial(k,n,p);
 }
 /**
  * Returns the cumulative distribution function.
  */
 private double cdfSlow(int k) {
-	if (k < 0) throw new IllegalArgumentException();
+  if (k < 0) throw new IllegalArgumentException();
 
-	double sum = 0.0;
-	for (int r = 0; r<=k; r++) sum += pdf(r);
-	
-	return sum;
+  double sum = 0.0;
+  for (int r = 0; r<=k; r++) sum += pdf(r);
+  
+  return sum;
 }
 /******************************************************************
  *                                                                *
@@ -120,143 +118,143 @@
  *                                                                *
  ******************************************************************/
 protected int generateBinomial(int n, double p) {
-	final double C1_3 = 0.33333333333333333;
-	final double C5_8 = 0.62500000000000000;
-	final double C1_6 = 0.16666666666666667;
-	final int DMAX_KM = 20;
+  final double C1_3 = 0.33333333333333333;
+  final double C5_8 = 0.62500000000000000;
+  final double C1_6 = 0.16666666666666667;
+  final int DMAX_KM = 20;
 
 
-	int     bh,i, K, Km, nK;
-	double  f, rm, U, V, X, T, E;
+  int     bh,i, K, Km, nK;
+  double  f, rm, U, V, X, T, E;
 
-	if (n != n_last || p != p_last) {                 // set-up 
-		n_last = n;
-		p_last = p;
-		par=Math.min(p,1.0-p);
-		q=1.0-par;
-		np = n*par;
+  if (n != n_last || p != p_last) {                 // set-up 
+    n_last = n;
+    p_last = p;
+    par=Math.min(p,1.0-p);
+    q=1.0-par;
+    np = n*par;
 
-		// Check for invalid input values
+    // Check for invalid input values
 
-		if( np <= 0.0 ) return -1;
+    if( np <= 0.0 ) return -1;
 
-		rm = np + par;
-		m  = (int) rm;                      		  // mode, integer 
-		if (np<10) {
-			p0=Math.exp(n*Math.log(q));               // Chop-down
-			bh=(int)(np+10.0*Math.sqrt(np*q));
-			b=Math.min(n,bh);
-		}
-		else {
-			rc = (n + 1.0) * (pq = par / q);          // recurr. relat.
-			ss = np * q;                              // variance  
-			i  = (int) (2.195*Math.sqrt(ss) - 4.6*q); // i = p1 - 0.5
-			xm = m + 0.5;
-			xl = (double) (m - i);                    // limit left
-			xr = (double) (m + i + 1L);               // limit right
-			f  = (rm - xl) / (rm - xl*par);  ll = f * (1.0 + 0.5*f);
-			f  = (xr - rm) / (xr * q);     lr = f * (1.0 + 0.5*f);
-			c  = 0.134 + 20.5/(15.3 + (double) m);    // parallelogram
-										 			  // height
-			p1 = i + 0.5;
-			p2 = p1 * (1.0 + c + c);                  // probabilities
-			p3 = p2 + c/ll;                           // of regions 1-4
-			p4 = p3 + c/lr;
-		}
-	}
+    rm = np + par;
+    m  = (int) rm;                            // mode, integer 
+    if (np<10) {
+      p0=Math.exp(n*Math.log(q));               // Chop-down
+      bh=(int)(np+10.0*Math.sqrt(np*q));
+      b=Math.min(n,bh);
+    }
+    else {
+      rc = (n + 1.0) * (pq = par / q);          // recurr. relat.
+      ss = np * q;                              // variance  
+      i  = (int) (2.195*Math.sqrt(ss) - 4.6*q); // i = p1 - 0.5
+      xm = m + 0.5;
+      xl = (double) (m - i);                    // limit left
+      xr = (double) (m + i + 1L);               // limit right
+      f  = (rm - xl) / (rm - xl*par);  ll = f * (1.0 + 0.5*f);
+      f  = (xr - rm) / (xr * q);     lr = f * (1.0 + 0.5*f);
+      c  = 0.134 + 20.5/(15.3 + (double) m);    // parallelogram
+                             // height
+      p1 = i + 0.5;
+      p2 = p1 * (1.0 + c + c);                  // probabilities
+      p3 = p2 + c/ll;                           // of regions 1-4
+      p4 = p3 + c/lr;
+    }
+  }
 
-	if (np<10) {                                      //Inversion Chop-down
-		double pk;
+  if (np<10) {                                      //Inversion Chop-down
+    double pk;
 
-		K=0;
-		pk=p0;
-		U=randomGenerator.raw();
-		while (U>pk) {
-			++K;
-			if (K>b) {
-				U=randomGenerator.raw();
-				K=0;
-				pk=p0;
-			}
-			else {
-				U-=pk;
-				pk=(double)(((n-K+1)*par*pk)/(K*q));
-			}
-		}
-		return ((p>0.5) ? (n-K):K);
-	}
+    K=0;
+    pk=p0;
+    U=randomGenerator.raw();
+    while (U>pk) {
+      ++K;
+      if (K>b) {
+        U=randomGenerator.raw();
+        K=0;
+        pk=p0;
+      }
+      else {
+        U-=pk;
+        pk=(double)(((n-K+1)*par*pk)/(K*q));
+      }
+    }
+    return ((p>0.5) ? (n-K):K);
+  }
 
-	for (;;) {
-		V = randomGenerator.raw();
-		if ((U = randomGenerator.raw() * p4) <= p1) {    // triangular region
-			K=(int) (xm - U + p1*V);
-			return (p>0.5) ? (n-K):K;  // immediate accept
-		}
-		if (U <= p2) {                               	 // parallelogram
-			X = xl + (U - p1)/c;
-			if ((V = V*c + 1.0 - Math.abs(xm - X)/p1) >= 1.0)  continue;
-			K = (int) X;
-		}
-		else if (U <= p3) {                           	 // left tail
-			if ((X = xl + Math.log(V)/ll) < 0.0)  continue;
-			K = (int) X;
-			V *= (U - p2) * ll;
-		}
-		else {                                        	 // right tail
-			if ((K = (int) (xr - Math.log(V)/lr)) > n)  continue;
-			V *= (U - p3) * lr;
-		}
+  for (;;) {
+    V = randomGenerator.raw();
+    if ((U = randomGenerator.raw() * p4) <= p1) {    // triangular region
+      K=(int) (xm - U + p1*V);
+      return (p>0.5) ? (n-K):K;  // immediate accept
+    }
+    if (U <= p2) {                                  // parallelogram
+      X = xl + (U - p1)/c;
+      if ((V = V*c + 1.0 - Math.abs(xm - X)/p1) >= 1.0)  continue;
+      K = (int) X;
+    }
+    else if (U <= p3) {                              // left tail
+      if ((X = xl + Math.log(V)/ll) < 0.0)  continue;
+      K = (int) X;
+      V *= (U - p2) * ll;
+    }
+    else {                                           // right tail
+      if ((K = (int) (xr - Math.log(V)/lr)) > n)  continue;
+      V *= (U - p3) * lr;
+    }
 
-		// acceptance test :  two cases, depending on |K - m|
-		if ((Km = Math.abs(K - m)) <= DMAX_KM || Km + Km + 2L >= ss) {
+    // acceptance test :  two cases, depending on |K - m|
+    if ((Km = Math.abs(K - m)) <= DMAX_KM || Km + Km + 2L >= ss) {
 
-			// computation of p(K) via recurrence relationship from the mode
-			f = 1.0;                              // f(m)
-			if (m < K) {
-				for (i = m; i < K; ) {
-					if ((f *= (rc / ++i - pq)) < V)  break;  // multiply  f
-				}
-			}
-			else {
-				for (i = K; i < m; ) {
-					if ((V *= (rc / ++i - pq)) > f)  break;  // multiply  V
-				}
-			}
-			if (V <= f)  break;                       		 // acceptance test
-		}
-		else {
+      // computation of p(K) via recurrence relationship from the mode
+      f = 1.0;                              // f(m)
+      if (m < K) {
+        for (i = m; i < K; ) {
+          if ((f *= (rc / ++i - pq)) < V)  break;  // multiply  f
+        }
+      }
+      else {
+        for (i = K; i < m; ) {
+          if ((V *= (rc / ++i - pq)) > f)  break;  // multiply  V
+        }
+      }
+      if (V <= f)  break;                            // acceptance test
+    }
+    else {
 
-			// lower and upper squeeze tests, based on lower bounds for log p(K)
-			V = Math.log(V);
-			T = - Km * Km / (ss + ss);
-			E =  (Km / ss) * ((Km * (Km * C1_3 + C5_8) + C1_6) / ss + 0.5);
-			if (V <= T - E)  break;
-			if (V <= T + E) {
-				if (n != n_prev || par != p_prev) {
-					n_prev = n;
-					p_prev = par;
+      // lower and upper squeeze tests, based on lower bounds for log p(K)
+      V = Math.log(V);
+      T = - Km * Km / (ss + ss);
+      E =  (Km / ss) * ((Km * (Km * C1_3 + C5_8) + C1_6) / ss + 0.5);
+      if (V <= T - E)  break;
+      if (V <= T + E) {
+        if (n != n_prev || par != p_prev) {
+          n_prev = n;
+          p_prev = par;
 
-					nm = n - m + 1;
-					ch = xm * Math.log((m + 1.0)/(pq * nm)) +
-					   Arithmetic.stirlingCorrection(m + 1) + Arithmetic.stirlingCorrection(nm);
-				}
-				nK = n - K + 1;
+          nm = n - m + 1;
+          ch = xm * Math.log((m + 1.0)/(pq * nm)) +
+             Arithmetic.stirlingCorrection(m + 1) + Arithmetic.stirlingCorrection(nm);
+        }
+        nK = n - K + 1;
 
-				// computation of log f(K) via Stirling's formula
-				// final acceptance-rejection test
-				if (V <= ch + (n + 1.0)*Math.log((double) nm / (double) nK) +
-							 (K + 0.5)*Math.log(nK * pq / (K + 1.0)) -
-							 Arithmetic.stirlingCorrection(K + 1) - Arithmetic.stirlingCorrection(nK))  break;
-			}
-		}
-	}
-	return (p>0.5) ? (n-K):K;
+        // computation of log f(K) via Stirling's formula
+        // final acceptance-rejection test
+        if (V <= ch + (n + 1.0)*Math.log((double) nm / (double) nK) +
+               (K + 0.5)*Math.log(nK * pq / (K + 1.0)) -
+               Arithmetic.stirlingCorrection(K + 1) - Arithmetic.stirlingCorrection(nK))  break;
+      }
+    }
+  }
+  return (p>0.5) ? (n-K):K;
 }
 /**
  * Returns a random number from the distribution.
  */
 public int nextInt() {
-	return generateBinomial(n,p);
+  return generateBinomial(n,p);
 }
 /**
  * Returns a random number from the distribution with the given parameters n and p; bypasses the internal state.
@@ -265,16 +263,16 @@
  * @throws IllegalArgumentException if <tt>n*Math.min(p,1-p) &lt;= 0.0</tt>
  */
 public int nextInt(int n, double p) {
-	if (n*Math.min(p,1-p) <= 0.0) throw new IllegalArgumentException();
-	return generateBinomial(n,p);
+  if (n*Math.min(p,1-p) <= 0.0) throw new IllegalArgumentException();
+  return generateBinomial(n,p);
 }
 /**
  * Returns the probability distribution function.
  */
 public double pdf(int k) {
-	if (k < 0) throw new IllegalArgumentException();
-	int r = this.n - k;
-	return Math.exp(this.log_n - Arithmetic.logFactorial(k) - Arithmetic.logFactorial(r) + this.log_p * k + this.log_q * r);
+  if (k < 0) throw new IllegalArgumentException();
+  int r = this.n - k;
+  return Math.exp(this.log_n - Arithmetic.logFactorial(k) - Arithmetic.logFactorial(r) + this.log_p * k + this.log_q * r);
 }
 /**
  * Sets the parameters number of trials and the probability of success.
@@ -283,13 +281,13 @@
  * @throws IllegalArgumentException if <tt>n*Math.min(p,1-p) &lt;= 0.0</tt>
  */
 public void setNandP(int n, double p) {
-	if (n*Math.min(p,1-p) <= 0.0) throw new IllegalArgumentException();
-	this.n = n;
-	this.p = p;
-	
-	this.log_p = Math.log(p);
-	this.log_q = Math.log(1.0-p);
-	this.log_n = Arithmetic.logFactorial(n);
+  if (n*Math.min(p,1-p) <= 0.0) throw new IllegalArgumentException();
+  this.n = n;
+  this.p = p;
+  
+  this.log_p = Math.log(p);
+  this.log_q = Math.log(1.0-p);
+  this.log_n = Arithmetic.logFactorial(n);
 }
 /**
  * Returns a random number from the distribution with the given parameters n and p.
@@ -298,23 +296,23 @@
  * @throws IllegalArgumentException if <tt>n*Math.min(p,1-p) &lt;= 0.0</tt>
  */
 public static int staticNextInt(int n, double p) {
-	synchronized (shared) {
-		return shared.nextInt(n,p);
-	}
+  synchronized (shared) {
+    return shared.nextInt(n,p);
+  }
 }
 /**
  * Returns a String representation of the receiver.
  */
 public String toString() {
-	return this.getClass().getName()+"("+n+","+p+")";
+  return this.getClass().getName()+"("+n+","+p+")";
 }
 /**
  * Sets the uniform random number generated shared by all <b>static</b> methods.
  * @param randomGenerator the new uniform random number generator to be shared.
  */
 private static void xstaticSetRandomGenerator(RandomEngine randomGenerator) {
-	synchronized (shared) {
-		shared.setRandomGenerator(randomGenerator);
-	}
+  synchronized (shared) {
+    shared.setRandomGenerator(randomGenerator);
+  }
 }
 }
Index: matrix/src/main/java/org/apache/mahout/jet/random/Logarithmic.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/jet/random/Logarithmic.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/jet/random/Logarithmic.java	(working copy)
@@ -27,33 +27,31 @@
  * <p>
  * A.W. Kemp (1981): Efficient generation of logarithmically distributed pseudo-random variables, Appl. Statist. 30, 249-253.
  *
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 09/24/99
  */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
  */
 @Deprecated
 public class Logarithmic extends AbstractContinousDistribution {
-	protected double my_p;
+  protected double my_p;
 
-	// cached vars for method nextDouble(a) (for performance only)
- 	private double t,h,a_prev = -1.0;
+  // cached vars for method nextDouble(a) (for performance only)
+   private double t,h,a_prev = -1.0;
 
- 	// The uniform random number generated shared by all <b>static</b> methods. 
-	protected static Logarithmic shared = new Logarithmic(0.5,makeDefaultGenerator());
+   // The uniform random number generated shared by all <b>static</b> methods. 
+  protected static Logarithmic shared = new Logarithmic(0.5,makeDefaultGenerator());
 /**
  * Constructs a Logarithmic distribution.
  */
 public Logarithmic(double p, RandomEngine randomGenerator) {
-	setRandomGenerator(randomGenerator);
-	setState(p);
+  setRandomGenerator(randomGenerator);
+  setState(p);
 }
 /**
  * Returns a random number from the distribution.
  */
 public double nextDouble() {
-	return nextDouble(this.my_p);
+  return nextDouble(this.my_p);
 }
 /**
  * Returns a random number from the distribution; bypasses the internal state.
@@ -92,66 +90,66 @@
  *                unsigned long integer *seed.                    *
  *                                                                *
  ******************************************************************/
-	double u,v,p,q;
-	int k;
+  double u,v,p,q;
+  int k;
 
-	if (a != a_prev) {                   // Set-up
-		a_prev = a;
-		if (a<0.97) t = -a / Math.log(1.0 - a);
-		else h=Math.log(1.0 - a);
-	}
+  if (a != a_prev) {                   // Set-up
+    a_prev = a;
+    if (a<0.97) t = -a / Math.log(1.0 - a);
+    else h=Math.log(1.0 - a);
+  }
 
-	u=randomGenerator.raw();
-	if (a<0.97) {                        // Inversion/Chop-down 
-		k = 1;
-		p = t;
-		while (u > p) {
-			//System.out.println("u="+u+", p="+p);
-			u -= p;
-			k++;
-			p *= a * (k-1.0)/(double)k;
-		}
-		return k;
-	}
+  u=randomGenerator.raw();
+  if (a<0.97) {                        // Inversion/Chop-down 
+    k = 1;
+    p = t;
+    while (u > p) {
+      //System.out.println("u="+u+", p="+p);
+      u -= p;
+      k++;
+      p *= a * (k-1.0)/(double)k;
+    }
+    return k;
+  }
 
-	if (u > a) return 1;                 // Transformation
-	u=randomGenerator.raw();
-	v = u;
-	q = 1.0 - Math.exp(v * h);
-	if ( u <= q * q) {
-		k = (int) (1 + Math.log(u) / Math.log(q));
-		return k;
-	}
-	if (u > q) return 1;
-	return 2;
+  if (u > a) return 1;                 // Transformation
+  u=randomGenerator.raw();
+  v = u;
+  q = 1.0 - Math.exp(v * h);
+  if ( u <= q * q) {
+    k = (int) (1 + Math.log(u) / Math.log(q));
+    return k;
+  }
+  if (u > q) return 1;
+  return 2;
 }
 /**
  * Sets the distribution parameter.
  */
 public void setState(double p) {
-	this.my_p = p;
+  this.my_p = p;
 }
 /**
  * Returns a random number from the distribution.
  */
 public static double staticNextDouble(double p) {
-	synchronized (shared) {
-		return shared.nextDouble(p);
-	}
+  synchronized (shared) {
+    return shared.nextDouble(p);
+  }
 }
 /**
  * Returns a String representation of the receiver.
  */
 public String toString() {
-	return this.getClass().getName()+"("+my_p+")";
+  return this.getClass().getName()+"("+my_p+")";
 }
 /**
  * Sets the uniform random number generated shared by all <b>static</b> methods.
  * @param randomGenerator the new uniform random number generator to be shared.
  */
 private static void xstaticSetRandomGenerator(RandomEngine randomGenerator) {
-	synchronized (shared) {
-		shared.setRandomGenerator(randomGenerator);
-	}
+  synchronized (shared) {
+    shared.setRandomGenerator(randomGenerator);
+  }
 }
 }
Index: matrix/src/main/java/org/apache/mahout/jet/random/Distributions.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/jet/random/Distributions.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/jet/random/Distributions.java	(working copy)
@@ -32,8 +32,6 @@
  * @see org.apache.mahout.jet.random.engine.MersenneTwister
  * @see java.util.Random
  * @see java.lang.Math
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 09/24/99
  */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
@@ -44,7 +42,7 @@
  * Makes this class non instantiable, but still let's others inherit from it.
  */
 protected Distributions() {
-	throw new RuntimeException("Non instantiable");
+  throw new RuntimeException("Non instantiable");
 }
 /**
  * Returns the probability distribution function of the discrete geometric distribution.
@@ -55,8 +53,8 @@
  * @param p the parameter of the probability distribution function.
  */
 public static double geometricPdf(int k, double p) {
-	if (k<0) throw new IllegalArgumentException();
-	return p * Math.pow(1-p,k);
+  if (k<0) throw new IllegalArgumentException();
+  return p * Math.pow(1-p,k);
 }
 /**
  * Returns a random number from the Burr II, VII, VIII, X Distributions.
@@ -89,22 +87,22 @@
  *                                                                *
  ******************************************************************/
 
-	double y;
-	y=Math.exp(Math.log(randomGenerator.raw())/r);                                /* y=u^(1/r) */
-	switch (nr) {
-		// BURR II   
-		case 2  : return(-Math.log(1/y-1)); 
+  double y;
+  y=Math.exp(Math.log(randomGenerator.raw())/r);                                /* y=u^(1/r) */
+  switch (nr) {
+    // BURR II   
+    case 2  : return(-Math.log(1/y-1)); 
 
-		// BURR VII 
-		case 7  : return(Math.log(2*y/(2-2*y))/2);
+    // BURR VII 
+    case 7  : return(Math.log(2*y/(2-2*y))/2);
 
-		// BURR VIII 
-		case 8  : return(Math.log(Math.tan(y*Math.PI/2.0)));
+    // BURR VIII 
+    case 8  : return(Math.log(Math.tan(y*Math.PI/2.0)));
 
-		// BURR X    
-		case 10 : return(Math.sqrt(-Math.log(1-y)));
-	}
-	return 0;
+    // BURR X    
+    case 10 : return(Math.sqrt(-Math.log(1-y)));
+  }
+  return 0;
 }
 /**
  * Returns a random number from the Burr III, IV, V, VI, IX, XII distributions.
@@ -137,36 +135,36 @@
  *                unsigned long integer *seed.                    *
  *                                                                *
  ******************************************************************/
-	double y,u;
-	u = randomGenerator.raw();                     // U(0/1)       
-	y = Math.exp(-Math.log(u)/r)-1.0;              // u^(-1/r) - 1 
-	switch (nr) {
-		case 3  :               // BURR III 
-			return(Math.exp(-Math.log(y)/k));      // y^(-1/k) 
+  double y,u;
+  u = randomGenerator.raw();                     // U(0/1)       
+  y = Math.exp(-Math.log(u)/r)-1.0;              // u^(-1/r) - 1 
+  switch (nr) {
+    case 3  :               // BURR III 
+      return(Math.exp(-Math.log(y)/k));      // y^(-1/k) 
 
-		case 4  :               // BURR IV  
-			y=Math.exp(k*Math.log(y))+1.0;         // y^k + 1 
-			y=k/y;
-			return(y);
+    case 4  :               // BURR IV  
+      y=Math.exp(k*Math.log(y))+1.0;         // y^k + 1 
+      y=k/y;
+      return(y);
 
-		case 5  :               // BURR V  
-			y=Math.atan(-Math.log(y/k));           // arctan[log(y/k)] 
-			return(y);
+    case 5  :               // BURR V  
+      y=Math.atan(-Math.log(y/k));           // arctan[log(y/k)] 
+      return(y);
 
-		case 6  :               // BURR VI  
-			y=-Math.log(y/k)/r;
-			y=Math.log(y+Math.sqrt(y*y +1.0));
-			return(y);
+    case 6  :               // BURR VI  
+      y=-Math.log(y/k)/r;
+      y=Math.log(y+Math.sqrt(y*y +1.0));
+      return(y);
 
-		case 9  :               // BURR IX  
-			y=1.0+2.0*u/(k*(1.0-u));
-			y=Math.exp(Math.log(y)/r)-1.0;         // y^(1/r) -1 
-			return Math.log(y);
+    case 9  :               // BURR IX  
+      y=1.0+2.0*u/(k*(1.0-u));
+      y=Math.exp(Math.log(y)/r)-1.0;         // y^(1/r) -1 
+      return Math.log(y);
 
-		case 12 :               // BURR XII 
-			return Math.exp(Math.log(y)/k);        // y^(1/k) 
-		}
-	return 0;
+    case 12 :               // BURR XII 
+      return Math.exp(Math.log(y)/k);        // y^(1/k) 
+    }
+  return 0;
 }
 /**
  * Returns a cauchy distributed random number from the standard Cauchy distribution C(0,1).  
@@ -181,19 +179,19 @@
  * @returns a number in the open unit interval <code>(0.0,1.0)</code> (excluding 0.0 and 1.0).
  */
 public static double nextCauchy(RandomEngine randomGenerator) {
-	return Math.tan(Math.PI*randomGenerator.raw());
+  return Math.tan(Math.PI*randomGenerator.raw());
 }
 /**
  * Returns an erlang distributed random number with the given variance and mean.
  */
 public static double nextErlang(double variance, double mean, RandomEngine randomGenerator) {
-	int k = (int)( (mean * mean ) / variance + 0.5 );
-	k = (k > 0) ? k : 1;
-	double a = k / mean;
+  int k = (int)( (mean * mean ) / variance + 0.5 );
+  k = (k > 0) ? k : 1;
+  double a = k / mean;
 
-	double prod = 1.0;
-	for (int i = 0; i < k; i++) prod *= randomGenerator.raw();
-	return -Math.log(prod)/a;
+  double prod = 1.0;
+  for (int i = 0; i < k; i++) prod *= randomGenerator.raw();
+  return -Math.log(prod)/a;
 }
 /**
  * Returns a discrete geometric distributed random number; <A HREF="http://www.statsoft.com/textbook/glosf.html#Geometric Distribution">Definition</A>.
@@ -232,8 +230,8 @@
  *                unsigned long integer *seed.                    *
  *                                                                *
  ******************************************************************/
-	double u = randomGenerator.raw();
-	return (int)(Math.log(u)/Math.log(1.0-p));
+  double u = randomGenerator.raw();
+  return (int)(Math.log(u)/Math.log(1.0-p));
 }
 /**
  * Returns a lambda distributed random number with parameters l3 and l4.
@@ -246,13 +244,13 @@
  * <p>
  */
 public static double nextLambda(double l3, double l4, RandomEngine randomGenerator) {
- 	double l_sign;
-	if ((l3<0) || (l4<0)) l_sign=-1.0;                          // sign(l) 
-	else l_sign=1.0;
+   double l_sign;
+  if ((l3<0) || (l4<0)) l_sign=-1.0;                          // sign(l) 
+  else l_sign=1.0;
 
-	double u = randomGenerator.raw();                           // U(0/1) 
-	double x = l_sign*(Math.exp(Math.log(u)*l3) - Math.exp(Math.log(1.0 - u)*l4));
-	return x;
+  double u = randomGenerator.raw();                           // U(0/1) 
+  double x = l_sign*(Math.exp(Math.log(u)*l3) - Math.exp(Math.log(1.0 - u)*l4));
+  return x;
 }
 /**
  * Returns a Laplace (Double Exponential) distributed random number from the standard Laplace distribution L(0,1).  
@@ -263,10 +261,10 @@
  * @returns a number in the open unit interval <code>(0.0,1.0)</code> (excluding 0.0 and 1.0).
  */
 public static double nextLaplace(RandomEngine randomGenerator) {
-	double u = randomGenerator.raw();
-	u = u+u-1.0;
-	if (u>0) return -Math.log(1.0-u);
-	else return Math.log(1.0+u);
+  double u = randomGenerator.raw();
+  u = u+u-1.0;
+  if (u>0) return -Math.log(1.0-u);
+  else return Math.log(1.0+u);
 }
 /**
  * Returns a random number from the standard Logistic distribution Log(0,1).
@@ -275,8 +273,8 @@
  * This is a port of <tt>login.c</tt> from the <A HREF="http://www.cis.tu-graz.ac.at/stat/stadl/random.html">C-RAND / WIN-RAND</A> library.
  */
 public static double nextLogistic(RandomEngine randomGenerator) {
-	double u = randomGenerator.raw();
-	return(-Math.log(1.0 / u-1.0));
+  double u = randomGenerator.raw();
+  return(-Math.log(1.0 / u-1.0));
 }
 /**
  * Returns a power-law distributed random number with the given exponent and lower cutoff.
@@ -284,7 +282,7 @@
  * @param cut the lower cutoff
  */
 public static double nextPowLaw(double alpha, double cut, RandomEngine randomGenerator) {
-	  return cut*Math.pow(randomGenerator.raw(), 1.0/(alpha+1.0) ) ;
+    return cut*Math.pow(randomGenerator.raw(), 1.0/(alpha+1.0) ) ;
 }
 /**
  * Returns a random number from the standard Triangular distribution in (-1,1).
@@ -307,10 +305,10 @@
  *                                                                *
  ******************************************************************/
 
-	double u;
-	u=randomGenerator.raw();
-	if (u<=0.5) return(Math.sqrt(2.0*u)-1.0);                      /* -1 <= x <= 0 */
-	else return(1.0-Math.sqrt(2.0*(1.0-u)));                 /*  0 <= x <= 1 */
+  double u;
+  u=randomGenerator.raw();
+  if (u<=0.5) return(Math.sqrt(2.0*u)-1.0);                      /* -1 <= x <= 0 */
+  else return(1.0-Math.sqrt(2.0*(1.0-u)));                 /*  0 <= x <= 1 */
 }
 /**
  * Returns a weibull distributed random number. 
@@ -318,9 +316,9 @@
  * See Simulation, Modelling & Analysis by Law & Kelton, pp259
  */
 public static double nextWeibull(double alpha, double beta, RandomEngine randomGenerator) {
-	// Polar method.
-	// See Simulation, Modelling & Analysis by Law & Kelton, pp259
-	return Math.pow(beta * ( - Math.log(1.0 - randomGenerator.raw()) ), 1.0 / alpha);
+  // Polar method.
+  // See Simulation, Modelling & Analysis by Law & Kelton, pp259
+  return Math.pow(beta * ( - Math.log(1.0 - randomGenerator.raw()) ), 1.0 / alpha);
 }
 /**
  * Returns a zipfian distributed random number with the given skew.
@@ -332,22 +330,22 @@
  * @param z the skew of the distribution (must be &gt;1.0).
  * @returns a zipfian distributed number in the closed interval <tt>[1,Integer.MAX_VALUE]</tt>.
  */
-public static int nextZipfInt(double z, RandomEngine randomGenerator) {	 
-	/* Algorithm from page 551 of:
-	 * Devroye, Luc (1986) `Non-uniform random variate generation',
-	 * Springer-Verlag: Berlin.   ISBN 3-540-96305-7 (also 0-387-96305-7)
-	 */
-	final double b = Math.pow(2.0,z-1.0);
-  	final double constant = -1.0/(z-1.0); 
+public static int nextZipfInt(double z, RandomEngine randomGenerator) {   
+  /* Algorithm from page 551 of:
+   * Devroye, Luc (1986) `Non-uniform random variate generation',
+   * Springer-Verlag: Berlin.   ISBN 3-540-96305-7 (also 0-387-96305-7)
+   */
+  final double b = Math.pow(2.0,z-1.0);
+    final double constant = -1.0/(z-1.0); 
 
-  	int result=0;
-	for (;;) {
-		double u = randomGenerator.raw();
-		double v = randomGenerator.raw();
-		result = (int) (Math.floor(Math.pow(u,constant))); 
-		double t = Math.pow(1.0 + 1.0/result, z-1.0);
-		if (v*result*(t-1.0)/(b-1.0) <= t/b) break; 
-	}
-	return result;
+    int result=0;
+  for (;;) {
+    double u = randomGenerator.raw();
+    double v = randomGenerator.raw();
+    result = (int) (Math.floor(Math.pow(u,constant))); 
+    double t = Math.pow(1.0 + 1.0/result, z-1.0);
+    if (v*result*(t-1.0)/(b-1.0) <= t/b) break; 
+  }
+  return result;
 }
 }
Index: matrix/src/main/java/org/apache/mahout/jet/random/ExponentialPower.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/jet/random/ExponentialPower.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/jet/random/ExponentialPower.java	(working copy)
@@ -26,106 +26,104 @@
  * L. Devroye (1986): Non-Uniform Random Variate Generation , Springer Verlag, New York.
  * <p>
  *
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 09/24/99
  */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
  */
 @Deprecated
 public class ExponentialPower extends AbstractContinousDistribution { 
-	protected double tau;
+  protected double tau;
 
-	// cached vars for method nextDouble(tau) (for performance only)
-	private double s,sm1,tau_set = -1.0;
+  // cached vars for method nextDouble(tau) (for performance only)
+  private double s,sm1,tau_set = -1.0;
 
- 	// The uniform random number generated shared by all <b>static</b> methods.
-	protected static ExponentialPower shared = new ExponentialPower(1.0,makeDefaultGenerator());
+   // The uniform random number generated shared by all <b>static</b> methods.
+  protected static ExponentialPower shared = new ExponentialPower(1.0,makeDefaultGenerator());
 /**
  * Constructs an Exponential Power distribution.
  * Example: tau=1.0.
  * @throws IllegalArgumentException if <tt>tau &lt; 1.0</tt>.
  */
 public ExponentialPower(double tau, RandomEngine randomGenerator) {
-	setRandomGenerator(randomGenerator);
-	setState(tau);
+  setRandomGenerator(randomGenerator);
+  setState(tau);
 }
 /**
  * Returns a random number from the distribution.
  */
 public double nextDouble() {
-	return nextDouble(this.tau);
+  return nextDouble(this.tau);
 }
 /**
  * Returns a random number from the distribution; bypasses the internal state.
  * @throws IllegalArgumentException if <tt>tau &lt; 1.0</tt>.
  */
 public double nextDouble(double tau) {
-	double u,u1,v,x,y;
+  double u,u1,v,x,y;
 
-	if (tau != tau_set) { // SET-UP 
-		s = 1.0/tau;
-		sm1 = 1.0 - s;
+  if (tau != tau_set) { // SET-UP 
+    s = 1.0/tau;
+    sm1 = 1.0 - s;
 
-		tau_set = tau;
-	}
+    tau_set = tau;
+  }
 
-	// GENERATOR 
-	do {
-		u = randomGenerator.raw();                             // U(0/1)      
-		u = (2.0*u) - 1.0;                                     // U(-1.0/1.0) 
-		u1 = Math.abs(u);                                      // u1=|u|     
-		v = randomGenerator.raw();                             // U(0/1) 
+  // GENERATOR 
+  do {
+    u = randomGenerator.raw();                             // U(0/1)      
+    u = (2.0*u) - 1.0;                                     // U(-1.0/1.0) 
+    u1 = Math.abs(u);                                      // u1=|u|     
+    v = randomGenerator.raw();                             // U(0/1) 
 
-		if (u1 <= sm1) { // Uniform hat-function for x <= (1-1/tau)   
-			x = u1;
-		}
-		else { // Exponential hat-function for x > (1-1/tau) 
-			y = tau*(1.0 - u1);                                // U(0/1) 
-			x = sm1 - s*Math.log(y);
-			v = v*y;
-		}
-	}
+    if (u1 <= sm1) { // Uniform hat-function for x <= (1-1/tau)   
+      x = u1;
+    }
+    else { // Exponential hat-function for x > (1-1/tau) 
+      y = tau*(1.0 - u1);                                // U(0/1) 
+      x = sm1 - s*Math.log(y);
+      v = v*y;
+    }
+  }
 
-	// Acceptance/Rejection
-	while (Math.log(v) > -Math.exp(Math.log(x)*tau));
+  // Acceptance/Rejection
+  while (Math.log(v) > -Math.exp(Math.log(x)*tau));
 
-	// Random sign 
-	if (u < 0.0) 
-		return x;
-	else
-		return -x;
+  // Random sign 
+  if (u < 0.0) 
+    return x;
+  else
+    return -x;
 }
 /**
  * Sets the distribution parameter.
  * @throws IllegalArgumentException if <tt>tau &lt; 1.0</tt>.
  */
 public void setState(double tau) {
-	if (tau<1.0) throw new IllegalArgumentException();
-	this.tau = tau;
+  if (tau<1.0) throw new IllegalArgumentException();
+  this.tau = tau;
 }
 /**
  * Returns a random number from the distribution.
  * @throws IllegalArgumentException if <tt>tau &lt; 1.0</tt>.
  */
 public static double staticNextDouble(double tau) {
-	synchronized (shared) {
-		return shared.nextDouble(tau);
-	}
+  synchronized (shared) {
+    return shared.nextDouble(tau);
+  }
 }
 /**
  * Returns a String representation of the receiver.
  */
 public String toString() {
-	return this.getClass().getName()+"("+tau+")";
+  return this.getClass().getName()+"("+tau+")";
 }
 /**
  * Sets the uniform random number generated shared by all <b>static</b> methods.
  * @param randomGenerator the new uniform random number generator to be shared.
  */
 private static void xstaticSetRandomGenerator(RandomEngine randomGenerator) {
-	synchronized (shared) {
-		shared.setRandomGenerator(randomGenerator);
-	}
+  synchronized (shared) {
+    shared.setRandomGenerator(randomGenerator);
+  }
 }
 }
Index: matrix/src/main/java/org/apache/mahout/jet/random/BreitWignerMeanSquare.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/jet/random/BreitWignerMeanSquare.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/jet/random/BreitWignerMeanSquare.java	(working copy)
@@ -18,25 +18,23 @@
  * <p>
  * <b>Implementation:</b> This is a port of <A HREF="http://wwwinfo.cern.ch/asd/lhc++/clhep/manual/RefGuide/Random/RandBreitWigner.html">RandBreitWigner</A> used in <A HREF="http://wwwinfo.cern.ch/asd/lhc++/clhep">CLHEP 1.4.0</A> (C++).
  *
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 09/24/99
  */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
  */
 @Deprecated
 public class BreitWignerMeanSquare extends BreitWigner {
-	protected Uniform uniform; // helper
-	
-	// The uniform random number generated shared by all <b>static</b> methods.
-	protected static BreitWigner shared = new BreitWignerMeanSquare(1.0,0.2,1.0,makeDefaultGenerator());
+  protected Uniform uniform; // helper
+  
+  // The uniform random number generated shared by all <b>static</b> methods.
+  protected static BreitWigner shared = new BreitWignerMeanSquare(1.0,0.2,1.0,makeDefaultGenerator());
 /**
  * Constructs a mean-squared BreitWigner distribution.
  * @param cut </tt>cut==Double.NEGATIVE_INFINITY</tt> indicates "don't cut".
  */
 public BreitWignerMeanSquare(double mean, double gamma, double cut, RandomEngine randomGenerator) {
-	super(mean,gamma,cut,randomGenerator);
-	this.uniform = new Uniform(randomGenerator);
+  super(mean,gamma,cut,randomGenerator);
+  this.uniform = new Uniform(randomGenerator);
 }
 /**
  * Returns a deep copy of the receiver; the copy will produce identical sequences.
@@ -45,48 +43,48 @@
  * @return a copy of the receiver.
  */
 public Object clone() {
-	BreitWignerMeanSquare copy = (BreitWignerMeanSquare) super.clone();
-	if (this.uniform != null) copy.uniform = new Uniform(copy.randomGenerator);
-	return copy;
+  BreitWignerMeanSquare copy = (BreitWignerMeanSquare) super.clone();
+  if (this.uniform != null) copy.uniform = new Uniform(copy.randomGenerator);
+  return copy;
 }
 /**
  * Returns a mean-squared random number from the distribution; bypasses the internal state.
  * @param cut </tt>cut==Double.NEGATIVE_INFINITY</tt> indicates "don't cut".
  */
 public double nextDouble(double mean,double gamma,double cut) {
-	if (gamma == 0.0) return mean;
-	if (cut==Double.NEGATIVE_INFINITY) { // don't cut
-		double val = Math.atan(-mean/gamma);
-		double rval = this.uniform.nextDoubleFromTo(val, Math.PI/2.0);
-		double displ = gamma*Math.tan(rval);
-		return Math.sqrt(mean*mean + mean*displ);
-	}
-	else {
-		double tmp = Math.max(0.0,mean-cut);
-		double lower = Math.atan( (tmp*tmp-mean*mean)/(mean*gamma) );
-		double upper = Math.atan( ((mean+cut)*(mean+cut)-mean*mean)/(mean*gamma) );
-		double rval = this.uniform.nextDoubleFromTo(lower, upper);
+  if (gamma == 0.0) return mean;
+  if (cut==Double.NEGATIVE_INFINITY) { // don't cut
+    double val = Math.atan(-mean/gamma);
+    double rval = this.uniform.nextDoubleFromTo(val, Math.PI/2.0);
+    double displ = gamma*Math.tan(rval);
+    return Math.sqrt(mean*mean + mean*displ);
+  }
+  else {
+    double tmp = Math.max(0.0,mean-cut);
+    double lower = Math.atan( (tmp*tmp-mean*mean)/(mean*gamma) );
+    double upper = Math.atan( ((mean+cut)*(mean+cut)-mean*mean)/(mean*gamma) );
+    double rval = this.uniform.nextDoubleFromTo(lower, upper);
 
-		double displ = gamma*Math.tan(rval);
-		return Math.sqrt(Math.max(0.0, mean*mean + mean*displ));
-	}
+    double displ = gamma*Math.tan(rval);
+    return Math.sqrt(Math.max(0.0, mean*mean + mean*displ));
+  }
 }
 /**
  * Returns a random number from the distribution.
  * @param cut </tt>cut==Double.NEGATIVE_INFINITY</tt> indicates "don't cut".
  */
 public static double staticNextDouble(double mean,double gamma,double cut) {
-	synchronized (shared) {
-		return shared.nextDouble(mean,gamma,cut);
-	}
+  synchronized (shared) {
+    return shared.nextDouble(mean,gamma,cut);
+  }
 }
 /**
  * Sets the uniform random number generated shared by all <b>static</b> methods.
  * @param randomGenerator the new uniform random number generator to be shared.
  */
 private static void xstaticSetRandomGenerator(RandomEngine randomGenerator) {
-	synchronized (shared) {
-		shared.setRandomGenerator(randomGenerator);
-	}
+  synchronized (shared) {
+    shared.setRandomGenerator(randomGenerator);
+  }
 }
 }
Index: matrix/src/main/java/org/apache/mahout/jet/random/AbstractDistribution.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/jet/random/AbstractDistribution.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/jet/random/AbstractDistribution.java	(working copy)
@@ -40,15 +40,13 @@
  * @see org.apache.mahout.jet.random.engine
  * @see org.apache.mahout.jet.random.engine.Benchmark
  * @see org.apache.mahout.jet.random.Benchmark
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 09/24/99
  */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
  */
 @Deprecated
 public abstract class AbstractDistribution extends org.apache.mahout.matrix.PersistentObject implements org.apache.mahout.matrix.function.DoubleFunction, org.apache.mahout.matrix.function.IntFunction {
-	protected RandomEngine randomGenerator;
+  protected RandomEngine randomGenerator;
 /**
  * Makes this class non instantiable, but still let's others inherit from it.
  */
@@ -58,14 +56,14 @@
 This has the effect that distributions can now be used as function objects, returning a random number upon function evaluation.
 */
 public double apply(double dummy) {
-	return nextDouble();
+  return nextDouble();
 }
 /**
 Equivalent to <tt>nextInt()</tt>.
 This has the effect that distributions can now be used as function objects, returning a random number upon function evaluation.
 */
 public int apply(int dummy) {
-	return nextInt();
+  return nextInt();
 }
 /**
  * Returns a deep copy of the receiver; the copy will produce identical sequences.
@@ -74,22 +72,22 @@
  * @return a copy of the receiver.
  */
 public Object clone() {
-	AbstractDistribution copy = (AbstractDistribution) super.clone();
-	if (this.randomGenerator != null) copy.randomGenerator = (RandomEngine) this.randomGenerator.clone();
-	return copy;
+  AbstractDistribution copy = (AbstractDistribution) super.clone();
+  if (this.randomGenerator != null) copy.randomGenerator = (RandomEngine) this.randomGenerator.clone();
+  return copy;
 }
 /**
  * Returns the used uniform random number generator;
  */
 protected RandomEngine getRandomGenerator() {
-	return randomGenerator;
+  return randomGenerator;
 }
 /**
  * Constructs and returns a new uniform random number generation engine seeded with the current time.
  * Currently this is {@link org.apache.mahout.jet.random.engine.MersenneTwister}.
  */
 public static RandomEngine makeDefaultGenerator() {
-	return org.apache.mahout.jet.random.engine.RandomEngine.makeDefault();
+  return org.apache.mahout.jet.random.engine.RandomEngine.makeDefault();
 }
 /**
  * Returns a random number from the distribution.
@@ -100,12 +98,12 @@
  * Override this method if necessary.
  */
 public int nextInt() {
-	return (int) Math.round(nextDouble());
+  return (int) Math.round(nextDouble());
 }
 /**
  * Sets the uniform random generator internally used.
  */
 protected void setRandomGenerator(RandomEngine randomGenerator) {
-	this.randomGenerator = randomGenerator;
+  this.randomGenerator = randomGenerator;
 }
 }
Index: matrix/src/main/java/org/apache/mahout/jet/random/Zeta.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/jet/random/Zeta.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/jet/random/Zeta.java	(working copy)
@@ -30,29 +30,27 @@
  * <p>
  * J. Dagpunar (1988): Principles of Random Variate  Generation, Clarendon Press, Oxford.   
  *
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 09/24/99
  */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
  */
 @Deprecated
 public class Zeta extends AbstractDiscreteDistribution {
-	protected double ro;
-	protected double pk;
+  protected double ro;
+  protected double pk;
 
-	// cached values (for performance)
-	protected double c,d,ro_prev = -1.0,pk_prev = -1.0;
-	protected double maxlongint = Long.MAX_VALUE - 1.5;
+  // cached values (for performance)
+  protected double c,d,ro_prev = -1.0,pk_prev = -1.0;
+  protected double maxlongint = Long.MAX_VALUE - 1.5;
 
-	// The uniform random number generated shared by all <b>static</b> methods. 
-	protected static Zeta shared = new Zeta(1.0,1.0,makeDefaultGenerator());
+  // The uniform random number generated shared by all <b>static</b> methods. 
+  protected static Zeta shared = new Zeta(1.0,1.0,makeDefaultGenerator());
 /**
  * Constructs a Zeta distribution.
  */
 public Zeta(double ro, double pk, RandomEngine randomGenerator) {
-	setRandomGenerator(randomGenerator);
-	setState(ro,pk);
+  setRandomGenerator(randomGenerator);
+  setState(ro,pk);
 }
 /**
  * Returns a zeta distributed random number.
@@ -96,69 +94,69 @@
  *                Variate  Generation, Clarendon Press, Oxford.   *
  *                                                                *
  ******************************************************************/
-	double u,v,e,x;
-	long k;
+  double u,v,e,x;
+  long k;
 
-	if (ro != ro_prev || pk != pk_prev) {                   // Set-up 
-		ro_prev = ro;
-		pk_prev = pk;
-		if (ro<pk) {
-			c = pk-0.5;
-			d = 0;
-		}
-		else {
-			c = ro-0.5;
-			d = (1.0+ro)*Math.log((1.0+pk)/(1.0+ro));
-		}
-	}
-	do {
-		do {
-			u=randomGenerator.raw();
-			v=randomGenerator.raw();
-			x = (c+0.5)*Math.exp(-Math.log(u)/ro) - c;
-		} while (x<=0.5 || x>=maxlongint);
-		
-		k = (int) (x+0.5);
-		e = -Math.log(v);
-	} while ( e < (1.0+ro)*Math.log((k+pk)/(x+c)) - d );
-	
-	return k;
+  if (ro != ro_prev || pk != pk_prev) {                   // Set-up 
+    ro_prev = ro;
+    pk_prev = pk;
+    if (ro<pk) {
+      c = pk-0.5;
+      d = 0;
+    }
+    else {
+      c = ro-0.5;
+      d = (1.0+ro)*Math.log((1.0+pk)/(1.0+ro));
+    }
+  }
+  do {
+    do {
+      u=randomGenerator.raw();
+      v=randomGenerator.raw();
+      x = (c+0.5)*Math.exp(-Math.log(u)/ro) - c;
+    } while (x<=0.5 || x>=maxlongint);
+    
+    k = (int) (x+0.5);
+    e = -Math.log(v);
+  } while ( e < (1.0+ro)*Math.log((k+pk)/(x+c)) - d );
+  
+  return k;
 }
 /**
  * Returns a random number from the distribution.
  */
 public int nextInt() {
-	return (int) generateZeta(ro, pk, randomGenerator); 
+  return (int) generateZeta(ro, pk, randomGenerator); 
 }
 /**
  * Sets the parameters.
  */
 public void setState(double ro, double pk) {
-	this.ro = ro;
-	this.pk = pk;
+  this.ro = ro;
+  this.pk = pk;
 }
 /**
  * Returns a random number from the distribution.
  */
 public static int staticNextInt(double ro, double pk) {
-	synchronized (shared) {
-		shared.setState(ro,pk);
-		return shared.nextInt();
-	}
+  synchronized (shared) {
+    shared.setState(ro,pk);
+    return shared.nextInt();
+  }
 }
 /**
  * Returns a String representation of the receiver.
  */
 public String toString() {
-	return this.getClass().getName()+"("+ro+","+pk+")";
+  return this.getClass().getName()+"("+ro+","+pk+")";
 }
 /**
  * Sets the uniform random number generated shared by all <b>static</b> methods.
  * @param randomGenerator the new uniform random number generator to be shared.
  */
 private static void xstaticSetRandomGenerator(RandomEngine randomGenerator) {
-	synchronized (shared) {
-		shared.setRandomGenerator(randomGenerator);
-	}
+  synchronized (shared) {
+    shared.setRandomGenerator(randomGenerator);
+  }
 }
 }
Index: matrix/src/main/java/org/apache/mahout/jet/random/Empirical.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/jet/random/Empirical.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/jet/random/Empirical.java	(working copy)
@@ -30,19 +30,17 @@
  * <p>
  * This is a port of <A HREF="http://wwwinfo.cern.ch/asd/lhc++/clhep/manual/RefGuide/Random/RandGeneral.html">RandGeneral</A> used in <A HREF="http://wwwinfo.cern.ch/asd/lhc++/clhep">CLHEP 1.4.0</A> (C++).
  *
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 09/24/99
  */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
  */
 @Deprecated
 public class Empirical extends AbstractContinousDistribution {
-	protected double[] cdf; // cumulative distribution function
-	protected int interpolationType;
-	
-	public static final int LINEAR_INTERPOLATION = 0;
-	public static final int NO_INTERPOLATION = 1;
+  protected double[] cdf; // cumulative distribution function
+  protected int interpolationType;
+  
+  public static final int LINEAR_INTERPOLATION = 0;
+  public static final int NO_INTERPOLATION = 1;
 /**
  * Constructs an Empirical distribution.
  * The probability distribution function (pdf) is an array of positive real numbers. 
@@ -58,16 +56,16 @@
  * @throws IllegalArgumentException if at least one of the three conditions above is violated.
  */
 public Empirical(double[] pdf, int interpolationType, RandomEngine randomGenerator) {
-	setRandomGenerator(randomGenerator);
-	setState(pdf, interpolationType);	
+  setRandomGenerator(randomGenerator);
+  setState(pdf, interpolationType);  
 }
 /**
  * Returns the cumulative distribution function.
  */
 public double cdf(int k) {
-	if (k < 0) return 0.0;
-	if (k >= cdf.length-1) return 1.0;
-	return cdf[k];
+  if (k < 0) return 0.0;
+  if (k >= cdf.length-1) return 1.0;
+  return cdf[k];
 }
 /**
  * Returns a deep copy of the receiver; the copy will produce identical sequences.
@@ -76,64 +74,64 @@
  * @return a copy of the receiver.
  */
 public Object clone() {
-	Empirical copy = (Empirical) super.clone();
-	if (this.cdf != null) copy.cdf = (double[]) this.cdf.clone();
-	return copy;
+  Empirical copy = (Empirical) super.clone();
+  if (this.cdf != null) copy.cdf = (double[]) this.cdf.clone();
+  return copy;
 }
 /**
  * Returns a random number from the distribution.
  */
 public double nextDouble() {
-	double rand = randomGenerator.raw();
-	if (this.cdf==null) return rand; // Non-existing pdf
+  double rand = randomGenerator.raw();
+  if (this.cdf==null) return rand; // Non-existing pdf
 
-	// binary search in cumulative distribution function:
-	int nBins = cdf.length-1;
-	int nbelow = 0;     // largest k such that I[k] is known to be <= rand
-	int nabove = nBins; // largest k such that I[k] is known to be >  rand
+  // binary search in cumulative distribution function:
+  int nBins = cdf.length-1;
+  int nbelow = 0;     // largest k such that I[k] is known to be <= rand
+  int nabove = nBins; // largest k such that I[k] is known to be >  rand
  
-	while (nabove > nbelow+1) {
-		int middle = (nabove + nbelow + 1) >> 1; // div 2
-		if (rand >= cdf[middle]) nbelow = middle;
-		else nabove = middle;
-	}
-	// after this binary search, nabove is always nbelow+1 and they straddle rand:
+  while (nabove > nbelow+1) {
+    int middle = (nabove + nbelow + 1) >> 1; // div 2
+    if (rand >= cdf[middle]) nbelow = middle;
+    else nabove = middle;
+  }
+  // after this binary search, nabove is always nbelow+1 and they straddle rand:
 
-	if (this.interpolationType == NO_INTERPOLATION) {
-		return ((double)nbelow) / nBins;
-	} 
-	else if (this.interpolationType == LINEAR_INTERPOLATION) {
-		double binMeasure = cdf[nabove] - cdf[nbelow];
-		// binMeasure is always aProbFunc[nbelow], 
-		// but we don't have aProbFunc any more so we subtract.
+  if (this.interpolationType == NO_INTERPOLATION) {
+    return ((double)nbelow) / nBins;
+  } 
+  else if (this.interpolationType == LINEAR_INTERPOLATION) {
+    double binMeasure = cdf[nabove] - cdf[nbelow];
+    // binMeasure is always aProbFunc[nbelow], 
+    // but we don't have aProbFunc any more so we subtract.
 
-		if ( binMeasure == 0.0 ) { 
-			// rand lies right in a bin of measure 0.  Simply return the center
-			// of the range of that bin.  (Any value between k/N and (k+1)/N is
-			// equally good, in this rare case.)
-			return (nbelow + 0.5) / nBins;
-		}
+    if ( binMeasure == 0.0 ) { 
+      // rand lies right in a bin of measure 0.  Simply return the center
+      // of the range of that bin.  (Any value between k/N and (k+1)/N is
+      // equally good, in this rare case.)
+      return (nbelow + 0.5) / nBins;
+    }
 
-		double binFraction = (rand - cdf[nbelow]) / binMeasure;
-		return (nbelow + binFraction) / nBins;
-	}
-	else throw new InternalError(); // illegal interpolation type
+    double binFraction = (rand - cdf[nbelow]) / binMeasure;
+    return (nbelow + binFraction) / nBins;
+  }
+  else throw new InternalError(); // illegal interpolation type
 }
 /**
  * Returns the probability distribution function.
  */
 public double pdf(double x) {
-	throw new RuntimeException("not implemented");
-	//if (x < 0 || x > cdf.length-2) return 0.0;
-	//int k = (int) x;
-	//return cdf[k-1] - cdf[k];
+  throw new RuntimeException("not implemented");
+  //if (x < 0 || x > cdf.length-2) return 0.0;
+  //int k = (int) x;
+  //return cdf[k-1] - cdf[k];
 }
 /**
  * Returns the probability distribution function.
  */
 public double pdf(int k) {
-	if (k < 0 || k >= cdf.length-1) return 0.0;
-	return cdf[k-1] - cdf[k];
+  if (k < 0 || k >= cdf.length-1) return 0.0;
+  return cdf[k-1] - cdf[k];
 }
 /**
  * Sets the distribution parameters.
@@ -147,48 +145,48 @@
  * @throws IllegalArgumentException if at least one of the three conditions above is violated.
  */
 public void setState(double[] pdf, int interpolationType) {
-	if (interpolationType != LINEAR_INTERPOLATION &&
-		interpolationType != NO_INTERPOLATION) {
-		throw new IllegalArgumentException("Illegal Interpolation Type");
-	}
-	this.interpolationType = interpolationType;
-	
-	if (pdf==null || pdf.length==0) {
-		this.cdf = null;
-		//throw new IllegalArgumentException("Non-existing pdf");
-		return;
-	}
+  if (interpolationType != LINEAR_INTERPOLATION &&
+    interpolationType != NO_INTERPOLATION) {
+    throw new IllegalArgumentException("Illegal Interpolation Type");
+  }
+  this.interpolationType = interpolationType;
+  
+  if (pdf==null || pdf.length==0) {
+    this.cdf = null;
+    //throw new IllegalArgumentException("Non-existing pdf");
+    return;
+  }
 
-	// compute cumulative distribution function (cdf) from probability distribution function (pdf)
-	int nBins = pdf.length;
-	this.cdf = new double[nBins+1];
-	
-	cdf[0] = 0;
-	for (int ptn = 0; ptn<nBins; ++ptn ) {
-		double prob = pdf[ptn];
-		if (prob < 0.0) throw new IllegalArgumentException("Negative probability");
-		cdf[ptn+1] = cdf[ptn] + prob;
-	}
-	if (cdf[nBins] <=0.0) throw new IllegalArgumentException("At leat one probability must be > 0.0");
-	for (int ptn = 0; ptn < nBins+1; ++ptn ) {
-		cdf[ptn] /= cdf[nBins];
-	}
-	// cdf is now cached...
+  // compute cumulative distribution function (cdf) from probability distribution function (pdf)
+  int nBins = pdf.length;
+  this.cdf = new double[nBins+1];
+  
+  cdf[0] = 0;
+  for (int ptn = 0; ptn<nBins; ++ptn ) {
+    double prob = pdf[ptn];
+    if (prob < 0.0) throw new IllegalArgumentException("Negative probability");
+    cdf[ptn+1] = cdf[ptn] + prob;
+  }
+  if (cdf[nBins] <=0.0) throw new IllegalArgumentException("At leat one probability must be > 0.0");
+  for (int ptn = 0; ptn < nBins+1; ++ptn ) {
+    cdf[ptn] /= cdf[nBins];
+  }
+  // cdf is now cached...
 }
 /**
  * Returns a String representation of the receiver.
  */
 public String toString() {
-	String interpolation = null;
-	if (interpolationType==NO_INTERPOLATION) interpolation = "NO_INTERPOLATION";
-	if (interpolationType==LINEAR_INTERPOLATION) interpolation = "LINEAR_INTERPOLATION";
-	return this.getClass().getName()+"("+ ((cdf!=null) ? cdf.length : 0) +","+interpolation+")";
+  String interpolation = null;
+  if (interpolationType==NO_INTERPOLATION) interpolation = "NO_INTERPOLATION";
+  if (interpolationType==LINEAR_INTERPOLATION) interpolation = "LINEAR_INTERPOLATION";
+  return this.getClass().getName()+"("+ ((cdf!=null) ? cdf.length : 0) +","+interpolation+")";
 }
 /**
  * Not yet commented.
  * @return int
  */
 private int xnBins() {
-	return cdf.length-1;
+  return cdf.length-1;
 }
 }
Index: matrix/src/main/java/org/apache/mahout/jet/random/AbstractContinousDistribution.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/jet/random/AbstractContinousDistribution.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/jet/random/AbstractContinousDistribution.java	(working copy)
@@ -11,8 +11,6 @@
 /**
  * Abstract base class for all continous distributions.
  *
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 09/24/99
  */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
Index: matrix/src/main/java/org/apache/mahout/jet/random/Stack.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/jet/random/Stack.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/jet/random/Stack.java	(working copy)
@@ -12,76 +12,76 @@
  * Not yet commented.
  */
 class Stack {
-	int N;                      /* max number of elts on stack */
-	int[]v;                     /* array of values on the stack */
-	int i;                      /* index of top of stack */
+  int N;                      /* max number of elts on stack */
+  int[]v;                     /* array of values on the stack */
+  int i;                      /* index of top of stack */
 /**
  * Constructs a new stack with the given capacity.
  */
 public Stack(int capacity) {
-	this.N = capacity;
-	this.i = -1; // indicates stack is empty
-	this.v = new int[N];
+  this.N = capacity;
+  this.i = -1; // indicates stack is empty
+  this.v = new int[N];
 /*
 static stack_t *
 new_stack(int N) {
-	stack_t *s;
-	s = (stack_t *)malloc(sizeof(stack_t));
-	s->N = N;
-	s->i = -1;                  // indicates stack is empty 
-	s->v = (int *)malloc(sizeof(int)*N);
-	return s;
+  stack_t *s;
+  s = (stack_t *)malloc(sizeof(stack_t));
+  s->N = N;
+  s->i = -1;                  // indicates stack is empty 
+  s->v = (int *)malloc(sizeof(int)*N);
+  return s;
 }
 static void
 push_stack(stack_t *s, int v)
 {
-	s->i += 1;
-	if ((s->i) >= (s->N)) {
-		fprintf(stderr,"Cannot push stack!\n");
-		exit(0);                // fatal!! 
-	}
-	(s->v)[s->i] = v;
+  s->i += 1;
+  if ((s->i) >= (s->N)) {
+    fprintf(stderr,"Cannot push stack!\n");
+    exit(0);                // fatal!! 
+  }
+  (s->v)[s->i] = v;
 }
 static int pop_stack(stack_t *s)
 {
-	if ((s->i) < 0) {
-		fprintf(stderr,"Cannot pop stack!\n");
-		exit(0);
-	}
-	s->i -= 1;
-	return ((s->v)[s->i + 1]);
+  if ((s->i) < 0) {
+    fprintf(stderr,"Cannot pop stack!\n");
+    exit(0);
+  }
+  s->i -= 1;
+  return ((s->v)[s->i + 1]);
 }
 static inline int size_stack(const stack_t *s)
 {
-	return s->i + 1;
+  return s->i + 1;
 }
 static void free_stack(stack_t *s)
 {
-	free((char *)(s->v));
-	free((char *)s);
+  free((char *)(s->v));
+  free((char *)s);
 }
-*/	
+*/  
 }
 /**
  * Returns the topmost element.
  */
 public int pop() {
-	if (this.i < 0) throw new InternalError("Cannot pop stack!");
-	this.i--;
-	return this.v[this.i+1];
+  if (this.i < 0) throw new InternalError("Cannot pop stack!");
+  this.i--;
+  return this.v[this.i+1];
 }
 /**
  * Places the given value on top of the stack.
  */
 public void push(int value) {
-	this.i++;
-	if (this.i >= this.N) throw new InternalError("Cannot push stack!");
-	this.v[this.i] = value;
+  this.i++;
+  if (this.i >= this.N) throw new InternalError("Cannot push stack!");
+  this.v[this.i] = value;
 }
 /**
  * Returns the number of elements contained.
  */
 public int size() {
-	return i+1;
+  return i+1;
 }
 }
Index: matrix/src/main/java/org/apache/mahout/jet/random/package.html
===================================================================
--- matrix/src/main/java/org/apache/mahout/jet/random/package.html	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/jet/random/package.html	(working copy)
@@ -15,14 +15,14 @@
 double lambda = 1 / (variance / mean); 
 
 // for tests and debugging use a random engine with CONSTANT seed --> deterministic and reproducible results
-cern.jet.random.engine.RandomEngine engine = new cern.jet.random.engine.MersenneTwister(); 
+org.apache.mahout.jet.random.engine.RandomEngine engine = new org.apache.mahout.jet.random.engine.MersenneTwister(); 
 
 // your favourite distribution goes here
-cern.jet.random.AbstractDistribution dist = new cern.jet.random.Gamma(alpha,lambda,engine);
+org.apache.mahout.jet.random.AbstractDistribution dist = new org.apache.mahout.jet.random.Gamma(alpha,lambda,engine);
 
 // collect random numbers and print statistics
 int size = 100000;
-cern.colt.list.DoubleArrayList numbers = new cern.colt.list.DoubleArrayList(size);
+org.apache.mahout.matrix.list.DoubleArrayList numbers = new org.apache.mahout.matrix.list.DoubleArrayList(size);
 for (int i=0; i < size; i++) numbers.add(dist.nextDouble());
 
 hep.aida.bin.DynamicBin1D bin = new hep.aida.bin.DynamicBin1D();
Index: matrix/src/main/java/org/apache/mahout/jet/random/Uniform.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/jet/random/Uniform.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/jet/random/Uniform.java	(working copy)
@@ -17,210 +17,208 @@
  * <dt>
  * Static methods operate on a default uniform random number generator; they are synchronized.
  * <p>
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 09/24/99
  */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
  */
 @Deprecated
 public class Uniform extends AbstractContinousDistribution {
-	protected double min;
-	protected double max;
-	
- 	// The uniform random number generated shared by all <b>static</b> methods. 
-	protected static Uniform shared = new Uniform(makeDefaultGenerator());
+  protected double min;
+  protected double max;
+  
+   // The uniform random number generated shared by all <b>static</b> methods. 
+  protected static Uniform shared = new Uniform(makeDefaultGenerator());
 /**
  * Constructs a uniform distribution with the given minimum and maximum, using a {@link org.apache.mahout.jet.random.engine.MersenneTwister} seeded with the given seed.
  */
 public Uniform(double min, double max, int seed) {
-	this(min,max, new org.apache.mahout.jet.random.engine.MersenneTwister(seed));
+  this(min,max, new org.apache.mahout.jet.random.engine.MersenneTwister(seed));
 }
 /**
  * Constructs a uniform distribution with the given minimum and maximum.
  */
 public Uniform(double min, double max, RandomEngine randomGenerator) {
-	setRandomGenerator(randomGenerator);
-	setState(min,max);
+  setRandomGenerator(randomGenerator);
+  setState(min,max);
 }
 /**
  * Constructs a uniform distribution with <tt>min=0.0</tt> and <tt>max=1.0</tt>.
  */
 public Uniform(RandomEngine randomGenerator) {
-	this(0,1,randomGenerator);
+  this(0,1,randomGenerator);
 }
 /**
  * Returns the cumulative distribution function (assuming a continous uniform distribution).
  */
 public double cdf(double x) {
-	if (x <= min) return 0.0;
-	if (x >= max) return 1.0;
-	return (x-min) / (max-min);
+  if (x <= min) return 0.0;
+  if (x >= max) return 1.0;
+  return (x-min) / (max-min);
 }
 /**
  * Returns a uniformly distributed random <tt>boolean</tt>.
  */
 public boolean nextBoolean() {
-	return randomGenerator.raw() > 0.5;
+  return randomGenerator.raw() > 0.5;
 }
 /**
  * Returns a uniformly distributed random number in the open interval <tt>(min,max)</tt> (excluding <tt>min</tt> and <tt>max</tt>).
  */
 public double nextDouble() {
-	return min+(max-min)*randomGenerator.raw();
+  return min+(max-min)*randomGenerator.raw();
 }
 /**
  * Returns a uniformly distributed random number in the open interval <tt>(from,to)</tt> (excluding <tt>from</tt> and <tt>to</tt>).
  * Pre conditions: <tt>from &lt;= to</tt>.
  */
 public double nextDoubleFromTo(double from, double to) {
-	return from+(to-from)*randomGenerator.raw();
+  return from+(to-from)*randomGenerator.raw();
 }
 /**
  * Returns a uniformly distributed random number in the open interval <tt>(from,to)</tt> (excluding <tt>from</tt> and <tt>to</tt>).
  * Pre conditions: <tt>from &lt;= to</tt>.
  */
 public float nextFloatFromTo(float from, float to) {
-	return (float) nextDoubleFromTo(from,to);
+  return (float) nextDoubleFromTo(from,to);
 }
 /**
  * Returns a uniformly distributed random number in the closed interval <tt>[min,max]</tt> (including <tt>min</tt> and <tt>max</tt>).
  */
-public int nextInt() {	
-	return nextIntFromTo((int)Math.round(min), (int)Math.round(max));
+public int nextInt() {  
+  return nextIntFromTo((int)Math.round(min), (int)Math.round(max));
 }
 /**
  * Returns a uniformly distributed random number in the closed interval <tt>[from,to]</tt> (including <tt>from</tt> and <tt>to</tt>).
  * Pre conditions: <tt>from &lt;= to</tt>.
  */
-public int nextIntFromTo(int from, int to) {	
-	return (int) ((long)from  +  (long)((1L + (long)to - (long)from)*randomGenerator.raw()));
+public int nextIntFromTo(int from, int to) {  
+  return (int) ((long)from  +  (long)((1L + (long)to - (long)from)*randomGenerator.raw()));
 }
 /**
  * Returns a uniformly distributed random number in the closed interval <tt>[from,to]</tt> (including <tt>from</tt> and <tt>to</tt>).
  * Pre conditions: <tt>from &lt;= to</tt>.
  */
 public long nextLongFromTo(long from, long to) {
-	/* Doing the thing turns out to be more tricky than expected.
-	   avoids overflows and underflows.
-	   treats cases like from=-1, to=1 and the like right.
-	   the following code would NOT solve the problem: return (long) (Doubles.randomFromTo(from,to));
-	
-	   rounding avoids the unsymmetric behaviour of casts from double to long: (long) -0.7 = 0, (long) 0.7 = 0.
-	   checking for overflows and underflows is also necessary.
-	*/
-	
-	// first the most likely and also the fastest case.
-	if (from>=0 && to<Long.MAX_VALUE) {
-		return from + (long) (nextDoubleFromTo(0.0,to-from+1));
-	}
+  /* Doing the thing turns out to be more tricky than expected.
+     avoids overflows and underflows.
+     treats cases like from=-1, to=1 and the like right.
+     the following code would NOT solve the problem: return (long) (Doubles.randomFromTo(from,to));
+  
+     rounding avoids the unsymmetric behaviour of casts from double to long: (long) -0.7 = 0, (long) 0.7 = 0.
+     checking for overflows and underflows is also necessary.
+  */
+  
+  // first the most likely and also the fastest case.
+  if (from>=0 && to<Long.MAX_VALUE) {
+    return from + (long) (nextDoubleFromTo(0.0,to-from+1));
+  }
 
-	// would we get a numeric overflow?
-	// if not, we can still handle the case rather efficient.
-	double diff = ((double)to) - (double)from + 1.0;
-	if (diff <= Long.MAX_VALUE) {
-		return from + (long) (nextDoubleFromTo(0.0,diff));
-	}
+  // would we get a numeric overflow?
+  // if not, we can still handle the case rather efficient.
+  double diff = ((double)to) - (double)from + 1.0;
+  if (diff <= Long.MAX_VALUE) {
+    return from + (long) (nextDoubleFromTo(0.0,diff));
+  }
 
-	// now the pathologic boundary cases.
-	// they are handled rather slow.
-	long random;
-	if (from==Long.MIN_VALUE) {
-		if (to==Long.MAX_VALUE) {
-			//return Math.round(nextDoubleFromTo(from,to));
-			int i1 = nextIntFromTo(Integer.MIN_VALUE,Integer.MAX_VALUE);
-			int i2 = nextIntFromTo(Integer.MIN_VALUE,Integer.MAX_VALUE);
-			return ((i1 & 0xFFFFFFFFL) << 32) | (i2 & 0xFFFFFFFFL);
-		}
-		random = Math.round(nextDoubleFromTo(from,to+1));
-		if (random > to) random = from;
-	}
-	else {
-		random = Math.round(nextDoubleFromTo(from-1,to));
-		if (random < from) random = to;
-	}
-	return random;
+  // now the pathologic boundary cases.
+  // they are handled rather slow.
+  long random;
+  if (from==Long.MIN_VALUE) {
+    if (to==Long.MAX_VALUE) {
+      //return Math.round(nextDoubleFromTo(from,to));
+      int i1 = nextIntFromTo(Integer.MIN_VALUE,Integer.MAX_VALUE);
+      int i2 = nextIntFromTo(Integer.MIN_VALUE,Integer.MAX_VALUE);
+      return ((i1 & 0xFFFFFFFFL) << 32) | (i2 & 0xFFFFFFFFL);
+    }
+    random = Math.round(nextDoubleFromTo(from,to+1));
+    if (random > to) random = from;
+  }
+  else {
+    random = Math.round(nextDoubleFromTo(from-1,to));
+    if (random < from) random = to;
+  }
+  return random;
 }
 /**
  * Returns the probability distribution function (assuming a continous uniform distribution).
  */
 public double pdf(double x) {
-	if (x <= min || x >= max) return 0.0;
-	return 1.0 / (max-min);
+  if (x <= min || x >= max) return 0.0;
+  return 1.0 / (max-min);
 }
 /**
  * Sets the internal state.
  */
 public void setState(double min, double max) {
-	if (max<min) { setState(max,min); return; }
-	this.min=min;
-	this.max=max;
+  if (max<min) { setState(max,min); return; }
+  this.min=min;
+  this.max=max;
 }
 /**
  * Returns a uniformly distributed random <tt>boolean</tt>.
  */
 public static boolean staticNextBoolean() {
-	synchronized (shared) {
-		return shared.nextBoolean();
-	}
+  synchronized (shared) {
+    return shared.nextBoolean();
+  }
 }
 /**
  * Returns a uniformly distributed random number in the open interval <tt>(0,1)</tt> (excluding <tt>0</tt> and <tt>1</tt>).
  */
 public static double staticNextDouble() {
-	synchronized (shared) {
-		return shared.nextDouble();
-	}
+  synchronized (shared) {
+    return shared.nextDouble();
+  }
 }
 /**
  * Returns a uniformly distributed random number in the open interval <tt>(from,to)</tt> (excluding <tt>from</tt> and <tt>to</tt>).
  * Pre conditions: <tt>from &lt;= to</tt>.
  */
 public static double staticNextDoubleFromTo(double from, double to) {
-	synchronized (shared) {
-		return shared.nextDoubleFromTo(from,to);
-	}
+  synchronized (shared) {
+    return shared.nextDoubleFromTo(from,to);
+  }
 }
 /**
  * Returns a uniformly distributed random number in the open interval <tt>(from,to)</tt> (excluding <tt>from</tt> and <tt>to</tt>).
  * Pre conditions: <tt>from &lt;= to</tt>.
  */
 public static float staticNextFloatFromTo(float from, float to) {
-	synchronized (shared) {
-		return shared.nextFloatFromTo(from,to);
-	}
+  synchronized (shared) {
+    return shared.nextFloatFromTo(from,to);
+  }
 }
 /**
  * Returns a uniformly distributed random number in the closed interval <tt>[from,to]</tt> (including <tt>from</tt> and <tt>to</tt>).
  * Pre conditions: <tt>from &lt;= to</tt>.
  */
-public static int staticNextIntFromTo(int from, int to) {	
-	synchronized (shared) {
-		return shared.nextIntFromTo(from,to);
-	}
+public static int staticNextIntFromTo(int from, int to) {  
+  synchronized (shared) {
+    return shared.nextIntFromTo(from,to);
+  }
 }
 /**
  * Returns a uniformly distributed random number in the closed interval <tt>[from,to]</tt> (including <tt>from</tt> and <tt>to</tt>).
  * Pre conditions: <tt>from &lt;= to</tt>.
  */
 public static long staticNextLongFromTo(long from, long to) {
-	synchronized (shared) {
-		return shared.nextLongFromTo(from,to);
-	}
+  synchronized (shared) {
+    return shared.nextLongFromTo(from,to);
+  }
 }
 /**
  * Sets the uniform random number generation engine shared by all <b>static</b> methods.
  * @param randomGenerator the new uniform random number generation engine to be shared.
  */
 public static void staticSetRandomEngine(RandomEngine randomGenerator) {
-	synchronized (shared) {
-		shared.setRandomGenerator(randomGenerator);
-	}
+  synchronized (shared) {
+    shared.setRandomGenerator(randomGenerator);
+  }
 }
 /**
  * Returns a String representation of the receiver.
  */
 public String toString() {
-	return this.getClass().getName()+"("+min+","+max+")";
+  return this.getClass().getName()+"("+min+","+max+")";
 }
 }
Index: matrix/src/main/java/org/apache/mahout/jet/random/BreitWigner.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/jet/random/BreitWigner.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/jet/random/BreitWigner.java	(working copy)
@@ -19,86 +19,84 @@
  * <p>
  * <b>Implementation:</b> This is a port of <A HREF="http://wwwinfo.cern.ch/asd/lhc++/clhep/manual/RefGuide/Random/RandBreitWigner.html">RandBreitWigner</A> used in <A HREF="http://wwwinfo.cern.ch/asd/lhc++/clhep">CLHEP 1.4.0</A> (C++).
  *
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 09/24/99
  */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
  */
 @Deprecated
 public class BreitWigner extends AbstractContinousDistribution {
-	protected double mean;
-	protected double gamma;
-	protected double cut;
+  protected double mean;
+  protected double gamma;
+  protected double cut;
 
-	// The uniform random number generated shared by all <b>static</b> methods.
-	protected static BreitWigner shared = new BreitWigner(1.0,0.2,1.0,makeDefaultGenerator());
+  // The uniform random number generated shared by all <b>static</b> methods.
+  protected static BreitWigner shared = new BreitWigner(1.0,0.2,1.0,makeDefaultGenerator());
 /**
  * Constructs a BreitWigner distribution.
  * @param cut </tt>cut==Double.NEGATIVE_INFINITY</tt> indicates "don't cut".
  */
 public BreitWigner(double mean, double gamma, double cut, RandomEngine randomGenerator) {
-	setRandomGenerator(randomGenerator);
-	setState(mean, gamma, cut);
+  setRandomGenerator(randomGenerator);
+  setState(mean, gamma, cut);
 }
 /**
  * Returns a random number from the distribution.
  */
 public double nextDouble() {
-	return nextDouble(mean, gamma, cut);
+  return nextDouble(mean, gamma, cut);
 }
 /**
  * Returns a random number from the distribution; bypasses the internal state.
  * @param cut </tt>cut==Double.NEGATIVE_INFINITY</tt> indicates "don't cut".
  */
 public double nextDouble(double mean,double gamma,double cut) {
-	double val, rval, displ;
+  double val, rval, displ;
 
-	if (gamma == 0.0) return mean;
-	if (cut==Double.NEGATIVE_INFINITY) { // don't cut
-		rval = 2.0*randomGenerator.raw()-1.0;
-		displ = 0.5*gamma*Math.tan(rval*(Math.PI/2.0));
-		return mean + displ;
-	}
-	else {
-		val = Math.atan(2.0*cut/gamma);
-		rval = 2.0*randomGenerator.raw()-1.0;
-		displ = 0.5*gamma*Math.tan(rval*val);
+  if (gamma == 0.0) return mean;
+  if (cut==Double.NEGATIVE_INFINITY) { // don't cut
+    rval = 2.0*randomGenerator.raw()-1.0;
+    displ = 0.5*gamma*Math.tan(rval*(Math.PI/2.0));
+    return mean + displ;
+  }
+  else {
+    val = Math.atan(2.0*cut/gamma);
+    rval = 2.0*randomGenerator.raw()-1.0;
+    displ = 0.5*gamma*Math.tan(rval*val);
 
-		return mean + displ;
-	}
+    return mean + displ;
+  }
 }
 /**
  * Sets the mean, gamma and cut parameters.
  * @param cut </tt>cut==Double.NEGATIVE_INFINITY</tt> indicates "don't cut".
  */
 public void setState(double mean, double gamma, double cut) {
-	this.mean = mean;
-	this.gamma = gamma;
-	this.cut = cut;
+  this.mean = mean;
+  this.gamma = gamma;
+  this.cut = cut;
 }
 /**
  * Returns a random number from the distribution.
  * @param cut </tt>cut==Double.NEGATIVE_INFINITY</tt> indicates "don't cut".
  */
 public static double staticNextDouble(double mean,double gamma,double cut) {
-	synchronized (shared) {
-		return shared.nextDouble(mean,gamma,cut);
-	}
+  synchronized (shared) {
+    return shared.nextDouble(mean,gamma,cut);
+  }
 }
 /**
  * Returns a String representation of the receiver.
  */
 public String toString() {
-	return this.getClass().getName()+"("+mean+","+gamma+","+cut+")";
+  return this.getClass().getName()+"("+mean+","+gamma+","+cut+")";
 }
 /**
  * Sets the uniform random number generated shared by all <b>static</b> methods.
  * @param randomGenerator the new uniform random number generator to be shared.
  */
 private static void xstaticSetRandomGenerator(RandomEngine randomGenerator) {
-	synchronized (shared) {
-		shared.setRandomGenerator(randomGenerator);
-	}
+  synchronized (shared) {
+    shared.setRandomGenerator(randomGenerator);
+  }
 }
 }
Index: matrix/src/main/java/org/apache/mahout/jet/random/ChiSquare.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/jet/random/ChiSquare.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/jet/random/ChiSquare.java	(working copy)
@@ -32,21 +32,19 @@
  * C-RAND's implementation, in turn, is based upon
  * <p>J.F. Monahan (1987): An algorithm for generating chi random variables, ACM Trans. Math. Software 13, 168-172.
  *
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 09/24/99
  */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
  */
 @Deprecated
 public class ChiSquare extends AbstractContinousDistribution {
-	protected double freedom;
+  protected double freedom;
 
-	// cached vars for method nextDouble(a) (for performance only)
-	private double freedom_in = -1.0,b,vm,vp,vd;
+  // cached vars for method nextDouble(a) (for performance only)
+  private double freedom_in = -1.0,b,vm,vp,vd;
 
- 	// The uniform random number generated shared by all <b>static</b> methods.
-	protected static ChiSquare shared = new ChiSquare(1.0,makeDefaultGenerator());
+   // The uniform random number generated shared by all <b>static</b> methods.
+  protected static ChiSquare shared = new ChiSquare(1.0,makeDefaultGenerator());
 /**
  * Constructs a ChiSquare distribution.
  * Example: freedom=1.0.
@@ -54,20 +52,20 @@
  * @throws IllegalArgumentException if <tt>freedom &lt; 1.0</tt>.
  */
 public ChiSquare(double freedom, RandomEngine randomGenerator) {
-	setRandomGenerator(randomGenerator);
-	setState(freedom);
+  setRandomGenerator(randomGenerator);
+  setState(freedom);
 }
 /**
  * Returns the cumulative distribution function.
  */
 public double cdf(double x) {
-	return Probability.chiSquare(freedom,x);
+  return Probability.chiSquare(freedom,x);
 }
 /**
  * Returns a random number from the distribution.
  */
 public double nextDouble() {
-	return nextDouble(this.freedom);
+  return nextDouble(this.freedom);
 }
 /**
  * Returns a random number from the distribution; bypasses the internal state.
@@ -92,54 +90,54 @@
  * Implemented by R. Kremer, 1990                                 *
  ******************************************************************/
 
-	double u,v,z,zz,r;
+  double u,v,z,zz,r;
 
-	//if( a < 1 )  return (-1.0); // Check for invalid input value
+  //if( a < 1 )  return (-1.0); // Check for invalid input value
 
-	if (freedom == 1.0) {
-		for(;;) {
-			u = randomGenerator.raw();
-			v = randomGenerator.raw() * 0.857763884960707;
-			z = v / u;
-			if (z < 0) continue;
-			zz = z * z;
-			r = 2.5 - zz;
-			if (z < 0.0) r = r + zz * z / (3.0 * z);
-			if (u < r * 0.3894003915) return(z*z);
-			if (zz > (1.036961043 / u + 1.4)) continue;
-			if (2.0 * Math.log(u) < (- zz * 0.5 )) return(z*z);
-		}
-	}
-	else {
-		if (freedom != freedom_in) {
-			b = Math.sqrt(freedom - 1.0);
-			vm = - 0.6065306597 * (1.0 - 0.25 / (b * b + 1.0));
-			vm = (-b > vm) ? -b : vm;
-			vp = 0.6065306597 * (0.7071067812 + b) / (0.5 + b);
-			vd = vp - vm;
-			freedom_in = freedom;
-		}
-		for(;;) {
-			u = randomGenerator.raw();
-			v = randomGenerator.raw() * vd + vm;
-			z = v / u;
-			if (z < -b) continue;
-			zz = z * z;
-			r = 2.5 - zz;
-			if (z < 0.0) r = r + zz * z / (3.0 * (z + b));
-			if (u < r * 0.3894003915) return((z + b)*(z + b));
-			if (zz > (1.036961043 / u + 1.4)) continue;
-			if (2.0 * Math.log(u) < (Math.log(1.0 + z / b) * b * b - zz * 0.5 - z * b)) return((z + b)*(z + b));
-		}
-	}
+  if (freedom == 1.0) {
+    for(;;) {
+      u = randomGenerator.raw();
+      v = randomGenerator.raw() * 0.857763884960707;
+      z = v / u;
+      if (z < 0) continue;
+      zz = z * z;
+      r = 2.5 - zz;
+      if (z < 0.0) r = r + zz * z / (3.0 * z);
+      if (u < r * 0.3894003915) return(z*z);
+      if (zz > (1.036961043 / u + 1.4)) continue;
+      if (2.0 * Math.log(u) < (- zz * 0.5 )) return(z*z);
+    }
+  }
+  else {
+    if (freedom != freedom_in) {
+      b = Math.sqrt(freedom - 1.0);
+      vm = - 0.6065306597 * (1.0 - 0.25 / (b * b + 1.0));
+      vm = (-b > vm) ? -b : vm;
+      vp = 0.6065306597 * (0.7071067812 + b) / (0.5 + b);
+      vd = vp - vm;
+      freedom_in = freedom;
+    }
+    for(;;) {
+      u = randomGenerator.raw();
+      v = randomGenerator.raw() * vd + vm;
+      z = v / u;
+      if (z < -b) continue;
+      zz = z * z;
+      r = 2.5 - zz;
+      if (z < 0.0) r = r + zz * z / (3.0 * (z + b));
+      if (u < r * 0.3894003915) return((z + b)*(z + b));
+      if (zz > (1.036961043 / u + 1.4)) continue;
+      if (2.0 * Math.log(u) < (Math.log(1.0 + z / b) * b * b - zz * 0.5 - z * b)) return((z + b)*(z + b));
+    }
+  }
 }
 /**
  * Returns the probability distribution function.
  */
 public double pdf(double x) {
-	if (x <= 0.0) throw new IllegalArgumentException();
-	double logGamma = Fun.logGamma(freedom/2.0);
-	return Math.exp((freedom/2.0 - 1.0) * Math.log(x/2.0) - x/2.0 - logGamma) / 2.0;
+  if (x <= 0.0) throw new IllegalArgumentException();
+  double logGamma = Fun.logGamma(freedom/2.0);
+  return Math.exp((freedom/2.0 - 1.0) * Math.log(x/2.0) - x/2.0 - logGamma) / 2.0;
 }
 /**
  * Sets the distribution parameter.
@@ -147,8 +145,8 @@
  * @throws IllegalArgumentException if <tt>freedom &lt; 1.0</tt>.
  */
 public void setState(double freedom) {
-	if (freedom<1.0) throw new IllegalArgumentException();
-	this.freedom = freedom;
+  if (freedom<1.0) throw new IllegalArgumentException();
+  this.freedom = freedom;
 }
 /**
  * Returns a random number from the distribution.
@@ -156,23 +154,23 @@
  * @throws IllegalArgumentException if <tt>freedom &lt; 1.0</tt>.
  */
 public static double staticNextDouble(double freedom) {
-	synchronized (shared) {
-		return shared.nextDouble(freedom);
-	}
+  synchronized (shared) {
+    return shared.nextDouble(freedom);
+  }
 }
 /**
  * Returns a String representation of the receiver.
  */
 public String toString() {
-	return this.getClass().getName()+"("+freedom+")";
+  return this.getClass().getName()+"("+freedom+")";
 }
 /**
  * Sets the uniform random number generated shared by all <b>static</b> methods.
  * @param randomGenerator the new uniform random number generator to be shared.
  */
 private static void xstaticSetRandomGenerator(RandomEngine randomGenerator) {
-	synchronized (shared) {
-		shared.setRandomGenerator(randomGenerator);
-	}
+  synchronized (shared) {
+    shared.setRandomGenerator(randomGenerator);
+  }
 }
 }
Index: matrix/src/main/java/org/apache/mahout/jet/random/engine/RandomEngine.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/jet/random/engine/RandomEngine.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/jet/random/engine/RandomEngine.java	(working copy)
@@ -26,8 +26,6 @@
  * <p>
  * Note that this implementation is <b>not synchronized</b>.
  * 
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 09/24/99
  * @see MersenneTwister
  * @see MersenneTwister64
  * @see java.util.Random
@@ -47,65 +45,65 @@
 This has the effect that random engines can now be used as function objects, returning a random number upon function evaluation.
 */
 public double apply(double dummy) {
-	return raw();
+  return raw();
 }
 /**
 Equivalent to <tt>nextInt()</tt>.
 This has the effect that random engines can now be used as function objects, returning a random number upon function evaluation.
 */
 public int apply(int dummy) {
-	return nextInt();
+  return nextInt();
 }
 /**
  * Constructs and returns a new uniform random number engine seeded with the current time.
  * Currently this is {@link org.apache.mahout.jet.random.engine.MersenneTwister}.
  */
 public static RandomEngine makeDefault() {
-	return new org.apache.mahout.jet.random.engine.MersenneTwister((int) System.currentTimeMillis());
+  return new org.apache.mahout.jet.random.engine.MersenneTwister((int) System.currentTimeMillis());
 }
 /**
  * Returns a 64 bit uniformly distributed random number in the open unit interval <code>(0.0,1.0)</code> (excluding 0.0 and 1.0).
  */
 public double nextDouble() {
-	double nextDouble;
-	
-	do {
-		// -9.223372036854776E18 == (double) Long.MIN_VALUE
-		// 5.421010862427522E-20 == 1 / Math.pow(2,64) == 1 / ((double) Long.MAX_VALUE - (double) Long.MIN_VALUE);
-		nextDouble = ((double) nextLong() - -9.223372036854776E18)  *  5.421010862427522E-20;
-	}
-	// catch loss of precision of long --> double conversion
-	while (! (nextDouble>0.0 && nextDouble<1.0));
-	
-	// --> in (0.0,1.0)
-	return nextDouble;
+  double nextDouble;
+  
+  do {
+    // -9.223372036854776E18 == (double) Long.MIN_VALUE
+    // 5.421010862427522E-20 == 1 / Math.pow(2,64) == 1 / ((double) Long.MAX_VALUE - (double) Long.MIN_VALUE);
+    nextDouble = ((double) nextLong() - -9.223372036854776E18)  *  5.421010862427522E-20;
+  }
+  // catch loss of precision of long --> double conversion
+  while (! (nextDouble>0.0 && nextDouble<1.0));
+  
+  // --> in (0.0,1.0)
+  return nextDouble;
 
-	/*
-		nextLong == Long.MAX_VALUE         --> 1.0
-		nextLong == Long.MIN_VALUE         --> 0.0
-		nextLong == Long.MAX_VALUE-1       --> 1.0
-		nextLong == Long.MAX_VALUE-100000L --> 0.9999999999999946
-		nextLong == Long.MIN_VALUE+1       --> 0.0
-		nextLong == Long.MIN_VALUE-100000L --> 0.9999999999999946
-		nextLong == 1L                     --> 0.5
-		nextLong == -1L                    --> 0.5
-		nextLong == 2L                     --> 0.5
-		nextLong == -2L                    --> 0.5
-		nextLong == 2L+100000L             --> 0.5000000000000054
-		nextLong == -2L-100000L            --> 0.49999999999999456
-	*/
+  /*
+    nextLong == Long.MAX_VALUE         --> 1.0
+    nextLong == Long.MIN_VALUE         --> 0.0
+    nextLong == Long.MAX_VALUE-1       --> 1.0
+    nextLong == Long.MAX_VALUE-100000L --> 0.9999999999999946
+    nextLong == Long.MIN_VALUE+1       --> 0.0
+    nextLong == Long.MIN_VALUE-100000L --> 0.9999999999999946
+    nextLong == 1L                     --> 0.5
+    nextLong == -1L                    --> 0.5
+    nextLong == 2L                     --> 0.5
+    nextLong == -2L                    --> 0.5
+    nextLong == 2L+100000L             --> 0.5000000000000054
+    nextLong == -2L-100000L            --> 0.49999999999999456
+  */
 }
 /**
  * Returns a 32 bit uniformly distributed random number in the open unit interval <code>(0.0f,1.0f)</code> (excluding 0.0f and 1.0f).
  */
 public float nextFloat() {
-	// catch loss of precision of double --> float conversion
-	float nextFloat;
-	do { nextFloat = (float) raw(); }
-	while (nextFloat>=1.0f);
-	
-	// --> in (0.0f,1.0f)
-	return nextFloat;
+  // catch loss of precision of double --> float conversion
+  float nextFloat;
+  do { nextFloat = (float) raw(); }
+  while (nextFloat>=1.0f);
+  
+  // --> in (0.0f,1.0f)
+  return nextFloat;
 }
 /**
  * Returns a 32 bit uniformly distributed random number in the closed interval <tt>[Integer.MIN_VALUE,Integer.MAX_VALUE]</tt> (including <tt>Integer.MIN_VALUE</tt> and <tt>Integer.MAX_VALUE</tt>);
@@ -115,32 +113,32 @@
  * Returns a 64 bit uniformly distributed random number in the closed interval <tt>[Long.MIN_VALUE,Long.MAX_VALUE]</tt> (including <tt>Long.MIN_VALUE</tt> and <tt>Long.MAX_VALUE</tt>).
  */
 public long nextLong() {
-	// concatenate two 32-bit strings into one 64-bit string
-	return ((nextInt() & 0xFFFFFFFFL) << 32)
-		|  ((nextInt() & 0xFFFFFFFFL));
+  // concatenate two 32-bit strings into one 64-bit string
+  return ((nextInt() & 0xFFFFFFFFL) << 32)
+    |  ((nextInt() & 0xFFFFFFFFL));
 }
 /**
  * Returns a 32 bit uniformly distributed random number in the open unit interval <code>(0.0,1.0)</code> (excluding 0.0 and 1.0).
  */
 public double raw() {
-	int nextInt;
-	do { // accept anything but zero
-		nextInt = nextInt(); // in [Integer.MIN_VALUE,Integer.MAX_VALUE]-interval
-	} while (nextInt==0);
+  int nextInt;
+  do { // accept anything but zero
+    nextInt = nextInt(); // in [Integer.MIN_VALUE,Integer.MAX_VALUE]-interval
+  } while (nextInt==0);
 
-	// transform to (0.0,1.0)-interval
-	// 2.3283064365386963E-10 == 1.0 / Math.pow(2,32)
-	return (double) (nextInt & 0xFFFFFFFFL) * 2.3283064365386963E-10;
-	
-	/*
-		nextInt == Integer.MAX_VALUE   --> 0.49999999976716936
-		nextInt == Integer.MIN_VALUE   --> 0.5
-		nextInt == Integer.MAX_VALUE-1 --> 0.4999999995343387
-		nextInt == Integer.MIN_VALUE+1 --> 0.5000000002328306
-		nextInt == 1                   --> 2.3283064365386963E-10
-		nextInt == -1                  --> 0.9999999997671694
-		nextInt == 2                   --> 4.6566128730773926E-10
-		nextInt == -2                  --> 0.9999999995343387
-	*/
+  // transform to (0.0,1.0)-interval
+  // 2.3283064365386963E-10 == 1.0 / Math.pow(2,32)
+  return (double) (nextInt & 0xFFFFFFFFL) * 2.3283064365386963E-10;
+  
+  /*
+    nextInt == Integer.MAX_VALUE   --> 0.49999999976716936
+    nextInt == Integer.MIN_VALUE   --> 0.5
+    nextInt == Integer.MAX_VALUE-1 --> 0.4999999995343387
+    nextInt == Integer.MIN_VALUE+1 --> 0.5000000002328306
+    nextInt == 1                   --> 2.3283064365386963E-10
+    nextInt == -1                  --> 0.9999999997671694
+    nextInt == 2                   --> 4.6566128730773926E-10
+    nextInt == -2                  --> 0.9999999995343387
+  */
 }
 }
Index: matrix/src/main/java/org/apache/mahout/jet/random/engine/RandomGenerator.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/jet/random/engine/RandomGenerator.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/jet/random/engine/RandomGenerator.java	(working copy)
@@ -17,28 +17,28 @@
 @Deprecated
 public interface RandomGenerator  {
 
-	/**
-	 * Returns a 32 bit uniformly distributed random number in the open unit interval <code>(0.0,1.0)</code> (excluding 0.0 and 1.0).
-	 */
-	public double raw();
+  /**
+   * Returns a 32 bit uniformly distributed random number in the open unit interval <code>(0.0,1.0)</code> (excluding 0.0 and 1.0).
+   */
+  public double raw();
 
-	/**
-	 * Returns a 64 bit uniformly distributed random number in the open unit interval <code>(0.0,1.0)</code> (excluding 0.0 and 1.0).
-	 */
-	public double nextDouble();
-	
-	/**
-	 * Returns a 32 bit uniformly distributed random number in the closed interval <tt>[Integer.MIN_VALUE,Integer.MAX_VALUE]</tt> (including <tt>Integer.MIN_VALUE</tt> and <tt>Integer.MAX_VALUE</tt>);
-	 */
-	public int nextInt();
-	
-	/**
-	 * Returns a 64 bit uniformly distributed random number in the closed interval <tt>[Long.MIN_VALUE,Long.MAX_VALUE]</tt> (including <tt>Long.MIN_VALUE</tt> and <tt>Long.MAX_VALUE</tt>).
-	 */
-	public long nextLong();
+  /**
+   * Returns a 64 bit uniformly distributed random number in the open unit interval <code>(0.0,1.0)</code> (excluding 0.0 and 1.0).
+   */
+  public double nextDouble();
+  
+  /**
+   * Returns a 32 bit uniformly distributed random number in the closed interval <tt>[Integer.MIN_VALUE,Integer.MAX_VALUE]</tt> (including <tt>Integer.MIN_VALUE</tt> and <tt>Integer.MAX_VALUE</tt>);
+   */
+  public int nextInt();
+  
+  /**
+   * Returns a 64 bit uniformly distributed random number in the closed interval <tt>[Long.MIN_VALUE,Long.MAX_VALUE]</tt> (including <tt>Long.MIN_VALUE</tt> and <tt>Long.MAX_VALUE</tt>).
+   */
+  public long nextLong();
 
-	/**
-	 * Returns a 32 bit uniformly distributed random number in the open unit interval <code>(0.0f,1.0f)</code> (excluding 0.0f and 1.0f).
-	 */
-	public float nextFloat();
+  /**
+   * Returns a 32 bit uniformly distributed random number in the open unit interval <code>(0.0f,1.0f)</code> (excluding 0.0f and 1.0f).
+   */
+  public float nextFloat();
 }
\ No newline at end of file
Index: matrix/src/main/java/org/apache/mahout/jet/random/engine/DRand.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/jet/random/engine/DRand.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/jet/random/engine/DRand.java	(working copy)
@@ -33,8 +33,6 @@
  * Note that this implementation is <b>not synchronized</b>.                                  
  * <p>
  * 
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 09/24/99
  * @see MersenneTwister
  * @see java.util.Random
  */
@@ -43,20 +41,20 @@
  */
 @Deprecated
 public class DRand extends RandomEngine {
-	private int current;
-	public static final int DEFAULT_SEED = 1;
+  private int current;
+  public static final int DEFAULT_SEED = 1;
 /**
  * Constructs and returns a random number generator with a default seed, which is a <b>constant</b>.
  */
 public DRand() {
-	this(DEFAULT_SEED);
+  this(DEFAULT_SEED);
 }
 /**
  * Constructs and returns a random number generator with the given seed.
  * @param seed should not be 0, in such a case <tt>DRand.DEFAULT_SEED</tt> is substituted.
  */
 public DRand(int seed) {
-	setSeed(seed);
+  setSeed(seed);
 }
 /**
  * Constructs and returns a random number generator seeded with the given date.
@@ -64,16 +62,16 @@
  * @param d typically <tt>new java.util.Date()</tt>
  */
 public DRand(Date d) {
-	this((int)d.getTime());
+  this((int)d.getTime());
 }
 /**
  * Returns a 32 bit uniformly distributed random number in the closed interval <tt>[Integer.MIN_VALUE,Integer.MAX_VALUE]</tt> (including <tt>Integer.MIN_VALUE</tt> and <tt>Integer.MAX_VALUE</tt>).
  */
 public int nextInt() {
-	current *= 0x278DDE6D;     /* z(i+1)=a*z(i) (mod 2**32) */
-	// a == 0x278DDE6D == 663608941
-	
-	return current;
+  current *= 0x278DDE6D;     /* z(i+1)=a*z(i) (mod 2**32) */
+  // a == 0x278DDE6D == 663608941
+  
+  return current;
 }
 /**
  * Sets the receiver's seed. 
@@ -82,10 +80,10 @@
  * @param seed if the above condition does not hold, a modified seed that meets the condition is silently substituted.
  */
 protected void setSeed(int seed) {
-	if (seed<0) seed = -seed;
-	int limit = (int)((Math.pow(2,32)-1) /4); // --> 536870911
-	if (seed >= limit) seed = seed >> 3;
+  if (seed<0) seed = -seed;
+  int limit = (int)((Math.pow(2,32)-1) /4); // --> 536870911
+  if (seed >= limit) seed = seed >> 3;
 
-	this.current = 4*seed+1;
+  this.current = 4*seed+1;
 }
 }
Index: matrix/src/main/java/org/apache/mahout/jet/random/engine/MersenneTwister64.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/jet/random/engine/MersenneTwister64.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/jet/random/engine/MersenneTwister64.java	(working copy)
@@ -12,8 +12,6 @@
 /**
  * Same as <tt>MersenneTwister</tt> except that method <tt>raw()</tt> returns 64 bit random numbers instead of 32 bit random numbers.
  * 
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 09/24/99
  * @see MersenneTwister
  */
 /** 
@@ -25,14 +23,14 @@
  * Constructs and returns a random number generator with a default seed, which is a <b>constant</b>.
  */
 public MersenneTwister64() {
-	super();
+  super();
 }
 /**
  * Constructs and returns a random number generator with the given seed.
  * @param seed should not be 0, in such a case <tt>MersenneTwister64.DEFAULT_SEED</tt> is silently substituted.
  */
 public MersenneTwister64(int seed) {
-	super(seed);
+  super(seed);
 }
 /**
  * Constructs and returns a random number generator seeded with the given date.
@@ -40,12 +38,12 @@
  * @param d typically <tt>new java.util.Date()</tt>
  */
 public MersenneTwister64(Date d) {
-	super(d);
+  super(d);
 }
 /**
  * Returns a 64 bit uniformly distributed random number in the open unit interval <code>(0.0,1.0)</code> (excluding 0.0 and 1.0).
  */
 public double raw() {
-	return nextDouble();
+  return nextDouble();
 }
 }
Index: matrix/src/main/java/org/apache/mahout/jet/random/engine/RandomSeedGenerator.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/jet/random/engine/RandomSeedGenerator.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/jet/random/engine/RandomSeedGenerator.java	(working copy)
@@ -20,21 +20,19 @@
  * Each generated sequence of seeds has a period of 10<sup>9</sup> numbers.
  * Internally uses {@link RandomSeedTable}.
  *
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 09/24/99
  */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
  */
 @Deprecated
 public class RandomSeedGenerator extends org.apache.mahout.matrix.PersistentObject {
-	protected int row;
-	protected int column;
+  protected int row;
+  protected int column;
 /**
  * Constructs and returns a new seed generator.
  */
 public RandomSeedGenerator() {
-	this(0,0);
+  this(0,0);
 }
 /**
  * Constructs and returns a new seed generator; you normally won't need to use this method.
@@ -48,35 +46,35 @@
  * @param column should be in <tt>[0,RandomSeedTable.COLUMNS - 1]</tt>.
  */
 public RandomSeedGenerator(int row, int column) {
-	this.row = row;
-	this.column = column;
+  this.row = row;
+  this.column = column;
 }
 /**
  * Prints the generated seeds for the given input parameters.
  */
 public static void main(String args[]) {
-	int row = Integer.parseInt(args[0]);
-	int column = Integer.parseInt(args[1]);
-	int size = Integer.parseInt(args[2]);
-	new RandomSeedGenerator(row,column).print(size);
+  int row = Integer.parseInt(args[0]);
+  int column = Integer.parseInt(args[1]);
+  int size = Integer.parseInt(args[2]);
+  new RandomSeedGenerator(row,column).print(size);
 }
 /**
  * Returns the next seed.
  */
 public int nextSeed() {
-	return RandomSeedTable.getSeedAtRowColumn(row++, column);
+  return RandomSeedTable.getSeedAtRowColumn(row++, column);
 }
 /**
  * Prints the next <tt>size</tt> generated seeds.
  */
 public void print(int size) {
-	System.out.println("Generating "+size+" random seeds...");
-	RandomSeedGenerator copy = (RandomSeedGenerator) this.clone();
-	for (int i=0; i<size; i++) {
-		int seed = copy.nextSeed();
-		System.out.println(seed);
-	}
+  System.out.println("Generating "+size+" random seeds...");
+  RandomSeedGenerator copy = (RandomSeedGenerator) this.clone();
+  for (int i=0; i<size; i++) {
+    int seed = copy.nextSeed();
+    System.out.println(seed);
+  }
 
-	System.out.println("\ndone.");
+  System.out.println("\ndone.");
 }
 }
Index: matrix/src/main/java/org/apache/mahout/jet/random/engine/RandomSeedTable.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/jet/random/engine/RandomSeedTable.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/jet/random/engine/RandomSeedTable.java	(working copy)
@@ -17,242 +17,240 @@
  * Geant4, in turn,  took the table from the original FORTRAN77 implementation of the HEP CERN Library routine RECUSQ.
  * Each sequence has a period of 10**9 numbers.
  *
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 09/24/99
  */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
  */
 @Deprecated
 public class RandomSeedTable {
-	/**
-	 * The number of columns of the matrix (currently COLUMNS = 2).
-	 */ 
-	public static final int COLUMNS = 2;
+  /**
+   * The number of columns of the matrix (currently COLUMNS = 2).
+   */ 
+  public static final int COLUMNS = 2;
 
-	// a m*n matrix, just stored as one-dim array
-	// 215 * 2 entries
-	private static final int[] seeds = new int[] {
-		   9876, 54321,
-	 1299961164, 253987020,
-	  669708517, 2079157264,
-	  190904760, 417696270,
-	 1289741558, 1376336092,
-	 1803730167, 324952955,
-	  489854550, 582847132,
-	 1348037628, 1661577989,
-	  350557787, 1155446919,
-	  591502945, 634133404,
-	 1901084678, 862916278,
-	 1988640932, 1785523494,
-	 1873836227, 508007031,
-	 1146416592, 967585720,
-	 1837193353, 1522927634,
-	   38219936, 921609208,
-	  349152748, 112892610,
-	  744459040, 1735807920,
-	 1983990104, 728277902,
-	  309164507, 2126677523,
-	  362993787, 1897782044,
-	  556776976, 462072869,
-	 1584900822, 2019394912,
-	 1249892722, 791083656,
-	 1686600998, 1983731097,
-	 1127381380, 198976625,
-	 1999420861, 1810452455,
-	 1972906041, 664182577,
-	   84636481, 1291886301,
-	 1186362995, 954388413,
-	 2141621785, 61738584,
-	 1969581251, 1557880415,
-	 1150606439, 136325185,
-	   95187861, 1592224108,
-	  940517655, 1629971798,
-	  215350428, 922659102,
-	  786161212, 1121345074,
-	 1450830056, 1922787776,
-	 1696578057, 2025150487,
-	 1803414346, 1851324780,
-	 1017898585, 1452594263,
-	 1184497978, 82122239,
-	  633338765, 1829684974,
-	  430889421, 230039326,
-	  492544653, 76320266,
-	  389386975, 1314148944,
-	 1720322786, 709120323,
-	 1868768216, 1992898523,
-	  443210610, 811117710,
-	 1191938868, 1548484733,
-	  616890172, 159787986,
-	  935835339, 1231440405,
-	 1058009367, 1527613300,
-	 1463148129, 1970575097,
-	 1795336935, 434768675,
-	  274019517, 605098487,
-	  483689317, 217146977,
-	 2070804364, 340596558,
-	  930226308, 1602100969,
-	  989324440, 801809442,
-	  410606853, 1893139948,
-	 1583588576, 1219225407,
-	 2102034391, 1394921405,
-	 2005037790, 2031006861,
-	 1244218766, 923231061,
-	   49312790, 775496649,
-	  721012176, 321339902,
-	 1719909107, 1865748178,
-	 1156177430, 1257110891,
-	  307561322, 1918244397,
-	  906041433, 360476981,
-	 1591375755, 268492659,
-	  461522398, 227343256,
-	 2145930725, 2020665454,
-	 1938419274, 1331283701,
-	  174405412, 524140103,
-	  494343653,  18063908,
-	 1025534808, 181709577,
-	 2048959776, 1913665637,
-	  950636517, 794796256,
-	 1828843197, 1335757744,
-	  211109723, 983900607,
-	  825474095, 1046009991,
-	  374915657, 381856628,
-	 1241296328, 698149463,
-	 1260624655, 1024538273,
-	  900676210, 1628865823,
-	  697951025, 500570753,
-	 1007920268, 1708398558,
-	  264596520, 624727803,
-	 1977924811, 674673241,
-	 1440257718, 271184151,
-	 1928778847, 993535203,
-	 1307807366, 1801502463,
-	 1498732610, 300876954,
-	 1617712402, 1574250679,
-	 1261800762, 1556667280,
-	  949929273, 560721070,
-	 1766170474, 1953522912,
-	 1849939248, 19435166,
-	  887262858, 1219627824,
-	  483086133, 603728993,
-	 1330541052, 1582596025,
-	 1850591475, 723593133,
-	 1431775678, 1558439000,
-	  922493739, 1356554404,
-	 1058517206, 948567762,
-	  709067283, 1350890215,
-	 1044787723, 2144304941,
-	  999707003, 513837520,
-	 2140038663, 1850568788,
-	 1803100150, 127574047,
-	  867445693, 1149173981,
-	  408583729, 914837991,
-	 1166715497, 602315845,
-	  430738528, 1743308384,
-	 1388022681, 1760110496,
-	 1664028066, 654300326,
-	 1767741172, 1338181197,
-	 1625723550, 1742482745,
-	  464486085, 1507852127,
-	  754082421, 1187454014,
-	 1315342834, 425995190,
-	  960416608, 2004255418,
-	 1262630671, 671761697,
-	   59809238, 103525918,
-	 1205644919, 2107823293,
-	 1615183160, 1152411412,
-	 1024474681, 2118672937,
-	 1703877649, 1235091369,
-	 1821417852, 1098463802,
-	 1738806466, 1529062843,
-	  620780646, 1654833544,
-	 1070174101, 795158254,
-	  658537995, 1693620426,
-	 2055317555, 508053916,
-	 1647371686, 1282395762,
-	   29067379, 409683067,
-	 1763495989, 1917939635,
-	 1602690753, 810926582,
-	  885787576, 513818500,
-	 1853512561, 1195205756,
-	 1798585498, 1970460256,
-	 1819261032, 1306536501,
-	 1133245275, 37901,
-	  689459799, 1334389069,
-	 1730609912, 1854586207,
-	 1556832175, 1228729041,
-	  251375753, 683687209,
-	 2083946182, 1763106152,
-	 2142981854, 1365385561,
-	  763711891, 1735754548,
-	 1581256466, 173689858,
-	 2121337132, 1247108250,
-	 1004003636, 891894307,
-	  569816524, 358675254,
-	  626626425, 116062841,
-	  632086003, 861268491,
-	 1008211580, 779404957,
-	 1134217766, 1766838261,
-	 1423829292, 1706666192,
-	  942037869, 1549358884,
-	 1959429535, 480779114,
-	  778311037, 1940360875,
-	 1531372185, 2009078158,
-	  241935492, 1050047003,
-	  272453504, 1870883868,
-	  390441332, 1057903098,
-	 1230238834, 1548117688,
-	 1242956379, 1217296445,
-	  515648357, 1675011378,
-	  364477932, 355212934,
-	 2096008713, 1570161804,
-	 1409752526, 214033983,
-	 1288158292, 1760636178,
-	  407562666, 1265144848,
-	 1071056491, 1582316946,
-	 1014143949, 911406955,
-	  203080461, 809380052,
-	  125647866, 1705464126,
-	 2015685843, 599230667,
-	 1425476020, 668203729,
-	 1673735652, 567931803,
-	 1714199325, 181737617,
-	 1389137652, 678147926,
-	  288547803, 435433694,
-	  200159281, 654399753,
-	 1580828223, 1298308945,
-	 1832286107, 169991953,
-	  182557704, 1046541065,
-	 1688025575, 1248944426,
-	 1508287706, 1220577001,
-	   36721212, 1377275347,
-	 1968679856, 1675229747,
-	  279109231, 1835333261,
-	 1358617667, 1416978076,
-	  740626186, 2103913602,
-	 1882655908, 251341858,
-	  648016670, 1459615287,
-	  780255321, 154906988,
-	  857296483, 203375965,
-	 1631676846, 681204578,
-	 1906971307, 1623728832,
-	 1541899600, 1168449797,
-	 1267051693, 1020078717,
-	 1998673940, 1298394942,
-	 1914117058, 1381290704,
-	  426068513, 1381618498,
-	  139365577, 1598767734,
-	 2129910384, 952266588,
-	  661788054, 19661356,
-	 1104640222, 240506063,
-	  356133630, 1676634527,
-	  242242374, 1863206182,
-	  957935844, 1490681416 };
+  // a m*n matrix, just stored as one-dim array
+  // 215 * 2 entries
+  private static final int[] seeds = new int[] {
+       9876, 54321,
+   1299961164, 253987020,
+    669708517, 2079157264,
+    190904760, 417696270,
+   1289741558, 1376336092,
+   1803730167, 324952955,
+    489854550, 582847132,
+   1348037628, 1661577989,
+    350557787, 1155446919,
+    591502945, 634133404,
+   1901084678, 862916278,
+   1988640932, 1785523494,
+   1873836227, 508007031,
+   1146416592, 967585720,
+   1837193353, 1522927634,
+     38219936, 921609208,
+    349152748, 112892610,
+    744459040, 1735807920,
+   1983990104, 728277902,
+    309164507, 2126677523,
+    362993787, 1897782044,
+    556776976, 462072869,
+   1584900822, 2019394912,
+   1249892722, 791083656,
+   1686600998, 1983731097,
+   1127381380, 198976625,
+   1999420861, 1810452455,
+   1972906041, 664182577,
+     84636481, 1291886301,
+   1186362995, 954388413,
+   2141621785, 61738584,
+   1969581251, 1557880415,
+   1150606439, 136325185,
+     95187861, 1592224108,
+    940517655, 1629971798,
+    215350428, 922659102,
+    786161212, 1121345074,
+   1450830056, 1922787776,
+   1696578057, 2025150487,
+   1803414346, 1851324780,
+   1017898585, 1452594263,
+   1184497978, 82122239,
+    633338765, 1829684974,
+    430889421, 230039326,
+    492544653, 76320266,
+    389386975, 1314148944,
+   1720322786, 709120323,
+   1868768216, 1992898523,
+    443210610, 811117710,
+   1191938868, 1548484733,
+    616890172, 159787986,
+    935835339, 1231440405,
+   1058009367, 1527613300,
+   1463148129, 1970575097,
+   1795336935, 434768675,
+    274019517, 605098487,
+    483689317, 217146977,
+   2070804364, 340596558,
+    930226308, 1602100969,
+    989324440, 801809442,
+    410606853, 1893139948,
+   1583588576, 1219225407,
+   2102034391, 1394921405,
+   2005037790, 2031006861,
+   1244218766, 923231061,
+     49312790, 775496649,
+    721012176, 321339902,
+   1719909107, 1865748178,
+   1156177430, 1257110891,
+    307561322, 1918244397,
+    906041433, 360476981,
+   1591375755, 268492659,
+    461522398, 227343256,
+   2145930725, 2020665454,
+   1938419274, 1331283701,
+    174405412, 524140103,
+    494343653,  18063908,
+   1025534808, 181709577,
+   2048959776, 1913665637,
+    950636517, 794796256,
+   1828843197, 1335757744,
+    211109723, 983900607,
+    825474095, 1046009991,
+    374915657, 381856628,
+   1241296328, 698149463,
+   1260624655, 1024538273,
+    900676210, 1628865823,
+    697951025, 500570753,
+   1007920268, 1708398558,
+    264596520, 624727803,
+   1977924811, 674673241,
+   1440257718, 271184151,
+   1928778847, 993535203,
+   1307807366, 1801502463,
+   1498732610, 300876954,
+   1617712402, 1574250679,
+   1261800762, 1556667280,
+    949929273, 560721070,
+   1766170474, 1953522912,
+   1849939248, 19435166,
+    887262858, 1219627824,
+    483086133, 603728993,
+   1330541052, 1582596025,
+   1850591475, 723593133,
+   1431775678, 1558439000,
+    922493739, 1356554404,
+   1058517206, 948567762,
+    709067283, 1350890215,
+   1044787723, 2144304941,
+    999707003, 513837520,
+   2140038663, 1850568788,
+   1803100150, 127574047,
+    867445693, 1149173981,
+    408583729, 914837991,
+   1166715497, 602315845,
+    430738528, 1743308384,
+   1388022681, 1760110496,
+   1664028066, 654300326,
+   1767741172, 1338181197,
+   1625723550, 1742482745,
+    464486085, 1507852127,
+    754082421, 1187454014,
+   1315342834, 425995190,
+    960416608, 2004255418,
+   1262630671, 671761697,
+     59809238, 103525918,
+   1205644919, 2107823293,
+   1615183160, 1152411412,
+   1024474681, 2118672937,
+   1703877649, 1235091369,
+   1821417852, 1098463802,
+   1738806466, 1529062843,
+    620780646, 1654833544,
+   1070174101, 795158254,
+    658537995, 1693620426,
+   2055317555, 508053916,
+   1647371686, 1282395762,
+     29067379, 409683067,
+   1763495989, 1917939635,
+   1602690753, 810926582,
+    885787576, 513818500,
+   1853512561, 1195205756,
+   1798585498, 1970460256,
+   1819261032, 1306536501,
+   1133245275, 37901,
+    689459799, 1334389069,
+   1730609912, 1854586207,
+   1556832175, 1228729041,
+    251375753, 683687209,
+   2083946182, 1763106152,
+   2142981854, 1365385561,
+    763711891, 1735754548,
+   1581256466, 173689858,
+   2121337132, 1247108250,
+   1004003636, 891894307,
+    569816524, 358675254,
+    626626425, 116062841,
+    632086003, 861268491,
+   1008211580, 779404957,
+   1134217766, 1766838261,
+   1423829292, 1706666192,
+    942037869, 1549358884,
+   1959429535, 480779114,
+    778311037, 1940360875,
+   1531372185, 2009078158,
+    241935492, 1050047003,
+    272453504, 1870883868,
+    390441332, 1057903098,
+   1230238834, 1548117688,
+   1242956379, 1217296445,
+    515648357, 1675011378,
+    364477932, 355212934,
+   2096008713, 1570161804,
+   1409752526, 214033983,
+   1288158292, 1760636178,
+    407562666, 1265144848,
+   1071056491, 1582316946,
+   1014143949, 911406955,
+    203080461, 809380052,
+    125647866, 1705464126,
+   2015685843, 599230667,
+   1425476020, 668203729,
+   1673735652, 567931803,
+   1714199325, 181737617,
+   1389137652, 678147926,
+    288547803, 435433694,
+    200159281, 654399753,
+   1580828223, 1298308945,
+   1832286107, 169991953,
+    182557704, 1046541065,
+   1688025575, 1248944426,
+   1508287706, 1220577001,
+     36721212, 1377275347,
+   1968679856, 1675229747,
+    279109231, 1835333261,
+   1358617667, 1416978076,
+    740626186, 2103913602,
+   1882655908, 251341858,
+    648016670, 1459615287,
+    780255321, 154906988,
+    857296483, 203375965,
+   1631676846, 681204578,
+   1906971307, 1623728832,
+   1541899600, 1168449797,
+   1267051693, 1020078717,
+   1998673940, 1298394942,
+   1914117058, 1381290704,
+    426068513, 1381618498,
+    139365577, 1598767734,
+   2129910384, 952266588,
+    661788054, 19661356,
+   1104640222, 240506063,
+    356133630, 1676634527,
+    242242374, 1863206182,
+    957935844, 1490681416 };
 /**
  * Makes this class non instantiable, but still let's others inherit from it.
  */
 protected RandomSeedTable() {
-	throw new RuntimeException("Non instantiable");
+  throw new RuntimeException("Non instantiable");
 }
 /**
  * Returns a deterministic seed from a (seemingly gigantic) matrix of predefined seeds.
@@ -261,27 +259,27 @@
  * @return the seed at the indicated matrix position.
  */
 public static int getSeedAtRowColumn(int row, int column) {
-	// the table is limited; let's snap the unbounded input parameters to the table's actual size.
-	int rows = rows();
-	
-	int theRow = Math.abs(row % rows);
-	int theColumn = Math.abs(column % COLUMNS);
-	
-	int seed = seeds[theRow*COLUMNS + theColumn];
-	
-	// "randomize" the seed (in some ways comparable to hash functions)
-	int cycle = Math.abs(row / rows); 
-	int mask = (( cycle & 0x000007ff ) << 20 ); // cycle==0 --> mask = 0
-	seed = seed ^ mask;  // cycle==0 --> seed stays unaffected
-	// now, each sequence has a period of 10**9 numbers.
-	
-	return seed;
+  // the table is limited; let's snap the unbounded input parameters to the table's actual size.
+  int rows = rows();
+  
+  int theRow = Math.abs(row % rows);
+  int theColumn = Math.abs(column % COLUMNS);
+  
+  int seed = seeds[theRow*COLUMNS + theColumn];
+  
+  // "randomize" the seed (in some ways comparable to hash functions)
+  int cycle = Math.abs(row / rows); 
+  int mask = (( cycle & 0x000007ff ) << 20 ); // cycle==0 --> mask = 0
+  seed = seed ^ mask;  // cycle==0 --> seed stays unaffected
+  // now, each sequence has a period of 10**9 numbers.
+  
+  return seed;
 }
 /**
  * Not yet commented.
  * @return int
  */
 private static int rows() {
-	return seeds.length/COLUMNS;
+  return seeds.length/COLUMNS;
 }
 }
Index: matrix/src/main/java/org/apache/mahout/jet/random/engine/Benchmark.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/jet/random/engine/Benchmark.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/jet/random/engine/Benchmark.java	(working copy)
@@ -75,8 +75,6 @@
  *
  *
  * @see org.apache.mahout.jet.random
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 09/24/99
  */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
@@ -87,167 +85,167 @@
  * Makes this class non instantiable, but still let's others inherit from it.
  */
 protected Benchmark() {
-	throw new RuntimeException("Non instantiable");
+  throw new RuntimeException("Non instantiable");
 }
 /**
  * Benchmarks <tt>raw()</tt> for various uniform generation engines.
  */
 public static void benchmark(int times) {
-	org.apache.mahout.matrix.Timer timer = new org.apache.mahout.matrix.Timer();
-	RandomEngine gen;
+  org.apache.mahout.matrix.Timer timer = new org.apache.mahout.matrix.Timer();
+  RandomEngine gen;
 
-	timer.reset().start();
-	for (int i=times; --i>=0; ) ; // no operation
-	timer.stop().display();
-	float emptyLoop = timer.elapsedTime();
-	System.out.println("empty loop timing done.");
-	
-	gen = new MersenneTwister();
-	System.out.println("\n MersenneTwister:");
-	timer.reset().start();
-	for (int i=times; --i>=0; ) gen.raw();
-	timer.stop().display();
-	System.out.println(times/(timer.elapsedTime()-emptyLoop)+ " numbers per second.");
+  timer.reset().start();
+  for (int i=times; --i>=0; ) ; // no operation
+  timer.stop().display();
+  float emptyLoop = timer.elapsedTime();
+  System.out.println("empty loop timing done.");
+  
+  gen = new MersenneTwister();
+  System.out.println("\n MersenneTwister:");
+  timer.reset().start();
+  for (int i=times; --i>=0; ) gen.raw();
+  timer.stop().display();
+  System.out.println(times/(timer.elapsedTime()-emptyLoop)+ " numbers per second.");
 
-	
-	gen = new MersenneTwister64();
-	System.out.println("\n MersenneTwister64:");
-	timer.reset().start();
-	for (int i=times; --i>=0; ) gen.raw();
-	timer.stop().display();
-	System.out.println(times/(timer.elapsedTime()-emptyLoop)+ " numbers per second.");
-	
-	/*
-	gen = new edu.stanford.mt.MersenneTwister();
-	System.out.println("\n edu.stanford.mt.MersenneTwister:");
-	timer.reset().start();
-	for (int i=times; --i>=0; ) gen.raw();
-	timer.stop().display();
-	System.out.println(times/(timer.elapsedTime()-emptyLoop)+ " numbers per second.");
-	*/
-	
-	
-	gen = new DRand();
-	System.out.println("\nDRand:");
-	timer.reset().start();
-	for (int i=times; --i>=0; ) gen.raw();
-	timer.stop().display();
-	System.out.println(times/(timer.elapsedTime()-emptyLoop)+ " numbers per second.");	
-	
+  
+  gen = new MersenneTwister64();
+  System.out.println("\n MersenneTwister64:");
+  timer.reset().start();
+  for (int i=times; --i>=0; ) gen.raw();
+  timer.stop().display();
+  System.out.println(times/(timer.elapsedTime()-emptyLoop)+ " numbers per second.");
+  
+  /*
+  gen = new edu.stanford.mt.MersenneTwister();
+  System.out.println("\n edu.stanford.mt.MersenneTwister:");
+  timer.reset().start();
+  for (int i=times; --i>=0; ) gen.raw();
+  timer.stop().display();
+  System.out.println(times/(timer.elapsedTime()-emptyLoop)+ " numbers per second.");
+  */
+  
+  
+  gen = new DRand();
+  System.out.println("\nDRand:");
+  timer.reset().start();
+  for (int i=times; --i>=0; ) gen.raw();
+  timer.stop().display();
+  System.out.println(times/(timer.elapsedTime()-emptyLoop)+ " numbers per second.");  
+  
 
-	java.util.Random javaGen = new java.util.Random();
-	System.out.println("\njava.util.Random.nextFloat():");
-	timer.reset().start();
-	for (int i=times; --i>=0; ) javaGen.nextFloat(); // nextDouble() is slower
-	timer.stop().display();
-	System.out.println(times/(timer.elapsedTime()-emptyLoop)+ " numbers per second.");
+  java.util.Random javaGen = new java.util.Random();
+  System.out.println("\njava.util.Random.nextFloat():");
+  timer.reset().start();
+  for (int i=times; --i>=0; ) javaGen.nextFloat(); // nextDouble() is slower
+  timer.stop().display();
+  System.out.println(times/(timer.elapsedTime()-emptyLoop)+ " numbers per second.");
 
-	/*
-	gen = new edu.cornell.lassp.houle.RngPack.Ranecu();
-	System.out.println("\nRanecu:");
-	timer.reset().start();
-	for (int i=times; --i>=0; ) gen.raw();
-	timer.stop().display();
-	System.out.println(times/(timer.elapsedTime()-emptyLoop)+ " numbers per second.");	
-	
-	gen = new edu.cornell.lassp.houle.RngPack.Ranmar();
-	System.out.println("\nRanmar:");
-	timer.reset().start();
-	for (int i=times; --i>=0; ) gen.raw();
-	timer.stop().display();
-	System.out.println(times/(timer.elapsedTime()-emptyLoop)+ " numbers per second.");
+  /*
+  gen = new edu.cornell.lassp.houle.RngPack.Ranecu();
+  System.out.println("\nRanecu:");
+  timer.reset().start();
+  for (int i=times; --i>=0; ) gen.raw();
+  timer.stop().display();
+  System.out.println(times/(timer.elapsedTime()-emptyLoop)+ " numbers per second.");  
+  
+  gen = new edu.cornell.lassp.houle.RngPack.Ranmar();
+  System.out.println("\nRanmar:");
+  timer.reset().start();
+  for (int i=times; --i>=0; ) gen.raw();
+  timer.stop().display();
+  System.out.println(times/(timer.elapsedTime()-emptyLoop)+ " numbers per second.");
 
-	gen = new edu.cornell.lassp.houle.RngPack.Ranlux();
-	System.out.println("\nRanlux:");
-	timer.reset().start();
-	for (int i=times; --i>=0; ) gen.raw();
-	timer.stop().display();
-	System.out.println(times/(timer.elapsedTime()-emptyLoop)+ " numbers per second.");
-	*/
+  gen = new edu.cornell.lassp.houle.RngPack.Ranlux();
+  System.out.println("\nRanlux:");
+  timer.reset().start();
+  for (int i=times; --i>=0; ) gen.raw();
+  timer.stop().display();
+  System.out.println(times/(timer.elapsedTime()-emptyLoop)+ " numbers per second.");
+  */
 
-	System.out.println("\nGood bye.\n");
-	
+  System.out.println("\nGood bye.\n");
+  
 }
 /**
  * Tests various methods of this class.
  */
 public static void main(String args[]) {
-	long from = Long.parseLong(args[0]);
-	long to = Long.parseLong(args[1]);
-	int times = Integer.parseInt(args[2]);
-	int runs = Integer.parseInt(args[3]);
-	//testRandomFromTo(from,to,times);
-	//benchmark(1000000);
-	//benchmark(1000000);
-	for (int i=0; i<runs; i++) {
-		benchmark(times);
-		//benchmarkSync(times);
-	}
+  long from = Long.parseLong(args[0]);
+  long to = Long.parseLong(args[1]);
+  int times = Integer.parseInt(args[2]);
+  int runs = Integer.parseInt(args[3]);
+  //testRandomFromTo(from,to,times);
+  //benchmark(1000000);
+  //benchmark(1000000);
+  for (int i=0; i<runs; i++) {
+    benchmark(times);
+    //benchmarkSync(times);
+  }
 }
 /**
  * Prints the first <tt>size</tt> random numbers generated by the given engine.
  */
 public static void test(int size, RandomEngine randomEngine) {
-	RandomEngine random;
+  RandomEngine random;
 
-	/*
-	System.out.println("raw():");
-	random = (RandomEngine) randomEngine.clone();
-	//org.apache.mahout.matrix.Timer timer = new org.apache.mahout.matrix.Timer().start();
-	for (int j=0, i=size; --i>=0; j++) {
-		System.out.print(" "+random.raw());
-		if (j%8==7) System.out.println();
-	}
+  /*
+  System.out.println("raw():");
+  random = (RandomEngine) randomEngine.clone();
+  //org.apache.mahout.matrix.Timer timer = new org.apache.mahout.matrix.Timer().start();
+  for (int j=0, i=size; --i>=0; j++) {
+    System.out.print(" "+random.raw());
+    if (j%8==7) System.out.println();
+  }
 
-	System.out.println("\n\nfloat():");
-	random = (RandomEngine) randomEngine.clone();
-	for (int j=0, i=size; --i>=0; j++) {
-		System.out.print(" "+random.nextFloat());
-		if (j%8==7) System.out.println();
-	}
+  System.out.println("\n\nfloat():");
+  random = (RandomEngine) randomEngine.clone();
+  for (int j=0, i=size; --i>=0; j++) {
+    System.out.print(" "+random.nextFloat());
+    if (j%8==7) System.out.println();
+  }
 
-	System.out.println("\n\ndouble():");
-	random = (RandomEngine) randomEngine.clone();
-	for (int j=0, i=size; --i>=0; j++) {
-		System.out.print(" "+random.nextDouble());
-		if (j%8==7) System.out.println();
-	}
-	*/
-	System.out.println("\n\nint():");
-	random = (RandomEngine) randomEngine.clone();
-	for (int j=0, i=size; --i>=0; j++) {
-		System.out.print(" "+random.nextInt());
-		if (j%8==7) System.out.println();
-	}
+  System.out.println("\n\ndouble():");
+  random = (RandomEngine) randomEngine.clone();
+  for (int j=0, i=size; --i>=0; j++) {
+    System.out.print(" "+random.nextDouble());
+    if (j%8==7) System.out.println();
+  }
+  */
+  System.out.println("\n\nint():");
+  random = (RandomEngine) randomEngine.clone();
+  for (int j=0, i=size; --i>=0; j++) {
+    System.out.print(" "+random.nextInt());
+    if (j%8==7) System.out.println();
+  }
 
-	//timer.stop().display();
-	System.out.println("\n\nGood bye.\n");
+  //timer.stop().display();
+  System.out.println("\n\nGood bye.\n");
 }
 /**
  * Tests various methods of this class.
  */
 private static void xtestRandomFromTo(long from, long to, int times) {
-	System.out.println("from="+from+", to="+to);
-	
-	//org.apache.mahout.matrix.set.OpenMultiFloatHashSet multiset = new org.apache.mahout.matrix.set.OpenMultiFloatHashSet();
+  System.out.println("from="+from+", to="+to);
+  
+  //org.apache.mahout.matrix.set.OpenMultiFloatHashSet multiset = new org.apache.mahout.matrix.set.OpenMultiFloatHashSet();
 
-	java.util.Random randomJava = new java.util.Random();
-	//edu.cornell.lassp.houle.RngPack.RandomElement random = new edu.cornell.lassp.houle.RngPack.Ranecu();
-	//edu.cornell.lassp.houle.RngPack.RandomElement random = new edu.cornell.lassp.houle.RngPack.MT19937B();
-	//edu.cornell.lassp.houle.RngPack.RandomElement random = new edu.stanford.mt.MersenneTwister();
-	RandomEngine random = new MersenneTwister();
-	int _from=(int)from, _to=(int)to;
-	org.apache.mahout.matrix.Timer timer = new org.apache.mahout.matrix.Timer().start();
-	for (int j=0, i=times; --i>=0; j++) {
-		//randomJava.nextInt(10000);
-		//Integers.randomFromTo(_from,_to);
-		System.out.print(" "+random.raw());
-		if (j%8==7) System.out.println();
-		//multiset.add(nextIntFromTo(_from,_to));
-	}
+  java.util.Random randomJava = new java.util.Random();
+  //edu.cornell.lassp.houle.RngPack.RandomElement random = new edu.cornell.lassp.houle.RngPack.Ranecu();
+  //edu.cornell.lassp.houle.RngPack.RandomElement random = new edu.cornell.lassp.houle.RngPack.MT19937B();
+  //edu.cornell.lassp.houle.RngPack.RandomElement random = new edu.stanford.mt.MersenneTwister();
+  RandomEngine random = new MersenneTwister();
+  int _from=(int)from, _to=(int)to;
+  org.apache.mahout.matrix.Timer timer = new org.apache.mahout.matrix.Timer().start();
+  for (int j=0, i=times; --i>=0; j++) {
+    //randomJava.nextInt(10000);
+    //Integers.randomFromTo(_from,_to);
+    System.out.print(" "+random.raw());
+    if (j%8==7) System.out.println();
+    //multiset.add(nextIntFromTo(_from,_to));
+  }
 
-	timer.stop().display();
-	//System.out.println(multiset); //check the distribution
-	System.out.println("Good bye.\n");
+  timer.stop().display();
+  //System.out.println(multiset); //check the distribution
+  System.out.println("Good bye.\n");
 }
 }
Index: matrix/src/main/java/org/apache/mahout/jet/random/engine/MersenneTwister.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/jet/random/engine/MersenneTwister.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/jet/random/engine/MersenneTwister.java	(working copy)
@@ -23,19 +23,19 @@
 Be aware, however, that there is a non-negligible amount of overhead required to initialize the data
 structures used by a MersenneTwister. Code like
 <pre>
-	double sum = 0.0;
-	for (int i=0; i<100000; ++i) {
-	   RandomElement twister = new MersenneTwister(new java.util.Date());
-	   sum += twister.raw();
-	}
+  double sum = 0.0;
+  for (int i=0; i<100000; ++i) {
+     RandomElement twister = new MersenneTwister(new java.util.Date());
+     sum += twister.raw();
+  }
 </pre>
 will be wildly inefficient. Consider using
 <pre>
-	double sum = 0.0;
-	RandomElement twister = new MersenneTwister(new java.util.Date());
-	for (int i=0; i<100000; ++i) {
-	   sum += twister.raw();
-	}
+  double sum = 0.0;
+  RandomElement twister = new MersenneTwister(new java.util.Date());
+  for (int i=0; i<100000; ++i) {
+     sum += twister.raw();
+  }
 </pre>
 instead.  This allows the cost of constructing the MersenneTwister object
 to be borne only once, rather than once for each iteration in the loop.
@@ -65,36 +65,36 @@
 <div align="center">
 <table width="75%" border="1" cellspacing="0" cellpadding="0">
   <tr> 
-	<td width="2%"> <div align="center">n</div> </td>
-	<td width="6%"> <div align="center">1</div> </td>
-	<td width="5%"> <div align="center">2</div> </td>
-	<td width="5%"> <div align="center">3</div> </td>
-	<td width="5%"> <div align="center">4</div> </td>
-	<td width="5%"> <div align="center">5</div> </td>
-	<td width="5%"> <div align="center">6</div> </td>
-	<td width="5%"> <div align="center">7</div> </td>
-	<td width="5%"> <div align="center">8</div> </td>
-	<td width="5%"> <div align="center">9</div> </td>
-	<td width="5%"> <div align="center">10</div> </td>
-	<td width="5%"> <div align="center">11</div> </td>
-	<td width="10%"> <div align="center">12 .. 16</div> </td>
-	<td width="10%"> <div align="center">17 .. 32</div> </td>
+  <td width="2%"> <div align="center">n</div> </td>
+  <td width="6%"> <div align="center">1</div> </td>
+  <td width="5%"> <div align="center">2</div> </td>
+  <td width="5%"> <div align="center">3</div> </td>
+  <td width="5%"> <div align="center">4</div> </td>
+  <td width="5%"> <div align="center">5</div> </td>
+  <td width="5%"> <div align="center">6</div> </td>
+  <td width="5%"> <div align="center">7</div> </td>
+  <td width="5%"> <div align="center">8</div> </td>
+  <td width="5%"> <div align="center">9</div> </td>
+  <td width="5%"> <div align="center">10</div> </td>
+  <td width="5%"> <div align="center">11</div> </td>
+  <td width="10%"> <div align="center">12 .. 16</div> </td>
+  <td width="10%"> <div align="center">17 .. 32</div> </td>
   </tr>
   <tr> 
-	<td width="2%"> <div align="center">k</div> </td>
-	<td width="6%"> <div align="center">19937</div> </td>
-	<td width="5%"> <div align="center">9968</div> </td>
-	<td width="5%"> <div align="center">6240</div> </td>
-	<td width="5%"> <div align="center">4984</div> </td>
-	<td width="5%"> <div align="center">3738</div> </td>
-	<td width="5%"> <div align="center">3115</div> </td>
-	<td width="5%"> <div align="center">2493</div> </td>
-	<td width="5%"> <div align="center">2492</div> </td>
-	<td width="5%"> <div align="center">1869</div> </td>
-	<td width="5%"> <div align="center">1869</div> </td>
-	<td width="5%"> <div align="center">1248</div> </td>
-	<td width="10%"> <div align="center">1246</div> </td>
-	<td width="10%"> <div align="center">623</div> </td>
+  <td width="2%"> <div align="center">k</div> </td>
+  <td width="6%"> <div align="center">19937</div> </td>
+  <td width="5%"> <div align="center">9968</div> </td>
+  <td width="5%"> <div align="center">6240</div> </td>
+  <td width="5%"> <div align="center">4984</div> </td>
+  <td width="5%"> <div align="center">3738</div> </td>
+  <td width="5%"> <div align="center">3115</div> </td>
+  <td width="5%"> <div align="center">2493</div> </td>
+  <td width="5%"> <div align="center">2492</div> </td>
+  <td width="5%"> <div align="center">1869</div> </td>
+  <td width="5%"> <div align="center">1869</div> </td>
+  <td width="5%"> <div align="center">1248</div> </td>
+  <td width="10%"> <div align="center">1246</div> </td>
+  <td width="10%"> <div align="center">623</div> </td>
   </tr>
 </table>
 </div>
@@ -115,39 +115,39 @@
  */
 @Deprecated
 public class MersenneTwister extends RandomEngine {
-	private int mti;
-	private int[] mt = new int[N]; /* set initial seeds: N = 624 words */
+  private int mti;
+  private int[] mt = new int[N]; /* set initial seeds: N = 624 words */
 
-	/* Period parameters */  
-	private static final int N=624;
-	private static final int M=397;
-	private static final int MATRIX_A=0x9908b0df;   /* constant vector a */
-	private static final int UPPER_MASK=0x80000000; /* most significant w-r bits */
-	private static final int LOWER_MASK=0x7fffffff; /* least significant r bits */
+  /* Period parameters */  
+  private static final int N=624;
+  private static final int M=397;
+  private static final int MATRIX_A=0x9908b0df;   /* constant vector a */
+  private static final int UPPER_MASK=0x80000000; /* most significant w-r bits */
+  private static final int LOWER_MASK=0x7fffffff; /* least significant r bits */
 
-	/* for tempering */   
-	private static final int TEMPERING_MASK_B=0x9d2c5680;
-	private static final int TEMPERING_MASK_C=0xefc60000;
-	  
-	private static final int mag0 = 0x0;
-	private static final int mag1 = MATRIX_A;
-	//private static final int[] mag01=new int[] {0x0, MATRIX_A};
-	/* mag01[x] = x * MATRIX_A  for x=0,1 */
+  /* for tempering */   
+  private static final int TEMPERING_MASK_B=0x9d2c5680;
+  private static final int TEMPERING_MASK_C=0xefc60000;
+    
+  private static final int mag0 = 0x0;
+  private static final int mag1 = MATRIX_A;
+  //private static final int[] mag01=new int[] {0x0, MATRIX_A};
+  /* mag01[x] = x * MATRIX_A  for x=0,1 */
 
-	public static final int DEFAULT_SEED = 4357;
+  public static final int DEFAULT_SEED = 4357;
 /**
  * Constructs and returns a random number generator with a default seed, which is a <b>constant</b>.
  * Thus using this constructor will yield generators that always produce exactly the same sequence.
  * This method is mainly intended to ease testing and debugging.
  */
 public MersenneTwister() {
-	this(DEFAULT_SEED);
+  this(DEFAULT_SEED);
 }
 /**
  * Constructs and returns a random number generator with the given seed.
  */
 public MersenneTwister(int seed) {
-	setSeed(seed);
+  setSeed(seed);
 }
 /**
  * Constructs and returns a random number generator seeded with the given date.
@@ -155,7 +155,7 @@
  * @param d typically <tt>new java.util.Date()</tt>
  */
 public MersenneTwister(Date d) {
-	this((int)d.getTime());
+  this((int)d.getTime());
 }
 /**
  * Returns a copy of the receiver; the copy will produce identical sequences.
@@ -164,104 +164,104 @@
  * @return a copy of the receiver.
  */
 public Object clone() {
-	MersenneTwister clone = (MersenneTwister) super.clone();
-	clone.mt = (int[]) this.mt.clone();
-	return clone;
+  MersenneTwister clone = (MersenneTwister) super.clone();
+  clone.mt = (int[]) this.mt.clone();
+  return clone;
 }
 /**
  * Generates N words at one time.
  */
 protected void nextBlock() {
-	/*
-	// ******************** OPTIMIZED **********************
-	// only 5-10% faster ?
-	int y;
+  /*
+  // ******************** OPTIMIZED **********************
+  // only 5-10% faster ?
+  int y;
   
-	int kk;
-	int[] cache = mt; // cached for speed
-	int kkM;
-	int limit = N-M;
-	for (kk=0,kkM=kk+M; kk<limit; kk++,kkM++) {
-		y = (cache[kk]&UPPER_MASK)|(cache[kk+1]&LOWER_MASK);
-		cache[kk] = cache[kkM] ^ (y >>> 1) ^ ((y & 0x1) == 0 ? mag0 : mag1);
-	}
-	limit = N-1;
-	for (kkM=kk+(M-N); kk<limit; kk++,kkM++) {
-		y = (cache[kk]&UPPER_MASK)|(cache[kk+1]&LOWER_MASK);
-		cache[kk] = cache[kkM] ^ (y >>> 1) ^ ((y & 0x1) == 0 ? mag0 : mag1);
-	}
-	y = (cache[N-1]&UPPER_MASK)|(cache[0]&LOWER_MASK);
-	cache[N-1] = cache[M-1] ^ (y >>> 1) ^ ((y & 0x1) == 0 ? mag0 : mag1);
+  int kk;
+  int[] cache = mt; // cached for speed
+  int kkM;
+  int limit = N-M;
+  for (kk=0,kkM=kk+M; kk<limit; kk++,kkM++) {
+    y = (cache[kk]&UPPER_MASK)|(cache[kk+1]&LOWER_MASK);
+    cache[kk] = cache[kkM] ^ (y >>> 1) ^ ((y & 0x1) == 0 ? mag0 : mag1);
+  }
+  limit = N-1;
+  for (kkM=kk+(M-N); kk<limit; kk++,kkM++) {
+    y = (cache[kk]&UPPER_MASK)|(cache[kk+1]&LOWER_MASK);
+    cache[kk] = cache[kkM] ^ (y >>> 1) ^ ((y & 0x1) == 0 ? mag0 : mag1);
+  }
+  y = (cache[N-1]&UPPER_MASK)|(cache[0]&LOWER_MASK);
+  cache[N-1] = cache[M-1] ^ (y >>> 1) ^ ((y & 0x1) == 0 ? mag0 : mag1);
 
-	this.mt = cache;
-	this.mti = 0;
-	*/
-	
+  this.mt = cache;
+  this.mti = 0;
+  */
+  
 
-	
-	// ******************** UNOPTIMIZED **********************
-	int y;
   
-	int kk;
-	
-	for (kk=0;kk<N-M;kk++) {
-		y = (mt[kk]&UPPER_MASK)|(mt[kk+1]&LOWER_MASK);
-		mt[kk] = mt[kk+M] ^ (y >>> 1) ^ ((y & 0x1) == 0 ? mag0 : mag1);
-	}
-	for (;kk<N-1;kk++) {
-		y = (mt[kk]&UPPER_MASK)|(mt[kk+1]&LOWER_MASK);
-		mt[kk] = mt[kk+(M-N)] ^ (y >>> 1) ^ ((y & 0x1) == 0 ? mag0 : mag1);
-	}
-	y = (mt[N-1]&UPPER_MASK)|(mt[0]&LOWER_MASK);
-	mt[N-1] = mt[M-1] ^ (y >>> 1) ^ ((y & 0x1) == 0 ? mag0 : mag1);
+  // ******************** UNOPTIMIZED **********************
+  int y;
+  
+  int kk;
+  
+  for (kk=0;kk<N-M;kk++) {
+    y = (mt[kk]&UPPER_MASK)|(mt[kk+1]&LOWER_MASK);
+    mt[kk] = mt[kk+M] ^ (y >>> 1) ^ ((y & 0x1) == 0 ? mag0 : mag1);
+  }
+  for (;kk<N-1;kk++) {
+    y = (mt[kk]&UPPER_MASK)|(mt[kk+1]&LOWER_MASK);
+    mt[kk] = mt[kk+(M-N)] ^ (y >>> 1) ^ ((y & 0x1) == 0 ? mag0 : mag1);
+  }
+  y = (mt[N-1]&UPPER_MASK)|(mt[0]&LOWER_MASK);
+  mt[N-1] = mt[M-1] ^ (y >>> 1) ^ ((y & 0x1) == 0 ? mag0 : mag1);
 
-	this.mti = 0;
-	
+  this.mti = 0;
+  
 }
 /**
  * Returns a 32 bit uniformly distributed random number in the closed interval <tt>[Integer.MIN_VALUE,Integer.MAX_VALUE]</tt> (including <tt>Integer.MIN_VALUE</tt> and <tt>Integer.MAX_VALUE</tt>).
  */
 public int nextInt() {
-	/* Each single bit including the sign bit will be random */
-  	if (mti == N) nextBlock(); // generate N ints at one time
+  /* Each single bit including the sign bit will be random */
+    if (mti == N) nextBlock(); // generate N ints at one time
 
-	int y = mt[mti++];
-	y ^= y >>> 11; // y ^= TEMPERING_SHIFT_U(y );
-	y ^= (y << 7) & TEMPERING_MASK_B; // y ^= TEMPERING_SHIFT_S(y) & TEMPERING_MASK_B;
-	y ^= (y << 15) & TEMPERING_MASK_C; // y ^= TEMPERING_SHIFT_T(y) & TEMPERING_MASK_C;	
-	// y &= 0xffffffff; //you may delete this line if word size = 32 
-	y ^= y >>> 18; // y ^= TEMPERING_SHIFT_L(y);
+  int y = mt[mti++];
+  y ^= y >>> 11; // y ^= TEMPERING_SHIFT_U(y );
+  y ^= (y << 7) & TEMPERING_MASK_B; // y ^= TEMPERING_SHIFT_S(y) & TEMPERING_MASK_B;
+  y ^= (y << 15) & TEMPERING_MASK_C; // y ^= TEMPERING_SHIFT_T(y) & TEMPERING_MASK_C;  
+  // y &= 0xffffffff; //you may delete this line if word size = 32 
+  y ^= y >>> 18; // y ^= TEMPERING_SHIFT_L(y);
 
-	return y;
+  return y;
 }
 /**
  * Sets the receiver's seed. 
  * This method resets the receiver's entire internal state.
  */
 protected void setSeed(int seed) {
-	mt[0] = seed & 0xffffffff;
-	for (int i = 1; i < N; i++) {
-		mt[i] = (1812433253 * (mt[i-1] ^ (mt[i-1] >> 30)) + i); 
-		/* See Knuth TAOCP Vol2. 3rd Ed. P.106 for multiplier. */
-		/* In the previous versions, MSBs of the seed affect   */
-		/* only MSBs of the array mt[].                        */
-		/* 2002/01/09 modified by Makoto Matsumoto             */
-		mt[i] &= 0xffffffff;
-		/* for >32 bit machines */
- 	}
-	//System.out.println("init done");
-	mti = N;
+  mt[0] = seed & 0xffffffff;
+  for (int i = 1; i < N; i++) {
+    mt[i] = (1812433253 * (mt[i-1] ^ (mt[i-1] >> 30)) + i); 
+    /* See Knuth TAOCP Vol2. 3rd Ed. P.106 for multiplier. */
+    /* In the previous versions, MSBs of the seed affect   */
+    /* only MSBs of the array mt[].                        */
+    /* 2002/01/09 modified by Makoto Matsumoto             */
+    mt[i] &= 0xffffffff;
+    /* for >32 bit machines */
+   }
+  //System.out.println("init done");
+  mti = N;
 
-	/*
-	old version was:	
-	for (int i = 0; i < N; i++) {
-		mt[i] = seed & 0xffff0000;
-		seed = 69069 * seed + 1;
-		mt[i] |= (seed & 0xffff0000) >>> 16;
-		seed = 69069 * seed + 1;
- 	}
-	//System.out.println("init done");
-	mti = N;
-	*/
+  /*
+  old version was:  
+  for (int i = 0; i < N; i++) {
+    mt[i] = seed & 0xffff0000;
+    seed = 69069 * seed + 1;
+    mt[i] |= (seed & 0xffff0000) >>> 16;
+    seed = 69069 * seed + 1;
+   }
+  //System.out.println("init done");
+  mti = N;
+  */
 }
 }
Index: matrix/src/main/java/org/apache/mahout/jet/random/HyperGeometric.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/jet/random/HyperGeometric.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/jet/random/HyperGeometric.java	(working copy)
@@ -32,43 +32,41 @@
  * H. Zechner (1994): Efficient sampling from continuous and discrete unimodal distributions,
  * Doctoral Dissertation, 156 pp., Technical University Graz, Austria.
  *
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 09/24/99
  */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
  */
 @Deprecated
 public class HyperGeometric extends AbstractDiscreteDistribution {
-	protected       int my_N;
-	protected       int my_s;
-	protected       int my_n;
+  protected       int my_N;
+  protected       int my_s;
+  protected       int my_n;
 
-	// cached vars shared by hmdu(...) and hprs(...)
-	private int     N_last = -1, M_last = -1, n_last = -1;
-	private int     N_Mn, m;
+  // cached vars shared by hmdu(...) and hprs(...)
+  private int     N_last = -1, M_last = -1, n_last = -1;
+  private int     N_Mn, m;
 
-	// cached vars for hmdu(...)
-	private int     mp, b;
-	private double  Mp, np, fm;
+  // cached vars for hmdu(...)
+  private int     mp, b;
+  private double  Mp, np, fm;
 
-	// cached vars for hprs(...)
-	private int     k2, k4, k1, k5;
-	private double  dl, dr, r1, r2, r4, r5, ll, lr, c_pm,
-					f1, f2, f4, f5, p1, p2, p3, p4, p5, p6; 
+  // cached vars for hprs(...)
+  private int     k2, k4, k1, k5;
+  private double  dl, dr, r1, r2, r4, r5, ll, lr, c_pm,
+          f1, f2, f4, f5, p1, p2, p3, p4, p5, p6; 
 
-	
-	// The uniform random number generated shared by all <b>static</b> methods.
-	protected static HyperGeometric shared = new HyperGeometric(1,1,1,makeDefaultGenerator());
+  
+  // The uniform random number generated shared by all <b>static</b> methods.
+  protected static HyperGeometric shared = new HyperGeometric(1,1,1,makeDefaultGenerator());
 /**
  * Constructs a HyperGeometric distribution.
  */
 public HyperGeometric(int N, int s, int n, RandomEngine randomGenerator) {
-	setRandomGenerator(randomGenerator);
-	setState(N,s,n);
+  setRandomGenerator(randomGenerator);
+  setState(N,s,n);
 }
 private static double fc_lnpk(int k, int N_Mn, int M, int n) {
-	return(Arithmetic.logFactorial(k) + Arithmetic.logFactorial(M - k) + Arithmetic.logFactorial(n - k) + Arithmetic.logFactorial(N_Mn + k));
+  return(Arithmetic.logFactorial(k) + Arithmetic.logFactorial(M - k) + Arithmetic.logFactorial(n - k) + Arithmetic.logFactorial(N_Mn + k));
 }
 /**
  * Returns a random number from the distribution.
@@ -79,209 +77,209 @@
   double              p, nu, c, d, U;
 
   if (N != N_last || M != M_last || n != n_last) {   // set-up           */
-		N_last = N;
-	 M_last = M;
-	 n_last = n;
+    N_last = N;
+   M_last = M;
+   n_last = n;
 
-	 Mp = (double) (M + 1);
-	 np = (double) (n + 1);  N_Mn = N - M - n;
+   Mp = (double) (M + 1);
+   np = (double) (n + 1);  N_Mn = N - M - n;
 
-	 p  = Mp / (N + 2.0);
-	 nu = np * p;                             /* mode, real       */
-	 if ((m = (int) nu) == nu && p == 0.5) {     /* mode, integer    */
-		mp = m--;
-	 }
-	 else {
-		mp = m + 1;                           /* mp = m + 1       */
-		}
+   p  = Mp / (N + 2.0);
+   nu = np * p;                             /* mode, real       */
+   if ((m = (int) nu) == nu && p == 0.5) {     /* mode, integer    */
+    mp = m--;
+   }
+   else {
+    mp = m + 1;                           /* mp = m + 1       */
+    }
 
  /* mode probability, using the external function flogfak(k) = ln(k!)    */
-	 fm = Math.exp(Arithmetic.logFactorial(N - M) - Arithmetic.logFactorial(N_Mn + m) - Arithmetic.logFactorial(n - m)
-		 + Arithmetic.logFactorial(M)     - Arithmetic.logFactorial(M - m)    - Arithmetic.logFactorial(m)
-		 - Arithmetic.logFactorial(N)     + Arithmetic.logFactorial(N - n)    + Arithmetic.logFactorial(n)   );
+   fm = Math.exp(Arithmetic.logFactorial(N - M) - Arithmetic.logFactorial(N_Mn + m) - Arithmetic.logFactorial(n - m)
+     + Arithmetic.logFactorial(M)     - Arithmetic.logFactorial(M - m)    - Arithmetic.logFactorial(m)
+     - Arithmetic.logFactorial(N)     + Arithmetic.logFactorial(N - n)    + Arithmetic.logFactorial(n)   );
 
  /* safety bound  -  guarantees at least 17 significant decimal digits   */
  /*                  b = min(n, (long int)(nu + k*c')) */
-		b = (int) (nu + 11.0 * Math.sqrt(nu * (1.0 - p) * (1.0 - n/(double)N) + 1.0));	
-		if (b > n) b = n;
-	}
+    b = (int) (nu + 11.0 * Math.sqrt(nu * (1.0 - p) * (1.0 - n/(double)N) + 1.0));  
+    if (b > n) b = n;
+  }
 
-	for (;;) {
-		if ((U = randomGenerator.raw() - fm) <= 0.0)  return(m);
-		c = d = fm;
+  for (;;) {
+    if ((U = randomGenerator.raw() - fm) <= 0.0)  return(m);
+    c = d = fm;
 
  /* down- and upward search from the mode                                */
-		for (I = 1; I <= m; I++) {
-			K  = mp - I;                                   /* downward search  */
-			c *= (double)K/(np - K) * ((double)(N_Mn + K)/(Mp - K));
-			if ((U -= c) <= 0.0)  return(K - 1);
+    for (I = 1; I <= m; I++) {
+      K  = mp - I;                                   /* downward search  */
+      c *= (double)K/(np - K) * ((double)(N_Mn + K)/(Mp - K));
+      if ((U -= c) <= 0.0)  return(K - 1);
 
-			K  = m + I;                                    /* upward search    */
-			d *= (np - K)/(double)K * ((Mp - K)/(double)(N_Mn + K));
-			if ((U -= d) <= 0.0)  return(K);
-		}
+      K  = m + I;                                    /* upward search    */
+      d *= (np - K)/(double)K * ((Mp - K)/(double)(N_Mn + K));
+      if ((U -= d) <= 0.0)  return(K);
+    }
 
  /* upward search from K = 2m + 1 to K = b                               */
-		for (K = mp + m; K <= b; K++) {
-			d *= (np - K)/(double)K * ((Mp - K)/(double)(N_Mn + K));
-			if ((U -= d) <= 0.0)  return(K);
-		}
-	}
+    for (K = mp + m; K <= b; K++) {
+      d *= (np - K)/(double)K * ((Mp - K)/(double)(N_Mn + K));
+      if ((U -= d) <= 0.0)  return(K);
+    }
+  }
 }
 /**
  * Returns a random number from the distribution.
  */
 protected int hprs(int N, int M, int n,  RandomEngine randomGenerator) {
-	int    Dk, X, V;
-	double Mp, np, p, nu, U, Y, W;       /* (X, Y) <-> (V, W) */
+  int    Dk, X, V;
+  double Mp, np, p, nu, U, Y, W;       /* (X, Y) <-> (V, W) */
 
-	if (N != N_last || M != M_last || n != n_last) {  /* set-up            */
-		N_last = N;
-		M_last = M;
-		n_last = n;
+  if (N != N_last || M != M_last || n != n_last) {  /* set-up            */
+    N_last = N;
+    M_last = M;
+    n_last = n;
 
-		Mp = (double) (M + 1);
-		np = (double) (n + 1);  N_Mn = N - M - n;
+    Mp = (double) (M + 1);
+    np = (double) (n + 1);  N_Mn = N - M - n;
 
-		p  = Mp / (N + 2.0);  nu = np * p;              // main parameters   
+    p  = Mp / (N + 2.0);  nu = np * p;              // main parameters   
 
-		// approximate deviation of reflection points k2, k4 from nu - 1/2      
-		U  = Math.sqrt(nu * (1.0 - p) * (1.0 - (n + 2.0)/(N + 3.0)) + 0.25);
+    // approximate deviation of reflection points k2, k4 from nu - 1/2      
+    U  = Math.sqrt(nu * (1.0 - p) * (1.0 - (n + 2.0)/(N + 3.0)) + 0.25);
 
-		// mode m, reflection points k2 and k4, and points k1 and k5, which    
-		// delimit the centre region of h(x)                                   
-		// k2 = ceil (nu - 1/2 - U),    k1 = 2*k2 - (m - 1 + delta_ml)          
-		// k4 = floor(nu - 1/2 + U),    k5 = 2*k4 - (m + 1 - delta_mr)         
+    // mode m, reflection points k2 and k4, and points k1 and k5, which    
+    // delimit the centre region of h(x)                                   
+    // k2 = ceil (nu - 1/2 - U),    k1 = 2*k2 - (m - 1 + delta_ml)          
+    // k4 = floor(nu - 1/2 + U),    k5 = 2*k4 - (m + 1 - delta_mr)         
    
-		m  = (int) nu;
-		k2 = (int) Math.ceil(nu - 0.5 - U);  if (k2 >= m)  k2 = m - 1;
-		k4 = (int)     (nu - 0.5 + U);
-		k1 = k2 + k2 - m + 1;            				// delta_ml = 0      
-		k5 = k4 + k4 - m;                               // delta_mr = 1      
+    m  = (int) nu;
+    k2 = (int) Math.ceil(nu - 0.5 - U);  if (k2 >= m)  k2 = m - 1;
+    k4 = (int)     (nu - 0.5 + U);
+    k1 = k2 + k2 - m + 1;                    // delta_ml = 0      
+    k5 = k4 + k4 - m;                               // delta_mr = 1      
 
-		// range width of the critical left and right centre region             
-		dl = (double) (k2 - k1);
-		dr = (double) (k5 - k4);
+    // range width of the critical left and right centre region             
+    dl = (double) (k2 - k1);
+    dr = (double) (k5 - k4);
 
-		// recurrence constants r(k) = p(k)/p(k-1) at k = k1, k2, k4+1, k5+1    
-		r1 = (np/(double) k1       - 1.0) * (Mp - k1)/(double)(N_Mn + k1);
-		r2 = (np/(double) k2       - 1.0) * (Mp - k2)/(double)(N_Mn + k2);
-		r4 = (np/(double)(k4 + 1) - 1.0) * (M  - k4)/(double)(N_Mn + k4 + 1);
-		r5 = (np/(double)(k5 + 1) - 1.0) * (M  - k5)/(double)(N_Mn + k5 + 1);
+    // recurrence constants r(k) = p(k)/p(k-1) at k = k1, k2, k4+1, k5+1    
+    r1 = (np/(double) k1       - 1.0) * (Mp - k1)/(double)(N_Mn + k1);
+    r2 = (np/(double) k2       - 1.0) * (Mp - k2)/(double)(N_Mn + k2);
+    r4 = (np/(double)(k4 + 1) - 1.0) * (M  - k4)/(double)(N_Mn + k4 + 1);
+    r5 = (np/(double)(k5 + 1) - 1.0) * (M  - k5)/(double)(N_Mn + k5 + 1);
 
-		// reciprocal values of the scale parameters of expon. tail envelopes   
-		ll =  Math.log(r1);                                  // expon. tail left  //
-		lr = -Math.log(r5);                                  // expon. tail right //
+    // reciprocal values of the scale parameters of expon. tail envelopes   
+    ll =  Math.log(r1);                                  // expon. tail left  //
+    lr = -Math.log(r5);                                  // expon. tail right //
 
-		// hypergeom. constant, necessary for computing function values f(k)    
-		c_pm = fc_lnpk(m, N_Mn, M, n);
+    // hypergeom. constant, necessary for computing function values f(k)    
+    c_pm = fc_lnpk(m, N_Mn, M, n);
 
-		// function values f(k) = p(k)/p(m)  at  k = k2, k4, k1, k5             
-		f2 = Math.exp(c_pm - fc_lnpk(k2, N_Mn, M, n));
-		f4 = Math.exp(c_pm - fc_lnpk(k4, N_Mn, M, n));
-		f1 = Math.exp(c_pm - fc_lnpk(k1, N_Mn, M, n));
-		f5 = Math.exp(c_pm - fc_lnpk(k5, N_Mn, M, n));
+    // function values f(k) = p(k)/p(m)  at  k = k2, k4, k1, k5             
+    f2 = Math.exp(c_pm - fc_lnpk(k2, N_Mn, M, n));
+    f4 = Math.exp(c_pm - fc_lnpk(k4, N_Mn, M, n));
+    f1 = Math.exp(c_pm - fc_lnpk(k1, N_Mn, M, n));
+    f5 = Math.exp(c_pm - fc_lnpk(k5, N_Mn, M, n));
 
-		// area of the two centre and the two exponential tail regions  
-		// area of the two immediate acceptance regions between k2, k4
-		p1 = f2 * (dl + 1.0);                           // immed. left       
-		p2 = f2 * dl         + p1;                      // centre left       
-		p3 = f4 * (dr + 1.0) + p2;                      // immed. right      
-		p4 = f4 * dr         + p3;                      // centre right      
-		p5 = f1 / ll         + p4;                      // expon. tail left  
-		p6 = f5 / lr         + p5;                      // expon. tail right 
-	}
+    // area of the two centre and the two exponential tail regions  
+    // area of the two immediate acceptance regions between k2, k4
+    p1 = f2 * (dl + 1.0);                           // immed. left       
+    p2 = f2 * dl         + p1;                      // centre left       
+    p3 = f4 * (dr + 1.0) + p2;                      // immed. right      
+    p4 = f4 * dr         + p3;                      // centre right      
+    p5 = f1 / ll         + p4;                      // expon. tail left  
+    p6 = f5 / lr         + p5;                      // expon. tail right 
+  }
 
-	for (;;) {
-		// generate uniform number U -- U(0, p6)                                
-		// case distinction corresponding to U                                  
-		if ((U = randomGenerator.raw() * p6) < p2) {    // centre left       
+  for (;;) {
+    // generate uniform number U -- U(0, p6)                                
+    // case distinction corresponding to U                                  
+    if ((U = randomGenerator.raw() * p6) < p2) {    // centre left       
 
-			// immediate acceptance region R2 = [k2, m) *[0, f2),  X = k2, ... m -1 
-			if ((W = U - p1) < 0.0)  return(k2 + (int)(U/f2));
-			// immediate acceptance region R1 = [k1, k2)*[0, f1),  X = k1, ... k2-1 
-			if ((Y = W / dl) < f1 )  return(k1 + (int)(W/f1));
+      // immediate acceptance region R2 = [k2, m) *[0, f2),  X = k2, ... m -1 
+      if ((W = U - p1) < 0.0)  return(k2 + (int)(U/f2));
+      // immediate acceptance region R1 = [k1, k2)*[0, f1),  X = k1, ... k2-1 
+      if ((Y = W / dl) < f1 )  return(k1 + (int)(W/f1));
 
-			// computation of candidate X < k2, and its counterpart V > k2          
-			// either squeeze-acceptance of X or acceptance-rejection of V          
-			Dk = (int)(dl * randomGenerator.raw()) + 1;
-			if (Y <= f2 - Dk * (f2 - f2/r2)) {            // quick accept of   
-				return(k2 - Dk);                          // X = k2 - Dk       
-			}
-			if ((W = f2 + f2 - Y) < 1.0) {                // quick reject of V 
-				V = k2 + Dk;
-				if (W <= f2 + Dk * (1.0 - f2)/(dl + 1.0)) { // quick accept of   
-					return(V);                              // V = k2 + Dk       
-				}
-				if (Math.log(W) <= c_pm - fc_lnpk(V, N_Mn, M, n)) {
-					return(V);               // final accept of V 
-				}
-			}
-			X = k2 - Dk;
-		}
-		else if (U < p4) {                              // centre right      
+      // computation of candidate X < k2, and its counterpart V > k2          
+      // either squeeze-acceptance of X or acceptance-rejection of V          
+      Dk = (int)(dl * randomGenerator.raw()) + 1;
+      if (Y <= f2 - Dk * (f2 - f2/r2)) {            // quick accept of   
+        return(k2 - Dk);                          // X = k2 - Dk       
+      }
+      if ((W = f2 + f2 - Y) < 1.0) {                // quick reject of V 
+        V = k2 + Dk;
+        if (W <= f2 + Dk * (1.0 - f2)/(dl + 1.0)) { // quick accept of   
+          return(V);                              // V = k2 + Dk       
+        }
+        if (Math.log(W) <= c_pm - fc_lnpk(V, N_Mn, M, n)) {
+          return(V);               // final accept of V 
+        }
+      }
+      X = k2 - Dk;
+    }
+    else if (U < p4) {                              // centre right      
 
-			// immediate acceptance region R3 = [m, k4+1)*[0, f4), X = m, ... k4    
-			if ((W = U - p3) < 0.0)  return(k4 - (int)((U - p2)/f4));
-			// immediate acceptance region R4 = [k4+1, k5+1)*[0, f5)              
-			if ((Y = W / dr) < f5 )  return(k5 - (int)(W/f5));
+      // immediate acceptance region R3 = [m, k4+1)*[0, f4), X = m, ... k4    
+      if ((W = U - p3) < 0.0)  return(k4 - (int)((U - p2)/f4));
+      // immediate acceptance region R4 = [k4+1, k5+1)*[0, f5)              
+      if ((Y = W / dr) < f5 )  return(k5 - (int)(W/f5));
 
-			// computation of candidate X > k4, and its counterpart V < k4          
-			// either squeeze-acceptance of X or acceptance-rejection of V          
-			Dk = (int)(dr * randomGenerator.raw()) + 1;
-			if (Y <= f4 - Dk * (f4 - f4*r4)) {            // quick accept of   
-				return(k4 + Dk);                          // X = k4 + Dk     
-			}
-			if ((W = f4 + f4 - Y) < 1.0) {                // quick reject of V
-				V = k4 - Dk;
-				if (W <= f4 + Dk * (1.0 - f4)/dr) {       // quick accept of   
-					return(V);                            // V = k4 - Dk       
-				}
-				if (Math.log(W) <= c_pm - fc_lnpk(V, N_Mn, M, n)) {
-					return(V);                            // final accept of V 
-				}
-			}
-			X = k4 + Dk;
-		}
-		else {
-			Y = randomGenerator.raw();
-			if (U < p5) {                                 // expon. tail left  
-				Dk = (int)(1.0 - Math.log(Y)/ll);
-				if ((X = k1 - Dk) < 0)  continue;         // 0 <= X <= k1 - 1  
-				Y *= (U - p4) * ll;                       // Y -- U(0, h(x))   
-				if (Y <= f1 - Dk * (f1 - f1/r1)) {
-					return(X);                            // quick accept of X 
-				}
-			}
-			else {                                        // expon. tail right 
-				Dk = (int)(1.0 - Math.log(Y)/lr);
-				if ((X = k5 + Dk) > n )  continue;        // k5 + 1 <= X <= n  
-				Y *= (U - p5) * lr;                       // Y -- U(0, h(x))   /
-				if (Y <= f5 - Dk * (f5 - f5*r5)) {
-					return(X);                            // quick accept of X 
-				}
-			}
-		}
+      // computation of candidate X > k4, and its counterpart V < k4          
+      // either squeeze-acceptance of X or acceptance-rejection of V          
+      Dk = (int)(dr * randomGenerator.raw()) + 1;
+      if (Y <= f4 - Dk * (f4 - f4*r4)) {            // quick accept of   
+        return(k4 + Dk);                          // X = k4 + Dk     
+      }
+      if ((W = f4 + f4 - Y) < 1.0) {                // quick reject of V
+        V = k4 - Dk;
+        if (W <= f4 + Dk * (1.0 - f4)/dr) {       // quick accept of   
+          return(V);                            // V = k4 - Dk       
+        }
+        if (Math.log(W) <= c_pm - fc_lnpk(V, N_Mn, M, n)) {
+          return(V);                            // final accept of V 
+        }
+      }
+      X = k4 + Dk;
+    }
+    else {
+      Y = randomGenerator.raw();
+      if (U < p5) {                                 // expon. tail left  
+        Dk = (int)(1.0 - Math.log(Y)/ll);
+        if ((X = k1 - Dk) < 0)  continue;         // 0 <= X <= k1 - 1  
+        Y *= (U - p4) * ll;                       // Y -- U(0, h(x))   
+        if (Y <= f1 - Dk * (f1 - f1/r1)) {
+          return(X);                            // quick accept of X 
+        }
+      }
+      else {                                        // expon. tail right 
+        Dk = (int)(1.0 - Math.log(Y)/lr);
+        if ((X = k5 + Dk) > n )  continue;        // k5 + 1 <= X <= n  
+        Y *= (U - p5) * lr;                       // Y -- U(0, h(x))   /
+        if (Y <= f5 - Dk * (f5 - f5*r5)) {
+          return(X);                            // quick accept of X 
+        }
+      }
+    }
 
-	// acceptance-rejection test of candidate X from the original area     
-	// test, whether  Y <= f(X),    with  Y = U*h(x)  and  U -- U(0, 1)    
-	// log f(X) = log( m! (M - m)! (n - m)! (N - M - n + m)! )             
-	//          - log( X! (M - X)! (n - X)! (N - M - n + X)! )              
-	// by using an external function for log k!                             
-		if (Math.log(Y) <= c_pm - fc_lnpk(X, N_Mn, M, n))  return(X);
-	}
+  // acceptance-rejection test of candidate X from the original area     
+  // test, whether  Y <= f(X),    with  Y = U*h(x)  and  U -- U(0, 1)    
+  // log f(X) = log( m! (M - m)! (n - m)! (N - M - n + m)! )             
+  //          - log( X! (M - X)! (n - X)! (N - M - n + X)! )              
+  // by using an external function for log k!                             
+    if (Math.log(Y) <= c_pm - fc_lnpk(X, N_Mn, M, n))  return(X);
+  }
 }
 /**
  * Returns a random number from the distribution.
  */
 public int nextInt() {
-	return nextInt(this.my_N, this.my_s, this.my_n, this.randomGenerator);
+  return nextInt(this.my_N, this.my_s, this.my_n, this.randomGenerator);
 }
 /**
  * Returns a random number from the distribution; bypasses the internal state.
  */
 public int nextInt(int N, int s, int n) {
-	return nextInt(N,s,n,this.randomGenerator);
+  return nextInt(N,s,n,this.randomGenerator);
 }
 /**
  * Returns a random number from the distribution; bypasses the internal state.
@@ -329,66 +327,66 @@
  *                long integer  N , M , n.                        *
  *                                                                *
  ******************************************************************/
-	int Nhalf, n_le_Nhalf, M_le_Nhalf, K;
+  int Nhalf, n_le_Nhalf, M_le_Nhalf, K;
 
-	Nhalf =  N / 2;
-	n_le_Nhalf = (n <= Nhalf)  ?  n  :  N - n;
-	M_le_Nhalf = (M <= Nhalf)  ?  M  :  N - M;
+  Nhalf =  N / 2;
+  n_le_Nhalf = (n <= Nhalf)  ?  n  :  N - n;
+  M_le_Nhalf = (M <= Nhalf)  ?  M  :  N - M;
 
-	if ((n*M/N) < 10) {
-		K = (n_le_Nhalf <= M_le_Nhalf)
-			?  hmdu(N, M_le_Nhalf, n_le_Nhalf, randomGenerator)
-			:  hmdu(N, n_le_Nhalf, M_le_Nhalf, randomGenerator);
-	}
-	else {
-		K = (n_le_Nhalf <= M_le_Nhalf)
-			?  hprs(N, M_le_Nhalf, n_le_Nhalf, randomGenerator)
-			:  hprs(N, n_le_Nhalf, M_le_Nhalf, randomGenerator);
-	}
+  if ((n*M/N) < 10) {
+    K = (n_le_Nhalf <= M_le_Nhalf)
+      ?  hmdu(N, M_le_Nhalf, n_le_Nhalf, randomGenerator)
+      :  hmdu(N, n_le_Nhalf, M_le_Nhalf, randomGenerator);
+  }
+  else {
+    K = (n_le_Nhalf <= M_le_Nhalf)
+      ?  hprs(N, M_le_Nhalf, n_le_Nhalf, randomGenerator)
+      :  hprs(N, n_le_Nhalf, M_le_Nhalf, randomGenerator);
+  }
 
-	if (n <= Nhalf) {
-		return (M <= Nhalf)  ?      K  :  n - K;
-	}
-	else {
-		return (M <= Nhalf)  ?  M - K  :  n - N + M + K;
-	}
+  if (n <= Nhalf) {
+    return (M <= Nhalf)  ?      K  :  n - K;
+  }
+  else {
+    return (M <= Nhalf)  ?  M - K  :  n - N + M + K;
+  }
 }
 /**
  * Returns the probability distribution function.
  */
 public double pdf(int k) {
-	return Arithmetic.binomial(my_s, k) * Arithmetic.binomial(my_N - my_s, my_n - k) 
-		/ Arithmetic.binomial(my_N, my_n);
+  return Arithmetic.binomial(my_s, k) * Arithmetic.binomial(my_N - my_s, my_n - k) 
+    / Arithmetic.binomial(my_N, my_n);
 }
 /**
  * Sets the parameters.
  */
 public void setState(int N, int s, int n) {
-	this.my_N = N;
-	this.my_s = s;
-	this.my_n = n;
+  this.my_N = N;
+  this.my_s = s;
+  this.my_n = n;
 }
 /**
  * Returns a random number from the distribution.
  */
 public static double staticNextInt(int N, int M, int n) {
-	synchronized (shared) {
-		return shared.nextInt(N,M,n);
-	}
+  synchronized (shared) {
+    return shared.nextInt(N,M,n);
+  }
 }
 /**
  * Returns a String representation of the receiver.
  */
 public String toString() {
-	return this.getClass().getName()+"("+my_N+","+my_s+","+my_n+")";
+  return this.getClass().getName()+"("+my_N+","+my_s+","+my_n+")";
 }
 /**
  * Sets the uniform random number generated shared by all <b>static</b> methods.
  * @param randomGenerator the new uniform random number generator to be shared.
  */
 private static void xstaticSetRandomGenerator(RandomEngine randomGenerator) {
-	synchronized (shared) {
-		shared.setRandomGenerator(randomGenerator);
-	}
+  synchronized (shared) {
+    shared.setRandomGenerator(randomGenerator);
+  }
 }
 }
Index: matrix/src/main/java/org/apache/mahout/jet/random/Fun.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/jet/random/Fun.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/jet/random/Fun.java	(working copy)
@@ -14,289 +14,287 @@
  * <b>Implementation:</b> High performance implementation.
  * <dt>This is a port of <tt>gen_fun.cpp</tt> from the <A HREF="http://www.cis.tu-graz.ac.at/stat/stadl/random.html">C-RAND / WIN-RAND</A> library.
  *
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 09/24/99
  */
 class Fun {
 /**
  * Makes this class non instantiable, but still let's others inherit from it.
  */
 protected Fun() {
-	throw new RuntimeException("Non instantiable");
+  throw new RuntimeException("Non instantiable");
 }
 private static double _fkt_value(double lambda, double z1, double z2, double x_value) {
-	double y_value;
+  double y_value;
 
-	y_value = Math.cos(z1*x_value)/(Math.pow((x_value*x_value + z2*z2),(lambda + 0.5)));
-	return y_value;
+  y_value = Math.cos(z1*x_value)/(Math.pow((x_value*x_value + z2*z2),(lambda + 0.5)));
+  return y_value;
 }
 public static double bessel2_fkt(double lambda, double beta) {
-	final double pi = Math.PI;
-	double sum,x,step,x1,first_value,new_value;
-	double epsilon = 0.01;
-	double y,fx,z1,z2,erg;
-	double period,border,first_sum,second_sum;
-	double my,c,prod=0.0,diff,value;
-	int i,j,nr_per;
+  final double pi = Math.PI;
+  double sum,x,step,x1,first_value,new_value;
+  double epsilon = 0.01;
+  double y,fx,z1,z2,erg;
+  double period,border,first_sum,second_sum;
+  double my,c,prod=0.0,diff,value;
+  int i,j,nr_per;
 
-	final double b0[] =  { -1.5787132, -0.6130827,  0.1735823,  1.4793411,
-		    2.6667307,  4.9086836,  8.1355339,
-		   };
-	final double b05[] = { -1.9694802, -0.7642538,  0.0826017,  1.4276355,
-		    2.6303682,  4.8857787,  8.1207968,
-		   };
-	final double b1[] =  { -2.9807345, -1.1969943, -0.1843161,  1.2739241,
-		    2.5218256,  4.8172216,  8.0765633,
-		   };
-	final double b2[] =  { -5.9889676, -2.7145389, -1.1781269,  0.6782201,
-		    2.0954009,  4.5452152,  7.9003173,
-		   };
-	final double b3[] =  { -9.6803440, -4.8211925, -2.6533185, -0.2583337,
-		    1.4091915,  4.0993448,  7.6088310,
-		   };
-	final double b5[] =  {-18.1567152,-10.0939408, -6.5819139, -2.9371545,
-		   -0.6289005,  2.7270412,  6.6936799,
-		   };
-	final double b8[] =  {-32.4910195,-19.6065943,-14.0347298, -8.3839439,
-		   -4.9679730, -0.3567823,  4.5589697,
-		   };
+  final double b0[] =  { -1.5787132, -0.6130827,  0.1735823,  1.4793411,
+        2.6667307,  4.9086836,  8.1355339,
+       };
+  final double b05[] = { -1.9694802, -0.7642538,  0.0826017,  1.4276355,
+        2.6303682,  4.8857787,  8.1207968,
+       };
+  final double b1[] =  { -2.9807345, -1.1969943, -0.1843161,  1.2739241,
+        2.5218256,  4.8172216,  8.0765633,
+       };
+  final double b2[] =  { -5.9889676, -2.7145389, -1.1781269,  0.6782201,
+        2.0954009,  4.5452152,  7.9003173,
+       };
+  final double b3[] =  { -9.6803440, -4.8211925, -2.6533185, -0.2583337,
+        1.4091915,  4.0993448,  7.6088310,
+       };
+  final double b5[] =  {-18.1567152,-10.0939408, -6.5819139, -2.9371545,
+       -0.6289005,  2.7270412,  6.6936799,
+       };
+  final double b8[] =  {-32.4910195,-19.6065943,-14.0347298, -8.3839439,
+       -4.9679730, -0.3567823,  4.5589697,
+       };
 
-	if (lambda == 0.0) {
-		if (beta == 0.1) return(b0[0]);
-		if (beta == 0.5) return(b0[1]);
-		if (beta == 1.0) return(b0[2]);
-		if (beta == 2.0) return(b0[3]);
-		if (beta == 3.0) return(b0[4]);
-		if (beta == 5.0) return(b0[5]);
-		if (beta == 8.0) return(b0[6]);
-	}
+  if (lambda == 0.0) {
+    if (beta == 0.1) return(b0[0]);
+    if (beta == 0.5) return(b0[1]);
+    if (beta == 1.0) return(b0[2]);
+    if (beta == 2.0) return(b0[3]);
+    if (beta == 3.0) return(b0[4]);
+    if (beta == 5.0) return(b0[5]);
+    if (beta == 8.0) return(b0[6]);
+  }
 
-	if (lambda == 0.5) {
-		if (beta == 0.1) return(b05[0]);
-		if (beta == 0.5) return(b05[1]);
-		if (beta == 1.0) return(b05[2]);
-		if (beta == 2.0) return(b05[3]);
-		if (beta == 3.0) return(b05[4]);
-		if (beta == 5.0) return(b05[5]);
-		if (beta == 8.0) return(b05[6]);
-	}
+  if (lambda == 0.5) {
+    if (beta == 0.1) return(b05[0]);
+    if (beta == 0.5) return(b05[1]);
+    if (beta == 1.0) return(b05[2]);
+    if (beta == 2.0) return(b05[3]);
+    if (beta == 3.0) return(b05[4]);
+    if (beta == 5.0) return(b05[5]);
+    if (beta == 8.0) return(b05[6]);
+  }
 
-	if (lambda == 1.0) {
-		if (beta == 0.1) return(b1[0]);
-		if (beta == 0.5) return(b1[1]);
-		if (beta == 1.0) return(b1[2]);
-		if (beta == 2.0) return(b1[3]);
-		if (beta == 3.0) return(b1[4]);
-		if (beta == 5.0) return(b1[5]);
-		if (beta == 8.0) return(b1[6]);
-	}
+  if (lambda == 1.0) {
+    if (beta == 0.1) return(b1[0]);
+    if (beta == 0.5) return(b1[1]);
+    if (beta == 1.0) return(b1[2]);
+    if (beta == 2.0) return(b1[3]);
+    if (beta == 3.0) return(b1[4]);
+    if (beta == 5.0) return(b1[5]);
+    if (beta == 8.0) return(b1[6]);
+  }
 
-	if (lambda == 2.0) {
-		if (beta == 0.1) return(b2[0]);
-		if (beta == 0.5) return(b2[1]);
-		if (beta == 1.0) return(b2[2]);
-		if (beta == 2.0) return(b2[3]);
-		if (beta == 3.0) return(b2[4]);
-		if (beta == 5.0) return(b2[5]);
-		if (beta == 8.0) return(b2[6]);
-	}
+  if (lambda == 2.0) {
+    if (beta == 0.1) return(b2[0]);
+    if (beta == 0.5) return(b2[1]);
+    if (beta == 1.0) return(b2[2]);
+    if (beta == 2.0) return(b2[3]);
+    if (beta == 3.0) return(b2[4]);
+    if (beta == 5.0) return(b2[5]);
+    if (beta == 8.0) return(b2[6]);
+  }
 
-	if (lambda == 3.0) {
-		if (beta == 0.1) return(b3[0]);
-		if (beta == 0.5) return(b3[1]);
-		if (beta == 1.0) return(b3[2]);
-		if (beta == 2.0) return(b3[3]);
-		if (beta == 3.0) return(b3[4]);
-		if (beta == 5.0) return(b3[5]);
-		if (beta == 8.0) return(b3[6]);
-	}
+  if (lambda == 3.0) {
+    if (beta == 0.1) return(b3[0]);
+    if (beta == 0.5) return(b3[1]);
+    if (beta == 1.0) return(b3[2]);
+    if (beta == 2.0) return(b3[3]);
+    if (beta == 3.0) return(b3[4]);
+    if (beta == 5.0) return(b3[5]);
+    if (beta == 8.0) return(b3[6]);
+  }
 
-	if (lambda == 5.0) {
-		if (beta == 0.1) return(b5[0]);
-		if (beta == 0.5) return(b5[1]);
-		if (beta == 1.0) return(b5[2]);
-		if (beta == 2.0) return(b5[3]);
-		if (beta == 3.0) return(b5[4]);
-		if (beta == 5.0) return(b5[5]);
-		if (beta == 8.0) return(b5[6]);
-	}
+  if (lambda == 5.0) {
+    if (beta == 0.1) return(b5[0]);
+    if (beta == 0.5) return(b5[1]);
+    if (beta == 1.0) return(b5[2]);
+    if (beta == 2.0) return(b5[3]);
+    if (beta == 3.0) return(b5[4]);
+    if (beta == 5.0) return(b5[5]);
+    if (beta == 8.0) return(b5[6]);
+  }
 
-	if (lambda == 8.0) {
-		if (beta == 0.1) return(b8[0]);
-		if (beta == 0.5) return(b8[1]);
-		if (beta == 1.0) return(b8[2]);
-		if (beta == 2.0) return(b8[3]);
-		if (beta == 3.0) return(b8[4]);
-		if (beta == 5.0) return(b8[5]);
-		if (beta == 8.0) return(b8[6]);
-	}
+  if (lambda == 8.0) {
+    if (beta == 0.1) return(b8[0]);
+    if (beta == 0.5) return(b8[1]);
+    if (beta == 1.0) return(b8[2]);
+    if (beta == 2.0) return(b8[3]);
+    if (beta == 3.0) return(b8[4]);
+    if (beta == 5.0) return(b8[5]);
+    if (beta == 8.0) return(b8[6]);
+  }
 
 
-	if ((beta - 5.0*lambda - 8.0) >= 0.0) {
-		my = 4.0*lambda*lambda;
-		c = -0.9189385 + 0.5*Math.log(beta) + beta;	
-		sum = 1.0;
-		value = 1.0;
-		diff = 8.0;
-		i = 1;
-		for (;;) { //while (!NULL) {
-			if ((factorial(i)*Math.pow((8.0*beta),i)) > 1.0e250) break;
-			if (i > 10) break;
-			if (i == 1) prod = my - 1.0;
-			else {
-				value += diff;
-				prod = prod*(my - value);
-				diff *= 2.0;
-			}
-			sum =sum + prod/(factorial(i)*Math.pow((8.0*beta),i));
-			i++;
-		}
-		erg = c - Math.log(sum);
-		return(erg);
-	}
+  if ((beta - 5.0*lambda - 8.0) >= 0.0) {
+    my = 4.0*lambda*lambda;
+    c = -0.9189385 + 0.5*Math.log(beta) + beta;  
+    sum = 1.0;
+    value = 1.0;
+    diff = 8.0;
+    i = 1;
+    for (;;) { //while (!NULL) {
+      if ((factorial(i)*Math.pow((8.0*beta),i)) > 1.0e250) break;
+      if (i > 10) break;
+      if (i == 1) prod = my - 1.0;
+      else {
+        value += diff;
+        prod = prod*(my - value);
+        diff *= 2.0;
+      }
+      sum =sum + prod/(factorial(i)*Math.pow((8.0*beta),i));
+      i++;
+    }
+    erg = c - Math.log(sum);
+    return(erg);
+  }
 
-	if ((lambda > 0.0) && ((beta - 0.04*lambda) <= 0.0)) {
-		if (lambda < 11.5) {
-			erg = -Math.log(gamma(lambda)) - lambda*Math.log(2.0) + lambda*Math.log(beta);
-			return(erg);
-		}
-		else {
-			erg = -(lambda + 1.0)*Math.log(2.0) - (lambda - 0.5)*Math.log(lambda) + lambda + lambda*Math.log(beta) - 0.5*Math.log(0.5*pi);
-			return(erg);
-		}
-	}
+  if ((lambda > 0.0) && ((beta - 0.04*lambda) <= 0.0)) {
+    if (lambda < 11.5) {
+      erg = -Math.log(gamma(lambda)) - lambda*Math.log(2.0) + lambda*Math.log(beta);
+      return(erg);
+    }
+    else {
+      erg = -(lambda + 1.0)*Math.log(2.0) - (lambda - 0.5)*Math.log(lambda) + lambda + lambda*Math.log(beta) - 0.5*Math.log(0.5*pi);
+      return(erg);
+    }
+  }
 
 
-	// otherwise numerical integration of the function defined above 
+  // otherwise numerical integration of the function defined above 
 
-	x = 0.0;
+  x = 0.0;
 
-	if (beta < 1.57) {
-		fx = (fkt2_value(lambda,beta,x))*0.01;
-		y = 0.0;
-		for (;;) { //while (!NULL) {
-			y += 0.1;
-			if ((fkt2_value(lambda,beta,y)) < fx) break;
-		}
-		step = y*0.001;
-		x1 = step;
-		sum = (0.5*(10.0*step + fkt2_value(lambda,beta,x1)))*step;
-		first_value = sum;
-		for (;;) { //while (!NULL) {
-			x = x1;
-			x1 += step;
-			new_value = (0.5*(fkt2_value(lambda,beta,x) + fkt2_value(lambda,beta,x1)))*step;
-			sum += new_value;
-			if ((new_value/first_value) < epsilon) break;
-		}
-		erg = -Math.log(2.0*sum);
-		return(erg);
-	}
-	else {
-		z2 = 1.57;
-		z1 = beta/1.57;
-		sum = 0.0;
-		period = pi/z1;
-		step = 0.1*period;
-		border = 100.0/((lambda + 0.1)*(lambda + 0.1));
-		nr_per = (int) Math.ceil((border/period)) + 20;
-		x1 = step;
-		for (i = 1; i <= nr_per; i++) {
-			for (j = 1; j <= 10; j++) {
-				new_value = (0.5*(_fkt_value(lambda,z1,z2,x) + _fkt_value(lambda,z1,z2,x1)))*step;
-				sum += new_value;
-				x = x1;
-				x1 += step;
-			}
-		}
-		for (j = 1; j <= 5; j++) {
-			new_value = (0.5*(_fkt_value(lambda,z1,z2,x) + _fkt_value(lambda,z1,z2,x1)))*step;
-			sum += new_value;
-			x = x1;
-			x1 += step;
-		}
-		first_sum = sum;
-		for (j = 1; j <= 10; j++) {
-			new_value = (0.5*(_fkt_value(lambda,z1,z2,x) + _fkt_value(lambda,z1,z2,x1)))*step;
-			sum += new_value;
-			x = x1;
-			x1 += step;
-		}
-		second_sum = sum;
-		sum = 0.5*(first_sum + second_sum);
-		erg = gamma(lambda + 0.5)*Math.pow((2.0*z2),lambda)/(Math.sqrt(pi)*Math.pow(z1,lambda))*sum;
-		erg = -Math.log(2.0*erg);
-		return(erg);
-	}
+  if (beta < 1.57) {
+    fx = (fkt2_value(lambda,beta,x))*0.01;
+    y = 0.0;
+    for (;;) { //while (!NULL) {
+      y += 0.1;
+      if ((fkt2_value(lambda,beta,y)) < fx) break;
+    }
+    step = y*0.001;
+    x1 = step;
+    sum = (0.5*(10.0*step + fkt2_value(lambda,beta,x1)))*step;
+    first_value = sum;
+    for (;;) { //while (!NULL) {
+      x = x1;
+      x1 += step;
+      new_value = (0.5*(fkt2_value(lambda,beta,x) + fkt2_value(lambda,beta,x1)))*step;
+      sum += new_value;
+      if ((new_value/first_value) < epsilon) break;
+    }
+    erg = -Math.log(2.0*sum);
+    return(erg);
+  }
+  else {
+    z2 = 1.57;
+    z1 = beta/1.57;
+    sum = 0.0;
+    period = pi/z1;
+    step = 0.1*period;
+    border = 100.0/((lambda + 0.1)*(lambda + 0.1));
+    nr_per = (int) Math.ceil((border/period)) + 20;
+    x1 = step;
+    for (i = 1; i <= nr_per; i++) {
+      for (j = 1; j <= 10; j++) {
+        new_value = (0.5*(_fkt_value(lambda,z1,z2,x) + _fkt_value(lambda,z1,z2,x1)))*step;
+        sum += new_value;
+        x = x1;
+        x1 += step;
+      }
+    }
+    for (j = 1; j <= 5; j++) {
+      new_value = (0.5*(_fkt_value(lambda,z1,z2,x) + _fkt_value(lambda,z1,z2,x1)))*step;
+      sum += new_value;
+      x = x1;
+      x1 += step;
+    }
+    first_sum = sum;
+    for (j = 1; j <= 10; j++) {
+      new_value = (0.5*(_fkt_value(lambda,z1,z2,x) + _fkt_value(lambda,z1,z2,x1)))*step;
+      sum += new_value;
+      x = x1;
+      x1 += step;
+    }
+    second_sum = sum;
+    sum = 0.5*(first_sum + second_sum);
+    erg = gamma(lambda + 0.5)*Math.pow((2.0*z2),lambda)/(Math.sqrt(pi)*Math.pow(z1,lambda))*sum;
+    erg = -Math.log(2.0*erg);
+    return(erg);
+  }
 }
 /**
  * Modified Bessel Functions of First Kind - Order 0.
  */
 public static double bessi0(double x) {
-	double ax,ans;
-	double y;
+  double ax,ans;
+  double y;
 
-	if ((ax=Math.abs(x)) < 3.75) {
-		y=x/3.75;
-		y*=y;
-		ans=1.0+y*(3.5156229+y*(3.0899424+y*(1.2067492
-			+y*(0.2659732+y*(0.360768e-1+y*0.45813e-2)))));
-	}
-	else {
-		y=3.75/ax;
-		ans=(Math.exp(ax)/Math.sqrt(ax))*(0.39894228+y*(0.1328592e-1
-			+y*(0.225319e-2+y*(-0.157565e-2+y*(0.916281e-2
-			+y*(-0.2057706e-1+y*(0.2635537e-1+y*(-0.1647633e-1
-			+y*0.392377e-2))))))));
-	}
-	return ans;
+  if ((ax=Math.abs(x)) < 3.75) {
+    y=x/3.75;
+    y*=y;
+    ans=1.0+y*(3.5156229+y*(3.0899424+y*(1.2067492
+      +y*(0.2659732+y*(0.360768e-1+y*0.45813e-2)))));
+  }
+  else {
+    y=3.75/ax;
+    ans=(Math.exp(ax)/Math.sqrt(ax))*(0.39894228+y*(0.1328592e-1
+      +y*(0.225319e-2+y*(-0.157565e-2+y*(0.916281e-2
+      +y*(-0.2057706e-1+y*(0.2635537e-1+y*(-0.1647633e-1
+      +y*0.392377e-2))))))));
+  }
+  return ans;
 }
 /**
  * Modified Bessel Functions of First Kind - Order 1.
  */
 public static double bessi1(double x) {
-	double ax,ans;
-	double y;
+  double ax,ans;
+  double y;
 
-	if ((ax=Math.abs(x)) < 3.75) {
-		y=x/3.75;
-		y*=y;
-		ans=ax*(0.5+y*(0.87890594+y*(0.51498869+y*(0.15084934
-			+y*(0.2658733e-1+y*(0.301532e-2+y*0.32411e-3))))));
-	}
-	else {
-		y=3.75/ax;
-		ans=0.2282967e-1+y*(-0.2895312e-1+y*(0.1787654e-1
-			-y*0.420059e-2));
-		ans=0.39894228+y*(-0.3988024e-1+y*(-0.362018e-2
-			+y*(0.163801e-2+y*(-0.1031555e-1+y*ans))));
-		ans *= (Math.exp(ax)/Math.sqrt(ax));
-		}
-	return x < 0.0 ? -ans : ans;
+  if ((ax=Math.abs(x)) < 3.75) {
+    y=x/3.75;
+    y*=y;
+    ans=ax*(0.5+y*(0.87890594+y*(0.51498869+y*(0.15084934
+      +y*(0.2658733e-1+y*(0.301532e-2+y*0.32411e-3))))));
+  }
+  else {
+    y=3.75/ax;
+    ans=0.2282967e-1+y*(-0.2895312e-1+y*(0.1787654e-1
+      -y*0.420059e-2));
+    ans=0.39894228+y*(-0.3988024e-1+y*(-0.362018e-2
+      +y*(0.163801e-2+y*(-0.1031555e-1+y*ans))));
+    ans *= (Math.exp(ax)/Math.sqrt(ax));
+    }
+  return x < 0.0 ? -ans : ans;
  } 
 /**
  * Returns <tt>n!</tt>.
  */
 public static long factorial(int n) {
-	return org.apache.mahout.jet.math.Arithmetic.longFactorial(n);
-	/*
-	long i,prod;
+  return org.apache.mahout.jet.math.Arithmetic.longFactorial(n);
+  /*
+  long i,prod;
 
-	prod = 1;
-	if (n != 0) {
-		for (i = 2; i <= n; i++) prod *= i;
-	}
-	return prod;
-	*/
+  prod = 1;
+  if (n != 0) {
+    for (i = 2; i <= n; i++) prod *= i;
+  }
+  return prod;
+  */
 }
 private static double fkt2_value(double lambda, double beta, double x_value) {
-	double y_value;
+  double y_value;
 
-	y_value = cosh(lambda*x_value)*Math.exp(-beta*cosh(x_value));
-	return y_value;
+  y_value = cosh(lambda*x_value)*Math.exp(-beta*cosh(x_value));
+  return y_value;
 }
 private static double cosh(double x) {
-	return (Math.exp(x) + Math.exp(-x)) / 2.0;
+  return (Math.exp(x) + Math.exp(-x)) / 2.0;
 }
 
 
@@ -304,28 +302,28 @@
  * Returns the gamma function <tt>gamma(x)</tt>.
  */
 public static double gamma(double x) {
-	x = logGamma(x);
-	//if (x > Math.log(Double.MAX_VALUE)) return Double.MAX_VALUE;
-	return Math.exp(x);
+  x = logGamma(x);
+  //if (x > Math.log(Double.MAX_VALUE)) return Double.MAX_VALUE;
+  return Math.exp(x);
 }
 /**
  * Returns a quick approximation of <tt>log(gamma(x))</tt>.
  */
 public static double logGamma(double x) {
-	final double c0 = 9.1893853320467274e-01, c1 = 8.3333333333333333e-02,
-		c2 =-2.7777777777777777e-03, c3 = 7.9365079365079365e-04,
-		c4 =-5.9523809523809524e-04, c5 = 8.4175084175084175e-04,
-		c6 =-1.9175269175269175e-03;
-	double g,r,z;
+  final double c0 = 9.1893853320467274e-01, c1 = 8.3333333333333333e-02,
+    c2 =-2.7777777777777777e-03, c3 = 7.9365079365079365e-04,
+    c4 =-5.9523809523809524e-04, c5 = 8.4175084175084175e-04,
+    c6 =-1.9175269175269175e-03;
+  double g,r,z;
 
-	if (x <= 0.0 /* || x > 1.3e19 */ ) return -999;
-	
-	for (z = 1.0; x < 11.0; x++) z *= x;
-	
-	r = 1.0 / (x * x);
-	g = c1 + r * (c2 + r * (c3 + r * (c4 + r * (c5 + r + c6))));
-	g = (x - 0.5) * Math.log(x) - x + c0 + g / x;
-	if (z == 1.0) return g;
-	return g - Math.log(z);
+  if (x <= 0.0 /* || x > 1.3e19 */ ) return -999;
+  
+  for (z = 1.0; x < 11.0; x++) z *= x;
+  
+  r = 1.0 / (x * x);
+  g = c1 + r * (c2 + r * (c3 + r * (c4 + r * (c5 + r + c6))));
+  g = (x - 0.5) * Math.log(x) - x + c0 + g / x;
+  if (z == 1.0) return g;
+  return g - Math.log(z);
 }
 }
Index: matrix/src/main/java/org/apache/mahout/jet/random/Normal.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/jet/random/Normal.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/jet/random/Normal.java	(working copy)
@@ -14,17 +14,17 @@
 Normal (aka Gaussian) distribution; See the <A HREF="http://www.cern.ch/RD11/rkb/AN16pp/node188.html#SECTION0001880000000000000000"> math definition</A>
 and <A HREF="http://www.statsoft.com/textbook/glosn.html#Normal Distribution"> animated definition</A>.
 <pre>                       
-				   1                       2
-	  pdf(x) = ---------    exp( - (x-mean) / 2v ) 
-			   sqrt(2pi*v)
+           1                       2
+    pdf(x) = ---------    exp( - (x-mean) / 2v ) 
+         sqrt(2pi*v)
 
-							x
-							 -
-				   1        | |                 2
-	  cdf(x) = ---------    |    exp( - (t-mean) / 2v ) dt
-			   sqrt(2pi*v)| |
-						   -
-						  -inf.
+              x
+               -
+           1        | |                 2
+    cdf(x) = ---------    |    exp( - (t-mean) / 2v ) dt
+         sqrt(2pi*v)| |
+               -
+              -inf.
 </pre>
 where <tt>v = variance = standardDeviation^2</tt>.
 <p>
@@ -43,107 +43,107 @@
  */
 @Deprecated
 public class Normal extends AbstractContinousDistribution {
-	protected double mean;
-	protected double variance;
-	protected double standardDeviation;
+  protected double mean;
+  protected double variance;
+  protected double standardDeviation;
 
-	protected double cache; // cache for Box-Mueller algorithm 
-	protected boolean cacheFilled; // Box-Mueller
+  protected double cache; // cache for Box-Mueller algorithm 
+  protected boolean cacheFilled; // Box-Mueller
 
-	protected double SQRT_INV; // performance cache
+  protected double SQRT_INV; // performance cache
 
- 	// The uniform random number generated shared by all <b>static</b> methods.
-	protected static Normal shared = new Normal(0.0,1.0,makeDefaultGenerator());
+   // The uniform random number generated shared by all <b>static</b> methods.
+  protected static Normal shared = new Normal(0.0,1.0,makeDefaultGenerator());
 /**
  * Constructs a normal (gauss) distribution.
  * Example: mean=0.0, standardDeviation=1.0.
  */
 public Normal(double mean, double standardDeviation, RandomEngine randomGenerator) {
-	setRandomGenerator(randomGenerator);
-	setState(mean,standardDeviation);
+  setRandomGenerator(randomGenerator);
+  setState(mean,standardDeviation);
 }
 /**
  * Returns the cumulative distribution function.
  */
 public double cdf(double x) {
-	return Probability.normal(mean,variance,x);
+  return Probability.normal(mean,variance,x);
 }
 /**
  * Returns a random number from the distribution.
  */
 public double nextDouble() {
-	return nextDouble(this.mean,this.standardDeviation);
+  return nextDouble(this.mean,this.standardDeviation);
 }
 /**
  * Returns a random number from the distribution; bypasses the internal state.
  */
 public double nextDouble(double mean, double standardDeviation) {
-	// Uses polar Box-Muller transformation.
-	if (cacheFilled && this.mean == mean && this.standardDeviation == standardDeviation) {
-		cacheFilled = false;
-		return cache; 
-	};
+  // Uses polar Box-Muller transformation.
+  if (cacheFilled && this.mean == mean && this.standardDeviation == standardDeviation) {
+    cacheFilled = false;
+    return cache; 
+  };
 
-	double x,y,r,z;
-	do {
-		x = 2.0*randomGenerator.raw() - 1.0; 
-		y = 2.0*randomGenerator.raw() - 1.0;		 
-		r = x*x+y*y;
-	} while (r >= 1.0);
+  double x,y,r,z;
+  do {
+    x = 2.0*randomGenerator.raw() - 1.0; 
+    y = 2.0*randomGenerator.raw() - 1.0;     
+    r = x*x+y*y;
+  } while (r >= 1.0);
 
-	z = Math.sqrt(-2.0*Math.log(r)/r);
-	cache = mean + standardDeviation*x*z;
-	cacheFilled = true;
-	return mean + standardDeviation*y*z;
+  z = Math.sqrt(-2.0*Math.log(r)/r);
+  cache = mean + standardDeviation*x*z;
+  cacheFilled = true;
+  return mean + standardDeviation*y*z;
 }
 /**
  * Returns the probability distribution function.
  */
 public double pdf(double x) {
-	double diff = x-mean;
-	return SQRT_INV * Math.exp(-(diff*diff) / (2.0*variance));
+  double diff = x-mean;
+  return SQRT_INV * Math.exp(-(diff*diff) / (2.0*variance));
 }
 /**
  * Sets the uniform random generator internally used.
  */
 protected void setRandomGenerator(RandomEngine randomGenerator) {
-	super.setRandomGenerator(randomGenerator);
-	this.cacheFilled = false;
+  super.setRandomGenerator(randomGenerator);
+  this.cacheFilled = false;
 }
 /**
  * Sets the mean and variance.
  */
 public void setState(double mean, double standardDeviation) {
-	if (mean!=this.mean || standardDeviation!=this.standardDeviation) {
-		this.mean = mean;
-		this.standardDeviation = standardDeviation;
-		this.variance = standardDeviation*standardDeviation;
-		this.cacheFilled = false;
-		
-		this.SQRT_INV = 1.0 / Math.sqrt(2.0*Math.PI*variance);
-	}
+  if (mean!=this.mean || standardDeviation!=this.standardDeviation) {
+    this.mean = mean;
+    this.standardDeviation = standardDeviation;
+    this.variance = standardDeviation*standardDeviation;
+    this.cacheFilled = false;
+    
+    this.SQRT_INV = 1.0 / Math.sqrt(2.0*Math.PI*variance);
+  }
 }
 /**
  * Returns a random number from the distribution with the given mean and standard deviation.
  */
 public static double staticNextDouble(double mean, double standardDeviation) {
-	synchronized (shared) {
-		return shared.nextDouble(mean,standardDeviation);
-	}
+  synchronized (shared) {
+    return shared.nextDouble(mean,standardDeviation);
+  }
 }
 /**
  * Returns a String representation of the receiver.
  */
 public String toString() {
-	return this.getClass().getName()+"("+mean+","+standardDeviation+")";
+  return this.getClass().getName()+"("+mean+","+standardDeviation+")";
 }
 /**
  * Sets the uniform random number generated shared by all <b>static</b> methods.
  * @param randomGenerator the new uniform random number generator to be shared.
  */
 private static void xstaticSetRandomGenerator(RandomEngine randomGenerator) {
-	synchronized (shared) {
-		shared.setRandomGenerator(randomGenerator);
-	}
+  synchronized (shared) {
+    shared.setRandomGenerator(randomGenerator);
+  }
 }
 }
Index: matrix/src/main/java/org/apache/mahout/jet/random/Poisson.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/jet/random/Poisson.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/jet/random/Poisson.java	(working copy)
@@ -37,53 +37,51 @@
  * Stadlober E., H. Zechner (1999), <A HREF="http://www.cis.tu-graz.ac.at/stat/stadl/random.html">The patchwork rejection method for sampling from unimodal distributions</A>,
  * to appear in ACM Transactions on Modelling and Simulation.
  *
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 09/24/99
  */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
  */
 @Deprecated
 public class Poisson extends AbstractDiscreteDistribution {
-	protected double mean;
+  protected double mean;
 
-	// precomputed and cached values (for performance only)
-	// cache for < SWITCH_MEAN
-	protected double my_old = -1.0;
-	protected double p,q,p0;
-	protected double[] pp = new double[36];
-	protected int llll;
+  // precomputed and cached values (for performance only)
+  // cache for < SWITCH_MEAN
+  protected double my_old = -1.0;
+  protected double p,q,p0;
+  protected double[] pp = new double[36];
+  protected int llll;
 
-	// cache for >= SWITCH_MEAN
-	protected double my_last = -1.0;
-	protected double ll;
-	protected int k2, k4, k1, k5;
-	protected double dl, dr, r1, r2, r4, r5, lr, l_my, c_pm;
-	protected double f1, f2, f4, f5, p1, p2, p3, p4, p5, p6;
+  // cache for >= SWITCH_MEAN
+  protected double my_last = -1.0;
+  protected double ll;
+  protected int k2, k4, k1, k5;
+  protected double dl, dr, r1, r2, r4, r5, lr, l_my, c_pm;
+  protected double f1, f2, f4, f5, p1, p2, p3, p4, p5, p6;
 
-	// cache for both;
-	protected int m;
+  // cache for both;
+  protected int m;
 
 
-	protected static final double MEAN_MAX = Integer.MAX_VALUE; // for all means larger than that, we don't try to compute a poisson deviation, but return the mean.
-	protected static final double SWITCH_MEAN = 10.0; // switch from method A to method B
-	
+  protected static final double MEAN_MAX = Integer.MAX_VALUE; // for all means larger than that, we don't try to compute a poisson deviation, but return the mean.
+  protected static final double SWITCH_MEAN = 10.0; // switch from method A to method B
+  
 
- 	// The uniform random number generated shared by all <b>static</b> methods. 
-	protected static Poisson shared = new Poisson(0.0,makeDefaultGenerator());
+   // The uniform random number generated shared by all <b>static</b> methods. 
+  protected static Poisson shared = new Poisson(0.0,makeDefaultGenerator());
 /**
  * Constructs a poisson distribution.
  * Example: mean=1.0.
  */
 public Poisson(double mean, RandomEngine randomGenerator) {
-	setRandomGenerator(randomGenerator);
-	setMean(mean);
+  setRandomGenerator(randomGenerator);
+  setMean(mean);
 }
 /**
  * Returns the cumulative distribution function.
  */
 public double cdf(int k) {
-	return Probability.poisson(k,this.mean);
+  return Probability.poisson(k,this.mean);
 }
 /**
  * Returns a deep copy of the receiver; the copy will produce identical sequences.
@@ -92,18 +90,18 @@
  * @return a copy of the receiver.
  */
 public Object clone() {
-	Poisson copy = (Poisson) super.clone();
-	if (this.pp != null) copy.pp = (double[]) this.pp.clone();
-	return copy;
+  Poisson copy = (Poisson) super.clone();
+  if (this.pp != null) copy.pp = (double[]) this.pp.clone();
+  return copy;
 }
 private static double f(int k, double l_nu, double c_pm) {
-	return  Math.exp(k * l_nu - Arithmetic.logFactorial(k) - c_pm);
+  return  Math.exp(k * l_nu - Arithmetic.logFactorial(k) - c_pm);
 }
 /**
  * Returns a random number from the distribution.
  */
 public int nextInt() {
-	return nextInt(this.mean);
+  return nextInt(this.mean);
 }
 /**
  * Returns a random number from the distribution; bypasses the internal state.
@@ -125,215 +123,215 @@
  * exponential functions.                                         *
  *                                                                *
  *****************************************************************/
-	RandomEngine gen = this.randomGenerator;
-	double my = theMean;
-	
-	double t,g,my_k;
+  RandomEngine gen = this.randomGenerator;
+  double my = theMean;
+  
+  double t,g,my_k;
 
-	double gx,gy,px,py,e,x,xx,delta,v;
-	int sign;
+  double gx,gy,px,py,e,x,xx,delta,v;
+  int sign;
 
-	//static double p,q,p0,pp[36];
-	//static long ll,m;
-	double u;
-	int k,i;
+  //static double p,q,p0,pp[36];
+  //static long ll,m;
+  double u;
+  int k,i;
  
-	if (my < SWITCH_MEAN) { // CASE B: Inversion- start new table and calculate p0
-		if (my != my_old) {
-			my_old = my;
-			llll = 0;
-			p = Math.exp(-my);
-			q = p;
-			p0 = p;
-			//for (k=pp.length; --k >=0; ) pp[k] = 0;
-		}
-		m = (my > 1.0) ? (int)my : 1;
-		for(;;) {
-			u = gen.raw();           // Step U. Uniform sample 
-			k = 0;
-			if (u <= p0) return(k);
-			if (llll != 0) {              // Step T. Table comparison 
-				i = (u > 0.458) ? Math.min(llll,m) : 1;
-				for (k = i; k <=llll; k++) if (u <= pp[k]) return(k);
-				if (llll == 35) continue;
-			}
-			for (k = llll +1; k <= 35; k++) { // Step C. Creation of new prob. 
-				p *= my/(double)k;
-				q += p;
-				pp[k] = q;
-				if (u <= q) {
-					llll = k;
-					return(k);
-				}
-			}
-			llll = 35;
-		}
-	}     // end my < SWITCH_MEAN 
-	else if (my < MEAN_MAX ) { // CASE A: acceptance complement
-		//static double        my_last = -1.0;
-		//static long int      m,  k2, k4, k1, k5;
-		//static double        dl, dr, r1, r2, r4, r5, ll, lr, l_my, c_pm,
-		//  					 f1, f2, f4, f5, p1, p2, p3, p4, p5, p6;
-		int    Dk, X, Y;
-		double Ds, U, V, W;
+  if (my < SWITCH_MEAN) { // CASE B: Inversion- start new table and calculate p0
+    if (my != my_old) {
+      my_old = my;
+      llll = 0;
+      p = Math.exp(-my);
+      q = p;
+      p0 = p;
+      //for (k=pp.length; --k >=0; ) pp[k] = 0;
+    }
+    m = (my > 1.0) ? (int)my : 1;
+    for(;;) {
+      u = gen.raw();           // Step U. Uniform sample 
+      k = 0;
+      if (u <= p0) return(k);
+      if (llll != 0) {              // Step T. Table comparison 
+        i = (u > 0.458) ? Math.min(llll,m) : 1;
+        for (k = i; k <=llll; k++) if (u <= pp[k]) return(k);
+        if (llll == 35) continue;
+      }
+      for (k = llll +1; k <= 35; k++) { // Step C. Creation of new prob. 
+        p *= my/(double)k;
+        q += p;
+        pp[k] = q;
+        if (u <= q) {
+          llll = k;
+          return(k);
+        }
+      }
+      llll = 35;
+    }
+  }     // end my < SWITCH_MEAN 
+  else if (my < MEAN_MAX ) { // CASE A: acceptance complement
+    //static double        my_last = -1.0;
+    //static long int      m,  k2, k4, k1, k5;
+    //static double        dl, dr, r1, r2, r4, r5, ll, lr, l_my, c_pm,
+    //             f1, f2, f4, f5, p1, p2, p3, p4, p5, p6;
+    int    Dk, X, Y;
+    double Ds, U, V, W;
 
-		m  = (int) my;
-		if (my != my_last) { //  set-up    
-			my_last = my;
+    m  = (int) my;
+    if (my != my_last) { //  set-up    
+      my_last = my;
 
-			// approximate deviation of reflection points k2, k4 from my - 1/2    
-			Ds = Math.sqrt(my + 0.25);
+      // approximate deviation of reflection points k2, k4 from my - 1/2    
+      Ds = Math.sqrt(my + 0.25);
 
-			// mode m, reflection points k2 and k4, and points k1 and k5, which    
-			// delimit the centre region of h(x)                                    
-			k2 = (int) Math.ceil(my - 0.5 - Ds);
-			k4 = (int)     (my - 0.5 + Ds);
-			k1 = k2 + k2 - m + 1;
-			k5 = k4 + k4 - m;
+      // mode m, reflection points k2 and k4, and points k1 and k5, which    
+      // delimit the centre region of h(x)                                    
+      k2 = (int) Math.ceil(my - 0.5 - Ds);
+      k4 = (int)     (my - 0.5 + Ds);
+      k1 = k2 + k2 - m + 1;
+      k5 = k4 + k4 - m;
 
-			// range width of the critical left and right centre region            
-			dl = (double) (k2 - k1);
-			dr = (double) (k5 - k4);
+      // range width of the critical left and right centre region            
+      dl = (double) (k2 - k1);
+      dr = (double) (k5 - k4);
 
-			// recurrence constants r(k) = p(k)/p(k-1) at k = k1, k2, k4+1, k5+1    
-			r1 = my / (double) k1;
-			r2 = my / (double) k2;
-			r4 = my / (double)(k4 + 1);
-			r5 = my / (double)(k5 + 1);
+      // recurrence constants r(k) = p(k)/p(k-1) at k = k1, k2, k4+1, k5+1    
+      r1 = my / (double) k1;
+      r2 = my / (double) k2;
+      r4 = my / (double)(k4 + 1);
+      r5 = my / (double)(k5 + 1);
 
-			// reciprocal values of the scale parameters of expon. tail envelopes   
-			ll =  Math.log(r1);                     // expon. tail left 
-			lr = -Math.log(r5);                     // expon. tail right
+      // reciprocal values of the scale parameters of expon. tail envelopes   
+      ll =  Math.log(r1);                     // expon. tail left 
+      lr = -Math.log(r5);                     // expon. tail right
 
-			// Poisson constants, necessary for computing function values f(k)      
-			l_my = Math.log(my);
-			c_pm = m * l_my - Arithmetic.logFactorial(m);
+      // Poisson constants, necessary for computing function values f(k)      
+      l_my = Math.log(my);
+      c_pm = m * l_my - Arithmetic.logFactorial(m);
 
-			// function values f(k) = p(k)/p(m) at k = k2, k4, k1, k5               
-			f2 = f(k2, l_my, c_pm);
-			f4 = f(k4, l_my, c_pm);
-			f1 = f(k1, l_my, c_pm);
-			f5 = f(k5, l_my, c_pm);
+      // function values f(k) = p(k)/p(m) at k = k2, k4, k1, k5               
+      f2 = f(k2, l_my, c_pm);
+      f4 = f(k4, l_my, c_pm);
+      f1 = f(k1, l_my, c_pm);
+      f5 = f(k5, l_my, c_pm);
 
-			// area of the two centre and the two exponential tail regions          
-			// area of the two immediate acceptance regions between k2, k4         
-			p1 = f2 * (dl + 1.0);                    // immed. left    
-			p2 = f2 * dl         + p1;               // centre left    
-			p3 = f4 * (dr + 1.0) + p2;               // immed. right     
-			p4 = f4 * dr         + p3;               // centre right     
-			p5 = f1 / ll         + p4;               // expon. tail left 
-			p6 = f5 / lr         + p5;               // expon. tail right
-		} // end set-up
+      // area of the two centre and the two exponential tail regions          
+      // area of the two immediate acceptance regions between k2, k4         
+      p1 = f2 * (dl + 1.0);                    // immed. left    
+      p2 = f2 * dl         + p1;               // centre left    
+      p3 = f4 * (dr + 1.0) + p2;               // immed. right     
+      p4 = f4 * dr         + p3;               // centre right     
+      p5 = f1 / ll         + p4;               // expon. tail left 
+      p6 = f5 / lr         + p5;               // expon. tail right
+    } // end set-up
 
-		for (;;) {
-			// generate uniform number U -- U(0, p6)                                
-			// case distinction corresponding to U                                  
-			if ((U = gen.raw() * p6) < p2) {         // centre left      
+    for (;;) {
+      // generate uniform number U -- U(0, p6)                                
+      // case distinction corresponding to U                                  
+      if ((U = gen.raw() * p6) < p2) {         // centre left      
 
-				// immediate acceptance region R2 = [k2, m) *[0, f2),  X = k2, ... m -1 
-				if ((V = U - p1) < 0.0)  return(k2 + (int)(U/f2));
-				// immediate acceptance region R1 = [k1, k2)*[0, f1),  X = k1, ... k2-1 
-				if ((W = V / dl) < f1 )  return(k1 + (int)(V/f1));
+        // immediate acceptance region R2 = [k2, m) *[0, f2),  X = k2, ... m -1 
+        if ((V = U - p1) < 0.0)  return(k2 + (int)(U/f2));
+        // immediate acceptance region R1 = [k1, k2)*[0, f1),  X = k1, ... k2-1 
+        if ((W = V / dl) < f1 )  return(k1 + (int)(V/f1));
 
-				// computation of candidate X < k2, and its counterpart Y > k2          
-				// either squeeze-acceptance of X or acceptance-rejection of Y          
-				Dk = (int)(dl * gen.raw()) + 1;
-				if (W <= f2 - Dk * (f2 - f2/r2)) {            // quick accept of  
-					return(k2 - Dk);                          // X = k2 - Dk      
-				}
-				if ((V = f2 + f2 - W) < 1.0) {                // quick reject of Y
-					Y = k2 + Dk;
-					if (V <= f2 + Dk * (1.0 - f2)/(dl + 1.0)) {// quick accept of  
-						return(Y);                             // Y = k2 + Dk      
-					}
-					if (V <= f(Y, l_my, c_pm))  return(Y);    // final accept of Y
-				}
-				X = k2 - Dk;
-			}
-			else if (U < p4) {                                 // centre right     
-				// immediate acceptance region R3 = [m, k4+1)*[0, f4), X = m, ... k4    
-				if ((V = U - p3) < 0.0)  return(k4 - (int)((U - p2)/f4));
-				// immediate acceptance region R4 = [k4+1, k5+1)*[0, f5)                
-				if ((W = V / dr) < f5 )  return(k5 - (int)(V/f5));
+        // computation of candidate X < k2, and its counterpart Y > k2          
+        // either squeeze-acceptance of X or acceptance-rejection of Y          
+        Dk = (int)(dl * gen.raw()) + 1;
+        if (W <= f2 - Dk * (f2 - f2/r2)) {            // quick accept of  
+          return(k2 - Dk);                          // X = k2 - Dk      
+        }
+        if ((V = f2 + f2 - W) < 1.0) {                // quick reject of Y
+          Y = k2 + Dk;
+          if (V <= f2 + Dk * (1.0 - f2)/(dl + 1.0)) {// quick accept of  
+            return(Y);                             // Y = k2 + Dk      
+          }
+          if (V <= f(Y, l_my, c_pm))  return(Y);    // final accept of Y
+        }
+        X = k2 - Dk;
+      }
+      else if (U < p4) {                                 // centre right     
+        // immediate acceptance region R3 = [m, k4+1)*[0, f4), X = m, ... k4    
+        if ((V = U - p3) < 0.0)  return(k4 - (int)((U - p2)/f4));
+        // immediate acceptance region R4 = [k4+1, k5+1)*[0, f5)                
+        if ((W = V / dr) < f5 )  return(k5 - (int)(V/f5));
 
-				// computation of candidate X > k4, and its counterpart Y < k4          
-				// either squeeze-acceptance of X or acceptance-rejection of Y          
-				Dk = (int)(dr * gen.raw()) + 1;
-				if (W <= f4 - Dk * (f4 - f4*r4)) {             // quick accept of  
-					return(k4 + Dk);                           // X = k4 + Dk      
-				}
-				if ((V = f4 + f4 - W) < 1.0) {                 // quick reject of Y
-					Y = k4 - Dk;
-					if (V <= f4 + Dk * (1.0 - f4)/ dr) {       // quick accept of  
-						return(Y);                             // Y = k4 - Dk      
-					}
-					if (V <= f(Y, l_my, c_pm))  return(Y);    // final accept of Y
-				}
-				X = k4 + Dk;
-			}
-			else {
-				W = gen.raw();
-				if (U < p5)	{                                  // expon. tail left 
-					Dk = (int)(1.0 - Math.log(W)/ll);
-					if ((X = k1 - Dk) < 0)  continue;          // 0 <= X <= k1 - 1 
-					W *= (U - p4) * ll;                        // W -- U(0, h(x))  
-					if (W <= f1 - Dk * (f1 - f1/r1))  return(X); // quick accept of X
-				}
-				else {                                         // expon. tail right
-					Dk = (int)(1.0 - Math.log(W)/lr);
-					X  = k5 + Dk;                              // X >= k5 + 1      
-					W *= (U - p5) * lr;                        // W -- U(0, h(x))  
-					if (W <= f5 - Dk * (f5 - f5*r5))  return(X); // quick accept of X
-				}
-			}
+        // computation of candidate X > k4, and its counterpart Y < k4          
+        // either squeeze-acceptance of X or acceptance-rejection of Y          
+        Dk = (int)(dr * gen.raw()) + 1;
+        if (W <= f4 - Dk * (f4 - f4*r4)) {             // quick accept of  
+          return(k4 + Dk);                           // X = k4 + Dk      
+        }
+        if ((V = f4 + f4 - W) < 1.0) {                 // quick reject of Y
+          Y = k4 - Dk;
+          if (V <= f4 + Dk * (1.0 - f4)/ dr) {       // quick accept of  
+            return(Y);                             // Y = k4 - Dk      
+          }
+          if (V <= f(Y, l_my, c_pm))  return(Y);    // final accept of Y
+        }
+        X = k4 + Dk;
+      }
+      else {
+        W = gen.raw();
+        if (U < p5)  {                                  // expon. tail left 
+          Dk = (int)(1.0 - Math.log(W)/ll);
+          if ((X = k1 - Dk) < 0)  continue;          // 0 <= X <= k1 - 1 
+          W *= (U - p4) * ll;                        // W -- U(0, h(x))  
+          if (W <= f1 - Dk * (f1 - f1/r1))  return(X); // quick accept of X
+        }
+        else {                                         // expon. tail right
+          Dk = (int)(1.0 - Math.log(W)/lr);
+          X  = k5 + Dk;                              // X >= k5 + 1      
+          W *= (U - p5) * lr;                        // W -- U(0, h(x))  
+          if (W <= f5 - Dk * (f5 - f5*r5))  return(X); // quick accept of X
+        }
+      }
 
-			// acceptance-rejection test of candidate X from the original area   
-			// test, whether  W <= f(k),    with  W = U*h(x)  and  U -- U(0, 1)  
-			// log f(X) = (X - m)*log(my) - log X! + log m!                       
-			if (Math.log(W) <= X * l_my - Arithmetic.logFactorial(X) - c_pm)  return(X);	
-		}
-	}
-	else { // mean is too large
-		return (int) my;
-	}
+      // acceptance-rejection test of candidate X from the original area   
+      // test, whether  W <= f(k),    with  W = U*h(x)  and  U -- U(0, 1)  
+      // log f(X) = (X - m)*log(my) - log X! + log m!                       
+      if (Math.log(W) <= X * l_my - Arithmetic.logFactorial(X) - c_pm)  return(X);  
+    }
+  }
+  else { // mean is too large
+    return (int) my;
+  }
 }
 /**
  * Returns the probability distribution function.
  */
 public double pdf(int k) {
-	return Math.exp(k*Math.log(this.mean) - Arithmetic.logFactorial(k) - this.mean);
-	
-	// Overflow sensitive:
-	// return (Math.pow(mean,k) / cephes.Arithmetic.factorial(k)) * Math.exp(-this.mean);
+  return Math.exp(k*Math.log(this.mean) - Arithmetic.logFactorial(k) - this.mean);
+  
+  // Overflow sensitive:
+  // return (Math.pow(mean,k) / cephes.Arithmetic.factorial(k)) * Math.exp(-this.mean);
 }
 /**
  * Sets the mean.
  */
 public void setMean(double mean) {
-	this.mean = mean;
+  this.mean = mean;
 }
 /**
  * Returns a random number from the distribution with the given mean.
  */
 public static int staticNextInt(double mean) {
-	synchronized (shared) {
-		shared.setMean(mean);
-		return shared.nextInt();
-	}
+  synchronized (shared) {
+    shared.setMean(mean);
+    return shared.nextInt();
+  }
 }
 /**
  * Returns a String representation of the receiver.
  */
 public String toString() {
-	return this.getClass().getName()+"("+mean+")";
+  return this.getClass().getName()+"("+mean+")";
 }
 /**
  * Sets the uniform random number generated shared by all <b>static</b> methods.
  * @param randomGenerator the new uniform random number generator to be shared.
  */
 private static void xstaticSetRandomGenerator(RandomEngine randomGenerator) {
-	synchronized (shared) {
-		shared.setRandomGenerator(randomGenerator);
-	}
+  synchronized (shared) {
+    shared.setRandomGenerator(randomGenerator);
+  }
 }
 }
Index: matrix/src/main/java/org/apache/mahout/jet/math/Functions.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/jet/math/Functions.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/jet/math/Functions.java	(working copy)
@@ -111,37 +111,37 @@
   is often acceptable.
 <center>
   <table border cellpadding="3" cellspacing="0" align="center">
-	<tr valign="middle" bgcolor="#33CC66" nowrap align="center"> 
-	  <td nowrap colspan="7"> <font size="+2">Iteration Performance [million function 
-		evaluations per second]</font><br>
-		<font size="-1">Pentium Pro 200 Mhz, SunJDK 1.2.2, NT, java -classic, 
-		</font></td>
-	</tr>
-	<tr valign="middle" bgcolor="#66CCFF" nowrap align="center"> 
-	  <td nowrap bgcolor="#FF9966" rowspan="2">&nbsp;</td>
-	  <td bgcolor="#FF9966" colspan="2"> 
-		<p> 30000000 iterations</p>
-	  </td>
-	  <td bgcolor="#FF9966" colspan="2"> 3000000 iterations (10 times less)</td>
-	  <td bgcolor="#FF9966" colspan="2">&nbsp;</td>
-	</tr>
-	<tr valign="middle" bgcolor="#66CCFF" nowrap align="center"> 
-	  <td bgcolor="#FF9966"> <tt>F.plus</tt></td>
-	  <td bgcolor="#FF9966"><tt>a+b</tt></td>
-	  <td bgcolor="#FF9966"> <tt>F.chain(F.abs,F.chain(F.plus,F.sin,F.chain(F.square,F.cos)))</tt></td>
-	  <td bgcolor="#FF9966"> <tt>Math.abs(Math.sin(a) + Math.pow(Math.cos(b),2))</tt></td>
-	  <td bgcolor="#FF9966">&nbsp;</td>
-	  <td bgcolor="#FF9966">&nbsp;</td>
-	</tr>
-	<tr valign="middle" bgcolor="#66CCFF" nowrap align="center"> 
-	  <td nowrap bgcolor="#FF9966">&nbsp;</td>
-	  <td nowrap>10.8</td>
-	  <td nowrap>29.6</td>
-	  <td nowrap>0.43</td>
-	  <td nowrap>0.35</td>
-	  <td nowrap>&nbsp;</td>
-	  <td nowrap>&nbsp;</td>
-	</tr>
+  <tr valign="middle" bgcolor="#33CC66" nowrap align="center"> 
+    <td nowrap colspan="7"> <font size="+2">Iteration Performance [million function 
+    evaluations per second]</font><br>
+    <font size="-1">Pentium Pro 200 Mhz, SunJDK 1.2.2, NT, java -classic, 
+    </font></td>
+  </tr>
+  <tr valign="middle" bgcolor="#66CCFF" nowrap align="center"> 
+    <td nowrap bgcolor="#FF9966" rowspan="2">&nbsp;</td>
+    <td bgcolor="#FF9966" colspan="2"> 
+    <p> 30000000 iterations</p>
+    </td>
+    <td bgcolor="#FF9966" colspan="2"> 3000000 iterations (10 times less)</td>
+    <td bgcolor="#FF9966" colspan="2">&nbsp;</td>
+  </tr>
+  <tr valign="middle" bgcolor="#66CCFF" nowrap align="center"> 
+    <td bgcolor="#FF9966"> <tt>F.plus</tt></td>
+    <td bgcolor="#FF9966"><tt>a+b</tt></td>
+    <td bgcolor="#FF9966"> <tt>F.chain(F.abs,F.chain(F.plus,F.sin,F.chain(F.square,F.cos)))</tt></td>
+    <td bgcolor="#FF9966"> <tt>Math.abs(Math.sin(a) + Math.pow(Math.cos(b),2))</tt></td>
+    <td bgcolor="#FF9966">&nbsp;</td>
+    <td bgcolor="#FF9966">&nbsp;</td>
+  </tr>
+  <tr valign="middle" bgcolor="#66CCFF" nowrap align="center"> 
+    <td nowrap bgcolor="#FF9966">&nbsp;</td>
+    <td nowrap>10.8</td>
+    <td nowrap>29.6</td>
+    <td nowrap>0.43</td>
+    <td nowrap>0.35</td>
+    <td nowrap>&nbsp;</td>
+    <td nowrap>&nbsp;</td>
+  </tr>
   </table></center>
 
 
@@ -153,437 +153,437 @@
  */
 @Deprecated
 public class Functions extends Object {
-	/**
-	Little trick to allow for "aliasing", that is, renaming this class.
-	Writing code like
-	<p>
-	<tt>Functions.chain(Functions.plus,Functions.sin,Functions.chain(Functions.square,Functions.cos));</tt>
-	<p>
-	is a bit awkward, to say the least.
-	Using the aliasing you can instead write
-	<p>
-	<tt>Functions F = Functions.functions; <br>
-	F.chain(F.plus,F.sin,F.chain(F.square,F.cos));</tt>
-	*/
-	public static final Functions functions = new Functions();
+  /**
+  Little trick to allow for "aliasing", that is, renaming this class.
+  Writing code like
+  <p>
+  <tt>Functions.chain(Functions.plus,Functions.sin,Functions.chain(Functions.square,Functions.cos));</tt>
+  <p>
+  is a bit awkward, to say the least.
+  Using the aliasing you can instead write
+  <p>
+  <tt>Functions F = Functions.functions; <br>
+  F.chain(F.plus,F.sin,F.chain(F.square,F.cos));</tt>
+  */
+  public static final Functions functions = new Functions();
 
-	/*****************************
-	 * <H3>Unary functions</H3>
-	 *****************************/
-	/**
-	 * Function that returns <tt>Math.abs(a)</tt>.
-	 */
-	public static final DoubleFunction abs = new DoubleFunction() {
-		public final double apply(double a) { return Math.abs(a); }
-	};		
+  /*****************************
+   * <H3>Unary functions</H3>
+   *****************************/
+  /**
+   * Function that returns <tt>Math.abs(a)</tt>.
+   */
+  public static final DoubleFunction abs = new DoubleFunction() {
+    public final double apply(double a) { return Math.abs(a); }
+  };    
 
-	/**
-	 * Function that returns <tt>Math.acos(a)</tt>.
-	 */
-	public static final DoubleFunction acos = new DoubleFunction() {
-		public final double apply(double a) { return Math.acos(a); }
-	};		
+  /**
+   * Function that returns <tt>Math.acos(a)</tt>.
+   */
+  public static final DoubleFunction acos = new DoubleFunction() {
+    public final double apply(double a) { return Math.acos(a); }
+  };    
 
-	/**
-	 * Function that returns <tt>com.imsl.math.Sfun.acosh(a)</tt>.
-	 */
-	/*
-	public static final DoubleFunction acosh = new DoubleFunction() {
-		public final double apply(double a) { return Sfun.acosh(a); }
-	};
-	*/		
+  /**
+   * Function that returns <tt>com.imsl.math.Sfun.acosh(a)</tt>.
+   */
+  /*
+  public static final DoubleFunction acosh = new DoubleFunction() {
+    public final double apply(double a) { return Sfun.acosh(a); }
+  };
+  */    
 
-	/**
-	 * Function that returns <tt>Math.asin(a)</tt>.
-	 */
-	public static final DoubleFunction asin = new DoubleFunction() {
-		public final double apply(double a) { return Math.asin(a); }
-	};		
+  /**
+   * Function that returns <tt>Math.asin(a)</tt>.
+   */
+  public static final DoubleFunction asin = new DoubleFunction() {
+    public final double apply(double a) { return Math.asin(a); }
+  };    
 
-	/**
-	 * Function that returns <tt>com.imsl.math.Sfun.asinh(a)</tt>.
-	 */
-	/*
-	public static final DoubleFunction asinh = new DoubleFunction() {
-		public final double apply(double a) { return Sfun.asinh(a); }
-	};
-	*/		
+  /**
+   * Function that returns <tt>com.imsl.math.Sfun.asinh(a)</tt>.
+   */
+  /*
+  public static final DoubleFunction asinh = new DoubleFunction() {
+    public final double apply(double a) { return Sfun.asinh(a); }
+  };
+  */    
 
-	/**
-	 * Function that returns <tt>Math.atan(a)</tt>.
-	 */
-	public static final DoubleFunction atan = new DoubleFunction() {
-		public final double apply(double a) { return Math.atan(a); }
-	};		
+  /**
+   * Function that returns <tt>Math.atan(a)</tt>.
+   */
+  public static final DoubleFunction atan = new DoubleFunction() {
+    public final double apply(double a) { return Math.atan(a); }
+  };    
 
-	/**
-	 * Function that returns <tt>com.imsl.math.Sfun.atanh(a)</tt>.
-	 */
-	/*
-	public static final DoubleFunction atanh = new DoubleFunction() {
-		public final double apply(double a) { return Sfun.atanh(a); }
-	};
-	*/		
+  /**
+   * Function that returns <tt>com.imsl.math.Sfun.atanh(a)</tt>.
+   */
+  /*
+  public static final DoubleFunction atanh = new DoubleFunction() {
+    public final double apply(double a) { return Sfun.atanh(a); }
+  };
+  */    
 
-	/**
-	 * Function that returns <tt>Math.ceil(a)</tt>.
-	 */
-	public static final DoubleFunction ceil = new DoubleFunction() {
-		public final double apply(double a) { return Math.ceil(a); }
-	};		
+  /**
+   * Function that returns <tt>Math.ceil(a)</tt>.
+   */
+  public static final DoubleFunction ceil = new DoubleFunction() {
+    public final double apply(double a) { return Math.ceil(a); }
+  };    
 
-	/**
-	 * Function that returns <tt>Math.cos(a)</tt>.
-	 */
-	public static final DoubleFunction cos = new DoubleFunction() {
-		public final double apply(double a) { return Math.cos(a); }
-	};		
+  /**
+   * Function that returns <tt>Math.cos(a)</tt>.
+   */
+  public static final DoubleFunction cos = new DoubleFunction() {
+    public final double apply(double a) { return Math.cos(a); }
+  };    
 
-	/**
-	 * Function that returns <tt>com.imsl.math.Sfun.cosh(a)</tt>.
-	 */
-	/*
-	public static final DoubleFunction cosh = new DoubleFunction() {
-		public final double apply(double a) { return Sfun.cosh(a); }
-	};
-	*/		
+  /**
+   * Function that returns <tt>com.imsl.math.Sfun.cosh(a)</tt>.
+   */
+  /*
+  public static final DoubleFunction cosh = new DoubleFunction() {
+    public final double apply(double a) { return Sfun.cosh(a); }
+  };
+  */    
 
-	/**
-	 * Function that returns <tt>com.imsl.math.Sfun.cot(a)</tt>.
-	 */
-	/*
-	public static final DoubleFunction cot = new DoubleFunction() {
-		public final double apply(double a) { return Sfun.cot(a); }
-	};
-	*/		
+  /**
+   * Function that returns <tt>com.imsl.math.Sfun.cot(a)</tt>.
+   */
+  /*
+  public static final DoubleFunction cot = new DoubleFunction() {
+    public final double apply(double a) { return Sfun.cot(a); }
+  };
+  */    
 
-	/**
-	 * Function that returns <tt>com.imsl.math.Sfun.erf(a)</tt>.
-	 */
-	/*
-	public static final DoubleFunction erf = new DoubleFunction() {
-		public final double apply(double a) { return Sfun.erf(a); }
-	};
-	*/		
+  /**
+   * Function that returns <tt>com.imsl.math.Sfun.erf(a)</tt>.
+   */
+  /*
+  public static final DoubleFunction erf = new DoubleFunction() {
+    public final double apply(double a) { return Sfun.erf(a); }
+  };
+  */    
 
-	/**
-	 * Function that returns <tt>com.imsl.math.Sfun.erfc(a)</tt>.
-	 */
-	/*
-	public static final DoubleFunction erfc = new DoubleFunction() {
-		public final double apply(double a) { return Sfun.erfc(a); }
-	};
-	*/		
+  /**
+   * Function that returns <tt>com.imsl.math.Sfun.erfc(a)</tt>.
+   */
+  /*
+  public static final DoubleFunction erfc = new DoubleFunction() {
+    public final double apply(double a) { return Sfun.erfc(a); }
+  };
+  */    
 
-	/**
-	 * Function that returns <tt>Math.exp(a)</tt>.
-	 */
-	public static final DoubleFunction exp = new DoubleFunction() {
-		public final double apply(double a) { return Math.exp(a); }
-	};		
+  /**
+   * Function that returns <tt>Math.exp(a)</tt>.
+   */
+  public static final DoubleFunction exp = new DoubleFunction() {
+    public final double apply(double a) { return Math.exp(a); }
+  };    
 
-	/**
-	 * Function that returns <tt>Math.floor(a)</tt>.
-	 */
-	public static final DoubleFunction floor = new DoubleFunction() {
-		public final double apply(double a) { return Math.floor(a); }
-	};		
+  /**
+   * Function that returns <tt>Math.floor(a)</tt>.
+   */
+  public static final DoubleFunction floor = new DoubleFunction() {
+    public final double apply(double a) { return Math.floor(a); }
+  };    
 
-	/**
-	 * Function that returns <tt>com.imsl.math.Sfun.gamma(a)</tt>.
-	 */
-	/*
-	public static final DoubleFunction gamma = new DoubleFunction() {
-		public final double apply(double a) { return Sfun.gamma(a); }
-	};
-	*/		
+  /**
+   * Function that returns <tt>com.imsl.math.Sfun.gamma(a)</tt>.
+   */
+  /*
+  public static final DoubleFunction gamma = new DoubleFunction() {
+    public final double apply(double a) { return Sfun.gamma(a); }
+  };
+  */    
 
-	/**
-	 * Function that returns its argument.
-	 */
-	public static final DoubleFunction identity = new DoubleFunction() {
-		public final double apply(double a) { return a; }   
-	};
-	
-	/**
-	 * Function that returns <tt>1.0 / a</tt>.
-	 */
-	public static final DoubleFunction inv = new DoubleFunction() {
-		public final double apply(double a) { return 1.0 / a; }   
-	};
-	
-	/**
-	 * Function that returns <tt>Math.log(a)</tt>.
-	 */
-	public static final DoubleFunction log = new DoubleFunction() {
-		public final double apply(double a) { return Math.log(a); }
-	};		
+  /**
+   * Function that returns its argument.
+   */
+  public static final DoubleFunction identity = new DoubleFunction() {
+    public final double apply(double a) { return a; }   
+  };
+  
+  /**
+   * Function that returns <tt>1.0 / a</tt>.
+   */
+  public static final DoubleFunction inv = new DoubleFunction() {
+    public final double apply(double a) { return 1.0 / a; }   
+  };
+  
+  /**
+   * Function that returns <tt>Math.log(a)</tt>.
+   */
+  public static final DoubleFunction log = new DoubleFunction() {
+    public final double apply(double a) { return Math.log(a); }
+  };    
 
-	/**
-	 * Function that returns <tt>com.imsl.math.Sfun.log10(a)</tt>.
-	 */
-	/*
-	public static final DoubleFunction log10 = new DoubleFunction() {
-		public final double apply(double a) { return Sfun.log10(a); }
-	};
-	*/		
+  /**
+   * Function that returns <tt>com.imsl.math.Sfun.log10(a)</tt>.
+   */
+  /*
+  public static final DoubleFunction log10 = new DoubleFunction() {
+    public final double apply(double a) { return Sfun.log10(a); }
+  };
+  */    
 
-	/**
-	 * Function that returns <tt>Math.log(a) / Math.log(2)</tt>.
-	 */
-	public static final DoubleFunction log2 = new DoubleFunction() {
-		// 1.0 / Math.log(2) == 1.4426950408889634
-		public final double apply(double a) { return Math.log(a) * 1.4426950408889634; }
-	};		
+  /**
+   * Function that returns <tt>Math.log(a) / Math.log(2)</tt>.
+   */
+  public static final DoubleFunction log2 = new DoubleFunction() {
+    // 1.0 / Math.log(2) == 1.4426950408889634
+    public final double apply(double a) { return Math.log(a) * 1.4426950408889634; }
+  };    
 
-	/**
-	 * Function that returns <tt>com.imsl.math.Sfun.logGamma(a)</tt>.
-	 */
-	/*
-	public static final DoubleFunction logGamma = new DoubleFunction() {
-		public final double apply(double a) { return Sfun.logGamma(a); }
-	};
-	*/		
+  /**
+   * Function that returns <tt>com.imsl.math.Sfun.logGamma(a)</tt>.
+   */
+  /*
+  public static final DoubleFunction logGamma = new DoubleFunction() {
+    public final double apply(double a) { return Sfun.logGamma(a); }
+  };
+  */    
 
-	/**
-	 * Function that returns <tt>-a</tt>.
-	 */
-	public static final DoubleFunction neg = new DoubleFunction() {
-		public final double apply(double a) { return -a; }
-	};
-		
-	/**
-	 * Function that returns <tt>Math.rint(a)</tt>.
-	 */
-	public static final DoubleFunction rint = new DoubleFunction() {
-		public final double apply(double a) { return Math.rint(a); }
-	};
-		
-	/**
-	 * Function that returns <tt>a < 0 ? -1 : a > 0 ? 1 : 0</tt>.
-	 */
-	public static final DoubleFunction sign = new DoubleFunction() {
-		public final double apply(double a) { return a < 0 ? -1 : a > 0 ? 1 : 0; }
-	};
-		
-	/**
-	 * Function that returns <tt>Math.sin(a)</tt>.
-	 */
-	public static final DoubleFunction sin = new DoubleFunction() {
-		public final double apply(double a) { return Math.sin(a); }
-	};
-		
-	/**
-	 * Function that returns <tt>com.imsl.math.Sfun.sinh(a)</tt>.
-	 */
-	/*
-	public static final DoubleFunction sinh = new DoubleFunction() {
-		public final double apply(double a) { return Sfun.sinh(a); }
-	};
-	*/		
+  /**
+   * Function that returns <tt>-a</tt>.
+   */
+  public static final DoubleFunction neg = new DoubleFunction() {
+    public final double apply(double a) { return -a; }
+  };
+    
+  /**
+   * Function that returns <tt>Math.rint(a)</tt>.
+   */
+  public static final DoubleFunction rint = new DoubleFunction() {
+    public final double apply(double a) { return Math.rint(a); }
+  };
+    
+  /**
+   * Function that returns <tt>a < 0 ? -1 : a > 0 ? 1 : 0</tt>.
+   */
+  public static final DoubleFunction sign = new DoubleFunction() {
+    public final double apply(double a) { return a < 0 ? -1 : a > 0 ? 1 : 0; }
+  };
+    
+  /**
+   * Function that returns <tt>Math.sin(a)</tt>.
+   */
+  public static final DoubleFunction sin = new DoubleFunction() {
+    public final double apply(double a) { return Math.sin(a); }
+  };
+    
+  /**
+   * Function that returns <tt>com.imsl.math.Sfun.sinh(a)</tt>.
+   */
+  /*
+  public static final DoubleFunction sinh = new DoubleFunction() {
+    public final double apply(double a) { return Sfun.sinh(a); }
+  };
+  */    
 
-	/**
-	 * Function that returns <tt>Math.sqrt(a)</tt>.
-	 */
-	public static final DoubleFunction sqrt = new DoubleFunction() {
-		public final double apply(double a) { return Math.sqrt(a); }
-	};
-		
-	/**
-	 * Function that returns <tt>a * a</tt>.
-	 */
-	public static final DoubleFunction square = new DoubleFunction() {
-		public final double apply(double a) { return a * a; }
-	};
-		
-	/**
-	 * Function that returns <tt>Math.tan(a)</tt>.
-	 */
-	public static final DoubleFunction tan = new DoubleFunction() {
-		public final double apply(double a) { return Math.tan(a); }
-	};
-		
-	/**
-	 * Function that returns <tt>com.imsl.math.Sfun.tanh(a)</tt>.
-	 */
-	/*
-	public static final DoubleFunction tanh = new DoubleFunction() {
-		public final double apply(double a) { return Sfun.tanh(a); }
-	};
-	*/		
+  /**
+   * Function that returns <tt>Math.sqrt(a)</tt>.
+   */
+  public static final DoubleFunction sqrt = new DoubleFunction() {
+    public final double apply(double a) { return Math.sqrt(a); }
+  };
+    
+  /**
+   * Function that returns <tt>a * a</tt>.
+   */
+  public static final DoubleFunction square = new DoubleFunction() {
+    public final double apply(double a) { return a * a; }
+  };
+    
+  /**
+   * Function that returns <tt>Math.tan(a)</tt>.
+   */
+  public static final DoubleFunction tan = new DoubleFunction() {
+    public final double apply(double a) { return Math.tan(a); }
+  };
+    
+  /**
+   * Function that returns <tt>com.imsl.math.Sfun.tanh(a)</tt>.
+   */
+  /*
+  public static final DoubleFunction tanh = new DoubleFunction() {
+    public final double apply(double a) { return Sfun.tanh(a); }
+  };
+  */    
 
-	/**
-	 * Function that returns <tt>Math.toDegrees(a)</tt>.
-	 */
-	/*
-	public static final DoubleFunction toDegrees = new DoubleFunction() {
-		public final double apply(double a) { return Math.toDegrees(a); }
-	};
-	*/
+  /**
+   * Function that returns <tt>Math.toDegrees(a)</tt>.
+   */
+  /*
+  public static final DoubleFunction toDegrees = new DoubleFunction() {
+    public final double apply(double a) { return Math.toDegrees(a); }
+  };
+  */
 
-	/**
-	 * Function that returns <tt>Math.toRadians(a)</tt>.
-	 */
-	/*
-	public static final DoubleFunction toRadians = new DoubleFunction() {
-		public final double apply(double a) { return Math.toRadians(a); }
-	};		
-	*/
-	
+  /**
+   * Function that returns <tt>Math.toRadians(a)</tt>.
+   */
+  /*
+  public static final DoubleFunction toRadians = new DoubleFunction() {
+    public final double apply(double a) { return Math.toRadians(a); }
+  };    
+  */
+  
 
 
-	/*****************************
-	 * <H3>Binary functions</H3>
-	 *****************************/
-		
-	/**
-	 * Function that returns <tt>Math.atan2(a,b)</tt>.
-	 */
-	public static final DoubleDoubleFunction atan2 = new DoubleDoubleFunction() {
-		public final double apply(double a, double b) { return Math.atan2(a,b); }
-	};
-		
-	/**
-	 * Function that returns <tt>com.imsl.math.Sfun.logBeta(a,b)</tt>.
-	 */
-	/*
-	public static final DoubleDoubleFunction logBeta = new DoubleDoubleFunction() {
-		public final double apply(double a, double b) { return Sfun.logBeta(a,b); }
-	};
-	*/
-		
+  /*****************************
+   * <H3>Binary functions</H3>
+   *****************************/
+    
+  /**
+   * Function that returns <tt>Math.atan2(a,b)</tt>.
+   */
+  public static final DoubleDoubleFunction atan2 = new DoubleDoubleFunction() {
+    public final double apply(double a, double b) { return Math.atan2(a,b); }
+  };
+    
+  /**
+   * Function that returns <tt>com.imsl.math.Sfun.logBeta(a,b)</tt>.
+   */
+  /*
+  public static final DoubleDoubleFunction logBeta = new DoubleDoubleFunction() {
+    public final double apply(double a, double b) { return Sfun.logBeta(a,b); }
+  };
+  */
+    
 
-	/**
-	 * Function that returns <tt>a < b ? -1 : a > b ? 1 : 0</tt>.
-	 */
-	public static final DoubleDoubleFunction compare = new DoubleDoubleFunction() {
-		public final double apply(double a, double b) { return a < b ? -1 : a > b ? 1 : 0; }
-	};
-		
-	/**
-	 * Function that returns <tt>a / b</tt>.
-	 */
-	public static final DoubleDoubleFunction div = new DoubleDoubleFunction() {
-		public final double apply(double a, double b) { return a / b; }
-	};
-		
-	/**
-	 * Function that returns <tt>a == b ? 1 : 0</tt>.
-	 */
-	public static final DoubleDoubleFunction equals = new DoubleDoubleFunction() {
-		public final double apply(double a, double b) { return a == b ? 1 : 0; }
-	};
-		
-	/**
-	 * Function that returns <tt>a > b ? 1 : 0</tt>.
-	 */
-	public static final DoubleDoubleFunction greater = new DoubleDoubleFunction() {
-		public final double apply(double a, double b) { return a > b ? 1 : 0; }
-	};
-		
-	/**
-	 * Function that returns <tt>Math.IEEEremainder(a,b)</tt>.
-	 */
-	public static final DoubleDoubleFunction IEEEremainder = new DoubleDoubleFunction() {
-		public final double apply(double a, double b) { return Math.IEEEremainder(a,b); }
-	};		
+  /**
+   * Function that returns <tt>a < b ? -1 : a > b ? 1 : 0</tt>.
+   */
+  public static final DoubleDoubleFunction compare = new DoubleDoubleFunction() {
+    public final double apply(double a, double b) { return a < b ? -1 : a > b ? 1 : 0; }
+  };
+    
+  /**
+   * Function that returns <tt>a / b</tt>.
+   */
+  public static final DoubleDoubleFunction div = new DoubleDoubleFunction() {
+    public final double apply(double a, double b) { return a / b; }
+  };
+    
+  /**
+   * Function that returns <tt>a == b ? 1 : 0</tt>.
+   */
+  public static final DoubleDoubleFunction equals = new DoubleDoubleFunction() {
+    public final double apply(double a, double b) { return a == b ? 1 : 0; }
+  };
+    
+  /**
+   * Function that returns <tt>a > b ? 1 : 0</tt>.
+   */
+  public static final DoubleDoubleFunction greater = new DoubleDoubleFunction() {
+    public final double apply(double a, double b) { return a > b ? 1 : 0; }
+  };
+    
+  /**
+   * Function that returns <tt>Math.IEEEremainder(a,b)</tt>.
+   */
+  public static final DoubleDoubleFunction IEEEremainder = new DoubleDoubleFunction() {
+    public final double apply(double a, double b) { return Math.IEEEremainder(a,b); }
+  };    
 
-	/**
-	 * Function that returns <tt>a == b</tt>.
-	 */
-	public static final DoubleDoubleProcedure isEqual = new DoubleDoubleProcedure() {
-		public final boolean apply(double a, double b) { return a == b; }
-	};		
+  /**
+   * Function that returns <tt>a == b</tt>.
+   */
+  public static final DoubleDoubleProcedure isEqual = new DoubleDoubleProcedure() {
+    public final boolean apply(double a, double b) { return a == b; }
+  };    
 
-	/**
-	 * Function that returns <tt>a < b</tt>.
-	 */
-	public static final DoubleDoubleProcedure isLess = new DoubleDoubleProcedure() {
-		public final boolean apply(double a, double b) { return a < b; }
-	};		
+  /**
+   * Function that returns <tt>a < b</tt>.
+   */
+  public static final DoubleDoubleProcedure isLess = new DoubleDoubleProcedure() {
+    public final boolean apply(double a, double b) { return a < b; }
+  };    
 
-	/**
-	 * Function that returns <tt>a > b</tt>.
-	 */
-	public static final DoubleDoubleProcedure isGreater = new DoubleDoubleProcedure() {
-		public final boolean apply(double a, double b) { return a > b; }
-	};		
+  /**
+   * Function that returns <tt>a > b</tt>.
+   */
+  public static final DoubleDoubleProcedure isGreater = new DoubleDoubleProcedure() {
+    public final boolean apply(double a, double b) { return a > b; }
+  };    
 
-	/**
-	 * Function that returns <tt>a < b ? 1 : 0</tt>.
-	 */
-	public static final DoubleDoubleFunction less = new DoubleDoubleFunction() {
-		public final double apply(double a, double b) { return a < b ? 1 : 0; }
-	};
-		
-	/**
-	 * Function that returns <tt>Math.log(a) / Math.log(b)</tt>.
-	 */
-	public static final DoubleDoubleFunction lg = new DoubleDoubleFunction() {
-		public final double apply(double a, double b) { return Math.log(a) / Math.log(b); }
-	};		
+  /**
+   * Function that returns <tt>a < b ? 1 : 0</tt>.
+   */
+  public static final DoubleDoubleFunction less = new DoubleDoubleFunction() {
+    public final double apply(double a, double b) { return a < b ? 1 : 0; }
+  };
+    
+  /**
+   * Function that returns <tt>Math.log(a) / Math.log(b)</tt>.
+   */
+  public static final DoubleDoubleFunction lg = new DoubleDoubleFunction() {
+    public final double apply(double a, double b) { return Math.log(a) / Math.log(b); }
+  };    
 
-	/**
-	 * Function that returns <tt>Math.max(a,b)</tt>.
-	 */
-	public static final DoubleDoubleFunction max = new DoubleDoubleFunction() {
-		public final double apply(double a, double b) { return Math.max(a,b); }
-	};
-		
-	/**
-	 * Function that returns <tt>Math.min(a,b)</tt>.
-	 */
-	public static final DoubleDoubleFunction min = new DoubleDoubleFunction() {
-		public final double apply(double a, double b) { return Math.min(a,b); }
-	};
-		
-	/**
-	 * Function that returns <tt>a - b</tt>.
-	 */
-	public static final DoubleDoubleFunction minus = plusMult(-1);
-	/*
-	new DoubleDoubleFunction() {
-		public final double apply(double a, double b) { return a - b; }
-	};
-	*/
-		
-	/**
-	 * Function that returns <tt>a % b</tt>.
-	 */
-	public static final DoubleDoubleFunction mod = new DoubleDoubleFunction() {
-		public final double apply(double a, double b) { return a % b; }
-	};
-		
-	/**
-	 * Function that returns <tt>a * b</tt>.
-	 */
-	public static final DoubleDoubleFunction mult = new DoubleDoubleFunction() {
-		public final double apply(double a, double b) { return a * b; }
-	};
-		
-	/**
-	 * Function that returns <tt>a + b</tt>.
-	 */
-	public static final DoubleDoubleFunction plus = plusMult(1);
-	/*
-	new DoubleDoubleFunction() {
-		public final double apply(double a, double b) { return a + b; }
-	};
-	*/
-		
-	/**
-	 * Function that returns <tt>Math.abs(a) + Math.abs(b)</tt>.
-	 */
-	public static final DoubleDoubleFunction plusAbs = new DoubleDoubleFunction() {
-		public final double apply(double a, double b) { return Math.abs(a) + Math.abs(b); }
-	};
-	
-	/**
-	 * Function that returns <tt>Math.pow(a,b)</tt>.
-	 */
-	public static final DoubleDoubleFunction pow = new DoubleDoubleFunction() {
-		public final double apply(double a, double b) { return Math.pow(a,b); }
-	};
+  /**
+   * Function that returns <tt>Math.max(a,b)</tt>.
+   */
+  public static final DoubleDoubleFunction max = new DoubleDoubleFunction() {
+    public final double apply(double a, double b) { return Math.max(a,b); }
+  };
+    
+  /**
+   * Function that returns <tt>Math.min(a,b)</tt>.
+   */
+  public static final DoubleDoubleFunction min = new DoubleDoubleFunction() {
+    public final double apply(double a, double b) { return Math.min(a,b); }
+  };
+    
+  /**
+   * Function that returns <tt>a - b</tt>.
+   */
+  public static final DoubleDoubleFunction minus = plusMult(-1);
+  /*
+  new DoubleDoubleFunction() {
+    public final double apply(double a, double b) { return a - b; }
+  };
+  */
+    
+  /**
+   * Function that returns <tt>a % b</tt>.
+   */
+  public static final DoubleDoubleFunction mod = new DoubleDoubleFunction() {
+    public final double apply(double a, double b) { return a % b; }
+  };
+    
+  /**
+   * Function that returns <tt>a * b</tt>.
+   */
+  public static final DoubleDoubleFunction mult = new DoubleDoubleFunction() {
+    public final double apply(double a, double b) { return a * b; }
+  };
+    
+  /**
+   * Function that returns <tt>a + b</tt>.
+   */
+  public static final DoubleDoubleFunction plus = plusMult(1);
+  /*
+  new DoubleDoubleFunction() {
+    public final double apply(double a, double b) { return a + b; }
+  };
+  */
+    
+  /**
+   * Function that returns <tt>Math.abs(a) + Math.abs(b)</tt>.
+   */
+  public static final DoubleDoubleFunction plusAbs = new DoubleDoubleFunction() {
+    public final double apply(double a, double b) { return Math.abs(a) + Math.abs(b); }
+  };
+  
+  /**
+   * Function that returns <tt>Math.pow(a,b)</tt>.
+   */
+  public static final DoubleDoubleFunction pow = new DoubleDoubleFunction() {
+    public final double apply(double a, double b) { return Math.pow(a,b); }
+  };
 /**
  * Makes this class non instantiable, but still let's others inherit from it.
  */
@@ -593,9 +593,9 @@
  * <tt>a</tt> is a variable, <tt>from</tt> and <tt>to</tt> are fixed.
  */
 public static DoubleFunction between(final double from, final double to) {
-	return new DoubleFunction() {
-		public final double apply(double a) { return (from<=a && a<=to) ? 1 : 0; }
-	};
+  return new DoubleFunction() {
+    public final double apply(double a) { return (from<=a && a<=to) ? 1 : 0; }
+  };
 }
 /**
  * Constructs a unary function from a binary function with the first operand (argument) fixed to the given constant <tt>c</tt>.
@@ -605,9 +605,9 @@
  * @return the unary function <tt>function(c,var)</tt>.
  */
 public static DoubleFunction bindArg1(final DoubleDoubleFunction function, final double c) {
-	return new DoubleFunction() {
-		public final double apply(double var) { return function.apply(c,var); }
-	};
+  return new DoubleFunction() {
+    public final double apply(double var) { return function.apply(c,var); }
+  };
 }
 /**
  * Constructs a unary function from a binary function with the second operand (argument) fixed to the given constant <tt>c</tt>.
@@ -617,9 +617,9 @@
  * @return the unary function <tt>function(var,c)</tt>.
  */
 public static DoubleFunction bindArg2(final DoubleDoubleFunction function, final double c) {
-	return new DoubleFunction() {
-		public final double apply(double var) { return function.apply(var,c); }
-	};
+  return new DoubleFunction() {
+    public final double apply(double var) { return function.apply(var,c); }
+  };
 }
 /**
  * Constructs the function <tt>f( g(a), h(b) )</tt>.
@@ -630,9 +630,9 @@
  * @return the binary function <tt>f( g(a), h(b) )</tt>.
  */
 public static DoubleDoubleFunction chain(final DoubleDoubleFunction f, final DoubleFunction g, final DoubleFunction h) {
-	return new DoubleDoubleFunction() {
-		public final double apply(double a, double b) { return f.apply(g.apply(a), h.apply(b)); }
-	};
+  return new DoubleDoubleFunction() {
+    public final double apply(double a, double b) { return f.apply(g.apply(a), h.apply(b)); }
+  };
 }
 /**
  * Constructs the function <tt>g( h(a,b) )</tt>.
@@ -642,9 +642,9 @@
  * @return the unary function <tt>g( h(a,b) )</tt>.
  */
 public static DoubleDoubleFunction chain(final DoubleFunction g, final DoubleDoubleFunction h) {
-	return new DoubleDoubleFunction() {
-		public final double apply(double a, double b) { return g.apply(h.apply(a,b)); }
-	};
+  return new DoubleDoubleFunction() {
+    public final double apply(double a, double b) { return g.apply(h.apply(a,b)); }
+  };
 }
 /**
  * Constructs the function <tt>g( h(a) )</tt>.
@@ -654,299 +654,299 @@
  * @return the unary function <tt>g( h(a) )</tt>.
  */
 public static DoubleFunction chain(final DoubleFunction g, final DoubleFunction h) {
-	return new DoubleFunction() {
-		public final double apply(double a) { return g.apply(h.apply(a)); }
-	};
+  return new DoubleFunction() {
+    public final double apply(double a) { return g.apply(h.apply(a)); }
+  };
 }
 /**
  * Constructs a function that returns <tt>a < b ? -1 : a > b ? 1 : 0</tt>.
  * <tt>a</tt> is a variable, <tt>b</tt> is fixed.
  */
 public static DoubleFunction compare(final double b) {
-	return new DoubleFunction() {
-		public final double apply(double a) { return a < b ? -1 : a > b ? 1 : 0; }
-	};
+  return new DoubleFunction() {
+    public final double apply(double a) { return a < b ? -1 : a > b ? 1 : 0; }
+  };
 }
 /**
  * Constructs a function that returns the constant <tt>c</tt>.
  */
 public static DoubleFunction constant(final double c) {
-	return new DoubleFunction() {
-		public final double apply(double a) { return c; }
-	};
+  return new DoubleFunction() {
+    public final double apply(double a) { return c; }
+  };
 }
 /**
  * Demonstrates usage of this class.
  */
 public static void demo1() {
-	org.apache.mahout.jet.math.Functions F = org.apache.mahout.jet.math.Functions.functions;
-	double a = 0.5; 
-	double b = 0.2;
-	double v = Math.sin(a) + Math.pow(Math.cos(b),2);
-	System.out.println(v);
-	DoubleDoubleFunction f = F.chain(F.plus,F.sin,F.chain(F.square,F.cos));
-	//DoubleDoubleFunction f = F.chain(plus,sin,F.chain(square,cos));
-	System.out.println(f.apply(a,b));
-	DoubleDoubleFunction g = new DoubleDoubleFunction() {
-		public final double apply(double x, double y) { return Math.sin(x) + Math.pow(Math.cos(y),2); }
-	};
-	System.out.println(g.apply(a,b));
-	DoubleFunction m = F.plus(3);
-	DoubleFunction n = F.plus(4);
-	System.out.println(m.apply(0));
-	System.out.println(n.apply(0));
+  org.apache.mahout.jet.math.Functions F = org.apache.mahout.jet.math.Functions.functions;
+  double a = 0.5; 
+  double b = 0.2;
+  double v = Math.sin(a) + Math.pow(Math.cos(b),2);
+  System.out.println(v);
+  DoubleDoubleFunction f = F.chain(F.plus,F.sin,F.chain(F.square,F.cos));
+  //DoubleDoubleFunction f = F.chain(plus,sin,F.chain(square,cos));
+  System.out.println(f.apply(a,b));
+  DoubleDoubleFunction g = new DoubleDoubleFunction() {
+    public final double apply(double x, double y) { return Math.sin(x) + Math.pow(Math.cos(y),2); }
+  };
+  System.out.println(g.apply(a,b));
+  DoubleFunction m = F.plus(3);
+  DoubleFunction n = F.plus(4);
+  System.out.println(m.apply(0));
+  System.out.println(n.apply(0));
 }
 /**
  * Benchmarks and demonstrates usage of trivial and complex functions.
  */
 public static void demo2(int size) {
-	org.apache.mahout.jet.math.Functions F = org.apache.mahout.jet.math.Functions.functions;
-	System.out.println("\n\n");
-	double a = 0.0; 
-	double b = 0.0;
-	double v = Math.abs(Math.sin(a) + Math.pow(Math.cos(b),2));
-	//double v = Math.sin(a) + Math.pow(Math.cos(b),2);
-	//double v = a + b;
-	System.out.println(v);
-	
-	//DoubleDoubleFunction f = F.chain(F.plus,F.identity,F.identity);
-	DoubleDoubleFunction f = F.chain(F.abs,F.chain(F.plus,F.sin,F.chain(F.square,F.cos)));
-	//DoubleDoubleFunction f = F.chain(F.plus,F.sin,F.chain(F.square,F.cos));
-	//DoubleDoubleFunction f = F.plus;
-	
-	System.out.println(f.apply(a,b));
-	DoubleDoubleFunction g = new DoubleDoubleFunction() {
-		public final double apply(double x, double y) { return Math.abs(Math.sin(x) + Math.pow(Math.cos(y),2)); }
-		//public final double apply(double x, double y) { return x+y; }
-	};
-	System.out.println(g.apply(a,b));
+  org.apache.mahout.jet.math.Functions F = org.apache.mahout.jet.math.Functions.functions;
+  System.out.println("\n\n");
+  double a = 0.0; 
+  double b = 0.0;
+  double v = Math.abs(Math.sin(a) + Math.pow(Math.cos(b),2));
+  //double v = Math.sin(a) + Math.pow(Math.cos(b),2);
+  //double v = a + b;
+  System.out.println(v);
+  
+  //DoubleDoubleFunction f = F.chain(F.plus,F.identity,F.identity);
+  DoubleDoubleFunction f = F.chain(F.abs,F.chain(F.plus,F.sin,F.chain(F.square,F.cos)));
+  //DoubleDoubleFunction f = F.chain(F.plus,F.sin,F.chain(F.square,F.cos));
+  //DoubleDoubleFunction f = F.plus;
+  
+  System.out.println(f.apply(a,b));
+  DoubleDoubleFunction g = new DoubleDoubleFunction() {
+    public final double apply(double x, double y) { return Math.abs(Math.sin(x) + Math.pow(Math.cos(y),2)); }
+    //public final double apply(double x, double y) { return x+y; }
+  };
+  System.out.println(g.apply(a,b));
 
-	// emptyLoop
-	org.apache.mahout.matrix.Timer emptyLoop = new org.apache.mahout.matrix.Timer().start();
-	a = 0; b = 0;
-	double sum = 0;
-	for (int i=size; --i >= 0; ) {
-		sum += a;
-		a++;
-		b++;
-	}
-	emptyLoop.stop().display();
-	System.out.println("empty sum="+sum);
-	
-	org.apache.mahout.matrix.Timer timer = new org.apache.mahout.matrix.Timer().start();
-	a = 0; b = 0;
-	sum = 0;
-	for (int i=size; --i >= 0; ) {
-		sum += Math.abs(Math.sin(a) + Math.pow(Math.cos(b),2));
-		//sum += a + b;
-		a++; b++;
-	}
-	timer.stop().display();
-	System.out.println("evals / sec = "+size / timer.minus(emptyLoop).seconds());
-	System.out.println("sum="+sum);
+  // emptyLoop
+  org.apache.mahout.matrix.Timer emptyLoop = new org.apache.mahout.matrix.Timer().start();
+  a = 0; b = 0;
+  double sum = 0;
+  for (int i=size; --i >= 0; ) {
+    sum += a;
+    a++;
+    b++;
+  }
+  emptyLoop.stop().display();
+  System.out.println("empty sum="+sum);
+  
+  org.apache.mahout.matrix.Timer timer = new org.apache.mahout.matrix.Timer().start();
+  a = 0; b = 0;
+  sum = 0;
+  for (int i=size; --i >= 0; ) {
+    sum += Math.abs(Math.sin(a) + Math.pow(Math.cos(b),2));
+    //sum += a + b;
+    a++; b++;
+  }
+  timer.stop().display();
+  System.out.println("evals / sec = "+size / timer.minus(emptyLoop).seconds());
+  System.out.println("sum="+sum);
 
-	timer.reset().start();
-	a = 0; b = 0;
-	sum = 0;
-	for (int i=size; --i >= 0; ) {
-		sum += f.apply(a,b);
-		a++; b++;
-	}
-	timer.stop().display();
-	System.out.println("evals / sec = "+size / timer.minus(emptyLoop).seconds());
-	System.out.println("sum="+sum);
-		
-	timer.reset().start();
-	a = 0; b = 0;
-	sum = 0;
-	for (int i=size; --i >= 0; ) {
-		sum += g.apply(a,b);
-		a++; b++;
-	}
-	timer.stop().display();
-	System.out.println("evals / sec = "+size / timer.minus(emptyLoop).seconds());
-	System.out.println("sum="+sum);
-		
+  timer.reset().start();
+  a = 0; b = 0;
+  sum = 0;
+  for (int i=size; --i >= 0; ) {
+    sum += f.apply(a,b);
+    a++; b++;
+  }
+  timer.stop().display();
+  System.out.println("evals / sec = "+size / timer.minus(emptyLoop).seconds());
+  System.out.println("sum="+sum);
+    
+  timer.reset().start();
+  a = 0; b = 0;
+  sum = 0;
+  for (int i=size; --i >= 0; ) {
+    sum += g.apply(a,b);
+    a++; b++;
+  }
+  timer.stop().display();
+  System.out.println("evals / sec = "+size / timer.minus(emptyLoop).seconds());
+  System.out.println("sum="+sum);
+    
 }
 /**
  * Constructs a function that returns <tt>a / b</tt>.
  * <tt>a</tt> is a variable, <tt>b</tt> is fixed.
  */
 public static DoubleFunction div(final double b) {
-	return mult(1 / b);
+  return mult(1 / b);
 }
 /**
  * Constructs a function that returns <tt>a == b ? 1 : 0</tt>.
  * <tt>a</tt> is a variable, <tt>b</tt> is fixed.
  */
 public static DoubleFunction equals(final double b) {
-	return new DoubleFunction() {
-		public final double apply(double a) { return a == b ? 1 : 0; }
-	};
+  return new DoubleFunction() {
+    public final double apply(double a) { return a == b ? 1 : 0; }
+  };
 }
 /**
  * Constructs a function that returns <tt>a > b ? 1 : 0</tt>.
  * <tt>a</tt> is a variable, <tt>b</tt> is fixed.
  */
 public static DoubleFunction greater(final double b) {
-	return new DoubleFunction() {
-		public final double apply(double a) { return a > b ? 1 : 0; }
-	};
+  return new DoubleFunction() {
+    public final double apply(double a) { return a > b ? 1 : 0; }
+  };
 }
 /**
  * Constructs a function that returns <tt>Math.IEEEremainder(a,b)</tt>.
  * <tt>a</tt> is a variable, <tt>b</tt> is fixed.
  */
 public static DoubleFunction IEEEremainder(final double b) {
-	return new DoubleFunction() {
-		public final double apply(double a) { return Math.IEEEremainder(a,b); }
-	};
+  return new DoubleFunction() {
+    public final double apply(double a) { return Math.IEEEremainder(a,b); }
+  };
 }
 /**
  * Constructs a function that returns <tt>from<=a && a<=to</tt>.
  * <tt>a</tt> is a variable, <tt>from</tt> and <tt>to</tt> are fixed.
  */
 public static DoubleProcedure isBetween(final double from, final double to) {
-	return new DoubleProcedure() {
-		public final boolean apply(double a) { return from<=a && a<=to; }
-	};
+  return new DoubleProcedure() {
+    public final boolean apply(double a) { return from<=a && a<=to; }
+  };
 }
 /**
  * Constructs a function that returns <tt>a == b</tt>.
  * <tt>a</tt> is a variable, <tt>b</tt> is fixed.
  */
 public static DoubleProcedure isEqual(final double b) {
-	return new DoubleProcedure() {
-		public final boolean apply(double a) { return a==b; }
-	};
+  return new DoubleProcedure() {
+    public final boolean apply(double a) { return a==b; }
+  };
 }
 /**
  * Constructs a function that returns <tt>a > b</tt>.
  * <tt>a</tt> is a variable, <tt>b</tt> is fixed.
  */
 public static DoubleProcedure isGreater(final double b) {
-	return new DoubleProcedure() {
-		public final boolean apply(double a) { return a > b; }
-	};
+  return new DoubleProcedure() {
+    public final boolean apply(double a) { return a > b; }
+  };
 }
 /**
  * Constructs a function that returns <tt>a < b</tt>.
  * <tt>a</tt> is a variable, <tt>b</tt> is fixed.
  */
 public static DoubleProcedure isLess(final double b) {
-	return new DoubleProcedure() {
-		public final boolean apply(double a) { return a < b; }
-	};
+  return new DoubleProcedure() {
+    public final boolean apply(double a) { return a < b; }
+  };
 }
 /**
  * Constructs a function that returns <tt>a < b ? 1 : 0</tt>.
  * <tt>a</tt> is a variable, <tt>b</tt> is fixed.
  */
 public static DoubleFunction less(final double b) {
-	return new DoubleFunction() {
-		public final double apply(double a) { return a < b ? 1 : 0; }
-	};
+  return new DoubleFunction() {
+    public final double apply(double a) { return a < b ? 1 : 0; }
+  };
 }
 /**
  * Constructs a function that returns <tt><tt>Math.log(a) / Math.log(b)</tt></tt>.
  * <tt>a</tt> is a variable, <tt>b</tt> is fixed.
  */
 public static DoubleFunction lg(final double b) {
-	return new DoubleFunction() {
-		private final double logInv = 1 / Math.log(b); // cached for speed
-		public final double apply(double a) { return Math.log(a) * logInv; }
-	};
+  return new DoubleFunction() {
+    private final double logInv = 1 / Math.log(b); // cached for speed
+    public final double apply(double a) { return Math.log(a) * logInv; }
+  };
 }
 /**
  * Tests various methods of this class.
  */
 protected static void main(String args[]) {
-	int size = Integer.parseInt(args[0]);
-	demo2(size);
-	//demo1();
+  int size = Integer.parseInt(args[0]);
+  demo2(size);
+  //demo1();
 }
 /**
  * Constructs a function that returns <tt>Math.max(a,b)</tt>.
  * <tt>a</tt> is a variable, <tt>b</tt> is fixed.
  */
 public static DoubleFunction max(final double b) {
-	return new DoubleFunction() {
-		public final double apply(double a) { return Math.max(a,b); }
-	};
+  return new DoubleFunction() {
+    public final double apply(double a) { return Math.max(a,b); }
+  };
 }
 /**
  * Constructs a function that returns <tt>Math.min(a,b)</tt>.
  * <tt>a</tt> is a variable, <tt>b</tt> is fixed.
  */
 public static DoubleFunction min(final double b) {
-	return new DoubleFunction() {
-		public final double apply(double a) { return Math.min(a,b); }
-	};
+  return new DoubleFunction() {
+    public final double apply(double a) { return Math.min(a,b); }
+  };
 }
 /**
  * Constructs a function that returns <tt>a - b</tt>.
  * <tt>a</tt> is a variable, <tt>b</tt> is fixed.
  */
 public static DoubleFunction minus(final double b) {
-	return plus(-b);
+  return plus(-b);
 }
 /**
  * Constructs a function that returns <tt>a - b*constant</tt>.
  * <tt>a</tt> and <tt>b</tt> are variables, <tt>constant</tt> is fixed.
  */
 public static DoubleDoubleFunction minusMult(final double constant) {
-	return plusMult(-constant);
+  return plusMult(-constant);
 }
 /**
  * Constructs a function that returns <tt>a % b</tt>.
  * <tt>a</tt> is a variable, <tt>b</tt> is fixed.
  */
 public static DoubleFunction mod(final double b) {
-	return new DoubleFunction() {
-		public final double apply(double a) { return a % b; }
-	};
+  return new DoubleFunction() {
+    public final double apply(double a) { return a % b; }
+  };
 }
 /**
  * Constructs a function that returns <tt>a * b</tt>.
  * <tt>a</tt> is a variable, <tt>b</tt> is fixed.
  */
 public static DoubleFunction mult(final double b) {
-	return new Mult(b);
-	/*
-	return new DoubleFunction() {
-		public final double apply(double a) { return a * b; }
-	};
-	*/
+  return new Mult(b);
+  /*
+  return new DoubleFunction() {
+    public final double apply(double a) { return a * b; }
+  };
+  */
 }
 /**
  * Constructs a function that returns <tt>a + b</tt>.
  * <tt>a</tt> is a variable, <tt>b</tt> is fixed.
  */
 public static DoubleFunction plus(final double b) {
-	return new DoubleFunction() {
-		public final double apply(double a) { return a + b; }
-	};
+  return new DoubleFunction() {
+    public final double apply(double a) { return a + b; }
+  };
 }
 /**
  * Constructs a function that returns <tt>a + b*constant</tt>.
  * <tt>a</tt> and <tt>b</tt> are variables, <tt>constant</tt> is fixed.
  */
 public static DoubleDoubleFunction plusMult(double constant) {
-	return new PlusMult(constant); 
-	/*
-	return new DoubleDoubleFunction() {
-		public final double apply(double a, double b) { return a + b*constant; }
-	};
-	*/
+  return new PlusMult(constant); 
+  /*
+  return new DoubleDoubleFunction() {
+    public final double apply(double a, double b) { return a + b*constant; }
+  };
+  */
 }
 /**
  * Constructs a function that returns <tt>Math.pow(a,b)</tt>.
  * <tt>a</tt> is a variable, <tt>b</tt> is fixed.
  */
 public static DoubleFunction pow(final double b) {
-	return new DoubleFunction() {
-		public final double apply(double a) { return Math.pow(a,b); }
-	};
+  return new DoubleFunction() {
+    public final double apply(double a) { return Math.pow(a,b); }
+  };
 }
 /**
  * Constructs a function that returns a new uniform random number in the open unit interval <code>(0.0,1.0)</code> (excluding 0.0 and 1.0).
@@ -957,7 +957,7 @@
  * Thus, if you are not happy with the default, just pass your favourite random generator to function evaluating methods.
  */
 public static DoubleFunction random() {
-	return new org.apache.mahout.jet.random.engine.MersenneTwister(new java.util.Date());
+  return new org.apache.mahout.jet.random.engine.MersenneTwister(new java.util.Date());
 }
 /**
  * Constructs a function that returns the number rounded to the given precision; <tt>Math.rint(a/precision)*precision</tt>.
@@ -968,9 +968,9 @@
  * </pre>
  */
 public static DoubleFunction round(final double precision) {
-	return new DoubleFunction() {
-		public final double apply(double a) { return Math.rint(a/precision)*precision; }
-	};
+  return new DoubleFunction() {
+    public final double apply(double a) { return Math.rint(a/precision)*precision; }
+  };
 }
 /**
  * Constructs a function that returns <tt>function.apply(b,a)</tt>, i.e. applies the function with the first operand as second operand and the second operand as first operand.
@@ -979,8 +979,8 @@
  * @return the binary function <tt>function(b,a)</tt>.
  */
 public static DoubleDoubleFunction swapArgs(final DoubleDoubleFunction function) {
-	return new DoubleDoubleFunction() {
-		public final double apply(double a, double b) { return function.apply(b,a); }
-	};
+  return new DoubleDoubleFunction() {
+    public final double apply(double a, double b) { return function.apply(b,a); }
+  };
 }
 }
Index: matrix/src/main/java/org/apache/mahout/jet/math/Constants.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/jet/math/Constants.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/jet/math/Constants.java	(working copy)
@@ -19,19 +19,19 @@
   /*
    * machine constants
    */
-	protected static final double MACHEP =  1.11022302462515654042E-16;
-	protected static final double MAXLOG =  7.09782712893383996732E2;
-	protected static final double MINLOG = -7.451332191019412076235E2;
-	protected static final double MAXGAM = 171.624376956302725;
-	protected static final double SQTPI  =  2.50662827463100050242E0;
-	protected static final double SQRTH  =  7.07106781186547524401E-1;
-	protected static final double LOGPI  =  1.14472988584940017414;
+  protected static final double MACHEP =  1.11022302462515654042E-16;
+  protected static final double MAXLOG =  7.09782712893383996732E2;
+  protected static final double MINLOG = -7.451332191019412076235E2;
+  protected static final double MAXGAM = 171.624376956302725;
+  protected static final double SQTPI  =  2.50662827463100050242E0;
+  protected static final double SQRTH  =  7.07106781186547524401E-1;
+  protected static final double LOGPI  =  1.14472988584940017414;
 
-	protected static final double big = 4.503599627370496e15;
-	protected static final double biginv =  2.22044604925031308085e-16;
+  protected static final double big = 4.503599627370496e15;
+  protected static final double biginv =  2.22044604925031308085e-16;
 
 
-	/*
+  /*
  * MACHEP =  1.38777878078144567553E-17       2**-56
  * MAXLOG =  8.8029691931113054295988E1       log(2**127)
  * MINLOG = -8.872283911167299960540E1        log(2**-128)
Index: matrix/src/main/java/org/apache/mahout/jet/math/Bessel.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/jet/math/Bessel.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/jet/math/Bessel.java	(working copy)
@@ -16,277 +16,277 @@
  */
 @Deprecated
 public class Bessel extends Constants {
-	/****************************************
-	 *    COEFFICIENTS FOR METHODS i0, i0e  *
-	 ****************************************/
-	 
-	/**
-	 * Chebyshev coefficients for exp(-x) I0(x)
-	 * in the interval [0,8].
-	 *
-	 * lim(x->0){ exp(-x) I0(x) } = 1.
-	 */
-	protected static final double[] A_i0 = {
-		-4.41534164647933937950E-18,
-		 3.33079451882223809783E-17,
-		-2.43127984654795469359E-16,
-		 1.71539128555513303061E-15,
-		-1.16853328779934516808E-14,
-		 7.67618549860493561688E-14,
-		-4.85644678311192946090E-13,
-		 2.95505266312963983461E-12,
-		-1.72682629144155570723E-11,
-		 9.67580903537323691224E-11,
-		-5.18979560163526290666E-10,
-		 2.65982372468238665035E-9,
-		-1.30002500998624804212E-8,
-		 6.04699502254191894932E-8,
-		-2.67079385394061173391E-7,
-		 1.11738753912010371815E-6,
-		-4.41673835845875056359E-6,
-		 1.64484480707288970893E-5,
-		-5.75419501008210370398E-5,
-		 1.88502885095841655729E-4,
-		-5.76375574538582365885E-4,
-		 1.63947561694133579842E-3,
-		-4.32430999505057594430E-3,
-		 1.05464603945949983183E-2,
-		-2.37374148058994688156E-2,
-		 4.93052842396707084878E-2,
-		-9.49010970480476444210E-2,
-		 1.71620901522208775349E-1,
-		-3.04682672343198398683E-1,
-		 6.76795274409476084995E-1
-		};
+  /****************************************
+   *    COEFFICIENTS FOR METHODS i0, i0e  *
+   ****************************************/
+   
+  /**
+   * Chebyshev coefficients for exp(-x) I0(x)
+   * in the interval [0,8].
+   *
+   * lim(x->0){ exp(-x) I0(x) } = 1.
+   */
+  protected static final double[] A_i0 = {
+    -4.41534164647933937950E-18,
+     3.33079451882223809783E-17,
+    -2.43127984654795469359E-16,
+     1.71539128555513303061E-15,
+    -1.16853328779934516808E-14,
+     7.67618549860493561688E-14,
+    -4.85644678311192946090E-13,
+     2.95505266312963983461E-12,
+    -1.72682629144155570723E-11,
+     9.67580903537323691224E-11,
+    -5.18979560163526290666E-10,
+     2.65982372468238665035E-9,
+    -1.30002500998624804212E-8,
+     6.04699502254191894932E-8,
+    -2.67079385394061173391E-7,
+     1.11738753912010371815E-6,
+    -4.41673835845875056359E-6,
+     1.64484480707288970893E-5,
+    -5.75419501008210370398E-5,
+     1.88502885095841655729E-4,
+    -5.76375574538582365885E-4,
+     1.63947561694133579842E-3,
+    -4.32430999505057594430E-3,
+     1.05464603945949983183E-2,
+    -2.37374148058994688156E-2,
+     4.93052842396707084878E-2,
+    -9.49010970480476444210E-2,
+     1.71620901522208775349E-1,
+    -3.04682672343198398683E-1,
+     6.76795274409476084995E-1
+    };
 
 
 
-	/**
-	 * Chebyshev coefficients for exp(-x) sqrt(x) I0(x)
-	 * in the inverted interval [8,infinity].
-	 *
-	 * lim(x->inf){ exp(-x) sqrt(x) I0(x) } = 1/sqrt(2pi).
-	 */
-	protected static final double[] B_i0 = {
-		-7.23318048787475395456E-18,
-		-4.83050448594418207126E-18,
-		 4.46562142029675999901E-17,
-		 3.46122286769746109310E-17,
-		-2.82762398051658348494E-16,
-		-3.42548561967721913462E-16,
-		 1.77256013305652638360E-15,
-		 3.81168066935262242075E-15,
-		-9.55484669882830764870E-15,
-		-4.15056934728722208663E-14,
-		 1.54008621752140982691E-14,
-		 3.85277838274214270114E-13,
-		 7.18012445138366623367E-13,
-		-1.79417853150680611778E-12,
-		-1.32158118404477131188E-11,
-		-3.14991652796324136454E-11,
-		 1.18891471078464383424E-11,
-		 4.94060238822496958910E-10,
-		 3.39623202570838634515E-9,
-		 2.26666899049817806459E-8,
-		 2.04891858946906374183E-7,
-		 2.89137052083475648297E-6,
-		 6.88975834691682398426E-5,
-		 3.36911647825569408990E-3,
-		 8.04490411014108831608E-1
-		};
+  /**
+   * Chebyshev coefficients for exp(-x) sqrt(x) I0(x)
+   * in the inverted interval [8,infinity].
+   *
+   * lim(x->inf){ exp(-x) sqrt(x) I0(x) } = 1/sqrt(2pi).
+   */
+  protected static final double[] B_i0 = {
+    -7.23318048787475395456E-18,
+    -4.83050448594418207126E-18,
+     4.46562142029675999901E-17,
+     3.46122286769746109310E-17,
+    -2.82762398051658348494E-16,
+    -3.42548561967721913462E-16,
+     1.77256013305652638360E-15,
+     3.81168066935262242075E-15,
+    -9.55484669882830764870E-15,
+    -4.15056934728722208663E-14,
+     1.54008621752140982691E-14,
+     3.85277838274214270114E-13,
+     7.18012445138366623367E-13,
+    -1.79417853150680611778E-12,
+    -1.32158118404477131188E-11,
+    -3.14991652796324136454E-11,
+     1.18891471078464383424E-11,
+     4.94060238822496958910E-10,
+     3.39623202570838634515E-9,
+     2.26666899049817806459E-8,
+     2.04891858946906374183E-7,
+     2.89137052083475648297E-6,
+     6.88975834691682398426E-5,
+     3.36911647825569408990E-3,
+     8.04490411014108831608E-1
+    };
 
 
-	
-	/****************************************
-	 *    COEFFICIENTS FOR METHODS i1, i1e  *
-	 ****************************************/
-	/**
-	 * Chebyshev coefficients for exp(-x) I1(x) / x
-	 * in the interval [0,8].
-	 *
-	 * lim(x->0){ exp(-x) I1(x) / x } = 1/2.
-	 */
-	protected static final double[] A_i1 = {
-		 2.77791411276104639959E-18,
-		-2.11142121435816608115E-17,
-		 1.55363195773620046921E-16,
-		-1.10559694773538630805E-15,
-		 7.60068429473540693410E-15,
-		-5.04218550472791168711E-14,
-		 3.22379336594557470981E-13,
-		-1.98397439776494371520E-12,
-		 1.17361862988909016308E-11,
-		-6.66348972350202774223E-11,
-		 3.62559028155211703701E-10,
-		-1.88724975172282928790E-9,
-		 9.38153738649577178388E-9,
-		-4.44505912879632808065E-8,
-		 2.00329475355213526229E-7,
-		-8.56872026469545474066E-7,
-		 3.47025130813767847674E-6,
-		-1.32731636560394358279E-5,
-		 4.78156510755005422638E-5,
-		-1.61760815825896745588E-4,
-		 5.12285956168575772895E-4,
-		-1.51357245063125314899E-3,
-		 4.15642294431288815669E-3,
-		-1.05640848946261981558E-2,
-		 2.47264490306265168283E-2,
-		-5.29459812080949914269E-2,
-		 1.02643658689847095384E-1,
-		-1.76416518357834055153E-1,
-		 2.52587186443633654823E-1
-		};
+  
+  /****************************************
+   *    COEFFICIENTS FOR METHODS i1, i1e  *
+   ****************************************/
+  /**
+   * Chebyshev coefficients for exp(-x) I1(x) / x
+   * in the interval [0,8].
+   *
+   * lim(x->0){ exp(-x) I1(x) / x } = 1/2.
+   */
+  protected static final double[] A_i1 = {
+     2.77791411276104639959E-18,
+    -2.11142121435816608115E-17,
+     1.55363195773620046921E-16,
+    -1.10559694773538630805E-15,
+     7.60068429473540693410E-15,
+    -5.04218550472791168711E-14,
+     3.22379336594557470981E-13,
+    -1.98397439776494371520E-12,
+     1.17361862988909016308E-11,
+    -6.66348972350202774223E-11,
+     3.62559028155211703701E-10,
+    -1.88724975172282928790E-9,
+     9.38153738649577178388E-9,
+    -4.44505912879632808065E-8,
+     2.00329475355213526229E-7,
+    -8.56872026469545474066E-7,
+     3.47025130813767847674E-6,
+    -1.32731636560394358279E-5,
+     4.78156510755005422638E-5,
+    -1.61760815825896745588E-4,
+     5.12285956168575772895E-4,
+    -1.51357245063125314899E-3,
+     4.15642294431288815669E-3,
+    -1.05640848946261981558E-2,
+     2.47264490306265168283E-2,
+    -5.29459812080949914269E-2,
+     1.02643658689847095384E-1,
+    -1.76416518357834055153E-1,
+     2.52587186443633654823E-1
+    };
 
-	/*
-	 * Chebyshev coefficients for exp(-x) sqrt(x) I1(x)
-	 * in the inverted interval [8,infinity].
-	 *
-	 * lim(x->inf){ exp(-x) sqrt(x) I1(x) } = 1/sqrt(2pi).
-	 */
-	protected static final double[] B_i1 = {
-		 7.51729631084210481353E-18,
-		 4.41434832307170791151E-18,
-		-4.65030536848935832153E-17,
-		-3.20952592199342395980E-17,
-		 2.96262899764595013876E-16,
-		 3.30820231092092828324E-16,
-		-1.88035477551078244854E-15,
-		-3.81440307243700780478E-15,
-		 1.04202769841288027642E-14,
-		 4.27244001671195135429E-14,
-		-2.10154184277266431302E-14,
-		-4.08355111109219731823E-13,
-		-7.19855177624590851209E-13,
-		 2.03562854414708950722E-12,
-		 1.41258074366137813316E-11,
-		 3.25260358301548823856E-11,
-		-1.89749581235054123450E-11,
-		-5.58974346219658380687E-10,
-		-3.83538038596423702205E-9,
-		-2.63146884688951950684E-8,
-		-2.51223623787020892529E-7,
-		-3.88256480887769039346E-6,
-		-1.10588938762623716291E-4,
-		-9.76109749136146840777E-3,
-		 7.78576235018280120474E-1
-		};
+  /*
+   * Chebyshev coefficients for exp(-x) sqrt(x) I1(x)
+   * in the inverted interval [8,infinity].
+   *
+   * lim(x->inf){ exp(-x) sqrt(x) I1(x) } = 1/sqrt(2pi).
+   */
+  protected static final double[] B_i1 = {
+     7.51729631084210481353E-18,
+     4.41434832307170791151E-18,
+    -4.65030536848935832153E-17,
+    -3.20952592199342395980E-17,
+     2.96262899764595013876E-16,
+     3.30820231092092828324E-16,
+    -1.88035477551078244854E-15,
+    -3.81440307243700780478E-15,
+     1.04202769841288027642E-14,
+     4.27244001671195135429E-14,
+    -2.10154184277266431302E-14,
+    -4.08355111109219731823E-13,
+    -7.19855177624590851209E-13,
+     2.03562854414708950722E-12,
+     1.41258074366137813316E-11,
+     3.25260358301548823856E-11,
+    -1.89749581235054123450E-11,
+    -5.58974346219658380687E-10,
+    -3.83538038596423702205E-9,
+    -2.63146884688951950684E-8,
+    -2.51223623787020892529E-7,
+    -3.88256480887769039346E-6,
+    -1.10588938762623716291E-4,
+    -9.76109749136146840777E-3,
+     7.78576235018280120474E-1
+    };
 
 
-	
+  
 
-	/****************************************
-	 *    COEFFICIENTS FOR METHODS k0, k0e  *
-	 ****************************************/
-	/* Chebyshev coefficients for K0(x) + log(x/2) I0(x)
-	 * in the interval [0,2].  The odd order coefficients are all
-	 * zero; only the even order coefficients are listed.
-	 * 
-	 * lim(x->0){ K0(x) + log(x/2) I0(x) } = -EUL.
-	 */
-	protected static final double[] A_k0 = {
-		 1.37446543561352307156E-16,
-		 4.25981614279661018399E-14,
-		 1.03496952576338420167E-11,
-		 1.90451637722020886025E-9,
-		 2.53479107902614945675E-7,
-		 2.28621210311945178607E-5,
-		 1.26461541144692592338E-3,
-		 3.59799365153615016266E-2,
-		 3.44289899924628486886E-1,
-		-5.35327393233902768720E-1
-		};
+  /****************************************
+   *    COEFFICIENTS FOR METHODS k0, k0e  *
+   ****************************************/
+  /* Chebyshev coefficients for K0(x) + log(x/2) I0(x)
+   * in the interval [0,2].  The odd order coefficients are all
+   * zero; only the even order coefficients are listed.
+   * 
+   * lim(x->0){ K0(x) + log(x/2) I0(x) } = -EUL.
+   */
+  protected static final double[] A_k0 = {
+     1.37446543561352307156E-16,
+     4.25981614279661018399E-14,
+     1.03496952576338420167E-11,
+     1.90451637722020886025E-9,
+     2.53479107902614945675E-7,
+     2.28621210311945178607E-5,
+     1.26461541144692592338E-3,
+     3.59799365153615016266E-2,
+     3.44289899924628486886E-1,
+    -5.35327393233902768720E-1
+    };
 
-	/* Chebyshev coefficients for exp(x) sqrt(x) K0(x)
-	 * in the inverted interval [2,infinity].
-	 * 
-	 * lim(x->inf){ exp(x) sqrt(x) K0(x) } = sqrt(pi/2).
-	 */
-	protected static final double[] B_k0 = {
-		 5.30043377268626276149E-18,
-		-1.64758043015242134646E-17,
-		 5.21039150503902756861E-17,
-		-1.67823109680541210385E-16,
-		 5.51205597852431940784E-16,
-		-1.84859337734377901440E-15,
-		 6.34007647740507060557E-15,
-		-2.22751332699166985548E-14,
-		 8.03289077536357521100E-14,
-		-2.98009692317273043925E-13,
-		 1.14034058820847496303E-12,
-		-4.51459788337394416547E-12,
-		 1.85594911495471785253E-11,
-		-7.95748924447710747776E-11,
-		 3.57739728140030116597E-10,
-		-1.69753450938905987466E-9,
-		 8.57403401741422608519E-9,
-		-4.66048989768794782956E-8,
-		 2.76681363944501510342E-7,
-		-1.83175552271911948767E-6,
-		 1.39498137188764993662E-5,
-		-1.28495495816278026384E-4,
-		 1.56988388573005337491E-3,
-		-3.14481013119645005427E-2,
-		 2.44030308206595545468E0
-		};
+  /* Chebyshev coefficients for exp(x) sqrt(x) K0(x)
+   * in the inverted interval [2,infinity].
+   * 
+   * lim(x->inf){ exp(x) sqrt(x) K0(x) } = sqrt(pi/2).
+   */
+  protected static final double[] B_k0 = {
+     5.30043377268626276149E-18,
+    -1.64758043015242134646E-17,
+     5.21039150503902756861E-17,
+    -1.67823109680541210385E-16,
+     5.51205597852431940784E-16,
+    -1.84859337734377901440E-15,
+     6.34007647740507060557E-15,
+    -2.22751332699166985548E-14,
+     8.03289077536357521100E-14,
+    -2.98009692317273043925E-13,
+     1.14034058820847496303E-12,
+    -4.51459788337394416547E-12,
+     1.85594911495471785253E-11,
+    -7.95748924447710747776E-11,
+     3.57739728140030116597E-10,
+    -1.69753450938905987466E-9,
+     8.57403401741422608519E-9,
+    -4.66048989768794782956E-8,
+     2.76681363944501510342E-7,
+    -1.83175552271911948767E-6,
+     1.39498137188764993662E-5,
+    -1.28495495816278026384E-4,
+     1.56988388573005337491E-3,
+    -3.14481013119645005427E-2,
+     2.44030308206595545468E0
+    };
 
 
-	
-	
-	/****************************************
-	 *    COEFFICIENTS FOR METHODS k1, k1e  *
-	 ****************************************/
-	/* Chebyshev coefficients for x(K1(x) - log(x/2) I1(x))
-	 * in the interval [0,2].
-	 * 
-	 * lim(x->0){ x(K1(x) - log(x/2) I1(x)) } = 1.
-	 */
-	protected static final double[] A_k1 = {
-		-7.02386347938628759343E-18,
-		-2.42744985051936593393E-15,
-		-6.66690169419932900609E-13,
-		-1.41148839263352776110E-10,
-		-2.21338763073472585583E-8,
-		-2.43340614156596823496E-6,
-		-1.73028895751305206302E-4,
-		-6.97572385963986435018E-3,
-		-1.22611180822657148235E-1,
-		-3.53155960776544875667E-1,
-		 1.52530022733894777053E0
-		};
+  
+  
+  /****************************************
+   *    COEFFICIENTS FOR METHODS k1, k1e  *
+   ****************************************/
+  /* Chebyshev coefficients for x(K1(x) - log(x/2) I1(x))
+   * in the interval [0,2].
+   * 
+   * lim(x->0){ x(K1(x) - log(x/2) I1(x)) } = 1.
+   */
+  protected static final double[] A_k1 = {
+    -7.02386347938628759343E-18,
+    -2.42744985051936593393E-15,
+    -6.66690169419932900609E-13,
+    -1.41148839263352776110E-10,
+    -2.21338763073472585583E-8,
+    -2.43340614156596823496E-6,
+    -1.73028895751305206302E-4,
+    -6.97572385963986435018E-3,
+    -1.22611180822657148235E-1,
+    -3.53155960776544875667E-1,
+     1.52530022733894777053E0
+    };
 
-	/* Chebyshev coefficients for exp(x) sqrt(x) K1(x)
-	 * in the interval [2,infinity].
-	 *
-	 * lim(x->inf){ exp(x) sqrt(x) K1(x) } = sqrt(pi/2).
-	 */
-	protected static final double[] B_k1 = {
-		-5.75674448366501715755E-18,
-		 1.79405087314755922667E-17,
-		-5.68946255844285935196E-17,
-		 1.83809354436663880070E-16,
-		-6.05704724837331885336E-16,
-		 2.03870316562433424052E-15,
-		-7.01983709041831346144E-15,
-		 2.47715442448130437068E-14,
-		-8.97670518232499435011E-14,
-		 3.34841966607842919884E-13,
-		-1.28917396095102890680E-12,
-		 5.13963967348173025100E-12,
-		-2.12996783842756842877E-11,
-		 9.21831518760500529508E-11,
-		-4.19035475934189648750E-10,
-		 2.01504975519703286596E-9,
-		-1.03457624656780970260E-8,
-		 5.74108412545004946722E-8,
-		-3.50196060308781257119E-7,
-		 2.40648494783721712015E-6,
-		-1.93619797416608296024E-5,
-		 1.95215518471351631108E-4,
-		-2.85781685962277938680E-3,
-		 1.03923736576817238437E-1,
-		 2.72062619048444266945E0
-		};
+  /* Chebyshev coefficients for exp(x) sqrt(x) K1(x)
+   * in the interval [2,infinity].
+   *
+   * lim(x->inf){ exp(x) sqrt(x) K1(x) } = sqrt(pi/2).
+   */
+  protected static final double[] B_k1 = {
+    -5.75674448366501715755E-18,
+     1.79405087314755922667E-17,
+    -5.68946255844285935196E-17,
+     1.83809354436663880070E-16,
+    -6.05704724837331885336E-16,
+     2.03870316562433424052E-15,
+    -7.01983709041831346144E-15,
+     2.47715442448130437068E-14,
+    -8.97670518232499435011E-14,
+     3.34841966607842919884E-13,
+    -1.28917396095102890680E-12,
+     5.13963967348173025100E-12,
+    -2.12996783842756842877E-11,
+     9.21831518760500529508E-11,
+    -4.19035475934189648750E-10,
+     2.01504975519703286596E-9,
+    -1.03457624656780970260E-8,
+     5.74108412545004946722E-8,
+    -3.50196060308781257119E-7,
+     2.40648494783721712015E-6,
+    -1.93619797416608296024E-5,
+     1.95215518471351631108E-4,
+    -2.85781685962277938680E-3,
+     1.03923736576817238437E-1,
+     2.72062619048444266945E0
+    };
 
 /**
  * Makes this class non instantiable, but still let's others inherit from it.
@@ -305,14 +305,14 @@
  * @param x the value to compute the bessel function of.
  */
 static public double i0(double x) throws ArithmeticException {
-	double y;
-	if( x < 0 ) x = -x;
-	if( x <= 8.0 ) {
-		y = (x/2.0) - 2.0;
-		return( Math.exp(x) * Arithmetic.chbevl( y, A_i0, 30 ) );
-	}
+  double y;
+  if( x < 0 ) x = -x;
+  if( x <= 8.0 ) {
+    y = (x/2.0) - 2.0;
+    return( Math.exp(x) * Arithmetic.chbevl( y, A_i0, 30 ) );
+  }
 
-	return(  Math.exp(x) * Arithmetic.chbevl( 32.0/x - 2.0, B_i0, 25 ) / Math.sqrt(x) );
+  return(  Math.exp(x) * Arithmetic.chbevl( 32.0/x - 2.0, B_i0, 25 ) / Math.sqrt(x) );
 }
 /**
  * Returns the exponentially scaled modified Bessel function
@@ -324,15 +324,15 @@
  * @param x the value to compute the bessel function of.
  */
 static public double i0e(double x) throws ArithmeticException {
-	double y;
-	
-	if( x < 0 ) x = -x;
-	if( x <= 8.0 ) {
-		y = (x/2.0) - 2.0;
-		return( Arithmetic.chbevl( y, A_i0, 30 ) );
-	}
+  double y;
+  
+  if( x < 0 ) x = -x;
+  if( x <= 8.0 ) {
+    y = (x/2.0) - 2.0;
+    return( Arithmetic.chbevl( y, A_i0, 30 ) );
+  }
 
-	return(  Arithmetic.chbevl( 32.0/x - 2.0, B_i0, 25 ) / Math.sqrt(x) );
+  return(  Arithmetic.chbevl( 32.0/x - 2.0, B_i0, 25 ) / Math.sqrt(x) );
 }
 /**
  * Returns the modified Bessel function of order 1 of the
@@ -347,21 +347,21 @@
  * @param x the value to compute the bessel function of.
  */
 static public double i1(double x) throws ArithmeticException {
-	double y, z;
+  double y, z;
 
-	z = Math.abs(x);
-	if( z <= 8.0 )
-		{
-		y = (z/2.0) - 2.0;
-		z = Arithmetic.chbevl( y, A_i1, 29 ) * z * Math.exp(z);
-		}
-	else
-		{
-		z = Math.exp(z) * Arithmetic.chbevl( 32.0/z - 2.0, B_i1, 25 ) / Math.sqrt(z);
-		}
-	if( x < 0.0 )
-		z = -z;
-	return( z );
+  z = Math.abs(x);
+  if( z <= 8.0 )
+    {
+    y = (z/2.0) - 2.0;
+    z = Arithmetic.chbevl( y, A_i1, 29 ) * z * Math.exp(z);
+    }
+  else
+    {
+    z = Math.exp(z) * Arithmetic.chbevl( 32.0/z - 2.0, B_i1, 25 ) / Math.sqrt(z);
+    }
+  if( x < 0.0 )
+    z = -z;
+  return( z );
 }
 /**
  * Returns the exponentially scaled modified Bessel function
@@ -376,16 +376,16 @@
 
 z = Math.abs(x);
 if( z <= 8.0 )
-	{
-	y = (z/2.0) - 2.0;
-	z = Arithmetic.chbevl( y, A_i1, 29 ) * z;
-	}
+  {
+  y = (z/2.0) - 2.0;
+  z = Arithmetic.chbevl( y, A_i1, 29 ) * z;
+  }
 else
-	{
-	z = Arithmetic.chbevl( 32.0/z - 2.0, B_i1, 25 ) / Math.sqrt(z);
-	}
+  {
+  z = Arithmetic.chbevl( 32.0/z - 2.0, B_i1, 25 ) / Math.sqrt(z);
+  }
 if( x < 0.0 )
-	z = -z;
+  z = -z;
 return( z );
 }
 /**
@@ -393,64 +393,64 @@
  * @param x the value to compute the bessel function of.
  */
 static public double j0(double x) throws ArithmeticException {
-	double ax;
+  double ax;
 
-	if( (ax=Math.abs(x)) < 8.0 ) {
-	   double y=x*x;
-	   double ans1=57568490574.0+y*(-13362590354.0+y*(651619640.7
-				   +y*(-11214424.18+y*(77392.33017+y*(-184.9052456)))));
-	   double ans2=57568490411.0+y*(1029532985.0+y*(9494680.718
-				   +y*(59272.64853+y*(267.8532712+y*1.0))));
+  if( (ax=Math.abs(x)) < 8.0 ) {
+     double y=x*x;
+     double ans1=57568490574.0+y*(-13362590354.0+y*(651619640.7
+           +y*(-11214424.18+y*(77392.33017+y*(-184.9052456)))));
+     double ans2=57568490411.0+y*(1029532985.0+y*(9494680.718
+           +y*(59272.64853+y*(267.8532712+y*1.0))));
 
-	   return ans1/ans2;
+     return ans1/ans2;
 
-	} 
-	else {
-	   double z=8.0/ax;
-	   double y=z*z;
-	   double xx=ax-0.785398164;
-	   double ans1=1.0+y*(-0.1098628627e-2+y*(0.2734510407e-4
-				   +y*(-0.2073370639e-5+y*0.2093887211e-6)));
-	   double ans2 = -0.1562499995e-1+y*(0.1430488765e-3
-				   +y*(-0.6911147651e-5+y*(0.7621095161e-6
-				   -y*0.934935152e-7)));
-		   
-	   return Math.sqrt(0.636619772/ax)*
-			  (Math.cos(xx)*ans1-z*Math.sin(xx)*ans2);
-	}
+  } 
+  else {
+     double z=8.0/ax;
+     double y=z*z;
+     double xx=ax-0.785398164;
+     double ans1=1.0+y*(-0.1098628627e-2+y*(0.2734510407e-4
+           +y*(-0.2073370639e-5+y*0.2093887211e-6)));
+     double ans2 = -0.1562499995e-1+y*(0.1430488765e-3
+           +y*(-0.6911147651e-5+y*(0.7621095161e-6
+           -y*0.934935152e-7)));
+       
+     return Math.sqrt(0.636619772/ax)*
+        (Math.cos(xx)*ans1-z*Math.sin(xx)*ans2);
+  }
 }
 /**
  * Returns the Bessel function of the first kind of order 1 of the argument.
  * @param x the value to compute the bessel function of.
  */
 static public double j1(double x) throws ArithmeticException {
-	double ax;
-	double y;
-	double ans1, ans2;
+  double ax;
+  double y;
+  double ans1, ans2;
 
-	if ((ax=Math.abs(x)) < 8.0) {
-		y=x*x;
-		ans1=x*(72362614232.0+y*(-7895059235.0+y*(242396853.1
-		   +y*(-2972611.439+y*(15704.48260+y*(-30.16036606))))));
-		ans2=144725228442.0+y*(2300535178.0+y*(18583304.74
-		   +y*(99447.43394+y*(376.9991397+y*1.0))));
-		return ans1/ans2;
-	} 
-	else {
-		double z=8.0/ax;
-		double xx=ax-2.356194491;
-		y=z*z;
+  if ((ax=Math.abs(x)) < 8.0) {
+    y=x*x;
+    ans1=x*(72362614232.0+y*(-7895059235.0+y*(242396853.1
+       +y*(-2972611.439+y*(15704.48260+y*(-30.16036606))))));
+    ans2=144725228442.0+y*(2300535178.0+y*(18583304.74
+       +y*(99447.43394+y*(376.9991397+y*1.0))));
+    return ans1/ans2;
+  } 
+  else {
+    double z=8.0/ax;
+    double xx=ax-2.356194491;
+    y=z*z;
 
-		ans1=1.0+y*(0.183105e-2+y*(-0.3516396496e-4
-		  +y*(0.2457520174e-5+y*(-0.240337019e-6))));
-		ans2=0.04687499995+y*(-0.2002690873e-3
-		  +y*(0.8449199096e-5+y*(-0.88228987e-6
-		  +y*0.105787412e-6)));
-		double ans=Math.sqrt(0.636619772/ax)*
-			   (Math.cos(xx)*ans1-z*Math.sin(xx)*ans2);
-		if (x < 0.0) ans = -ans;
-		return ans;
-	}
+    ans1=1.0+y*(0.183105e-2+y*(-0.3516396496e-4
+      +y*(0.2457520174e-5+y*(-0.240337019e-6))));
+    ans2=0.04687499995+y*(-0.2002690873e-3
+      +y*(0.8449199096e-5+y*(-0.88228987e-6
+      +y*0.105787412e-6)));
+    double ans=Math.sqrt(0.636619772/ax)*
+         (Math.cos(xx)*ans1-z*Math.sin(xx)*ans2);
+    if (x < 0.0) ans = -ans;
+    return ans;
+  }
 }
 /**
  * Returns the Bessel function of the first kind of order <tt>n</tt> of the argument.
@@ -458,55 +458,55 @@
  * @param x the value to compute the bessel function of.
  */
 static public double jn(int n, double x) throws ArithmeticException {
-	int j,m;
-	double ax,bj,bjm,bjp,sum,tox,ans;
-	boolean jsum;
+  int j,m;
+  double ax,bj,bjm,bjp,sum,tox,ans;
+  boolean jsum;
 
-	final double ACC   = 40.0;
-	final double BIGNO = 1.0e+10;
-	final double BIGNI = 1.0e-10;
+  final double ACC   = 40.0;
+  final double BIGNO = 1.0e+10;
+  final double BIGNI = 1.0e-10;
 
-	if(n == 0) return j0(x);
-	if(n == 1) return j1(x);
+  if(n == 0) return j0(x);
+  if(n == 1) return j1(x);
 
-	ax=Math.abs(x);
-	if(ax == 0.0)  return 0.0;
+  ax=Math.abs(x);
+  if(ax == 0.0)  return 0.0;
 
-	if (ax > (double)n) {
-		tox=2.0/ax;
-		bjm=j0(ax);
-		bj=j1(ax);
-		for (j=1;j<n;j++) {
-			bjp=j*tox*bj-bjm;
-			bjm=bj;
-			bj=bjp;
-		}
-		ans=bj;
-	} 
-	else {
-		tox=2.0/ax;
-		m=2*((n+(int)Math.sqrt(ACC*n))/2);
-		jsum=false;
-		bjp=ans=sum=0.0;
-		bj=1.0;
-		for (j=m;j>0;j--) {
-			bjm=j*tox*bj-bjp;
-			bjp=bj;
-			bj=bjm;
-			if (Math.abs(bj) > BIGNO) {
-				bj *= BIGNI;
-				bjp *= BIGNI;
-				ans *= BIGNI;
-				sum *= BIGNI;
-			}
-			if (jsum) sum += bj;
-			jsum=!jsum;
-			if (j == n) ans=bjp;
-		}
-		sum=2.0*sum-bj;
-		ans /= sum;
-	}
-	return  x < 0.0 && n%2 == 1 ? -ans : ans;
+  if (ax > (double)n) {
+    tox=2.0/ax;
+    bjm=j0(ax);
+    bj=j1(ax);
+    for (j=1;j<n;j++) {
+      bjp=j*tox*bj-bjm;
+      bjm=bj;
+      bj=bjp;
+    }
+    ans=bj;
+  } 
+  else {
+    tox=2.0/ax;
+    m=2*((n+(int)Math.sqrt(ACC*n))/2);
+    jsum=false;
+    bjp=ans=sum=0.0;
+    bj=1.0;
+    for (j=m;j>0;j--) {
+      bjm=j*tox*bj-bjp;
+      bjp=bj;
+      bj=bjm;
+      if (Math.abs(bj) > BIGNO) {
+        bj *= BIGNI;
+        bjp *= BIGNI;
+        ans *= BIGNI;
+        sum *= BIGNI;
+      }
+      if (jsum) sum += bj;
+      jsum=!jsum;
+      if (j == n) ans=bjp;
+    }
+    sum=2.0*sum-bj;
+    ans /= sum;
+  }
+  return  x < 0.0 && n%2 == 1 ? -ans : ans;
 }
 /**
  * Returns the modified Bessel function of the third kind
@@ -519,18 +519,18 @@
  * @param x the value to compute the bessel function of.
  */
 static public double k0(double x) throws ArithmeticException {
-	double y, z;
+  double y, z;
 
-	if( x <= 0.0 ) throw new ArithmeticException();
-	if( x <= 2.0 ) {
-		y = x * x - 2.0;
-		y = Arithmetic.chbevl( y, A_k0, 10 ) - Math.log( 0.5 * x ) * i0(x);
-		return( y );
-	}
-	
-	z = 8.0/x - 2.0;
-	y = Math.exp(-x) * Arithmetic.chbevl( z, B_k0, 25 ) / Math.sqrt(x);
-	return(y);
+  if( x <= 0.0 ) throw new ArithmeticException();
+  if( x <= 2.0 ) {
+    y = x * x - 2.0;
+    y = Arithmetic.chbevl( y, A_k0, 10 ) - Math.log( 0.5 * x ) * i0(x);
+    return( y );
+  }
+  
+  z = 8.0/x - 2.0;
+  y = Math.exp(-x) * Arithmetic.chbevl( z, B_k0, 25 ) / Math.sqrt(x);
+  return(y);
 }
 /**
  * Returns the exponentially scaled modified Bessel function
@@ -539,17 +539,17 @@
  * @param x the value to compute the bessel function of.
  */
 static public double k0e(double x) throws ArithmeticException {
-	double y;
+  double y;
 
-	if( x <= 0.0 ) throw new ArithmeticException();
-	if( x <= 2.0 ) {
-		y = x * x - 2.0;
-		y = Arithmetic.chbevl( y, A_k0, 10 ) - Math.log( 0.5 * x ) * i0(x);
-		return( y * Math.exp(x) );
-	}
+  if( x <= 0.0 ) throw new ArithmeticException();
+  if( x <= 2.0 ) {
+    y = x * x - 2.0;
+    y = Arithmetic.chbevl( y, A_k0, 10 ) - Math.log( 0.5 * x ) * i0(x);
+    return( y * Math.exp(x) );
+  }
 
-	y = Arithmetic.chbevl( 8.0/x - 2.0, B_k0, 25 ) / Math.sqrt(x);
-	return(y);
+  y = Arithmetic.chbevl( 8.0/x - 2.0, B_k0, 25 ) / Math.sqrt(x);
+  return(y);
 }
 /**
  * Returns the modified Bessel function of the third kind
@@ -562,17 +562,17 @@
  * @param x the value to compute the bessel function of.
  */
 static public double k1(double x) throws ArithmeticException {
-	double y, z;
+  double y, z;
 
-	z = 0.5 * x;
-	if( z <= 0.0 ) throw new ArithmeticException();	
-	if( x <= 2.0 ) {
-		y = x * x - 2.0;
-		y =  Math.log(z) * i1(x)  +  Arithmetic.chbevl( y, A_k1, 11 ) / x;
-		return( y );
-	}
+  z = 0.5 * x;
+  if( z <= 0.0 ) throw new ArithmeticException();  
+  if( x <= 2.0 ) {
+    y = x * x - 2.0;
+    y =  Math.log(z) * i1(x)  +  Arithmetic.chbevl( y, A_k1, 11 ) / x;
+    return( y );
+  }
 
-	return(  Math.exp(-x) * Arithmetic.chbevl( 8.0/x - 2.0, B_k1, 25 ) / Math.sqrt(x) );
+  return(  Math.exp(-x) * Arithmetic.chbevl( 8.0/x - 2.0, B_k1, 25 ) / Math.sqrt(x) );
 }
 /**
  * Returns the exponentially scaled modified Bessel function
@@ -583,16 +583,16 @@
  * @param x the value to compute the bessel function of.
  */
 static public double k1e(double x) throws ArithmeticException {
-	double y;
+  double y;
 
-	if( x <= 0.0 ) throw new ArithmeticException();
-	if( x <= 2.0 ) {
-		y = x * x - 2.0;
-		y =  Math.log( 0.5 * x ) * i1(x)  +  Arithmetic.chbevl( y, A_k1, 11 ) / x;
-		return( y * Math.exp(x) );
-	}
+  if( x <= 0.0 ) throw new ArithmeticException();
+  if( x <= 2.0 ) {
+    y = x * x - 2.0;
+    y =  Math.log( 0.5 * x ) * i1(x)  +  Arithmetic.chbevl( y, A_k1, 11 ) / x;
+    return( y * Math.exp(x) );
+  }
 
-	return(  Arithmetic.chbevl( 8.0/x - 2.0, B_k1, 25 ) / Math.sqrt(x) );
+  return(  Arithmetic.chbevl( 8.0/x - 2.0, B_k1, 25 ) / Math.sqrt(x) );
 }
 /**
  * Returns the modified Bessel function of the third kind
@@ -608,220 +608,220 @@
 static public double kn(int nn, double x) throws ArithmeticException {
 /*
 Algorithm for Kn.
-					   n-1 
-				   -n   -  (n-k-1)!    2   k
+             n-1 
+           -n   -  (n-k-1)!    2   k
 K (x)  =  0.5 (x/2)     >  -------- (-x /4)
  n                      -     k!
-					   k=0
+             k=0
 
-					inf.                                   2   k
-	   n         n   -                                   (x /4)
+          inf.                                   2   k
+     n         n   -                                   (x /4)
  + (-1)  0.5(x/2)    >  {p(k+1) + p(n+k+1) - 2log(x/2)} ---------
-					 -                                  k! (n+k)!
-					k=0
+           -                                  k! (n+k)!
+          k=0
 
 where  p(m) is the psi function: p(1) = -EUL and
 
-					  m-1
-					   -
-	  p(m)  =  -EUL +  >  1/k
-					   -
-					  k=1
+            m-1
+             -
+    p(m)  =  -EUL +  >  1/k
+             -
+            k=1
 
 For large x,
-										 2        2     2
-									  u-1     (u-1 )(u-3 )
+                     2        2     2
+                    u-1     (u-1 )(u-3 )
 K (z)  =  sqrt(pi/2z) exp(-z) { 1 + ------- + ------------ + ...}
  v                                        1            2
-									1! (8z)     2! (8z)
+                  1! (8z)     2! (8z)
 asymptotically, where
 
-		   2
-	u = 4 v .
+       2
+  u = 4 v .
 
 */
-	final double EUL = 5.772156649015328606065e-1;
-	final double MAXNUM = Double.MAX_VALUE;
-	final int MAXFAC = 31;
+  final double EUL = 5.772156649015328606065e-1;
+  final double MAXNUM = Double.MAX_VALUE;
+  final int MAXFAC = 31;
 
 
-	double k, kf, nk1f, nkf, zn, t, s, z0, z;
-	double ans, fn, pn, pk, zmn, tlg, tox;
-	int i, n;
+  double k, kf, nk1f, nkf, zn, t, s, z0, z;
+  double ans, fn, pn, pk, zmn, tlg, tox;
+  int i, n;
 
-	if( nn < 0 )
-		n = -nn;
-	else
-		n = nn;
+  if( nn < 0 )
+    n = -nn;
+  else
+    n = nn;
 
-	if( n > MAXFAC ) throw new ArithmeticException("Overflow");
-	if( x <= 0.0 ) throw new IllegalArgumentException();
+  if( n > MAXFAC ) throw new ArithmeticException("Overflow");
+  if( x <= 0.0 ) throw new IllegalArgumentException();
 
-	if( x <= 9.55 ) {
-		ans = 0.0;
-		z0 = 0.25 * x * x;
-		fn = 1.0;
-		pn = 0.0;
-		zmn = 1.0;
-		tox = 2.0/x;
+  if( x <= 9.55 ) {
+    ans = 0.0;
+    z0 = 0.25 * x * x;
+    fn = 1.0;
+    pn = 0.0;
+    zmn = 1.0;
+    tox = 2.0/x;
 
-		if( n > 0 ) {
-			/* compute factorial of n and psi(n) */
-			pn = -EUL;
-			k = 1.0;
-			for( i=1; i<n; i++ ) {
-				pn += 1.0/k;
-				k += 1.0;
-				fn *= k;
-			}
+    if( n > 0 ) {
+      /* compute factorial of n and psi(n) */
+      pn = -EUL;
+      k = 1.0;
+      for( i=1; i<n; i++ ) {
+        pn += 1.0/k;
+        k += 1.0;
+        fn *= k;
+      }
 
-			zmn = tox;
+      zmn = tox;
 
-			if( n == 1 ) {
-				ans = 1.0/x;
-			}
-			else {
-				nk1f = fn/n;
-				kf = 1.0;
-				s = nk1f;
-				z = -z0;
-				zn = 1.0;
-				for( i=1; i<n; i++ ) {
-					nk1f = nk1f/(n-i);
-					kf = kf * i;
-					zn *= z;
-					t = nk1f * zn / kf;
-					s += t;   
-					if( (MAXNUM - Math.abs(t)) < Math.abs(s) ) throw new ArithmeticException("Overflow");
-					if( (tox > 1.0) && ((MAXNUM/tox) < zmn) ) throw new ArithmeticException("Overflow");
-					zmn *= tox;
-				}
-				s *= 0.5;
-				t = Math.abs(s);
-				if( (zmn > 1.0) && ((MAXNUM/zmn) < t) )  throw new ArithmeticException("Overflow");
-				if( (t > 1.0) && ((MAXNUM/t) < zmn) )  throw new ArithmeticException("Overflow");
-				ans = s * zmn;
-			}
-		}
+      if( n == 1 ) {
+        ans = 1.0/x;
+      }
+      else {
+        nk1f = fn/n;
+        kf = 1.0;
+        s = nk1f;
+        z = -z0;
+        zn = 1.0;
+        for( i=1; i<n; i++ ) {
+          nk1f = nk1f/(n-i);
+          kf = kf * i;
+          zn *= z;
+          t = nk1f * zn / kf;
+          s += t;   
+          if( (MAXNUM - Math.abs(t)) < Math.abs(s) ) throw new ArithmeticException("Overflow");
+          if( (tox > 1.0) && ((MAXNUM/tox) < zmn) ) throw new ArithmeticException("Overflow");
+          zmn *= tox;
+        }
+        s *= 0.5;
+        t = Math.abs(s);
+        if( (zmn > 1.0) && ((MAXNUM/zmn) < t) )  throw new ArithmeticException("Overflow");
+        if( (t > 1.0) && ((MAXNUM/t) < zmn) )  throw new ArithmeticException("Overflow");
+        ans = s * zmn;
+      }
+    }
 
 
-		tlg = 2.0 * Math.log( 0.5 * x );
-		pk = -EUL;
-		if( n == 0 ) {
-			pn = pk;
-			t = 1.0;
-		}
-		else {
-			pn = pn + 1.0/n;
-			t = 1.0/fn;
-		}
-		s = (pk+pn-tlg)*t;
-		k = 1.0;
-		do {
-			t *= z0 / (k * (k+n));
-			pk += 1.0/k;
-			pn += 1.0/(k+n);
-			s += (pk+pn-tlg)*t;
-			k += 1.0;
-			}
-		while( Math.abs(t/s) > MACHEP );
+    tlg = 2.0 * Math.log( 0.5 * x );
+    pk = -EUL;
+    if( n == 0 ) {
+      pn = pk;
+      t = 1.0;
+    }
+    else {
+      pn = pn + 1.0/n;
+      t = 1.0/fn;
+    }
+    s = (pk+pn-tlg)*t;
+    k = 1.0;
+    do {
+      t *= z0 / (k * (k+n));
+      pk += 1.0/k;
+      pn += 1.0/(k+n);
+      s += (pk+pn-tlg)*t;
+      k += 1.0;
+      }
+    while( Math.abs(t/s) > MACHEP );
 
-		s = 0.5 * s / zmn;
-		if( (n & 1) > 0)
-			s = -s;
-		ans += s;
+    s = 0.5 * s / zmn;
+    if( (n & 1) > 0)
+      s = -s;
+    ans += s;
 
-		return(ans);
-	}
+    return(ans);
+  }
 
 
 
-	/* Asymptotic expansion for Kn(x) */
-	/* Converges to 1.4e-17 for x > 18.4 */
-	if( x > MAXLOG )  throw new ArithmeticException("Underflow");
-	k = n;
-	pn = 4.0 * k * k;
-	pk = 1.0;
-	z0 = 8.0 * x;
-	fn = 1.0;
-	t = 1.0;
-	s = t;
-	nkf = MAXNUM;
-	i = 0;
-	do {
-		z = pn - pk * pk;
-		t = t * z /(fn * z0);
-		nk1f = Math.abs(t);
-		if( (i >= n) && (nk1f > nkf) ) {
-			ans = Math.exp(-x) * Math.sqrt( Math.PI/(2.0*x) ) * s;
-			return(ans);
-		}
-		nkf = nk1f;
-		s += t;
-		fn += 1.0;
-		pk += 2.0;
-		i += 1;
-	} while( Math.abs(t/s) > MACHEP );
+  /* Asymptotic expansion for Kn(x) */
+  /* Converges to 1.4e-17 for x > 18.4 */
+  if( x > MAXLOG )  throw new ArithmeticException("Underflow");
+  k = n;
+  pn = 4.0 * k * k;
+  pk = 1.0;
+  z0 = 8.0 * x;
+  fn = 1.0;
+  t = 1.0;
+  s = t;
+  nkf = MAXNUM;
+  i = 0;
+  do {
+    z = pn - pk * pk;
+    t = t * z /(fn * z0);
+    nk1f = Math.abs(t);
+    if( (i >= n) && (nk1f > nkf) ) {
+      ans = Math.exp(-x) * Math.sqrt( Math.PI/(2.0*x) ) * s;
+      return(ans);
+    }
+    nkf = nk1f;
+    s += t;
+    fn += 1.0;
+    pk += 2.0;
+    i += 1;
+  } while( Math.abs(t/s) > MACHEP );
 
 
-	ans = Math.exp(-x) * Math.sqrt( Math.PI/(2.0*x) ) * s;
-	return(ans);
+  ans = Math.exp(-x) * Math.sqrt( Math.PI/(2.0*x) ) * s;
+  return(ans);
 }
 /**
  * Returns the Bessel function of the second kind of order 0 of the argument.
  * @param x the value to compute the bessel function of.
  */
 static public double y0(double x) throws ArithmeticException {
-	if (x < 8.0) {
-		double y=x*x;
-		double ans1 = -2957821389.0+y*(7062834065.0+y*(-512359803.6
-						+y*(10879881.29+y*(-86327.92757+y*228.4622733))));
-		double ans2=40076544269.0+y*(745249964.8+y*(7189466.438
-			+y*(47447.26470+y*(226.1030244+y*1.0))));
+  if (x < 8.0) {
+    double y=x*x;
+    double ans1 = -2957821389.0+y*(7062834065.0+y*(-512359803.6
+            +y*(10879881.29+y*(-86327.92757+y*228.4622733))));
+    double ans2=40076544269.0+y*(745249964.8+y*(7189466.438
+      +y*(47447.26470+y*(226.1030244+y*1.0))));
 
-		return (ans1/ans2)+0.636619772*j0(x)*Math.log(x);
-	} 
-	else {
-		double z=8.0/x;
-		double y=z*z;
-		double xx=x-0.785398164;
+    return (ans1/ans2)+0.636619772*j0(x)*Math.log(x);
+  } 
+  else {
+    double z=8.0/x;
+    double y=z*z;
+    double xx=x-0.785398164;
 
-		double ans1=1.0+y*(-0.1098628627e-2+y*(0.2734510407e-4
-					 +y*(-0.2073370639e-5+y*0.2093887211e-6)));
-		double ans2 = -0.1562499995e-1+y*(0.1430488765e-3
-					  +y*(-0.6911147651e-5+y*(0.7621095161e-6
-					  +y*(-0.934945152e-7))));
-		return Math.sqrt(0.636619772/x)*
-				(Math.sin(xx)*ans1+z*Math.cos(xx)*ans2);
-	}
+    double ans1=1.0+y*(-0.1098628627e-2+y*(0.2734510407e-4
+           +y*(-0.2073370639e-5+y*0.2093887211e-6)));
+    double ans2 = -0.1562499995e-1+y*(0.1430488765e-3
+            +y*(-0.6911147651e-5+y*(0.7621095161e-6
+            +y*(-0.934945152e-7))));
+    return Math.sqrt(0.636619772/x)*
+        (Math.sin(xx)*ans1+z*Math.cos(xx)*ans2);
+  }
 }
 /**
  * Returns the Bessel function of the second kind of order 1 of the argument.
  * @param x the value to compute the bessel function of.
  */
 static public double y1(double x) throws ArithmeticException {
-	if (x < 8.0) {
-		double y=x*x;
-		double ans1=x*(-0.4900604943e13+y*(0.1275274390e13
-					 +y*(-0.5153438139e11+y*(0.7349264551e9
-					 +y*(-0.4237922726e7+y*0.8511937935e4)))));
-		double ans2=0.2499580570e14+y*(0.4244419664e12
-					 +y*(0.3733650367e10+y*(0.2245904002e8
-					 +y*(0.1020426050e6+y*(0.3549632885e3+y)))));
-		return (ans1/ans2)+0.636619772*(j1(x)*Math.log(x)-1.0/x);
-	} 
-	else {
-		double z=8.0/x;
-		double y=z*z;
-		double xx=x-2.356194491;
-		double ans1=1.0+y*(0.183105e-2+y*(-0.3516396496e-4
-					 +y*(0.2457520174e-5+y*(-0.240337019e-6))));
-		double ans2=0.04687499995+y*(-0.2002690873e-3
-					 +y*(0.8449199096e-5+y*(-0.88228987e-6
-					 +y*0.105787412e-6)));
-		return Math.sqrt(0.636619772/x)*
-				(Math.sin(xx)*ans1+z*Math.cos(xx)*ans2);
-	}
+  if (x < 8.0) {
+    double y=x*x;
+    double ans1=x*(-0.4900604943e13+y*(0.1275274390e13
+           +y*(-0.5153438139e11+y*(0.7349264551e9
+           +y*(-0.4237922726e7+y*0.8511937935e4)))));
+    double ans2=0.2499580570e14+y*(0.4244419664e12
+           +y*(0.3733650367e10+y*(0.2245904002e8
+           +y*(0.1020426050e6+y*(0.3549632885e3+y)))));
+    return (ans1/ans2)+0.636619772*(j1(x)*Math.log(x)-1.0/x);
+  } 
+  else {
+    double z=8.0/x;
+    double y=z*z;
+    double xx=x-2.356194491;
+    double ans1=1.0+y*(0.183105e-2+y*(-0.3516396496e-4
+           +y*(0.2457520174e-5+y*(-0.240337019e-6))));
+    double ans2=0.04687499995+y*(-0.2002690873e-3
+           +y*(0.8449199096e-5+y*(-0.88228987e-6
+           +y*0.105787412e-6)));
+    return Math.sqrt(0.636619772/x)*
+        (Math.sin(xx)*ans1+z*Math.cos(xx)*ans2);
+  }
 }
 /**
  * Returns the Bessel function of the second kind of order <tt>n</tt> of the argument.
@@ -829,19 +829,19 @@
  * @param x the value to compute the bessel function of.
  */
 static public double yn(int n, double x) throws ArithmeticException {
-	double by,bym,byp,tox;
+  double by,bym,byp,tox;
 
-	if(n == 0) return y0(x);
-	if(n == 1) return y1(x);
+  if(n == 0) return y0(x);
+  if(n == 1) return y1(x);
 
-	tox=2.0/x;
-	by=y1(x);
-	bym=y0(x);
-	for (int j=1;j<n;j++) {
-		byp=j*tox*by-bym;
-		bym=by;
-		by=byp;
-	}
-	return by;
+  tox=2.0/x;
+  by=y1(x);
+  bym=y0(x);
+  for (int j=1;j<n;j++) {
+    byp=j*tox*by-bym;
+    bym=by;
+    by=byp;
+  }
+  return by;
 }
 }
Index: matrix/src/main/java/org/apache/mahout/jet/math/Mult.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/jet/math/Mult.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/jet/math/Mult.java	(working copy)
@@ -23,33 +23,33 @@
  */
 @Deprecated
 public final class Mult implements org.apache.mahout.matrix.function.DoubleFunction {
-	/**
-	 * Public read/write access to avoid frequent object construction.
-	 */
-	public double multiplicator;
+  /**
+   * Public read/write access to avoid frequent object construction.
+   */
+  public double multiplicator;
 /**
  * Insert the method's description here.
  * Creation date: (8/10/99 19:12:09)
  */
 protected Mult(final double multiplicator) {
-	this.multiplicator = multiplicator;
+  this.multiplicator = multiplicator;
 }
 /**
  * Returns the result of the function evaluation.
  */
 public final double apply(double a) {
-	return a * multiplicator;
+  return a * multiplicator;
 }
 /**
  * <tt>a / constant</tt>.
  */
 public static Mult div(final double constant) {
-	return mult(1/constant);
+  return mult(1/constant);
 }
 /**
  * <tt>a * constant</tt>.
  */
 public static Mult mult(final double constant) {
-	return new Mult(constant);
+  return new Mult(constant);
 }
 }
Index: matrix/src/main/java/org/apache/mahout/jet/math/IntFunctions.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/jet/math/IntFunctions.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/jet/math/IntFunctions.java	(working copy)
@@ -26,230 +26,230 @@
  */
 @Deprecated
 public class IntFunctions extends Object {
-	/**
-	Little trick to allow for "aliasing", that is, renaming this class.
-	Writing code like
-	<p>
-	<tt>IntFunctions.chain(IntFunctions.plus,IntFunctions.mult(3),IntFunctions.chain(IntFunctions.square,IntFunctions.div(2)));</tt>
-	<p>
-	is a bit awkward, to say the least.
-	Using the aliasing you can instead write
-	<p>
-	<tt>IntFunctions F = IntFunctions.intFunctions; <br>
-	F.chain(F.plus,F.mult(3),F.chain(F.square,F.div(2)));</tt>
-	<p>
-	*/
-	public static final IntFunctions intFunctions = new IntFunctions();
-	
-	/*****************************
-	 * <H3>Unary functions</H3>
-	 *****************************/
-	/**
-	 * Function that returns <tt>Math.abs(a) == (a < 0) ? -a : a</tt>.
-	 */
-	public static final IntFunction abs = new IntFunction() {
-		public final int apply(int a) { return (a < 0) ? -a : a; }
-	};		
+  /**
+  Little trick to allow for "aliasing", that is, renaming this class.
+  Writing code like
+  <p>
+  <tt>IntFunctions.chain(IntFunctions.plus,IntFunctions.mult(3),IntFunctions.chain(IntFunctions.square,IntFunctions.div(2)));</tt>
+  <p>
+  is a bit awkward, to say the least.
+  Using the aliasing you can instead write
+  <p>
+  <tt>IntFunctions F = IntFunctions.intFunctions; <br>
+  F.chain(F.plus,F.mult(3),F.chain(F.square,F.div(2)));</tt>
+  <p>
+  */
+  public static final IntFunctions intFunctions = new IntFunctions();
+  
+  /*****************************
+   * <H3>Unary functions</H3>
+   *****************************/
+  /**
+   * Function that returns <tt>Math.abs(a) == (a < 0) ? -a : a</tt>.
+   */
+  public static final IntFunction abs = new IntFunction() {
+    public final int apply(int a) { return (a < 0) ? -a : a; }
+  };    
 
-	/**
-	 * Function that returns <tt>a--</tt>.
-	 */
-	public static final IntFunction dec = new IntFunction() {
-		public final int apply(int a) { return a--; }   
-	};
+  /**
+   * Function that returns <tt>a--</tt>.
+   */
+  public static final IntFunction dec = new IntFunction() {
+    public final int apply(int a) { return a--; }   
+  };
 
-	/**
-	 * Function that returns <tt>(int) Arithmetic.factorial(a)</tt>.
-	 */
-	public static final IntFunction factorial = new IntFunction() {
-		public final int apply(int a) { return (int) Arithmetic.factorial(a); }
-	};
-		
-	/**
-	 * Function that returns its argument.
-	 */
-	public static final IntFunction identity = new IntFunction() {
-		public final int apply(int a) { return a; }   
-	};
+  /**
+   * Function that returns <tt>(int) Arithmetic.factorial(a)</tt>.
+   */
+  public static final IntFunction factorial = new IntFunction() {
+    public final int apply(int a) { return (int) Arithmetic.factorial(a); }
+  };
+    
+  /**
+   * Function that returns its argument.
+   */
+  public static final IntFunction identity = new IntFunction() {
+    public final int apply(int a) { return a; }   
+  };
 
-	/**
-	 * Function that returns <tt>a++</tt>.
-	 */
-	public static final IntFunction inc = new IntFunction() {
-		public final int apply(int a) { return a++; }   
-	};
+  /**
+   * Function that returns <tt>a++</tt>.
+   */
+  public static final IntFunction inc = new IntFunction() {
+    public final int apply(int a) { return a++; }   
+  };
 
-	/**
-	 * Function that returns <tt>-a</tt>.
-	 */
-	public static final IntFunction neg = new IntFunction() {
-		public final int apply(int a) { return -a; }
-	};
-		
-	/**
-	 * Function that returns <tt>~a</tt>.
-	 */
-	public static final IntFunction not = new IntFunction() {
-		public final int apply(int a) { return ~a; }
-	};
-		
-	/**
-	 * Function that returns <tt>a < 0 ? -1 : a > 0 ? 1 : 0</tt>.
-	 */
-	public static final IntFunction sign = new IntFunction() {
-		public final int apply(int a) { return a < 0 ? -1 : a > 0 ? 1 : 0; }
-	};
-		
-	/**
-	 * Function that returns <tt>a * a</tt>.
-	 */
-	public static final IntFunction square = new IntFunction() {
-		public final int apply(int a) { return a * a; }
-	};
-		
+  /**
+   * Function that returns <tt>-a</tt>.
+   */
+  public static final IntFunction neg = new IntFunction() {
+    public final int apply(int a) { return -a; }
+  };
+    
+  /**
+   * Function that returns <tt>~a</tt>.
+   */
+  public static final IntFunction not = new IntFunction() {
+    public final int apply(int a) { return ~a; }
+  };
+    
+  /**
+   * Function that returns <tt>a < 0 ? -1 : a > 0 ? 1 : 0</tt>.
+   */
+  public static final IntFunction sign = new IntFunction() {
+    public final int apply(int a) { return a < 0 ? -1 : a > 0 ? 1 : 0; }
+  };
+    
+  /**
+   * Function that returns <tt>a * a</tt>.
+   */
+  public static final IntFunction square = new IntFunction() {
+    public final int apply(int a) { return a * a; }
+  };
+    
 
 
 
 
 
-	/*****************************
-	 * <H3>Binary functions</H3>
-	 *****************************/
-		
-	/**
-	 * Function that returns <tt>a & b</tt>.
-	 */
-	public static final IntIntFunction and = new IntIntFunction() {
-		public final int apply(int a, int b) { return a & b; }
-	};
-		
-	/**
-	 * Function that returns <tt>a < b ? -1 : a > b ? 1 : 0</tt>.
-	 */
-	public static final IntIntFunction compare = new IntIntFunction() {
-		public final int apply(int a, int b) { return a < b ? -1 : a > b ? 1 : 0; }
-	};
-		
-	/**
-	 * Function that returns <tt>a / b</tt>.
-	 */
-	public static final IntIntFunction div = new IntIntFunction() {
-		public final int apply(int a, int b) { return a / b; }
-	};
-		
-	/**
-	 * Function that returns <tt>a == b ? 1 : 0</tt>.
-	 */
-	public static final IntIntFunction equals = new IntIntFunction() {
-		public final int apply(int a, int b) { return a == b ? 1 : 0; }
-	};
-		
-	/**
-	 * Function that returns <tt>a == b</tt>.
-	 */
-	public static final IntIntProcedure isEqual = new IntIntProcedure() {
-		public final boolean apply(int a, int b) { return a == b; }
-	};		
+  /*****************************
+   * <H3>Binary functions</H3>
+   *****************************/
+    
+  /**
+   * Function that returns <tt>a & b</tt>.
+   */
+  public static final IntIntFunction and = new IntIntFunction() {
+    public final int apply(int a, int b) { return a & b; }
+  };
+    
+  /**
+   * Function that returns <tt>a < b ? -1 : a > b ? 1 : 0</tt>.
+   */
+  public static final IntIntFunction compare = new IntIntFunction() {
+    public final int apply(int a, int b) { return a < b ? -1 : a > b ? 1 : 0; }
+  };
+    
+  /**
+   * Function that returns <tt>a / b</tt>.
+   */
+  public static final IntIntFunction div = new IntIntFunction() {
+    public final int apply(int a, int b) { return a / b; }
+  };
+    
+  /**
+   * Function that returns <tt>a == b ? 1 : 0</tt>.
+   */
+  public static final IntIntFunction equals = new IntIntFunction() {
+    public final int apply(int a, int b) { return a == b ? 1 : 0; }
+  };
+    
+  /**
+   * Function that returns <tt>a == b</tt>.
+   */
+  public static final IntIntProcedure isEqual = new IntIntProcedure() {
+    public final boolean apply(int a, int b) { return a == b; }
+  };    
 
-	/**
-	 * Function that returns <tt>a < b</tt>.
-	 */
-	public static final IntIntProcedure isLess = new IntIntProcedure() {
-		public final boolean apply(int a, int b) { return a < b; }
-	};		
+  /**
+   * Function that returns <tt>a < b</tt>.
+   */
+  public static final IntIntProcedure isLess = new IntIntProcedure() {
+    public final boolean apply(int a, int b) { return a < b; }
+  };    
 
-	/**
-	 * Function that returns <tt>a > b</tt>.
-	 */
-	public static final IntIntProcedure isGreater = new IntIntProcedure() {
-		public final boolean apply(int a, int b) { return a > b; }
-	};		
+  /**
+   * Function that returns <tt>a > b</tt>.
+   */
+  public static final IntIntProcedure isGreater = new IntIntProcedure() {
+    public final boolean apply(int a, int b) { return a > b; }
+  };    
 
-	/**
-	 * Function that returns <tt>Math.max(a,b)</tt>.
-	 */
-	public static final IntIntFunction max = new IntIntFunction() {
-		public final int apply(int a, int b) { return (a >= b) ? a : b; }
-	};
-		
-	/**
-	 * Function that returns <tt>Math.min(a,b)</tt>.
-	 */
-	public static final IntIntFunction min = new IntIntFunction() {
-		public final int apply(int a, int b) { return (a <= b) ? a : b; }
-	};
-		
-	/**
-	 * Function that returns <tt>a - b</tt>.
-	 */
-	public static final IntIntFunction minus = new IntIntFunction() {
-		public final int apply(int a, int b) { return a - b; }
-	};
-		
-	/**
-	 * Function that returns <tt>a % b</tt>.
-	 */
-	public static final IntIntFunction mod = new IntIntFunction() {
-		public final int apply(int a, int b) { return a % b; }
-	};
-		
-	/**
-	 * Function that returns <tt>a * b</tt>.
-	 */
-	public static final IntIntFunction mult = new IntIntFunction() {
-		public final int apply(int a, int b) { return a * b; }
-	};
-		
-	/**
-	 * Function that returns <tt>a | b</tt>.
-	 */
-	public static final IntIntFunction or = new IntIntFunction() {
-		public final int apply(int a, int b) { return a | b; }
-	};
-		
-	/**
-	 * Function that returns <tt>a + b</tt>.
-	 */
-	public static final IntIntFunction plus = new IntIntFunction() {
-		public final int apply(int a, int b) { return a + b; }
-	};
-		
-	/**
-	 * Function that returns <tt>(int) Math.pow(a,b)</tt>.
-	 */
-	public static final IntIntFunction pow = new IntIntFunction() {
-		public final int apply(int a, int b) { return (int) Math.pow(a,b); }
-	};
-	
-	/**
-	 * Function that returns <tt>a << b</tt>.
-	 */
-	public static final IntIntFunction shiftLeft = new IntIntFunction() {
-		public final int apply(int a, int b) { return a << b; }
-	};
-		
-	
-	/**
-	 * Function that returns <tt>a >> b</tt>.
-	 */
-	public static final IntIntFunction shiftRightSigned = new IntIntFunction() {
-		public final int apply(int a, int b) { return a >> b; }
-	};
-		
-	/**
-	 * Function that returns <tt>a >>> b</tt>.
-	 */
-	public static final IntIntFunction shiftRightUnsigned = new IntIntFunction() {
-		public final int apply(int a, int b) { return a >>> b; }
-	};
-		
-	/**
-	 * Function that returns <tt>a ^ b</tt>.
-	 */
-	public static final IntIntFunction xor = new IntIntFunction() {
-		public final int apply(int a, int b) { return a ^ b; }
-	};
-		
+  /**
+   * Function that returns <tt>Math.max(a,b)</tt>.
+   */
+  public static final IntIntFunction max = new IntIntFunction() {
+    public final int apply(int a, int b) { return (a >= b) ? a : b; }
+  };
+    
+  /**
+   * Function that returns <tt>Math.min(a,b)</tt>.
+   */
+  public static final IntIntFunction min = new IntIntFunction() {
+    public final int apply(int a, int b) { return (a <= b) ? a : b; }
+  };
+    
+  /**
+   * Function that returns <tt>a - b</tt>.
+   */
+  public static final IntIntFunction minus = new IntIntFunction() {
+    public final int apply(int a, int b) { return a - b; }
+  };
+    
+  /**
+   * Function that returns <tt>a % b</tt>.
+   */
+  public static final IntIntFunction mod = new IntIntFunction() {
+    public final int apply(int a, int b) { return a % b; }
+  };
+    
+  /**
+   * Function that returns <tt>a * b</tt>.
+   */
+  public static final IntIntFunction mult = new IntIntFunction() {
+    public final int apply(int a, int b) { return a * b; }
+  };
+    
+  /**
+   * Function that returns <tt>a | b</tt>.
+   */
+  public static final IntIntFunction or = new IntIntFunction() {
+    public final int apply(int a, int b) { return a | b; }
+  };
+    
+  /**
+   * Function that returns <tt>a + b</tt>.
+   */
+  public static final IntIntFunction plus = new IntIntFunction() {
+    public final int apply(int a, int b) { return a + b; }
+  };
+    
+  /**
+   * Function that returns <tt>(int) Math.pow(a,b)</tt>.
+   */
+  public static final IntIntFunction pow = new IntIntFunction() {
+    public final int apply(int a, int b) { return (int) Math.pow(a,b); }
+  };
+  
+  /**
+   * Function that returns <tt>a << b</tt>.
+   */
+  public static final IntIntFunction shiftLeft = new IntIntFunction() {
+    public final int apply(int a, int b) { return a << b; }
+  };
+    
+  
+  /**
+   * Function that returns <tt>a >> b</tt>.
+   */
+  public static final IntIntFunction shiftRightSigned = new IntIntFunction() {
+    public final int apply(int a, int b) { return a >> b; }
+  };
+    
+  /**
+   * Function that returns <tt>a >>> b</tt>.
+   */
+  public static final IntIntFunction shiftRightUnsigned = new IntIntFunction() {
+    public final int apply(int a, int b) { return a >>> b; }
+  };
+    
+  /**
+   * Function that returns <tt>a ^ b</tt>.
+   */
+  public static final IntIntFunction xor = new IntIntFunction() {
+    public final int apply(int a, int b) { return a ^ b; }
+  };
+    
 /**
  * Makes this class non instantiable, but still let's others inherit from it.
  */
@@ -259,18 +259,18 @@
  * <tt>a</tt> is a variable, <tt>b</tt> is fixed.
  */
 public static IntFunction and(final int b) {
-	return new IntFunction() {
-		public final int apply(int a) { return a & b; }
-	};
+  return new IntFunction() {
+    public final int apply(int a) { return a & b; }
+  };
 }
 /**
  * Constructs a function that returns <tt>(from<=a && a<=to) ? 1 : 0</tt>.
  * <tt>a</tt> is a variable, <tt>from</tt> and <tt>to</tt> are fixed.
  */
 public static IntFunction between(final int from, final int to) {
-	return new IntFunction() {
-		public final int apply(int a) { return (from<=a && a<=to) ? 1 : 0; }
-	};
+  return new IntFunction() {
+    public final int apply(int a) { return (from<=a && a<=to) ? 1 : 0; }
+  };
 }
 /**
  * Constructs a unary function from a binary function with the first operand (argument) fixed to the given constant <tt>c</tt>.
@@ -280,9 +280,9 @@
  * @return the unary function <tt>function(c,var)</tt>.
  */
 public static IntFunction bindArg1(final IntIntFunction function, final int c) {
-	return new IntFunction() {
-		public final int apply(int var) { return function.apply(c,var); }
-	};
+  return new IntFunction() {
+    public final int apply(int var) { return function.apply(c,var); }
+  };
 }
 /**
  * Constructs a unary function from a binary function with the second operand (argument) fixed to the given constant <tt>c</tt>.
@@ -292,9 +292,9 @@
  * @return the unary function <tt>function(var,c)</tt>.
  */
 public static IntFunction bindArg2(final IntIntFunction function, final int c) {
-	return new IntFunction() {
-		public final int apply(int var) { return function.apply(var,c); }
-	};
+  return new IntFunction() {
+    public final int apply(int var) { return function.apply(var,c); }
+  };
 }
 /**
  * Constructs the function <tt>g( h(a) )</tt>.
@@ -304,9 +304,9 @@
  * @return the unary function <tt>g( h(a) )</tt>.
  */
 public static IntFunction chain(final IntFunction g, final IntFunction h) {
-	return new IntFunction() {
-		public final int apply(int a) { return g.apply(h.apply(a)); }
-	};
+  return new IntFunction() {
+    public final int apply(int a) { return g.apply(h.apply(a)); }
+  };
 }
 /**
  * Constructs the function <tt>g( h(a,b) )</tt>.
@@ -316,9 +316,9 @@
  * @return the unary function <tt>g( h(a,b) )</tt>.
  */
 public static IntIntFunction chain(final IntFunction g, final IntIntFunction h) {
-	return new IntIntFunction() {
-		public final int apply(int a, int b) { return g.apply(h.apply(a,b)); }
-	};
+  return new IntIntFunction() {
+    public final int apply(int a, int b) { return g.apply(h.apply(a,b)); }
+  };
 }
 /**
  * Constructs the function <tt>f( g(a), h(b) )</tt>.
@@ -329,152 +329,152 @@
  * @return the binary function <tt>f( g(a), h(b) )</tt>.
  */
 public static IntIntFunction chain(final IntIntFunction f, final IntFunction g, final IntFunction h) {
-	return new IntIntFunction() {
-		public final int apply(int a, int b) { return f.apply(g.apply(a), h.apply(b)); }
-	};
+  return new IntIntFunction() {
+    public final int apply(int a, int b) { return f.apply(g.apply(a), h.apply(b)); }
+  };
 }
 /**
  * Constructs a function that returns <tt>a < b ? -1 : a > b ? 1 : 0</tt>.
  * <tt>a</tt> is a variable, <tt>b</tt> is fixed.
  */
 public static IntFunction compare(final int b) {
-	return new IntFunction() {
-		public final int apply(int a) { return a < b ? -1 : a > b ? 1 : 0; }
-	};
+  return new IntFunction() {
+    public final int apply(int a) { return a < b ? -1 : a > b ? 1 : 0; }
+  };
 }
 /**
  * Constructs a function that returns the constant <tt>c</tt>.
  */
 public static IntFunction constant(final int c) {
-	return new IntFunction() {
-		public final int apply(int a) { return c; }
-	};
+  return new IntFunction() {
+    public final int apply(int a) { return c; }
+  };
 }
 /**
  * Constructs a function that returns <tt>a / b</tt>.
  * <tt>a</tt> is a variable, <tt>b</tt> is fixed.
  */
 public static IntFunction div(final int b) {
-	return new IntFunction() {
-		public final int apply(int a) { return a / b; }
-	};
+  return new IntFunction() {
+    public final int apply(int a) { return a / b; }
+  };
 }
 /**
  * Constructs a function that returns <tt>a == b ? 1 : 0</tt>.
  * <tt>a</tt> is a variable, <tt>b</tt> is fixed.
  */
 public static IntFunction equals(final int b) {
-	return new IntFunction() {
-		public final int apply(int a) { return a == b ? 1 : 0; }
-	};
+  return new IntFunction() {
+    public final int apply(int a) { return a == b ? 1 : 0; }
+  };
 }
 /**
  * Constructs a function that returns <tt>from<=a && a<=to</tt>.
  * <tt>a</tt> is a variable, <tt>from</tt> and <tt>to</tt> are fixed.
  */
 public static IntProcedure isBetween(final int from, final int to) {
-	return new IntProcedure() {
-		public final boolean apply(int a) { return from<=a && a<=to; }
-	};
+  return new IntProcedure() {
+    public final boolean apply(int a) { return from<=a && a<=to; }
+  };
 }
 /**
  * Constructs a function that returns <tt>a == b</tt>.
  * <tt>a</tt> is a variable, <tt>b</tt> is fixed.
  */
 public static IntProcedure isEqual(final int b) {
-	return new IntProcedure() {
-		public final boolean apply(int a) { return a==b; }
-	};
+  return new IntProcedure() {
+    public final boolean apply(int a) { return a==b; }
+  };
 }
 /**
  * Constructs a function that returns <tt>a > b</tt>.
  * <tt>a</tt> is a variable, <tt>b</tt> is fixed.
  */
 public static IntProcedure isGreater(final int b) {
-	return new IntProcedure() {
-		public final boolean apply(int a) { return a > b; }
-	};
+  return new IntProcedure() {
+    public final boolean apply(int a) { return a > b; }
+  };
 }
 /**
  * Constructs a function that returns <tt>a < b</tt>.
  * <tt>a</tt> is a variable, <tt>b</tt> is fixed.
  */
 public static IntProcedure isLess(final int b) {
-	return new IntProcedure() {
-		public final boolean apply(int a) { return a < b; }
-	};
+  return new IntProcedure() {
+    public final boolean apply(int a) { return a < b; }
+  };
 }
 /**
  * Constructs a function that returns <tt>Math.max(a,b)</tt>.
  * <tt>a</tt> is a variable, <tt>b</tt> is fixed.
  */
 public static IntFunction max(final int b) {
-	return new IntFunction() {
-		public final int apply(int a) { return (a >= b) ? a : b; }
-	};
+  return new IntFunction() {
+    public final int apply(int a) { return (a >= b) ? a : b; }
+  };
 }
 /**
  * Constructs a function that returns <tt>Math.min(a,b)</tt>.
  * <tt>a</tt> is a variable, <tt>b</tt> is fixed.
  */
 public static IntFunction min(final int b) {
-	return new IntFunction() {
-		public final int apply(int a) { return (a <= b) ? a : b; }
-	};
+  return new IntFunction() {
+    public final int apply(int a) { return (a <= b) ? a : b; }
+  };
 }
 /**
  * Constructs a function that returns <tt>a - b</tt>.
  * <tt>a</tt> is a variable, <tt>b</tt> is fixed.
  */
 public static IntFunction minus(final int b) {
-	return new IntFunction() {
-		public final int apply(int a) { return a - b; }
-	};
+  return new IntFunction() {
+    public final int apply(int a) { return a - b; }
+  };
 }
 /**
  * Constructs a function that returns <tt>a % b</tt>.
  * <tt>a</tt> is a variable, <tt>b</tt> is fixed.
  */
 public static IntFunction mod(final int b) {
-	return new IntFunction() {
-		public final int apply(int a) { return a % b; }
-	};
+  return new IntFunction() {
+    public final int apply(int a) { return a % b; }
+  };
 }
 /**
  * Constructs a function that returns <tt>a * b</tt>.
  * <tt>a</tt> is a variable, <tt>b</tt> is fixed.
  */
 public static IntFunction mult(final int b) {
-	return new IntFunction() {
-		public final int apply(int a) { return a * b; }
-	};
+  return new IntFunction() {
+    public final int apply(int a) { return a * b; }
+  };
 }
 /**
  * Constructs a function that returns <tt>a | b</tt>.
  * <tt>a</tt> is a variable, <tt>b</tt> is fixed.
  */
 public static IntFunction or(final int b) {
-	return new IntFunction() {
-		public final int apply(int a) { return a | b; }
-	};
+  return new IntFunction() {
+    public final int apply(int a) { return a | b; }
+  };
 }
 /**
  * Constructs a function that returns <tt>a + b</tt>.
  * <tt>a</tt> is a variable, <tt>b</tt> is fixed.
  */
 public static IntFunction plus(final int b) {
-	return new IntFunction() {
-		public final int apply(int a) { return a + b; }
-	};
+  return new IntFunction() {
+    public final int apply(int a) { return a + b; }
+  };
 }
 /**
  * Constructs a function that returns <tt>(int) Math.pow(a,b)</tt>.
  * <tt>a</tt> is a variable, <tt>b</tt> is fixed.
  */
 public static IntFunction pow(final int b) {
-	return new IntFunction() {
-		public final int apply(int a) { return (int) Math.pow(a,b); }
-	};
+  return new IntFunction() {
+    public final int apply(int a) { return (int) Math.pow(a,b); }
+  };
 }
 /**
  * Constructs a function that returns a 32 bit uniformly distributed random number in the closed interval <tt>[Integer.MIN_VALUE,Integer.MAX_VALUE]</tt> (including <tt>Integer.MIN_VALUE</tt> and <tt>Integer.MAX_VALUE</tt>).
@@ -485,34 +485,34 @@
  * Thus, if you are not happy with the default, just pass your favourite random generator to function evaluating methods.
  */
 public static IntFunction random() {
-	return new org.apache.mahout.jet.random.engine.MersenneTwister(new java.util.Date());
+  return new org.apache.mahout.jet.random.engine.MersenneTwister(new java.util.Date());
 }
 /**
  * Constructs a function that returns <tt>a << b</tt>.
  * <tt>a</tt> is a variable, <tt>b</tt> is fixed.
  */
 public static IntFunction shiftLeft(final int b) {
-	return new IntFunction() {
-		public final int apply(int a) { return a << b; }
-	};
+  return new IntFunction() {
+    public final int apply(int a) { return a << b; }
+  };
 }
 /**
  * Constructs a function that returns <tt>a >> b</tt>.
  * <tt>a</tt> is a variable, <tt>b</tt> is fixed.
  */
 public static IntFunction shiftRightSigned(final int b) {
-	return new IntFunction() {
-		public final int apply(int a) { return a >> b; }
-	};
+  return new IntFunction() {
+    public final int apply(int a) { return a >> b; }
+  };
 }
 /**
  * Constructs a function that returns <tt>a >>> b</tt>.
  * <tt>a</tt> is a variable, <tt>b</tt> is fixed.
  */
 public static IntFunction shiftRightUnsigned(final int b) {
-	return new IntFunction() {
-		public final int apply(int a) { return a >>> b; }
-	};
+  return new IntFunction() {
+    public final int apply(int a) { return a >>> b; }
+  };
 }
 /**
  * Constructs a function that returns <tt>function.apply(b,a)</tt>, i.e. applies the function with the first operand as second operand and the second operand as first operand.
@@ -521,17 +521,17 @@
  * @return the binary function <tt>function(b,a)</tt>.
  */
 public static IntIntFunction swapArgs(final IntIntFunction function) {
-	return new IntIntFunction() {
-		public final int apply(int a, int b) { return function.apply(b,a); }
-	};
+  return new IntIntFunction() {
+    public final int apply(int a, int b) { return function.apply(b,a); }
+  };
 }
 /**
  * Constructs a function that returns <tt>a | b</tt>.
  * <tt>a</tt> is a variable, <tt>b</tt> is fixed.
  */
 public static IntFunction xor(final int b) {
-	return new IntFunction() {
-		public final int apply(int a) { return a ^ b; }
-	};
+  return new IntFunction() {
+    public final int apply(int a) { return a ^ b; }
+  };
 }
 }
Index: matrix/src/main/java/org/apache/mahout/jet/math/Polynomial.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/jet/math/Polynomial.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/jet/math/Polynomial.java	(working copy)
@@ -45,13 +45,13 @@
  * @param N the degree of the polynomial.
  */
 public static double p1evl( double x, double coef[], int N ) throws ArithmeticException {
-	double ans;
+  double ans;
 
-	ans = x + coef[0];
+  ans = x + coef[0];
 
-	for(int i=1; i<N; i++) { ans = ans*x+coef[i]; }
+  for(int i=1; i<N; i++) { ans = ans*x+coef[i]; }
 
-	return ans;
+  return ans;
 }
 /**
  * Evaluates the given polynomial of degree <tt>N</tt> at <tt>x</tt>.
@@ -72,11 +72,11 @@
  * @param N the degree of the polynomial.
  */
 public static double polevl( double x, double coef[], int N ) throws ArithmeticException {
-	double ans;
-	ans = coef[0];
+  double ans;
+  ans = coef[0];
 
-	for(int i=1; i<=N; i++) ans = ans*x+coef[i];
+  for(int i=1; i<=N; i++) ans = ans*x+coef[i];
 
-	return ans;
+  return ans;
 }
 }
Index: matrix/src/main/java/org/apache/mahout/jet/math/PlusMult.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/jet/math/PlusMult.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/jet/math/PlusMult.java	(working copy)
@@ -25,45 +25,45 @@
  */
 @Deprecated
 public final class PlusMult implements org.apache.mahout.matrix.function.DoubleDoubleFunction {
-	/**
-	 * Public read/write access to avoid frequent object construction.
-	 */
-	public double multiplicator;
+  /**
+   * Public read/write access to avoid frequent object construction.
+   */
+  public double multiplicator;
 /**
  * Insert the method's description here.
  * Creation date: (8/10/99 19:12:09)
  */
 protected PlusMult(final double multiplicator) {
-	this.multiplicator = multiplicator;
+  this.multiplicator = multiplicator;
 }
 /**
  * Returns the result of the function evaluation.
  */
 public final double apply(double a, double b) {
-	return a + b*multiplicator;
+  return a + b*multiplicator;
 }
 /**
  * <tt>a - b/constant</tt>.
  */
 public static PlusMult minusDiv(final double constant) {
-	return new PlusMult(-1/constant);
+  return new PlusMult(-1/constant);
 }
 /**
  * <tt>a - b*constant</tt>.
  */
 public static PlusMult minusMult(final double constant) {
-	return new PlusMult(-constant);
+  return new PlusMult(-constant);
 }
 /**
  * <tt>a + b/constant</tt>.
  */
 public static PlusMult plusDiv(final double constant) {
-	return new PlusMult(1/constant);
+  return new PlusMult(1/constant);
 }
 /**
  * <tt>a + b*constant</tt>.
  */
 public static PlusMult plusMult(final double constant) {
-	return new PlusMult(constant);
+  return new PlusMult(constant);
 }
 }
Index: matrix/src/main/java/org/apache/mahout/jet/math/Arithmetic.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/jet/math/Arithmetic.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/jet/math/Arithmetic.java	(working copy)
@@ -16,220 +16,220 @@
  */
 @Deprecated
 public class Arithmetic extends Constants {
-	// for method stirlingCorrection(...)
-	private static final double[] stirlingCorrection =  {   
-		 0.0,
-	     8.106146679532726e-02, 4.134069595540929e-02,
-	     2.767792568499834e-02, 2.079067210376509e-02,
-	     1.664469118982119e-02, 1.387612882307075e-02,
-	     1.189670994589177e-02, 1.041126526197209e-02,
-	     9.255462182712733e-03, 8.330563433362871e-03,
-	     7.573675487951841e-03, 6.942840107209530e-03,
-	     6.408994188004207e-03, 5.951370112758848e-03,
-	     5.554733551962801e-03, 5.207655919609640e-03,
-	     4.901395948434738e-03, 4.629153749334029e-03,
-	     4.385560249232324e-03, 4.166319691996922e-03,
-	     3.967954218640860e-03, 3.787618068444430e-03,
-	     3.622960224683090e-03, 3.472021382978770e-03,
-	     3.333155636728090e-03, 3.204970228055040e-03,
-	     3.086278682608780e-03, 2.976063983550410e-03,
-	     2.873449362352470e-03, 2.777674929752690e-03,
-	};
+  // for method stirlingCorrection(...)
+  private static final double[] stirlingCorrection =  {   
+     0.0,
+       8.106146679532726e-02, 4.134069595540929e-02,
+       2.767792568499834e-02, 2.079067210376509e-02,
+       1.664469118982119e-02, 1.387612882307075e-02,
+       1.189670994589177e-02, 1.041126526197209e-02,
+       9.255462182712733e-03, 8.330563433362871e-03,
+       7.573675487951841e-03, 6.942840107209530e-03,
+       6.408994188004207e-03, 5.951370112758848e-03,
+       5.554733551962801e-03, 5.207655919609640e-03,
+       4.901395948434738e-03, 4.629153749334029e-03,
+       4.385560249232324e-03, 4.166319691996922e-03,
+       3.967954218640860e-03, 3.787618068444430e-03,
+       3.622960224683090e-03, 3.472021382978770e-03,
+       3.333155636728090e-03, 3.204970228055040e-03,
+       3.086278682608780e-03, 2.976063983550410e-03,
+       2.873449362352470e-03, 2.777674929752690e-03,
+  };
 
-	// for method logFactorial(...)
-	// log(k!) for k = 0, ..., 29
-	protected static final double[] logFactorials = {
-		 0.00000000000000000,   0.00000000000000000,   0.69314718055994531,
-		 1.79175946922805500,   3.17805383034794562,   4.78749174278204599,
-		 6.57925121201010100,   8.52516136106541430,  10.60460290274525023,
-		12.80182748008146961,  15.10441257307551530,  17.50230784587388584,
-		19.98721449566188615,  22.55216385312342289,  25.19122118273868150,
-		27.89927138384089157,  30.67186010608067280,  33.50507345013688888,
-		36.39544520803305358,  39.33988418719949404,  42.33561646075348503,
-		45.38013889847690803,  48.47118135183522388,  51.60667556776437357,
-		54.78472939811231919,  58.00360522298051994,  61.26170176100200198,
-		64.55753862700633106,  67.88974313718153498,  71.25703896716800901
-	  };
+  // for method logFactorial(...)
+  // log(k!) for k = 0, ..., 29
+  protected static final double[] logFactorials = {
+     0.00000000000000000,   0.00000000000000000,   0.69314718055994531,
+     1.79175946922805500,   3.17805383034794562,   4.78749174278204599,
+     6.57925121201010100,   8.52516136106541430,  10.60460290274525023,
+    12.80182748008146961,  15.10441257307551530,  17.50230784587388584,
+    19.98721449566188615,  22.55216385312342289,  25.19122118273868150,
+    27.89927138384089157,  30.67186010608067280,  33.50507345013688888,
+    36.39544520803305358,  39.33988418719949404,  42.33561646075348503,
+    45.38013889847690803,  48.47118135183522388,  51.60667556776437357,
+    54.78472939811231919,  58.00360522298051994,  61.26170176100200198,
+    64.55753862700633106,  67.88974313718153498,  71.25703896716800901
+    };
 
-	// k! for k = 0, ..., 20
-	protected static final long[] longFactorials = {
-		1L,
-		1L,
-		2L,
-		6L,
-		24L,
-		120L,
-		720L,
-		5040L,
-		40320L,
-		362880L,
-		3628800L,
-		39916800L,
-		479001600L,
-		6227020800L,
-		87178291200L,
-		1307674368000L,
-		20922789888000L,
-		355687428096000L,
-		6402373705728000L,
-		121645100408832000L,
-		2432902008176640000L
-	};
+  // k! for k = 0, ..., 20
+  protected static final long[] longFactorials = {
+    1L,
+    1L,
+    2L,
+    6L,
+    24L,
+    120L,
+    720L,
+    5040L,
+    40320L,
+    362880L,
+    3628800L,
+    39916800L,
+    479001600L,
+    6227020800L,
+    87178291200L,
+    1307674368000L,
+    20922789888000L,
+    355687428096000L,
+    6402373705728000L,
+    121645100408832000L,
+    2432902008176640000L
+  };
 
-	// k! for k = 21, ..., 170
-	protected static final double[] doubleFactorials = {
-		5.109094217170944E19,
-		1.1240007277776077E21,
-		2.585201673888498E22,
-		6.204484017332394E23,
-		1.5511210043330984E25,
-		4.032914611266057E26,
-		1.0888869450418352E28,
-		3.048883446117138E29,
-		8.841761993739701E30,
-		2.652528598121911E32,
-		8.222838654177924E33,
-		2.6313083693369355E35,
-		8.68331761881189E36,
-		2.952327990396041E38,
-		1.0333147966386144E40,
-		3.719933267899013E41,
-		1.3763753091226346E43,
-		5.23022617466601E44,
-		2.0397882081197447E46,
-		8.15915283247898E47,
-		3.34525266131638E49,
-		1.4050061177528801E51,
-		6.041526306337384E52,
-		2.6582715747884495E54,
-		1.196222208654802E56,
-		5.502622159812089E57,
-		2.5862324151116827E59,
-		1.2413915592536068E61,
-		6.082818640342679E62,
-		3.0414093201713376E64,
-		1.5511187532873816E66,
-		8.06581751709439E67,
-		4.274883284060024E69,
-		2.308436973392413E71,
-		1.2696403353658264E73,
-		7.109985878048632E74,
-		4.052691950487723E76,
-		2.350561331282879E78,
-		1.386831185456898E80,
-		8.32098711274139E81,
-		5.075802138772246E83,
-		3.146997326038794E85,
-		1.9826083154044396E87,
-		1.2688693218588414E89,
-		8.247650592082472E90,
-		5.443449390774432E92,
-		3.6471110918188705E94,
-		2.48003554243683E96,
-		1.7112245242814127E98,
-		1.1978571669969892E100,
-		8.504785885678624E101,
-		6.123445837688612E103,
-		4.470115461512686E105,
-		3.307885441519387E107,
-		2.4809140811395404E109,
-		1.8854947016660506E111,
-		1.451830920282859E113,
-		1.1324281178206295E115,
-		8.94618213078298E116,
-		7.15694570462638E118,
-		5.797126020747369E120,
-		4.7536433370128435E122,
-		3.94552396972066E124,
-		3.314240134565354E126,
-		2.8171041143805494E128,
-		2.4227095383672744E130,
-		2.107757298379527E132,
-		1.854826422573984E134,
-		1.6507955160908465E136,
-		1.4857159644817605E138,
-		1.3520015276784033E140,
-		1.2438414054641305E142,
-		1.156772507081641E144,
-		1.0873661566567426E146,
-		1.0329978488239061E148,
-		9.916779348709491E149,
-		9.619275968248216E151,
-		9.426890448883248E153,
-		9.332621544394415E155,
-		9.332621544394418E157,
-		9.42594775983836E159,
-		9.614466715035125E161,
-		9.902900716486178E163,
-		1.0299016745145631E166,
-		1.0813967582402912E168,
-		1.1462805637347086E170,
-		1.2265202031961373E172,
-		1.324641819451829E174,
-		1.4438595832024942E176,
-		1.5882455415227423E178,
-		1.7629525510902457E180,
-		1.974506857221075E182,
-		2.2311927486598138E184,
-		2.543559733472186E186,
-		2.925093693493014E188,
-		3.393108684451899E190,
-		3.96993716080872E192,
-		4.6845258497542896E194,
-		5.574585761207606E196,
-		6.689502913449135E198,
-		8.094298525273444E200,
-		9.875044200833601E202,
-		1.2146304367025332E205,
-		1.506141741511141E207,
-		1.882677176888926E209,
-		2.3721732428800483E211,
-		3.0126600184576624E213,
-		3.856204823625808E215,
-		4.974504222477287E217,
-		6.466855489220473E219,
-		8.471580690878813E221,
-		1.1182486511960037E224,
-		1.4872707060906847E226,
-		1.99294274616152E228,
-		2.690472707318049E230,
-		3.6590428819525483E232,
-		5.0128887482749884E234,
-		6.917786472619482E236,
-		9.615723196941089E238,
-		1.3462012475717523E241,
-		1.8981437590761713E243,
-		2.6953641378881633E245,
-		3.8543707171800694E247,
-		5.550293832739308E249,
-		8.047926057471989E251,
-		1.1749972043909107E254,
-		1.72724589045464E256,
-		2.5563239178728637E258,
-		3.8089226376305687E260,
-		5.7133839564458575E262,
-		8.627209774233244E264,
-		1.3113358856834527E267,
-		2.0063439050956838E269,
-		3.0897696138473515E271,
-		4.789142901463393E273,
-		7.471062926282892E275,
-		1.1729568794264134E278,
-		1.8532718694937346E280,
-		2.946702272495036E282,
-		4.714723635992061E284,
-		7.590705053947223E286,
-		1.2296942187394494E289,
-		2.0044015765453032E291,
-		3.287218585534299E293,
-		5.423910666131583E295,
-		9.003691705778434E297,
-		1.5036165148649983E300,
-		2.5260757449731988E302,
-		4.2690680090047056E304,
-		7.257415615308004E306
-	};
-	
+  // k! for k = 21, ..., 170
+  protected static final double[] doubleFactorials = {
+    5.109094217170944E19,
+    1.1240007277776077E21,
+    2.585201673888498E22,
+    6.204484017332394E23,
+    1.5511210043330984E25,
+    4.032914611266057E26,
+    1.0888869450418352E28,
+    3.048883446117138E29,
+    8.841761993739701E30,
+    2.652528598121911E32,
+    8.222838654177924E33,
+    2.6313083693369355E35,
+    8.68331761881189E36,
+    2.952327990396041E38,
+    1.0333147966386144E40,
+    3.719933267899013E41,
+    1.3763753091226346E43,
+    5.23022617466601E44,
+    2.0397882081197447E46,
+    8.15915283247898E47,
+    3.34525266131638E49,
+    1.4050061177528801E51,
+    6.041526306337384E52,
+    2.6582715747884495E54,
+    1.196222208654802E56,
+    5.502622159812089E57,
+    2.5862324151116827E59,
+    1.2413915592536068E61,
+    6.082818640342679E62,
+    3.0414093201713376E64,
+    1.5511187532873816E66,
+    8.06581751709439E67,
+    4.274883284060024E69,
+    2.308436973392413E71,
+    1.2696403353658264E73,
+    7.109985878048632E74,
+    4.052691950487723E76,
+    2.350561331282879E78,
+    1.386831185456898E80,
+    8.32098711274139E81,
+    5.075802138772246E83,
+    3.146997326038794E85,
+    1.9826083154044396E87,
+    1.2688693218588414E89,
+    8.247650592082472E90,
+    5.443449390774432E92,
+    3.6471110918188705E94,
+    2.48003554243683E96,
+    1.7112245242814127E98,
+    1.1978571669969892E100,
+    8.504785885678624E101,
+    6.123445837688612E103,
+    4.470115461512686E105,
+    3.307885441519387E107,
+    2.4809140811395404E109,
+    1.8854947016660506E111,
+    1.451830920282859E113,
+    1.1324281178206295E115,
+    8.94618213078298E116,
+    7.15694570462638E118,
+    5.797126020747369E120,
+    4.7536433370128435E122,
+    3.94552396972066E124,
+    3.314240134565354E126,
+    2.8171041143805494E128,
+    2.4227095383672744E130,
+    2.107757298379527E132,
+    1.854826422573984E134,
+    1.6507955160908465E136,
+    1.4857159644817605E138,
+    1.3520015276784033E140,
+    1.2438414054641305E142,
+    1.156772507081641E144,
+    1.0873661566567426E146,
+    1.0329978488239061E148,
+    9.916779348709491E149,
+    9.619275968248216E151,
+    9.426890448883248E153,
+    9.332621544394415E155,
+    9.332621544394418E157,
+    9.42594775983836E159,
+    9.614466715035125E161,
+    9.902900716486178E163,
+    1.0299016745145631E166,
+    1.0813967582402912E168,
+    1.1462805637347086E170,
+    1.2265202031961373E172,
+    1.324641819451829E174,
+    1.4438595832024942E176,
+    1.5882455415227423E178,
+    1.7629525510902457E180,
+    1.974506857221075E182,
+    2.2311927486598138E184,
+    2.543559733472186E186,
+    2.925093693493014E188,
+    3.393108684451899E190,
+    3.96993716080872E192,
+    4.6845258497542896E194,
+    5.574585761207606E196,
+    6.689502913449135E198,
+    8.094298525273444E200,
+    9.875044200833601E202,
+    1.2146304367025332E205,
+    1.506141741511141E207,
+    1.882677176888926E209,
+    2.3721732428800483E211,
+    3.0126600184576624E213,
+    3.856204823625808E215,
+    4.974504222477287E217,
+    6.466855489220473E219,
+    8.471580690878813E221,
+    1.1182486511960037E224,
+    1.4872707060906847E226,
+    1.99294274616152E228,
+    2.690472707318049E230,
+    3.6590428819525483E232,
+    5.0128887482749884E234,
+    6.917786472619482E236,
+    9.615723196941089E238,
+    1.3462012475717523E241,
+    1.8981437590761713E243,
+    2.6953641378881633E245,
+    3.8543707171800694E247,
+    5.550293832739308E249,
+    8.047926057471989E251,
+    1.1749972043909107E254,
+    1.72724589045464E256,
+    2.5563239178728637E258,
+    3.8089226376305687E260,
+    5.7133839564458575E262,
+    8.627209774233244E264,
+    1.3113358856834527E267,
+    2.0063439050956838E269,
+    3.0897696138473515E271,
+    4.789142901463393E273,
+    7.471062926282892E275,
+    1.1729568794264134E278,
+    1.8532718694937346E280,
+    2.946702272495036E282,
+    4.714723635992061E284,
+    7.590705053947223E286,
+    1.2296942187394494E289,
+    2.0044015765453032E291,
+    3.287218585534299E293,
+    5.423910666131583E295,
+    9.003691705778434E297,
+    1.5036165148649983E300,
+    2.5260757449731988E302,
+    4.2690680090047056E304,
+    7.257415615308004E306
+  };
+  
 /**
  * Makes this class non instantiable, but still let's others inherit from it.
  */
@@ -246,18 +246,18 @@
  * @return the binomial coefficient.
  */
 public static double binomial(double n, long k) {
-	if (k<0) return 0;
-	if (k==0) return 1;
-	if (k==1) return n;
-	
-	// binomial(n,k) = (n * n-1 * ... * n-k+1 ) / ( 1 * 2 * ... * k )
-	double a = n-k+1;
-	double b = 1;
-	double binomial = 1;
-	for (long i=k; i-- > 0; ) {
-		binomial *= (a++) / (b++);
-	}
-	return binomial;
+  if (k<0) return 0;
+  if (k==0) return 1;
+  if (k==1) return n;
+  
+  // binomial(n,k) = (n * n-1 * ... * n-k+1 ) / ( 1 * 2 * ... * k )
+  double a = n-k+1;
+  double b = 1;
+  double binomial = 1;
+  for (long i=k; i-- > 0; ) {
+    binomial *= (a++) / (b++);
+  }
+  return binomial;
 }
 /**
  * Efficiently returns the binomial coefficient, often also referred to as "n over k" or "n choose k".
@@ -271,35 +271,35 @@
  * @return the binomial coefficient.
  */
 public static double binomial(long n, long k) {
-	if (k<0) return 0;
-	if (k==0 || k==n) return 1;
-	if (k==1 || k==n-1) return n;
-	
-	// try quick version and see whether we get numeric overflows.
-	// factorial(..) is O(1); requires no loop; only a table lookup.
-	if (n>k) {
-		int max = longFactorials.length + doubleFactorials.length;
-		if (n<max) { // if (n! < inf && k! < inf)
-			double n_fac = factorial((int)n);
-			double k_fac = factorial((int)k);
-			double n_minus_k_fac = factorial((int) (n-k));
-			double nk = n_minus_k_fac * k_fac;
-			if (nk != Double.POSITIVE_INFINITY) { // no numeric overflow?
-				// now this is completely safe and accurate
-				return n_fac / nk;
-			}
-		}
-		if (k > n/2) k = n-k; // quicker
-	}
-	
-	// binomial(n,k) = (n * n-1 * ... * n-k+1 ) / ( 1 * 2 * ... * k )
-	long a = n-k+1;
-	long b = 1;
-	double binomial = 1;
-	for (long i=k; i-- > 0; ) {
-		binomial *= ((double)(a++)) / (b++);
-	}
-	return binomial;
+  if (k<0) return 0;
+  if (k==0 || k==n) return 1;
+  if (k==1 || k==n-1) return n;
+  
+  // try quick version and see whether we get numeric overflows.
+  // factorial(..) is O(1); requires no loop; only a table lookup.
+  if (n>k) {
+    int max = longFactorials.length + doubleFactorials.length;
+    if (n<max) { // if (n! < inf && k! < inf)
+      double n_fac = factorial((int)n);
+      double k_fac = factorial((int)k);
+      double n_minus_k_fac = factorial((int) (n-k));
+      double nk = n_minus_k_fac * k_fac;
+      if (nk != Double.POSITIVE_INFINITY) { // no numeric overflow?
+        // now this is completely safe and accurate
+        return n_fac / nk;
+      }
+    }
+    if (k > n/2) k = n-k; // quicker
+  }
+  
+  // binomial(n,k) = (n * n-1 * ... * n-k+1 ) / ( 1 * 2 * ... * k )
+  long a = n-k+1;
+  long b = 1;
+  double binomial = 1;
+  for (long i=k; i-- > 0; ) {
+    binomial *= ((double)(a++)) / (b++);
+  }
+  return binomial;
 }
 /**
  * Returns the smallest <code>long &gt;= value</code>.
@@ -307,7 +307,7 @@
  * This method is safer than using (long) Math.ceil(value), because of possible rounding error.
  */
 public static long ceil(double value) {
-	return Math.round(Math.ceil(value));
+  return Math.round(Math.ceil(value));
 }
 /**
  * Evaluates the series of Chebyshev polynomials Ti at argument x/2.
@@ -345,63 +345,63 @@
  * @param N the number of coefficients.
  */
 public static double chbevl( double x, double coef[], int N ) throws ArithmeticException {
-	double b0, b1, b2;
+  double b0, b1, b2;
 
-	int p = 0;
-	int i;
+  int p = 0;
+  int i;
 
-	b0 = coef[p++];
-	b1 = 0.0;
-	i = N - 1;
+  b0 = coef[p++];
+  b1 = 0.0;
+  i = N - 1;
 
-	do {
-		b2 = b1;
-		b1 = b0;
-		b0 = x * b1  -  b2  + coef[p++];
-	} while( --i > 0);
+  do {
+    b2 = b1;
+    b1 = b0;
+    b0 = x * b1  -  b2  + coef[p++];
+  } while( --i > 0);
 
-	return( 0.5*(b0-b2) );
+  return( 0.5*(b0-b2) );
 }
 /**
  * Returns the factorial of the argument.
  */
 static private long fac1(int j) {
-	long i = j;
-	if(j < 0) i = Math.abs(j);
-	if (i>longFactorials.length) throw new IllegalArgumentException("Overflow");
-	
-	long d = 1;
-	while (i > 1) d *= i--;
-	
-	if (j < 0) return -d;
-	else return d;
+  long i = j;
+  if(j < 0) i = Math.abs(j);
+  if (i>longFactorials.length) throw new IllegalArgumentException("Overflow");
+  
+  long d = 1;
+  while (i > 1) d *= i--;
+  
+  if (j < 0) return -d;
+  else return d;
 }
 /**
  * Returns the factorial of the argument.
  */
 static private double fac2(int j) {
-	long i = j;
-	if (j < 0) i = Math.abs(j);
-	
-	double d = 1.0;
-	while (i > 1) d *= i--;
-	
-	if (j < 0) return -d;
-	else return d;
+  long i = j;
+  if (j < 0) i = Math.abs(j);
+  
+  double d = 1.0;
+  while (i > 1) d *= i--;
+  
+  if (j < 0) return -d;
+  else return d;
 }
 /**
  * Instantly returns the factorial <tt>k!</tt>.
  * @param k must hold <tt>k &gt;= 0</tt>.
  */
 static public double factorial(int k) {
-	if (k<0) throw new IllegalArgumentException();
-	
-	int length1 = longFactorials.length;
-	if (k<length1) return longFactorials[k];
-	
-	int length2 = doubleFactorials.length;
-	if (k<length1+length2) return doubleFactorials[k-length1];
-	else return Double.POSITIVE_INFINITY;
+  if (k<0) throw new IllegalArgumentException();
+  
+  int length1 = longFactorials.length;
+  if (k<length1) return longFactorials[k];
+  
+  int length2 = doubleFactorials.length;
+  if (k<length1+length2) return doubleFactorials[k-length1];
+  else return Double.POSITIVE_INFINITY;
 }
 /**
  * Returns the largest <code>long &lt;= value</code>.
@@ -411,27 +411,27 @@
  * This method is safer than using (long) Math.floor(value), because of possible rounding error.
  */
 public static long floor(double value) {
-	return Math.round(Math.floor(value));
+  return Math.round(Math.floor(value));
 }
 /**
  * Returns <tt>log<sub>base</sub>value</tt>.
  */
 public static double log(double base, double value) {
-	return Math.log(value) / Math.log(base);
+  return Math.log(value) / Math.log(base);
 }
 /**
  * Returns <tt>log<sub>10</sub>value</tt>.
  */
 static public double log10(double value) {
-	// 1.0 / Math.log(10) == 0.43429448190325176
-	return Math.log(value) * 0.43429448190325176;
+  // 1.0 / Math.log(10) == 0.43429448190325176
+  return Math.log(value) * 0.43429448190325176;
 }
 /**
  * Returns <tt>log<sub>2</sub>value</tt>.
  */
 static public double log2(double value) {
-	// 1.0 / Math.log(2) == 1.4426950408889634
-	return Math.log(value) * 1.4426950408889634;
+  // 1.0 / Math.log(2) == 1.4426950408889634
+  return Math.log(value) * 1.4426950408889634;
 }
 /**
  * Returns <tt>log(k!)</tt>.
@@ -441,30 +441,30 @@
  * @param k must hold <tt>k &gt;= 0</tt>.
  */
 public static double logFactorial(int k) {                                               
-	if (k >= 30) {
-		double  r, rr;
-		final double C0 =  9.18938533204672742e-01;
-		final double C1 =  8.33333333333333333e-02;
-		final double C3 = -2.77777777777777778e-03;
-		final double C5 =  7.93650793650793651e-04;
-		final double C7 = -5.95238095238095238e-04;
+  if (k >= 30) {
+    double  r, rr;
+    final double C0 =  9.18938533204672742e-01;
+    final double C1 =  8.33333333333333333e-02;
+    final double C3 = -2.77777777777777778e-03;
+    final double C5 =  7.93650793650793651e-04;
+    final double C7 = -5.95238095238095238e-04;
 
-		r  = 1.0 / (double) k;
-		rr = r * r;
-		return (k + 0.5)*Math.log(k) - k + C0 + r*(C1 + rr*(C3 + rr*(C5 + rr*C7)));
-	}
-	else
-		return logFactorials[k];
+    r  = 1.0 / (double) k;
+    rr = r * r;
+    return (k + 0.5)*Math.log(k) - k + C0 + r*(C1 + rr*(C3 + rr*(C5 + rr*C7)));
+  }
+  else
+    return logFactorials[k];
 }
 /**
  * Instantly returns the factorial <tt>k!</tt>.
  * @param k must hold <tt>k &gt;= 0 && k &lt; 21</tt>.
  */
 static public long longFactorial(int k) throws IllegalArgumentException{
-	if (k<0) throw new IllegalArgumentException("Negative k");
-	
-	if (k<longFactorials.length) return longFactorials[k];
-	throw new IllegalArgumentException("Overflow");	
+  if (k<0) throw new IllegalArgumentException("Negative k");
+  
+  if (k<longFactorials.length) return longFactorials[k];
+  throw new IllegalArgumentException("Overflow");  
 }
 /**
  * Returns the StirlingCorrection.                 
@@ -482,24 +482,24 @@
  * </tt>
  */
 public static double stirlingCorrection(int k) {
-	final double C1 =  8.33333333333333333e-02;     //  +1/12 
-	final double C3 = -2.77777777777777778e-03;     //  -1/360
-	final double C5 =  7.93650793650793651e-04;     //  +1/1260
-	final double C7 = -5.95238095238095238e-04;     //  -1/1680
+  final double C1 =  8.33333333333333333e-02;     //  +1/12 
+  final double C3 = -2.77777777777777778e-03;     //  -1/360
+  final double C5 =  7.93650793650793651e-04;     //  +1/1260
+  final double C7 = -5.95238095238095238e-04;     //  -1/1680
 
-	double r, rr;
+  double r, rr;
 
-	if (k > 30) {
-		r = 1.0 / (double) k;
-		rr = r * r;
-		return r*(C1 + rr*(C3 + rr*(C5 + rr*C7)));
-	}
-	else return stirlingCorrection[k];
+  if (k > 30) {
+    r = 1.0 / (double) k;
+    rr = r * r;
+    return r*(C1 + rr*(C3 + rr*(C5 + rr*C7)));
+  }
+  else return stirlingCorrection[k];
 }
 /**
  * Equivalent to <tt>Math.round(binomial(n,k))</tt>.
  */
 private static long xlongBinomial(long n, long k) {
-	return Math.round(binomial(n,k));
+  return Math.round(binomial(n,k));
 }
 }
Index: matrix/src/main/java/org/apache/mahout/jet/stat/Probability.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/jet/stat/Probability.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/jet/stat/Probability.java	(working copy)
@@ -18,90 +18,87 @@
  * which in turn is a port from the <A HREF="http://people.ne.mediaone.net/moshier/index.html#Cephes">Cephes 2.2</A> Math Library (C).
  * Most Cephes code (missing from the 2D Graph Package) directly ported.
  *
- * @author peter.gedeck@pharma.Novartis.com
- * @author wolfgang.hoschek@cern.ch
- * @version 0.91, 08-Dec-99
  */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
  */
 @Deprecated
 public class Probability extends org.apache.mahout.jet.math.Constants {
-	/*************************************************
-	 *    COEFFICIENTS FOR METHOD  normalInverse()   *
-	 *************************************************/
-	/* approximation for 0 <= |y - 0.5| <= 3/8 */
-	protected static final double P0[] = {
-		-5.99633501014107895267E1,
-		 9.80010754185999661536E1,
-		-5.66762857469070293439E1,
-		 1.39312609387279679503E1,
-		-1.23916583867381258016E0,
-		};
-	protected static final double Q0[] = {
-		/* 1.00000000000000000000E0,*/
-		 1.95448858338141759834E0,
-		 4.67627912898881538453E0,
-		 8.63602421390890590575E1,
-		-2.25462687854119370527E2,
-		 2.00260212380060660359E2,
-		-8.20372256168333339912E1,
-		 1.59056225126211695515E1,
-		-1.18331621121330003142E0,
-		};
+  /*************************************************
+   *    COEFFICIENTS FOR METHOD  normalInverse()   *
+   *************************************************/
+  /* approximation for 0 <= |y - 0.5| <= 3/8 */
+  protected static final double P0[] = {
+    -5.99633501014107895267E1,
+     9.80010754185999661536E1,
+    -5.66762857469070293439E1,
+     1.39312609387279679503E1,
+    -1.23916583867381258016E0,
+    };
+  protected static final double Q0[] = {
+    /* 1.00000000000000000000E0,*/
+     1.95448858338141759834E0,
+     4.67627912898881538453E0,
+     8.63602421390890590575E1,
+    -2.25462687854119370527E2,
+     2.00260212380060660359E2,
+    -8.20372256168333339912E1,
+     1.59056225126211695515E1,
+    -1.18331621121330003142E0,
+    };
 
 
-	/* Approximation for interval z = sqrt(-2 log y ) between 2 and 8
-	 * i.e., y between exp(-2) = .135 and exp(-32) = 1.27e-14.
-	 */
-	protected static final double P1[] = {
-		 4.05544892305962419923E0,
-		 3.15251094599893866154E1,
-		 5.71628192246421288162E1,
-		 4.40805073893200834700E1,
-		 1.46849561928858024014E1,
-		 2.18663306850790267539E0,
-		-1.40256079171354495875E-1,
-		-3.50424626827848203418E-2,
-		-8.57456785154685413611E-4,
-		};
-	protected static final double Q1[] = {
-		/*  1.00000000000000000000E0,*/
-		 1.57799883256466749731E1,
-		 4.53907635128879210584E1,
-		 4.13172038254672030440E1,
-		 1.50425385692907503408E1,
-		 2.50464946208309415979E0,
-		-1.42182922854787788574E-1,
-		-3.80806407691578277194E-2,
-		-9.33259480895457427372E-4,
-		};
+  /* Approximation for interval z = sqrt(-2 log y ) between 2 and 8
+   * i.e., y between exp(-2) = .135 and exp(-32) = 1.27e-14.
+   */
+  protected static final double P1[] = {
+     4.05544892305962419923E0,
+     3.15251094599893866154E1,
+     5.71628192246421288162E1,
+     4.40805073893200834700E1,
+     1.46849561928858024014E1,
+     2.18663306850790267539E0,
+    -1.40256079171354495875E-1,
+    -3.50424626827848203418E-2,
+    -8.57456785154685413611E-4,
+    };
+  protected static final double Q1[] = {
+    /*  1.00000000000000000000E0,*/
+     1.57799883256466749731E1,
+     4.53907635128879210584E1,
+     4.13172038254672030440E1,
+     1.50425385692907503408E1,
+     2.50464946208309415979E0,
+    -1.42182922854787788574E-1,
+    -3.80806407691578277194E-2,
+    -9.33259480895457427372E-4,
+    };
 
-	/* Approximation for interval z = sqrt(-2 log y ) between 8 and 64
-	 * i.e., y between exp(-32) = 1.27e-14 and exp(-2048) = 3.67e-890.
-	 */
-	protected static final double  P2[] = {
-		  3.23774891776946035970E0,
-		  6.91522889068984211695E0,
-		  3.93881025292474443415E0,
-		  1.33303460815807542389E0,
-		  2.01485389549179081538E-1,
-		  1.23716634817820021358E-2,
-		  3.01581553508235416007E-4,
-		  2.65806974686737550832E-6,
-		  6.23974539184983293730E-9,
-		};
-	protected static final double  Q2[] = {
-		/*  1.00000000000000000000E0,*/
-		  6.02427039364742014255E0,
-		  3.67983563856160859403E0,
-		  1.37702099489081330271E0,
-		  2.16236993594496635890E-1,
-		  1.34204006088543189037E-2,
-		  3.28014464682127739104E-4,
-		  2.89247864745380683936E-6,
-		  6.79019408009981274425E-9,
-		};
+  /* Approximation for interval z = sqrt(-2 log y ) between 8 and 64
+   * i.e., y between exp(-32) = 1.27e-14 and exp(-2048) = 3.67e-890.
+   */
+  protected static final double  P2[] = {
+      3.23774891776946035970E0,
+      6.91522889068984211695E0,
+      3.93881025292474443415E0,
+      1.33303460815807542389E0,
+      2.01485389549179081538E-1,
+      1.23716634817820021358E-2,
+      3.01581553508235416007E-4,
+      2.65806974686737550832E-6,
+      6.23974539184983293730E-9,
+    };
+  protected static final double  Q2[] = {
+    /*  1.00000000000000000000E0,*/
+      6.02427039364742014255E0,
+      3.67983563856160859403E0,
+      1.37702099489081330271E0,
+      2.16236993594496635890E-1,
+      1.34204006088543189037E-2,
+      3.28014464682127739104E-4,
+      2.89247864745380683936E-6,
+      6.79019408009981274425E-9,
+    };
 
 /**
  * Makes this class non instantiable, but still let's others inherit from it.
@@ -128,7 +125,7 @@
  *
  */
 static public double beta(double a, double b, double x ) {
-	return Gamma.incompleteBeta( a, b, x );
+  return Gamma.incompleteBeta( a, b, x );
 }
 /**
  * Returns the area under the right hand tail (from <tt>x</tt> to
@@ -138,7 +135,7 @@
  * integral function <tt>Gamma.incompleteBeta(b, a, x)</tt>.
  */
 static public double betaComplemented(double a, double b, double x ) {
-	return Gamma.incompleteBeta( b, a, x );
+  return Gamma.incompleteBeta( b, a, x );
 }
 /**
  * Returns the sum of the terms <tt>0</tt> through <tt>k</tt> of the Binomial
@@ -161,13 +158,13 @@
  * @param p the probability of success (must be in <tt>(0.0,1.0)</tt>).
  */
 static public double binomial(int k, int n, double p) {
-	if( (p < 0.0) || (p > 1.0) ) throw new IllegalArgumentException();
-	if( (k < 0) || (n < k) ) throw new IllegalArgumentException();
+  if( (p < 0.0) || (p > 1.0) ) throw new IllegalArgumentException();
+  if( (k < 0) || (n < k) ) throw new IllegalArgumentException();
 
-	if( k == n ) return( 1.0 );
-	if( k == 0 ) return Math.pow( 1.0-p, n-k );
-	
-	return Gamma.incompleteBeta( n-k, k+1, 1.0 - p );
+  if( k == n ) return( 1.0 );
+  if( k == 0 ) return Math.pow( 1.0-p, n-k );
+  
+  return Gamma.incompleteBeta( n-k, k+1, 1.0 - p );
 }
 /**
  * Returns the sum of the terms <tt>k+1</tt> through <tt>n</tt> of the Binomial
@@ -190,13 +187,13 @@
  * @param p the probability of success (must be in <tt>(0.0,1.0)</tt>).
  */
 static public double binomialComplemented(int k, int n, double p) {
-	if( (p < 0.0) || (p > 1.0) ) throw new IllegalArgumentException();
-	if( (k < 0) || (n < k) ) throw new IllegalArgumentException();
+  if( (p < 0.0) || (p > 1.0) ) throw new IllegalArgumentException();
+  if( (k < 0) || (n < k) ) throw new IllegalArgumentException();
 
-	if( k == n ) return( 0.0 );
-	if( k == 0 ) return 1.0 - Math.pow( 1.0-p, n-k );
-	
-	return Gamma.incompleteBeta( k+1, n-k, p );
+  if( k == n ) return( 0.0 );
+  if( k == 0 ) return 1.0 - Math.pow( 1.0-p, n-k );
+  
+  return Gamma.incompleteBeta( k+1, n-k, p );
 }
 /**
  * Returns the area under the left hand tail (from 0 to <tt>x</tt>)
@@ -224,8 +221,8 @@
  * @param x integration end point.
  */
 static public double chiSquare(double v, double x) throws ArithmeticException { 
-	if( x < 0.0 || v < 1.0 ) return 0.0;
-	return Gamma.incompleteGamma( v/2.0, x/2.0 );
+  if( x < 0.0 || v < 1.0 ) return 0.0;
+  return Gamma.incompleteGamma( v/2.0, x/2.0 );
 }
 /**
  * Returns the area under the right hand tail (from <tt>x</tt> to
@@ -253,8 +250,8 @@
  * @param v degrees of freedom.
  */
 static public double chiSquareComplemented(double v, double x) throws ArithmeticException { 
-	if( x < 0.0 || v < 1.0 ) return 0.0;
-	return Gamma.incompleteGammaComplement( v/2.0, x/2.0 );
+  if( x < 0.0 || v < 1.0 ) return 0.0;
+  return Gamma.incompleteGammaComplement( v/2.0, x/2.0 );
 }
 /**
  * Returns the error function of the normal distribution; formerly named <tt>erf</tt>.
@@ -278,27 +275,27 @@
  * @param x the argument to the function.
  */
 static public double errorFunction(double x) throws ArithmeticException { 
-	double y, z;
-	final double T[] = {
-					 9.60497373987051638749E0,
-					 9.00260197203842689217E1,
-					 2.23200534594684319226E3,
-					 7.00332514112805075473E3,
-					 5.55923013010394962768E4
-					};
-	final double U[] = {
-				   //1.00000000000000000000E0,
-					 3.35617141647503099647E1,
-					 5.21357949780152679795E2,
-					 4.59432382970980127987E3,
-					 2.26290000613890934246E4,
-					 4.92673942608635921086E4
-					};
+  double y, z;
+  final double T[] = {
+           9.60497373987051638749E0,
+           9.00260197203842689217E1,
+           2.23200534594684319226E3,
+           7.00332514112805075473E3,
+           5.55923013010394962768E4
+          };
+  final double U[] = {
+           //1.00000000000000000000E0,
+           3.35617141647503099647E1,
+           5.21357949780152679795E2,
+           4.59432382970980127987E3,
+           2.26290000613890934246E4,
+           4.92673942608635921086E4
+          };
 
-	if( Math.abs(x) > 1.0 ) return( 1.0 - errorFunctionComplemented(x) );
-	z = x * x;
-	y = x * Polynomial.polevl( z, T, 4 ) / Polynomial.p1evl( z, U, 5 );
-	return y;
+  if( Math.abs(x) > 1.0 ) return( 1.0 - errorFunctionComplemented(x) );
+  z = x * x;
+  y = x * Polynomial.polevl( z, T, 4 ) / Polynomial.p1evl( z, U, 5 );
+  return y;
 }
 /**
  * Returns the complementary Error function of the normal distribution; formerly named <tt>erfc</tt>.
@@ -323,81 +320,81 @@
  * @param a the argument to the function.
  */
 static public double errorFunctionComplemented(double a) throws ArithmeticException { 
-	double x,y,z,p,q;
+  double x,y,z,p,q;
 
-	double P[] = {
-					 2.46196981473530512524E-10,
-					 5.64189564831068821977E-1,
-					 7.46321056442269912687E0,
-					 4.86371970985681366614E1,
-					 1.96520832956077098242E2,
-					 5.26445194995477358631E2,
-					 9.34528527171957607540E2,
-					 1.02755188689515710272E3,
-					 5.57535335369399327526E2
-					};
-	double Q[] = {
-					//1.0
-					  1.32281951154744992508E1,
-					  8.67072140885989742329E1,
-					  3.54937778887819891062E2,
-					  9.75708501743205489753E2,
-					  1.82390916687909736289E3,
-					  2.24633760818710981792E3,
-					  1.65666309194161350182E3,
-					  5.57535340817727675546E2
-					 };
+  double P[] = {
+           2.46196981473530512524E-10,
+           5.64189564831068821977E-1,
+           7.46321056442269912687E0,
+           4.86371970985681366614E1,
+           1.96520832956077098242E2,
+           5.26445194995477358631E2,
+           9.34528527171957607540E2,
+           1.02755188689515710272E3,
+           5.57535335369399327526E2
+          };
+  double Q[] = {
+          //1.0
+            1.32281951154744992508E1,
+            8.67072140885989742329E1,
+            3.54937778887819891062E2,
+            9.75708501743205489753E2,
+            1.82390916687909736289E3,
+            2.24633760818710981792E3,
+            1.65666309194161350182E3,
+            5.57535340817727675546E2
+           };
 
-	double R[] = {
-					  5.64189583547755073984E-1,
-					  1.27536670759978104416E0,
-					  5.01905042251180477414E0,
-					  6.16021097993053585195E0,
-					  7.40974269950448939160E0,
-					  2.97886665372100240670E0
-					 };
-	double S[] = {
-					//1.00000000000000000000E0, 
-					  2.26052863220117276590E0,
-					  9.39603524938001434673E0,
-					  1.20489539808096656605E1,
-					  1.70814450747565897222E1,
-					  9.60896809063285878198E0,
-					  3.36907645100081516050E0
-					 };
+  double R[] = {
+            5.64189583547755073984E-1,
+            1.27536670759978104416E0,
+            5.01905042251180477414E0,
+            6.16021097993053585195E0,
+            7.40974269950448939160E0,
+            2.97886665372100240670E0
+           };
+  double S[] = {
+          //1.00000000000000000000E0, 
+            2.26052863220117276590E0,
+            9.39603524938001434673E0,
+            1.20489539808096656605E1,
+            1.70814450747565897222E1,
+            9.60896809063285878198E0,
+            3.36907645100081516050E0
+           };
 
-	if( a < 0.0 )   x = -a;
-	else            x = a;
+  if( a < 0.0 )   x = -a;
+  else            x = a;
 
-	if( x < 1.0 )   return 1.0 - errorFunction(a);
+  if( x < 1.0 )   return 1.0 - errorFunction(a);
 
-	z = -a * a;
+  z = -a * a;
 
-	if( z < -MAXLOG ) {
-		 if( a < 0 )  return( 2.0 );
-		 else         return( 0.0 );
-	}
+  if( z < -MAXLOG ) {
+     if( a < 0 )  return( 2.0 );
+     else         return( 0.0 );
+  }
 
-	z = Math.exp(z);
+  z = Math.exp(z);
 
-	if( x < 8.0 ) {
-	  p = Polynomial.polevl( x, P, 8 );
-	  q = Polynomial.p1evl( x, Q, 8 );
-	} else {
-	  p = Polynomial.polevl( x, R, 5 );
-	  q = Polynomial.p1evl( x, S, 6 );
-	}
+  if( x < 8.0 ) {
+    p = Polynomial.polevl( x, P, 8 );
+    q = Polynomial.p1evl( x, Q, 8 );
+  } else {
+    p = Polynomial.polevl( x, R, 5 );
+    q = Polynomial.p1evl( x, S, 6 );
+  }
 
-	y = (z * p)/q;
+  y = (z * p)/q;
 
-	if( a < 0 ) y = 2.0 - y;
+  if( a < 0 ) y = 2.0 - y;
 
-	if( y == 0.0 ) {
-			if( a < 0 ) return 2.0;
-			else        return( 0.0 );
-	 }
+  if( y == 0.0 ) {
+      if( a < 0 ) return 2.0;
+      else        return( 0.0 );
+   }
 
-	return y;
+  return y;
 }
 /**
  * Returns the integral from zero to <tt>x</tt> of the gamma probability
@@ -421,8 +418,8 @@
  * @param x integration end point.
  */
 static public double gamma(double a, double b, double x ) {
-	if( x < 0.0 ) return 0.0;
-	return Gamma.incompleteGamma(b, a*x);
+  if( x < 0.0 ) return 0.0;
+  return Gamma.incompleteGamma(b, a*x);
 }
 /**
  * Returns the integral from <tt>x</tt> to infinity of the gamma
@@ -446,8 +443,8 @@
  * @param x integration end point.
  */
 static public double gammaComplemented(double a, double b, double x ) {
-	if( x < 0.0 ) return 0.0;
-	return Gamma.incompleteGammaComplement(b, a*x);
+  if( x < 0.0 ) return 0.0;
+  return Gamma.incompleteGammaComplement(b, a*x);
 }
 /**
  * Returns the sum of the terms <tt>0</tt> through <tt>k</tt> of the Negative Binomial Distribution.
@@ -472,10 +469,10 @@
  * @param p the probability of success (must be in <tt>(0.0,1.0)</tt>).
  */
 static public double negativeBinomial(int k, int n, double p) {
-	if( (p < 0.0) || (p > 1.0) ) throw new IllegalArgumentException();
-	if(k < 0) return 0.0;
+  if( (p < 0.0) || (p > 1.0) ) throw new IllegalArgumentException();
+  if(k < 0) return 0.0;
 
-	return Gamma.incompleteBeta( n, k+1, p );
+  return Gamma.incompleteBeta( n, k+1, p );
 }
 /**
  * Returns the sum of the terms <tt>k+1</tt> to infinity of the Negative
@@ -498,10 +495,10 @@
  * @param p the probability of success (must be in <tt>(0.0,1.0)</tt>).
  */
 static public double negativeBinomialComplemented(int k, int n, double p) {
-	if( (p < 0.0) || (p > 1.0) ) throw new IllegalArgumentException();
-	if(k < 0) return 0.0;
+  if( (p < 0.0) || (p > 1.0) ) throw new IllegalArgumentException();
+  if(k < 0) return 0.0;
 
-	return Gamma.incompleteBeta( k+1, n, 1.0-p );
+  return Gamma.incompleteBeta( k+1, n, 1.0-p );
 }
 /**
  * Returns the area under the Normal (Gaussian) probability density
@@ -522,18 +519,18 @@
  * Computation is via the functions <tt>errorFunction</tt> and <tt>errorFunctionComplement</tt>.
  */
 static public double normal( double a) throws ArithmeticException { 
-	double x, y, z;
+  double x, y, z;
 
-	x = a * SQRTH;
-	z = Math.abs(x);
+  x = a * SQRTH;
+  z = Math.abs(x);
 
-	if( z < SQRTH ) y = 0.5 + 0.5 * errorFunction(x);
-	else {
-		y = 0.5 * errorFunctionComplemented(z);
-		if( x > 0 )  y = 1.0 - y;
-	}
+  if( z < SQRTH ) y = 0.5 + 0.5 * errorFunction(x);
+  else {
+    y = 0.5 * errorFunctionComplemented(z);
+    if( x > 0 )  y = 1.0 - y;
+  }
 
-	return y;
+  return y;
 }
 /**
  * Returns the area under the Normal (Gaussian) probability density
@@ -556,10 +553,10 @@
  * @param x the integration limit.
  */
 static public double normal(double mean, double variance, double x) throws ArithmeticException {
-	if (x>0) 
-		return 0.5 + 0.5*errorFunction((x-mean)/Math.sqrt(2.0*variance));
-	else 
-		return 0.5 - 0.5*errorFunction((-(x-mean))/Math.sqrt(2.0*variance));
+  if (x>0) 
+    return 0.5 + 0.5*errorFunction((x-mean)/Math.sqrt(2.0*variance));
+  else 
+    return 0.5 - 0.5*errorFunction((-(x-mean))/Math.sqrt(2.0*variance));
 }
 /**
  * Returns the value, <tt>x</tt>, for which the area under the
@@ -576,40 +573,40 @@
  *
  */
 static public double normalInverse( double y0) throws ArithmeticException { 
-	double x, y, z, y2, x0, x1;
-	int code;
+  double x, y, z, y2, x0, x1;
+  int code;
 
-	final double s2pi = Math.sqrt(2.0*Math.PI);
+  final double s2pi = Math.sqrt(2.0*Math.PI);
 
-	if( y0 <= 0.0 ) throw new IllegalArgumentException();
-	if( y0 >= 1.0 ) throw new IllegalArgumentException();
-	code = 1;
-	y = y0;
-	if( y > (1.0 - 0.13533528323661269189) ) { /* 0.135... = exp(-2) */
-		y = 1.0 - y;
-		code = 0;
-	}
+  if( y0 <= 0.0 ) throw new IllegalArgumentException();
+  if( y0 >= 1.0 ) throw new IllegalArgumentException();
+  code = 1;
+  y = y0;
+  if( y > (1.0 - 0.13533528323661269189) ) { /* 0.135... = exp(-2) */
+    y = 1.0 - y;
+    code = 0;
+  }
 
-	if( y > 0.13533528323661269189 ) {
-		y = y - 0.5;
-		y2 = y * y;
-		x = y + y * (y2 * Polynomial.polevl( y2, P0, 4)/Polynomial.p1evl( y2, Q0, 8 ));
-		x = x * s2pi; 
-		return(x);
-	}
+  if( y > 0.13533528323661269189 ) {
+    y = y - 0.5;
+    y2 = y * y;
+    x = y + y * (y2 * Polynomial.polevl( y2, P0, 4)/Polynomial.p1evl( y2, Q0, 8 ));
+    x = x * s2pi; 
+    return(x);
+  }
 
-	x = Math.sqrt( -2.0 * Math.log(y) );
-	x0 = x - Math.log(x)/x;
+  x = Math.sqrt( -2.0 * Math.log(y) );
+  x0 = x - Math.log(x)/x;
 
-	z = 1.0/x;
-	if( x < 8.0 ) /* y > exp(-32) = 1.2664165549e-14 */
-		x1 = z * Polynomial.polevl( z, P1, 8 )/Polynomial.p1evl( z, Q1, 8 );
-	else
-		x1 = z * Polynomial.polevl( z, P2, 8 )/Polynomial.p1evl( z, Q2, 8 );
-	x = x0 - x1;
-	if( code != 0 )
-		x = -x;
-	return( x );
+  z = 1.0/x;
+  if( x < 8.0 ) /* y > exp(-32) = 1.2664165549e-14 */
+    x1 = z * Polynomial.polevl( z, P1, 8 )/Polynomial.p1evl( z, Q1, 8 );
+  else
+    x1 = z * Polynomial.polevl( z, P2, 8 )/Polynomial.p1evl( z, Q2, 8 );
+  x = x0 - x1;
+  if( code != 0 )
+    x = -x;
+  return( x );
 }
 /**
  * Returns the sum of the first <tt>k</tt> terms of the Poisson distribution.
@@ -631,9 +628,9 @@
  * @param mean the mean of the poisson distribution.
  */
 static public double poisson(int k, double mean) throws ArithmeticException { 
-	if( mean < 0 ) throw new IllegalArgumentException();
-	if( k < 0 ) return 0.0;
-	return Gamma.incompleteGammaComplement((double)(k+1) ,mean);
+  if( mean < 0 ) throw new IllegalArgumentException();
+  if( k < 0 ) return 0.0;
+  return Gamma.incompleteGammaComplement((double)(k+1) ,mean);
 }
 /**
  * Returns the sum of the terms <tt>k+1</tt> to <tt>Infinity</tt> of the Poisson distribution.
@@ -655,9 +652,9 @@
  * @param mean the mean of the poisson distribution.
  */
 static public double poissonComplemented(int k, double mean) throws ArithmeticException { 
-	if( mean < 0 ) throw new IllegalArgumentException();
-	if( k < -1 ) return 0.0;
-	return Gamma.incompleteGamma((double)(k+1),mean);
+  if( mean < 0 ) throw new IllegalArgumentException();
+  if( k < -1 ) return 0.0;
+  return Gamma.incompleteGamma((double)(k+1),mean);
 }
 /**
  * Returns the integral from minus infinity to <tt>t</tt> of the Student-t 
@@ -688,14 +685,14 @@
  * @param t integration end point.
  */
 static public double studentT(double k, double t) throws ArithmeticException { 
-	if( k <= 0 ) throw new IllegalArgumentException();
-	if( t == 0 ) return( 0.5 );
-	
-	double cdf = 0.5 * Gamma.incompleteBeta( 0.5*k, 0.5, k / (k + t * t) );
-	
-	if (t >= 0) cdf = 1.0 - cdf; // fixes bug reported by stefan.bentink@molgen.mpg.de
-	 
-	return cdf;
+  if( k <= 0 ) throw new IllegalArgumentException();
+  if( t == 0 ) return( 0.5 );
+  
+  double cdf = 0.5 * Gamma.incompleteBeta( 0.5*k, 0.5, k / (k + t * t) );
+  
+  if (t >= 0) cdf = 1.0 - cdf; // fixes bug reported by stefan.bentink@molgen.mpg.de
+   
+  return cdf;
 }
 /**
  * Returns the value, <tt>t</tt>, for which the area under the
@@ -711,59 +708,59 @@
  * @param size size of data set
  */
 public static double studentTInverse(double alpha, int size) {
-	 double cumProb = 1-alpha/2; // Cumulative probability
-	 double f1,f2,f3;
-	 double x1,x2,x3;
-	 double g,s12;
+   double cumProb = 1-alpha/2; // Cumulative probability
+   double f1,f2,f3;
+   double x1,x2,x3;
+   double g,s12;
 
-	 cumProb = 1-alpha/2; // Cumulative probability
-	 x1 = normalInverse(cumProb);
+   cumProb = 1-alpha/2; // Cumulative probability
+   x1 = normalInverse(cumProb);
 
-	 // Return inverse of normal for large size
-	 if (size > 200) {
-		return x1;
-	 }
+   // Return inverse of normal for large size
+   if (size > 200) {
+    return x1;
+   }
 
-	 // Find a pair of x1,x2 that braket zero
-	 f1 = studentT(size,x1)-cumProb;
-	 x2 = x1; f2 = f1;
-	 do {
-		if (f1>0) {
-		   x2 = x2/2;
-		} else {
-		   x2 = x2+x1;
-		}
-		f2 = studentT(size,x2)-cumProb;
-	 } while (f1*f2>0);
+   // Find a pair of x1,x2 that braket zero
+   f1 = studentT(size,x1)-cumProb;
+   x2 = x1; f2 = f1;
+   do {
+    if (f1>0) {
+       x2 = x2/2;
+    } else {
+       x2 = x2+x1;
+    }
+    f2 = studentT(size,x2)-cumProb;
+   } while (f1*f2>0);
 
-	 // Find better approximation
-	 // Pegasus-method
-	 do {
-		// Calculate slope of secant and t value for which it is 0.
-		s12 = (f2-f1)/(x2-x1);
-		x3 = x2 - f2/s12;
+   // Find better approximation
+   // Pegasus-method
+   do {
+    // Calculate slope of secant and t value for which it is 0.
+    s12 = (f2-f1)/(x2-x1);
+    x3 = x2 - f2/s12;
 
-		// Calculate function value at x3
-		f3 = studentT(size,x3)-cumProb;
-		if (Math.abs(f3)<1e-8) { // This criteria needs to be very tight!
-		   // We found a perfect value -> return
-		   return x3;
-		}
+    // Calculate function value at x3
+    f3 = studentT(size,x3)-cumProb;
+    if (Math.abs(f3)<1e-8) { // This criteria needs to be very tight!
+       // We found a perfect value -> return
+       return x3;
+    }
 
-		if (f3*f2<0) {
-		   x1=x2; f1=f2;
-		   x2=x3; f2=f3;
-		} else {
-		   g = f2/(f2+f3);
-		   f1=g*f1;
-		   x2=x3; f2=f3;
-		}
-	 } while(Math.abs(x2-x1)>0.001);
+    if (f3*f2<0) {
+       x1=x2; f1=f2;
+       x2=x3; f2=f3;
+    } else {
+       g = f2/(f2+f3);
+       f1=g*f1;
+       x2=x3; f2=f3;
+    }
+   } while(Math.abs(x2-x1)>0.001);
 
-	 if (Math.abs(f2)<=Math.abs(f1)) {
-		return x2;
-	 } else {
-		return x1;
-	 }
+   if (Math.abs(f2)<=Math.abs(f1)) {
+    return x2;
+   } else {
+    return x1;
+   }
 }
 }
Index: matrix/src/main/java/org/apache/mahout/jet/stat/Descriptive.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/jet/stat/Descriptive.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/jet/stat/Descriptive.java	(working copy)
@@ -13,9 +13,6 @@
 /**
  * Basic descriptive statistics.
  *
- * @author peter.gedeck@pharma.Novartis.com
- * @author wolfgang.hoschek@cern.ch
- * @version 0.91, 08-Dec-99
  */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
@@ -30,24 +27,24 @@
  * Returns the auto-correlation of a data sequence.
  */
 public static double autoCorrelation(DoubleArrayList data, int lag, double mean, double variance) {
-	int N = data.size();
-	if (lag >= N) throw new IllegalArgumentException("Lag is too large");
+  int N = data.size();
+  if (lag >= N) throw new IllegalArgumentException("Lag is too large");
 
-	double[] elements = data.elements();
-	double run = 0;
-	for( int i=lag; i<N; ++i)
-		run += (elements[i]-mean)*(elements[i-lag]-mean);
+  double[] elements = data.elements();
+  double run = 0;
+  for( int i=lag; i<N; ++i)
+    run += (elements[i]-mean)*(elements[i-lag]-mean);
   
-	return (run/(N-lag)) / variance;
+  return (run/(N-lag)) / variance;
 }
 /**
  * Checks if the given range is within the contained array's bounds.
  * @throws IndexOutOfBoundsException if <tt>to!=from-1 || from&lt;0 || from&gt;to || to&gt;=size()</tt>.
  */
 protected static void checkRangeFromTo(int from, int to, int theSize) {
-	if (to==from-1) return;
-	if (from<0 || from>to || to>=theSize)
-		throw new IndexOutOfBoundsException("from: "+from+", to: "+to+", size="+theSize);
+  if (to==from-1) return;
+  if (from<0 || from>to || to>=theSize)
+    throw new IndexOutOfBoundsException("from: "+from+", to: "+to+", size="+theSize);
 }
 /**
  * Returns the correlation of two data sequences.
@@ -62,39 +59,39 @@
  * See the <A HREF="http://www.cquest.utoronto.ca/geog/ggr270y/notes/not05efg.html"> math definition</A>.
  */
 public static double covariance(DoubleArrayList data1, DoubleArrayList data2) {
-	int size = data1.size();
-	if (size != data2.size() || size == 0) throw new IllegalArgumentException();
-	double[] elements1 = data1.elements();
-	double[] elements2 = data2.elements();
-	
-	double sumx=elements1[0], sumy=elements2[0], Sxy=0;
-	for (int i=1; i<size; ++i) {
-		double x = elements1[i];
-		double y = elements2[i];
-		sumx += x;
-		Sxy += (x - sumx/(i+1))*(y - sumy/i);
-		sumy += y;
-		// Exercise for the reader: Why does this give us the right answer?
-	}
-	return Sxy/(size-1);
+  int size = data1.size();
+  if (size != data2.size() || size == 0) throw new IllegalArgumentException();
+  double[] elements1 = data1.elements();
+  double[] elements2 = data2.elements();
+  
+  double sumx=elements1[0], sumy=elements2[0], Sxy=0;
+  for (int i=1; i<size; ++i) {
+    double x = elements1[i];
+    double y = elements2[i];
+    sumx += x;
+    Sxy += (x - sumx/(i+1))*(y - sumy/i);
+    sumy += y;
+    // Exercise for the reader: Why does this give us the right answer?
+  }
+  return Sxy/(size-1);
 }
 
 /* 
  * Both covariance versions yield the same results but the one above is faster 
  */
 private static double covariance2(DoubleArrayList data1, DoubleArrayList data2) {
-	int size = data1.size();
-	double mean1 = Descriptive.mean(data1);
-	double mean2 = Descriptive.mean(data2);
-	double covariance = 0.0D;
-	for (int i = 0; i < size; i++) {
-		double x = data1.get(i);
-		double y = data2.get(i);
+  int size = data1.size();
+  double mean1 = Descriptive.mean(data1);
+  double mean2 = Descriptive.mean(data2);
+  double covariance = 0.0D;
+  for (int i = 0; i < size; i++) {
+    double x = data1.get(i);
+    double y = data2.get(i);
 
-		covariance += (x - mean1) * (y - mean2);
-	}
+    covariance += (x - mean1) * (y - mean2);
+  }
 
-	return covariance / (double) (size-1);
+  return covariance / (double) (size-1);
 }
 
 
@@ -102,20 +99,20 @@
  * Durbin-Watson computation.
  */
 public static double durbinWatson(DoubleArrayList data) {
-	int size = data.size();
-	if (size < 2) throw new IllegalArgumentException("data sequence must contain at least two values.");
+  int size = data.size();
+  if (size < 2) throw new IllegalArgumentException("data sequence must contain at least two values.");
 
-	double[] elements = data.elements();
-	double run = 0;
-	double run_sq = 0;
-	run_sq = elements[0] * elements[0];
-	for(int i=1; i<size; ++i) {
-		double x = elements[i] - elements[i-1];
-		run += x*x;
-		run_sq += elements[i] * elements[i];
-	}
+  double[] elements = data.elements();
+  double run = 0;
+  double run_sq = 0;
+  run_sq = elements[0] * elements[0];
+  for(int i=1; i<size; ++i) {
+    double x = elements[i] - elements[i-1];
+    run += x*x;
+    run_sq += elements[i] * elements[i];
+  }
 
-	return run / run_sq;
+  return run / run_sq;
 }
 /**
  * Computes the frequency (number of occurances, count) of each distinct value in the given sorted data.
@@ -134,24 +131,24 @@
  * @param frequencies      a list to be filled with the frequencies; can have any size; set this parameter to <tt>null</tt> to ignore it.
  */
 public static void frequencies(DoubleArrayList sortedData, DoubleArrayList distinctValues, IntArrayList frequencies) {
-	distinctValues.clear();
-	if (frequencies!=null) frequencies.clear();
+  distinctValues.clear();
+  if (frequencies!=null) frequencies.clear();
 
-	double[] sortedElements = sortedData.elements();
-	int size = sortedData.size();
-	int i=0;
-	
-	while (i<size) {
-		double element = sortedElements[i];
-		int cursor = i;
+  double[] sortedElements = sortedData.elements();
+  int size = sortedData.size();
+  int i=0;
+  
+  while (i<size) {
+    double element = sortedElements[i];
+    int cursor = i;
 
-		// determine run length (number of equal elements)
-		while (++i < size  &&  sortedElements[i]==element);
+    // determine run length (number of equal elements)
+    while (++i < size  &&  sortedElements[i]==element);
 
-		int runLength = i - cursor;
-		distinctValues.add(element);
-		if (frequencies!=null) frequencies.add(runLength);
-	}
+    int runLength = i - cursor;
+    distinctValues.add(element);
+    if (frequencies!=null) frequencies.add(runLength);
+  }
 }
 /**
  * Returns the geometric mean of a data sequence.
@@ -161,10 +158,10 @@
  * which is equivalent to <tt>Math.exp( Sum( Log(data[i]) ) / size)</tt>.
  */
 public static double geometricMean(int size, double sumOfLogarithms) {
-	return Math.exp(sumOfLogarithms/size);
-	
-	// this version would easily results in overflows
-	//return Math.pow(product, 1/size);
+  return Math.exp(sumOfLogarithms/size);
+  
+  // this version would easily results in overflows
+  //return Math.pow(product, 1/size);
 }
 /**
  * Returns the geometric mean of a data sequence.
@@ -175,7 +172,7 @@
  * <tt>geo = Math.exp( Sum( Log(data[i]) ) / data.size())</tt>.
  */
 public static double geometricMean(DoubleArrayList data) {
-	return geometricMean(data.size(), sumOfLogarithms(data,0,data.size()-1));
+  return geometricMean(data.size(), sumOfLogarithms(data,0,data.size()-1));
 }
 /**
  * Returns the harmonic mean of a data sequence.
@@ -184,7 +181,7 @@
  * @param sumOfInversions <tt>Sum( 1.0 / data[i])</tt>.
  */
 public static double harmonicMean(int size, double sumOfInversions) {
-	return size / sumOfInversions;
+  return size / sumOfInversions;
 }
 /**
  * Incrementally maintains and updates minimum, maximum, sum and sum of squares of a data sequence.
@@ -222,47 +219,47 @@
  * @return the updated values filled into the <tt>inOut</tt> array.
  */
 public static void incrementalUpdate(DoubleArrayList data, int from, int to, double[] inOut) {
-	checkRangeFromTo(from,to,data.size());
+  checkRangeFromTo(from,to,data.size());
 
-	// read current values
-	double min = inOut[0];
-	double max = inOut[1];
-	double sum = inOut[2];
-	double sumSquares = inOut[3];
+  // read current values
+  double min = inOut[0];
+  double max = inOut[1];
+  double sum = inOut[2];
+  double sumSquares = inOut[3];
 
-	double[] elements = data.elements();
+  double[] elements = data.elements();
 
-	for (; from<=to; from++) {
-		double element = elements[from];
-		sum += element;
-		sumSquares += element*element;
-		if (element < min) min = element;
-		if (element > max) max = element;
+  for (; from<=to; from++) {
+    double element = elements[from];
+    sum += element;
+    sumSquares += element*element;
+    if (element < min) min = element;
+    if (element > max) max = element;
 
-		/*
-		double oldDeviation = element - mean;
-		mean += oldDeviation / (N+1);
-		sumSquaredDeviations += (element-mean)*oldDeviation; // cool, huh?
-		*/
-		
-		/*
-		double oldMean = mean;
-		mean += (element - mean)/(N+1);
-		if (N > 0) {
-			sumSquaredDeviations += (element-mean)*(element-oldMean); // cool, huh?
-		}
-		*/
-		
-	}
+    /*
+    double oldDeviation = element - mean;
+    mean += oldDeviation / (N+1);
+    sumSquaredDeviations += (element-mean)*oldDeviation; // cool, huh?
+    */
+    
+    /*
+    double oldMean = mean;
+    mean += (element - mean)/(N+1);
+    if (N > 0) {
+      sumSquaredDeviations += (element-mean)*(element-oldMean); // cool, huh?
+    }
+    */
+    
+  }
 
-	// store new values
-	inOut[0] = min;
-	inOut[1] = max;
-	inOut[2] = sum;
-	inOut[3] = sumSquares;
+  // store new values
+  inOut[0] = min;
+  inOut[1] = max;
+  inOut[2] = sum;
+  inOut[3] = sumSquares;
 
-	// At this point of return the following postcondition holds:
-	// data.size()-from elements have been consumed by this call.
+  // At this point of return the following postcondition holds:
+  // data.size()-from elements have been consumed by this call.
 }
 /**
  * Incrementally maintains and updates various sums of powers of the form <tt>Sum(data[i]<sup>k</sup>)</tt>.
@@ -302,94 +299,94 @@
  * @return the updated values filled into the <tt>sumOfPowers</tt> array.
  */
 public static void incrementalUpdateSumsOfPowers(DoubleArrayList data, int from, int to, int fromSumIndex, int toSumIndex, double[] sumOfPowers) {
-	int size = data.size();
-	int lastIndex = toSumIndex - fromSumIndex;
-	if (from > size || lastIndex+1 > sumOfPowers.length) throw new IllegalArgumentException();
+  int size = data.size();
+  int lastIndex = toSumIndex - fromSumIndex;
+  if (from > size || lastIndex+1 > sumOfPowers.length) throw new IllegalArgumentException();
 
-	// optimized for common parameters
-	if (fromSumIndex==1) { // handle quicker
-		if (toSumIndex==2) { 
-			double[] elements = data.elements();
-			double sum = sumOfPowers[0];
-			double sumSquares = sumOfPowers[1];
-			for (int i=from-1; ++i<=to; ) {
-				double element = elements[i];
-				sum += element;
-				sumSquares += element*element;
-				//if (element < min) min = element;
-				//else if (element > max) max = element;
-			}
-			sumOfPowers[0] += sum;
-			sumOfPowers[1] += sumSquares;
-			return;
-		}
-		else if (toSumIndex==3) { 
-			double[] elements = data.elements();
-			double sum = sumOfPowers[0];
-			double sumSquares = sumOfPowers[1];
-			double sum_xxx = sumOfPowers[2];
-			for (int i=from-1; ++i<=to; ) {
-				double element = elements[i];
-				sum += element;
-				sumSquares += element*element;
-				sum_xxx += element*element*element;
-				//if (element < min) min = element;
-				//else if (element > max) max = element;
-			}
-			sumOfPowers[0] += sum;
-			sumOfPowers[1] += sumSquares;
-			sumOfPowers[2] += sum_xxx;
-			return;
-		}
-		else if (toSumIndex==4) { // handle quicker
-			double[] elements = data.elements();
-			double sum = sumOfPowers[0];
-			double sumSquares = sumOfPowers[1];
-			double sum_xxx = sumOfPowers[2];
-			double sum_xxxx = sumOfPowers[3];
-			for (int i=from-1; ++i<=to; ) {
-				double element = elements[i];
-				sum += element;
-				sumSquares += element*element;
-				sum_xxx += element*element*element;
-				sum_xxxx += element*element*element*element;
-				//if (element < min) min = element;
-				//else if (element > max) max = element;
-			}
-			sumOfPowers[0] += sum;
-			sumOfPowers[1] += sumSquares;
-			sumOfPowers[2] += sum_xxx;
-			sumOfPowers[3] += sum_xxxx;
-			return;
-		}
-	}
+  // optimized for common parameters
+  if (fromSumIndex==1) { // handle quicker
+    if (toSumIndex==2) { 
+      double[] elements = data.elements();
+      double sum = sumOfPowers[0];
+      double sumSquares = sumOfPowers[1];
+      for (int i=from-1; ++i<=to; ) {
+        double element = elements[i];
+        sum += element;
+        sumSquares += element*element;
+        //if (element < min) min = element;
+        //else if (element > max) max = element;
+      }
+      sumOfPowers[0] += sum;
+      sumOfPowers[1] += sumSquares;
+      return;
+    }
+    else if (toSumIndex==3) { 
+      double[] elements = data.elements();
+      double sum = sumOfPowers[0];
+      double sumSquares = sumOfPowers[1];
+      double sum_xxx = sumOfPowers[2];
+      for (int i=from-1; ++i<=to; ) {
+        double element = elements[i];
+        sum += element;
+        sumSquares += element*element;
+        sum_xxx += element*element*element;
+        //if (element < min) min = element;
+        //else if (element > max) max = element;
+      }
+      sumOfPowers[0] += sum;
+      sumOfPowers[1] += sumSquares;
+      sumOfPowers[2] += sum_xxx;
+      return;
+    }
+    else if (toSumIndex==4) { // handle quicker
+      double[] elements = data.elements();
+      double sum = sumOfPowers[0];
+      double sumSquares = sumOfPowers[1];
+      double sum_xxx = sumOfPowers[2];
+      double sum_xxxx = sumOfPowers[3];
+      for (int i=from-1; ++i<=to; ) {
+        double element = elements[i];
+        sum += element;
+        sumSquares += element*element;
+        sum_xxx += element*element*element;
+        sum_xxxx += element*element*element*element;
+        //if (element < min) min = element;
+        //else if (element > max) max = element;
+      }
+      sumOfPowers[0] += sum;
+      sumOfPowers[1] += sumSquares;
+      sumOfPowers[2] += sum_xxx;
+      sumOfPowers[3] += sum_xxxx;
+      return;
+    }
+  }
 
-	if (fromSumIndex==toSumIndex || (fromSumIndex >= -1 && toSumIndex <= 5)) { // handle quicker
-		for (int i=fromSumIndex; i<=toSumIndex; i++) {
-			sumOfPowers[i-fromSumIndex] += sumOfPowerDeviations(data,i,0.0,from,to);
-		}
-		return;
-	}
-	
+  if (fromSumIndex==toSumIndex || (fromSumIndex >= -1 && toSumIndex <= 5)) { // handle quicker
+    for (int i=fromSumIndex; i<=toSumIndex; i++) {
+      sumOfPowers[i-fromSumIndex] += sumOfPowerDeviations(data,i,0.0,from,to);
+    }
+    return;
+  }
+  
 
-	// now the most general case:
-	// optimized for maximum speed, but still not quite quick
-	double[] elements = data.elements();
+  // now the most general case:
+  // optimized for maximum speed, but still not quite quick
+  double[] elements = data.elements();
 
-	for (int i=from-1; ++i<=to; ) {
-		double element = elements[i];
-		double pow = Math.pow(element,fromSumIndex);
+  for (int i=from-1; ++i<=to; ) {
+    double element = elements[i];
+    double pow = Math.pow(element,fromSumIndex);
 
-		int j=0;
-		for (int m=lastIndex; --m >= 0; ) {
-			sumOfPowers[j++] += pow;
-			pow *= element;
-		}
-		sumOfPowers[j] += pow;
-	}
+    int j=0;
+    for (int m=lastIndex; --m >= 0; ) {
+      sumOfPowers[j++] += pow;
+      pow *= element;
+    }
+    sumOfPowers[j] += pow;
+  }
 
-	// At this point of return the following postcondition holds:
-	// data.size()-fromIndex elements have been consumed by this call.
+  // At this point of return the following postcondition holds:
+  // data.size()-fromIndex elements have been consumed by this call.
 }
 /**
  * Incrementally maintains and updates sum and sum of squares of a <i>weighted</i> data sequence.
@@ -425,32 +422,32 @@
  * @return the updated values filled into the <tt>inOut</tt> array.
  */
 public static void incrementalWeightedUpdate(DoubleArrayList data, DoubleArrayList weights, int from, int to, double[] inOut) {
-	int dataSize = data.size();
-	checkRangeFromTo(from,to,dataSize);
-	if (dataSize != weights.size()) throw new IllegalArgumentException("from="+from+", to="+to+", data.size()="+dataSize+", weights.size()="+weights.size());
+  int dataSize = data.size();
+  checkRangeFromTo(from,to,dataSize);
+  if (dataSize != weights.size()) throw new IllegalArgumentException("from="+from+", to="+to+", data.size()="+dataSize+", weights.size()="+weights.size());
 
-	// read current values
-	double sum = inOut[0];
-	double sumOfSquares = inOut[1];
+  // read current values
+  double sum = inOut[0];
+  double sumOfSquares = inOut[1];
 
-	double[] elements = data.elements();
-	double[] w = weights.elements();
-	
-	for (int i=from-1; ++i<=to; ) {
-		double element = elements[i];
-		double weight = w[i];
-		double prod = element*weight;
-		
-		sum += prod;
-		sumOfSquares += element * prod;
-	}
+  double[] elements = data.elements();
+  double[] w = weights.elements();
+  
+  for (int i=from-1; ++i<=to; ) {
+    double element = elements[i];
+    double weight = w[i];
+    double prod = element*weight;
+    
+    sum += prod;
+    sumOfSquares += element * prod;
+  }
 
-	// store new values
-	inOut[0] = sum;
-	inOut[1] = sumOfSquares;
+  // store new values
+  inOut[0] = sum;
+  inOut[1] = sumOfSquares;
 
-	// At this point of return the following postcondition holds:
-	// data.size()-from elements have been consumed by this call.
+  // At this point of return the following postcondition holds:
+  // data.size()-from elements have been consumed by this call.
 }
 /**
  * Returns the kurtosis (aka excess) of a data sequence.
@@ -458,67 +455,67 @@
  * @param standardDeviation the standardDeviation.
  */
 public static double kurtosis(double moment4, double standardDeviation) {
-	return -3 + moment4 / (standardDeviation * standardDeviation * standardDeviation * standardDeviation);
+  return -3 + moment4 / (standardDeviation * standardDeviation * standardDeviation * standardDeviation);
 }
 /**
  * Returns the kurtosis (aka excess) of a data sequence, which is <tt>-3 + moment(data,4,mean) / standardDeviation<sup>4</sup></tt>.
  */
 public static double kurtosis(DoubleArrayList data, double mean, double standardDeviation) {
-	return kurtosis(moment(data,4,mean), standardDeviation);
+  return kurtosis(moment(data,4,mean), standardDeviation);
 }
 /**
  * Returns the lag-1 autocorrelation of a dataset; 
  * Note that this method has semantics different from <tt>autoCorrelation(..., 1)</tt>;
  */
 public static double lag1(DoubleArrayList data, double mean) {
-	int size = data.size();
-	double[] elements = data.elements();
-	double r1 ;
-	double q = 0 ;
-	double v = (elements[0] - mean) * (elements[0] - mean) ;
+  int size = data.size();
+  double[] elements = data.elements();
+  double r1 ;
+  double q = 0 ;
+  double v = (elements[0] - mean) * (elements[0] - mean) ;
 
-	for (int i = 1; i < size ; i++) {
-		double delta0 = (elements[i-1] - mean);
-		double delta1 = (elements[i] - mean);
-		q += (delta0 * delta1 - q)/(i + 1);
-		v += (delta1 * delta1 - v)/(i + 1);
-	}
+  for (int i = 1; i < size ; i++) {
+    double delta0 = (elements[i-1] - mean);
+    double delta1 = (elements[i] - mean);
+    q += (delta0 * delta1 - q)/(i + 1);
+    v += (delta1 * delta1 - v)/(i + 1);
+  }
 
-	r1 = q / v ;
-	return r1;
+  r1 = q / v ;
+  return r1;
 }
 /**
  * Returns the largest member of a data sequence.
  */
 public static double max(DoubleArrayList data) {
-	int size = data.size();
-	if (size==0) throw new IllegalArgumentException();
-	
-	double[] elements = data.elements();
-	double max = elements[size-1];
-	for (int i = size-1; --i >= 0;) {
-		if (elements[i] > max) max = elements[i];
-	}
+  int size = data.size();
+  if (size==0) throw new IllegalArgumentException();
+  
+  double[] elements = data.elements();
+  double max = elements[size-1];
+  for (int i = size-1; --i >= 0;) {
+    if (elements[i] > max) max = elements[i];
+  }
 
-	return max;
+  return max;
 }
 /**
  * Returns the arithmetic mean of a data sequence; 
  * That is <tt>Sum( data[i] ) / data.size()</tt>.
  */
 public static double mean(DoubleArrayList data) {
-	return sum(data) / data.size();
+  return sum(data) / data.size();
 }
 /**
  * Returns the mean deviation of a dataset.
  * That is <tt>Sum (Math.abs(data[i]-mean)) / data.size())</tt>.
  */
 public static double meanDeviation(DoubleArrayList data, double mean) {
-	double[] elements = data.elements();
-	int size = data.size();
-	double sum=0;
-	for (int i=size; --i >= 0;) sum += Math.abs(elements[i]-mean);
-	return sum/size;
+  double[] elements = data.elements();
+  int size = data.size();
+  double sum=0;
+  for (int i=size; --i >= 0;) sum += Math.abs(elements[i]-mean);
+  return sum/size;
 }
 /**
  * Returns the median of a sorted data sequence.
@@ -526,73 +523,73 @@
  * @param sortedData the data sequence; <b>must be sorted ascending</b>.
  */
 public static double median(DoubleArrayList sortedData) {
-	return quantile(sortedData, 0.5);
-	/*
-	double[] sortedElements = sortedData.elements();
-	int n = sortedData.size();
-	int lhs = (n - 1) / 2 ;
-	int rhs = n / 2 ;
+  return quantile(sortedData, 0.5);
+  /*
+  double[] sortedElements = sortedData.elements();
+  int n = sortedData.size();
+  int lhs = (n - 1) / 2 ;
+  int rhs = n / 2 ;
   
-	if (n == 0) return 0.0 ;
+  if (n == 0) return 0.0 ;
 
-	double median;
-	if (lhs == rhs) median = sortedElements[lhs] ;
-	else median = (sortedElements[lhs] + sortedElements[rhs])/2.0 ;
+  double median;
+  if (lhs == rhs) median = sortedElements[lhs] ;
+  else median = (sortedElements[lhs] + sortedElements[rhs])/2.0 ;
 
-	return median;
-	*/
+  return median;
+  */
 }
 /**
  * Returns the smallest member of a data sequence.
  */
 public static double min(DoubleArrayList data) {
-	int size = data.size();
-	if (size==0) throw new IllegalArgumentException();
-	
-	double[] elements = data.elements();
-	double min = elements[size-1];
-	for (int i = size-1; --i >= 0;) {
-		if (elements[i] < min) min = elements[i];
-	}
+  int size = data.size();
+  if (size==0) throw new IllegalArgumentException();
+  
+  double[] elements = data.elements();
+  double min = elements[size-1];
+  for (int i = size-1; --i >= 0;) {
+    if (elements[i] < min) min = elements[i];
+  }
 
-	return min;
+  return min;
 }
 /**
  * Returns the moment of <tt>k</tt>-th order with constant <tt>c</tt> of a data sequence,
  * which is <tt>Sum( (data[i]-c)<sup>k</sup> ) / data.size()</tt>.
  *
  * @param sumOfPowers <tt>sumOfPowers[m] == Sum( data[i]<sup>m</sup>) )</tt> for <tt>m = 0,1,..,k</tt> as returned by method {@link #incrementalUpdateSumsOfPowers(DoubleArrayList,int,int,int,int,double[])}.
- *			In particular there must hold <tt>sumOfPowers.length == k+1</tt>.
+ *      In particular there must hold <tt>sumOfPowers.length == k+1</tt>.
  * @param size the number of elements of the data sequence.
  */
 public static double moment(int k, double c, int size, double[] sumOfPowers) {
-	double sum=0;
-	int sign = 1;
-	for (int i=0; i<=k; i++) {
-		double y;
-		if (i==0) y = 1;
-		else if (i==1) y = c;
-		else if (i==2) y = c*c;
-		else if (i==3) y = c*c*c;
-		else y = Math.pow(c, i);
-		//sum += sign * 
-		sum += sign * org.apache.mahout.jet.math.Arithmetic.binomial(k,i) * y * sumOfPowers[k-i];
-		sign = -sign;
-	}
-	/*
-	for (int i=0; i<=k; i++) {
-		sum += sign * org.apache.mahout.jet.math.Arithmetic.binomial(k,i) * Math.pow(c, i) * sumOfPowers[k-i];
-		sign = -sign;
-	}
-	*/
-	return sum/size;
+  double sum=0;
+  int sign = 1;
+  for (int i=0; i<=k; i++) {
+    double y;
+    if (i==0) y = 1;
+    else if (i==1) y = c;
+    else if (i==2) y = c*c;
+    else if (i==3) y = c*c*c;
+    else y = Math.pow(c, i);
+    //sum += sign * 
+    sum += sign * org.apache.mahout.jet.math.Arithmetic.binomial(k,i) * y * sumOfPowers[k-i];
+    sign = -sign;
+  }
+  /*
+  for (int i=0; i<=k; i++) {
+    sum += sign * org.apache.mahout.jet.math.Arithmetic.binomial(k,i) * Math.pow(c, i) * sumOfPowers[k-i];
+    sign = -sign;
+  }
+  */
+  return sum/size;
 }
 /**
  * Returns the moment of <tt>k</tt>-th order with constant <tt>c</tt> of a data sequence,
  * which is <tt>Sum( (data[i]-c)<sup>k</sup> ) / data.size()</tt>.
  */
 public static double moment(DoubleArrayList data, int k, double c) {
-	return sumOfPowerDeviations(data,k,c) / data.size();
+  return sumOfPowerDeviations(data,k,c) / data.size();
 }
 /**
  * Returns the pooled mean of two data sequences.
@@ -604,7 +601,7 @@
  * @param mean2 the mean of data sequence 2.
  */
 public static double pooledMean(int size1, double mean1, int size2, double mean2) {
-	return (size1 * mean1 + size2 * mean2) / (size1 + size2);
+  return (size1 * mean1 + size2 * mean2) / (size1 + size2);
 }
 /**
  * Returns the pooled variance of two data sequences.
@@ -616,7 +613,7 @@
  * @param variance2 the variance of data sequence 2.
  */
 public static double pooledVariance(int size1, double variance1, int size2, double variance2) {
-	return (size1 * variance1 + size2 * variance2) / (size1 + size2);
+  return (size1 * variance1 + size2 * variance2) / (size1 + size2);
 }
 /**
  * Returns the product, which is <tt>Prod( data[i] )</tt>.
@@ -625,7 +622,7 @@
  * <tt>prod = pow( exp( Sum( Log(x[i]) ) / size(), size())</tt>.
  */
 public static double product(int size, double sumOfLogarithms) {
-	return Math.pow(Math.exp(sumOfLogarithms/size), size);
+  return Math.pow(Math.exp(sumOfLogarithms/size), size);
 }
 /**
  * Returns the product of a data sequence, which is <tt>Prod( data[i] )</tt>.
@@ -633,13 +630,13 @@
  * Note that you may easily get numeric overflows.
  */
 public static double product(DoubleArrayList data) {
-	int size = data.size();
-	double[] elements = data.elements();
-	
-	double product = 1;
-	for (int i=size; --i >= 0;) product *= elements[i];
-	
-	return product;
+  int size = data.size();
+  double[] elements = data.elements();
+  
+  double product = 1;
+  for (int i=size; --i >= 0;) product *= elements[i];
+  
+  return product;
 }
 /**
  * Returns the <tt>phi-</tt>quantile; that is, an element <tt>elem</tt> for which holds that <tt>phi</tt> percent of data elements are less than <tt>elem</tt>.
@@ -648,24 +645,24 @@
  * @param phi the percentage; must satisfy <tt>0 &lt;= phi &lt;= 1</tt>.
  */
 public static double quantile(DoubleArrayList sortedData, double phi) {
-	double[] sortedElements = sortedData.elements();
-	int n = sortedData.size();
-	
-	double index = phi * (n - 1) ;
-	int lhs = (int)index ;
-	double delta = index - lhs ;
-	double result;
+  double[] sortedElements = sortedData.elements();
+  int n = sortedData.size();
+  
+  double index = phi * (n - 1) ;
+  int lhs = (int)index ;
+  double delta = index - lhs ;
+  double result;
 
-	if (n == 0) return 0.0 ;
+  if (n == 0) return 0.0 ;
 
-	if (lhs == n - 1) {
-		result = sortedElements[lhs] ;
-	}
-	else {
-		result = (1 - delta) * sortedElements[lhs] + delta * sortedElements[lhs + 1] ;
-	}
+  if (lhs == n - 1) {
+    result = sortedElements[lhs] ;
+  }
+  else {
+    result = (1 - delta) * sortedElements[lhs] + delta * sortedElements[lhs + 1] ;
+  }
 
-	return result ;
+  return result ;
 }
 /**
  * Returns how many percent of the elements contained in the receiver are <tt>&lt;= element</tt>.
@@ -676,7 +673,7 @@
  * @return the percentage <tt>phi</tt> of elements <tt>&lt;= element</tt> (<tt>0.0 &lt;= phi &lt;= 1.0)</tt>.
  */
 public static double quantileInverse(DoubleArrayList sortedList, double element) {
-	return rankInterpolated(sortedList,element) / sortedList.size();
+  return rankInterpolated(sortedList,element) / sortedList.size();
 }
 /**
  * Returns the quantiles of the specified percentages.
@@ -687,14 +684,14 @@
  * @return the quantiles.
  */
 public static DoubleArrayList quantiles(DoubleArrayList sortedData, DoubleArrayList percentages) {
-	int s = percentages.size();
-	DoubleArrayList quantiles = new DoubleArrayList(s);
-	
-	for (int i=0; i < s; i++) {
-		quantiles.add(quantile(sortedData, percentages.get(i)));
-	}
-	
-	return quantiles;
+  int s = percentages.size();
+  DoubleArrayList quantiles = new DoubleArrayList(s);
+  
+  for (int i=0; i < s; i++) {
+    quantiles.add(quantile(sortedData, percentages.get(i)));
+  }
+  
+  return quantiles;
 }
 /**
  * Returns the linearly interpolated number of elements in a list less or equal to a given element.
@@ -708,23 +705,23 @@
  * @return the rank of the element.
  */
 public static double rankInterpolated(DoubleArrayList sortedList, double element) {
-	int index = sortedList.binarySearch(element);
-	if (index >= 0) { // element found
-		// skip to the right over multiple occurances of element.
-		int to = index+1;
-		int s = sortedList.size();
-		while (to<s && sortedList.get(to)==element) to++;
-		return to;
-	}
-	
-	// element not found
-	int insertionPoint = -index-1;
-	if (insertionPoint == 0 || insertionPoint==sortedList.size()) return insertionPoint;
+  int index = sortedList.binarySearch(element);
+  if (index >= 0) { // element found
+    // skip to the right over multiple occurances of element.
+    int to = index+1;
+    int s = sortedList.size();
+    while (to<s && sortedList.get(to)==element) to++;
+    return to;
+  }
+  
+  // element not found
+  int insertionPoint = -index-1;
+  if (insertionPoint == 0 || insertionPoint==sortedList.size()) return insertionPoint;
 
-	double from = sortedList.get(insertionPoint-1);
-	double to = sortedList.get(insertionPoint);
-	double delta = (element-from) / (to-from); //linear interpolation
-	return insertionPoint + delta;
+  double from = sortedList.get(insertionPoint-1);
+  double to = sortedList.get(insertionPoint);
+  double delta = (element-from) / (to-from); //linear interpolation
+  return insertionPoint + delta;
 }
 /**
  * Returns the RMS (Root-Mean-Square) of a data sequence.
@@ -736,7 +733,7 @@
  * @param size the number of elements in the data sequence.
  */
 public static double rms(int size, double sumOfSquares) {
-	return Math.sqrt(sumOfSquares/size);
+  return Math.sqrt(sumOfSquares/size);
 }
 /**
  * Returns the sample kurtosis (aka excess) of a data sequence.
@@ -750,17 +747,17 @@
  * @param sampleVariance the <b>sample variance</b>.
  */
 public static double sampleKurtosis(int size, double moment4, double sampleVariance) {
-	 int    n=size;
-	 double s2=sampleVariance; // (y-ymean)^2/(n-1)
-	 double m4 = moment4*n;    // (y-ymean)^4
-	 return m4*n*(n+1) / ((n-1)*(n-2)*(n-3)*s2*s2)
-		  - 3.0*(n-1)*(n-1)/((n-2)*(n-3));
+   int    n=size;
+   double s2=sampleVariance; // (y-ymean)^2/(n-1)
+   double m4 = moment4*n;    // (y-ymean)^4
+   return m4*n*(n+1) / ((n-1)*(n-2)*(n-3)*s2*s2)
+      - 3.0*(n-1)*(n-1)/((n-2)*(n-3));
 }
 /**
  * Returns the sample kurtosis (aka excess) of a data sequence.
  */
 public static double sampleKurtosis(DoubleArrayList data, double mean, double sampleVariance) {
-	 return sampleKurtosis(data.size(),moment(data,4,mean), sampleVariance);
+   return sampleKurtosis(data.size(),moment(data,4,mean), sampleVariance);
 }
 /**
  * Return the standard error of the sample kurtosis.
@@ -772,8 +769,8 @@
  * @param size the number of elements of the data sequence.
  */
 public static double sampleKurtosisStandardError(int size) {
-	 int n=size;
-	 return Math.sqrt( 24.0*n*(n-1)*(n-1)/((n-3)*(n-2)*(n+3)*(n+5)) );
+   int n=size;
+   return Math.sqrt( 24.0*n*(n-1)*(n-1)/((n-3)*(n-2)*(n+3)*(n+5)) );
 }
 /**
  * Returns the sample skew of a data sequence.
@@ -787,16 +784,16 @@
  * @param sampleVariance the <b>sample variance</b>.
  */
 public static double sampleSkew(int size, double moment3, double sampleVariance) {
-	 int    n=size;
-	 double s=Math.sqrt(sampleVariance); // sqrt( (y-ymean)^2/(n-1) )
-	 double m3 = moment3*n;    // (y-ymean)^3
-	 return n*m3 / ((n-1)*(n-2)*s*s*s);
+   int    n=size;
+   double s=Math.sqrt(sampleVariance); // sqrt( (y-ymean)^2/(n-1) )
+   double m3 = moment3*n;    // (y-ymean)^3
+   return n*m3 / ((n-1)*(n-2)*s*s*s);
 }
 /**
  * Returns the sample skew of a data sequence.
  */
 public static double sampleSkew(DoubleArrayList data, double mean, double sampleVariance) {
-	 return sampleSkew(data.size(), moment(data,3,mean), sampleVariance);
+   return sampleSkew(data.size(), moment(data,3,mean), sampleVariance);
 }
 /**
  * Return the standard error of the sample skew.
@@ -808,8 +805,8 @@
  * @param size the number of elements of the data sequence.
  */
 public static double sampleSkewStandardError(int size) {
-	 int n=size;
-	 return Math.sqrt( 6.0*n*(n-1)/((n-2)*(n+1)*(n+3)) );
+   int n=size;
+   return Math.sqrt( 6.0*n*(n-1)/((n-2)*(n+1)*(n+3)) );
 }
 /**
  * Returns the sample standard deviation.
@@ -822,19 +819,19 @@
  * @param sampleVariance the <b>sample variance</b>.
  */
 public static double sampleStandardDeviation(int size, double sampleVariance) {
-	 double s, Cn;
-	 int    n=size;
+   double s, Cn;
+   int    n=size;
 
-	 // The standard deviation calculated as the sqrt of the variance underestimates
-	 // the unbiased standard deviation.
-	 s=Math.sqrt(sampleVariance);
-	 // It needs to be multiplied by this correction factor.
-	 if (n>30) {
-		Cn = 1 + 1.0/(4*(n-1)); // Cn = 1+1/(4*(n-1));
-	 } else {
-		Cn = Math.sqrt((n-1)*0.5)*Gamma.gamma((n-1)*0.5)/Gamma.gamma(n*0.5);
-	 }
-	 return Cn*s;
+   // The standard deviation calculated as the sqrt of the variance underestimates
+   // the unbiased standard deviation.
+   s=Math.sqrt(sampleVariance);
+   // It needs to be multiplied by this correction factor.
+   if (n>30) {
+    Cn = 1 + 1.0/(4*(n-1)); // Cn = 1+1/(4*(n-1));
+   } else {
+    Cn = Math.sqrt((n-1)*0.5)*Gamma.gamma((n-1)*0.5)/Gamma.gamma(n*0.5);
+   }
+   return Cn*s;
 }
 /**
  * Returns the sample variance of a data sequence.
@@ -845,24 +842,24 @@
  * @param sumOfSquares <tt>== Sum( data[i]*data[i] )</tt>.
  */
 public static double sampleVariance(int size, double sum, double sumOfSquares) {
-	double mean = sum / size;
-	return (sumOfSquares - mean*sum) / (size - 1);
+  double mean = sum / size;
+  return (sumOfSquares - mean*sum) / (size - 1);
 }
 /**
  * Returns the sample variance of a data sequence.
  * That is <tt>Sum ( (data[i]-mean)^2 ) / (data.size()-1)</tt>.
  */
 public static double sampleVariance(DoubleArrayList data, double mean) {
-	double[] elements = data.elements();
-	int size = data.size();	
-	double sum = 0 ;
-	// find the sum of the squares 
-	for (int i = size; --i >= 0; ) {
-		double delta = elements[i] - mean;
-		sum += delta * delta;
-	}
+  double[] elements = data.elements();
+  int size = data.size();  
+  double sum = 0 ;
+  // find the sum of the squares 
+  for (int i = size; --i >= 0; ) {
+    double delta = elements[i] - mean;
+    sum += delta * delta;
+  }
 
-	return sum / (size-1);
+  return sum / (size-1);
 }
 /**
  * Returns the sample weighted variance of a data sequence.
@@ -873,7 +870,7 @@
  * @param sumOfSquaredProducts <tt>== Sum( data[i] * data[i] * weights[i] )</tt>.
  */
 public static double sampleWeightedVariance(double sumOfWeights, double sumOfProducts, double sumOfSquaredProducts) {
-	return (sumOfSquaredProducts  -  sumOfProducts * sumOfProducts / sumOfWeights) / (sumOfWeights - 1);
+  return (sumOfSquaredProducts  -  sumOfProducts * sumOfProducts / sumOfWeights) / (sumOfWeights - 1);
 }
 /**
  * Returns the skew of a data sequence.
@@ -881,13 +878,13 @@
  * @param standardDeviation the standardDeviation.
  */
 public static double skew(double moment3, double standardDeviation) {
-	return moment3 / (standardDeviation * standardDeviation * standardDeviation);
+  return moment3 / (standardDeviation * standardDeviation * standardDeviation);
 }
 /**
  * Returns the skew of a data sequence, which is <tt>moment(data,3,mean) / standardDeviation<sup>3</sup></tt>.
  */
 public static double skew(DoubleArrayList data, double mean, double standardDeviation) {
-	return skew(moment(data,3,mean), standardDeviation);
+  return skew(moment(data,3,mean), standardDeviation);
 }
 /**
  * Splits (partitions) a list into sublists such that each sublist contains the elements with a given range.
@@ -906,47 +903,47 @@
  * Each sublist is returned sorted ascending.
  */
 public static DoubleArrayList[] split(DoubleArrayList sortedList, DoubleArrayList splitters) {
-	// assertion: data is sorted ascending.
-	// assertion: splitValues is sorted ascending.
-	int noOfBins = splitters.size() + 1;
-	
-	DoubleArrayList[] bins = new DoubleArrayList[noOfBins];
-	for (int i=noOfBins; --i >= 0;) bins[i] = new DoubleArrayList();
-	
-	int listSize = sortedList.size();
-	int nextStart = 0;
-	int i=0;
-	while (nextStart < listSize && i < noOfBins-1) {
-		double splitValue = splitters.get(i);
-		int index = sortedList.binarySearch(splitValue);
-		if (index < 0) { // splitValue not found
-			int insertionPosition = -index - 1;
-			bins[i].addAllOfFromTo(sortedList,nextStart,insertionPosition-1);
-			nextStart = insertionPosition;
-		}
-		else { // splitValue found
-			// For multiple identical elements ("runs"), binarySearch does not define which of all valid indexes is returned.
-			// Thus, skip over to the first element of a run.
-			do {
-				index--;
-			} while (index >= 0 && sortedList.get(index) == splitValue);
-			
-			bins[i].addAllOfFromTo(sortedList,nextStart,index);
-			nextStart = index + 1;
-		}
-		i++;
-	}
+  // assertion: data is sorted ascending.
+  // assertion: splitValues is sorted ascending.
+  int noOfBins = splitters.size() + 1;
+  
+  DoubleArrayList[] bins = new DoubleArrayList[noOfBins];
+  for (int i=noOfBins; --i >= 0;) bins[i] = new DoubleArrayList();
+  
+  int listSize = sortedList.size();
+  int nextStart = 0;
+  int i=0;
+  while (nextStart < listSize && i < noOfBins-1) {
+    double splitValue = splitters.get(i);
+    int index = sortedList.binarySearch(splitValue);
+    if (index < 0) { // splitValue not found
+      int insertionPosition = -index - 1;
+      bins[i].addAllOfFromTo(sortedList,nextStart,insertionPosition-1);
+      nextStart = insertionPosition;
+    }
+    else { // splitValue found
+      // For multiple identical elements ("runs"), binarySearch does not define which of all valid indexes is returned.
+      // Thus, skip over to the first element of a run.
+      do {
+        index--;
+      } while (index >= 0 && sortedList.get(index) == splitValue);
+      
+      bins[i].addAllOfFromTo(sortedList,nextStart,index);
+      nextStart = index + 1;
+    }
+    i++;
+  }
 
-	// now fill the remainder
-	bins[noOfBins-1].addAllOfFromTo(sortedList,nextStart,sortedList.size()-1);
-	
-	return bins;
+  // now fill the remainder
+  bins[noOfBins-1].addAllOfFromTo(sortedList,nextStart,sortedList.size()-1);
+  
+  return bins;
 }
 /**
  * Returns the standard deviation from a variance.
  */
 public static double standardDeviation(double variance) {
-	return Math.sqrt(variance);
+  return Math.sqrt(variance);
 }
 /**
  * Returns the standard error of a data sequence.
@@ -956,22 +953,22 @@
  * @param variance the variance of the data sequence.
  */
 public static double standardError(int size, double variance) {
-	return Math.sqrt(variance/size);
+  return Math.sqrt(variance/size);
 }
 /**
  * Modifies a data sequence to be standardized.
  * Changes each element <tt>data[i]</tt> as follows: <tt>data[i] = (data[i]-mean)/standardDeviation</tt>.
  */
 public static void standardize(DoubleArrayList data, double mean, double standardDeviation) {
-	double[] elements = data.elements();
-	for (int i=data.size(); --i >= 0;) elements[i] = (elements[i]-mean)/standardDeviation;
+  double[] elements = data.elements();
+  for (int i=data.size(); --i >= 0;) elements[i] = (elements[i]-mean)/standardDeviation;
 }
 /**
  * Returns the sum of a data sequence.
  * That is <tt>Sum( data[i] )</tt>.
  */
 public static double sum(DoubleArrayList data) {
-	return sumOfPowerDeviations(data,1,0.0);
+  return sumOfPowerDeviations(data,1,0.0);
 }
 /**
  * Returns the sum of inversions of a data sequence,
@@ -981,7 +978,7 @@
  * @param to the index of the last data element (inclusive).
  */
 public static double sumOfInversions(DoubleArrayList data, int from, int to) {
-	return sumOfPowerDeviations(data,-1,0.0,from,to);
+  return sumOfPowerDeviations(data,-1,0.0,from,to);
 }
 /**
  * Returns the sum of logarithms of a data sequence, which is <tt>Sum( Log(data[i])</tt>.
@@ -990,68 +987,68 @@
  * @param to the index of the last data element (inclusive).
  */
 public static double sumOfLogarithms(DoubleArrayList data, int from, int to) {
-	double[] elements = data.elements();
-	double logsum = 0;
-	for (int i=from-1; ++i <= to;) logsum += Math.log(elements[i]);
-	return logsum;
+  double[] elements = data.elements();
+  double logsum = 0;
+  for (int i=from-1; ++i <= to;) logsum += Math.log(elements[i]);
+  return logsum;
 }
 /**
  * Returns <tt>Sum( (data[i]-c)<sup>k</sup> )</tt>; optimized for common parameters like <tt>c == 0.0</tt> and/or <tt>k == -2 .. 4</tt>.
  */
 public static double sumOfPowerDeviations(DoubleArrayList data, int k, double c) {
-	return sumOfPowerDeviations(data,k,c,0,data.size()-1);
+  return sumOfPowerDeviations(data,k,c,0,data.size()-1);
 }
 /**
  * Returns <tt>Sum( (data[i]-c)<sup>k</sup> )</tt> for all <tt>i = from .. to</tt>; optimized for common parameters like <tt>c == 0.0</tt> and/or <tt>k == -2 .. 5</tt>.
  */
 public static double sumOfPowerDeviations(final DoubleArrayList data, final int k, final double c, final int from, final int to) {
-	final double[] elements = data.elements();
-	double sum = 0;
-	double v;
-	int i;
-	switch (k) { // optimized for speed
-		case -2: 
-			if (c==0.0) for (i=from-1; ++i<=to; ) { v = elements[i]; sum += 1/(v*v); }
-			else for (i=from-1; ++i<=to; ) { v = elements[i]-c; sum += 1/(v*v); }
-			break;
-		case -1:
-			if (c==0.0) for (i=from-1; ++i<=to; ) sum += 1/(elements[i]);
-			else for (i=from-1; ++i<=to; ) sum += 1/(elements[i]-c);
-			break;
-		case 0: 
-			sum += to-from+1;
-			break;
-		case 1: 
-			if (c==0.0) for (i=from-1; ++i<=to; ) sum += elements[i];
-			else for (i=from-1; ++i<=to; ) sum += elements[i]-c;
-			break;
-		case 2: 
-			if (c==0.0) for (i=from-1; ++i<=to; ) { v = elements[i]; sum += v*v; }
-			else for (i=from-1; ++i<=to; ) { v = elements[i]-c; sum += v*v; }
-			break;
-		case 3: 
-			if (c==0.0) for (i=from-1; ++i<=to; ) { v = elements[i]; sum += v*v*v; }
-			else for (i=from-1; ++i<=to; ) { v = elements[i]-c; sum += v*v*v; }
-			break;
-		case 4: 
-			if (c==0.0) for (i=from-1; ++i<=to; ) { v = elements[i]; sum += v*v*v*v; }
-			else for (i=from-1; ++i<=to; ) { v = elements[i]-c; sum += v*v*v*v; }
-			break;
-		case 5: 
-			if (c==0.0) for (i=from-1; ++i<=to; ) { v = elements[i]; sum += v*v*v*v*v; }
-			else for (i=from-1; ++i<=to; ) { v = elements[i]-c; sum += v*v*v*v*v; }
-			break;
-		default:
-			for (i=from-1; ++i<=to; ) sum += Math.pow(elements[i]-c, k);
-			break;
-	}
-	return sum;
+  final double[] elements = data.elements();
+  double sum = 0;
+  double v;
+  int i;
+  switch (k) { // optimized for speed
+    case -2: 
+      if (c==0.0) for (i=from-1; ++i<=to; ) { v = elements[i]; sum += 1/(v*v); }
+      else for (i=from-1; ++i<=to; ) { v = elements[i]-c; sum += 1/(v*v); }
+      break;
+    case -1:
+      if (c==0.0) for (i=from-1; ++i<=to; ) sum += 1/(elements[i]);
+      else for (i=from-1; ++i<=to; ) sum += 1/(elements[i]-c);
+      break;
+    case 0: 
+      sum += to-from+1;
+      break;
+    case 1: 
+      if (c==0.0) for (i=from-1; ++i<=to; ) sum += elements[i];
+      else for (i=from-1; ++i<=to; ) sum += elements[i]-c;
+      break;
+    case 2: 
+      if (c==0.0) for (i=from-1; ++i<=to; ) { v = elements[i]; sum += v*v; }
+      else for (i=from-1; ++i<=to; ) { v = elements[i]-c; sum += v*v; }
+      break;
+    case 3: 
+      if (c==0.0) for (i=from-1; ++i<=to; ) { v = elements[i]; sum += v*v*v; }
+      else for (i=from-1; ++i<=to; ) { v = elements[i]-c; sum += v*v*v; }
+      break;
+    case 4: 
+      if (c==0.0) for (i=from-1; ++i<=to; ) { v = elements[i]; sum += v*v*v*v; }
+      else for (i=from-1; ++i<=to; ) { v = elements[i]-c; sum += v*v*v*v; }
+      break;
+    case 5: 
+      if (c==0.0) for (i=from-1; ++i<=to; ) { v = elements[i]; sum += v*v*v*v*v; }
+      else for (i=from-1; ++i<=to; ) { v = elements[i]-c; sum += v*v*v*v*v; }
+      break;
+    default:
+      for (i=from-1; ++i<=to; ) sum += Math.pow(elements[i]-c, k);
+      break;
+  }
+  return sum;
 }
 /**
  * Returns the sum of powers of a data sequence, which is <tt>Sum ( data[i]<sup>k</sup> )</tt>.
  */
 public static double sumOfPowers(DoubleArrayList data, int k) {
-	return sumOfPowerDeviations(data,k,0);
+  return sumOfPowerDeviations(data,k,0);
 }
 /**
  * Returns the sum of squared mean deviation of of a data sequence.
@@ -1061,14 +1058,14 @@
  * @param variance the variance of the data sequence.
  */
 public static double sumOfSquaredDeviations(int size, double variance) {
-	return variance * (size-1);
+  return variance * (size-1);
 }
 /**
  * Returns the sum of squares of a data sequence.
  * That is <tt>Sum ( data[i]*data[i] )</tt>.
  */
 public static double sumOfSquares(DoubleArrayList data) {
-	return sumOfPowerDeviations(data,2,0.0);
+  return sumOfPowerDeviations(data,2,0.0);
 }
 /**
  * Returns the trimmed mean of a sorted data sequence.
@@ -1079,23 +1076,23 @@
  * @right the number of trailing elements to trim.
  */
 public static double trimmedMean(DoubleArrayList sortedData, double mean, int left, int right) {
-	int N = sortedData.size();
-	if (N==0) throw new IllegalArgumentException("Empty data.");
-	if (left+right >= N) throw new IllegalArgumentException("Not enough data.");
+  int N = sortedData.size();
+  if (N==0) throw new IllegalArgumentException("Empty data.");
+  if (left+right >= N) throw new IllegalArgumentException("Not enough data.");
 
-	double[] sortedElements = sortedData.elements();
-	int N0=N;
-	for(int i=0; i<left; ++i)
-		mean += (mean-sortedElements[i])/(--N);
-	for(int i=0; i<right; ++i)
-		mean += (mean-sortedElements[N0-1-i])/(--N);
-	return mean;
+  double[] sortedElements = sortedData.elements();
+  int N0=N;
+  for(int i=0; i<left; ++i)
+    mean += (mean-sortedElements[i])/(--N);
+  for(int i=0; i<right; ++i)
+    mean += (mean-sortedElements[N0-1-i])/(--N);
+  return mean;
 }
 /**
  * Returns the variance from a standard deviation.
  */
 public static double variance(double standardDeviation) {
-	return standardDeviation * standardDeviation;
+  return standardDeviation * standardDeviation;
 }
 /**
  * Returns the variance of a data sequence.
@@ -1106,28 +1103,28 @@
  * @param sumOfSquares <tt>== Sum( data[i]*data[i] )</tt>.
  */
 public static double variance(int size, double sum, double sumOfSquares) {
-	double mean = sum / size;
-	return (sumOfSquares - mean*sum) / size;
+  double mean = sum / size;
+  return (sumOfSquares - mean*sum) / size;
 }
 /**
  * Returns the weighted mean of a data sequence.
  * That is <tt> Sum (data[i] * weights[i]) / Sum ( weights[i] )</tt>.
  */
 public static double weightedMean(DoubleArrayList data, DoubleArrayList weights) {
-	int size = data.size();
-	if (size != weights.size() || size == 0) throw new IllegalArgumentException();
-	
-	double[] elements = data.elements();
-	double[] theWeights = weights.elements();
-	double sum = 0.0;
-	double weightsSum = 0.0;
-	for (int i=size; --i >= 0; ) {
-		double w = theWeights[i];
-		sum += elements[i] * w;
-		weightsSum += w;
-	}
+  int size = data.size();
+  if (size != weights.size() || size == 0) throw new IllegalArgumentException();
+  
+  double[] elements = data.elements();
+  double[] theWeights = weights.elements();
+  double sum = 0.0;
+  double weightsSum = 0.0;
+  for (int i=size; --i >= 0; ) {
+    double w = theWeights[i];
+    sum += elements[i] * w;
+    weightsSum += w;
+  }
 
-	return sum/weightsSum;
+  return sum/weightsSum;
 }
 /**
  * Returns the weighted RMS (Root-Mean-Square) of a data sequence.
@@ -1138,7 +1135,7 @@
  * @param sumOfSquaredProducts <tt>== Sum( data[i] * data[i] * weights[i] )</tt>.
  */
 public static double weightedRMS(double sumOfProducts, double sumOfSquaredProducts) {
-	return sumOfProducts / sumOfSquaredProducts;
+  return sumOfProducts / sumOfSquaredProducts;
 }
 /**
  * Returns the winsorized mean of a sorted data sequence.
@@ -1149,20 +1146,20 @@
  * @right the number of trailing elements to trim.
  */
 public static double winsorizedMean(DoubleArrayList sortedData, double mean, int left, int right) {
-	int N = sortedData.size();
-	if (N==0) throw new IllegalArgumentException("Empty data.");
-	if (left+right >= N) throw new IllegalArgumentException("Not enough data.");
+  int N = sortedData.size();
+  if (N==0) throw new IllegalArgumentException("Empty data.");
+  if (left+right >= N) throw new IllegalArgumentException("Not enough data.");
 
-	double[] sortedElements = sortedData.elements();
+  double[] sortedElements = sortedData.elements();
 
-	double leftElement = sortedElements[left];
-	for(int i=0; i<left; ++i)
-		mean += (leftElement-sortedElements[i])/N;
+  double leftElement = sortedElements[left];
+  for(int i=0; i<left; ++i)
+    mean += (leftElement-sortedElements[i])/N;
 
-	double rightElement = sortedElements[N-1-right];
-	for(int i=0; i<right; ++i)
-		mean += (rightElement-sortedElements[N-1-i])/N;
+  double rightElement = sortedElements[N-1-right];
+  for(int i=0; i<right; ++i)
+    mean += (rightElement-sortedElements[N-1-i])/N;
 
-	return mean;
+  return mean;
 }
 }
Index: matrix/src/main/java/org/apache/mahout/jet/stat/Gamma.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/jet/stat/Gamma.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/jet/stat/Gamma.java	(working copy)
@@ -18,8 +18,6 @@
  * which in turn is a port from the <A HREF="http://people.ne.mediaone.net/moshier/index.html#Cephes">Cephes 2.2</A> Math Library (C).
  * Most Cephes code (missing from the 2D Graph Package) directly ported.
  *
- * @author wolfgang.hoschek@cern.ch
- * @version 0.9, 22-Jun-99
  */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
@@ -41,22 +39,22 @@
  * </pre>
  */
 static public double beta(double a, double b) throws ArithmeticException {
-	double y;
-	
-	y = a + b;
-	y = gamma(y);
-	if( y == 0.0 ) return 1.0;
+  double y;
+  
+  y = a + b;
+  y = gamma(y);
+  if( y == 0.0 ) return 1.0;
 
-	if( a > b ) {
-		y = gamma(a)/y;
-		y *= gamma(b);
-	}
-	else {
-		y = gamma(b)/y;
-		y *= gamma(a);
-	}
+  if( a > b ) {
+    y = gamma(a)/y;
+    y *= gamma(b);
+  }
+  else {
+    y = gamma(b)/y;
+    y *= gamma(a);
+  }
 
-	return(y);
+  return(y);
 }
 /**
  * Returns the Gamma function of the argument.
@@ -64,24 +62,24 @@
 static public double gamma(double x) throws ArithmeticException {
 
 double P[] = {
-			   1.60119522476751861407E-4,
-			   1.19135147006586384913E-3,
-			   1.04213797561761569935E-2,
-			   4.76367800457137231464E-2,
-			   2.07448227648435975150E-1,
-			   4.94214826801497100753E-1,
-			   9.99999999999999996796E-1
-			  };
+         1.60119522476751861407E-4,
+         1.19135147006586384913E-3,
+         1.04213797561761569935E-2,
+         4.76367800457137231464E-2,
+         2.07448227648435975150E-1,
+         4.94214826801497100753E-1,
+         9.99999999999999996796E-1
+        };
 double Q[] = {
-			   -2.31581873324120129819E-5,
-				5.39605580493303397842E-4,
-			   -4.45641913851797240494E-3,
-				1.18139785222060435552E-2,
-				3.58236398605498653373E-2,
-			   -2.34591795718243348568E-1,
-				7.14304917030273074085E-2,
-				1.00000000000000000320E0
-			   };
+         -2.31581873324120129819E-5,
+        5.39605580493303397842E-4,
+         -4.45641913851797240494E-3,
+        1.18139785222060435552E-2,
+        3.58236398605498653373E-2,
+         -2.34591795718243348568E-1,
+        7.14304917030273074085E-2,
+        1.00000000000000000320E0
+         };
 //double MAXGAM = 171.624376956302725;
 //double LOGPI  = 1.14472988584940017414;
 
@@ -92,59 +90,59 @@
 
 if( q > 33.0 ) {
    if( x < 0.0 ) {
-		p = Math.floor(q);
-	if( p == q ) throw new ArithmeticException("gamma: overflow");
-	i = (int)p;
-	z = q - p;
-	if( z > 0.5 ) {
-		p += 1.0;
-		z = q - p;
-	}
-	z = q * Math.sin( Math.PI * z );
-	if( z == 0.0 ) throw new ArithmeticException("gamma: overflow");
-	z = Math.abs(z);
-	z = Math.PI/(z * stirlingFormula(q) );
+    p = Math.floor(q);
+  if( p == q ) throw new ArithmeticException("gamma: overflow");
+  i = (int)p;
+  z = q - p;
+  if( z > 0.5 ) {
+    p += 1.0;
+    z = q - p;
+  }
+  z = q * Math.sin( Math.PI * z );
+  if( z == 0.0 ) throw new ArithmeticException("gamma: overflow");
+  z = Math.abs(z);
+  z = Math.PI/(z * stirlingFormula(q) );
 
-		return -z;
+    return -z;
    } else {
-	return stirlingFormula(x);
+  return stirlingFormula(x);
    }
  }
 
  z = 1.0;
    while( x >= 3.0 ) {
-  	     x -= 1.0;
-	 z *= x;
+         x -= 1.0;
+   z *= x;
    }
 
    while( x < 0.0 ) {
-	 if( x == 0.0 ) {
-			throw new ArithmeticException("gamma: singular");
-		 } else
-	 if( x > -1.E-9 ) {
-			 return( z/((1.0 + 0.5772156649015329 * x) * x) );
-		 }
-	 z /= x;
-	 x += 1.0;
+   if( x == 0.0 ) {
+      throw new ArithmeticException("gamma: singular");
+     } else
+   if( x > -1.E-9 ) {
+       return( z/((1.0 + 0.5772156649015329 * x) * x) );
+     }
+   z /= x;
+   x += 1.0;
    }
 
    while( x < 2.0 ) {
-	 if( x == 0.0 ) {
-			throw new ArithmeticException("gamma: singular");
-		 } else
-	 if( x < 1.e-9 ) {
-  	        return( z/((1.0 + 0.5772156649015329 * x) * x) );
-		 }
-	 z /= x;
-	 x += 1.0;
+   if( x == 0.0 ) {
+      throw new ArithmeticException("gamma: singular");
+     } else
+   if( x < 1.e-9 ) {
+            return( z/((1.0 + 0.5772156649015329 * x) * x) );
+     }
+   z /= x;
+   x += 1.0;
 }
 
-	if( (x == 2.0) || (x == 3.0) ) 	return z;
+  if( (x == 2.0) || (x == 3.0) )   return z;
 
-	x -= 2.0;
-	p = Polynomial.polevl( x, P, 6 );
-	q = Polynomial.polevl( x, Q, 7 );
-	return  z * p / q;
+  x -= 2.0;
+  p = Polynomial.polevl( x, P, 6 );
+  q = Polynomial.polevl( x, Q, 7 );
+  return  z * p / q;
 
 }
 /**
@@ -155,479 +153,479 @@
  * @param xx the integration end point.
  */
 public static double incompleteBeta( double aa, double bb, double xx ) throws ArithmeticException {
-		double a, b, t, x, xc, w, y;
-		boolean flag;
+    double a, b, t, x, xc, w, y;
+    boolean flag;
 
-		if( aa <= 0.0 || bb <= 0.0 ) throw new 
-						  ArithmeticException("ibeta: Domain error!");
+    if( aa <= 0.0 || bb <= 0.0 ) throw new 
+              ArithmeticException("ibeta: Domain error!");
 
-		if( (xx <= 0.0) || ( xx >= 1.0) ) {
-  	       if( xx == 0.0 ) return 0.0;
-   	       if( xx == 1.0 ) return 1.0;
-		   throw new ArithmeticException("ibeta: Domain error!");
-	    }
+    if( (xx <= 0.0) || ( xx >= 1.0) ) {
+           if( xx == 0.0 ) return 0.0;
+            if( xx == 1.0 ) return 1.0;
+       throw new ArithmeticException("ibeta: Domain error!");
+      }
 
-		flag = false;
-		if( (bb * xx) <= 1.0 && xx <= 0.95) {
-	        t = powerSeries(aa, bb, xx);
-		    return t;
-	    }
+    flag = false;
+    if( (bb * xx) <= 1.0 && xx <= 0.95) {
+          t = powerSeries(aa, bb, xx);
+        return t;
+      }
 
-		w = 1.0 - xx;
+    w = 1.0 - xx;
 
-		/* Reverse a and b if x is greater than the mean. */
-		if( xx > (aa/(aa+bb)) ) {
-	       flag = true;
-	       a = bb;
-	       b = aa;
-	       xc = xx;
-	       x = w;
-	    } else {
-  	       a = aa;
-	       b = bb;
-	       xc = w;
-	       x = xx;
-	    }
+    /* Reverse a and b if x is greater than the mean. */
+    if( xx > (aa/(aa+bb)) ) {
+         flag = true;
+         a = bb;
+         b = aa;
+         xc = xx;
+         x = w;
+      } else {
+           a = aa;
+         b = bb;
+         xc = w;
+         x = xx;
+      }
 
-		if( flag  && (b * x) <= 1.0 && x <= 0.95) {
- 	       t = powerSeries(a, b, x);
-	       if( t <= MACHEP ) 	t = 1.0 - MACHEP;
-	       else  		        t = 1.0 - t;
-		   return t;
-	    }
+    if( flag  && (b * x) <= 1.0 && x <= 0.95) {
+          t = powerSeries(a, b, x);
+         if( t <= MACHEP )   t = 1.0 - MACHEP;
+         else              t = 1.0 - t;
+       return t;
+      }
 
-		/* Choose expansion for better convergence. */
-		y = x * (a+b-2.0) - (a-1.0);
-		if( y < 0.0 )
-	                  w = incompleteBetaFraction1( a, b, x );
-		else
-	                  w = incompleteBetaFraction2( a, b, x ) / xc;
+    /* Choose expansion for better convergence. */
+    y = x * (a+b-2.0) - (a-1.0);
+    if( y < 0.0 )
+                    w = incompleteBetaFraction1( a, b, x );
+    else
+                    w = incompleteBetaFraction2( a, b, x ) / xc;
 
-		/* Multiply w by the factor
-		   a      b   _             _     _
-		  x  (1-x)   | (a+b) / ( a | (a) | (b) ) .   */
+    /* Multiply w by the factor
+       a      b   _             _     _
+      x  (1-x)   | (a+b) / ( a | (a) | (b) ) .   */
 
-		y = a * Math.log(x);
-		t = b * Math.log(xc);
-		if( (a+b) < MAXGAM && Math.abs(y) < MAXLOG && Math.abs(t) < MAXLOG ) {
-	        t = Math.pow(xc,b);
-	        t *= Math.pow(x,a);
-	        t /= a;
-	        t *= w;
-	        t *= gamma(a+b) / (gamma(a) * gamma(b));
-			if( flag ) {
- 	           if( t <= MACHEP ) 	t = 1.0 - MACHEP;
-	           else  		        t = 1.0 - t;
-	        }
-			return t;
-	    }
-		/* Resort to logarithms.  */
-		y += t + logGamma(a+b) - logGamma(a) - logGamma(b);
-		y += Math.log(w/a);
-		if( y < MINLOG )
-	                    t = 0.0;
-		else
-	                    t = Math.exp(y);
+    y = a * Math.log(x);
+    t = b * Math.log(xc);
+    if( (a+b) < MAXGAM && Math.abs(y) < MAXLOG && Math.abs(t) < MAXLOG ) {
+          t = Math.pow(xc,b);
+          t *= Math.pow(x,a);
+          t /= a;
+          t *= w;
+          t *= gamma(a+b) / (gamma(a) * gamma(b));
+      if( flag ) {
+              if( t <= MACHEP )   t = 1.0 - MACHEP;
+             else              t = 1.0 - t;
+          }
+      return t;
+      }
+    /* Resort to logarithms.  */
+    y += t + logGamma(a+b) - logGamma(a) - logGamma(b);
+    y += Math.log(w/a);
+    if( y < MINLOG )
+                      t = 0.0;
+    else
+                      t = Math.exp(y);
 
-		if( flag ) {
- 	           if( t <= MACHEP ) 	t = 1.0 - MACHEP;
-	           else  		        t = 1.0 - t;
-	    }
-		return t;
+    if( flag ) {
+              if( t <= MACHEP )   t = 1.0 - MACHEP;
+             else              t = 1.0 - t;
+      }
+    return t;
    }   
 /**
  * Continued fraction expansion #1 for incomplete beta integral; formerly named <tt>incbcf</tt>.
  */
 static double incompleteBetaFraction1( double a, double b, double x ) throws ArithmeticException {
-	   double xk, pk, pkm1, pkm2, qk, qkm1, qkm2;
-	   double k1, k2, k3, k4, k5, k6, k7, k8;
-	   double r, t, ans, thresh;
-	   int n;
+     double xk, pk, pkm1, pkm2, qk, qkm1, qkm2;
+     double k1, k2, k3, k4, k5, k6, k7, k8;
+     double r, t, ans, thresh;
+     int n;
 
-	   k1 = a;
-	   k2 = a + b;
-	   k3 = a;
-	   k4 = a + 1.0;
-	   k5 = 1.0;
-	   k6 = b - 1.0;
-	   k7 = k4;
-	   k8 = a + 2.0;
+     k1 = a;
+     k2 = a + b;
+     k3 = a;
+     k4 = a + 1.0;
+     k5 = 1.0;
+     k6 = b - 1.0;
+     k7 = k4;
+     k8 = a + 2.0;
 
-	   pkm2 = 0.0;
-	   qkm2 = 1.0;
-	   pkm1 = 1.0;
-	   qkm1 = 1.0;
-	   ans = 1.0;
-	   r = 1.0;
-	   n = 0;
-	   thresh = 3.0 * MACHEP;
-	   do {
-	      xk = -( x * k1 * k2 )/( k3 * k4 );
-	      pk = pkm1 +  pkm2 * xk;
-	      qk = qkm1 +  qkm2 * xk;
-	      pkm2 = pkm1;
-	      pkm1 = pk;
-	      qkm2 = qkm1;
-	      qkm1 = qk;
+     pkm2 = 0.0;
+     qkm2 = 1.0;
+     pkm1 = 1.0;
+     qkm1 = 1.0;
+     ans = 1.0;
+     r = 1.0;
+     n = 0;
+     thresh = 3.0 * MACHEP;
+     do {
+        xk = -( x * k1 * k2 )/( k3 * k4 );
+        pk = pkm1 +  pkm2 * xk;
+        qk = qkm1 +  qkm2 * xk;
+        pkm2 = pkm1;
+        pkm1 = pk;
+        qkm2 = qkm1;
+        qkm1 = qk;
 
-	      xk = ( x * k5 * k6 )/( k7 * k8 );
-	      pk = pkm1 +  pkm2 * xk;
-	      qk = qkm1 +  qkm2 * xk;
-	      pkm2 = pkm1;
-	      pkm1 = pk;
-	      qkm2 = qkm1;
-	      qkm1 = qk;
+        xk = ( x * k5 * k6 )/( k7 * k8 );
+        pk = pkm1 +  pkm2 * xk;
+        qk = qkm1 +  qkm2 * xk;
+        pkm2 = pkm1;
+        pkm1 = pk;
+        qkm2 = qkm1;
+        qkm1 = qk;
 
-	      if( qk != 0 )		r = pk/qk;
-	      if( r != 0 ) {
-		       t = Math.abs( (ans - r)/r );
-		       ans = r;
-		  }	else
-		       t = 1.0;
+        if( qk != 0 )    r = pk/qk;
+        if( r != 0 ) {
+           t = Math.abs( (ans - r)/r );
+           ans = r;
+      }  else
+           t = 1.0;
 
-	      if( t < thresh ) return ans;
+        if( t < thresh ) return ans;
 
-	      k1 += 1.0;
-		  k2 += 1.0;
-	  	  k3 += 2.0;
-	  	  k4 += 2.0;
-	  	  k5 += 1.0;
-	  	  k6 -= 1.0;
-	  	  k7 += 2.0;
-	  	  k8 += 2.0;
+        k1 += 1.0;
+      k2 += 1.0;
+        k3 += 2.0;
+        k4 += 2.0;
+        k5 += 1.0;
+        k6 -= 1.0;
+        k7 += 2.0;
+        k8 += 2.0;
 
-	  	  if( (Math.abs(qk) + Math.abs(pk)) > big ) {
-	  		pkm2 *= biginv;
-	  		pkm1 *= biginv;
-	  		qkm2 *= biginv;
-	  		qkm1 *= biginv;
-		  }
-	  	  if( (Math.abs(qk) < biginv) || (Math.abs(pk) < biginv) ) {
-	  		pkm2 *= big;
-	  		pkm1 *= big;
-	  		qkm2 *= big;
-	  		qkm1 *= big;
-		  }
-	   } while( ++n < 300 );
+        if( (Math.abs(qk) + Math.abs(pk)) > big ) {
+        pkm2 *= biginv;
+        pkm1 *= biginv;
+        qkm2 *= biginv;
+        qkm1 *= biginv;
+      }
+        if( (Math.abs(qk) < biginv) || (Math.abs(pk) < biginv) ) {
+        pkm2 *= big;
+        pkm1 *= big;
+        qkm2 *= big;
+        qkm1 *= big;
+      }
+     } while( ++n < 300 );
 
-	return ans;
+  return ans;
    }   
 /**
  * Continued fraction expansion #2 for incomplete beta integral; formerly named <tt>incbd</tt>.
  */
 static double incompleteBetaFraction2( double a, double b, double x ) throws ArithmeticException {
-		 double xk, pk, pkm1, pkm2, qk, qkm1, qkm2;
-		 double k1, k2, k3, k4, k5, k6, k7, k8;
-		 double r, t, ans, z, thresh;
-		 int n;
+     double xk, pk, pkm1, pkm2, qk, qkm1, qkm2;
+     double k1, k2, k3, k4, k5, k6, k7, k8;
+     double r, t, ans, z, thresh;
+     int n;
 
-		 k1 = a;
-		 k2 = b - 1.0;
-		 k3 = a;
-		 k4 = a + 1.0;
-		 k5 = 1.0;
-		 k6 = a + b;
-		 k7 = a + 1.0;;
-		 k8 = a + 2.0;
+     k1 = a;
+     k2 = b - 1.0;
+     k3 = a;
+     k4 = a + 1.0;
+     k5 = 1.0;
+     k6 = a + b;
+     k7 = a + 1.0;;
+     k8 = a + 2.0;
 
-		 pkm2 = 0.0;
-		 qkm2 = 1.0;
-		 pkm1 = 1.0;
-		 qkm1 = 1.0;
-		 z = x / (1.0-x);
-		 ans = 1.0;
-		 r = 1.0;
-		 n = 0;
-		 thresh = 3.0 * MACHEP;
-		 do {
-	         xk = -( z * k1 * k2 )/( k3 * k4 );
-	         pk = pkm1 +  pkm2 * xk;
-	         qk = qkm1 +  qkm2 * xk;
-	         pkm2 = pkm1;
-	         pkm1 = pk;
-	         qkm2 = qkm1;
-	         qkm1 = qk;
+     pkm2 = 0.0;
+     qkm2 = 1.0;
+     pkm1 = 1.0;
+     qkm1 = 1.0;
+     z = x / (1.0-x);
+     ans = 1.0;
+     r = 1.0;
+     n = 0;
+     thresh = 3.0 * MACHEP;
+     do {
+           xk = -( z * k1 * k2 )/( k3 * k4 );
+           pk = pkm1 +  pkm2 * xk;
+           qk = qkm1 +  qkm2 * xk;
+           pkm2 = pkm1;
+           pkm1 = pk;
+           qkm2 = qkm1;
+           qkm1 = qk;
 
-	         xk = ( z * k5 * k6 )/( k7 * k8 );
-	         pk = pkm1 +  pkm2 * xk;
-	         qk = qkm1 +  qkm2 * xk;
-	         pkm2 = pkm1;
-	         pkm1 = pk;
-	         qkm2 = qkm1;
-	         qkm1 = qk;
+           xk = ( z * k5 * k6 )/( k7 * k8 );
+           pk = pkm1 +  pkm2 * xk;
+           qk = qkm1 +  qkm2 * xk;
+           pkm2 = pkm1;
+           pkm1 = pk;
+           qkm2 = qkm1;
+           qkm1 = qk;
 
-	         if( qk != 0 )  r = pk/qk;
-	         if( r != 0 ) {
-		         t = Math.abs( (ans - r)/r );
-		         ans = r;
-		     } else
-		         t = 1.0;
+           if( qk != 0 )  r = pk/qk;
+           if( r != 0 ) {
+             t = Math.abs( (ans - r)/r );
+             ans = r;
+         } else
+             t = 1.0;
 
-	         if( t < thresh ) return ans;
+           if( t < thresh ) return ans;
 
-	         k1 += 1.0;
-	         k2 -= 1.0;
-	         k3 += 2.0;
-	         k4 += 2.0;
-	         k5 += 1.0;
-	         k6 += 1.0;
-	         k7 += 2.0;
-	         k8 += 2.0;
+           k1 += 1.0;
+           k2 -= 1.0;
+           k3 += 2.0;
+           k4 += 2.0;
+           k5 += 1.0;
+           k6 += 1.0;
+           k7 += 2.0;
+           k8 += 2.0;
 
-	         if( (Math.abs(qk) + Math.abs(pk)) > big ) {
-		        pkm2 *= biginv;
-		        pkm1 *= biginv;
-		        qkm2 *= biginv;
-		        qkm1 *= biginv;
-		     }
-	         if( (Math.abs(qk) < biginv) || (Math.abs(pk) < biginv) ) {
-		        pkm2 *= big;
-		        pkm1 *= big;
-		        qkm2 *= big;
-		        qkm1 *= big;
-		     }
-	    } while( ++n < 300 );
+           if( (Math.abs(qk) + Math.abs(pk)) > big ) {
+            pkm2 *= biginv;
+            pkm1 *= biginv;
+            qkm2 *= biginv;
+            qkm1 *= biginv;
+         }
+           if( (Math.abs(qk) < biginv) || (Math.abs(pk) < biginv) ) {
+            pkm2 *= big;
+            pkm1 *= big;
+            qkm2 *= big;
+            qkm1 *= big;
+         }
+      } while( ++n < 300 );
 
-		return ans;
-	 }
+    return ans;
+   }
 /**
  * Returns the Incomplete Gamma function; formerly named <tt>igamma</tt>.
  * @param a the parameter of the gamma distribution.
  * @param x the integration end point.
  */
 static public double incompleteGamma(double a, double x) 
-						 throws ArithmeticException {
+             throws ArithmeticException {
 
 
-		double ans, ax, c, r;
+    double ans, ax, c, r;
 
-		if( x <= 0 || a <= 0 ) return 0.0;
+    if( x <= 0 || a <= 0 ) return 0.0;
 
-		if( x > 1.0 && x > a ) return 1.0 - incompleteGammaComplement(a,x);
+    if( x > 1.0 && x > a ) return 1.0 - incompleteGammaComplement(a,x);
 
-	   /* Compute  x**a * exp(-x) / gamma(a)  */
-		ax = a * Math.log(x) - x - logGamma(a);
-		if( ax < -MAXLOG ) return( 0.0 );
+     /* Compute  x**a * exp(-x) / gamma(a)  */
+    ax = a * Math.log(x) - x - logGamma(a);
+    if( ax < -MAXLOG ) return( 0.0 );
 
-		ax = Math.exp(ax);
+    ax = Math.exp(ax);
 
-		/* power series */
-		r = a;
-		c = 1.0;
-		ans = 1.0;
+    /* power series */
+    r = a;
+    c = 1.0;
+    ans = 1.0;
 
-		do {
-  	    r += 1.0;
-	    c *= x/r;
-	    ans += c;
-	}
-		while( c/ans > MACHEP );
+    do {
+        r += 1.0;
+      c *= x/r;
+      ans += c;
+  }
+    while( c/ans > MACHEP );
 
-		return( ans * ax/a );
+    return( ans * ax/a );
 
-	 }
+   }
 /**
  * Returns the Complemented Incomplete Gamma function; formerly named <tt>igamc</tt>.
  * @param a the parameter of the gamma distribution.
  * @param x the integration start point.
  */
 static public double incompleteGammaComplement( double a, double x ) throws ArithmeticException {
-		double ans, ax, c, yc, r, t, y, z;
-		double pk, pkm1, pkm2, qk, qkm1, qkm2;
+    double ans, ax, c, yc, r, t, y, z;
+    double pk, pkm1, pkm2, qk, qkm1, qkm2;
 
-		if( x <= 0 || a <= 0 ) return 1.0;
+    if( x <= 0 || a <= 0 ) return 1.0;
 
-		if( x < 1.0 || x < a ) return 1.0 - incompleteGamma(a,x);
+    if( x < 1.0 || x < a ) return 1.0 - incompleteGamma(a,x);
 
-		ax = a * Math.log(x) - x - logGamma(a);
-		if( ax < -MAXLOG ) return 0.0;
+    ax = a * Math.log(x) - x - logGamma(a);
+    if( ax < -MAXLOG ) return 0.0;
 
-		ax = Math.exp(ax);
+    ax = Math.exp(ax);
 
-		/* continued fraction */
-		y = 1.0 - a;
-		z = x + y + 1.0;
-		c = 0.0;
-		pkm2 = 1.0;
-		qkm2 = x;
-		pkm1 = x + 1.0;
-		qkm1 = z * x;
-		ans = pkm1/qkm1;
+    /* continued fraction */
+    y = 1.0 - a;
+    z = x + y + 1.0;
+    c = 0.0;
+    pkm2 = 1.0;
+    qkm2 = x;
+    pkm1 = x + 1.0;
+    qkm1 = z * x;
+    ans = pkm1/qkm1;
 
-		do {
-  	    c += 1.0;
-	    y += 1.0;
-	    z += 2.0;
-	    yc = y * c;
-	    pk = pkm1 * z  -  pkm2 * yc;
-	    qk = qkm1 * z  -  qkm2 * yc;
-	    if( qk != 0 ) {
-		r = pk/qk;
-		t = Math.abs( (ans - r)/r );
-		ans = r;
-	    } else
-		t = 1.0;
+    do {
+        c += 1.0;
+      y += 1.0;
+      z += 2.0;
+      yc = y * c;
+      pk = pkm1 * z  -  pkm2 * yc;
+      qk = qkm1 * z  -  qkm2 * yc;
+      if( qk != 0 ) {
+    r = pk/qk;
+    t = Math.abs( (ans - r)/r );
+    ans = r;
+      } else
+    t = 1.0;
 
-	    pkm2 = pkm1;
-	    pkm1 = pk;
-	    qkm2 = qkm1;
-	    qkm1 = qk;
-	    if( Math.abs(pk) > big ) {
-		pkm2 *= biginv;
-		pkm1 *= biginv;
-		qkm2 *= biginv;
-		qkm1 *= biginv;
-	    }
-	} while( t > MACHEP );
+      pkm2 = pkm1;
+      pkm1 = pk;
+      qkm2 = qkm1;
+      qkm1 = qk;
+      if( Math.abs(pk) > big ) {
+    pkm2 *= biginv;
+    pkm1 *= biginv;
+    qkm2 *= biginv;
+    qkm1 *= biginv;
+      }
+  } while( t > MACHEP );
 
-		return ans * ax;
-	 }
+    return ans * ax;
+   }
 /**
  * Returns the natural logarithm of the gamma function; formerly named <tt>lgamma</tt>.
  */
 public static double logGamma(double x) throws ArithmeticException {
-	double p, q, w, z;
+  double p, q, w, z;
 
-		 double A[] = {
-					   8.11614167470508450300E-4,
-					   -5.95061904284301438324E-4,
-						7.93650340457716943945E-4,
-					   -2.77777777730099687205E-3,
-						8.33333333333331927722E-2
-					   };
-		 double B[] = {
-					   -1.37825152569120859100E3,
-					   -3.88016315134637840924E4,
-					   -3.31612992738871184744E5,
-					   -1.16237097492762307383E6,
-					   -1.72173700820839662146E6,
-					   -8.53555664245765465627E5
-					   };
-		 double C[] = {
-					   /* 1.00000000000000000000E0, */
-					   -3.51815701436523470549E2,
-					   -1.70642106651881159223E4,
-					   -2.20528590553854454839E5,
-					   -1.13933444367982507207E6,
-					   -2.53252307177582951285E6,
-					   -2.01889141433532773231E6
-					  };
+     double A[] = {
+             8.11614167470508450300E-4,
+             -5.95061904284301438324E-4,
+            7.93650340457716943945E-4,
+             -2.77777777730099687205E-3,
+            8.33333333333331927722E-2
+             };
+     double B[] = {
+             -1.37825152569120859100E3,
+             -3.88016315134637840924E4,
+             -3.31612992738871184744E5,
+             -1.16237097492762307383E6,
+             -1.72173700820839662146E6,
+             -8.53555664245765465627E5
+             };
+     double C[] = {
+             /* 1.00000000000000000000E0, */
+             -3.51815701436523470549E2,
+             -1.70642106651881159223E4,
+             -2.20528590553854454839E5,
+             -1.13933444367982507207E6,
+             -2.53252307177582951285E6,
+             -2.01889141433532773231E6
+            };
 
-		 if( x < -34.0 ) {
-  	   q = -x;
-	   w = logGamma(q);
-	   p = Math.floor(q);
-	   if( p == q ) throw new ArithmeticException("lgam: Overflow");
-	   z = q - p;
-	   if( z > 0.5 ) {
-		p += 1.0;
-		z = p - q;
- 	   }
-	   z = q * Math.sin( Math.PI * z );
-	   if( z == 0.0 ) throw new 
-							   ArithmeticException("lgamma: Overflow");
-	   z = LOGPI - Math.log( z ) - w;
-	   return z;
-	 }
+     if( x < -34.0 ) {
+       q = -x;
+     w = logGamma(q);
+     p = Math.floor(q);
+     if( p == q ) throw new ArithmeticException("lgam: Overflow");
+     z = q - p;
+     if( z > 0.5 ) {
+    p += 1.0;
+    z = p - q;
+      }
+     z = q * Math.sin( Math.PI * z );
+     if( z == 0.0 ) throw new 
+                 ArithmeticException("lgamma: Overflow");
+     z = LOGPI - Math.log( z ) - w;
+     return z;
+   }
 
-		 if( x < 13.0 ) {
-  	   z = 1.0;
-	   while( x >= 3.0 ) {
-		x -= 1.0;
-		z *= x;
-	   }
-	   while( x < 2.0 ) {
-		if( x == 0.0 ) throw new 
-								ArithmeticException("lgamma: Overflow");
-		z /= x;
-		x += 1.0;
-	   }
-	   if( z < 0.0 ) z = -z;
-	   if( x == 2.0 ) return Math.log(z);
-	   x -= 2.0;
-	   p = x * Polynomial.polevl( x, B, 5 ) / Polynomial.p1evl( x, C, 6);
- 	   return( Math.log(z) + p );
-	 }
+     if( x < 13.0 ) {
+       z = 1.0;
+     while( x >= 3.0 ) {
+    x -= 1.0;
+    z *= x;
+     }
+     while( x < 2.0 ) {
+    if( x == 0.0 ) throw new 
+                ArithmeticException("lgamma: Overflow");
+    z /= x;
+    x += 1.0;
+     }
+     if( z < 0.0 ) z = -z;
+     if( x == 2.0 ) return Math.log(z);
+     x -= 2.0;
+     p = x * Polynomial.polevl( x, B, 5 ) / Polynomial.p1evl( x, C, 6);
+      return( Math.log(z) + p );
+   }
 
-		 if( x > 2.556348e305 ) throw new 
-						  ArithmeticException("lgamma: Overflow");
+     if( x > 2.556348e305 ) throw new 
+              ArithmeticException("lgamma: Overflow");
 
-		 q = ( x - 0.5 ) * Math.log(x) - x + 0.91893853320467274178;
-		 //if( x > 1.0e8 ) return( q );
-		 if( x > 1.0e8 ) return( q );
+     q = ( x - 0.5 ) * Math.log(x) - x + 0.91893853320467274178;
+     //if( x > 1.0e8 ) return( q );
+     if( x > 1.0e8 ) return( q );
 
-		 p = 1.0/(x*x);
-		 if( x >= 1000.0 )
-	     q += ((   7.9365079365079365079365e-4 * p
-		      - 2.7777777777777777777778e-3) *p
-		     + 0.0833333333333333333333) / x;
-		 else
-	     q += Polynomial.polevl( p, A, 4 ) / x;
-		 return q;
-	 }
+     p = 1.0/(x*x);
+     if( x >= 1000.0 )
+       q += ((   7.9365079365079365079365e-4 * p
+          - 2.7777777777777777777778e-3) *p
+         + 0.0833333333333333333333) / x;
+     else
+       q += Polynomial.polevl( p, A, 4 ) / x;
+     return q;
+   }
 /**
  * Power series for incomplete beta integral; formerly named <tt>pseries</tt>.
  * Use when b*x is small and x not too close to 1.  
  */
 static double powerSeries( double a, double b, double x ) throws ArithmeticException {
-	double s, t, u, v, n, t1, z, ai;
+  double s, t, u, v, n, t1, z, ai;
 
-	ai = 1.0 / a;
-	u = (1.0 - b) * x;
-	v = u / (a + 1.0);
-	t1 = v;
-	t = u;
-	n = 2.0;
-	s = 0.0;
-	z = MACHEP * ai;
-	while( Math.abs(v) > z ) {
-	       u = (n - b) * x / n;
-	       t *= u;
-	       v = t / (a + n);
-	       s += v; 
-	       n += 1.0;
-	    }
-	s += t1;
-	s += ai;
+  ai = 1.0 / a;
+  u = (1.0 - b) * x;
+  v = u / (a + 1.0);
+  t1 = v;
+  t = u;
+  n = 2.0;
+  s = 0.0;
+  z = MACHEP * ai;
+  while( Math.abs(v) > z ) {
+         u = (n - b) * x / n;
+         t *= u;
+         v = t / (a + n);
+         s += v; 
+         n += 1.0;
+      }
+  s += t1;
+  s += ai;
 
-	u = a * Math.log(x);
-	if( (a+b) < MAXGAM && Math.abs(u) < MAXLOG ) {
-	        t = Gamma.gamma(a+b)/(Gamma.gamma(a)*Gamma.gamma(b));
-	        s = s * t * Math.pow(x,a);
-	    } else {
-	       t = Gamma.logGamma(a+b) - Gamma.logGamma(a) - Gamma.logGamma(b) + u + Math.log(s);
-	       if( t < MINLOG ) 	s = 0.0;
-	       else  	            s = Math.exp(t);
-	    }
-	return s;
+  u = a * Math.log(x);
+  if( (a+b) < MAXGAM && Math.abs(u) < MAXLOG ) {
+          t = Gamma.gamma(a+b)/(Gamma.gamma(a)*Gamma.gamma(b));
+          s = s * t * Math.pow(x,a);
+      } else {
+         t = Gamma.logGamma(a+b) - Gamma.logGamma(a) - Gamma.logGamma(b) + u + Math.log(s);
+         if( t < MINLOG )   s = 0.0;
+         else                s = Math.exp(t);
+      }
+  return s;
 }
 /**
  * Returns the Gamma function computed by Stirling's formula; formerly named <tt>stirf</tt>.
  * The polynomial STIR is valid for 33 <= x <= 172.
  */
 static double stirlingFormula(double x) throws ArithmeticException {
-		double STIR[] = {
-					 7.87311395793093628397E-4,
-					-2.29549961613378126380E-4,
-					-2.68132617805781232825E-3,
-					 3.47222221605458667310E-3,
-					 8.33333333333482257126E-2,
-					};
-		double MAXSTIR = 143.01608;
+    double STIR[] = {
+           7.87311395793093628397E-4,
+          -2.29549961613378126380E-4,
+          -2.68132617805781232825E-3,
+           3.47222221605458667310E-3,
+           8.33333333333482257126E-2,
+          };
+    double MAXSTIR = 143.01608;
 
-		double w = 1.0/x;
-		double  y = Math.exp(x);
+    double w = 1.0/x;
+    double  y = Math.exp(x);
 
-		w = 1.0 + w * Polynomial.polevl( w, STIR, 4 );
+    w = 1.0 + w * Polynomial.polevl( w, STIR, 4 );
 
-		if( x > MAXSTIR ) {
-	       /* Avoid overflow in Math.pow() */
-	       double v = Math.pow( x, 0.5 * x - 0.25 );
-	       y = v * (v / y);
-	} else {
-			   y = Math.pow( x, x - 0.5 ) / y;
-	}
-		y = SQTPI * y * w;
-		return y;
-	 }
+    if( x > MAXSTIR ) {
+         /* Avoid overflow in Math.pow() */
+         double v = Math.pow( x, 0.5 * x - 0.25 );
+         y = v * (v / y);
+  } else {
+         y = Math.pow( x, x - 0.5 ) / y;
+  }
+    y = SQTPI * y * w;
+    return y;
+   }
 }
Index: matrix/src/main/java/org/apache/mahout/jet/stat/quantile/Utils.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/jet/stat/quantile/Utils.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/jet/stat/quantile/Utils.java	(working copy)
@@ -16,13 +16,13 @@
  * Makes this class non instantiable, but still let's others inherit from it.
  */
 protected Utils() {
-	throw new RuntimeException("Non instantiable");
+  throw new RuntimeException("Non instantiable");
 }
 /**
  * Similar to Math.ceil(value), but adjusts small numerical rounding errors +- epsilon.
  */
 public static long epsilonCeiling(double value) {
-	double epsilon = 0.0000001;
-	return (long) Math.ceil(value - epsilon);
+  double epsilon = 0.0000001;
+  return (long) Math.ceil(value - epsilon);
 }
 }
Index: matrix/src/main/java/org/apache/mahout/jet/stat/quantile/QuantileFinderFactory.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/jet/stat/quantile/QuantileFinderFactory.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/jet/stat/quantile/QuantileFinderFactory.java	(working copy)
@@ -83,8 +83,6 @@
  *</pre><p>
  *
  *
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 09/24/99
  * @see KnownDoubleQuantileEstimator
  * @see UnknownDoubleQuantileEstimator
  */ 
@@ -113,26 +111,26 @@
  * @return <tt>long[2]</tt> - <tt>long[0]</tt>=the number of buffers, <tt>long[1]</tt>=the number of elements per buffer, <tt>returnSamplingRate[0]</tt>=the required sampling rate.
  */
 public static long[] known_N_compute_B_and_K(long N, double epsilon, double delta, int quantiles, double[] returnSamplingRate) {
-	returnSamplingRate[0] = 1.0;
-	if (epsilon<=0.0) {
-		// no way around exact quantile search
-		long[] result = new long[2];
-		result[0]=1;
-		result[1]=N;
-		return result;
-	}
-	if (epsilon>=1.0 || delta>=1.0) {
-		// can make any error we wish
-		long[] result = new long[2];
-		result[0]=2;
-		result[1]=1;
-		return result;
-	}
+  returnSamplingRate[0] = 1.0;
+  if (epsilon<=0.0) {
+    // no way around exact quantile search
+    long[] result = new long[2];
+    result[0]=1;
+    result[1]=N;
+    return result;
+  }
+  if (epsilon>=1.0 || delta>=1.0) {
+    // can make any error we wish
+    long[] result = new long[2];
+    result[0]=2;
+    result[1]=1;
+    return result;
+  }
 
-	if (delta > 0.0) {
-		return known_N_compute_B_and_K_slow(N, epsilon, delta, quantiles, returnSamplingRate);
-	}
-	return known_N_compute_B_and_K_quick(N, epsilon);
+  if (delta > 0.0) {
+    return known_N_compute_B_and_K_slow(N, epsilon, delta, quantiles, returnSamplingRate);
+  }
+  return known_N_compute_B_and_K_quick(N, epsilon);
 }
 /**
  * Computes the number of buffers and number of values per buffer such that
@@ -143,92 +141,92 @@
  * @param epsilon the approximation error which is guaranteed not to be exceeded (e.g. <tt>0.001</tt>) (<tt>0 &lt;= epsilon &lt;= 1</tt>). To get exact result, set <tt>epsilon=0.0</tt>;
  */
 protected static long[] known_N_compute_B_and_K_quick(long N, double epsilon) {
-	final int maxBuffers = 50;
-	final int maxHeight = 50;
-	final double N_double = (double) N;
-	final double c = N_double * epsilon * 2.0;
-	int[] heightMaximums = new int[maxBuffers-1];
+  final int maxBuffers = 50;
+  final int maxHeight = 50;
+  final double N_double = (double) N;
+  final double c = N_double * epsilon * 2.0;
+  int[] heightMaximums = new int[maxBuffers-1];
 
-	// for each b, determine maximum height, i.e. the height for which x<=0 and x is a maximum
-	// with x = binomial(b+h-2, h-1) - binomial(b+h-3, h-3) + binomial(b+h-3, h-2) - N * epsilon * 2.0
-	for (int b=2; b<=maxBuffers; b++) {
-		int h = 3;
-		
-		while ( h<=maxHeight && // skip heights until x<=0
-				(h-2) * (Arithmetic.binomial(b+h-2, h-1)) -
-				(Arithmetic.binomial(b+h-3, h-3)) +
-				(Arithmetic.binomial(b+h-3, h-2)) - c
-				> 0.0
-			  ) {h++;}
-		//from now on x is monotonically growing...
-		while ( h<=maxHeight && // skip heights until x>0
-				(h-2) * (Arithmetic.binomial(b+h-2, h-1)) -
-				(Arithmetic.binomial(b+h-3, h-3)) +
-				(Arithmetic.binomial(b+h-3, h-2)) - c
-				<= 0.0
-			  ) {h++;}
-		h--; //go back to last height
+  // for each b, determine maximum height, i.e. the height for which x<=0 and x is a maximum
+  // with x = binomial(b+h-2, h-1) - binomial(b+h-3, h-3) + binomial(b+h-3, h-2) - N * epsilon * 2.0
+  for (int b=2; b<=maxBuffers; b++) {
+    int h = 3;
+    
+    while ( h<=maxHeight && // skip heights until x<=0
+        (h-2) * (Arithmetic.binomial(b+h-2, h-1)) -
+        (Arithmetic.binomial(b+h-3, h-3)) +
+        (Arithmetic.binomial(b+h-3, h-2)) - c
+        > 0.0
+        ) {h++;}
+    //from now on x is monotonically growing...
+    while ( h<=maxHeight && // skip heights until x>0
+        (h-2) * (Arithmetic.binomial(b+h-2, h-1)) -
+        (Arithmetic.binomial(b+h-3, h-3)) +
+        (Arithmetic.binomial(b+h-3, h-2)) - c
+        <= 0.0
+        ) {h++;}
+    h--; //go back to last height
 
-		// was x>0 or did we loop without finding anything?
-		int hMax;
-		if (h>=maxHeight && 
-				(h-2) * (Arithmetic.binomial(b+h-2, h-1)) -
-				(Arithmetic.binomial(b+h-3, h-3)) +
-				(Arithmetic.binomial(b+h-3, h-2)) - c
-				> 0.0) {
-			hMax=Integer.MIN_VALUE;
-		}
-		else {
-			hMax=h;
-		}
-				
-		heightMaximums[b-2]=hMax; //safe some space
-	} //end for
+    // was x>0 or did we loop without finding anything?
+    int hMax;
+    if (h>=maxHeight && 
+        (h-2) * (Arithmetic.binomial(b+h-2, h-1)) -
+        (Arithmetic.binomial(b+h-3, h-3)) +
+        (Arithmetic.binomial(b+h-3, h-2)) - c
+        > 0.0) {
+      hMax=Integer.MIN_VALUE;
+    }
+    else {
+      hMax=h;
+    }
+        
+    heightMaximums[b-2]=hMax; //safe some space
+  } //end for
 
 
-	// for each b, determine the smallest k satisfying the constraints, i.e.
-	// for each b, determine kMin, with kMin = N/binomial(b+hMax-2,hMax-1)
-	long[] kMinimums = new long[maxBuffers-1];
-	for (int b=2; b<=maxBuffers; b++) {
-		int h=heightMaximums[b-2];
-		long kMin=Long.MAX_VALUE;
-		if (h>Integer.MIN_VALUE) {
-			double value = (Arithmetic.binomial(b+h-2, h-1));
-			long tmpK=(long)(Math.ceil(N_double/value));
-			if (tmpK<=Long.MAX_VALUE) {
-				kMin = tmpK;
-			}
-		}
-		kMinimums[b-2]=kMin;
-	}
+  // for each b, determine the smallest k satisfying the constraints, i.e.
+  // for each b, determine kMin, with kMin = N/binomial(b+hMax-2,hMax-1)
+  long[] kMinimums = new long[maxBuffers-1];
+  for (int b=2; b<=maxBuffers; b++) {
+    int h=heightMaximums[b-2];
+    long kMin=Long.MAX_VALUE;
+    if (h>Integer.MIN_VALUE) {
+      double value = (Arithmetic.binomial(b+h-2, h-1));
+      long tmpK=(long)(Math.ceil(N_double/value));
+      if (tmpK<=Long.MAX_VALUE) {
+        kMin = tmpK;
+      }
+    }
+    kMinimums[b-2]=kMin;
+  }
 
-	// from all b's, determine b that minimizes b*kMin
-	long multMin = Long.MAX_VALUE;
-	int minB = -1;
-	for (int b=2; b<=maxBuffers; b++) {
-		if (kMinimums[b-2]<Long.MAX_VALUE) {
-			long mult = ((long)b) * ((long)kMinimums[b-2]);
-			if (mult<multMin) {
-				multMin=mult;
-				minB = b;
-			}
-		}
-	}
+  // from all b's, determine b that minimizes b*kMin
+  long multMin = Long.MAX_VALUE;
+  int minB = -1;
+  for (int b=2; b<=maxBuffers; b++) {
+    if (kMinimums[b-2]<Long.MAX_VALUE) {
+      long mult = ((long)b) * ((long)kMinimums[b-2]);
+      if (mult<multMin) {
+        multMin=mult;
+        minB = b;
+      }
+    }
+  }
 
-	long b, k;
-	if (minB != -1) { // epsilon large enough?
-		b = minB;
-		k = kMinimums[minB-2];
-	}
-	else {     // epsilon is very small or zero.
-		b = 1; // the only possible solution without violating the 
-		k = N; // approximation guarantees is exact quantile search.
-	}
+  long b, k;
+  if (minB != -1) { // epsilon large enough?
+    b = minB;
+    k = kMinimums[minB-2];
+  }
+  else {     // epsilon is very small or zero.
+    b = 1; // the only possible solution without violating the 
+    k = N; // approximation guarantees is exact quantile search.
+  }
 
-	long[] result = new long[2];
-	result[0]=b;
-	result[1]=k;
-	return result;
+  long[] result = new long[2];
+  result[0]=b;
+  result[1]=k;
+  return result;
 }
 /**
  * Computes the number of buffers and number of values per buffer such that
@@ -243,71 +241,71 @@
  * @return <tt>long[2]</tt> - <tt>long[0]</tt>=the number of buffers, <tt>long[1]</tt>=the number of elements per buffer, <tt>returnSamplingRate[0]</tt>=the required sampling rate.
  */
 protected static long[] known_N_compute_B_and_K_slow(long N, double epsilon, double delta, int quantiles, double[] returnSamplingRate) {
-	final int maxBuffers = 50;
-	final int maxHeight = 50;
-	final double N_double = N;
+  final int maxBuffers = 50;
+  final int maxHeight = 50;
+  final double N_double = N;
 
-	// One possibility is to use one buffer of size N
-	//
-	long ret_b = 1;
-	long ret_k = N;
-	double sampling_rate = 1.0;
-	long memory = N;
+  // One possibility is to use one buffer of size N
+  //
+  long ret_b = 1;
+  long ret_k = N;
+  double sampling_rate = 1.0;
+  long memory = N;
 
 
-	// Otherwise, there are at least two buffers (b >= 2)
-	// and the height of the tree is at least three (h >= 3)
-	//
-	// We restrict the search for b and h to MAX_BINOM, a large enough value for
-	// practical values of    epsilon >= 0.001   and    delta >= 0.00001
-	//
-	final double logarithm = Math.log(2.0*quantiles/delta);
-	final double c = 2.0 * epsilon * N_double;
-	for (long b=2 ; b<maxBuffers ; b++)
-		for (long h=3 ; h<maxHeight ; h++) {
-			double binomial = Arithmetic.binomial(b+h-2, h-1);
-			long tmp = (long) Math.ceil(N_double / binomial);
-			if ((b * tmp < memory) && 
-					((h-2) * binomial - Arithmetic.binomial(b+h-3, h-3) + Arithmetic.binomial(b+h-3, h-2)
-					<= c) ) {
-				ret_k = tmp ;
-				ret_b = b ;
-				memory = ret_k * b;
-				sampling_rate = 1.0 ;
-			}
-			if (delta > 0.0) {
-				double t = (h-2) * Arithmetic.binomial(b+h-2, h-1) - Arithmetic.binomial(b+h-3, h-3) + Arithmetic.binomial(b+h-3, h-2) ;
-				double u = logarithm / epsilon ;
-				double v = Arithmetic.binomial (b+h-2, h-1) ;
-				double w = logarithm / (2.0*epsilon*epsilon) ;
+  // Otherwise, there are at least two buffers (b >= 2)
+  // and the height of the tree is at least three (h >= 3)
+  //
+  // We restrict the search for b and h to MAX_BINOM, a large enough value for
+  // practical values of    epsilon >= 0.001   and    delta >= 0.00001
+  //
+  final double logarithm = Math.log(2.0*quantiles/delta);
+  final double c = 2.0 * epsilon * N_double;
+  for (long b=2 ; b<maxBuffers ; b++)
+    for (long h=3 ; h<maxHeight ; h++) {
+      double binomial = Arithmetic.binomial(b+h-2, h-1);
+      long tmp = (long) Math.ceil(N_double / binomial);
+      if ((b * tmp < memory) && 
+          ((h-2) * binomial - Arithmetic.binomial(b+h-3, h-3) + Arithmetic.binomial(b+h-3, h-2)
+          <= c) ) {
+        ret_k = tmp ;
+        ret_b = b ;
+        memory = ret_k * b;
+        sampling_rate = 1.0 ;
+      }
+      if (delta > 0.0) {
+        double t = (h-2) * Arithmetic.binomial(b+h-2, h-1) - Arithmetic.binomial(b+h-3, h-3) + Arithmetic.binomial(b+h-3, h-2) ;
+        double u = logarithm / epsilon ;
+        double v = Arithmetic.binomial (b+h-2, h-1) ;
+        double w = logarithm / (2.0*epsilon*epsilon) ;
 
-				// From our SIGMOD 98 paper, we have two equantions to satisfy:
-				// t  <= u * alpha/(1-alpha)^2
-				// kv >= w/(1-alpha)^2
-				//
-				// Denoting 1/(1-alpha)    by x,
-				// we see that the first inequality is equivalent to
-				// t/u <= x^2 - x
-				// which is satisfied by x >= 0.5 + 0.5 * sqrt (1 + 4t/u)
-				// Plugging in this value into second equation yields
-				// k >= wx^2/v
+        // From our SIGMOD 98 paper, we have two equantions to satisfy:
+        // t  <= u * alpha/(1-alpha)^2
+        // kv >= w/(1-alpha)^2
+        //
+        // Denoting 1/(1-alpha)    by x,
+        // we see that the first inequality is equivalent to
+        // t/u <= x^2 - x
+        // which is satisfied by x >= 0.5 + 0.5 * sqrt (1 + 4t/u)
+        // Plugging in this value into second equation yields
+        // k >= wx^2/v
 
-				double x = 0.5 + 0.5 * Math.sqrt(1.0 + 4.0*t/u) ;
-				long k = (long) Math.ceil(w*x*x/v) ;
-				if (b * k < memory) {
-					ret_k = k ;
-					ret_b = b ;
-					memory = b * k ;
-					sampling_rate = N_double*2.0*epsilon*epsilon / logarithm ;
-				}
-			}
-		}
-		
-	long[] result = new long[2];
-	result[0]=ret_b;
-	result[1]=ret_k;
-	returnSamplingRate[0]=sampling_rate;
-	return result;
+        double x = 0.5 + 0.5 * Math.sqrt(1.0 + 4.0*t/u) ;
+        long k = (long) Math.ceil(w*x*x/v) ;
+        if (b * k < memory) {
+          ret_k = k ;
+          ret_b = b ;
+          memory = b * k ;
+          sampling_rate = N_double*2.0*epsilon*epsilon / logarithm ;
+        }
+      }
+    }
+    
+  long[] result = new long[2];
+  result[0]=ret_b;
+  result[1]=ret_k;
+  returnSamplingRate[0]=sampling_rate;
+  return result;
 }
 /**
  * Returns a quantile finder that minimizes the amount of memory needed under the user provided constraints.
@@ -318,8 +316,8 @@
  *
  * @param known_N specifies whether the number of elements over which quantiles are to be computed is known or not.
  * @param N if <tt>known_N==true</tt>, the number of elements over which quantiles are to be computed.
- *			if <tt>known_N==false</tt>, the upper limit on the number of elements over which quantiles are to be computed. 
- * 			If such an upper limit is a-priori unknown, then set <tt>N = Long.MAX_VALUE</tt>.
+ *      if <tt>known_N==false</tt>, the upper limit on the number of elements over which quantiles are to be computed. 
+ *       If such an upper limit is a-priori unknown, then set <tt>N = Long.MAX_VALUE</tt>.
  * @param epsilon the approximation error which is guaranteed not to be exceeded (e.g. <tt>0.001</tt>) (<tt>0 &lt;= epsilon &lt;= 1</tt>). To get exact result, set <tt>epsilon=0.0</tt>;
  * @param delta the probability that the approximation error is more than than epsilon (e.g. 0.0001) (0 &lt;= delta &lt;= 1). To avoid probabilistic answers, set <tt>delta=0.0</tt>.
  * @param quantiles the number of quantiles to be computed (e.g. <tt>100</tt>) (<tt>quantiles &gt;= 1</tt>). If unknown in advance, set this number large, e.g. <tt>quantiles &gt;= 10000</tt>.
@@ -327,62 +325,62 @@
  * @return the quantile finder minimizing memory requirements under the given constraints.
  */
 public static DoubleQuantileFinder newDoubleQuantileFinder(boolean known_N, long N, double epsilon, double delta, int quantiles, RandomEngine generator) {
-	//boolean known_N = true;
-	//if (N==Long.MAX_VALUE) known_N = false;
-	// check parameters.
-	// if they are illegal, keep quite and return an exact finder.
-	if (epsilon <= 0.0 || N < 1000) return new ExactDoubleQuantileFinder();
-	if (epsilon > 1) epsilon = 1;
-	if (delta < 0) delta = 0;
-	if (delta > 1) delta = 1;
-	if (quantiles < 1) quantiles = 1;
-	if (quantiles > N) N = quantiles;
-	
-	KnownDoubleQuantileEstimator finder;
-	if (known_N) {
-		double[] samplingRate = new double[1];
-		long[] resultKnown = known_N_compute_B_and_K(N, epsilon, delta, quantiles, samplingRate);
-		long b = resultKnown[0];
-		long k = resultKnown[1];
-		if (b == 1) return new ExactDoubleQuantileFinder();
-		return new KnownDoubleQuantileEstimator((int)b,(int)k, N, samplingRate[0], generator);
-	}
-	else {
-		long[] resultUnknown = unknown_N_compute_B_and_K(epsilon, delta, quantiles);
-		long b1 = resultUnknown[0];
-		long k1 = resultUnknown[1];
-		long h1 = resultUnknown[2];
-		double preComputeEpsilon = -1.0;
-		if (resultUnknown[3] == 1) preComputeEpsilon = epsilon;
+  //boolean known_N = true;
+  //if (N==Long.MAX_VALUE) known_N = false;
+  // check parameters.
+  // if they are illegal, keep quite and return an exact finder.
+  if (epsilon <= 0.0 || N < 1000) return new ExactDoubleQuantileFinder();
+  if (epsilon > 1) epsilon = 1;
+  if (delta < 0) delta = 0;
+  if (delta > 1) delta = 1;
+  if (quantiles < 1) quantiles = 1;
+  if (quantiles > N) N = quantiles;
+  
+  KnownDoubleQuantileEstimator finder;
+  if (known_N) {
+    double[] samplingRate = new double[1];
+    long[] resultKnown = known_N_compute_B_and_K(N, epsilon, delta, quantiles, samplingRate);
+    long b = resultKnown[0];
+    long k = resultKnown[1];
+    if (b == 1) return new ExactDoubleQuantileFinder();
+    return new KnownDoubleQuantileEstimator((int)b,(int)k, N, samplingRate[0], generator);
+  }
+  else {
+    long[] resultUnknown = unknown_N_compute_B_and_K(epsilon, delta, quantiles);
+    long b1 = resultUnknown[0];
+    long k1 = resultUnknown[1];
+    long h1 = resultUnknown[2];
+    double preComputeEpsilon = -1.0;
+    if (resultUnknown[3] == 1) preComputeEpsilon = epsilon;
 
-		//if (N==Long.MAX_VALUE) { // no maximum N provided by user.
-		
-		// if (true) fixes bug reported by LarryPeranich@fairisaac.com
-		if (true) { // no maximum N provided by user.
-			if (b1 == 1) return new ExactDoubleQuantileFinder();
-			return new UnknownDoubleQuantileEstimator((int)b1,(int)k1, (int)h1, preComputeEpsilon, generator);
-		}
+    //if (N==Long.MAX_VALUE) { // no maximum N provided by user.
+    
+    // if (true) fixes bug reported by LarryPeranich@fairisaac.com
+    if (true) { // no maximum N provided by user.
+      if (b1 == 1) return new ExactDoubleQuantileFinder();
+      return new UnknownDoubleQuantileEstimator((int)b1,(int)k1, (int)h1, preComputeEpsilon, generator);
+    }
 
-		// determine whether UnknownFinder or KnownFinder with maximum N requires less memory.
-		double[] samplingRate = new double[1];
-		
-		// IMPORTANT: for known finder, switch sampling off (delta == 0) !!!
-		// with knownN-sampling we can only guarantee the errors if the input sequence has EXACTLY N elements.
-		// with knownN-no sampling we can also guarantee the errors for sequences SMALLER than N elements.
-		long[] resultKnown = known_N_compute_B_and_K(N, epsilon, 0, quantiles, samplingRate);
-		
-		long b2 = resultKnown[0];
-		long k2 = resultKnown[1];
-		
-		if (b2 * k2 < b1 * k1) { // the KnownFinder is smaller
-			if (b2 == 1) return new ExactDoubleQuantileFinder();
-			return new KnownDoubleQuantileEstimator((int)b2,(int)k2, N, samplingRate[0], generator);
-		}
+    // determine whether UnknownFinder or KnownFinder with maximum N requires less memory.
+    double[] samplingRate = new double[1];
+    
+    // IMPORTANT: for known finder, switch sampling off (delta == 0) !!!
+    // with knownN-sampling we can only guarantee the errors if the input sequence has EXACTLY N elements.
+    // with knownN-no sampling we can also guarantee the errors for sequences SMALLER than N elements.
+    long[] resultKnown = known_N_compute_B_and_K(N, epsilon, 0, quantiles, samplingRate);
+    
+    long b2 = resultKnown[0];
+    long k2 = resultKnown[1];
+    
+    if (b2 * k2 < b1 * k1) { // the KnownFinder is smaller
+      if (b2 == 1) return new ExactDoubleQuantileFinder();
+      return new KnownDoubleQuantileEstimator((int)b2,(int)k2, N, samplingRate[0], generator);
+    }
 
-		// the UnknownFinder is smaller
-		if (b1 == 1) return new ExactDoubleQuantileFinder();
-		return new UnknownDoubleQuantileEstimator((int)b1,(int)k1, (int)h1, preComputeEpsilon, generator);
-	}
+    // the UnknownFinder is smaller
+    if (b1 == 1) return new ExactDoubleQuantileFinder();
+    return new UnknownDoubleQuantileEstimator((int)b1,(int)k1, (int)h1, preComputeEpsilon, generator);
+  }
 }
 /**
  * Convenience method that computes phi's for equi-depth histograms.
@@ -390,9 +388,9 @@
  * @return the equi-depth phi's
  */
 public static org.apache.mahout.matrix.list.DoubleArrayList newEquiDepthPhis(int quantiles) {
-	org.apache.mahout.matrix.list.DoubleArrayList phis = new org.apache.mahout.matrix.list.DoubleArrayList(quantiles-1);
-	for (int i=1; i<=quantiles-1; i++) phis.add(i / (double)quantiles);
-	return phis;
+  org.apache.mahout.matrix.list.DoubleArrayList phis = new org.apache.mahout.matrix.list.DoubleArrayList(quantiles-1);
+  for (int i=1; i<=quantiles-1; i++) phis.add(i / (double)quantiles);
+  return phis;
 }
 /**
  * Computes the number of buffers and number of values per buffer such that
@@ -404,30 +402,30 @@
  * @return <tt>long[4]</tt> - <tt>long[0]</tt>=the number of buffers, <tt>long[1]</tt>=the number of elements per buffer, <tt>long[2]</tt>=the tree height where sampling shall start, <tt>long[3]==1</tt> if precomputing is better, otherwise 0;
  */
 public static long[] unknown_N_compute_B_and_K(double epsilon, double delta, int quantiles) {
-	return unknown_N_compute_B_and_K_raw(epsilon,delta,quantiles);
-	// move stuff from _raw(..) here and delete _raw(...)
-	
-	/*
-	long[] result_1 = unknown_N_compute_B_and_K_raw(epsilon,delta,quantiles);
-	long b1 = result_1[0];
-	long k1 = result_1[1];
+  return unknown_N_compute_B_and_K_raw(epsilon,delta,quantiles);
+  // move stuff from _raw(..) here and delete _raw(...)
+  
+  /*
+  long[] result_1 = unknown_N_compute_B_and_K_raw(epsilon,delta,quantiles);
+  long b1 = result_1[0];
+  long k1 = result_1[1];
 
-	
-	int quantilesToPrecompute = (int) Doubles.ceiling(1.0 / epsilon);
-	
-	if (quantiles>quantilesToPrecompute) {
-		// try if precomputing quantiles requires less memory.
-		long[] result_2 = unknown_N_compute_B_and_K_raw(epsilon/2.0,delta,quantilesToPrecompute);
-		
-		long b2 = result_2[0];
-		long k2 = result_2[1];
-		if (b2*k2 < b1*k1) {
-			result_2[3] = 1; //precomputation is better
-			result_1 = result_2;
-		}
-	}
-	return result_1;
-	*/
+  
+  int quantilesToPrecompute = (int) Doubles.ceiling(1.0 / epsilon);
+  
+  if (quantiles>quantilesToPrecompute) {
+    // try if precomputing quantiles requires less memory.
+    long[] result_2 = unknown_N_compute_B_and_K_raw(epsilon/2.0,delta,quantilesToPrecompute);
+    
+    long b2 = result_2[0];
+    long k2 = result_2[1];
+    if (b2*k2 < b1*k1) {
+      result_2[3] = 1; //precomputation is better
+      result_1 = result_2;
+    }
+  }
+  return result_1;
+  */
 }
 /**
  * Computes the number of buffers and number of values per buffer such that
@@ -440,136 +438,136 @@
  * @return <tt>long[4]</tt> - <tt>long[0]</tt>=the number of buffers, <tt>long[1]</tt>=the number of elements per buffer, <tt>long[2]</tt>=the tree height where sampling shall start, <tt>long[3]==1</tt> if precomputing is better, otherwise 0;
  */
 protected static long[] unknown_N_compute_B_and_K_raw(double epsilon, double delta, int quantiles) {
-	// delta can be set to zero, i.e., all quantiles should be approximate with probability 1	
-	if (epsilon<=0.0) {
-		long[] result = new long[4];
-		result[0]=1;
-		result[1]=Long.MAX_VALUE;
-		result[2]=Long.MAX_VALUE;
-		result[3]=0;
-		return result;
-	}
-	if (epsilon>=1.0 || delta>=1.0) {
-		// can make any error we wish
-		long[] result = new long[4];
-		result[0]=2;
-		result[1]=1;
-		result[2]=3;
-		result[3]=0;
-		return result;
-	}
-	if (delta<=0.0) {
-		// no way around exact quantile search
-		long[] result = new long[4];
-		result[0]=1;
-		result[1]=Long.MAX_VALUE;
-		result[2]=Long.MAX_VALUE;
-		result[3]=0;
-		return result;
-	}
+  // delta can be set to zero, i.e., all quantiles should be approximate with probability 1  
+  if (epsilon<=0.0) {
+    long[] result = new long[4];
+    result[0]=1;
+    result[1]=Long.MAX_VALUE;
+    result[2]=Long.MAX_VALUE;
+    result[3]=0;
+    return result;
+  }
+  if (epsilon>=1.0 || delta>=1.0) {
+    // can make any error we wish
+    long[] result = new long[4];
+    result[0]=2;
+    result[1]=1;
+    result[2]=3;
+    result[3]=0;
+    return result;
+  }
+  if (delta<=0.0) {
+    // no way around exact quantile search
+    long[] result = new long[4];
+    result[0]=1;
+    result[1]=Long.MAX_VALUE;
+    result[2]=Long.MAX_VALUE;
+    result[3]=0;
+    return result;
+  }
 
-	int max_b = 50;
-	int max_h = 50;
-	int max_H = 50;
-	int max_Iterations = 2;
+  int max_b = 50;
+  int max_h = 50;
+  int max_H = 50;
+  int max_Iterations = 2;
 
-	long best_b = Long.MAX_VALUE;
-	long best_k = Long.MAX_VALUE;
-	long best_h = Long.MAX_VALUE;
-	long best_memory = Long.MAX_VALUE;
+  long best_b = Long.MAX_VALUE;
+  long best_k = Long.MAX_VALUE;
+  long best_h = Long.MAX_VALUE;
+  long best_memory = Long.MAX_VALUE;
 
-	double pow = Math.pow(2.0, max_H);
-	double logDelta =  Math.log(2.0/(delta/quantiles)) / (2.0*epsilon*epsilon);
-	//double logDelta =  Math.log(2.0/(quantiles*delta)) / (2.0*epsilon*epsilon);
+  double pow = Math.pow(2.0, max_H);
+  double logDelta =  Math.log(2.0/(delta/quantiles)) / (2.0*epsilon*epsilon);
+  //double logDelta =  Math.log(2.0/(quantiles*delta)) / (2.0*epsilon*epsilon);
 
-	while (best_b == Long.MAX_VALUE && max_Iterations-- > 0) { //until we find a solution
-		// identify that combination of b and h that minimizes b*k.
-		// exhaustive search.
-		for (int b=2; b<=max_b; b++) {
-			for (int h=2; h<=max_h; h++) {
-				double Ld = Arithmetic.binomial(b+h-2, h-1);
-				double Ls = Arithmetic.binomial(b+h-3,h-1);
-				
-				// now we have k>=c*(1-alpha)^-2.
-				// let's compute c.
-				//double c = Math.log(2.0/(delta/quantiles)) / (2.0*epsilon*epsilon*Math.min(Ld, 8.0*Ls/3.0));
-				double c = logDelta / Math.min(Ld, 8.0*Ls/3.0);
+  while (best_b == Long.MAX_VALUE && max_Iterations-- > 0) { //until we find a solution
+    // identify that combination of b and h that minimizes b*k.
+    // exhaustive search.
+    for (int b=2; b<=max_b; b++) {
+      for (int h=2; h<=max_h; h++) {
+        double Ld = Arithmetic.binomial(b+h-2, h-1);
+        double Ls = Arithmetic.binomial(b+h-3,h-1);
+        
+        // now we have k>=c*(1-alpha)^-2.
+        // let's compute c.
+        //double c = Math.log(2.0/(delta/quantiles)) / (2.0*epsilon*epsilon*Math.min(Ld, 8.0*Ls/3.0));
+        double c = logDelta / Math.min(Ld, 8.0*Ls/3.0);
 
-				// now we have k>=d/alpha.
-				// let's compute d.				
-				double beta = Ld/Ls;
-				double cc = (beta-2.0)*(max_H-2.0) / (beta + pow - 2.0);
-				double d = (h+3+cc) / (2.0*epsilon);
-				
-				/*
-				double d = (Ld*(h+max_H-1.0)  +  Ls*((h+1)*pow - 2.0*(h+max_H)))   /   (Ld + Ls*(pow-2.0));
-				d = (d + 2.0) / (2.0*epsilon);
-				*/
+        // now we have k>=d/alpha.
+        // let's compute d.        
+        double beta = Ld/Ls;
+        double cc = (beta-2.0)*(max_H-2.0) / (beta + pow - 2.0);
+        double d = (h+3+cc) / (2.0*epsilon);
+        
+        /*
+        double d = (Ld*(h+max_H-1.0)  +  Ls*((h+1)*pow - 2.0*(h+max_H)))   /   (Ld + Ls*(pow-2.0));
+        d = (d + 2.0) / (2.0*epsilon);
+        */
 
-				// now we have c*(1-alpha)^-2 == d/alpha.
-				// we solve this equation for alpha yielding two solutions
-				// alpha_1,2 = (c + 2*d  +-  Sqrt(c*c + 4*c*d))/(2*d)				
-				double f = c*c + 4.0*c*d;
-				if (f<0.0) continue; // non real solution to equation
-				double root = Math.sqrt(f);
-				double alpha_one = (c + 2.0*d + root)/(2.0*d);
-				double alpha_two = (c + 2.0*d - root)/(2.0*d);
+        // now we have c*(1-alpha)^-2 == d/alpha.
+        // we solve this equation for alpha yielding two solutions
+        // alpha_1,2 = (c + 2*d  +-  Sqrt(c*c + 4*c*d))/(2*d)        
+        double f = c*c + 4.0*c*d;
+        if (f<0.0) continue; // non real solution to equation
+        double root = Math.sqrt(f);
+        double alpha_one = (c + 2.0*d + root)/(2.0*d);
+        double alpha_two = (c + 2.0*d - root)/(2.0*d);
 
-				// any alpha must satisfy 0<alpha<1 to yield valid solutions
-				boolean alpha_one_OK = false;
-				boolean alpha_two_OK = false;
-				if (0.0 < alpha_one && alpha_one < 1.0) alpha_one_OK = true;
-				if (0.0 < alpha_two && alpha_two < 1.0) alpha_two_OK = true;
-				if (alpha_one_OK || alpha_two_OK) {
-					double alpha = alpha_one;
-					if (alpha_one_OK && alpha_two_OK) {
-						// take the alpha that minimizes d/alpha
-						alpha = Math.max(alpha_one, alpha_two);
-					}
-					else if (alpha_two_OK) {
-						alpha = alpha_two;
-					}
+        // any alpha must satisfy 0<alpha<1 to yield valid solutions
+        boolean alpha_one_OK = false;
+        boolean alpha_two_OK = false;
+        if (0.0 < alpha_one && alpha_one < 1.0) alpha_one_OK = true;
+        if (0.0 < alpha_two && alpha_two < 1.0) alpha_two_OK = true;
+        if (alpha_one_OK || alpha_two_OK) {
+          double alpha = alpha_one;
+          if (alpha_one_OK && alpha_two_OK) {
+            // take the alpha that minimizes d/alpha
+            alpha = Math.max(alpha_one, alpha_two);
+          }
+          else if (alpha_two_OK) {
+            alpha = alpha_two;
+          }
 
-					// now we have k=Ceiling(Max(d/alpha, (h+1)/(2*epsilon)))
-					long k = (long) Math.ceil(Math.max(d/alpha, (h+1)/(2.0*epsilon)));
-					if (k>0) { // valid solution?
-						long memory = b*k;
-						if (memory < best_memory) { 
-							// found a solution requiring less memory
-							best_k = k;
-							best_b = b;
-							best_h = h;
-							best_memory = memory;
-						}
-					}
-				}
-			} //end for h
-		} //end for b
-		
-		if (best_b == Long.MAX_VALUE) {
-			System.out.println("Warning: Computing b and k looks like a lot of work!");
-			// no solution found so far. very unlikely. Anyway, try again.
-			max_b *= 2;
-			max_h *= 2;
-			max_H *= 2;
-		}
-	} //end while
+          // now we have k=Ceiling(Max(d/alpha, (h+1)/(2*epsilon)))
+          long k = (long) Math.ceil(Math.max(d/alpha, (h+1)/(2.0*epsilon)));
+          if (k>0) { // valid solution?
+            long memory = b*k;
+            if (memory < best_memory) { 
+              // found a solution requiring less memory
+              best_k = k;
+              best_b = b;
+              best_h = h;
+              best_memory = memory;
+            }
+          }
+        }
+      } //end for h
+    } //end for b
+    
+    if (best_b == Long.MAX_VALUE) {
+      System.out.println("Warning: Computing b and k looks like a lot of work!");
+      // no solution found so far. very unlikely. Anyway, try again.
+      max_b *= 2;
+      max_h *= 2;
+      max_H *= 2;
+    }
+  } //end while
 
-	long[] result = new long[4];
-	result[3]=0;
-	if (best_b == Long.MAX_VALUE) {
-		// no solution found.
-		// no way around exact quantile search.
-		result[0]=1;
-		result[1]=Long.MAX_VALUE;
-		result[2]=Long.MAX_VALUE;
-	}
-	else {
-		result[0]=best_b;
-		result[1]=best_k;
-		result[2]=best_h;
-	}
+  long[] result = new long[4];
+  result[3]=0;
+  if (best_b == Long.MAX_VALUE) {
+    // no solution found.
+    // no way around exact quantile search.
+    result[0]=1;
+    result[1]=Long.MAX_VALUE;
+    result[2]=Long.MAX_VALUE;
+  }
+  else {
+    result[0]=best_b;
+    result[1]=best_k;
+    result[2]=best_h;
+  }
 
-	return result;
+  return result;
 }
 }
Index: matrix/src/main/java/org/apache/mahout/jet/stat/quantile/Quantile1Test.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/jet/stat/quantile/Quantile1Test.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/jet/stat/quantile/Quantile1Test.java	(working copy)
@@ -17,82 +17,82 @@
 @Deprecated
 public class Quantile1Test {
     public static void main(String[] argv) {
-	/*
-	 * Get the number of examples from the first argument
-	 */
-	int numExamples = 0;
-	try {
-	    numExamples = Integer.parseInt(argv[0]);
-	}
-	catch (Exception e) {
-	    System.err.println("Unable to parse input line count argument");
-	    System.err.println(e.getMessage());
-	    System.exit(1);
-	}
-	System.out.println("Got numExamples=" + numExamples);
+  /*
+   * Get the number of examples from the first argument
+   */
+  int numExamples = 0;
+  try {
+      numExamples = Integer.parseInt(argv[0]);
+  }
+  catch (Exception e) {
+      System.err.println("Unable to parse input line count argument");
+      System.err.println(e.getMessage());
+      System.exit(1);
+  }
+  System.out.println("Got numExamples=" + numExamples);
 
-	/*
-	 * Get N from the second argument
-	 */
-	long N = 0;
-	try {
-	    if (argv[1].equals("L")) {
-		N = Long.MAX_VALUE;
-	    } else if (argv[1].equals("I")) {
-		N = (long)Integer.MAX_VALUE;
-	    } else {
-		N = Long.parseLong(argv[1]);
-	    }
-	}
-	catch (Exception e) {
-	    System.err.println("Error parsing flag for N");
-	    System.err.println(e.getMessage());
-	    System.exit(1);
-	}
-	System.out.println("Got N=" + N);
+  /*
+   * Get N from the second argument
+   */
+  long N = 0;
+  try {
+      if (argv[1].equals("L")) {
+    N = Long.MAX_VALUE;
+      } else if (argv[1].equals("I")) {
+    N = (long)Integer.MAX_VALUE;
+      } else {
+    N = Long.parseLong(argv[1]);
+      }
+  }
+  catch (Exception e) {
+      System.err.println("Error parsing flag for N");
+      System.err.println(e.getMessage());
+      System.exit(1);
+  }
+  System.out.println("Got N=" + N);
 
-	/*
-	 * Set up the QuantileBin1D object
-	 *
-	DRand rand = new DRand(new Date());
-	QuantileBin1D qAccum = new QuantileBin1D(false,
-						 N,
-						 1.e-4,
-						 1.e-3,
-						 200,
-						 rand,
-						 false,
-						 false,
-						 2);
+  /*
+   * Set up the QuantileBin1D object
+   *
+  DRand rand = new DRand(new Date());
+  QuantileBin1D qAccum = new QuantileBin1D(false,
+             N,
+             1.e-4,
+             1.e-3,
+             200,
+             rand,
+             false,
+             false,
+             2);
 
-	DynamicBin1D dbin = new DynamicBin1D();
-	
-	*
-	 * Use a new random number generator to generate numExamples
-	 * random gaussians, and add them to the QuantileBin1D
-	 *
-	Uniform dataRand = new Uniform(new DRand(7757));
-	for (int i = 1; i <= numExamples; i++) {
-		double gauss = dataRand.nextDouble();
-	    qAccum.add(gauss);
-	    dbin.add(gauss);
-	}
-	
-	*
-	 * print out the percentiles
-	 *
-	DecimalFormat fmt = new DecimalFormat("0.00");
-	System.out.println();
-	//int step = 1;
-	int step = 10;
-	for (int i = 1; i < 100; ) {
-	    double percent = ((double)i) * 0.01;
-	    double quantile = qAccum.quantile(percent);
-	    System.out.println(fmt.format(percent) + "  " + quantile + ",  " + dbin.quantile(percent)+ ",  " + (dbin.quantile(percent)-quantile));
-	    i = i + step;
-	    *
-	}
-	*/
+  DynamicBin1D dbin = new DynamicBin1D();
+  
+  *
+   * Use a new random number generator to generate numExamples
+   * random gaussians, and add them to the QuantileBin1D
+   *
+  Uniform dataRand = new Uniform(new DRand(7757));
+  for (int i = 1; i <= numExamples; i++) {
+    double gauss = dataRand.nextDouble();
+      qAccum.add(gauss);
+      dbin.add(gauss);
+  }
+  
+  *
+   * print out the percentiles
+   *
+  DecimalFormat fmt = new DecimalFormat("0.00");
+  System.out.println();
+  //int step = 1;
+  int step = 10;
+  for (int i = 1; i < 100; ) {
+      double percent = ((double)i) * 0.01;
+      double quantile = qAccum.quantile(percent);
+      System.out.println(fmt.format(percent) + "  " + quantile + ",  " + dbin.quantile(percent)+ ",  " + (dbin.quantile(percent)-quantile));
+      i = i + step;
+      *
+  }
+  */
 }
 }
 
Index: matrix/src/main/java/org/apache/mahout/jet/stat/quantile/DoubleBuffer.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/jet/stat/quantile/DoubleBuffer.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/jet/stat/quantile/DoubleBuffer.java	(working copy)
@@ -13,45 +13,45 @@
  * A buffer holding <tt>double</tt> elements; internally used for computing approximate quantiles.
  */
 class DoubleBuffer extends Buffer {
-	protected DoubleArrayList values;
-	protected boolean isSorted;
+  protected DoubleArrayList values;
+  protected boolean isSorted;
 /**
  * This method was created in VisualAge.
  * @param k int
  */
 public DoubleBuffer(int k) {
-	super(k);
-	this.values = new DoubleArrayList(0);
-	this.isSorted = false;
+  super(k);
+  this.values = new DoubleArrayList(0);
+  this.isSorted = false;
 }
 /**
  * Adds a value to the receiver.
  */
 public void add(double value) {
-	if (! isAllocated) allocate(); // lazy buffer allocation can safe memory.
-	values.add(value);
-	this.isSorted = false;
+  if (! isAllocated) allocate(); // lazy buffer allocation can safe memory.
+  values.add(value);
+  this.isSorted = false;
 }
 /**
  * Adds a value to the receiver.
  */
 public void addAllOfFromTo(DoubleArrayList elements,int from, int to) {
-	if (! isAllocated) allocate(); // lazy buffer allocation can safe memory.
-	values.addAllOfFromTo(elements,from,to);
-	this.isSorted = false;
+  if (! isAllocated) allocate(); // lazy buffer allocation can safe memory.
+  values.addAllOfFromTo(elements,from,to);
+  this.isSorted = false;
 }
 /**
  * Allocates the receiver.
  */
 protected void allocate() {
-	isAllocated = true;
-	values.ensureCapacity(k);
+  isAllocated = true;
+  values.ensureCapacity(k);
 }
 /**
  * Clears the receiver.
  */
 public void clear() {
-	values.clear();
+  values.clear();
 }
 /**
  * Returns a deep copy of the receiver.
@@ -59,35 +59,35 @@
  * @return a deep copy of the receiver.
  */
 public Object clone() {
-	DoubleBuffer copy = (DoubleBuffer) super.clone();
-	if (this.values != null) copy.values = copy.values.copy();
-	return copy;
+  DoubleBuffer copy = (DoubleBuffer) super.clone();
+  if (this.values != null) copy.values = copy.values.copy();
+  return copy;
 }
 /**
  * Returns whether the specified element is contained in the receiver.
  */
 public boolean contains(double element) {
-	this.sort();
-	return values.contains(element);
+  this.sort();
+  return values.contains(element);
 }
 /**
  * Returns whether the receiver is empty.
  */
 public boolean isEmpty() {
-	return values.size()==0;
+  return values.size()==0;
 }
 /**
  * Returns whether the receiver is empty.
  */
 public boolean isFull() {
-	return values.size()==k;
+  return values.size()==k;
 }
 /**
  * Returns the number of elements currently needed to store all contained elements.
  * This number usually differs from the results of method <tt>size()</tt>, according to the underlying algorithm.
  */
 public int memory() {
-	return values.elements().length;
+  return values.elements().length;
 }
 /**
  * Returns the rank of a given element within the sorted sequence of the receiver.
@@ -100,35 +100,35 @@
  * @param element the element to search for
  */
 public double rank(double element) {
-	this.sort();
-	return org.apache.mahout.jet.stat.Descriptive.rankInterpolated(this.values, element);
+  this.sort();
+  return org.apache.mahout.jet.stat.Descriptive.rankInterpolated(this.values, element);
 }
 /**
  * Returns the number of elements contained in the receiver.
  */
 public int size() {
-	return values.size();
+  return values.size();
 }
 /**
  * Sorts the receiver.
  */
 public void sort() {
-	if (! this.isSorted) {
-		// IMPORTANT: TO DO : replace mergeSort with quickSort!
-		// currently it is mergeSort only for debugging purposes (JDK 1.2 can't be imported into VisualAge).
-		values.sort();
-		//values.mergeSort();
-		this.isSorted = true;
-	}
+  if (! this.isSorted) {
+    // IMPORTANT: TO DO : replace mergeSort with quickSort!
+    // currently it is mergeSort only for debugging purposes (JDK 1.2 can't be imported into VisualAge).
+    values.sort();
+    //values.mergeSort();
+    this.isSorted = true;
+  }
 }
 /**
  * Returns a String representation of the receiver.
  */
 public String toString() {
-	return	"k="+this.k +
-			", w="+Long.toString(weight()) +
-			", l="+Integer.toString(level()) + 
-			", size=" + values.size();
-			//", v=" + values.toString();
+  return  "k="+this.k +
+      ", w="+Long.toString(weight()) +
+      ", l="+Integer.toString(level()) + 
+      ", size=" + values.size();
+      //", v=" + values.toString();
 }
 }
Index: matrix/src/main/java/org/apache/mahout/jet/stat/quantile/DoubleQuantileEstimator.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/jet/stat/quantile/DoubleQuantileEstimator.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/jet/stat/quantile/DoubleQuantileEstimator.java	(working copy)
@@ -15,9 +15,9 @@
   */
 //abstract class ApproximateDoubleQuantileFinder extends Object implements DoubleQuantileFinder {
 abstract class DoubleQuantileEstimator extends org.apache.mahout.matrix.PersistentObject implements DoubleQuantileFinder {
-	protected DoubleBufferSet bufferSet;
-	protected DoubleBuffer currentBufferToFill;
-	protected int totalElementsFilled;
+  protected DoubleBufferSet bufferSet;
+  protected DoubleBuffer currentBufferToFill;
+  protected int totalElementsFilled;
 /**
  * Makes this class non instantiable, but still let's others inherit from it.
  */
@@ -27,25 +27,25 @@
  * @param value the value to add.
  */
 public void add(double value) {
-	totalElementsFilled++;
-	if (! sampleNextElement()) return;
+  totalElementsFilled++;
+  if (! sampleNextElement()) return;
 
-	//System.out.println("adding "+value);
+  //System.out.println("adding "+value);
 
-	if (currentBufferToFill==null) { 
-		if (bufferSet._getFirstEmptyBuffer()==null) collapse();
-		newBuffer();
-	}
+  if (currentBufferToFill==null) { 
+    if (bufferSet._getFirstEmptyBuffer()==null) collapse();
+    newBuffer();
+  }
 
-	currentBufferToFill.add(value);
-	if (currentBufferToFill.isFull()) currentBufferToFill = null;
+  currentBufferToFill.add(value);
+  if (currentBufferToFill.isFull()) currentBufferToFill = null;
 }
 /**
  * Adds all values of the specified list to the receiver.
  * @param values the list of which all values shall be added.
  */
 public void addAllOf(DoubleArrayList values) {
-	addAllOfFromTo(values,0,values.size()-1);
+  addAllOfFromTo(values,0,values.size()-1);
 }
 /**
  * Adds the part of the specified list between indexes <tt>from</tt> (inclusive) and <tt>to</tt> (inclusive) to the receiver.
@@ -55,61 +55,61 @@
  * @param to the index of the last element to be added (inclusive).
  */
 public void addAllOfFromTo(DoubleArrayList values, int from, int to) {
-	/*
-	// the obvious version, but we can do quicker...
-	double[] theValues = values.elements();
-	int theSize=values.size();
-	for (int i=0; i<theSize; ) add(theValues[i++]);
-	*/
-	
-	double[] valuesToAdd = values.elements();
-	int k = this.bufferSet.k();
-	int bufferSize = k;
-	double[] bufferValues = null;
-	if (currentBufferToFill != null) {
-		bufferValues = currentBufferToFill.values.elements();
-		bufferSize = currentBufferToFill.size();
-	}
+  /*
+  // the obvious version, but we can do quicker...
+  double[] theValues = values.elements();
+  int theSize=values.size();
+  for (int i=0; i<theSize; ) add(theValues[i++]);
+  */
+  
+  double[] valuesToAdd = values.elements();
+  int k = this.bufferSet.k();
+  int bufferSize = k;
+  double[] bufferValues = null;
+  if (currentBufferToFill != null) {
+    bufferValues = currentBufferToFill.values.elements();
+    bufferSize = currentBufferToFill.size();
+  }
 
-	for (int i=from-1; ++i <= to; ) {
-		if (sampleNextElement()) {
-			if (bufferSize == k) { // full
-				if (bufferSet._getFirstEmptyBuffer()==null) collapse();
-				newBuffer();
-				if (!currentBufferToFill.isAllocated) currentBufferToFill.allocate();
-				currentBufferToFill.isSorted = false;
-				bufferValues = currentBufferToFill.values.elements();
-				bufferSize = 0;
-			}
+  for (int i=from-1; ++i <= to; ) {
+    if (sampleNextElement()) {
+      if (bufferSize == k) { // full
+        if (bufferSet._getFirstEmptyBuffer()==null) collapse();
+        newBuffer();
+        if (!currentBufferToFill.isAllocated) currentBufferToFill.allocate();
+        currentBufferToFill.isSorted = false;
+        bufferValues = currentBufferToFill.values.elements();
+        bufferSize = 0;
+      }
 
-			bufferValues[bufferSize++] = valuesToAdd[i];
-			if (bufferSize == k) { // full
-				currentBufferToFill.values.setSize(bufferSize);
-				currentBufferToFill = null;
-			}
-		}
-	}
-	if (this.currentBufferToFill != null) {
-		this.currentBufferToFill.values.setSize(bufferSize);
-	}
-	
-	this.totalElementsFilled += to-from+1;
+      bufferValues[bufferSize++] = valuesToAdd[i];
+      if (bufferSize == k) { // full
+        currentBufferToFill.values.setSize(bufferSize);
+        currentBufferToFill = null;
+      }
+    }
+  }
+  if (this.currentBufferToFill != null) {
+    this.currentBufferToFill.values.setSize(bufferSize);
+  }
+  
+  this.totalElementsFilled += to-from+1;
 }
 /**
  * Not yet commented.
  */
 protected DoubleBuffer[] buffersToCollapse() {
-	int minLevel = bufferSet._getMinLevelOfFullOrPartialBuffers();
-	return bufferSet._getFullOrPartialBuffersWithLevel(minLevel);
+  int minLevel = bufferSet._getMinLevelOfFullOrPartialBuffers();
+  return bufferSet._getFullOrPartialBuffersWithLevel(minLevel);
 }
 /**
  * Removes all elements from the receiver.  The receiver will
  * be empty after this call returns, and its memory requirements will be close to zero.
  */
 public void clear() {
-	this.totalElementsFilled = 0;
-	this.currentBufferToFill = null;
-	this.bufferSet.clear();
+  this.totalElementsFilled = 0;
+  this.currentBufferToFill = null;
+  this.bufferSet.clear();
 }
 /**
  * Returns a deep copy of the receiver.
@@ -117,33 +117,33 @@
  * @return a deep copy of the receiver.
  */
 public Object clone() {
-	DoubleQuantileEstimator copy = (DoubleQuantileEstimator) super.clone();
-	if (this.bufferSet != null) {
-		copy.bufferSet = (DoubleBufferSet) copy.bufferSet.clone();
-		if (this.currentBufferToFill != null) {
-			 int index = new ObjectArrayList(this.bufferSet.buffers).indexOf(this.currentBufferToFill, true);
-			 copy.currentBufferToFill = copy.bufferSet.buffers[index];
-		}		
-	}
-	return copy;
+  DoubleQuantileEstimator copy = (DoubleQuantileEstimator) super.clone();
+  if (this.bufferSet != null) {
+    copy.bufferSet = (DoubleBufferSet) copy.bufferSet.clone();
+    if (this.currentBufferToFill != null) {
+       int index = new ObjectArrayList(this.bufferSet.buffers).indexOf(this.currentBufferToFill, true);
+       copy.currentBufferToFill = copy.bufferSet.buffers[index];
+    }    
+  }
+  return copy;
 }
 /**
  * Not yet commented.
  */
 protected void collapse() {
-	DoubleBuffer[] toCollapse = buffersToCollapse();
-	DoubleBuffer outputBuffer = bufferSet.collapse(toCollapse);
+  DoubleBuffer[] toCollapse = buffersToCollapse();
+  DoubleBuffer outputBuffer = bufferSet.collapse(toCollapse);
 
-	int minLevel = toCollapse[0].level();
-	outputBuffer.level(minLevel + 1);
+  int minLevel = toCollapse[0].level();
+  outputBuffer.level(minLevel + 1);
 
-	postCollapse(toCollapse);
+  postCollapse(toCollapse);
 }
 /**
  * Returns whether the specified element is contained in the receiver.
  */
 public boolean contains(double element) {
-	return bufferSet.contains(element);
+  return bufferSet.contains(element);
 }
 /**
  * Applies a procedure to each element of the receiver, if any.
@@ -152,14 +152,14 @@
  * @return <tt>false</tt> if the procedure stopped before all elements where iterated over, <tt>true</tt> otherwise. 
  */
 public boolean forEach(org.apache.mahout.matrix.function.DoubleProcedure procedure) {
-	return this.bufferSet.forEach(procedure);
+  return this.bufferSet.forEach(procedure);
 }
 /**
  * Returns the number of elements currently needed to store all contained elements.
  * This number usually differs from the results of method <tt>size()</tt>, according to the underlying datastructure.
  */
 public long memory() {
-	return bufferSet.memory();
+  return bufferSet.memory();
 }
 /**
  * Not yet commented.
@@ -173,7 +173,7 @@
  * @return the percentage <tt>p</tt> of elements <tt>&lt;= element</tt> (<tt>0.0 &lt;= p &lt;=1.0)</tt>.
  */
 public double phi(double element) {
-	return bufferSet.phi(element);
+  return bufferSet.phi(element);
 }
 /**
  * Not yet commented.
@@ -183,7 +183,7 @@
  * Default implementation does nothing.
  */
 protected DoubleArrayList preProcessPhis(DoubleArrayList phis) {
-	return phis;
+  return phis;
 }
 /**
  * Computes the specified quantile elements over the values previously added.
@@ -191,34 +191,34 @@
  * @return the approximate quantile elements.
  */
 public DoubleArrayList quantileElements(DoubleArrayList phis) {
-	/*
-	//check parameter
-	DoubleArrayList sortedPhiList = phis.copy();
-	sortedPhiList.sort();
-	if (! phis.equals(sortedPhiList)) {
-		throw new IllegalArgumentException("Phis must be sorted ascending.");
-	}
-	*/
+  /*
+  //check parameter
+  DoubleArrayList sortedPhiList = phis.copy();
+  sortedPhiList.sort();
+  if (! phis.equals(sortedPhiList)) {
+    throw new IllegalArgumentException("Phis must be sorted ascending.");
+  }
+  */
 
-	//System.out.println("starting to augment missing values, if necessary...");
+  //System.out.println("starting to augment missing values, if necessary...");
 
-	phis = preProcessPhis(phis);
-	
-	long[] triggerPositions = new long[phis.size()];
-	long totalSize = this.bufferSet.totalSize();
-	for (int i=phis.size(); --i >=0;) {
-		triggerPositions[i]=Utils.epsilonCeiling(phis.get(i) * totalSize)-1;
-	}
+  phis = preProcessPhis(phis);
+  
+  long[] triggerPositions = new long[phis.size()];
+  long totalSize = this.bufferSet.totalSize();
+  for (int i=phis.size(); --i >=0;) {
+    triggerPositions[i]=Utils.epsilonCeiling(phis.get(i) * totalSize)-1;
+  }
 
-	//System.out.println("triggerPositions="+org.apache.mahout.matrix.Arrays.toString(triggerPositions));
-	//System.out.println("starting to determine quantiles...");
-	//System.out.println(bufferSet);
+  //System.out.println("triggerPositions="+org.apache.mahout.matrix.Arrays.toString(triggerPositions));
+  //System.out.println("starting to determine quantiles...");
+  //System.out.println(bufferSet);
 
-	DoubleBuffer[] fullBuffers = bufferSet._getFullOrPartialBuffers();
-	double[] quantileElements = new double[phis.size()];
+  DoubleBuffer[] fullBuffers = bufferSet._getFullOrPartialBuffers();
+  double[] quantileElements = new double[phis.size()];
 
-	//do the main work: determine values at given positions in sorted sequence
-	return new DoubleArrayList(bufferSet.getValuesAtPositions(fullBuffers, triggerPositions));
+  //do the main work: determine values at given positions in sorted sequence
+  return new DoubleArrayList(bufferSet.getValuesAtPositions(fullBuffers, triggerPositions));
 }
 /**
  * Not yet commented.
@@ -228,33 +228,33 @@
  * Initializes the receiver
  */
 protected void setUp(int b, int k) {
-	if (!(b>=2 && k>=1)) {
-		throw new IllegalArgumentException("Assertion: b>=2 && k>=1");
-	}
-	this.bufferSet = new DoubleBufferSet(b,k);
-	this.clear();
+  if (!(b>=2 && k>=1)) {
+    throw new IllegalArgumentException("Assertion: b>=2 && k>=1");
+  }
+  this.bufferSet = new DoubleBufferSet(b,k);
+  this.clear();
 }
 /**
  * Returns the number of elements currently contained in the receiver (identical to the number of values added so far).
  */
 public long size() {
-	return totalElementsFilled;
+  return totalElementsFilled;
 }
 /**
  * Returns a String representation of the receiver.
  */
 public String toString() {
-	String s=this.getClass().getName();
-	s = s.substring(s.lastIndexOf('.')+1);
-	int b = bufferSet.b();
-	int k = bufferSet.k();
-	return s + "(mem="+memory()+", b="+b+", k="+k+", size="+size()+", totalSize="+this.bufferSet.totalSize()+")";
+  String s=this.getClass().getName();
+  s = s.substring(s.lastIndexOf('.')+1);
+  int b = bufferSet.b();
+  int k = bufferSet.k();
+  return s + "(mem="+memory()+", b="+b+", k="+k+", size="+size()+", totalSize="+this.bufferSet.totalSize()+")";
 }
 /**
  * Returns the number of elements currently needed to store all contained elements.
  * This number usually differs from the results of method <tt>size()</tt>, according to the underlying datastructure.
  */
 public long totalMemory() {
-	return bufferSet.b()*bufferSet.k();
+  return bufferSet.b()*bufferSet.k();
 }
 }
Index: matrix/src/main/java/org/apache/mahout/jet/stat/quantile/QuantileCalc.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/jet/stat/quantile/QuantileCalc.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/jet/stat/quantile/QuantileCalc.java	(working copy)
@@ -18,19 +18,19 @@
  * Tries to avoid numeric overflows. 
  * @return the binomial coefficient.
  */
-public static double binomial(long n, long k) {	
-	if (k==0 || k==n) {return 1.0;}
+public static double binomial(long n, long k) {  
+  if (k==0 || k==n) {return 1.0;}
 
-	// since binomial(n,k)==binomial(n,n-k), we can enforce the faster variant,
-	// which is also the variant minimizing number overflows.
-	if (k>n/2.0) k=n-k;
-	
-	double binomial=1.0;
-	long N=n-k+1;
-	for (long i=k; i>0; ) {
-		binomial *= ((double) N++) / (double) (i--);
-	}
-	return binomial;
+  // since binomial(n,k)==binomial(n,n-k), we can enforce the faster variant,
+  // which is also the variant minimizing number overflows.
+  if (k>n/2.0) k=n-k;
+  
+  double binomial=1.0;
+  long N=n-k+1;
+  for (long i=k; i>0; ) {
+    binomial *= ((double) N++) / (double) (i--);
+  }
+  return binomial;
 }
 /**
  * Returns the smallest <code>long &gt;= value</code>.
@@ -38,7 +38,7 @@
  * This method is safer than using (long) Math.ceil(value), because of possible rounding error.
  */
 public static long ceiling(double value) {
-	return Math.round(Math.ceil(value));
+  return Math.round(Math.ceil(value));
 }
 /**
  * Computes the number of buffers and number of values per buffer such that
@@ -55,11 +55,11 @@
  * @return <tt>long[2]</tt> - <tt>long[0]</tt>=the number of buffers, <tt>long[1]</tt>=the number of elements per buffer, <tt>returnSamplingRate[0]</tt>=the required sampling rate.
  */
 public static long[] known_N_compute_B_and_K(long N, double epsilon, double delta, int quantiles, double[] returnSamplingRate) {
-	if (delta > 0.0) {
-		return known_N_compute_B_and_K_slow(N, epsilon, delta, quantiles, returnSamplingRate);
-	}
-	returnSamplingRate[0] = 1.0;
-	return known_N_compute_B_and_K_quick(N, epsilon);
+  if (delta > 0.0) {
+    return known_N_compute_B_and_K_slow(N, epsilon, delta, quantiles, returnSamplingRate);
+  }
+  returnSamplingRate[0] = 1.0;
+  return known_N_compute_B_and_K_quick(N, epsilon);
 }
 /**
  * Computes the number of buffers and number of values per buffer such that
@@ -70,100 +70,100 @@
  * @param epsilon the approximation error which is guaranteed not to be exceeded (e.g. <tt>0.001</tt>) (<tt>0 &lt;= epsilon &lt;= 1</tt>). To get exact result, set <tt>epsilon=0.0</tt>;
  */
 protected static long[] known_N_compute_B_and_K_quick(long N, double epsilon) {
-	if (epsilon<=0.0) {
-		// no way around exact quantile search
-		long[] result = new long[2];
-		result[0]=1;
-		result[1]=N;
-		return result;
-	}
+  if (epsilon<=0.0) {
+    // no way around exact quantile search
+    long[] result = new long[2];
+    result[0]=1;
+    result[1]=N;
+    return result;
+  }
 
-	final int maxBuffers = 50;
-	final int maxHeight = 50;
-	final double N_double = (double) N;
-	final double c = N_double * epsilon * 2.0;
-	int[] heightMaximums = new int[maxBuffers-1];
+  final int maxBuffers = 50;
+  final int maxHeight = 50;
+  final double N_double = (double) N;
+  final double c = N_double * epsilon * 2.0;
+  int[] heightMaximums = new int[maxBuffers-1];
 
-	// for each b, determine maximum height, i.e. the height for which x<=0 and x is a maximum
-	// with x = binomial(b+h-2, h-1) - binomial(b+h-3, h-3) + binomial(b+h-3, h-2) - N * epsilon * 2.0
-	for (int b=2; b<=maxBuffers; b++) {
-		int h = 3;
-		
-		while ( h<=maxHeight && // skip heights until x<=0
-				(h-2) * ((double)Math.round(binomial(b+h-2, h-1))) -
-				((double) Math.round(binomial(b+h-3, h-3))) +
-				((double) Math.round(binomial(b+h-3, h-2))) - c
-				> 0.0
-			  ) {h++;}
-		//from now on x is monotonically growing...
-		while ( h<=maxHeight && // skip heights until x>0
-				(h-2) * ((double)Math.round(binomial(b+h-2, h-1))) -
-				((double) Math.round(binomial(b+h-3, h-3))) +
-				((double) Math.round(binomial(b+h-3, h-2))) - c
-				<= 0.0
-			  ) {h++;}
-		h--; //go back to last height
+  // for each b, determine maximum height, i.e. the height for which x<=0 and x is a maximum
+  // with x = binomial(b+h-2, h-1) - binomial(b+h-3, h-3) + binomial(b+h-3, h-2) - N * epsilon * 2.0
+  for (int b=2; b<=maxBuffers; b++) {
+    int h = 3;
+    
+    while ( h<=maxHeight && // skip heights until x<=0
+        (h-2) * ((double)Math.round(binomial(b+h-2, h-1))) -
+        ((double) Math.round(binomial(b+h-3, h-3))) +
+        ((double) Math.round(binomial(b+h-3, h-2))) - c
+        > 0.0
+        ) {h++;}
+    //from now on x is monotonically growing...
+    while ( h<=maxHeight && // skip heights until x>0
+        (h-2) * ((double)Math.round(binomial(b+h-2, h-1))) -
+        ((double) Math.round(binomial(b+h-3, h-3))) +
+        ((double) Math.round(binomial(b+h-3, h-2))) - c
+        <= 0.0
+        ) {h++;}
+    h--; //go back to last height
 
-		// was x>0 or did we loop without finding anything?
-		int hMax;
-		if (h>=maxHeight && 
-				(h-2) * ((double)Math.round(binomial(b+h-2, h-1))) -
-				((double) Math.round(binomial(b+h-3, h-3))) +
-				((double) Math.round(binomial(b+h-3, h-2))) - c
-				> 0.0) {
-			hMax=Integer.MIN_VALUE;
-		}
-		else {
-			hMax=h;
-		}
-				
-		heightMaximums[b-2]=hMax; //safe some space
-	} //end for
+    // was x>0 or did we loop without finding anything?
+    int hMax;
+    if (h>=maxHeight && 
+        (h-2) * ((double)Math.round(binomial(b+h-2, h-1))) -
+        ((double) Math.round(binomial(b+h-3, h-3))) +
+        ((double) Math.round(binomial(b+h-3, h-2))) - c
+        > 0.0) {
+      hMax=Integer.MIN_VALUE;
+    }
+    else {
+      hMax=h;
+    }
+        
+    heightMaximums[b-2]=hMax; //safe some space
+  } //end for
 
 
-	// for each b, determine the smallest k satisfying the constraints, i.e.
-	// for each b, determine kMin, with kMin = N/binomial(b+hMax-2,hMax-1)
-	long[] kMinimums = new long[maxBuffers-1];
-	for (int b=2; b<=maxBuffers; b++) {
-		int h=heightMaximums[b-2];
-		long kMin=Long.MAX_VALUE;
-		if (h>Integer.MIN_VALUE) {
-			double value = ((double)Math.round(binomial(b+h-2, h-1)));
-			long tmpK=ceiling(N_double/value);
-			if (tmpK<=Long.MAX_VALUE) {
-				kMin = tmpK;
-			}
-		}
-		kMinimums[b-2]=kMin;
-	}
+  // for each b, determine the smallest k satisfying the constraints, i.e.
+  // for each b, determine kMin, with kMin = N/binomial(b+hMax-2,hMax-1)
+  long[] kMinimums = new long[maxBuffers-1];
+  for (int b=2; b<=maxBuffers; b++) {
+    int h=heightMaximums[b-2];
+    long kMin=Long.MAX_VALUE;
+    if (h>Integer.MIN_VALUE) {
+      double value = ((double)Math.round(binomial(b+h-2, h-1)));
+      long tmpK=ceiling(N_double/value);
+      if (tmpK<=Long.MAX_VALUE) {
+        kMin = tmpK;
+      }
+    }
+    kMinimums[b-2]=kMin;
+  }
 
-	// from all b's, determine b that minimizes b*kMin
-	long multMin = Long.MAX_VALUE;
-	int minB = -1;
-	for (int b=2; b<=maxBuffers; b++) {
-		if (kMinimums[b-2]<Long.MAX_VALUE) {
-			long mult = ((long)b) * ((long)kMinimums[b-2]);
-			if (mult<multMin) {
-				multMin=mult;
-				minB = b;
-			}
-		}
-	}
+  // from all b's, determine b that minimizes b*kMin
+  long multMin = Long.MAX_VALUE;
+  int minB = -1;
+  for (int b=2; b<=maxBuffers; b++) {
+    if (kMinimums[b-2]<Long.MAX_VALUE) {
+      long mult = ((long)b) * ((long)kMinimums[b-2]);
+      if (mult<multMin) {
+        multMin=mult;
+        minB = b;
+      }
+    }
+  }
 
-	long b, k;
-	if (minB != -1) { // epsilon large enough?
-		b = minB;
-		k = kMinimums[minB-2];
-	}
-	else {     // epsilon is very small or zero.
-		b = 1; // the only possible solution without violating the 
-		k = N; // approximation guarantees is exact quantile search.
-	}
+  long b, k;
+  if (minB != -1) { // epsilon large enough?
+    b = minB;
+    k = kMinimums[minB-2];
+  }
+  else {     // epsilon is very small or zero.
+    b = 1; // the only possible solution without violating the 
+    k = N; // approximation guarantees is exact quantile search.
+  }
 
-	long[] result = new long[2];
-	result[0]=b;
-	result[1]=k;
-	return result;
+  long[] result = new long[2];
+  result[0]=b;
+  result[1]=k;
+  return result;
 }
 /**
  * Computes the number of buffers and number of values per buffer such that
@@ -178,149 +178,149 @@
  * @return <tt>long[2]</tt> - <tt>long[0]</tt>=the number of buffers, <tt>long[1]</tt>=the number of elements per buffer, <tt>returnSamplingRate[0]</tt>=the required sampling rate.
  */
 protected static long[] known_N_compute_B_and_K_slow(long N, double epsilon, double delta, int quantiles, double[] returnSamplingRate) {
-	// delta can be set to zero, i.e., all quantiles should be approximate with probability 1	
-	if (epsilon<=0.0) {
-		// no way around exact quantile search
-		long[] result = new long[2];
-		result[0]=1;
-		result[1]=N;
-		returnSamplingRate[0]=1.0;
-		return result;
-	}
+  // delta can be set to zero, i.e., all quantiles should be approximate with probability 1  
+  if (epsilon<=0.0) {
+    // no way around exact quantile search
+    long[] result = new long[2];
+    result[0]=1;
+    result[1]=N;
+    returnSamplingRate[0]=1.0;
+    return result;
+  }
 
 
-	final int maxBuffers = 50;
-	final int maxHeight = 50;
-	final double N_double = N;
+  final int maxBuffers = 50;
+  final int maxHeight = 50;
+  final double N_double = N;
 
-	// One possibility is to use one buffer of size N
-	//
-	long ret_b = 1;
-	long ret_k = N;
-	double sampling_rate = 1.0;
-	long memory = N;
+  // One possibility is to use one buffer of size N
+  //
+  long ret_b = 1;
+  long ret_k = N;
+  double sampling_rate = 1.0;
+  long memory = N;
 
 
-	// Otherwise, there are at least two buffers (b >= 2)
-	// and the height of the tree is at least three (h >= 3)
-	//
-	// We restrict the search for b and h to MAX_BINOM, a large enough value for
-	// practical values of    epsilon >= 0.001   and    delta >= 0.00001
-	//
-	final double logarithm = Math.log(2.0*quantiles/delta);
-	final double c = 2.0 * epsilon * N_double;
-	for (long b=2 ; b<maxBuffers ; b++)
-		for (long h=3 ; h<maxHeight ; h++) {
-			double binomial = binomial(b+h-2, h-1);
-			long tmp = ceiling(N_double / binomial);
-			if ((b * tmp < memory) && 
-					((h-2) * binomial - binomial(b+h-3, h-3) + binomial(b+h-3, h-2)
-					<= c) ) {
-				ret_k = tmp ;
-				ret_b = b ;
-				memory = ret_k * b;
-				sampling_rate = 1.0 ;
-			}
-			if (delta > 0.0) {
-				double t = (h-2) * binomial(b+h-2, h-1) - binomial(b+h-3, h-3) + binomial(b+h-3, h-2) ;
-				double u = logarithm / epsilon ;
-				double v = binomial (b+h-2, h-1) ;
-				double w = logarithm / (2.0*epsilon*epsilon) ;
+  // Otherwise, there are at least two buffers (b >= 2)
+  // and the height of the tree is at least three (h >= 3)
+  //
+  // We restrict the search for b and h to MAX_BINOM, a large enough value for
+  // practical values of    epsilon >= 0.001   and    delta >= 0.00001
+  //
+  final double logarithm = Math.log(2.0*quantiles/delta);
+  final double c = 2.0 * epsilon * N_double;
+  for (long b=2 ; b<maxBuffers ; b++)
+    for (long h=3 ; h<maxHeight ; h++) {
+      double binomial = binomial(b+h-2, h-1);
+      long tmp = ceiling(N_double / binomial);
+      if ((b * tmp < memory) && 
+          ((h-2) * binomial - binomial(b+h-3, h-3) + binomial(b+h-3, h-2)
+          <= c) ) {
+        ret_k = tmp ;
+        ret_b = b ;
+        memory = ret_k * b;
+        sampling_rate = 1.0 ;
+      }
+      if (delta > 0.0) {
+        double t = (h-2) * binomial(b+h-2, h-1) - binomial(b+h-3, h-3) + binomial(b+h-3, h-2) ;
+        double u = logarithm / epsilon ;
+        double v = binomial (b+h-2, h-1) ;
+        double w = logarithm / (2.0*epsilon*epsilon) ;
 
-				// From our SIGMOD 98 paper, we have two equantions to satisfy:
-				// t  <= u * alpha/(1-alpha)^2
-				// kv >= w/(1-alpha)^2
-				//
-				// Denoting 1/(1-alpha)    by x,
-				// we see that the first inequality is equivalent to
-				// t/u <= x^2 - x
-				// which is satisfied by x >= 0.5 + 0.5 * sqrt (1 + 4t/u)
-				// Plugging in this value into second equation yields
-				// k >= wx^2/v
+        // From our SIGMOD 98 paper, we have two equantions to satisfy:
+        // t  <= u * alpha/(1-alpha)^2
+        // kv >= w/(1-alpha)^2
+        //
+        // Denoting 1/(1-alpha)    by x,
+        // we see that the first inequality is equivalent to
+        // t/u <= x^2 - x
+        // which is satisfied by x >= 0.5 + 0.5 * sqrt (1 + 4t/u)
+        // Plugging in this value into second equation yields
+        // k >= wx^2/v
 
-				double x = 0.5 + 0.5 * Math.sqrt(1.0 + 4.0*t/u) ;
-				long k = ceiling(w*x*x/v) ;
-				if (b * k < memory) {
-					ret_k = k ;
-					ret_b = b ;
-					memory = b * k ;
-					sampling_rate = N_double*2.0*epsilon*epsilon / logarithm ;
-				}
-			}
-		}
-		
-	long[] result = new long[2];
-	result[0]=ret_b;
-	result[1]=ret_k;
-	returnSamplingRate[0]=sampling_rate;
-	return result;
+        double x = 0.5 + 0.5 * Math.sqrt(1.0 + 4.0*t/u) ;
+        long k = ceiling(w*x*x/v) ;
+        if (b * k < memory) {
+          ret_k = k ;
+          ret_b = b ;
+          memory = b * k ;
+          sampling_rate = N_double*2.0*epsilon*epsilon / logarithm ;
+        }
+      }
+    }
+    
+  long[] result = new long[2];
+  result[0]=ret_b;
+  result[1]=ret_k;
+  returnSamplingRate[0]=sampling_rate;
+  return result;
 }
 public static void main(String[] args) {
-	test_B_and_K_Calculation(args);
+  test_B_and_K_Calculation(args);
 }
 /**
  * Computes b and k for different parameters.
  */
 public static void test_B_and_K_Calculation(String[] args) {
-	boolean known_N;
-	if (args==null) known_N = false;
-	else known_N = new Boolean(args[0]).booleanValue();
+  boolean known_N;
+  if (args==null) known_N = false;
+  else known_N = new Boolean(args[0]).booleanValue();
 
-	int[] quantiles = {1,1000};
-	
-	long[] sizes = {100000, 1000000, 10000000, 1000000000};
-	
-	double[] deltas = {0.0, 0.001, 0.0001, 0.00001};
-	
-	double[] epsilons = {0.0, 0.1, 0.05, 0.01, 0.005, 0.001, 0.0000001};
+  int[] quantiles = {1,1000};
+  
+  long[] sizes = {100000, 1000000, 10000000, 1000000000};
+  
+  double[] deltas = {0.0, 0.001, 0.0001, 0.00001};
+  
+  double[] epsilons = {0.0, 0.1, 0.05, 0.01, 0.005, 0.001, 0.0000001};
 
 
-	
-	if (! known_N) sizes = new long[] {0};
-	System.out.println("\n\n");
-	if (known_N) 
-		System.out.println("Computing b's and k's for KNOWN N");
-	else 
-		System.out.println("Computing b's and k's for UNKNOWN N");
-	System.out.println("mem [elements/1024]");
-	System.out.println("***********************************");
+  
+  if (! known_N) sizes = new long[] {0};
+  System.out.println("\n\n");
+  if (known_N) 
+    System.out.println("Computing b's and k's for KNOWN N");
+  else 
+    System.out.println("Computing b's and k's for UNKNOWN N");
+  System.out.println("mem [elements/1024]");
+  System.out.println("***********************************");
 
-	for (int q=0; q<quantiles.length; q++) {
-		int p = quantiles[q];
-		System.out.println("------------------------------");
-		System.out.println("computing for p = "+p);
-		for (int s=0; s<sizes.length; s++) {
-			long N = sizes[s];
-			System.out.println("   ------------------------------");
-			System.out.println("   computing for N = "+N);
-			for (int d=0; d<deltas.length; d++) {
-				double delta = deltas[d];
-				System.out.println("      ------------------------------");
-				System.out.println("      computing for delta = "+delta);
-				for (int e=0; e<epsilons.length; e++) {
-					double epsilon = epsilons[e];
-					
-					double[] returnSamplingRate = new double[1];
-					long[] result;
-					if (known_N) {
-						result = known_N_compute_B_and_K(N, epsilon, delta, p, returnSamplingRate);
-					}
-					else {
-						result = unknown_N_compute_B_and_K(epsilon, delta, p);
-					}
+  for (int q=0; q<quantiles.length; q++) {
+    int p = quantiles[q];
+    System.out.println("------------------------------");
+    System.out.println("computing for p = "+p);
+    for (int s=0; s<sizes.length; s++) {
+      long N = sizes[s];
+      System.out.println("   ------------------------------");
+      System.out.println("   computing for N = "+N);
+      for (int d=0; d<deltas.length; d++) {
+        double delta = deltas[d];
+        System.out.println("      ------------------------------");
+        System.out.println("      computing for delta = "+delta);
+        for (int e=0; e<epsilons.length; e++) {
+          double epsilon = epsilons[e];
+          
+          double[] returnSamplingRate = new double[1];
+          long[] result;
+          if (known_N) {
+            result = known_N_compute_B_and_K(N, epsilon, delta, p, returnSamplingRate);
+          }
+          else {
+            result = unknown_N_compute_B_and_K(epsilon, delta, p);
+          }
 
-					long b = result[0];
-					long k = result[1];
-					System.out.print("         (e,d,N,p)=("+epsilon+","+delta+","+N+","+p+") --> ");
-					System.out.print("(b,k,mem");
-					if (known_N) System.out.print(",sampling");
-					System.out.print(")=("+b+","+k+","+(b*k/1024));
-					if (known_N) System.out.print(","+returnSamplingRate[0]);
-					System.out.println(")");
-				}
-			}
-		}
-	}
+          long b = result[0];
+          long k = result[1];
+          System.out.print("         (e,d,N,p)=("+epsilon+","+delta+","+N+","+p+") --> ");
+          System.out.print("(b,k,mem");
+          if (known_N) System.out.print(",sampling");
+          System.out.print(")=("+b+","+k+","+(b*k/1024));
+          if (known_N) System.out.print(","+returnSamplingRate[0]);
+          System.out.println(")");
+        }
+      }
+    }
+  }
 
 }
 /**
@@ -333,117 +333,117 @@
  * @return <tt>long[3]</tt> - <tt>long[0]</tt>=the number of buffers, <tt>long[1]</tt>=the number of elements per buffer, <tt>long[2]</tt>=the tree height where sampling shall start.
  */
 public static long[] unknown_N_compute_B_and_K(double epsilon, double delta, int quantiles) {
-	// delta can be set to zero, i.e., all quantiles should be approximate with probability 1	
-	if (epsilon<=0.0 || delta<=0.0) {
-		// no way around exact quantile search
-		long[] result = new long[3];
-		result[0]=1;
-		result[1]=Long.MAX_VALUE;
-		result[2]=Long.MAX_VALUE;
-		return result;
-	}
+  // delta can be set to zero, i.e., all quantiles should be approximate with probability 1  
+  if (epsilon<=0.0 || delta<=0.0) {
+    // no way around exact quantile search
+    long[] result = new long[3];
+    result[0]=1;
+    result[1]=Long.MAX_VALUE;
+    result[2]=Long.MAX_VALUE;
+    return result;
+  }
 
-	int max_b = 50;
-	int max_h = 50;
-	int max_H = 50;
-	int max_Iterations = 2;
+  int max_b = 50;
+  int max_h = 50;
+  int max_H = 50;
+  int max_Iterations = 2;
 
-	long best_b = Long.MAX_VALUE;
-	long best_k = Long.MAX_VALUE;
-	long best_h = Long.MAX_VALUE;
-	long best_memory = Long.MAX_VALUE;
+  long best_b = Long.MAX_VALUE;
+  long best_k = Long.MAX_VALUE;
+  long best_h = Long.MAX_VALUE;
+  long best_memory = Long.MAX_VALUE;
 
-	double pow = Math.pow(2.0, max_H);
-	double logDelta =  Math.log(2.0/(delta/quantiles)) / (2.0*epsilon*epsilon);
-	//double logDelta =  Math.log(2.0/(quantiles*delta)) / (2.0*epsilon*epsilon);
+  double pow = Math.pow(2.0, max_H);
+  double logDelta =  Math.log(2.0/(delta/quantiles)) / (2.0*epsilon*epsilon);
+  //double logDelta =  Math.log(2.0/(quantiles*delta)) / (2.0*epsilon*epsilon);
 
-	while (best_b == Long.MAX_VALUE && max_Iterations-- > 0) { //until we find a solution
-		// identify that combination of b and h that minimizes b*k.
-		// exhaustive search.
-		for (int b=2; b<=max_b; b++) {
-			for (int h=2; h<=max_h; h++) {
-				double Ld = binomial(b+h-2, h-1);
-				double Ls = binomial(b+h-3,h-1);
-				
-				// now we have k>=c*(1-alpha)^-2.
-				// let's compute c.
-				//double c = Math.log(2.0/(delta/quantiles)) / (2.0*epsilon*epsilon*Math.min(Ld, 8.0*Ls/3.0));
-				double c = logDelta / Math.min(Ld, 8.0*Ls/3.0);
+  while (best_b == Long.MAX_VALUE && max_Iterations-- > 0) { //until we find a solution
+    // identify that combination of b and h that minimizes b*k.
+    // exhaustive search.
+    for (int b=2; b<=max_b; b++) {
+      for (int h=2; h<=max_h; h++) {
+        double Ld = binomial(b+h-2, h-1);
+        double Ls = binomial(b+h-3,h-1);
+        
+        // now we have k>=c*(1-alpha)^-2.
+        // let's compute c.
+        //double c = Math.log(2.0/(delta/quantiles)) / (2.0*epsilon*epsilon*Math.min(Ld, 8.0*Ls/3.0));
+        double c = logDelta / Math.min(Ld, 8.0*Ls/3.0);
 
-				// now we have k>=d/alpha.
-				// let's compute d.				
-				double beta = Ld/Ls;
-				double cc = (beta-2.0)*(max_H-2.0) / (beta + pow - 2.0);
-				double d = (h+3+cc) / (2.0*epsilon);
-				
-				/*
-				double d = (Ld*(h+max_H-1.0)  +  Ls*((h+1)*pow - 2.0*(h+max_H)))   /   (Ld + Ls*(pow-2.0));
-				d = (d + 2.0) / (2.0*epsilon);
-				*/
+        // now we have k>=d/alpha.
+        // let's compute d.        
+        double beta = Ld/Ls;
+        double cc = (beta-2.0)*(max_H-2.0) / (beta + pow - 2.0);
+        double d = (h+3+cc) / (2.0*epsilon);
+        
+        /*
+        double d = (Ld*(h+max_H-1.0)  +  Ls*((h+1)*pow - 2.0*(h+max_H)))   /   (Ld + Ls*(pow-2.0));
+        d = (d + 2.0) / (2.0*epsilon);
+        */
 
-				// now we have c*(1-alpha)^-2 == d/alpha.
-				// we solve this equation for alpha yielding two solutions
-				// alpha_1,2 = (c + 2*d  +-  Sqrt(c*c + 4*c*d))/(2*d)				
-				double f = c*c + 4.0*c*d;
-				if (f<0.0) continue; // non real solution to equation
-				double root = Math.sqrt(f);
-				double alpha_one = (c + 2.0*d + root)/(2.0*d);
-				double alpha_two = (c + 2.0*d - root)/(2.0*d);
+        // now we have c*(1-alpha)^-2 == d/alpha.
+        // we solve this equation for alpha yielding two solutions
+        // alpha_1,2 = (c + 2*d  +-  Sqrt(c*c + 4*c*d))/(2*d)        
+        double f = c*c + 4.0*c*d;
+        if (f<0.0) continue; // non real solution to equation
+        double root = Math.sqrt(f);
+        double alpha_one = (c + 2.0*d + root)/(2.0*d);
+        double alpha_two = (c + 2.0*d - root)/(2.0*d);
 
-				// any alpha must satisfy 0<alpha<1 to yield valid solutions
-				boolean alpha_one_OK = false;
-				boolean alpha_two_OK = false;
-				if (0.0 < alpha_one && alpha_one < 1.0) alpha_one_OK = true;
-				if (0.0 < alpha_two && alpha_two < 1.0) alpha_two_OK = true;
-				if (alpha_one_OK || alpha_two_OK) {
-					double alpha = alpha_one;
-					if (alpha_one_OK && alpha_two_OK) {
-						// take the alpha that minimizes d/alpha
-						alpha = Math.max(alpha_one, alpha_two);
-					}
-					else if (alpha_two_OK) {
-						alpha = alpha_two;
-					}
+        // any alpha must satisfy 0<alpha<1 to yield valid solutions
+        boolean alpha_one_OK = false;
+        boolean alpha_two_OK = false;
+        if (0.0 < alpha_one && alpha_one < 1.0) alpha_one_OK = true;
+        if (0.0 < alpha_two && alpha_two < 1.0) alpha_two_OK = true;
+        if (alpha_one_OK || alpha_two_OK) {
+          double alpha = alpha_one;
+          if (alpha_one_OK && alpha_two_OK) {
+            // take the alpha that minimizes d/alpha
+            alpha = Math.max(alpha_one, alpha_two);
+          }
+          else if (alpha_two_OK) {
+            alpha = alpha_two;
+          }
 
-					// now we have k=Ceiling(Max(d/alpha, (h+1)/(2*epsilon)))
-					long k = ceiling(Math.max(d/alpha, (h+1)/(2.0*epsilon)));
-					if (k>0) { // valid solution?
-						long memory = b*k;
-						if (memory < best_memory) { 
-							// found a solution requiring less memory
-							best_k = k;
-							best_b = b;
-							best_h = h;
-							best_memory = memory;
-						}
-					}
-				}
-			} //end for h
-		} //end for b
-		
-		if (best_b == Long.MAX_VALUE) {
-			System.out.println("Warning: Computing b and k looks like a lot of work!");
-			// no solution found so far. very unlikely. Anyway, try again.
-			max_b *= 2;
-			max_h *= 2;
-			max_H *= 2;
-		}
-	} //end while
+          // now we have k=Ceiling(Max(d/alpha, (h+1)/(2*epsilon)))
+          long k = ceiling(Math.max(d/alpha, (h+1)/(2.0*epsilon)));
+          if (k>0) { // valid solution?
+            long memory = b*k;
+            if (memory < best_memory) { 
+              // found a solution requiring less memory
+              best_k = k;
+              best_b = b;
+              best_h = h;
+              best_memory = memory;
+            }
+          }
+        }
+      } //end for h
+    } //end for b
+    
+    if (best_b == Long.MAX_VALUE) {
+      System.out.println("Warning: Computing b and k looks like a lot of work!");
+      // no solution found so far. very unlikely. Anyway, try again.
+      max_b *= 2;
+      max_h *= 2;
+      max_H *= 2;
+    }
+  } //end while
 
-	long[] result = new long[3];
-	if (best_b == Long.MAX_VALUE) {
-		// no solution found.
-		// no way around exact quantile search.
-		result[0]=1;
-		result[1]=Long.MAX_VALUE;
-		result[2]=Long.MAX_VALUE;
-	}
-	else {
-		result[0]=best_b;
-		result[1]=best_k;
-		result[2]=best_h;
-	}
+  long[] result = new long[3];
+  if (best_b == Long.MAX_VALUE) {
+    // no solution found.
+    // no way around exact quantile search.
+    result[0]=1;
+    result[1]=Long.MAX_VALUE;
+    result[2]=Long.MAX_VALUE;
+  }
+  else {
+    result[0]=best_b;
+    result[1]=best_k;
+    result[2]=best_h;
+  }
 
-	return result;
+  return result;
 }
 }
Index: matrix/src/main/java/org/apache/mahout/jet/stat/quantile/EquiDepthHistogram.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/jet/stat/quantile/EquiDepthHistogram.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/jet/stat/quantile/EquiDepthHistogram.java	(working copy)
@@ -22,21 +22,19 @@
  * <li>Then for each <tt>i=0..s-1: l[i] = e : v.contains(e) && v[0],..., v[p[i]*v.length] &lt;= e</tt>.</li>
  * <li>(In particular: <tt>l[0]=min(v)=v[0]</tt> and <tt>l[s-1]=max(v)=v[s-1]</tt>.)</li>
  * 
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 09/24/99
  */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
  */
 @Deprecated
 public class EquiDepthHistogram extends org.apache.mahout.matrix.PersistentObject {
-	protected float[] binBoundaries;
+  protected float[] binBoundaries;
 /**
  * Constructs an equi-depth histogram with the given quantile elements.
  * Quantile elements must be sorted ascending and have the form specified in the class documentation.
  */
 public EquiDepthHistogram(float[] quantileElements) {
-	this.binBoundaries = quantileElements;
+  this.binBoundaries = quantileElements;
 }
 /**
  * Returns the bin index of the given element.
@@ -46,33 +44,33 @@
  * @throws java.lang.IllegalArgumentException if the element is not contained in any bin.
  */
 public int binOfElement(float element) {
-	int index = java.util.Arrays.binarySearch(binBoundaries,element);
-	if (index>=0) {
-		// element found.
-		if (index==binBoundaries.length-1) index--; // last bin is a closed interval.
-	}
-	else {
-		// element not found.
-		index -= -1; // index = -index-1; now index is the insertion point.
-		if (index==0 || index==binBoundaries.length) {
-			throw new IllegalArgumentException("Element="+element+" not contained in any bin.");
-		}
-		index--;
-	}
-	return index;
+  int index = java.util.Arrays.binarySearch(binBoundaries,element);
+  if (index>=0) {
+    // element found.
+    if (index==binBoundaries.length-1) index--; // last bin is a closed interval.
+  }
+  else {
+    // element not found.
+    index -= -1; // index = -index-1; now index is the insertion point.
+    if (index==0 || index==binBoundaries.length) {
+      throw new IllegalArgumentException("Element="+element+" not contained in any bin.");
+    }
+    index--;
+  }
+  return index;
 }
 /**
  * Returns the number of bins. In other words, returns the number of subdomains partitioning the entire value domain.
  */
 public int bins() {
-	return binBoundaries.length-1;
+  return binBoundaries.length-1;
 }
 /**
  * Returns the end of the range associated with the given bin.
  * @throws ArrayIndexOutOfBoundsException if <tt>binIndex &lt; 0 || binIndex &gt;= bins()</tt>.
  */
 public float endOfBin(int binIndex) {
-	return binBoundaries[binIndex+1];
+  return binBoundaries[binIndex+1];
 }
 /**
  * Returns the percentage of elements in the range (from,to]. Does linear interpolation.
@@ -81,7 +79,7 @@
  * @returns a number in the closed interval <tt>[0.0,1.0]</tt>.
  */
 public double percentFromTo(float from, float to) {
-	return phi(to)-phi(from);
+  return phi(to)-phi(from);
 }
 /**
  * Returns how many percent of the elements contained in the receiver are <tt>&lt;= element</tt>.
@@ -91,23 +89,23 @@
  * @returns a number in the closed interval <tt>[0.0,1.0]</tt>.
  */
 public double phi(float element) {
-	int size = binBoundaries.length;
-	if (element<=binBoundaries[0]) return 0.0;
-	if (element>=binBoundaries[size-1]) return 1.0;
+  int size = binBoundaries.length;
+  if (element<=binBoundaries[0]) return 0.0;
+  if (element>=binBoundaries[size-1]) return 1.0;
 
-	double binWidth = 1.0/(size-1);
-	int index = java.util.Arrays.binarySearch(binBoundaries, element);
-	//int index = new FloatArrayList(binBoundaries).binarySearch(element);
-	if (index>=0) { // found
-		return binWidth*index;
-	}
+  double binWidth = 1.0/(size-1);
+  int index = java.util.Arrays.binarySearch(binBoundaries, element);
+  //int index = new FloatArrayList(binBoundaries).binarySearch(element);
+  if (index>=0) { // found
+    return binWidth*index;
+  }
 
-	// do linear interpolation
-	int insertionPoint = -index-1;
-	double from = binBoundaries[insertionPoint-1];
-	double to = binBoundaries[insertionPoint]-from;
-	double p = (element - from) / to;
-	return binWidth * (p+(insertionPoint-1));
+  // do linear interpolation
+  int insertionPoint = -index-1;
+  double from = binBoundaries[insertionPoint-1];
+  double to = binBoundaries[insertionPoint]-from;
+  double p = (element - from) / to;
+  return binWidth * (p+(insertionPoint-1));
 }
 /**
  * @deprecated
@@ -115,22 +113,22 @@
  * Returns the number of bin boundaries.
  */
 public int size() {
-	return binBoundaries.length;
+  return binBoundaries.length;
 }
 /**
  * Returns the start of the range associated with the given bin.
  * @throws ArrayIndexOutOfBoundsException if <tt>binIndex &lt; 0 || binIndex &gt;= bins()</tt>.
  */
 public float startOfBin(int binIndex) {
-	return binBoundaries[binIndex];
+  return binBoundaries[binIndex];
 }
 /**
  * Not yet commented.
  */
 public static void test(float element) {
-	float[] quantileElements =
-		{50.0f, 100.0f, 200.0f, 300.0f, 1400.0f, 1500.0f,  1600.0f, 1700.0f, 1800.0f, 1900.0f, 2000.0f};
-	EquiDepthHistogram histo = new EquiDepthHistogram(quantileElements);
-	System.out.println("elem="+element+", phi="+histo.phi(element));
+  float[] quantileElements =
+    {50.0f, 100.0f, 200.0f, 300.0f, 1400.0f, 1500.0f,  1600.0f, 1700.0f, 1800.0f, 1900.0f, 2000.0f};
+  EquiDepthHistogram histo = new EquiDepthHistogram(quantileElements);
+  System.out.println("elem="+element+", phi="+histo.phi(element));
 }
 }
Index: matrix/src/main/java/org/apache/mahout/jet/stat/quantile/Buffer.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/jet/stat/quantile/Buffer.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/jet/stat/quantile/Buffer.java	(working copy)
@@ -12,19 +12,19 @@
  * A buffer holding elements; internally used for computing approximate quantiles.
  */
 abstract class Buffer extends org.apache.mahout.matrix.PersistentObject {
-	protected int weight;
-	protected int level;
-	protected int k;
-	protected boolean isAllocated;
+  protected int weight;
+  protected int level;
+  protected int k;
+  protected boolean isAllocated;
 /**
  * This method was created in VisualAge.
  * @param k int
  */
 public Buffer(int k) {
-	this.k=k;
-	this.weight=1;
-	this.level=0;
-	this.isAllocated=false;
+  this.k=k;
+  this.weight=1;
+  this.level=0;
+  this.isAllocated=false;
 }
 /**
  * Clears the receiver.
@@ -34,7 +34,7 @@
  * Returns whether the receiver is already allocated.
  */
 public boolean isAllocated() {
-	return isAllocated;
+  return isAllocated;
 }
 /**
  * Returns whether the receiver is empty.
@@ -48,19 +48,19 @@
  * Returns whether the receiver is partial.
  */
 public boolean isPartial() {
-	return ! (isEmpty() || isFull());
+  return ! (isEmpty() || isFull());
 }
 /**
  * Returns whether the receiver's level.
  */
 public int level() {
-	return level;
+  return level;
 }
 /**
  * Sets the receiver's level.
  */
 public void level(int level) {
-	this.level = level;
+  this.level = level;
 }
 /**
  * Returns the number of elements contained in the receiver.
@@ -74,12 +74,12 @@
  * Returns whether the receiver's weight.
  */
 public int weight() {
-	return weight;
+  return weight;
 }
 /**
  * Sets the receiver's weight.
  */
 public void weight(int weight) {
-	this.weight = weight;
+  this.weight = weight;
 }
 }
Index: matrix/src/main/java/org/apache/mahout/jet/stat/quantile/QuantileFinderTest.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/jet/stat/quantile/QuantileFinderTest.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/jet/stat/quantile/QuantileFinderTest.java	(working copy)
@@ -22,47 +22,47 @@
  * @param element the element to search for
  */
 protected static IntArrayList binaryMultiSearch(DoubleArrayList list, double element) {
-	int index = list.binarySearch(element);
-	if (index<0) return null; //not found
+  int index = list.binarySearch(element);
+  if (index<0) return null; //not found
 
-	int from = index-1;
-	while (from>=0 && list.get(from)==element) from--;
-	from++;
-	
-	int to = index+1;
-	while (to<list.size() && list.get(to)==element) to++;
-	to--;
-	
-	return new IntArrayList(new int[] {from,to});
+  int from = index-1;
+  while (from>=0 && list.get(from)==element) from--;
+  from++;
+  
+  int to = index+1;
+  while (to<list.size() && list.get(to)==element) to++;
+  to--;
+  
+  return new IntArrayList(new int[] {from,to});
 }
 /**
  * Observed epsilon
  */
 public static double epsilon(int size, double phi, double rank) {
-	double s = size;
-	//System.out.println("\n");
-	//System.out.println("s="+size+", rank="+rank+", phi="+phi+", eps="+Math.abs((rank)/s - phi));
-	//System.out.println("\n");
-	return Math.abs(rank/s - phi);
+  double s = size;
+  //System.out.println("\n");
+  //System.out.println("s="+size+", rank="+rank+", phi="+phi+", eps="+Math.abs((rank)/s - phi));
+  //System.out.println("\n");
+  return Math.abs(rank/s - phi);
 }
 /**
  * Observed epsilon
  */
 public static double epsilon(DoubleArrayList sortedList, double phi, double element) {
-	double rank = org.apache.mahout.jet.stat.Descriptive.rankInterpolated(sortedList,element);
-	return epsilon(sortedList.size(), phi, rank);
+  double rank = org.apache.mahout.jet.stat.Descriptive.rankInterpolated(sortedList,element);
+  return epsilon(sortedList.size(), phi, rank);
 }
 /**
  * Observed epsilon
  */
 public static double epsilon(DoubleArrayList sortedList, DoubleQuantileFinder finder, double phi) {
-	double element = finder.quantileElements(new DoubleArrayList(new double[] {phi})).get(0);
-	return epsilon(sortedList, phi, element); 
+  double element = finder.quantileElements(new DoubleArrayList(new double[] {phi})).get(0);
+  return epsilon(sortedList, phi, element); 
 }
 public static void main(String[] args) {
-	testBestBandKCalculation(args);
-	//testQuantileCalculation(args);
-	//testCollapse();
+  testBestBandKCalculation(args);
+  //testQuantileCalculation(args);
+  //testCollapse();
 }
 /**
  * This method was created in VisualAge.
@@ -71,26 +71,26 @@
  * @param phis double[]
  */
 public static double observedEpsilonAtPhi(double phi, ExactDoubleQuantileFinder exactFinder, DoubleQuantileFinder approxFinder) {
-	int N = (int) exactFinder.size();
-	
-	int exactRank = (int) Utils.epsilonCeiling(phi * N) - 1;
-	//System.out.println("exactRank="+exactRank);
-	exactFinder.quantileElements(new DoubleArrayList(new double[] {phi})).get(0); // just to ensure exactFinder is sorted
-	double approxElement = approxFinder.quantileElements(new DoubleArrayList(new double[] {phi})).get(0); 
-	//System.out.println("approxElem="+approxElement);
-	IntArrayList approxRanks = binaryMultiSearch(exactFinder.buffer, approxElement);
-	int from = approxRanks.get(0);
-	int to = approxRanks.get(1);
+  int N = (int) exactFinder.size();
+  
+  int exactRank = (int) Utils.epsilonCeiling(phi * N) - 1;
+  //System.out.println("exactRank="+exactRank);
+  exactFinder.quantileElements(new DoubleArrayList(new double[] {phi})).get(0); // just to ensure exactFinder is sorted
+  double approxElement = approxFinder.quantileElements(new DoubleArrayList(new double[] {phi})).get(0); 
+  //System.out.println("approxElem="+approxElement);
+  IntArrayList approxRanks = binaryMultiSearch(exactFinder.buffer, approxElement);
+  int from = approxRanks.get(0);
+  int to = approxRanks.get(1);
 
-	int distance;
-	if (from<=exactRank && exactRank<=to) distance = 0;
-	else {
-		if (from>exactRank) distance=Math.abs(from-exactRank);
-		else distance=Math.abs(exactRank-to);
-	}
+  int distance;
+  if (from<=exactRank && exactRank<=to) distance = 0;
+  else {
+    if (from>exactRank) distance=Math.abs(from-exactRank);
+    else distance=Math.abs(exactRank-to);
+  }
 
-	double epsilon = (double)distance / (double)N;
-	return epsilon;
+  double epsilon = (double)distance / (double)N;
+  return epsilon;
 }
 /**
  * This method was created in VisualAge.
@@ -99,341 +99,341 @@
  * @param phis double[]
  */
 public static DoubleArrayList observedEpsilonsAtPhis(DoubleArrayList phis, ExactDoubleQuantileFinder exactFinder, DoubleQuantileFinder approxFinder, double desiredEpsilon) {
-	DoubleArrayList epsilons = new DoubleArrayList(phis.size());
-	
-	for (int i=phis.size(); --i >=0;) {
-		double epsilon = observedEpsilonAtPhi(phis.get(i), exactFinder, approxFinder);
-		epsilons.add(epsilon);
-		if (epsilon>desiredEpsilon) System.out.println("Real epsilon = "+epsilon+" is larger than desired by "+(epsilon-desiredEpsilon));
-	}
-	return epsilons;
+  DoubleArrayList epsilons = new DoubleArrayList(phis.size());
+  
+  for (int i=phis.size(); --i >=0;) {
+    double epsilon = observedEpsilonAtPhi(phis.get(i), exactFinder, approxFinder);
+    epsilons.add(epsilon);
+    if (epsilon>desiredEpsilon) System.out.println("Real epsilon = "+epsilon+" is larger than desired by "+(epsilon-desiredEpsilon));
+  }
+  return epsilons;
 }
 /**
  * Not yet commented.
  */
 public static void test() {
-	String[] args = new String[20];
-	
-	String size="10000";
-	args[0]=size;
-	
-	//String b="5";
-	String b="12";
-	args[1]=b;
-	
-	String k="2290";
-	args[2]=k;
+  String[] args = new String[20];
+  
+  String size="10000";
+  args[0]=size;
+  
+  //String b="5";
+  String b="12";
+  args[1]=b;
+  
+  String k="2290";
+  args[2]=k;
 
-	String enableLogging="log";
-	args[3]=enableLogging;
+  String enableLogging="log";
+  args[3]=enableLogging;
 
-	String chunks="10";
-	args[4]=chunks;
+  String chunks="10";
+  args[4]=chunks;
 
-	String computeExactQuantilesAlso="exact";
-	args[5]=computeExactQuantilesAlso;
+  String computeExactQuantilesAlso="exact";
+  args[5]=computeExactQuantilesAlso;
 
-	String doShuffle="shuffle";
-	args[6]=doShuffle;
+  String doShuffle="shuffle";
+  args[6]=doShuffle;
 
-	String epsilon = "0.001";
-	args[7]=epsilon;
+  String epsilon = "0.001";
+  args[7]=epsilon;
 
-	String delta = "0.0001";
-	//String delta = "0.0001";
-	args[8]=delta;
+  String delta = "0.0001";
+  //String delta = "0.0001";
+  args[8]=delta;
 
-	String quantiles = "1";
-	args[9]=quantiles;
+  String quantiles = "1";
+  args[9]=quantiles;
 
-	String max_N = "-1";
-	args[10]=max_N;
+  String max_N = "-1";
+  args[10]=max_N;
 
 
-	testQuantileCalculation(args);
+  testQuantileCalculation(args);
 }
 /**
  * This method was created in VisualAge.
  */
 public static void testBestBandKCalculation(String[] args) {
-	//boolean known_N;
-	//if (args==null) known_N = false;
-	//else known_N = new Boolean(args[0]).booleanValue();
+  //boolean known_N;
+  //if (args==null) known_N = false;
+  //else known_N = new Boolean(args[0]).booleanValue();
 
-	int[] quantiles = {100,10000};
-	//int[] quantiles = {1,100,10000};
-	
-	long[] sizes = {Long.MAX_VALUE, 1000000, 10000000, 100000000};
-	
-	double[] deltas = {0.0, 0.1, 0.00001};
-	//double[] deltas = {0.0, 0.001, 0.00001, 0.000001};
-	
-	//double[] epsilons = {0.0, 0.01, 0.001, 0.0001, 0.00001};
-	double[] epsilons = {0.0, 0.1, 0.01, 0.001, 0.0001, 0.00001, 0.000001};
+  int[] quantiles = {100,10000};
+  //int[] quantiles = {1,100,10000};
+  
+  long[] sizes = {Long.MAX_VALUE, 1000000, 10000000, 100000000};
+  
+  double[] deltas = {0.0, 0.1, 0.00001};
+  //double[] deltas = {0.0, 0.001, 0.00001, 0.000001};
+  
+  //double[] epsilons = {0.0, 0.01, 0.001, 0.0001, 0.00001};
+  double[] epsilons = {0.0, 0.1, 0.01, 0.001, 0.0001, 0.00001, 0.000001};
 
 
-	
-	//if (! known_N) sizes = new long[] {0};
-	System.out.println("\n\n");
-	//if (known_N) 
-	//	System.out.println("Computing b's and k's for KNOWN N");
-	//else 
-	//	System.out.println("Computing b's and k's for UNKNOWN N");
-	System.out.println("mem [Math.round(elements/1000.0)]");
-	System.out.println("***********************************");
-	Timer timer = new Timer().start();
+  
+  //if (! known_N) sizes = new long[] {0};
+  System.out.println("\n\n");
+  //if (known_N) 
+  //  System.out.println("Computing b's and k's for KNOWN N");
+  //else 
+  //  System.out.println("Computing b's and k's for UNKNOWN N");
+  System.out.println("mem [Math.round(elements/1000.0)]");
+  System.out.println("***********************************");
+  Timer timer = new Timer().start();
 
-	for (int q=0; q<quantiles.length; q++) {
-		int p = quantiles[q];
-		System.out.println("------------------------------");
-		System.out.println("computing for p = "+p);
-		for (int s=0; s<sizes.length; s++) {
-			long N = sizes[s];
-			System.out.println("   ------------------------------");
-			System.out.println("   computing for N = "+N);
-			for (int e=0; e<epsilons.length; e++) {
-				double epsilon = epsilons[e];
-				System.out.println("      ------------------------------");
-				System.out.println("      computing for e = "+epsilon);
-				for (int d=0; d<deltas.length; d++) {
-					double delta = deltas[d];
-					for (int knownCounter=0; knownCounter<2; knownCounter++) {
-						boolean known_N;
-						if (knownCounter ==0) known_N = true;
-						else known_N = false;
+  for (int q=0; q<quantiles.length; q++) {
+    int p = quantiles[q];
+    System.out.println("------------------------------");
+    System.out.println("computing for p = "+p);
+    for (int s=0; s<sizes.length; s++) {
+      long N = sizes[s];
+      System.out.println("   ------------------------------");
+      System.out.println("   computing for N = "+N);
+      for (int e=0; e<epsilons.length; e++) {
+        double epsilon = epsilons[e];
+        System.out.println("      ------------------------------");
+        System.out.println("      computing for e = "+epsilon);
+        for (int d=0; d<deltas.length; d++) {
+          double delta = deltas[d];
+          for (int knownCounter=0; knownCounter<2; knownCounter++) {
+            boolean known_N;
+            if (knownCounter ==0) known_N = true;
+            else known_N = false;
 
-						DoubleQuantileFinder finder = QuantileFinderFactory.newDoubleQuantileFinder(known_N, N, epsilon, delta, p, null);
-						//System.out.println(finder.getClass().getName());
-						/*
-						double[] returnSamplingRate = new double[1];
-						long[] result;
-						if (known_N) {
-							result = QuantileFinderFactory.known_N_compute_B_and_K(N, epsilon, delta, p, returnSamplingRate);
-						}
-						else {
-							result = QuantileFinderFactory.unknown_N_compute_B_and_K(epsilon, delta, p);
-							long b1 = result[0];
-							long k1 = result[1];
+            DoubleQuantileFinder finder = QuantileFinderFactory.newDoubleQuantileFinder(known_N, N, epsilon, delta, p, null);
+            //System.out.println(finder.getClass().getName());
+            /*
+            double[] returnSamplingRate = new double[1];
+            long[] result;
+            if (known_N) {
+              result = QuantileFinderFactory.known_N_compute_B_and_K(N, epsilon, delta, p, returnSamplingRate);
+            }
+            else {
+              result = QuantileFinderFactory.unknown_N_compute_B_and_K(epsilon, delta, p);
+              long b1 = result[0];
+              long k1 = result[1];
 
-							if (N>=0) {
-								long[] resultKnown = QuantileFinderFactory.known_N_compute_B_and_K(N, epsilon, delta, p, returnSamplingRate);
-								long b2 = resultKnown[0];
-								long k2 = resultKnown[1];
-				
-								if (b2 * k2 < b1 * k1) { // the KnownFinder is smaller
-									result = resultKnown;
-								}
-							}
-						}
-						
+              if (N>=0) {
+                long[] resultKnown = QuantileFinderFactory.known_N_compute_B_and_K(N, epsilon, delta, p, returnSamplingRate);
+                long b2 = resultKnown[0];
+                long k2 = resultKnown[1];
+        
+                if (b2 * k2 < b1 * k1) { // the KnownFinder is smaller
+                  result = resultKnown;
+                }
+              }
+            }
+            
 
-						long b = result[0];
-						long k = result[1];
-						*/
-						String knownStr = known_N ? "  known" : "unknown";
-						long mem = finder.totalMemory();
-						if (mem==0) mem = N; 
-						//else if (mem==0 && !known_N && N<0) mem = Long.MAX_VALUE; // actually infinity
-						//else if (mem==0 && !known_N && N>=0) mem = N;
-						//System.out.print("         (e,d,N,p)=("+epsilon+","+delta+","+N+","+p+") --> ");
-						System.out.print("         (known, d)=("+knownStr+", "+delta+") --> ");
-						//System.out.print("(mem,b,k,memF");
-						System.out.print("(MB,mem");
-						//if (known_N) System.out.print(",sampling");
-						//System.out.print(")=("+(Math.round(b*k/1000.0))+","+b+","+k+", "+Math.round(b*k*8/1024.0/1024.0));
-						//System.out.print(")=("+b*k/1000.0+","+b+","+k+", "+b*k*8/1024.0/1024.0+", "+Math.round(b*k*8/1024.0/1024.0));
-						System.out.print(")=("+mem*8.0/1024.0/1024.0+",  "+mem/1000.0+",  "+Math.round(mem*8.0/1024.0/1024.0));
-						//if (known_N) System.out.print(","+returnSamplingRate[0]);
-						System.out.println(")");
-					}
-				}
-			}
-		}
-	}
+            long b = result[0];
+            long k = result[1];
+            */
+            String knownStr = known_N ? "  known" : "unknown";
+            long mem = finder.totalMemory();
+            if (mem==0) mem = N; 
+            //else if (mem==0 && !known_N && N<0) mem = Long.MAX_VALUE; // actually infinity
+            //else if (mem==0 && !known_N && N>=0) mem = N;
+            //System.out.print("         (e,d,N,p)=("+epsilon+","+delta+","+N+","+p+") --> ");
+            System.out.print("         (known, d)=("+knownStr+", "+delta+") --> ");
+            //System.out.print("(mem,b,k,memF");
+            System.out.print("(MB,mem");
+            //if (known_N) System.out.print(",sampling");
+            //System.out.print(")=("+(Math.round(b*k/1000.0))+","+b+","+k+", "+Math.round(b*k*8/1024.0/1024.0));
+            //System.out.print(")=("+b*k/1000.0+","+b+","+k+", "+b*k*8/1024.0/1024.0+", "+Math.round(b*k*8/1024.0/1024.0));
+            System.out.print(")=("+mem*8.0/1024.0/1024.0+",  "+mem/1000.0+",  "+Math.round(mem*8.0/1024.0/1024.0));
+            //if (known_N) System.out.print(","+returnSamplingRate[0]);
+            System.out.println(")");
+          }
+        }
+      }
+    }
+  }
 
-	timer.stop().display();
+  timer.stop().display();
 }
 /**
  * This method was created in VisualAge.
  */
 public static void testLocalVarDeclarationSpeed(int size) {
-	System.out.println("free="+Runtime.getRuntime().freeMemory());
-	System.out.println("total="+Runtime.getRuntime().totalMemory());
+  System.out.println("free="+Runtime.getRuntime().freeMemory());
+  System.out.println("total="+Runtime.getRuntime().totalMemory());
 
-	/*Timer timer = new Timer().start();
-	for (int i=0; i<size; i++) {
-		for (int j=0; j<size; j++) {
-			DoubleBuffer buffer=null;
-			int val=10;
-			double f=1.0f;
-		}
-	}
-	System.out.println(timer.stop());
-	*/
-	
-	Timer timer = new Timer().start();
-	DoubleBuffer buffer;
-	int val;
-	double f;
-	int j;
+  /*Timer timer = new Timer().start();
+  for (int i=0; i<size; i++) {
+    for (int j=0; j<size; j++) {
+      DoubleBuffer buffer=null;
+      int val=10;
+      double f=1.0f;
+    }
+  }
+  System.out.println(timer.stop());
+  */
+  
+  Timer timer = new Timer().start();
+  DoubleBuffer buffer;
+  int val;
+  double f;
+  int j;
 
-	for (int i=0; i<size; i++) {
-		for (j=0; j<size; j++) {
-			buffer=null;
-			val=10;
-			f=1.0f;
-		}
-	}
-	System.out.println(timer.stop());
+  for (int i=0; i<size; i++) {
+    for (j=0; j<size; j++) {
+      buffer=null;
+      val=10;
+      f=1.0f;
+    }
+  }
+  System.out.println(timer.stop());
 
-	System.out.println("free="+Runtime.getRuntime().freeMemory());
-	System.out.println("total="+Runtime.getRuntime().totalMemory());
+  System.out.println("free="+Runtime.getRuntime().freeMemory());
+  System.out.println("total="+Runtime.getRuntime().totalMemory());
 }
 /**
  */
 public static void testQuantileCalculation(String[] args) {
-	int size=Integer.parseInt(args[0]);
-	int b=Integer.parseInt(args[1]);
-	int k=Integer.parseInt(args[2]);	
-	//cern.it.util.Log.enableLogging(args[3].equals("log"));
-	int chunks=Integer.parseInt(args[4]);
-	boolean computeExactQuantilesAlso=args[5].equals("exact");
-	boolean doShuffle=args[6].equals("shuffle");
-	double epsilon = new Double(args[7]).doubleValue();
-	double delta = new Double(args[8]).doubleValue();
-	int quantiles = Integer.parseInt(args[9]);	
-	long max_N = Long.parseLong(args[10]);	
+  int size=Integer.parseInt(args[0]);
+  int b=Integer.parseInt(args[1]);
+  int k=Integer.parseInt(args[2]);  
+  //cern.it.util.Log.enableLogging(args[3].equals("log"));
+  int chunks=Integer.parseInt(args[4]);
+  boolean computeExactQuantilesAlso=args[5].equals("exact");
+  boolean doShuffle=args[6].equals("shuffle");
+  double epsilon = new Double(args[7]).doubleValue();
+  double delta = new Double(args[8]).doubleValue();
+  int quantiles = Integer.parseInt(args[9]);  
+  long max_N = Long.parseLong(args[10]);  
 
 
 
-	System.out.println("free="+Runtime.getRuntime().freeMemory());
-	System.out.println("total="+Runtime.getRuntime().totalMemory());
+  System.out.println("free="+Runtime.getRuntime().freeMemory());
+  System.out.println("total="+Runtime.getRuntime().totalMemory());
 
-	double[] phis = {0.001, 0.01, 0.1, 0.5, 0.9, 0.99, 0.999, 1.0};
-	//int quantiles = phis.length;
+  double[] phis = {0.001, 0.01, 0.1, 0.5, 0.9, 0.99, 0.999, 1.0};
+  //int quantiles = phis.length;
 
-	Timer timer = new Timer();
-	Timer timer2 = new Timer();
-	DoubleQuantileFinder approxFinder;
+  Timer timer = new Timer();
+  Timer timer2 = new Timer();
+  DoubleQuantileFinder approxFinder;
 
-	approxFinder = QuantileFinderFactory.newDoubleQuantileFinder(false, max_N, epsilon, delta, quantiles, null);
-	System.out.println(approxFinder);
-	//new UnknownApproximateDoubleQuantileFinder(b,k);
-	//approxFinder = new ApproximateDoubleQuantileFinder(b,k);
-	/*
-	double[] returnSamplingRate = new double[1];
-	long[] result = ApproximateQuantileFinder.computeBestBandK(size*chunks, epsilon, delta, quantiles, returnSamplingRate);
-	approxFinder = new ApproximateQuantileFinder((int) result[0], (int) result[1]);
-	System.out.println("epsilon="+epsilon);
-	System.out.println("delta="+delta);
-	System.out.println("samplingRate="+returnSamplingRate[0]);
-	*/
+  approxFinder = QuantileFinderFactory.newDoubleQuantileFinder(false, max_N, epsilon, delta, quantiles, null);
+  System.out.println(approxFinder);
+  //new UnknownApproximateDoubleQuantileFinder(b,k);
+  //approxFinder = new ApproximateDoubleQuantileFinder(b,k);
+  /*
+  double[] returnSamplingRate = new double[1];
+  long[] result = ApproximateQuantileFinder.computeBestBandK(size*chunks, epsilon, delta, quantiles, returnSamplingRate);
+  approxFinder = new ApproximateQuantileFinder((int) result[0], (int) result[1]);
+  System.out.println("epsilon="+epsilon);
+  System.out.println("delta="+delta);
+  System.out.println("samplingRate="+returnSamplingRate[0]);
+  */
 
-		
-	DoubleQuantileFinder exactFinder = QuantileFinderFactory.newDoubleQuantileFinder(false, -1, 0.0, delta, quantiles, null);
-	System.out.println(exactFinder);
+    
+  DoubleQuantileFinder exactFinder = QuantileFinderFactory.newDoubleQuantileFinder(false, -1, 0.0, delta, quantiles, null);
+  System.out.println(exactFinder);
 
-	DoubleArrayList list = new DoubleArrayList(size);
+  DoubleArrayList list = new DoubleArrayList(size);
 
-	for (int chunk=0; chunk<chunks; chunk++) {
-		list.setSize(0);
-		int d = chunk*size;
-		timer2.start();
-		for (int i=0; i<size; i++) {
-			list.add((double)(i + d));
-		}
-		timer2.stop();
-		
+  for (int chunk=0; chunk<chunks; chunk++) {
+    list.setSize(0);
+    int d = chunk*size;
+    timer2.start();
+    for (int i=0; i<size; i++) {
+      list.add((double)(i + d));
+    }
+    timer2.stop();
+    
 
-		
-		//System.out.println("unshuffled="+list);
-		if (doShuffle) {
-			Timer timer3 = new Timer().start();
-			list.shuffle();
-			System.out.println("shuffling took ");
-			timer3.stop().display();
-		}
-		//System.out.println("shuffled="+list);
-		//list.sort();
-		//System.out.println("sorted="+list);
+    
+    //System.out.println("unshuffled="+list);
+    if (doShuffle) {
+      Timer timer3 = new Timer().start();
+      list.shuffle();
+      System.out.println("shuffling took ");
+      timer3.stop().display();
+    }
+    //System.out.println("shuffled="+list);
+    //list.sort();
+    //System.out.println("sorted="+list);
 
-		timer.start();
-		approxFinder.addAllOf(list);
-		timer.stop();
+    timer.start();
+    approxFinder.addAllOf(list);
+    timer.stop();
 
-		if (computeExactQuantilesAlso) {
-			exactFinder.addAllOf(list);
-		}
+    if (computeExactQuantilesAlso) {
+      exactFinder.addAllOf(list);
+    }
 
-	}
-	System.out.println("list.add() took" + timer2);
-	System.out.println("approxFinder.add() took" + timer);
+  }
+  System.out.println("list.add() took" + timer2);
+  System.out.println("approxFinder.add() took" + timer);
 
-	//System.out.println("free="+Runtime.getRuntime().freeMemory());
-	//System.out.println("total="+Runtime.getRuntime().totalMemory());
+  //System.out.println("free="+Runtime.getRuntime().freeMemory());
+  //System.out.println("total="+Runtime.getRuntime().totalMemory());
 
-	timer.reset().start();
+  timer.reset().start();
 
-	//approxFinder.close();
-	DoubleArrayList approxQuantiles = approxFinder.quantileElements(new DoubleArrayList(phis)); 
+  //approxFinder.close();
+  DoubleArrayList approxQuantiles = approxFinder.quantileElements(new DoubleArrayList(phis)); 
 
-	timer.stop().display();
-	
-	System.out.println("Phis="+new DoubleArrayList(phis));
-	System.out.println("ApproxQuantiles="+approxQuantiles);
+  timer.stop().display();
+  
+  System.out.println("Phis="+new DoubleArrayList(phis));
+  System.out.println("ApproxQuantiles="+approxQuantiles);
 
-	//System.out.println("MaxLevel of full buffers="+maxLevelOfFullBuffers(approxFinder.bufferSet));
+  //System.out.println("MaxLevel of full buffers="+maxLevelOfFullBuffers(approxFinder.bufferSet));
 
-	//System.out.println("total buffers filled="+ approxFinder.totalBuffersFilled);
-	//System.out.println("free="+Runtime.getRuntime().freeMemory());
-	//System.out.println("total="+Runtime.getRuntime().totalMemory());
+  //System.out.println("total buffers filled="+ approxFinder.totalBuffersFilled);
+  //System.out.println("free="+Runtime.getRuntime().freeMemory());
+  //System.out.println("total="+Runtime.getRuntime().totalMemory());
 
 
-	if (computeExactQuantilesAlso) {
-		System.out.println("Comparing with exact quantile computation...");
+  if (computeExactQuantilesAlso) {
+    System.out.println("Comparing with exact quantile computation...");
 
-		timer.reset().start();
+    timer.reset().start();
 
-		//exactFinder.close();
-		DoubleArrayList exactQuantiles = exactFinder.quantileElements(new DoubleArrayList(phis));
-		timer.stop().display();
+    //exactFinder.close();
+    DoubleArrayList exactQuantiles = exactFinder.quantileElements(new DoubleArrayList(phis));
+    timer.stop().display();
 
-		System.out.println("ExactQuantiles="+exactQuantiles);
+    System.out.println("ExactQuantiles="+exactQuantiles);
 
 
-		//double[] errors1 = errors1(exactQuantiles.elements(), approxQuantiles.elements());
-		//System.out.println("Error1="+new DoubleArrayList(errors1));
+    //double[] errors1 = errors1(exactQuantiles.elements(), approxQuantiles.elements());
+    //System.out.println("Error1="+new DoubleArrayList(errors1));
 
-		/*
-		final DoubleArrayList buffer = new DoubleArrayList((int)exactFinder.size());
-		exactFinder.forEach(
-			new org.apache.mahout.matrix.function.DoubleFunction() {
-				public void apply(double element) {
-					buffer.add(element);
-				}
-			}
-		);
-		*/
-				
-		
-		DoubleArrayList observedEpsilons = observedEpsilonsAtPhis(new DoubleArrayList(phis), (ExactDoubleQuantileFinder) exactFinder, approxFinder, epsilon);
-		System.out.println("observedEpsilons="+observedEpsilons);
+    /*
+    final DoubleArrayList buffer = new DoubleArrayList((int)exactFinder.size());
+    exactFinder.forEach(
+      new org.apache.mahout.matrix.function.DoubleFunction() {
+        public void apply(double element) {
+          buffer.add(element);
+        }
+      }
+    );
+    */
+        
+    
+    DoubleArrayList observedEpsilons = observedEpsilonsAtPhis(new DoubleArrayList(phis), (ExactDoubleQuantileFinder) exactFinder, approxFinder, epsilon);
+    System.out.println("observedEpsilons="+observedEpsilons);
 
-		double element = 1000.0f;
-		
+    double element = 1000.0f;
+    
 
-		System.out.println("exact phi("+element+")="+exactFinder.phi(element));
-		System.out.println("apprx phi("+element+")="+approxFinder.phi(element));
+    System.out.println("exact phi("+element+")="+exactFinder.phi(element));
+    System.out.println("apprx phi("+element+")="+approxFinder.phi(element));
 
-		System.out.println("exact elem(phi("+element+"))="+exactFinder.quantileElements(new DoubleArrayList(new double[] {exactFinder.phi(element)})));
-		System.out.println("apprx elem(phi("+element+"))="+approxFinder.quantileElements(new DoubleArrayList(new double[] {approxFinder.phi(element)})));		
-	}
+    System.out.println("exact elem(phi("+element+"))="+exactFinder.quantileElements(new DoubleArrayList(new double[] {exactFinder.phi(element)})));
+    System.out.println("apprx elem(phi("+element+"))="+approxFinder.quantileElements(new DoubleArrayList(new double[] {approxFinder.phi(element)})));    
+  }
 }
 /**
  * Not yet commented.
  */
 public static void testRank() {
-	DoubleArrayList list = new DoubleArrayList(new double[] {1.0f, 5.0f, 5.0f, 5.0f, 7.0f, 10.f});
-	//System.out.println(rankOfWithin(5.0f, list));
+  DoubleArrayList list = new DoubleArrayList(new double[] {1.0f, 5.0f, 5.0f, 5.0f, 7.0f, 10.f});
+  //System.out.println(rankOfWithin(5.0f, list));
 }
 }
Index: matrix/src/main/java/org/apache/mahout/jet/stat/quantile/package.html
===================================================================
--- matrix/src/main/java/org/apache/mahout/jet/stat/quantile/package.html	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/jet/stat/quantile/package.html	(working copy)
@@ -18,8 +18,8 @@
   <dt>5. A space efficient value preserving bin of a 2-dim or d-dim histogram.
   <dt>(All subject to an accuracy specified by the user.)
 
-    Have a look at the documentation of class {@link cern.jet.stat.quantile.QuantileFinderFactory} and the interface
-    {@link cern.jet.stat.quantile.DoubleQuantileFinder} to learn more.
+    Have a look at the documentation of class {@link org.apache.mahout.jet.stat.quantile.QuantileFinderFactory} and the interface
+    {@link org.apache.mahout.jet.stat.quantile.DoubleQuantileFinder} to learn more.
     Most users will never need to know more than how to use these.
     Actual implementations of the <tt>QuantileFinder</tt> interface are hidden.
     They are indirectly constructed via the the factory.
Index: matrix/src/main/java/org/apache/mahout/jet/stat/quantile/DoubleBufferSet.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/jet/stat/quantile/DoubleBufferSet.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/jet/stat/quantile/DoubleBufferSet.java	(working copy)
@@ -12,16 +12,16 @@
  * A set of buffers holding <tt>double</tt> elements; internally used for computing approximate quantiles.
  */
 class DoubleBufferSet extends BufferSet {
-	protected DoubleBuffer[] buffers;
-	private boolean nextTriggerCalculationState; //tmp var only
+  protected DoubleBuffer[] buffers;
+  private boolean nextTriggerCalculationState; //tmp var only
 /**
  * Constructs a buffer set with b buffers, each having k elements
  * @param b the number of buffers
  * @param k the number of elements per buffer
  */
 public DoubleBufferSet(int b, int k) {
-	this.buffers = new DoubleBuffer[b];
-	this.clear(k);
+  this.buffers = new DoubleBuffer[b];
+  this.clear(k);
 }
 /**
  * Returns an empty buffer if at least one exists.
@@ -29,115 +29,115 @@
  * i.e. a buffer which has already been allocated.
  */
 public DoubleBuffer _getFirstEmptyBuffer() {
-	DoubleBuffer emptyBuffer = null;
-	for (int i=buffers.length; --i >= 0;) {
-		if (buffers[i].isEmpty()) {
-			if (buffers[i].isAllocated()) return buffers[i];
-			emptyBuffer = buffers[i];
-		}
-	}
-		
-	return emptyBuffer;
+  DoubleBuffer emptyBuffer = null;
+  for (int i=buffers.length; --i >= 0;) {
+    if (buffers[i].isEmpty()) {
+      if (buffers[i].isAllocated()) return buffers[i];
+      emptyBuffer = buffers[i];
+    }
+  }
+    
+  return emptyBuffer;
 }
 /**
  * Returns all full or partial buffers.
  */
 public DoubleBuffer[] _getFullOrPartialBuffers() {
-	//count buffers
-	int count = 0;
-	for (int i=buffers.length; --i >= 0;) {
-		if (! buffers[i].isEmpty()) count++;
-	}
+  //count buffers
+  int count = 0;
+  for (int i=buffers.length; --i >= 0;) {
+    if (! buffers[i].isEmpty()) count++;
+  }
 
-	//collect buffers
-	DoubleBuffer[] collectedBuffers = new DoubleBuffer[count];
-	int j=0;
-	for (int i=buffers.length; --i >= 0;) {
-		if (! buffers[i].isEmpty()) {
-			collectedBuffers[j++]=buffers[i];
-		}
-	}
+  //collect buffers
+  DoubleBuffer[] collectedBuffers = new DoubleBuffer[count];
+  int j=0;
+  for (int i=buffers.length; --i >= 0;) {
+    if (! buffers[i].isEmpty()) {
+      collectedBuffers[j++]=buffers[i];
+    }
+  }
 
-	return collectedBuffers;
+  return collectedBuffers;
 }
 /**
  * Determines all full buffers having the specified level.
  * @return all full buffers having the specified level
  */
 public DoubleBuffer[] _getFullOrPartialBuffersWithLevel(int level) {
-	//count buffers
-	int count = 0;
-	for (int i=buffers.length; --i >= 0;) {
-		if ((! buffers[i].isEmpty()) && buffers[i].level()==level) count++;
-	}
+  //count buffers
+  int count = 0;
+  for (int i=buffers.length; --i >= 0;) {
+    if ((! buffers[i].isEmpty()) && buffers[i].level()==level) count++;
+  }
 
-	//collect buffers
-	DoubleBuffer[] collectedBuffers = new DoubleBuffer[count];
-	int j=0;
-	for (int i=buffers.length; --i >= 0;) {
-		if ((! buffers[i].isEmpty()) && buffers[i].level()==level) {
-			collectedBuffers[j++]=buffers[i];
-		}
-	}
+  //collect buffers
+  DoubleBuffer[] collectedBuffers = new DoubleBuffer[count];
+  int j=0;
+  for (int i=buffers.length; --i >= 0;) {
+    if ((! buffers[i].isEmpty()) && buffers[i].level()==level) {
+      collectedBuffers[j++]=buffers[i];
+    }
+  }
 
-	return collectedBuffers;
+  return collectedBuffers;
 }
 /**
  * @return The minimum level of all buffers which are full.
  */
 public int _getMinLevelOfFullOrPartialBuffers() {
-	int b=this.b();
-	int minLevel=Integer.MAX_VALUE;
-	DoubleBuffer buffer;
-	
-	for (int i=0; i<b; i++) {
-		buffer = this.buffers[i];
-		if ((! buffer.isEmpty()) && (buffer.level() < minLevel)) {
-			minLevel = buffer.level();
-		}
-	}
-	return minLevel;
+  int b=this.b();
+  int minLevel=Integer.MAX_VALUE;
+  DoubleBuffer buffer;
+  
+  for (int i=0; i<b; i++) {
+    buffer = this.buffers[i];
+    if ((! buffer.isEmpty()) && (buffer.level() < minLevel)) {
+      minLevel = buffer.level();
+    }
+  }
+  return minLevel;
 }
 /**
  * Returns the number of empty buffers.
  */
 public int _getNumberOfEmptyBuffers() {
-	int count = 0;
-	for (int i=buffers.length; --i >= 0;) {
-		if (buffers[i].isEmpty()) count++;
-	}
+  int count = 0;
+  for (int i=buffers.length; --i >= 0;) {
+    if (buffers[i].isEmpty()) count++;
+  }
 
-	return count;
+  return count;
 }
 /**
  * Returns all empty buffers.
  */
 public DoubleBuffer _getPartialBuffer() {
-	for (int i=buffers.length; --i >= 0;) {
-		if (buffers[i].isPartial()) return buffers[i];
-	}
-	return null;
+  for (int i=buffers.length; --i >= 0;) {
+    if (buffers[i].isPartial()) return buffers[i];
+  }
+  return null;
 }
 /**
  * @return the number of buffers
  */
 public int b() {
-	return buffers.length;
+  return buffers.length;
 }
 /**
  * Removes all elements from the receiver.  The receiver will
  * be empty after this call returns, and its memory requirements will be close to zero.
  */
 public void clear() {
-	clear(k());
+  clear(k());
 }
 /**
  * Removes all elements from the receiver.  The receiver will
  * be empty after this call returns, and its memory requirements will be close to zero.
  */
 protected void clear(int k) {
-	for (int i=b(); --i >=0; ) this.buffers[i]=new DoubleBuffer(k);
-	this.nextTriggerCalculationState = true;
+  for (int i=b(); --i >=0; ) this.buffers[i]=new DoubleBuffer(k);
+  this.nextTriggerCalculationState = true;
 }
 /**
  * Returns a deep copy of the receiver.
@@ -145,13 +145,13 @@
  * @return a deep copy of the receiver.
  */
 public Object clone() {
-	DoubleBufferSet copy = (DoubleBufferSet) super.clone();
+  DoubleBufferSet copy = (DoubleBufferSet) super.clone();
 
-	copy.buffers = (DoubleBuffer[]) copy.buffers.clone();
-	for (int i=buffers.length; --i >= 0; ) {
-		copy.buffers[i] = (DoubleBuffer) copy.buffers[i].clone();
-	}
-	return copy;
+  copy.buffers = (DoubleBuffer[]) copy.buffers.clone();
+  for (int i=buffers.length; --i >= 0; ) {
+    copy.buffers[i] = (DoubleBuffer) copy.buffers[i].clone();
+  }
+  return copy;
 }
 /**
  * Collapses the specified full buffers (must not include partial buffer).
@@ -159,38 +159,38 @@
  * @param buffers the buffers to be collapsed (all of them must be full or partially full)
  */
 public DoubleBuffer collapse(DoubleBuffer[] buffers) {
-	//determine W
-	int W=0;								//sum of all weights
-	for (int i=0; i<buffers.length; i++) { W += buffers[i].weight(); }
+  //determine W
+  int W=0;                //sum of all weights
+  for (int i=0; i<buffers.length; i++) { W += buffers[i].weight(); }
 
-	//determine outputTriggerPositions
-	int k=this.k();
-	long[] triggerPositions = new long[k]; 
-	for (int j=0; j<k; j++) { triggerPositions[j]=this.nextTriggerPosition(j,W); }
+  //determine outputTriggerPositions
+  int k=this.k();
+  long[] triggerPositions = new long[k]; 
+  for (int j=0; j<k; j++) { triggerPositions[j]=this.nextTriggerPosition(j,W); }
 
-	//do the main work: determine values at given positions in sorted sequence
-	double[] outputValues = this.getValuesAtPositions(buffers, triggerPositions);
+  //do the main work: determine values at given positions in sorted sequence
+  double[] outputValues = this.getValuesAtPositions(buffers, triggerPositions);
 
-	//mark all full buffers as empty, except the first, which will contain the output
-	for (int b=1; b<buffers.length; b++) buffers[b].clear(); 
+  //mark all full buffers as empty, except the first, which will contain the output
+  for (int b=1; b<buffers.length; b++) buffers[b].clear(); 
 
-	DoubleBuffer outputBuffer = buffers[0];
-	outputBuffer.values.elements(outputValues);
-	outputBuffer.weight(W);
-	
-	return outputBuffer;
+  DoubleBuffer outputBuffer = buffers[0];
+  outputBuffer.values.elements(outputValues);
+  outputBuffer.weight(W);
+  
+  return outputBuffer;
 }
 /**
  * Returns whether the specified element is contained in the receiver.
  */
 public boolean contains(double element) {
-	for (int i=buffers.length; --i >= 0;) {
-		if ((! buffers[i].isEmpty()) && buffers[i].contains(element)) {
-			return true;
-		}
-	}
+  for (int i=buffers.length; --i >= 0;) {
+    if ((! buffers[i].isEmpty()) && buffers[i].contains(element)) {
+      return true;
+    }
+  }
 
-	return false;
+  return false;
 }
 /**
  * Applies a procedure to each element of the receiver, if any.
@@ -198,12 +198,12 @@
  * @param procedure    the procedure to be applied. Stops iteration if the procedure returns <tt>false</tt>, otherwise continues. 
  */
 public boolean forEach(org.apache.mahout.matrix.function.DoubleProcedure procedure) {
-	for (int i=buffers.length; --i >=0; ) {
-		for (int w=buffers[i].weight(); --w >=0; ) {
-			if (! (buffers[i].values.forEach(procedure))) return false;
-		}
-	}
-	return true;
+  for (int i=buffers.length; --i >=0; ) {
+    for (int w=buffers[i].weight(); --w >=0; ) {
+      if (! (buffers[i].values.forEach(procedure))) return false;
+    }
+  }
+  return true;
 }
 /**
  * Determines all values of the specified buffers positioned at the specified triggerPositions within the sorted sequence and fills them into outputValues.
@@ -212,115 +212,115 @@
  * @return outputValues a list filled with the values at triggerPositions
  */
 protected double[] getValuesAtPositions(DoubleBuffer[] buffers, long[] triggerPositions) {
-	//if (buffers.length==0) 
-	//{
-	//	throw new IllegalArgumentException("Oops! buffer.length==0.");
-	//}
+  //if (buffers.length==0) 
+  //{
+  //  throw new IllegalArgumentException("Oops! buffer.length==0.");
+  //}
 
-	//System.out.println("triggers="+cern.it.util.Arrays.toString(positions));
+  //System.out.println("triggers="+cern.it.util.Arrays.toString(positions));
 
-	//new DoubleArrayList(outputValues).fillFromToWith(0, outputValues.length-1, 0.0f);
-	//delte the above line, it is only for testing
-	
-	//cern.it.util.Log.println("\nEntering getValuesAtPositions...");
-	//cern.it.util.Log.println("hitPositions="+cern.it.util.Arrays.toString(positions));
+  //new DoubleArrayList(outputValues).fillFromToWith(0, outputValues.length-1, 0.0f);
+  //delte the above line, it is only for testing
+  
+  //cern.it.util.Log.println("\nEntering getValuesAtPositions...");
+  //cern.it.util.Log.println("hitPositions="+cern.it.util.Arrays.toString(positions));
 
-	// sort buffers.
-	for (int i=buffers.length; --i >= 0; ) {
-		buffers[i].sort();
-	}
+  // sort buffers.
+  for (int i=buffers.length; --i >= 0; ) {
+    buffers[i].sort();
+  }
 
-	// collect some infos into fast cache; for tuning purposes only.
-	int[] bufferSizes = new int[buffers.length];		
-	double[][] bufferValues = new double[buffers.length][];
-	int totalBuffersSize = 0;
-	for (int i=buffers.length; --i >= 0; ) {
-		bufferSizes[i] = buffers[i].size();
-		bufferValues[i] = buffers[i].values.elements();
-		totalBuffersSize += bufferSizes[i];
-		//cern.it.util.Log.println("buffer["+i+"]="+buffers[i].values);
-	}
-	
-	// prepare merge of equi-distant elements within buffers into output values
-	
-	// first collect some infos into fast cache; for tuning purposes only.
-	final int buffersSize = buffers.length;		
-	final int triggerPositionsLength = triggerPositions.length; 
+  // collect some infos into fast cache; for tuning purposes only.
+  int[] bufferSizes = new int[buffers.length];    
+  double[][] bufferValues = new double[buffers.length][];
+  int totalBuffersSize = 0;
+  for (int i=buffers.length; --i >= 0; ) {
+    bufferSizes[i] = buffers[i].size();
+    bufferValues[i] = buffers[i].values.elements();
+    totalBuffersSize += bufferSizes[i];
+    //cern.it.util.Log.println("buffer["+i+"]="+buffers[i].values);
+  }
+  
+  // prepare merge of equi-distant elements within buffers into output values
+  
+  // first collect some infos into fast cache; for tuning purposes only.
+  final int buffersSize = buffers.length;    
+  final int triggerPositionsLength = triggerPositions.length; 
 
-	// now prepare the important things.
-	int j=0; 								//current position in collapsed values
-	int[] cursors = new int[buffers.length];	//current position in each buffer; init with zeroes
-	long counter = 0; 						//current position in sorted sequence
-	long nextHit = triggerPositions[j];		//next position in sorted sequence to trigger output population
-	double[] outputValues = new double[triggerPositionsLength];
+  // now prepare the important things.
+  int j=0;                 //current position in collapsed values
+  int[] cursors = new int[buffers.length];  //current position in each buffer; init with zeroes
+  long counter = 0;             //current position in sorted sequence
+  long nextHit = triggerPositions[j];    //next position in sorted sequence to trigger output population
+  double[] outputValues = new double[triggerPositionsLength];
 
-	if (totalBuffersSize==0) {
-		// nothing to output, because no elements have been filled (we are empty).
-		// return meaningless values
-		for (int i=0; i<triggerPositions.length; i++) {
-			outputValues[i] = Double.NaN;
-		}
-		return outputValues;
-	}
-	
-	// fill all output values with equi-distant elements.
-	while (j<triggerPositionsLength) { 
-		//System.out.println("\nj="+j);
-		//System.out.println("counter="+counter);
-		//System.out.println("nextHit="+nextHit);
+  if (totalBuffersSize==0) {
+    // nothing to output, because no elements have been filled (we are empty).
+    // return meaningless values
+    for (int i=0; i<triggerPositions.length; i++) {
+      outputValues[i] = Double.NaN;
+    }
+    return outputValues;
+  }
+  
+  // fill all output values with equi-distant elements.
+  while (j<triggerPositionsLength) { 
+    //System.out.println("\nj="+j);
+    //System.out.println("counter="+counter);
+    //System.out.println("nextHit="+nextHit);
 
-		// determine buffer with smallest value at cursor position.
-		double minValue = Double.POSITIVE_INFINITY;
-		int minBufferIndex = -1;
+    // determine buffer with smallest value at cursor position.
+    double minValue = Double.POSITIVE_INFINITY;
+    int minBufferIndex = -1;
 
-		for (int b=buffersSize; --b >= 0; ) {
-			//DoubleBuffer buffer = buffers[b];
-			//if (cursors[b] < buffer.length) { 
-			if (cursors[b] < bufferSizes[b]) { 
-				///double value = buffer.values[cursors[b]];
-				double value = bufferValues[b][cursors[b]];
-				if (value <= minValue) {
-					minValue = value;
-					minBufferIndex = b;
-				}
-			}
-		}
+    for (int b=buffersSize; --b >= 0; ) {
+      //DoubleBuffer buffer = buffers[b];
+      //if (cursors[b] < buffer.length) { 
+      if (cursors[b] < bufferSizes[b]) { 
+        ///double value = buffer.values[cursors[b]];
+        double value = bufferValues[b][cursors[b]];
+        if (value <= minValue) {
+          minValue = value;
+          minBufferIndex = b;
+        }
+      }
+    }
 
-		DoubleBuffer minBuffer=buffers[minBufferIndex];
+    DoubleBuffer minBuffer=buffers[minBufferIndex];
 
-		// trigger copies into output sequence, if necessary.
-		counter += minBuffer.weight();
-		while (counter>nextHit && j<triggerPositionsLength) { 
-			outputValues[j++]=minValue;
-			//System.out.println("adding to output="+minValue);
-			if (j<triggerPositionsLength) nextHit=triggerPositions[j];
-		}
+    // trigger copies into output sequence, if necessary.
+    counter += minBuffer.weight();
+    while (counter>nextHit && j<triggerPositionsLength) { 
+      outputValues[j++]=minValue;
+      //System.out.println("adding to output="+minValue);
+      if (j<triggerPositionsLength) nextHit=triggerPositions[j];
+    }
 
 
-		// that element has now been treated, move further.
-		cursors[minBufferIndex]++;
-		//System.out.println("cursors="+cern.it.util.Arrays.toString(cursors));
-	
-	} //end while (j<k)
-	
-	//cern.it.util.Log.println("returning output="+cern.it.util.Arrays.toString(outputValues));
-	return outputValues;
+    // that element has now been treated, move further.
+    cursors[minBufferIndex]++;
+    //System.out.println("cursors="+cern.it.util.Arrays.toString(cursors));
+  
+  } //end while (j<k)
+  
+  //cern.it.util.Log.println("returning output="+cern.it.util.Arrays.toString(outputValues));
+  return outputValues;
 }
 /**
  * @return the number of elements within a buffer.
  */
 public int k() {
-	return buffers[0].k;
+  return buffers[0].k;
 }
 /**
  * Returns the number of elements currently needed to store all contained elements.
  */
 public long memory() {
-	long memory=0;
-	for (int i=buffers.length; --i >=0;) {
-		memory = memory + buffers[i].memory();
-	}
-	return memory;
+  long memory=0;
+  for (int i=buffers.length; --i >=0;) {
+    memory = memory + buffers[i].memory();
+  }
+  return memory;
 }
 /**
  * Computes the next triggerPosition for collapse
@@ -329,23 +329,23 @@
  * @param W the accumulated weights
  */
 protected long nextTriggerPosition(int j, long W) {
-	long nextTriggerPosition;
-	
-	if (W%2L != 0) { //is W odd?
-		nextTriggerPosition=j*W + (W+1)/2;
-	}
-	
-	else { //W is even
-		//alternate between both possible next hit positions upon successive invocations
-		if (nextTriggerCalculationState) {
-			nextTriggerPosition=j*W + W/2;
-		}
-		else {
-			nextTriggerPosition=j*W + (W+2)/2;
-		}
-	}
-			
-	return nextTriggerPosition;
+  long nextTriggerPosition;
+  
+  if (W%2L != 0) { //is W odd?
+    nextTriggerPosition=j*W + (W+1)/2;
+  }
+  
+  else { //W is even
+    //alternate between both possible next hit positions upon successive invocations
+    if (nextTriggerCalculationState) {
+      nextTriggerPosition=j*W + W/2;
+    }
+    else {
+      nextTriggerPosition=j*W + (W+2)/2;
+    }
+  }
+      
+  return nextTriggerPosition;
 }
 /**
  * Returns how many percent of the elements contained in the receiver are <tt>&lt;= element</tt>.
@@ -355,38 +355,38 @@
  * @return the percentage <tt>p</tt> of elements <tt>&lt;= element</tt> (<tt>0.0 &lt;= p &lt;=1.0)</tt>.
  */
 public double phi(double element) {
-	double elementsLessThanOrEqualToElement=0.0;							
-	for (int i=buffers.length; --i >= 0; ) {
-		if (! buffers[i].isEmpty()) {
-			elementsLessThanOrEqualToElement += buffers[i].weight * buffers[i].rank(element);
-		}
-	}
+  double elementsLessThanOrEqualToElement=0.0;              
+  for (int i=buffers.length; --i >= 0; ) {
+    if (! buffers[i].isEmpty()) {
+      elementsLessThanOrEqualToElement += buffers[i].weight * buffers[i].rank(element);
+    }
+  }
 
-	return elementsLessThanOrEqualToElement / totalSize();
+  return elementsLessThanOrEqualToElement / totalSize();
 }
 /**
  * @return a String representation of the receiver
  */
 public String toString() {
-	StringBuffer buf = new StringBuffer();
-	for (int b=0; b<this.b(); b++) {
-		if (! buffers[b].isEmpty()) {
-			buf.append("buffer#"+b+" = ");
-			buf.append(buffers[b].toString()+"\n");
-		}
-	}
-	return buf.toString();
+  StringBuffer buf = new StringBuffer();
+  for (int b=0; b<this.b(); b++) {
+    if (! buffers[b].isEmpty()) {
+      buf.append("buffer#"+b+" = ");
+      buf.append(buffers[b].toString()+"\n");
+    }
+  }
+  return buf.toString();
 }
 /**
  * Returns the number of elements in all buffers.
  */
 public long totalSize() {
-	DoubleBuffer[] fullBuffers = _getFullOrPartialBuffers();
-	long totalSize=0;							
-	for (int i=fullBuffers.length; --i >= 0; ) {
-		totalSize += fullBuffers[i].size() * fullBuffers[i].weight();
-	}
+  DoubleBuffer[] fullBuffers = _getFullOrPartialBuffers();
+  long totalSize=0;              
+  for (int i=fullBuffers.length; --i >= 0; ) {
+    totalSize += fullBuffers[i].size() * fullBuffers[i].weight();
+  }
 
-	return totalSize;
+  return totalSize;
 }
 }
Index: matrix/src/main/java/org/apache/mahout/jet/stat/quantile/KnownDoubleQuantileEstimator.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/jet/stat/quantile/KnownDoubleQuantileEstimator.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/jet/stat/quantile/KnownDoubleQuantileEstimator.java	(working copy)
@@ -32,19 +32,17 @@
  * Proc. of the 1998 ACM SIGMOD Int. Conf. on Management of Data,
  * Paper available <A HREF="http://www-cad.eecs.berkeley.edu/~manku"> here</A>.
  *
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 09/24/99
  * @see QuantileFinderFactory
  * @see UnknownApproximateDoubleQuantileFinder
  */
 class KnownDoubleQuantileEstimator extends DoubleQuantileEstimator {
-	protected double beta; //correction factor for phis
+  protected double beta; //correction factor for phis
 
-	protected boolean weHadMoreThanOneEmptyBuffer;
+  protected boolean weHadMoreThanOneEmptyBuffer;
 
-	protected RandomSamplingAssistant samplingAssistant;
-	protected double samplingRate; // see method sampleNextElement()
-	protected long N; // see method sampleNextElement()
+  protected RandomSamplingAssistant samplingAssistant;
+  protected double samplingRate; // see method sampleNextElement()
+  protected long N; // see method sampleNextElement()
 /**
  * Constructs an approximate quantile finder with b buffers, each having k elements.
  * @param b the number of buffers
@@ -54,68 +52,68 @@
  * @param generator a uniform random number generator.
  */
 public KnownDoubleQuantileEstimator(int b, int k, long N, double samplingRate, RandomEngine generator) {
-	this.samplingRate = samplingRate;
-	this.N = N;
+  this.samplingRate = samplingRate;
+  this.N = N;
 
-	if (this.samplingRate <= 1.0) {
-		this.samplingAssistant = null;
-	}
-	else {
-		this.samplingAssistant = new RandomSamplingAssistant(Arithmetic.floor(N/samplingRate), N, generator);
-	}
-	
-	setUp(b,k);
-	this.clear();
+  if (this.samplingRate <= 1.0) {
+    this.samplingAssistant = null;
+  }
+  else {
+    this.samplingAssistant = new RandomSamplingAssistant(Arithmetic.floor(N/samplingRate), N, generator);
+  }
+  
+  setUp(b,k);
+  this.clear();
 }
 /**
  * @param infinities the number of infinities to fill.
  * @param buffer the buffer into which the infinities shall be filled.
  */
 protected void addInfinities(int missingInfinities,  DoubleBuffer buffer) {
-	RandomSamplingAssistant oldAssistant = this.samplingAssistant;
-	this.samplingAssistant = null; // switch off sampler
-	//double[] infinities = new double[missingInfinities];
-	
-	boolean even=true;
-	for (int i=0; i<missingInfinities; i++) {
-		if (even) buffer.values.add(Double.MAX_VALUE);
-		else	  buffer.values.add(-Double.MAX_VALUE);
-		
-		//if (even) {infinities[i]=Double.MAX_VALUE;}
-		//else	  {infinities[i]=-Double.MAX_VALUE;}
-		
-		//if (even) {this.add(Double.MAX_VALUE);}
-		//else	  {this.add(-Double.MAX_VALUE);}
-		even = !even;
-	}
-	
-	//buffer.values.addAllOfFromTo(new DoubleArrayList(infinities),0,missingInfinities-1);
-	
-	//this.totalElementsFilled -= infinities;
-	
-	this.samplingAssistant = oldAssistant; // switch on sampler again
+  RandomSamplingAssistant oldAssistant = this.samplingAssistant;
+  this.samplingAssistant = null; // switch off sampler
+  //double[] infinities = new double[missingInfinities];
+  
+  boolean even=true;
+  for (int i=0; i<missingInfinities; i++) {
+    if (even) buffer.values.add(Double.MAX_VALUE);
+    else    buffer.values.add(-Double.MAX_VALUE);
+    
+    //if (even) {infinities[i]=Double.MAX_VALUE;}
+    //else    {infinities[i]=-Double.MAX_VALUE;}
+    
+    //if (even) {this.add(Double.MAX_VALUE);}
+    //else    {this.add(-Double.MAX_VALUE);}
+    even = !even;
+  }
+  
+  //buffer.values.addAllOfFromTo(new DoubleArrayList(infinities),0,missingInfinities-1);
+  
+  //this.totalElementsFilled -= infinities;
+  
+  this.samplingAssistant = oldAssistant; // switch on sampler again
 }
 /**
  * Not yet commented.
  */
 protected DoubleBuffer[] buffersToCollapse() {
-	int minLevel = bufferSet._getMinLevelOfFullOrPartialBuffers();
-	return bufferSet._getFullOrPartialBuffersWithLevel(minLevel);
+  int minLevel = bufferSet._getMinLevelOfFullOrPartialBuffers();
+  return bufferSet._getFullOrPartialBuffersWithLevel(minLevel);
 }
 /**
  * Removes all elements from the receiver.  The receiver will
  * be empty after this call returns, and its memory requirements will be close to zero.
  */
 public void clear() {
-	super.clear();
-	this.beta=1.0;
-	this.weHadMoreThanOneEmptyBuffer = false;
-	//this.setSamplingRate(samplingRate,N);
+  super.clear();
+  this.beta=1.0;
+  this.weHadMoreThanOneEmptyBuffer = false;
+  //this.setSamplingRate(samplingRate,N);
 
-	RandomSamplingAssistant assist = this.samplingAssistant;
-	if (assist != null) {
-		this.samplingAssistant = new RandomSamplingAssistant(Arithmetic.floor(N/samplingRate), N, assist.getRandomGenerator());
-	}
+  RandomSamplingAssistant assist = this.samplingAssistant;
+  if (assist != null) {
+    this.samplingAssistant = new RandomSamplingAssistant(Arithmetic.floor(N/samplingRate), N, assist.getRandomGenerator());
+  }
 }
 /**
  * Returns a deep copy of the receiver.
@@ -123,50 +121,50 @@
  * @return a deep copy of the receiver.
  */
 public Object clone() {
-	KnownDoubleQuantileEstimator copy = (KnownDoubleQuantileEstimator) super.clone();
-	if (this.samplingAssistant != null) copy.samplingAssistant = (RandomSamplingAssistant) copy.samplingAssistant.clone();
-	return copy;
+  KnownDoubleQuantileEstimator copy = (KnownDoubleQuantileEstimator) super.clone();
+  if (this.samplingAssistant != null) copy.samplingAssistant = (RandomSamplingAssistant) copy.samplingAssistant.clone();
+  return copy;
 }
 /**
  * Not yet commented.
  */
 protected void newBuffer() {
-	int numberOfEmptyBuffers = this.bufferSet._getNumberOfEmptyBuffers();
-	//DoubleBuffer[] emptyBuffers = this.bufferSet._getEmptyBuffers();
-	if (numberOfEmptyBuffers==0) throw new RuntimeException("Oops, no empty buffer.");
+  int numberOfEmptyBuffers = this.bufferSet._getNumberOfEmptyBuffers();
+  //DoubleBuffer[] emptyBuffers = this.bufferSet._getEmptyBuffers();
+  if (numberOfEmptyBuffers==0) throw new RuntimeException("Oops, no empty buffer.");
 
-	this.currentBufferToFill = this.bufferSet._getFirstEmptyBuffer();
-	if (numberOfEmptyBuffers==1 && ! this.weHadMoreThanOneEmptyBuffer) {
-		this.currentBufferToFill.level(this.bufferSet._getMinLevelOfFullOrPartialBuffers());
-	}
-	else {
-		this.weHadMoreThanOneEmptyBuffer = true;
-		this.currentBufferToFill.level(0);
-		/*
-		for (int i=0; i<emptyBuffers.length; i++) {
-			emptyBuffers[i].level = 0;			
-		}
-		*/
-	}
-	//currentBufferToFill.state = DoubleBuffer.PARTIAL;
-	this.currentBufferToFill.weight(1);
+  this.currentBufferToFill = this.bufferSet._getFirstEmptyBuffer();
+  if (numberOfEmptyBuffers==1 && ! this.weHadMoreThanOneEmptyBuffer) {
+    this.currentBufferToFill.level(this.bufferSet._getMinLevelOfFullOrPartialBuffers());
+  }
+  else {
+    this.weHadMoreThanOneEmptyBuffer = true;
+    this.currentBufferToFill.level(0);
+    /*
+    for (int i=0; i<emptyBuffers.length; i++) {
+      emptyBuffers[i].level = 0;      
+    }
+    */
+  }
+  //currentBufferToFill.state = DoubleBuffer.PARTIAL;
+  this.currentBufferToFill.weight(1);
 }
 /**
  * Not yet commented.
  */
 protected void postCollapse(DoubleBuffer[] toCollapse) {
-	this.weHadMoreThanOneEmptyBuffer = false;
+  this.weHadMoreThanOneEmptyBuffer = false;
 }
 /**
  */
 protected DoubleArrayList preProcessPhis(DoubleArrayList phis) {
-	if (beta>1.0) {
-		phis = phis.copy();
-		for (int i=phis.size(); --i >=0;) {
-			phis.set(i, (2*phis.get(i) + beta - 1) / (2*beta));
-		}		
-	}
-	return phis;
+  if (beta>1.0) {
+    phis = phis.copy();
+    for (int i=phis.size(); --i >=0;) {
+      phis.set(i, (2*phis.get(i) + beta - 1) / (2*beta));
+    }    
+  }
+  return phis;
 }
 /**
  * Computes the specified quantile elements over the values previously added.
@@ -174,41 +172,41 @@
  * @return the approximate quantile elements.
  */
 public DoubleArrayList quantileElements(DoubleArrayList phis) {
-	/*
-	* The KNOWN quantile finder reads off quantiles from FULL buffers only.
-	* Since there might be a partially full buffer, this method first satisfies this constraint by temporarily filling a few +infinity, -infinity elements to make up a full block.
-	* This is in full conformance with the explicit approximation guarantees.
- 	*
- 	* For those of you working on online apps:
-  	* The approximation guarantees are given for computing quantiles AFTER N elements have been filled, not for intermediate displays.
-	* If you have one thread filling and another thread displaying concurrently, you will note that in the very beginning the infinities will dominate the display.
- 	* This could confuse users, because, of course, they don't expect any infinities, even if they "disappear" after a short while.
- 	* To prevent panic exclude phi's close to zero or one in the early phases of processing.
-  	*/
-	DoubleBuffer partial = this.bufferSet._getPartialBuffer();
-	int missingValues = 0;
-	if (partial != null) { // any auxiliary infinities needed?
-		missingValues = bufferSet.k() - partial.size();
-		if (missingValues <= 0) throw new RuntimeException("Oops! illegal missing values.");
+  /*
+  * The KNOWN quantile finder reads off quantiles from FULL buffers only.
+  * Since there might be a partially full buffer, this method first satisfies this constraint by temporarily filling a few +infinity, -infinity elements to make up a full block.
+  * This is in full conformance with the explicit approximation guarantees.
+   *
+   * For those of you working on online apps:
+    * The approximation guarantees are given for computing quantiles AFTER N elements have been filled, not for intermediate displays.
+  * If you have one thread filling and another thread displaying concurrently, you will note that in the very beginning the infinities will dominate the display.
+   * This could confuse users, because, of course, they don't expect any infinities, even if they "disappear" after a short while.
+   * To prevent panic exclude phi's close to zero or one in the early phases of processing.
+    */
+  DoubleBuffer partial = this.bufferSet._getPartialBuffer();
+  int missingValues = 0;
+  if (partial != null) { // any auxiliary infinities needed?
+    missingValues = bufferSet.k() - partial.size();
+    if (missingValues <= 0) throw new RuntimeException("Oops! illegal missing values.");
 
-		//System.out.println("adding "+missingValues+" infinity elements...");
-		this.addInfinities(missingValues,partial);
+    //System.out.println("adding "+missingValues+" infinity elements...");
+    this.addInfinities(missingValues,partial);
 
-		//determine beta (N + Infinity values = beta * N)
-		this.beta = (this.totalElementsFilled + missingValues) / (double)this.totalElementsFilled;
-		}
-	else {
-		this.beta=1.0; 
-	}
-	 
-	DoubleArrayList quantileElements = super.quantileElements(phis);
+    //determine beta (N + Infinity values = beta * N)
+    this.beta = (this.totalElementsFilled + missingValues) / (double)this.totalElementsFilled;
+    }
+  else {
+    this.beta=1.0; 
+  }
+   
+  DoubleArrayList quantileElements = super.quantileElements(phis);
 
-	// restore state we were in before.
-	// remove the temporarily added infinities.
-	if (partial != null) removeInfinitiesFrom(missingValues, partial);
+  // restore state we were in before.
+  // remove the temporarily added infinities.
+  if (partial != null) removeInfinitiesFrom(missingValues, partial);
 
-	// now you can continue filling the remaining values, if any.
-	return quantileElements;
+  // now you can continue filling the remaining values, if any.
+  return quantileElements;
 }
 /**
  * Reading off quantiles requires to fill some +infinity, -infinity values to make a partial buffer become full.
@@ -220,42 +218,42 @@
  * @param buffer the buffer into which the infinities were filled.
  */
 protected void removeInfinitiesFrom(int infinities, DoubleBuffer buffer) {
-	int plusInf = 0;
-	int minusInf = 0;
-	// count them (this is not very clever but it's safe)
-	boolean even=true;
-	for (int i=0; i<infinities; i++) {
-		if (even) plusInf++;
-		else	  minusInf++;
-		even = !even;
-	}
+  int plusInf = 0;
+  int minusInf = 0;
+  // count them (this is not very clever but it's safe)
+  boolean even=true;
+  for (int i=0; i<infinities; i++) {
+    if (even) plusInf++;
+    else    minusInf++;
+    even = !even;
+  }
 
-	buffer.values.removeFromTo(buffer.size()-plusInf, buffer.size()-1);
-	buffer.values.removeFromTo(0, minusInf-1);
-	//this.totalElementsFilled -= infinities;
+  buffer.values.removeFromTo(buffer.size()-plusInf, buffer.size()-1);
+  buffer.values.removeFromTo(0, minusInf-1);
+  //this.totalElementsFilled -= infinities;
 }
 /**
  * Not yet commented.
  */
 protected boolean sampleNextElement() {
-	if (samplingAssistant == null) return true;
+  if (samplingAssistant == null) return true;
 
-	/*
-	 * This is a KNOWN N quantile finder!
-	 * One should not try to fill more than N elements,
-	 * because otherwise we can't give explicit approximation guarantees anymore.
-	 * Use an UNKNOWN quantile finder instead if your app may fill more than N elements.
-	 *
-	 * However, to make this class meaningful even under wired use cases, we actually do allow to fill more than N elements (without explicit approx. guarantees, of course).
-	 * Normally, elements beyond N will not get sampled because the sampler is exhausted. 
-	 * Therefore the histogram will no more change no matter how much you fill.
-	 * This might not be what the user expects.
-	 * Therefore we use a new (unexhausted) sampler with the same parametrization.
-	 *
-	 * If you want this class to ignore any elements beyong N, then comment the following line.
-	 */
-	//if ((totalElementsFilled-1) % N == 0) setSamplingRate(samplingRate, N); // delete if appropriate
+  /*
+   * This is a KNOWN N quantile finder!
+   * One should not try to fill more than N elements,
+   * because otherwise we can't give explicit approximation guarantees anymore.
+   * Use an UNKNOWN quantile finder instead if your app may fill more than N elements.
+   *
+   * However, to make this class meaningful even under wired use cases, we actually do allow to fill more than N elements (without explicit approx. guarantees, of course).
+   * Normally, elements beyond N will not get sampled because the sampler is exhausted. 
+   * Therefore the histogram will no more change no matter how much you fill.
+   * This might not be what the user expects.
+   * Therefore we use a new (unexhausted) sampler with the same parametrization.
+   *
+   * If you want this class to ignore any elements beyong N, then comment the following line.
+   */
+  //if ((totalElementsFilled-1) % N == 0) setSamplingRate(samplingRate, N); // delete if appropriate
 
-	return samplingAssistant.sampleNextElement();
+  return samplingAssistant.sampleNextElement();
 }
 }
Index: matrix/src/main/java/org/apache/mahout/jet/stat/quantile/UnknownDoubleQuantileEstimator.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/jet/stat/quantile/UnknownDoubleQuantileEstimator.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/jet/stat/quantile/UnknownDoubleQuantileEstimator.java	(working copy)
@@ -32,16 +32,14 @@
  * Accepted for Proc. of the 1999 ACM SIGMOD Int. Conf. on Management of Data,
  * Paper (soon) available <A HREF="http://www-cad.eecs.berkeley.edu/~manku"> here</A>.
  *
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 09/24/99
  * @see QuantileFinderFactory
  * @see KnownApproximateDoubleQuantileFinder
  */
 class UnknownDoubleQuantileEstimator extends DoubleQuantileEstimator {
-	protected int currentTreeHeight;
-	final protected int treeHeightStartingSampling;
-	protected WeightedRandomSampler sampler;
-	protected double precomputeEpsilon;
+  protected int currentTreeHeight;
+  final protected int treeHeightStartingSampling;
+  protected WeightedRandomSampler sampler;
+  protected double precomputeEpsilon;
 /**
  * Constructs an approximate quantile finder with b buffers, each having k elements.
  * @param b the number of buffers
@@ -51,36 +49,36 @@
  * @param generator a uniform random number generator.
  */
 public UnknownDoubleQuantileEstimator(int b, int k, int h, double precomputeEpsilon, RandomEngine generator) {
-	this.sampler = new WeightedRandomSampler(1,generator);
-	setUp(b,k);
-	this.treeHeightStartingSampling = h;
-	this.precomputeEpsilon = precomputeEpsilon;
-	this.clear();
+  this.sampler = new WeightedRandomSampler(1,generator);
+  setUp(b,k);
+  this.treeHeightStartingSampling = h;
+  this.precomputeEpsilon = precomputeEpsilon;
+  this.clear();
 }
 /**
  * Not yet commented.
  */
 protected DoubleBuffer[] buffersToCollapse() {
-	DoubleBuffer[] fullBuffers = bufferSet._getFullOrPartialBuffers();
+  DoubleBuffer[] fullBuffers = bufferSet._getFullOrPartialBuffers();
 
-	sortAscendingByLevel(fullBuffers);
-		
-	// if there is only one buffer at the lowest level, then increase its level so that there are at least two at the lowest level.
-	int minLevel = fullBuffers[1].level();
-	if (fullBuffers[0].level() < minLevel) {
-		fullBuffers[0].level(minLevel);
-	}
+  sortAscendingByLevel(fullBuffers);
+    
+  // if there is only one buffer at the lowest level, then increase its level so that there are at least two at the lowest level.
+  int minLevel = fullBuffers[1].level();
+  if (fullBuffers[0].level() < minLevel) {
+    fullBuffers[0].level(minLevel);
+  }
 
-	return bufferSet._getFullOrPartialBuffersWithLevel(minLevel);
+  return bufferSet._getFullOrPartialBuffersWithLevel(minLevel);
 }
 /**
  * Removes all elements from the receiver.  The receiver will
  * be empty after this call returns, and its memory requirements will be close to zero.
  */
 public synchronized void clear() {
-	super.clear();
-	this.currentTreeHeight = 1;
-	this.sampler.setWeight(1);
+  super.clear();
+  this.currentTreeHeight = 1;
+  this.sampler.setWeight(1);
 }
 /**
  * Returns a deep copy of the receiver.
@@ -88,30 +86,30 @@
  * @return a deep copy of the receiver.
  */
 public Object clone() {
-	UnknownDoubleQuantileEstimator copy = (UnknownDoubleQuantileEstimator) super.clone();
-	if (this.sampler != null) copy.sampler = (WeightedRandomSampler) copy.sampler.clone();
-	return copy;
+  UnknownDoubleQuantileEstimator copy = (UnknownDoubleQuantileEstimator) super.clone();
+  if (this.sampler != null) copy.sampler = (WeightedRandomSampler) copy.sampler.clone();
+  return copy;
 }
 /**
  * Not yet commented.
  */
 protected void newBuffer() {
-	currentBufferToFill = bufferSet._getFirstEmptyBuffer();
-	if (currentBufferToFill==null) throw new RuntimeException("Oops, no empty buffer.");
+  currentBufferToFill = bufferSet._getFirstEmptyBuffer();
+  if (currentBufferToFill==null) throw new RuntimeException("Oops, no empty buffer.");
 
-	currentBufferToFill.level(currentTreeHeight - 1);
-	currentBufferToFill.weight(sampler.getWeight());
+  currentBufferToFill.level(currentTreeHeight - 1);
+  currentBufferToFill.weight(sampler.getWeight());
 }
 /**
  * Not yet commented.
  */
 protected void postCollapse(DoubleBuffer[] toCollapse) {
-	if (toCollapse.length == bufferSet.b()) { //delta for unknown finder
-		currentTreeHeight++;
-		if (currentTreeHeight>=treeHeightStartingSampling) {
-			sampler.setWeight(sampler.getWeight() * 2);
-		}
-	}
+  if (toCollapse.length == bufferSet.b()) { //delta for unknown finder
+    currentTreeHeight++;
+    if (currentTreeHeight>=treeHeightStartingSampling) {
+      sampler.setWeight(sampler.getWeight() * 2);
+    }
+  }
 }
 /**
  * Computes the specified quantile elements over the values previously added.
@@ -119,56 +117,56 @@
  * @return the approximate quantile elements.
  */
 public DoubleArrayList quantileElements(DoubleArrayList phis) {
-	if (precomputeEpsilon<=0.0) return super.quantileElements(phis);
-	
-	int quantilesToPrecompute = (int) Utils.epsilonCeiling(1.0 / precomputeEpsilon);
-	/*
-	if (phis.size() > quantilesToPrecompute) {
-		// illegal use case!
-		// we compute results, but loose explicit approximation guarantees.
-		return super.quantileElements(phis);
-	}
-	*/
+  if (precomputeEpsilon<=0.0) return super.quantileElements(phis);
+  
+  int quantilesToPrecompute = (int) Utils.epsilonCeiling(1.0 / precomputeEpsilon);
+  /*
+  if (phis.size() > quantilesToPrecompute) {
+    // illegal use case!
+    // we compute results, but loose explicit approximation guarantees.
+    return super.quantileElements(phis);
+  }
+  */
  
-	//select that quantile from the precomputed set that corresponds to a position closest to phi.
-	phis = phis.copy();
-	double e = precomputeEpsilon;
-	for (int index=phis.size(); --index >= 0;) {
-		double phi = phis.get(index);
-		int i = (int) Math.round( ((2.0*phi/e) - 1.0 ) / 2.0); // finds closest
-		i = Math.min(quantilesToPrecompute-1, Math.max(0,i));
-		double augmentedPhi = (e/2.0)*(1+2*i);
-		phis.set(index,augmentedPhi);				
-	}
-	
-	return super.quantileElements(phis);
+  //select that quantile from the precomputed set that corresponds to a position closest to phi.
+  phis = phis.copy();
+  double e = precomputeEpsilon;
+  for (int index=phis.size(); --index >= 0;) {
+    double phi = phis.get(index);
+    int i = (int) Math.round( ((2.0*phi/e) - 1.0 ) / 2.0); // finds closest
+    i = Math.min(quantilesToPrecompute-1, Math.max(0,i));
+    double augmentedPhi = (e/2.0)*(1+2*i);
+    phis.set(index,augmentedPhi);        
+  }
+  
+  return super.quantileElements(phis);
 }
 /**
  * Not yet commented.
  */
 protected boolean sampleNextElement() {
-	return sampler.sampleNextElement();
+  return sampler.sampleNextElement();
 }
 /**
  * To do. This could faster be done without sorting (min and second min).
  */
 protected static void sortAscendingByLevel(DoubleBuffer[] fullBuffers) {
-	new ObjectArrayList(fullBuffers).quickSortFromTo(0,fullBuffers.length-1,
-		new java.util.Comparator() {
-			public int compare(Object o1, Object o2) {
-				int l1 = ((DoubleBuffer) o1).level();
-				int l2 = ((DoubleBuffer) o2).level();
-				return l1<l2? -1: l1==l2? 0: +1;
-			}
-		}
-	);
+  new ObjectArrayList(fullBuffers).quickSortFromTo(0,fullBuffers.length-1,
+    new java.util.Comparator() {
+      public int compare(Object o1, Object o2) {
+        int l1 = ((DoubleBuffer) o1).level();
+        int l2 = ((DoubleBuffer) o2).level();
+        return l1<l2? -1: l1==l2? 0: +1;
+      }
+    }
+  );
 }
 /**
  * Returns a String representation of the receiver.
  */
 public String toString() {
-	StringBuffer buf = new StringBuffer(super.toString());
-	buf.setLength(buf.length()-1);
-	return buf + ", h="+currentTreeHeight+", hStartSampling="+treeHeightStartingSampling+", precomputeEpsilon="+precomputeEpsilon+")";
+  StringBuffer buf = new StringBuffer(super.toString());
+  buf.setLength(buf.length()-1);
+  return buf + ", h="+currentTreeHeight+", hStartSampling="+treeHeightStartingSampling+", precomputeEpsilon="+precomputeEpsilon+")";
 }
 }
Index: matrix/src/main/java/org/apache/mahout/jet/stat/quantile/ExactDoubleQuantileFinder.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/jet/stat/quantile/ExactDoubleQuantileFinder.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/jet/stat/quantile/ExactDoubleQuantileFinder.java	(working copy)
@@ -13,34 +13,32 @@
  * Exact quantile finding algorithm for known and unknown <tt>N</tt> requiring large main memory; computes quantiles over a sequence of <tt>double</tt> elements.
  * The folkore algorithm: Keeps all elements in main memory, sorts the list, then picks the quantiles.
  *
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 09/24/99
  */
 //class ExactDoubleQuantileFinder extends Object implements DoubleQuantileFinder {
 class ExactDoubleQuantileFinder extends org.apache.mahout.matrix.PersistentObject implements DoubleQuantileFinder {
-	protected DoubleArrayList buffer;
-	protected boolean isSorted;
+  protected DoubleArrayList buffer;
+  protected boolean isSorted;
 /**
  * Constructs an empty exact quantile finder.
  */
 public ExactDoubleQuantileFinder() {
-	this.buffer = new DoubleArrayList(0);
-	this.clear();
+  this.buffer = new DoubleArrayList(0);
+  this.clear();
 }
 /**
  * Adds a value to the receiver.
  * @param value the value to add.
  */
 public void add(double value) {
-	this.buffer.add(value);
-	this.isSorted = false;
+  this.buffer.add(value);
+  this.isSorted = false;
 }
 /**
  * Adds all values of the specified list to the receiver.
  * @param values the list of which all values shall be added.
  */
 public void addAllOf(DoubleArrayList values) {
-	addAllOfFromTo(values, 0, values.size()-1);
+  addAllOfFromTo(values, 0, values.size()-1);
 }
 /**
  * Adds the part of the specified list between indexes <tt>from</tt> (inclusive) and <tt>to</tt> (inclusive) to the receiver.
@@ -50,17 +48,17 @@
  * @param to the index of the last element to be added (inclusive).
  */
 public void addAllOfFromTo(DoubleArrayList values, int from, int to) {
-	buffer.addAllOfFromTo(values, from, to);
-	this.isSorted = false;
+  buffer.addAllOfFromTo(values, from, to);
+  this.isSorted = false;
 }
 /**
  * Removes all elements from the receiver.  The receiver will
  * be empty after this call returns, and its memory requirements will be close to zero.
  */
 public void clear() {
-	this.buffer.clear();
-	this.buffer.trimToSize();
-	this.isSorted = false;
+  this.buffer.clear();
+  this.buffer.trimToSize();
+  this.isSorted = false;
 }
 /**
  * Returns a deep copy of the receiver.
@@ -68,16 +66,16 @@
  * @return a deep copy of the receiver.
  */
 public Object clone() {
-	ExactDoubleQuantileFinder copy = (ExactDoubleQuantileFinder) super.clone();
-	if (this.buffer != null) copy.buffer = copy.buffer.copy();
-	return copy;
+  ExactDoubleQuantileFinder copy = (ExactDoubleQuantileFinder) super.clone();
+  if (this.buffer != null) copy.buffer = copy.buffer.copy();
+  return copy;
 }
 /**
  * Returns whether the specified element is contained in the receiver.
  */
 public boolean contains(double element) {
-	this.sort();
-	return buffer.binarySearch(element)>=0;
+  this.sort();
+  return buffer.binarySearch(element)>=0;
 }
 /**
  * Applies a procedure to each element of the receiver, if any.
@@ -86,18 +84,18 @@
  * @return <tt>false</tt> if the procedure stopped before all elements where iterated over, <tt>true</tt> otherwise. 
  */
 public boolean forEach(org.apache.mahout.matrix.function.DoubleProcedure procedure) {
-	double[] theElements = buffer.elements();
-	int theSize = (int) size();
-	
-	for (int i=0; i<theSize;) if (! procedure.apply(theElements[i++])) return false;
-	return true;
+  double[] theElements = buffer.elements();
+  int theSize = (int) size();
+  
+  for (int i=0; i<theSize;) if (! procedure.apply(theElements[i++])) return false;
+  return true;
 }
 /**
  * Returns the number of elements currently needed to store all contained elements.
  * This number usually differs from the results of method <tt>size()</tt>, according to the underlying datastructure.
  */
 public long memory() {
-	return buffer.elements().length;
+  return buffer.elements().length;
 }
 /**
  * Returns how many percent of the elements contained in the receiver are <tt>&lt;= element</tt>.
@@ -107,8 +105,8 @@
  * @return the percentage <tt>p</tt> of elements <tt>&lt;= element</tt> (<tt>0.0 &lt;= p &lt;=1.0)</tt>.
  */
 public double phi(double element) {
-	this.sort();
-	return org.apache.mahout.jet.stat.Descriptive.rankInterpolated(buffer,element) / this.size();
+  this.sort();
+  return org.apache.mahout.jet.stat.Descriptive.rankInterpolated(buffer,element) / this.size();
 }
 /**
  * Computes the specified quantile elements over the values previously added.
@@ -116,49 +114,49 @@
  * @return the exact quantile elements.
  */
 public DoubleArrayList quantileElements(DoubleArrayList phis) {
-	this.sort();
-	return org.apache.mahout.jet.stat.Descriptive.quantiles(this.buffer, phis);
-	/*
-	int bufferSize = (int) this.size();
-	double[] quantileElements = new double[phis.size()];
-	for (int i=phis.size(); --i >=0;) {
-		int rank=(int)Utils.epsilonCeiling(phis.get(i)*bufferSize) -1;
-		quantileElements[i]=buffer.get(rank);
-	}
-	return new DoubleArrayList(quantileElements);
-	*/
+  this.sort();
+  return org.apache.mahout.jet.stat.Descriptive.quantiles(this.buffer, phis);
+  /*
+  int bufferSize = (int) this.size();
+  double[] quantileElements = new double[phis.size()];
+  for (int i=phis.size(); --i >=0;) {
+    int rank=(int)Utils.epsilonCeiling(phis.get(i)*bufferSize) -1;
+    quantileElements[i]=buffer.get(rank);
+  }
+  return new DoubleArrayList(quantileElements);
+  */
 }
 /**
  * Returns the number of elements currently contained in the receiver (identical to the number of values added so far).
  */
 public long size() {
-	return buffer.size();
+  return buffer.size();
 }
 /**
  * Sorts the receiver.
  */
 protected void sort() {
-	if (! isSorted) {
-		// IMPORTANT: TO DO : replace mergeSort with quickSort!
-		// currently it is mergeSort because JDK 1.2 can't be imported into VisualAge.
-		buffer.sort();
-		//this.buffer.mergeSort();
-		this.isSorted = true;
-	}
+  if (! isSorted) {
+    // IMPORTANT: TO DO : replace mergeSort with quickSort!
+    // currently it is mergeSort because JDK 1.2 can't be imported into VisualAge.
+    buffer.sort();
+    //this.buffer.mergeSort();
+    this.isSorted = true;
+  }
 }
 /**
  * Returns a String representation of the receiver.
  */
 public String toString() {
-	String s=this.getClass().getName();
-	s = s.substring(s.lastIndexOf('.')+1);
-	return s + "(mem="+memory()+", size="+size()+")";
+  String s=this.getClass().getName();
+  s = s.substring(s.lastIndexOf('.')+1);
+  return s + "(mem="+memory()+", size="+size()+")";
 }
 /**
  * Returns the number of elements currently needed to store all contained elements.
  * This number usually differs from the results of method <tt>size()</tt>, according to the underlying datastructure.
  */
 public long totalMemory() {
-	return memory();
+  return memory();
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/Arrays.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/Arrays.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/Arrays.java	(working copy)
@@ -14,8 +14,6 @@
  * @see java.util.Arrays
  * @see org.apache.mahout.matrix.Sorting
  *
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 03-Jul-99
  */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
@@ -37,21 +35,21 @@
  * @param   minCapacity   the desired minimum capacity.
  */
 public static byte[] ensureCapacity(byte[] array, int minCapacity) {
-	int oldCapacity = array.length;
-	byte[] newArray;
-	if (minCapacity > oldCapacity) {
-	    int newCapacity = (oldCapacity * 3)/2 + 1;
-		if (newCapacity < minCapacity) {
-			newCapacity = minCapacity;
-		}
-		
-	    newArray = new byte[newCapacity];
-	    System.arraycopy(array, 0, newArray, 0, oldCapacity);
-	}
-	else {
-		newArray=array;
-	}
-	return newArray;
+  int oldCapacity = array.length;
+  byte[] newArray;
+  if (minCapacity > oldCapacity) {
+      int newCapacity = (oldCapacity * 3)/2 + 1;
+    if (newCapacity < minCapacity) {
+      newCapacity = minCapacity;
+    }
+    
+      newArray = new byte[newCapacity];
+      System.arraycopy(array, 0, newArray, 0, oldCapacity);
+  }
+  else {
+    newArray=array;
+  }
+  return newArray;
 }
 /**
  * Ensures that a given array can hold up to <tt>minCapacity</tt> elements.
@@ -64,21 +62,21 @@
  * @param   minCapacity   the desired minimum capacity.
  */
 public static char[] ensureCapacity(char[] array, int minCapacity) {
-	int oldCapacity = array.length;
-	char[] newArray;
-	if (minCapacity > oldCapacity) {
-	    int newCapacity = (oldCapacity * 3)/2 + 1;
-		if (newCapacity < minCapacity) {
-			newCapacity = minCapacity;
-		}
-		
-	    newArray = new char[newCapacity];
-	    System.arraycopy(array, 0, newArray, 0, oldCapacity);
-	}
-	else {
-		newArray=array;
-	}
-	return newArray;
+  int oldCapacity = array.length;
+  char[] newArray;
+  if (minCapacity > oldCapacity) {
+      int newCapacity = (oldCapacity * 3)/2 + 1;
+    if (newCapacity < minCapacity) {
+      newCapacity = minCapacity;
+    }
+    
+      newArray = new char[newCapacity];
+      System.arraycopy(array, 0, newArray, 0, oldCapacity);
+  }
+  else {
+    newArray=array;
+  }
+  return newArray;
 }
 /**
  * Ensures that a given array can hold up to <tt>minCapacity</tt> elements.
@@ -91,22 +89,22 @@
  * @param   minCapacity   the desired minimum capacity.
  */
 public static double[] ensureCapacity(double[] array, int minCapacity) {
-	int oldCapacity = array.length;
-	double[] newArray;
-	if (minCapacity > oldCapacity) {
-	    int newCapacity = (oldCapacity * 3)/2 + 1;
-		if (newCapacity < minCapacity) {
-			newCapacity = minCapacity;
-		}
-		
-	    newArray = new double[newCapacity];
-	    //for (int i = oldCapacity; --i >= 0; ) newArray[i] = array[i];
-	    System.arraycopy(array, 0, newArray, 0, oldCapacity);
-	}
-	else {
-		newArray=array;
-	}
-	return newArray;
+  int oldCapacity = array.length;
+  double[] newArray;
+  if (minCapacity > oldCapacity) {
+      int newCapacity = (oldCapacity * 3)/2 + 1;
+    if (newCapacity < minCapacity) {
+      newCapacity = minCapacity;
+    }
+    
+      newArray = new double[newCapacity];
+      //for (int i = oldCapacity; --i >= 0; ) newArray[i] = array[i];
+      System.arraycopy(array, 0, newArray, 0, oldCapacity);
+  }
+  else {
+    newArray=array;
+  }
+  return newArray;
 }
 /**
  * Ensures that a given array can hold up to <tt>minCapacity</tt> elements.
@@ -119,21 +117,21 @@
  * @param   minCapacity   the desired minimum capacity.
  */
 public static float[] ensureCapacity(float[] array, int minCapacity) {
-	int oldCapacity = array.length;
-	float[] newArray;
-	if (minCapacity > oldCapacity) {
-	    int newCapacity = (oldCapacity * 3)/2 + 1;
-		if (newCapacity < minCapacity) {
-			newCapacity = minCapacity;
-		}
-		
-	    newArray = new float[newCapacity];
-	    System.arraycopy(array, 0, newArray, 0, oldCapacity);
-	}
-	else {
-		newArray=array;
-	}
-	return newArray;
+  int oldCapacity = array.length;
+  float[] newArray;
+  if (minCapacity > oldCapacity) {
+      int newCapacity = (oldCapacity * 3)/2 + 1;
+    if (newCapacity < minCapacity) {
+      newCapacity = minCapacity;
+    }
+    
+      newArray = new float[newCapacity];
+      System.arraycopy(array, 0, newArray, 0, oldCapacity);
+  }
+  else {
+    newArray=array;
+  }
+  return newArray;
 }
 /**
  * Ensures that a given array can hold up to <tt>minCapacity</tt> elements.
@@ -146,21 +144,21 @@
  * @param   minCapacity   the desired minimum capacity.
  */
 public static int[] ensureCapacity(int[] array, int minCapacity) {
-	int oldCapacity = array.length;
-	int[] newArray;
-	if (minCapacity > oldCapacity) {
-	    int newCapacity = (oldCapacity * 3)/2 + 1;
-		if (newCapacity < minCapacity) {
-			newCapacity = minCapacity;
-		}
-		
-	    newArray = new int[newCapacity];
-	    System.arraycopy(array, 0, newArray, 0, oldCapacity);
-	}
-	else {
-		newArray=array;
-	}
-	return newArray;
+  int oldCapacity = array.length;
+  int[] newArray;
+  if (minCapacity > oldCapacity) {
+      int newCapacity = (oldCapacity * 3)/2 + 1;
+    if (newCapacity < minCapacity) {
+      newCapacity = minCapacity;
+    }
+    
+      newArray = new int[newCapacity];
+      System.arraycopy(array, 0, newArray, 0, oldCapacity);
+  }
+  else {
+    newArray=array;
+  }
+  return newArray;
 }
 /**
  * Ensures that a given array can hold up to <tt>minCapacity</tt> elements.
@@ -173,21 +171,21 @@
  * @param   minCapacity   the desired minimum capacity.
  */
 public static long[] ensureCapacity(long[] array, int minCapacity) {
-	int oldCapacity = array.length;
-	long[] newArray;
-	if (minCapacity > oldCapacity) {
-	    int newCapacity = (oldCapacity * 3)/2 + 1;
-		if (newCapacity < minCapacity) {
-			newCapacity = minCapacity;
-		}
-		
-	    newArray = new long[newCapacity];
-	    System.arraycopy(array, 0, newArray, 0, oldCapacity);
-	}
-	else {
-		newArray=array;
-	}
-	return newArray;
+  int oldCapacity = array.length;
+  long[] newArray;
+  if (minCapacity > oldCapacity) {
+      int newCapacity = (oldCapacity * 3)/2 + 1;
+    if (newCapacity < minCapacity) {
+      newCapacity = minCapacity;
+    }
+    
+      newArray = new long[newCapacity];
+      System.arraycopy(array, 0, newArray, 0, oldCapacity);
+  }
+  else {
+    newArray=array;
+  }
+  return newArray;
 }
 /**
  * Ensures that a given array can hold up to <tt>minCapacity</tt> elements.
@@ -200,21 +198,21 @@
  * @param   minCapacity   the desired minimum capacity.
  */
 public static Object[] ensureCapacity(Object[] array, int minCapacity) {
-	int oldCapacity = array.length;
-	Object[] newArray;
-	if (minCapacity > oldCapacity) {
-	    int newCapacity = (oldCapacity * 3)/2 + 1;
-		if (newCapacity < minCapacity) {
-			newCapacity = minCapacity;
-		}
-		
-	    newArray = new Object[newCapacity];
-	    System.arraycopy(array, 0, newArray, 0, oldCapacity);
-	}
-	else {
-		newArray=array;
-	}
-	return newArray;
+  int oldCapacity = array.length;
+  Object[] newArray;
+  if (minCapacity > oldCapacity) {
+      int newCapacity = (oldCapacity * 3)/2 + 1;
+    if (newCapacity < minCapacity) {
+      newCapacity = minCapacity;
+    }
+    
+      newArray = new Object[newCapacity];
+      System.arraycopy(array, 0, newArray, 0, oldCapacity);
+  }
+  else {
+    newArray=array;
+  }
+  return newArray;
 }
 /**
  * Ensures that a given array can hold up to <tt>minCapacity</tt> elements.
@@ -227,21 +225,21 @@
  * @param   minCapacity   the desired minimum capacity.
  */
 public static short[] ensureCapacity(short[] array, int minCapacity) {
-	int oldCapacity = array.length;
-	short[] newArray;
-	if (minCapacity > oldCapacity) {
-	    int newCapacity = (oldCapacity * 3)/2 + 1;
-		if (newCapacity < minCapacity) {
-			newCapacity = minCapacity;
-		}
-		
-	    newArray = new short[newCapacity];
-	    System.arraycopy(array, 0, newArray, 0, oldCapacity);
-	}
-	else {
-		newArray=array;
-	}
-	return newArray;
+  int oldCapacity = array.length;
+  short[] newArray;
+  if (minCapacity > oldCapacity) {
+      int newCapacity = (oldCapacity * 3)/2 + 1;
+    if (newCapacity < minCapacity) {
+      newCapacity = minCapacity;
+    }
+    
+      newArray = new short[newCapacity];
+      System.arraycopy(array, 0, newArray, 0, oldCapacity);
+  }
+  else {
+    newArray=array;
+  }
+  return newArray;
 }
 /**
  * Ensures that a given array can hold up to <tt>minCapacity</tt> elements.
@@ -254,21 +252,21 @@
  * @param   minCapacity   the desired minimum capacity.
  */
 public static boolean[] ensureCapacity(boolean[] array, int minCapacity) {
-	int oldCapacity = array.length;
-	boolean[] newArray;
-	if (minCapacity > oldCapacity) {
-	    int newCapacity = (oldCapacity * 3)/2 + 1;
-		if (newCapacity < minCapacity) {
-			newCapacity = minCapacity;
-		}
-		
-	    newArray = new boolean[newCapacity];
-	    System.arraycopy(array, 0, newArray, 0, oldCapacity);
-	}
-	else {
-		newArray=array;
-	}
-	return newArray;
+  int oldCapacity = array.length;
+  boolean[] newArray;
+  if (minCapacity > oldCapacity) {
+      int newCapacity = (oldCapacity * 3)/2 + 1;
+    if (newCapacity < minCapacity) {
+      newCapacity = minCapacity;
+    }
+    
+      newArray = new boolean[newCapacity];
+      System.arraycopy(array, 0, newArray, 0, oldCapacity);
+  }
+  else {
+    newArray=array;
+  }
+  return newArray;
 }
 /**
  * Returns a string representation of the specified array.  The string
@@ -278,16 +276,16 @@
  * @return a string representation of the specified array.
  */
 public static String toString(byte[] array) {
-	StringBuffer buf = new StringBuffer();
-	buf.append("[");
-	int maxIndex = array.length - 1;
-	for (int i = 0; i <= maxIndex; i++) {
-	    buf.append(array[i]);
-	    if (i < maxIndex)
-		buf.append(", ");
-	}
-	buf.append("]");
-	return buf.toString();
+  StringBuffer buf = new StringBuffer();
+  buf.append("[");
+  int maxIndex = array.length - 1;
+  for (int i = 0; i <= maxIndex; i++) {
+      buf.append(array[i]);
+      if (i < maxIndex)
+    buf.append(", ");
+  }
+  buf.append("]");
+  return buf.toString();
 }
 /**
  * Returns a string representation of the specified array.  The string
@@ -297,16 +295,16 @@
  * @return a string representation of the specified array.
  */
 public static String toString(char[] array) {
-	StringBuffer buf = new StringBuffer();
-	buf.append("[");
-	int maxIndex = array.length - 1;
-	for (int i = 0; i <= maxIndex; i++) {
-	    buf.append(array[i]);
-	    if (i < maxIndex)
-		buf.append(", ");
-	}
-	buf.append("]");
-	return buf.toString();
+  StringBuffer buf = new StringBuffer();
+  buf.append("[");
+  int maxIndex = array.length - 1;
+  for (int i = 0; i <= maxIndex; i++) {
+      buf.append(array[i]);
+      if (i < maxIndex)
+    buf.append(", ");
+  }
+  buf.append("]");
+  return buf.toString();
 }
 /**
  * Returns a string representation of the specified array.  The string
@@ -316,16 +314,16 @@
  * @return a string representation of the specified array.
  */
 public static String toString(double[] array) {
-	StringBuffer buf = new StringBuffer();
-	buf.append("[");
-	int maxIndex = array.length - 1;
-	for (int i = 0; i <= maxIndex; i++) {
-	    buf.append(array[i]);
-	    if (i < maxIndex)
-		buf.append(", ");
-	}
-	buf.append("]");
-	return buf.toString();
+  StringBuffer buf = new StringBuffer();
+  buf.append("[");
+  int maxIndex = array.length - 1;
+  for (int i = 0; i <= maxIndex; i++) {
+      buf.append(array[i]);
+      if (i < maxIndex)
+    buf.append(", ");
+  }
+  buf.append("]");
+  return buf.toString();
 }
 /**
  * Returns a string representation of the specified array.  The string
@@ -335,16 +333,16 @@
  * @return a string representation of the specified array.
  */
 public static String toString(float[] array) {
-	StringBuffer buf = new StringBuffer();
-	buf.append("[");
-	int maxIndex = array.length - 1;
-	for (int i = 0; i <= maxIndex; i++) {
-	    buf.append(array[i]);
-	    if (i < maxIndex)
-		buf.append(", ");
-	}
-	buf.append("]");
-	return buf.toString();
+  StringBuffer buf = new StringBuffer();
+  buf.append("[");
+  int maxIndex = array.length - 1;
+  for (int i = 0; i <= maxIndex; i++) {
+      buf.append(array[i]);
+      if (i < maxIndex)
+    buf.append(", ");
+  }
+  buf.append("]");
+  return buf.toString();
 }
 /**
  * Returns a string representation of the specified array.  The string
@@ -354,16 +352,16 @@
  * @return a string representation of the specified array.
  */
 public static String toString(int[] array) {
-	StringBuffer buf = new StringBuffer();
-	buf.append("[");
-	int maxIndex = array.length - 1;
-	for (int i = 0; i <= maxIndex; i++) {
-	    buf.append(array[i]);
-	    if (i < maxIndex)
-		buf.append(", ");
-	}
-	buf.append("]");
-	return buf.toString();
+  StringBuffer buf = new StringBuffer();
+  buf.append("[");
+  int maxIndex = array.length - 1;
+  for (int i = 0; i <= maxIndex; i++) {
+      buf.append(array[i]);
+      if (i < maxIndex)
+    buf.append(", ");
+  }
+  buf.append("]");
+  return buf.toString();
 }
 /**
  * Returns a string representation of the specified array.  The string
@@ -373,16 +371,16 @@
  * @return a string representation of the specified array.
  */
 public static String toString(long[] array) {
-	StringBuffer buf = new StringBuffer();
-	buf.append("[");
-	int maxIndex = array.length - 1;
-	for (int i = 0; i <= maxIndex; i++) {
-	    buf.append(array[i]);
-	    if (i < maxIndex)
-		buf.append(", ");
-	}
-	buf.append("]");
-	return buf.toString();
+  StringBuffer buf = new StringBuffer();
+  buf.append("[");
+  int maxIndex = array.length - 1;
+  for (int i = 0; i <= maxIndex; i++) {
+      buf.append(array[i]);
+      if (i < maxIndex)
+    buf.append(", ");
+  }
+  buf.append("]");
+  return buf.toString();
 }
 /**
  * Returns a string representation of the specified array.  The string
@@ -392,16 +390,16 @@
  * @return a string representation of the specified array.
  */
 public static String toString(Object[] array) {
-	StringBuffer buf = new StringBuffer();
-	buf.append("[");
-	int maxIndex = array.length - 1;
-	for (int i = 0; i <= maxIndex; i++) {
-	    buf.append(array[i]);
-	    if (i < maxIndex)
-		buf.append(", ");
-	}
-	buf.append("]");
-	return buf.toString();
+  StringBuffer buf = new StringBuffer();
+  buf.append("[");
+  int maxIndex = array.length - 1;
+  for (int i = 0; i <= maxIndex; i++) {
+      buf.append(array[i]);
+      if (i < maxIndex)
+    buf.append(", ");
+  }
+  buf.append("]");
+  return buf.toString();
 }
 /**
  * Returns a string representation of the specified array.  The string
@@ -411,16 +409,16 @@
  * @return a string representation of the specified array.
  */
 public static String toString(short[] array) {
-	StringBuffer buf = new StringBuffer();
-	buf.append("[");
-	int maxIndex = array.length - 1;
-	for (int i = 0; i <= maxIndex; i++) {
-	    buf.append(array[i]);
-	    if (i < maxIndex)
-		buf.append(", ");
-	}
-	buf.append("]");
-	return buf.toString();
+  StringBuffer buf = new StringBuffer();
+  buf.append("[");
+  int maxIndex = array.length - 1;
+  for (int i = 0; i <= maxIndex; i++) {
+      buf.append(array[i]);
+      if (i < maxIndex)
+    buf.append(", ");
+  }
+  buf.append("]");
+  return buf.toString();
 }
 /**
  * Returns a string representation of the specified array.  The string
@@ -430,16 +428,16 @@
  * @return a string representation of the specified array.
  */
 public static String toString(boolean[] array) {
-	StringBuffer buf = new StringBuffer();
-	buf.append("[");
-	int maxIndex = array.length - 1;
-	for (int i = 0; i <= maxIndex; i++) {
-	    buf.append(array[i]);
-	    if (i < maxIndex)
-		buf.append(", ");
-	}
-	buf.append("]");
-	return buf.toString();
+  StringBuffer buf = new StringBuffer();
+  buf.append("[");
+  int maxIndex = array.length - 1;
+  for (int i = 0; i <= maxIndex; i++) {
+      buf.append(array[i]);
+      if (i < maxIndex)
+    buf.append(", ");
+  }
+  buf.append("]");
+  return buf.toString();
 }
 /**
  * Ensures that the specified array cannot hold more than <tt>maxCapacity</tt> elements.
@@ -452,12 +450,12 @@
  * @param   maxCapacity   the desired maximum capacity.
  */
 public static byte[] trimToCapacity(byte[] array, int maxCapacity) {
-	if (array.length > maxCapacity) {
-	    byte oldArray[] = array;
-	    array = new byte[maxCapacity];
-	    System.arraycopy(oldArray, 0, array, 0, maxCapacity);
-	}
-	return array;
+  if (array.length > maxCapacity) {
+      byte oldArray[] = array;
+      array = new byte[maxCapacity];
+      System.arraycopy(oldArray, 0, array, 0, maxCapacity);
+  }
+  return array;
 }
 /**
  * Ensures that the specified array cannot hold more than <tt>maxCapacity</tt> elements.
@@ -470,12 +468,12 @@
  * @param   maxCapacity   the desired maximum capacity.
  */
 public static char[] trimToCapacity(char[] array, int maxCapacity) {
-	if (array.length > maxCapacity) {
-	    char oldArray[] = array;
-	    array = new char[maxCapacity];
-	    System.arraycopy(oldArray, 0, array, 0, maxCapacity);
-	}
-	return array;
+  if (array.length > maxCapacity) {
+      char oldArray[] = array;
+      array = new char[maxCapacity];
+      System.arraycopy(oldArray, 0, array, 0, maxCapacity);
+  }
+  return array;
 }
 /**
  * Ensures that the specified array cannot hold more than <tt>maxCapacity</tt> elements.
@@ -488,12 +486,12 @@
  * @param   maxCapacity   the desired maximum capacity.
  */
 public static double[] trimToCapacity(double[] array, int maxCapacity) {
-	if (array.length > maxCapacity) {
-	    double oldArray[] = array;
-	    array = new double[maxCapacity];
-	    System.arraycopy(oldArray, 0, array, 0, maxCapacity);
-	}
-	return array;
+  if (array.length > maxCapacity) {
+      double oldArray[] = array;
+      array = new double[maxCapacity];
+      System.arraycopy(oldArray, 0, array, 0, maxCapacity);
+  }
+  return array;
 }
 /**
  * Ensures that the specified array cannot hold more than <tt>maxCapacity</tt> elements.
@@ -506,12 +504,12 @@
  * @param   maxCapacity   the desired maximum capacity.
  */
 public static float[] trimToCapacity(float[] array, int maxCapacity) {
-	if (array.length > maxCapacity) {
-	    float oldArray[] = array;
-	    array = new float[maxCapacity];
-	    System.arraycopy(oldArray, 0, array, 0, maxCapacity);
-	}
-	return array;
+  if (array.length > maxCapacity) {
+      float oldArray[] = array;
+      array = new float[maxCapacity];
+      System.arraycopy(oldArray, 0, array, 0, maxCapacity);
+  }
+  return array;
 }
 /**
  * Ensures that the specified array cannot hold more than <tt>maxCapacity</tt> elements.
@@ -524,12 +522,12 @@
  * @param   maxCapacity   the desired maximum capacity.
  */
 public static int[] trimToCapacity(int[] array, int maxCapacity) {
-	if (array.length > maxCapacity) {
-	    int oldArray[] = array;
-	    array = new int[maxCapacity];
-	    System.arraycopy(oldArray, 0, array, 0, maxCapacity);
-	}
-	return array;
+  if (array.length > maxCapacity) {
+      int oldArray[] = array;
+      array = new int[maxCapacity];
+      System.arraycopy(oldArray, 0, array, 0, maxCapacity);
+  }
+  return array;
 }
 /**
  * Ensures that the specified array cannot hold more than <tt>maxCapacity</tt> elements.
@@ -542,12 +540,12 @@
  * @param   maxCapacity   the desired maximum capacity.
  */
 public static long[] trimToCapacity(long[] array, int maxCapacity) {
-	if (array.length > maxCapacity) {
-	    long oldArray[] = array;
-	    array = new long[maxCapacity];
-	    System.arraycopy(oldArray, 0, array, 0, maxCapacity);
-	}
-	return array;
+  if (array.length > maxCapacity) {
+      long oldArray[] = array;
+      array = new long[maxCapacity];
+      System.arraycopy(oldArray, 0, array, 0, maxCapacity);
+  }
+  return array;
 }
 /**
  * Ensures that the specified array cannot hold more than <tt>maxCapacity</tt> elements.
@@ -560,12 +558,12 @@
  * @param   maxCapacity   the desired maximum capacity.
  */
 public static Object[] trimToCapacity(Object[] array, int maxCapacity) {
-	if (array.length > maxCapacity) {
-	    Object oldArray[] = array;
-	    array = new Object[maxCapacity];
-	    System.arraycopy(oldArray, 0, array, 0, maxCapacity);
-	}
-	return array;
+  if (array.length > maxCapacity) {
+      Object oldArray[] = array;
+      array = new Object[maxCapacity];
+      System.arraycopy(oldArray, 0, array, 0, maxCapacity);
+  }
+  return array;
 }
 /**
  * Ensures that the specified array cannot hold more than <tt>maxCapacity</tt> elements.
@@ -578,12 +576,12 @@
  * @param   maxCapacity   the desired maximum capacity.
  */
 public static short[] trimToCapacity(short[] array, int maxCapacity) {
-	if (array.length > maxCapacity) {
-	    short oldArray[] = array;
-	    array = new short[maxCapacity];
-	    System.arraycopy(oldArray, 0, array, 0, maxCapacity);
-	}
-	return array;
+  if (array.length > maxCapacity) {
+      short oldArray[] = array;
+      array = new short[maxCapacity];
+      System.arraycopy(oldArray, 0, array, 0, maxCapacity);
+  }
+  return array;
 }
 /**
  * Ensures that the specified array cannot hold more than <tt>maxCapacity</tt> elements.
@@ -596,11 +594,11 @@
  * @param   maxCapacity   the desired maximum capacity.
  */
 public static boolean[] trimToCapacity(boolean[] array, int maxCapacity) {
-	if (array.length > maxCapacity) {
-	    boolean oldArray[] = array;
-	    array = new boolean[maxCapacity];
-	    System.arraycopy(oldArray, 0, array, 0, maxCapacity);
-	}
-	return array;
+  if (array.length > maxCapacity) {
+      boolean oldArray[] = array;
+      array = new boolean[maxCapacity];
+      System.arraycopy(oldArray, 0, array, 0, maxCapacity);
+  }
+  return array;
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/function/CharComparator.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/function/CharComparator.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/function/CharComparator.java	(working copy)
@@ -19,8 +19,6 @@
  * order for the data structure to serialize successfully, the comparator (if
  * provided) must implement <tt>Serializable</tt>.<p>
  *
- * @author  wolfgang.hoschek@cern.ch
- * @version 0.1 01/09/99
  * @see java.util.Comparator
  * @see org.apache.mahout.matrix.Sorting
  */
@@ -49,8 +47,8 @@
  *
  * 
  * @return a negative integer, zero, or a positive integer as the
- * 	       first argument is less than, equal to, or greater than the
- *	       second. 
+ *          first argument is less than, equal to, or greater than the
+ *         second. 
  */
 int compare(char o1, char o2);
 /**
@@ -71,8 +69,8 @@
  *
  * @param   obj   the reference object with which to compare.
  * @return  <code>true</code> only if the specified object is also
- *		a comparator and it imposes the same ordering as this
- *		comparator.
+ *    a comparator and it imposes the same ordering as this
+ *    comparator.
  * @see     java.lang.Object#equals(java.lang.Object)
  * @see java.lang.Object#hashCode()
  */
Index: matrix/src/main/java/org/apache/mahout/matrix/function/Double9Function.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/function/Double9Function.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/function/Double9Function.java	(working copy)
@@ -23,8 +23,8 @@
  * @return the result of the function.
  */
 abstract public double apply(
-	double a00, double a01, double a02,
-	double a10, double a11, double a12,
-	double a20, double a21, double a22
-	);
+  double a00, double a01, double a02,
+  double a10, double a11, double a12,
+  double a20, double a21, double a22
+  );
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/function/IntComparator.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/function/IntComparator.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/function/IntComparator.java	(working copy)
@@ -19,8 +19,6 @@
  * order for the data structure to serialize successfully, the comparator (if
  * provided) must implement <tt>Serializable</tt>.<p>
  *
- * @author  wolfgang.hoschek@cern.ch
- * @version 0.1 01/09/99
  * @see java.util.Comparator
  * @see org.apache.mahout.matrix.Sorting
  */
@@ -49,8 +47,8 @@
  *
  * 
  * @return a negative integer, zero, or a positive integer as the
- * 	       first argument is less than, equal to, or greater than the
- *	       second. 
+ *          first argument is less than, equal to, or greater than the
+ *         second. 
  */
 int compare(int o1, int o2);
 /**
@@ -71,8 +69,8 @@
  *
  * @param   obj   the reference object with which to compare.
  * @return  <code>true</code> only if the specified object is also
- *		a comparator and it imposes the same ordering as this
- *		comparator.
+ *    a comparator and it imposes the same ordering as this
+ *    comparator.
  * @see     java.lang.Object#equals(java.lang.Object)
  * @see java.lang.Object#hashCode()
  */
Index: matrix/src/main/java/org/apache/mahout/matrix/function/LongComparator.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/function/LongComparator.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/function/LongComparator.java	(working copy)
@@ -19,8 +19,6 @@
  * order for the data structure to serialize successfully, the comparator (if
  * provided) must implement <tt>Serializable</tt>.<p>
  *
- * @author  wolfgang.hoschek@cern.ch
- * @version 0.1 01/09/99
  * @see java.util.Comparator
  * @see org.apache.mahout.matrix.Sorting
  */
@@ -49,8 +47,8 @@
  *
  * 
  * @return a negative integer, zero, or a positive integer as the
- * 	       first argument is less than, equal to, or greater than the
- *	       second. 
+ *          first argument is less than, equal to, or greater than the
+ *         second. 
  */
 int compare(long o1, long o2);
 /**
@@ -71,8 +69,8 @@
  *
  * @param   obj   the reference object with which to compare.
  * @return  <code>true</code> only if the specified object is also
- *		a comparator and it imposes the same ordering as this
- *		comparator.
+ *    a comparator and it imposes the same ordering as this
+ *    comparator.
  * @see     java.lang.Object#equals(java.lang.Object)
  * @see java.lang.Object#hashCode()
  */
Index: matrix/src/main/java/org/apache/mahout/matrix/function/ShortComparator.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/function/ShortComparator.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/function/ShortComparator.java	(working copy)
@@ -19,8 +19,6 @@
  * order for the data structure to serialize successfully, the comparator (if
  * provided) must implement <tt>Serializable</tt>.<p>
  *
- * @author  wolfgang.hoschek@cern.ch
- * @version 0.1 01/09/99
  * @see java.util.Comparator
  * @see org.apache.mahout.matrix.Sorting
  */
@@ -49,8 +47,8 @@
  *
  * 
  * @return a negative integer, zero, or a positive integer as the
- * 	       first argument is less than, equal to, or greater than the
- *	       second. 
+ *          first argument is less than, equal to, or greater than the
+ *         second. 
  */
 int compare(short o1, short o2);
 /**
@@ -71,8 +69,8 @@
  *
  * @param   obj   the reference object with which to compare.
  * @return  <code>true</code> only if the specified object is also
- *		a comparator and it imposes the same ordering as this
- *		comparator.
+ *    a comparator and it imposes the same ordering as this
+ *    comparator.
  * @see     java.lang.Object#equals(java.lang.Object)
  * @see java.lang.Object#hashCode()
  */
Index: matrix/src/main/java/org/apache/mahout/matrix/function/Double27Function.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/function/Double27Function.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/function/Double27Function.java	(working copy)
@@ -23,16 +23,16 @@
  * @return the result of the function.
  */
 abstract public double apply(
-	double a000, double a001, double a002,
-	double a010, double a011, double a012,
-	double a020, double a021, double a022,
+  double a000, double a001, double a002,
+  double a010, double a011, double a012,
+  double a020, double a021, double a022,
 
-	double a100, double a101, double a102,
-	double a110, double a111, double a112,
-	double a120, double a121, double a122,
+  double a100, double a101, double a102,
+  double a110, double a111, double a112,
+  double a120, double a121, double a122,
 
-	double a200, double a201, double a202,
-	double a210, double a211, double a212,
-	double a220, double a221, double a222
+  double a200, double a201, double a202,
+  double a210, double a211, double a212,
+  double a220, double a221, double a222
 );
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/function/ByteComparator.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/function/ByteComparator.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/function/ByteComparator.java	(working copy)
@@ -19,8 +19,6 @@
  * order for the data structure to serialize successfully, the comparator (if
  * provided) must implement <tt>Serializable</tt>.<p>
  *
- * @author  wolfgang.hoschek@cern.ch
- * @version 0.1 01/09/99
  * @see java.util.Comparator
  * @see org.apache.mahout.matrix.Sorting
  */
@@ -49,8 +47,8 @@
  *
  * 
  * @return a negative integer, zero, or a positive integer as the
- * 	       first argument is less than, equal to, or greater than the
- *	       second. 
+ *          first argument is less than, equal to, or greater than the
+ *         second. 
  */
 int compare(byte o1, byte o2);
 /**
@@ -71,8 +69,8 @@
  *
  * @param   obj   the reference object with which to compare.
  * @return  <code>true</code> only if the specified object is also
- *		a comparator and it imposes the same ordering as this
- *		comparator.
+ *    a comparator and it imposes the same ordering as this
+ *    comparator.
  * @see     java.lang.Object#equals(java.lang.Object)
  * @see java.lang.Object#hashCode()
  */
Index: matrix/src/main/java/org/apache/mahout/matrix/function/FloatComparator.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/function/FloatComparator.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/function/FloatComparator.java	(working copy)
@@ -19,8 +19,6 @@
  * order for the data structure to serialize successfully, the comparator (if
  * provided) must implement <tt>Serializable</tt>.<p>
  *
- * @author  wolfgang.hoschek@cern.ch
- * @version 0.1 01/09/99
  * @see java.util.Comparator
  * @see org.apache.mahout.matrix.Sorting
  */
@@ -49,8 +47,8 @@
  *
  * 
  * @return a negative integer, zero, or a positive integer as the
- * 	       first argument is less than, equal to, or greater than the
- *	       second. 
+ *          first argument is less than, equal to, or greater than the
+ *         second. 
  */
 int compare(float o1, float o2);
 /**
@@ -71,8 +69,8 @@
  *
  * @param   obj   the reference object with which to compare.
  * @return  <code>true</code> only if the specified object is also
- *		a comparator and it imposes the same ordering as this
- *		comparator.
+ *    a comparator and it imposes the same ordering as this
+ *    comparator.
  * @see     java.lang.Object#equals(java.lang.Object)
  * @see java.lang.Object#hashCode()
  */
Index: matrix/src/main/java/org/apache/mahout/matrix/function/DoubleComparator.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/function/DoubleComparator.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/function/DoubleComparator.java	(working copy)
@@ -19,8 +19,6 @@
  * order for the data structure to serialize successfully, the comparator (if
  * provided) must implement <tt>Serializable</tt>.<p>
  *
- * @author  wolfgang.hoschek@cern.ch
- * @version 0.1 01/09/99
  * @see java.util.Comparator
  * @see org.apache.mahout.matrix.Sorting
  */
@@ -49,8 +47,8 @@
  *
  * 
  * @return a negative integer, zero, or a positive integer as the
- * 	       first argument is less than, equal to, or greater than the
- *	       second. 
+ *          first argument is less than, equal to, or greater than the
+ *         second. 
  */
 int compare(double o1, double o2);
 /**
@@ -71,8 +69,8 @@
  *
  * @param   obj   the reference object with which to compare.
  * @return  <code>true</code> only if the specified object is also
- *		a comparator and it imposes the same ordering as this
- *		comparator.
+ *    a comparator and it imposes the same ordering as this
+ *    comparator.
  * @see     java.lang.Object#equals(java.lang.Object)
  * @see java.lang.Object#hashCode()
  */
Index: matrix/src/main/java/org/apache/mahout/matrix/Partitioning.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/Partitioning.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/Partitioning.java	(working copy)
@@ -35,20 +35,18 @@
  *
  * @see org.apache.mahout.matrix.matrix.doublealgo.Partitioning
  *
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 03-Jul-99
  */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
  */
 @Deprecated
 public class Partitioning extends Object {
-	private static final int SMALL = 7;
-	private static final int MEDIUM = 40;
+  private static final int SMALL = 7;
+  private static final int MEDIUM = 40;
 
-	// benchmark only
-	protected static int steps = 0;
-	public static int swappedElements = 0;
+  // benchmark only
+  protected static int steps = 0;
+  public static int swappedElements = 0;
 /**
  * Makes this class non instantiable, but still let's others inherit from it.
  */
@@ -59,119 +57,119 @@
 @param from the leftmost search position, inclusive.
 @param to the rightmost search position, inclusive.
 @param comp the comparator determining the order of the generic data.
-	Takes as first argument the index <tt>a</tt> within the generic splitters <tt>s</tt>.
-	Takes as second argument the index <tt>b</tt> within the generic data <tt>g</tt>.
+  Takes as first argument the index <tt>a</tt> within the generic splitters <tt>s</tt>.
+  Takes as second argument the index <tt>b</tt> within the generic data <tt>g</tt>.
 @return index of the search key, if it is contained in the list;
-	       otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
-	       point</i> is defined as the the point at which the value would
- 	       be inserted into the list: the index of the first
-	       element greater than the key, or <tt>list.length</tt>, if all
-	       elements in the list are less than the specified key.  Note
-	       that this guarantees that the return value will be &gt;= 0 if
-	       and only if the key is found.
+         otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
+         point</i> is defined as the the point at which the value would
+          be inserted into the list: the index of the first
+         element greater than the key, or <tt>list.length</tt>, if all
+         elements in the list are less than the specified key.  Note
+         that this guarantees that the return value will be &gt;= 0 if
+         and only if the key is found.
 */
 private static int binarySearchFromTo(int a, int from, int to, IntComparator comp) {
-	while (from <= to) {
-		int mid = (from + to) / 2;
-		int comparison = comp.compare(mid,a);
-		if (comparison < 0) from = mid + 1;
-		else if (comparison > 0) to = mid - 1;
-		else return mid; // key found
-	}
-	return -(from + 1);  // key not found.
+  while (from <= to) {
+    int mid = (from + to) / 2;
+    int comparison = comp.compare(mid,a);
+    if (comparison < 0) from = mid + 1;
+    else if (comparison > 0) to = mid - 1;
+    else return mid; // key found
+  }
+  return -(from + 1);  // key not found.
 }
 /**
  * Same as {@link #dualPartition(int[],int[],int,int,int[],int,int,int[])}
  * except that it <i>synchronously</i> partitions <tt>double[]</tt> rather than <tt>int[]</tt> arrays.
  */
 public static void dualPartition(double[] list, double[] secondary, int from, int to, double[] splitters, int splitFrom, int splitTo, int[] splitIndexes) {
-	double splitter; // int, double --> template type dependent
-	
-	if (splitFrom>splitTo) return; // nothing to do
-	if (from>to) { // all bins are empty
-		from--;
-		for (int i = splitFrom; i<=splitTo; ) splitIndexes[i++] = from;
-		return;
-	}
-	
-	// Choose a partition (pivot) index, m
-	// Ideally, the pivot should be the median, because a median splits a list into two equal sized sublists.
-	// However, computing the median is expensive, so we use an approximation.
-	int medianIndex;
-	if (splitFrom==splitTo) { // we don't really have a choice
-		medianIndex = splitFrom;
-	}
-	else { // we do have a choice
-		int m = (from+to) / 2;       // Small arrays, middle element
-		int len = to-from+1;
-		if (len > SMALL) {
-		    int l = from;
-		    int n = to;
-		    if (len > MEDIUM) {        // Big arrays, pseudomedian of 9
-				int s = len/8;
-				l = med3(list, l,     l+s, l+2*s);
-				m = med3(list, m-s,   m,   m+s);
-				n = med3(list, n-2*s, n-s, n);
-		    }
-		    m = med3(list, l, m, n); // Mid-size, pseudomedian of 3
-		}
-		
-		// Find the splitter closest to the pivot, i.e. the splitter that best splits the list into two equal sized sublists.
-		medianIndex = Sorting.binarySearchFromTo(splitters,list[m],splitFrom,splitTo);
-		if (medianIndex < 0) medianIndex = -medianIndex - 1; // not found
-		if (medianIndex > splitTo) medianIndex = splitTo; // not found, one past the end
-		
-	}
-	splitter = splitters[medianIndex];
+  double splitter; // int, double --> template type dependent
+  
+  if (splitFrom>splitTo) return; // nothing to do
+  if (from>to) { // all bins are empty
+    from--;
+    for (int i = splitFrom; i<=splitTo; ) splitIndexes[i++] = from;
+    return;
+  }
+  
+  // Choose a partition (pivot) index, m
+  // Ideally, the pivot should be the median, because a median splits a list into two equal sized sublists.
+  // However, computing the median is expensive, so we use an approximation.
+  int medianIndex;
+  if (splitFrom==splitTo) { // we don't really have a choice
+    medianIndex = splitFrom;
+  }
+  else { // we do have a choice
+    int m = (from+to) / 2;       // Small arrays, middle element
+    int len = to-from+1;
+    if (len > SMALL) {
+        int l = from;
+        int n = to;
+        if (len > MEDIUM) {        // Big arrays, pseudomedian of 9
+        int s = len/8;
+        l = med3(list, l,     l+s, l+2*s);
+        m = med3(list, m-s,   m,   m+s);
+        n = med3(list, n-2*s, n-s, n);
+        }
+        m = med3(list, l, m, n); // Mid-size, pseudomedian of 3
+    }
+    
+    // Find the splitter closest to the pivot, i.e. the splitter that best splits the list into two equal sized sublists.
+    medianIndex = Sorting.binarySearchFromTo(splitters,list[m],splitFrom,splitTo);
+    if (medianIndex < 0) medianIndex = -medianIndex - 1; // not found
+    if (medianIndex > splitTo) medianIndex = splitTo; // not found, one past the end
+    
+  }
+  splitter = splitters[medianIndex];
 
-	// Partition the list according to the splitter, i.e.
-	// Establish invariant: list[i] < splitter <= list[j] for i=from..medianIndex and j=medianIndex+1 .. to
-	int	splitIndex = dualPartition(list,secondary,from,to,splitter);
-	splitIndexes[medianIndex] = splitIndex;
+  // Partition the list according to the splitter, i.e.
+  // Establish invariant: list[i] < splitter <= list[j] for i=from..medianIndex and j=medianIndex+1 .. to
+  int  splitIndex = dualPartition(list,secondary,from,to,splitter);
+  splitIndexes[medianIndex] = splitIndex;
 
-	// Optimization: Handle special cases to cut down recursions.
-	if (splitIndex < from) { // no element falls into this bin
-		// all bins with splitters[i] <= splitter are empty
-		int i = medianIndex-1;
-		while (i>=splitFrom && (!(splitter < splitters[i]))) splitIndexes[i--] = splitIndex;
-		splitFrom = medianIndex+1;
-	}
-	else if (splitIndex >= to) { // all elements fall into this bin
-		// all bins with splitters[i] >= splitter are empty
-		int i = medianIndex+1;
-		while (i<=splitTo && (!(splitter > splitters[i]))) splitIndexes[i++] = splitIndex;
-		splitTo = medianIndex-1;
-	}
+  // Optimization: Handle special cases to cut down recursions.
+  if (splitIndex < from) { // no element falls into this bin
+    // all bins with splitters[i] <= splitter are empty
+    int i = medianIndex-1;
+    while (i>=splitFrom && (!(splitter < splitters[i]))) splitIndexes[i--] = splitIndex;
+    splitFrom = medianIndex+1;
+  }
+  else if (splitIndex >= to) { // all elements fall into this bin
+    // all bins with splitters[i] >= splitter are empty
+    int i = medianIndex+1;
+    while (i<=splitTo && (!(splitter > splitters[i]))) splitIndexes[i++] = splitIndex;
+    splitTo = medianIndex-1;
+  }
 
-	// recursively partition left half
-	if (splitFrom <= medianIndex-1) {
-		dualPartition(list, secondary, from,         splitIndex, splitters, splitFrom, medianIndex-1,  splitIndexes);
-	}
-	
-	// recursively partition right half
-	if (medianIndex+1 <= splitTo) {
-		dualPartition(list, secondary, splitIndex+1, to,         splitters, medianIndex+1,  splitTo,   splitIndexes);
-	}
+  // recursively partition left half
+  if (splitFrom <= medianIndex-1) {
+    dualPartition(list, secondary, from,         splitIndex, splitters, splitFrom, medianIndex-1,  splitIndexes);
+  }
+  
+  // recursively partition right half
+  if (medianIndex+1 <= splitTo) {
+    dualPartition(list, secondary, splitIndex+1, to,         splitters, medianIndex+1,  splitTo,   splitIndexes);
+  }
 }
 /**
  * Same as {@link #dualPartition(int[],int[],int,int,int)} 
  * except that it <i>synchronously</i> partitions <tt>double[]</tt> rather than <tt>int[]</tt> arrays.
  */
 public static int dualPartition(double[] list, double[] secondary, int from, int to, double splitter) {
-	double element;  // int, double --> template type dependent
-	for (int i=from-1; ++i<=to; ) {
-		element = list[i];
-		if (element < splitter) {
-			// swap x[i] with x[from]
-			list[i] = list[from];
-			list[from] = element;
+  double element;  // int, double --> template type dependent
+  for (int i=from-1; ++i<=to; ) {
+    element = list[i];
+    if (element < splitter) {
+      // swap x[i] with x[from]
+      list[i] = list[from];
+      list[from] = element;
 
-			element = secondary[i];
-			secondary[i] = secondary[from];
-			secondary[from++] = element;
-		}
-	}
-	return from-1;
+      element = secondary[i];
+      secondary[i] = secondary[from];
+      secondary[from++] = element;
+    }
+  }
+  return from-1;
 }
 /**
  * Same as {@link #partition(int[],int,int,int[],int,int,int[])} except that this method <i>synchronously</i> partitions two arrays at the same time;
@@ -192,73 +190,73 @@
  * Same as for single-partition methods.
  */
 public static void dualPartition(int[] list, int[] secondary, int from, int to, int[] splitters, int splitFrom, int splitTo, int[] splitIndexes) {
-	int splitter; // int, double --> template type dependent
-	
-	if (splitFrom>splitTo) return; // nothing to do
-	if (from>to) { // all bins are empty
-		from--;
-		for (int i = splitFrom; i<=splitTo; ) splitIndexes[i++] = from;
-		return;
-	}
-	
-	// Choose a partition (pivot) index, m
-	// Ideally, the pivot should be the median, because a median splits a list into two equal sized sublists.
-	// However, computing the median is expensive, so we use an approximation.
-	int medianIndex;
-	if (splitFrom==splitTo) { // we don't really have a choice
-		medianIndex = splitFrom;
-	}
-	else { // we do have a choice
-		int m = (from+to) / 2;       // Small arrays, middle element
-		int len = to-from+1;
-		if (len > SMALL) {
-		    int l = from;
-		    int n = to;
-		    if (len > MEDIUM) {        // Big arrays, pseudomedian of 9
-				int s = len/8;
-				l = med3(list, l,     l+s, l+2*s);
-				m = med3(list, m-s,   m,   m+s);
-				n = med3(list, n-2*s, n-s, n);
-		    }
-		    m = med3(list, l, m, n); // Mid-size, pseudomedian of 3
-		}
-		
-		// Find the splitter closest to the pivot, i.e. the splitter that best splits the list into two equal sized sublists.
-		medianIndex = Sorting.binarySearchFromTo(splitters,list[m],splitFrom,splitTo);
-		if (medianIndex < 0) medianIndex = -medianIndex - 1; // not found
-		if (medianIndex > splitTo) medianIndex = splitTo; // not found, one past the end
-		
-	}
-	splitter = splitters[medianIndex];
+  int splitter; // int, double --> template type dependent
+  
+  if (splitFrom>splitTo) return; // nothing to do
+  if (from>to) { // all bins are empty
+    from--;
+    for (int i = splitFrom; i<=splitTo; ) splitIndexes[i++] = from;
+    return;
+  }
+  
+  // Choose a partition (pivot) index, m
+  // Ideally, the pivot should be the median, because a median splits a list into two equal sized sublists.
+  // However, computing the median is expensive, so we use an approximation.
+  int medianIndex;
+  if (splitFrom==splitTo) { // we don't really have a choice
+    medianIndex = splitFrom;
+  }
+  else { // we do have a choice
+    int m = (from+to) / 2;       // Small arrays, middle element
+    int len = to-from+1;
+    if (len > SMALL) {
+        int l = from;
+        int n = to;
+        if (len > MEDIUM) {        // Big arrays, pseudomedian of 9
+        int s = len/8;
+        l = med3(list, l,     l+s, l+2*s);
+        m = med3(list, m-s,   m,   m+s);
+        n = med3(list, n-2*s, n-s, n);
+        }
+        m = med3(list, l, m, n); // Mid-size, pseudomedian of 3
+    }
+    
+    // Find the splitter closest to the pivot, i.e. the splitter that best splits the list into two equal sized sublists.
+    medianIndex = Sorting.binarySearchFromTo(splitters,list[m],splitFrom,splitTo);
+    if (medianIndex < 0) medianIndex = -medianIndex - 1; // not found
+    if (medianIndex > splitTo) medianIndex = splitTo; // not found, one past the end
+    
+  }
+  splitter = splitters[medianIndex];
 
-	// Partition the list according to the splitter, i.e.
-	// Establish invariant: list[i] < splitter <= list[j] for i=from..medianIndex and j=medianIndex+1 .. to
-	int	splitIndex = dualPartition(list,secondary,from,to,splitter);
-	splitIndexes[medianIndex] = splitIndex;
+  // Partition the list according to the splitter, i.e.
+  // Establish invariant: list[i] < splitter <= list[j] for i=from..medianIndex and j=medianIndex+1 .. to
+  int  splitIndex = dualPartition(list,secondary,from,to,splitter);
+  splitIndexes[medianIndex] = splitIndex;
 
-	// Optimization: Handle special cases to cut down recursions.
-	if (splitIndex < from) { // no element falls into this bin
-		// all bins with splitters[i] <= splitter are empty
-		int i = medianIndex-1;
-		while (i>=splitFrom && (!(splitter < splitters[i]))) splitIndexes[i--] = splitIndex;
-		splitFrom = medianIndex+1;
-	}
-	else if (splitIndex >= to) { // all elements fall into this bin
-		// all bins with splitters[i] >= splitter are empty
-		int i = medianIndex+1;
-		while (i<=splitTo && (!(splitter > splitters[i]))) splitIndexes[i++] = splitIndex;
-		splitTo = medianIndex-1;
-	}
+  // Optimization: Handle special cases to cut down recursions.
+  if (splitIndex < from) { // no element falls into this bin
+    // all bins with splitters[i] <= splitter are empty
+    int i = medianIndex-1;
+    while (i>=splitFrom && (!(splitter < splitters[i]))) splitIndexes[i--] = splitIndex;
+    splitFrom = medianIndex+1;
+  }
+  else if (splitIndex >= to) { // all elements fall into this bin
+    // all bins with splitters[i] >= splitter are empty
+    int i = medianIndex+1;
+    while (i<=splitTo && (!(splitter > splitters[i]))) splitIndexes[i++] = splitIndex;
+    splitTo = medianIndex-1;
+  }
 
-	// recursively partition left half
-	if (splitFrom <= medianIndex-1) {
-		dualPartition(list, secondary, from,         splitIndex, splitters, splitFrom, medianIndex-1,  splitIndexes);
-	}
-	
-	// recursively partition right half
-	if (medianIndex+1 <= splitTo) {
-		dualPartition(list, secondary, splitIndex+1, to,         splitters, medianIndex+1,  splitTo,   splitIndexes);
-	}
+  // recursively partition left half
+  if (splitFrom <= medianIndex-1) {
+    dualPartition(list, secondary, from,         splitIndex, splitters, splitFrom, medianIndex-1,  splitIndexes);
+  }
+  
+  // recursively partition right half
+  if (medianIndex+1 <= splitTo) {
+    dualPartition(list, secondary, splitIndex+1, to,         splitters, medianIndex+1,  splitTo,   splitIndexes);
+  }
 }
 /**
  * Same as {@link #partition(int[],int,int,int)} except that this method <i>synchronously</i> partitions two arrays at the same time;
@@ -270,20 +268,20 @@
  * Same as for single-partition methods.
  */
 public static int dualPartition(int[] list, int[] secondary, int from, int to, int splitter) {
-	int element;  // int, double --> template type dependent
-	for (int i=from-1; ++i<=to; ) {
-		element = list[i];
-		if (element < splitter) {
-			// swap x[i] with x[from]
-			list[i] = list[from];
-			list[from] = element;
+  int element;  // int, double --> template type dependent
+  for (int i=from-1; ++i<=to; ) {
+    element = list[i];
+    if (element < splitter) {
+      // swap x[i] with x[from]
+      list[i] = list[from];
+      list[from] = element;
 
-			element = secondary[i];
-			secondary[i] = secondary[from];
-			secondary[from++] = element;
-		}
-	}
-	return from-1;
+      element = secondary[i];
+      secondary[i] = secondary[from];
+      secondary[from++] = element;
+    }
+  }
+  return from-1;
 }
 /**
 Same as {@link #partition(int[],int,int,int[],int,int,int[])}
@@ -323,17 +321,17 @@
 Therefore, must satisfy <tt>splitIndexes.length > splitTo</tt>.
 
 @param comp the comparator comparing a splitter with an element of the generic data.
-	Takes as first argument the index <tt>a</tt> within the generic splitters <tt>s</tt>.
-	Takes as second argument the index <tt>b</tt> within the generic data <tt>g</tt>.
+  Takes as first argument the index <tt>a</tt> within the generic splitters <tt>s</tt>.
+  Takes as second argument the index <tt>b</tt> within the generic data <tt>g</tt>.
 @param comp2 the comparator to determine the order of the generic data.
-	Takes as first argument the index <tt>a</tt> within the generic data <tt>g</tt>.
-	Takes as second argument the index <tt>b</tt> within the generic data <tt>g</tt>.
+  Takes as first argument the index <tt>a</tt> within the generic data <tt>g</tt>.
+  Takes as second argument the index <tt>b</tt> within the generic data <tt>g</tt>.
 @param comp3 the comparator comparing a splitter with another splitter.
-	Takes as first argument the index <tt>a</tt> within the generic splitters <tt>s</tt>.
-	Takes as second argument the index <tt>b</tt> within the generic splitters <tt>g</tt>.
+  Takes as first argument the index <tt>a</tt> within the generic splitters <tt>s</tt>.
+  Takes as second argument the index <tt>b</tt> within the generic splitters <tt>g</tt>.
 @param swapper an object that knows how to swap the elements at any two indexes (a,b).
-	Takes as first argument the index <tt>b</tt> within the generic data <tt>g</tt>.
-	Takes as second argument the index <tt>c</tt> within the generic data <tt>g</tt>.
+  Takes as first argument the index <tt>b</tt> within the generic data <tt>g</tt>.
+  Takes as second argument the index <tt>c</tt> within the generic data <tt>g</tt>.
 
 <p>
 Tip: Normally you will have <tt>splitIndexes.length == s.length</tt> as well as <tt>from==0, to==g.length-1</tt> and <tt>splitFrom==0, splitTo==s.length-1</tt>.
@@ -343,216 +341,216 @@
 @see Sorting#binarySearchFromTo(int,int,IntComparator)
 */
 public static void genericPartition(int from, int to, int splitFrom, int splitTo, int[] splitIndexes, IntComparator comp, IntComparator comp2, IntComparator comp3, Swapper swapper) {
-	int splitter; // int, double --> template type dependent
-	
-	if (splitFrom>splitTo) return; // nothing to do
-	if (from>to) { // all bins are empty
-		from--;
-		for (int i = splitFrom; i<=splitTo; ) splitIndexes[i++] = from;
-		return;
-	}
-	
-	// Choose a partition (pivot) index, m
-	// Ideally, the pivot should be the median, because a median splits a list into two equal sized sublists.
-	// However, computing the median is expensive, so we use an approximation.
-	int medianIndex;
-	if (splitFrom==splitTo) { // we don't really have a choice
-		medianIndex = splitFrom;
-	}
-	else { // we do have a choice
-		int m = (from+to) / 2;       // Small arrays, middle element
-		int len = to-from+1;
-		if (len > SMALL) {
-		    int l = from;
-		    int n = to;
-		    if (len > MEDIUM) {        // Big arrays, pseudomedian of 9
-				int s = len/8;
-				l = med3(l,     l+s, l+2*s, comp2);
-				m = med3(m-s,   m,   m+s,   comp2);
-				n = med3(n-2*s, n-s, n,     comp2);
-		    }
-		    m = med3(l, m, n, comp2); // Mid-size, pseudomedian of 3
-		}
-		
-		// Find the splitter closest to the pivot, i.e. the splitter that best splits the list into two equal sized sublists.
-		medianIndex = binarySearchFromTo(m,splitFrom,splitTo,comp);
-		if (medianIndex < 0) medianIndex = -medianIndex - 1; // not found
-		if (medianIndex > splitTo) medianIndex = splitTo; // not found, one past the end
-		
-	}
-	splitter = medianIndex;
+  int splitter; // int, double --> template type dependent
+  
+  if (splitFrom>splitTo) return; // nothing to do
+  if (from>to) { // all bins are empty
+    from--;
+    for (int i = splitFrom; i<=splitTo; ) splitIndexes[i++] = from;
+    return;
+  }
+  
+  // Choose a partition (pivot) index, m
+  // Ideally, the pivot should be the median, because a median splits a list into two equal sized sublists.
+  // However, computing the median is expensive, so we use an approximation.
+  int medianIndex;
+  if (splitFrom==splitTo) { // we don't really have a choice
+    medianIndex = splitFrom;
+  }
+  else { // we do have a choice
+    int m = (from+to) / 2;       // Small arrays, middle element
+    int len = to-from+1;
+    if (len > SMALL) {
+        int l = from;
+        int n = to;
+        if (len > MEDIUM) {        // Big arrays, pseudomedian of 9
+        int s = len/8;
+        l = med3(l,     l+s, l+2*s, comp2);
+        m = med3(m-s,   m,   m+s,   comp2);
+        n = med3(n-2*s, n-s, n,     comp2);
+        }
+        m = med3(l, m, n, comp2); // Mid-size, pseudomedian of 3
+    }
+    
+    // Find the splitter closest to the pivot, i.e. the splitter that best splits the list into two equal sized sublists.
+    medianIndex = binarySearchFromTo(m,splitFrom,splitTo,comp);
+    if (medianIndex < 0) medianIndex = -medianIndex - 1; // not found
+    if (medianIndex > splitTo) medianIndex = splitTo; // not found, one past the end
+    
+  }
+  splitter = medianIndex;
 
-	// Partition the list according to the splitter, i.e.
-	// Establish invariant: list[i] < splitter <= list[j] for i=from..medianIndex and j=medianIndex+1 .. to
-	int	splitIndex = genericPartition(from,to,splitter,comp,swapper);
-	splitIndexes[medianIndex] = splitIndex;
+  // Partition the list according to the splitter, i.e.
+  // Establish invariant: list[i] < splitter <= list[j] for i=from..medianIndex and j=medianIndex+1 .. to
+  int  splitIndex = genericPartition(from,to,splitter,comp,swapper);
+  splitIndexes[medianIndex] = splitIndex;
 
-	
-	// Optimization: Handle special cases to cut down recursions.
-	if (splitIndex < from) { // no element falls into this bin
-		// all bins with splitters[i] <= splitter are empty
-		int i = medianIndex-1;
-		while (i>=splitFrom && (!(comp3.compare(splitter,i) < 0))) splitIndexes[i--] = splitIndex;
-		splitFrom = medianIndex+1;
-	}
-	else if (splitIndex >= to) { // all elements fall into this bin
-		// all bins with splitters[i] >= splitter are empty
-		int i = medianIndex+1;
-		while (i<=splitTo && (!(comp3.compare(splitter,i) > 0))) splitIndexes[i++] = splitIndex;
-		splitTo = medianIndex-1;
-	}
-	
+  
+  // Optimization: Handle special cases to cut down recursions.
+  if (splitIndex < from) { // no element falls into this bin
+    // all bins with splitters[i] <= splitter are empty
+    int i = medianIndex-1;
+    while (i>=splitFrom && (!(comp3.compare(splitter,i) < 0))) splitIndexes[i--] = splitIndex;
+    splitFrom = medianIndex+1;
+  }
+  else if (splitIndex >= to) { // all elements fall into this bin
+    // all bins with splitters[i] >= splitter are empty
+    int i = medianIndex+1;
+    while (i<=splitTo && (!(comp3.compare(splitter,i) > 0))) splitIndexes[i++] = splitIndex;
+    splitTo = medianIndex-1;
+  }
+  
 
-	// recursively partition left half
-	if (splitFrom <= medianIndex-1) {
-		genericPartition(from,         splitIndex, splitFrom, medianIndex-1,  splitIndexes, comp, comp2, comp3, swapper);
-	}
-	
-	// recursively partition right half
-	if (medianIndex+1 <= splitTo) {
-		genericPartition(splitIndex+1, to,         medianIndex+1,  splitTo,   splitIndexes, comp, comp2, comp3, swapper);
-	}
+  // recursively partition left half
+  if (splitFrom <= medianIndex-1) {
+    genericPartition(from,         splitIndex, splitFrom, medianIndex-1,  splitIndexes, comp, comp2, comp3, swapper);
+  }
+  
+  // recursively partition right half
+  if (medianIndex+1 <= splitTo) {
+    genericPartition(splitIndex+1, to,         medianIndex+1,  splitTo,   splitIndexes, comp, comp2, comp3, swapper);
+  }
 }
 /**
 Same as {@link #partition(int[],int,int,int)} 
 except that it <i>generically</i> partitions arbitrary shaped data (for example matrices or multiple arrays) rather than <tt>int[]</tt> arrays.
 */
 private static int genericPartition(int from, int to, int splitter, IntComparator comp, Swapper swapper) {
-	for (int i=from-1; ++i<=to; ) {
-		if (comp.compare(splitter,i) > 0) {
-			// swap x[i] with x[from]
-			swapper.swap(i,from);
-			from++;
-		}
-	}
-	return from-1;
+  for (int i=from-1; ++i<=to; ) {
+    if (comp.compare(splitter,i) > 0) {
+      // swap x[i] with x[from]
+      swapper.swap(i,from);
+      from++;
+    }
+  }
+  return from-1;
 }
 /**
  * Returns the index of the median of the three indexed elements.
  */
 private static int med3(double x[], int a, int b, int c) {
-	return (x[a] < x[b] ?
-		(x[b] < x[c] ? b : x[a] < x[c] ? c : a) :
-		(x[b] > x[c] ? b : x[a] > x[c] ? c : a));
+  return (x[a] < x[b] ?
+    (x[b] < x[c] ? b : x[a] < x[c] ? c : a) :
+    (x[b] > x[c] ? b : x[a] > x[c] ? c : a));
 }
 /**
  * Returns the index of the median of the three indexed elements.
  */
 private static int med3(int x[], int a, int b, int c) {
-	return (x[a] < x[b] ?
-		(x[b] < x[c] ? b : x[a] < x[c] ? c : a) :
-		(x[b] > x[c] ? b : x[a] > x[c] ? c : a));
+  return (x[a] < x[b] ?
+    (x[b] < x[c] ? b : x[a] < x[c] ? c : a) :
+    (x[b] > x[c] ? b : x[a] > x[c] ? c : a));
 }
 /**
  * Returns the index of the median of the three indexed chars.
  */
 private static int med3(Object x[], int a, int b, int c, java.util.Comparator comp) {
-	int ab = comp.compare(x[a],x[b]);
-	int ac = comp.compare(x[a],x[c]);
-	int bc = comp.compare(x[b],x[c]);
-	return (ab<0 ?
-		(bc<0 ? b : ac<0 ? c : a) :
-		(bc>0 ? b : ac>0 ? c : a));
+  int ab = comp.compare(x[a],x[b]);
+  int ac = comp.compare(x[a],x[c]);
+  int bc = comp.compare(x[b],x[c]);
+  return (ab<0 ?
+    (bc<0 ? b : ac<0 ? c : a) :
+    (bc>0 ? b : ac>0 ? c : a));
 }
 /**
  * Returns the index of the median of the three indexed chars.
  */
 private static int med3(int a, int b, int c, IntComparator comp) {
-	int ab = comp.compare(a,b);
-	int ac = comp.compare(a,c);
-	int bc = comp.compare(b,c);
-	return (ab<0 ?
-		(bc<0 ? b : ac<0 ? c : a) :
-		(bc>0 ? b : ac>0 ? c : a));
+  int ab = comp.compare(a,b);
+  int ac = comp.compare(a,c);
+  int bc = comp.compare(b,c);
+  return (ab<0 ?
+    (bc<0 ? b : ac<0 ? c : a) :
+    (bc>0 ? b : ac>0 ? c : a));
 }
 /**
  * Same as {@link #partition(int[],int,int,int[],int,int,int[])}
  * except that it partitions <tt>double[]</tt> rather than <tt>int[]</tt> arrays.
  */
 public static void partition(double[] list, int from, int to, double[] splitters, int splitFrom, int splitTo, int[] splitIndexes) {
-	double splitter; // int, double --> template type dependent
-	
-	if (splitFrom>splitTo) return; // nothing to do
-	if (from>to) { // all bins are empty
-		from--;
-		for (int i = splitFrom; i<=splitTo; ) splitIndexes[i++] = from;
-		return;
-	}
-	
-	// Choose a partition (pivot) index, m
-	// Ideally, the pivot should be the median, because a median splits a list into two equal sized sublists.
-	// However, computing the median is expensive, so we use an approximation.
-	int medianIndex;
-	if (splitFrom==splitTo) { // we don't really have a choice
-		medianIndex = splitFrom;
-	}
-	else { // we do have a choice
-		int m = (from+to) / 2;       // Small arrays, middle element
-		int len = to-from+1;
-		if (len > SMALL) {
-		    int l = from;
-		    int n = to;
-		    if (len > MEDIUM) {        // Big arrays, pseudomedian of 9
-				int s = len/8;
-				l = med3(list, l,     l+s, l+2*s);
-				m = med3(list, m-s,   m,   m+s);
-				n = med3(list, n-2*s, n-s, n);
-		    }
-		    m = med3(list, l, m, n); // Mid-size, pseudomedian of 3
-		}
-		
-		// Find the splitter closest to the pivot, i.e. the splitter that best splits the list into two equal sized sublists.
-		medianIndex = Sorting.binarySearchFromTo(splitters,list[m],splitFrom,splitTo);
-		if (medianIndex < 0) medianIndex = -medianIndex - 1; // not found
-		if (medianIndex > splitTo) medianIndex = splitTo; // not found, one past the end
-		
-	}
-	splitter = splitters[medianIndex];
+  double splitter; // int, double --> template type dependent
+  
+  if (splitFrom>splitTo) return; // nothing to do
+  if (from>to) { // all bins are empty
+    from--;
+    for (int i = splitFrom; i<=splitTo; ) splitIndexes[i++] = from;
+    return;
+  }
+  
+  // Choose a partition (pivot) index, m
+  // Ideally, the pivot should be the median, because a median splits a list into two equal sized sublists.
+  // However, computing the median is expensive, so we use an approximation.
+  int medianIndex;
+  if (splitFrom==splitTo) { // we don't really have a choice
+    medianIndex = splitFrom;
+  }
+  else { // we do have a choice
+    int m = (from+to) / 2;       // Small arrays, middle element
+    int len = to-from+1;
+    if (len > SMALL) {
+        int l = from;
+        int n = to;
+        if (len > MEDIUM) {        // Big arrays, pseudomedian of 9
+        int s = len/8;
+        l = med3(list, l,     l+s, l+2*s);
+        m = med3(list, m-s,   m,   m+s);
+        n = med3(list, n-2*s, n-s, n);
+        }
+        m = med3(list, l, m, n); // Mid-size, pseudomedian of 3
+    }
+    
+    // Find the splitter closest to the pivot, i.e. the splitter that best splits the list into two equal sized sublists.
+    medianIndex = Sorting.binarySearchFromTo(splitters,list[m],splitFrom,splitTo);
+    if (medianIndex < 0) medianIndex = -medianIndex - 1; // not found
+    if (medianIndex > splitTo) medianIndex = splitTo; // not found, one past the end
+    
+  }
+  splitter = splitters[medianIndex];
 
-	// Partition the list according to the splitter, i.e.
-	// Establish invariant: list[i] < splitter <= list[j] for i=from..medianIndex and j=medianIndex+1 .. to
-	int	splitIndex = partition(list,from,to,splitter);
-	splitIndexes[medianIndex] = splitIndex;
+  // Partition the list according to the splitter, i.e.
+  // Establish invariant: list[i] < splitter <= list[j] for i=from..medianIndex and j=medianIndex+1 .. to
+  int  splitIndex = partition(list,from,to,splitter);
+  splitIndexes[medianIndex] = splitIndex;
 
-	// Optimization: Handle special cases to cut down recursions.
-	if (splitIndex < from) { // no element falls into this bin
-		// all bins with splitters[i] <= splitter are empty
-		int i = medianIndex-1;
-		while (i>=splitFrom && (!(splitter < splitters[i]))) splitIndexes[i--] = splitIndex;
-		splitFrom = medianIndex+1;
-	}
-	else if (splitIndex >= to) { // all elements fall into this bin
-		// all bins with splitters[i] >= splitter are empty
-		int i = medianIndex+1;
-		while (i<=splitTo && (!(splitter > splitters[i]))) splitIndexes[i++] = splitIndex;
-		splitTo = medianIndex-1;
-	}
+  // Optimization: Handle special cases to cut down recursions.
+  if (splitIndex < from) { // no element falls into this bin
+    // all bins with splitters[i] <= splitter are empty
+    int i = medianIndex-1;
+    while (i>=splitFrom && (!(splitter < splitters[i]))) splitIndexes[i--] = splitIndex;
+    splitFrom = medianIndex+1;
+  }
+  else if (splitIndex >= to) { // all elements fall into this bin
+    // all bins with splitters[i] >= splitter are empty
+    int i = medianIndex+1;
+    while (i<=splitTo && (!(splitter > splitters[i]))) splitIndexes[i++] = splitIndex;
+    splitTo = medianIndex-1;
+  }
 
-	// recursively partition left half
-	if (splitFrom <= medianIndex-1) {
-		partition(list, from,         splitIndex, splitters, splitFrom, medianIndex-1,  splitIndexes);
-	}
-	
-	// recursively partition right half
-	if (medianIndex+1 <= splitTo) {
-		partition(list, splitIndex+1, to,         splitters, medianIndex+1,  splitTo,   splitIndexes);
-	}
+  // recursively partition left half
+  if (splitFrom <= medianIndex-1) {
+    partition(list, from,         splitIndex, splitters, splitFrom, medianIndex-1,  splitIndexes);
+  }
+  
+  // recursively partition right half
+  if (medianIndex+1 <= splitTo) {
+    partition(list, splitIndex+1, to,         splitters, medianIndex+1,  splitTo,   splitIndexes);
+  }
 }
 /**
  * Same as {@link #partition(int[],int,int,int)}
  * except that it partitions <tt>double[]</tt> rather than <tt>int[]</tt> arrays.
  */
 public static int partition(double[] list, int from, int to, double splitter) {
-	double element;  // int, double --> template type dependent
-	for (int i=from-1; ++i<=to; ) {
-		element = list[i];
-		if (element < splitter) {
-			// swap x[i] with x[from]
-			list[i] = list[from];
-			list[from++] = element;
-		}
-	}
-	return from-1;
+  double element;  // int, double --> template type dependent
+  for (int i=from-1; ++i<=to; ) {
+    element = list[i];
+    if (element < splitter) {
+      // swap x[i] with x[from]
+      list[i] = list[from];
+      list[from++] = element;
+    }
+  }
+  return from-1;
 }
 /**
  * Partitions (partially sorts) the given list such that all elements falling into some intervals are placed next to each other.
@@ -627,133 +625,133 @@
  * @see java.util.Arrays
  */
 public static void partition(int[] list, int from, int to, int[] splitters, int splitFrom, int splitTo, int[] splitIndexes) {
-	int element,splitter; // int, double --> template type dependent
-	
-	if (splitFrom>splitTo) return; // nothing to do
-	if (from>to) { // all bins are empty
-		from--;
-		for (int i = splitFrom; i<=splitTo; ) splitIndexes[i++] = from;
-		return;
-	}
-	
-	// Choose a partition (pivot) index, m
-	// Ideally, the pivot should be the median, because a median splits a list into two equal sized sublists.
-	// However, computing the median is expensive, so we use an approximation.
-	int medianIndex;
-	if (splitFrom==splitTo) { // we don't really have a choice
-		medianIndex = splitFrom;
-	}
-	else { // we do have a choice
-		int m = (from+to) / 2;       // Small arrays, middle element
-		int len = to-from+1;
-		if (len > SMALL) {
-		    int l = from;
-		    int n = to;
-		    if (len > MEDIUM) {        // Big arrays, pseudomedian of 9
-				int s = len/8;
-				l = med3(list, l,     l+s, l+2*s);
-				m = med3(list, m-s,   m,   m+s);
-				n = med3(list, n-2*s, n-s, n);
-		    }
-		    m = med3(list, l, m, n); // Mid-size, pseudomedian of 3
-		}
-		
-		// Find the splitter closest to the pivot, i.e. the splitter that best splits the list into two equal sized sublists.
-		medianIndex = Sorting.binarySearchFromTo(splitters,list[m],splitFrom,splitTo);
-				
-		//int key = list[m];
-		/*
-		if (splitTo-splitFrom+1 < 5) { // on short lists linear search is quicker
-			int i=splitFrom-1;
-			while (++i <= splitTo && list[i] < key);
-			if (i > splitTo || list[i] > key) i = -i-1; // not found
-			medianIndex = i;
-		}
-		*/
-		//else {
-		/*
-		
-			int low = splitFrom;
-			int high = splitTo;
-			int comparison;
-		
-			int mid=0;
-			while (low <= high) {
-				mid = (low + high) / 2;
-				comparison = splitters[mid]-key;
-				if (comparison < 0) low = mid + 1;
-				else if (comparison > 0) high = mid - 1;
-				else break; //return mid; // key found
-			}
-			medianIndex = mid;
-			if (low > high) medianIndex = -(medianIndex + 1);  // key not found.
-		//}
-		*/
-		
-		
-		if (medianIndex < 0) medianIndex = -medianIndex - 1; // not found
-		if (medianIndex > splitTo) medianIndex = splitTo; // not found, one past the end
-		
-	}
-	splitter = splitters[medianIndex];
+  int element,splitter; // int, double --> template type dependent
+  
+  if (splitFrom>splitTo) return; // nothing to do
+  if (from>to) { // all bins are empty
+    from--;
+    for (int i = splitFrom; i<=splitTo; ) splitIndexes[i++] = from;
+    return;
+  }
+  
+  // Choose a partition (pivot) index, m
+  // Ideally, the pivot should be the median, because a median splits a list into two equal sized sublists.
+  // However, computing the median is expensive, so we use an approximation.
+  int medianIndex;
+  if (splitFrom==splitTo) { // we don't really have a choice
+    medianIndex = splitFrom;
+  }
+  else { // we do have a choice
+    int m = (from+to) / 2;       // Small arrays, middle element
+    int len = to-from+1;
+    if (len > SMALL) {
+        int l = from;
+        int n = to;
+        if (len > MEDIUM) {        // Big arrays, pseudomedian of 9
+        int s = len/8;
+        l = med3(list, l,     l+s, l+2*s);
+        m = med3(list, m-s,   m,   m+s);
+        n = med3(list, n-2*s, n-s, n);
+        }
+        m = med3(list, l, m, n); // Mid-size, pseudomedian of 3
+    }
+    
+    // Find the splitter closest to the pivot, i.e. the splitter that best splits the list into two equal sized sublists.
+    medianIndex = Sorting.binarySearchFromTo(splitters,list[m],splitFrom,splitTo);
+        
+    //int key = list[m];
+    /*
+    if (splitTo-splitFrom+1 < 5) { // on short lists linear search is quicker
+      int i=splitFrom-1;
+      while (++i <= splitTo && list[i] < key);
+      if (i > splitTo || list[i] > key) i = -i-1; // not found
+      medianIndex = i;
+    }
+    */
+    //else {
+    /*
+    
+      int low = splitFrom;
+      int high = splitTo;
+      int comparison;
+    
+      int mid=0;
+      while (low <= high) {
+        mid = (low + high) / 2;
+        comparison = splitters[mid]-key;
+        if (comparison < 0) low = mid + 1;
+        else if (comparison > 0) high = mid - 1;
+        else break; //return mid; // key found
+      }
+      medianIndex = mid;
+      if (low > high) medianIndex = -(medianIndex + 1);  // key not found.
+    //}
+    */
+    
+    
+    if (medianIndex < 0) medianIndex = -medianIndex - 1; // not found
+    if (medianIndex > splitTo) medianIndex = splitTo; // not found, one past the end
+    
+  }
+  splitter = splitters[medianIndex];
 
-	//System.out.println("medianIndex="+medianIndex);
-	// Partition the list according to the splitter, i.e.
-	// Establish invariant: list[i] < splitter <= list[j] for i=from..medianIndex and j=medianIndex+1 .. to
-	// Could simply call:
-	int	splitIndex = partition(list,from,to,splitter);
-	// but for speed the code is manually inlined.
-	/*
-	steps += to-from+1;
-	int head = from;
-	for (int i=from-1; ++i<=to; ) { // swap all elements < splitter to front
-		element = list[i];
-		if (element < splitter) {		
-			list[i] = list[head];
-			list[head++] = element;
-			//swappedElements++;
-		}
-	}
-	int splitIndex = head-1;
-	*/
-	
-	
-	
-	
+  //System.out.println("medianIndex="+medianIndex);
+  // Partition the list according to the splitter, i.e.
+  // Establish invariant: list[i] < splitter <= list[j] for i=from..medianIndex and j=medianIndex+1 .. to
+  // Could simply call:
+  int  splitIndex = partition(list,from,to,splitter);
+  // but for speed the code is manually inlined.
+  /*
+  steps += to-from+1;
+  int head = from;
+  for (int i=from-1; ++i<=to; ) { // swap all elements < splitter to front
+    element = list[i];
+    if (element < splitter) {    
+      list[i] = list[head];
+      list[head++] = element;
+      //swappedElements++;
+    }
+  }
+  int splitIndex = head-1;
+  */
+  
+  
+  
+  
 
 
-	
-	//System.out.println("splitIndex="+splitIndex);
-	splitIndexes[medianIndex] = splitIndex;
+  
+  //System.out.println("splitIndex="+splitIndex);
+  splitIndexes[medianIndex] = splitIndex;
 
-	//if (splitFrom == splitTo) return; // done
+  //if (splitFrom == splitTo) return; // done
 
-	// Optimization: Handle special cases to cut down recursions.
-	if (splitIndex < from) { // no element falls into this bin
-		// all bins with splitters[i] <= splitter are empty
-		int i = medianIndex-1;
-		while (i>=splitFrom && (!(splitter < splitters[i]))) splitIndexes[i--] = splitIndex;
-		splitFrom = medianIndex+1;
-	}
-	else if (splitIndex >= to) { // all elements fall into this bin
-		// all bins with splitters[i] >= splitter are empty
-		int i = medianIndex+1;
-		while (i<=splitTo && (!(splitter > splitters[i]))) splitIndexes[i++] = splitIndex;
-		splitTo = medianIndex-1;
-	}
+  // Optimization: Handle special cases to cut down recursions.
+  if (splitIndex < from) { // no element falls into this bin
+    // all bins with splitters[i] <= splitter are empty
+    int i = medianIndex-1;
+    while (i>=splitFrom && (!(splitter < splitters[i]))) splitIndexes[i--] = splitIndex;
+    splitFrom = medianIndex+1;
+  }
+  else if (splitIndex >= to) { // all elements fall into this bin
+    // all bins with splitters[i] >= splitter are empty
+    int i = medianIndex+1;
+    while (i<=splitTo && (!(splitter > splitters[i]))) splitIndexes[i++] = splitIndex;
+    splitTo = medianIndex-1;
+  }
 
-	// recursively partition left half
-	if (splitFrom <= medianIndex-1) {
-		//System.out.println("1.recursive: from="+from+", to="+splitIndex+", splitFrom="+splitFrom+", splitTo="+(medianIndex-1));		
-		partition(list, from,         splitIndex, splitters, splitFrom, medianIndex-1,  splitIndexes);
-	}
-	
-	// recursively partition right half
-	if (medianIndex+1 <= splitTo) {
-		//System.out.println("2.recursive: from="+(splitIndex+1)+", to="+to+", splitFrom="+(medianIndex+1)+", splitTo="+splitTo);
-		partition(list, splitIndex+1, to,         splitters, medianIndex+1,  splitTo,   splitIndexes);
-	}
-	//System.out.println("BACK TRACKING\n\n");
+  // recursively partition left half
+  if (splitFrom <= medianIndex-1) {
+    //System.out.println("1.recursive: from="+from+", to="+splitIndex+", splitFrom="+splitFrom+", splitTo="+(medianIndex-1));    
+    partition(list, from,         splitIndex, splitters, splitFrom, medianIndex-1,  splitIndexes);
+  }
+  
+  // recursively partition right half
+  if (medianIndex+1 <= splitTo) {
+    //System.out.println("2.recursive: from="+(splitIndex+1)+", to="+to+", splitFrom="+(medianIndex+1)+", splitTo="+splitTo);
+    partition(list, splitIndex+1, to,         splitters, medianIndex+1,  splitTo,   splitIndexes);
+  }
+  //System.out.println("BACK TRACKING\n\n");
 }
 /**
  * Partitions (partially sorts) the given list such that all elements falling into the given interval are placed next to each other.
@@ -800,345 +798,345 @@
  * @return the index of the largest element falling into the interval <tt>[-infinity,splitter)</tt>, as seen after partitioning.
  */
 public static int partition(int[] list, int from, int to, int splitter) {
-	steps += to-from+1;
-	
-	/*
-	System.out.println();
-	if (from<=to) {
-		System.out.println("SORT WORKING: from="+from+", to="+to+", splitter="+splitter);
-	}
-	else {
-		System.out.println("SORT WORKING: NOTHING TO DO.");
-	}
-	*/
-	
-	
-	
-		
-	
-	// returns index of last element < splitter
+  steps += to-from+1;
+  
+  /*
+  System.out.println();
+  if (from<=to) {
+    System.out.println("SORT WORKING: from="+from+", to="+to+", splitter="+splitter);
+  }
+  else {
+    System.out.println("SORT WORKING: NOTHING TO DO.");
+  }
+  */
+  
+  
+  
+    
+  
+  // returns index of last element < splitter
 
-	
-	/*
-	for (int i=from-1; ++i<=to; ) {
-		if (list[i] < splitter) {
-			int element = list[i];
-			list[i] = list[from];
-			list[from++] = element;
-		}
-	}
-	*/
-	
-	
-	
-	
-	int element;
-	for (int i=from-1; ++i<=to; ) {
-		element = list[i];
-		if (element < splitter) {
-			// swap x[i] with x[from]
-			list[i] = list[from];
-			list[from++] = element;
-			//swappedElements++;
-		}
-	}
-	//if (from<=to) System.out.println("Swapped "+(head-from)+" elements");
-	
+  
+  /*
+  for (int i=from-1; ++i<=to; ) {
+    if (list[i] < splitter) {
+      int element = list[i];
+      list[i] = list[from];
+      list[from++] = element;
+    }
+  }
+  */
+  
+  
+  
+  
+  int element;
+  for (int i=from-1; ++i<=to; ) {
+    element = list[i];
+    if (element < splitter) {
+      // swap x[i] with x[from]
+      list[i] = list[from];
+      list[from++] = element;
+      //swappedElements++;
+    }
+  }
+  //if (from<=to) System.out.println("Swapped "+(head-from)+" elements");
+  
 
-	/*	
-	//JAL:
-	int first = from;
-	int last = to+1;
-	--first;
-	while (true) {
-		while (++first < last && list[first] < splitter);
-		while (first < --last && !(list[last] < splitter)); 
-		if (first >= last) return first-1;
-		int tmp = list[first];
-		list[first] = list[last];
-		list[last] = tmp;
-	}
-	*/
-	
-	
+  /*  
+  //JAL:
+  int first = from;
+  int last = to+1;
+  --first;
+  while (true) {
+    while (++first < last && list[first] < splitter);
+    while (first < --last && !(list[last] < splitter)); 
+    if (first >= last) return first-1;
+    int tmp = list[first];
+    list[first] = list[last];
+    list[last] = tmp;
+  }
+  */
+  
+  
 
-	/*
-	System.out.println("splitter="+splitter);
-	System.out.println("before="+new IntArrayList(list));
-	int head = from;
-	int trail = to;
-	int element;
-	while (head<=trail) {
-		head--;
-		while (++head < trail && list[head] < splitter);
-		
-		trail++;
-		while (--trail > head && list[trail] >= splitter);
+  /*
+  System.out.println("splitter="+splitter);
+  System.out.println("before="+new IntArrayList(list));
+  int head = from;
+  int trail = to;
+  int element;
+  while (head<=trail) {
+    head--;
+    while (++head < trail && list[head] < splitter);
+    
+    trail++;
+    while (--trail > head && list[trail] >= splitter);
 
-		if (head != trail) {		
-			element = list[head];
-			list[head] = list[trail];
-			list[trail] = element;
-		}
-		head++;
-		trail--;
-		System.out.println("after ="+new IntArrayList(list)+", head="+head);
-	}
-	*/
-		
+    if (head != trail) {    
+      element = list[head];
+      list[head] = list[trail];
+      list[trail] = element;
+    }
+    head++;
+    trail--;
+    System.out.println("after ="+new IntArrayList(list)+", head="+head);
+  }
+  */
+    
 
-	/*
-	//System.out.println("splitter="+splitter);
-	//System.out.println("before="+new IntArrayList(list));
-	to++;
-	//int head = from;
-	int element;
-	//int oldHead;
-	while (--to >= from) {
-		element = list[to];
-		if (element < splitter) {
-			from--;
-			while (++from < to && list[from] < splitter);
-			//if (head != to) {
-				list[to] = list[from];
-				list[from++] = element;
-				//oldHead = list[head];
-				//list[head] = element;
-				//list[i] = oldHead;
-				
-				//head++;
-			//}
-			//head++;
-		}
-		//System.out.println("after ="+new IntArrayList(list)+", head="+head);
-	}
-	*/
-	
-	/*
-	int i=from-1;
-	int head = from;
-	int trail = to;
-	while (++i <= trail) {
-		int element = list[i];
-		if (element < splitter) {
-			if (head == i) head++;
-			else {
-				// swap list[i] with list[from]
-				int oldHead = list[head];
-				int oldTrail = list[trail];
-				list[head++] = element;
-				list[i--] = oldTrail;
-				list[trail--] = oldHead;
-			}
-		}
-		//System.out.println(new IntArrayList(list));
-	
-	}
-	*/
-	
-	
-	return from-1;
-	//return head-1;
+  /*
+  //System.out.println("splitter="+splitter);
+  //System.out.println("before="+new IntArrayList(list));
+  to++;
+  //int head = from;
+  int element;
+  //int oldHead;
+  while (--to >= from) {
+    element = list[to];
+    if (element < splitter) {
+      from--;
+      while (++from < to && list[from] < splitter);
+      //if (head != to) {
+        list[to] = list[from];
+        list[from++] = element;
+        //oldHead = list[head];
+        //list[head] = element;
+        //list[i] = oldHead;
+        
+        //head++;
+      //}
+      //head++;
+    }
+    //System.out.println("after ="+new IntArrayList(list)+", head="+head);
+  }
+  */
+  
+  /*
+  int i=from-1;
+  int head = from;
+  int trail = to;
+  while (++i <= trail) {
+    int element = list[i];
+    if (element < splitter) {
+      if (head == i) head++;
+      else {
+        // swap list[i] with list[from]
+        int oldHead = list[head];
+        int oldTrail = list[trail];
+        list[head++] = element;
+        list[i--] = oldTrail;
+        list[trail--] = oldHead;
+      }
+    }
+    //System.out.println(new IntArrayList(list));
+  
+  }
+  */
+  
+  
+  return from-1;
+  //return head-1;
 }
 /**
  * Same as {@link #partition(int[],int,int,int[],int,int,int[])}
  * except that it partitions <tt>Object[]</tt> rather than <tt>int[]</tt> arrays.
  */
 public static void partition(Object[] list, int from, int to, Object[] splitters, int splitFrom, int splitTo, int[] splitIndexes, java.util.Comparator comp) {
-	Object splitter; // int, double --> template type dependent
-	
-	if (splitFrom>splitTo) return; // nothing to do
-	if (from>to) { // all bins are empty
-		from--;
-		for (int i = splitFrom; i<=splitTo; ) splitIndexes[i++] = from;
-		return;
-	}
-	
-	// Choose a partition (pivot) index, m
-	// Ideally, the pivot should be the median, because a median splits a list into two equal sized sublists.
-	// However, computing the median is expensive, so we use an approximation.
-	int medianIndex;
-	if (splitFrom==splitTo) { // we don't really have a choice
-		medianIndex = splitFrom;
-	}
-	else { // we do have a choice
-		int m = (from+to) / 2;       // Small arrays, middle element
-		int len = to-from+1;
-		if (len > SMALL) {
-		    int l = from;
-		    int n = to;
-		    if (len > MEDIUM) {        // Big arrays, pseudomedian of 9
-				int s = len/8;
-				l = med3(list, l,     l+s, l+2*s, comp);
-				m = med3(list, m-s,   m,   m+s,   comp);
-				n = med3(list, n-2*s, n-s, n,     comp);
-		    }
-		    m = med3(list, l, m, n, comp); // Mid-size, pseudomedian of 3
-		}
-		
-		// Find the splitter closest to the pivot, i.e. the splitter that best splits the list into two equal sized sublists.
-		medianIndex = Sorting.binarySearchFromTo(splitters,list[m],splitFrom,splitTo,comp);
-		if (medianIndex < 0) medianIndex = -medianIndex - 1; // not found
-		if (medianIndex > splitTo) medianIndex = splitTo; // not found, one past the end
-		
-	}
-	splitter = splitters[medianIndex];
+  Object splitter; // int, double --> template type dependent
+  
+  if (splitFrom>splitTo) return; // nothing to do
+  if (from>to) { // all bins are empty
+    from--;
+    for (int i = splitFrom; i<=splitTo; ) splitIndexes[i++] = from;
+    return;
+  }
+  
+  // Choose a partition (pivot) index, m
+  // Ideally, the pivot should be the median, because a median splits a list into two equal sized sublists.
+  // However, computing the median is expensive, so we use an approximation.
+  int medianIndex;
+  if (splitFrom==splitTo) { // we don't really have a choice
+    medianIndex = splitFrom;
+  }
+  else { // we do have a choice
+    int m = (from+to) / 2;       // Small arrays, middle element
+    int len = to-from+1;
+    if (len > SMALL) {
+        int l = from;
+        int n = to;
+        if (len > MEDIUM) {        // Big arrays, pseudomedian of 9
+        int s = len/8;
+        l = med3(list, l,     l+s, l+2*s, comp);
+        m = med3(list, m-s,   m,   m+s,   comp);
+        n = med3(list, n-2*s, n-s, n,     comp);
+        }
+        m = med3(list, l, m, n, comp); // Mid-size, pseudomedian of 3
+    }
+    
+    // Find the splitter closest to the pivot, i.e. the splitter that best splits the list into two equal sized sublists.
+    medianIndex = Sorting.binarySearchFromTo(splitters,list[m],splitFrom,splitTo,comp);
+    if (medianIndex < 0) medianIndex = -medianIndex - 1; // not found
+    if (medianIndex > splitTo) medianIndex = splitTo; // not found, one past the end
+    
+  }
+  splitter = splitters[medianIndex];
 
-	// Partition the list according to the splitter, i.e.
-	// Establish invariant: list[i] < splitter <= list[j] for i=from..medianIndex and j=medianIndex+1 .. to
-	int	splitIndex = partition(list,from,to,splitter,comp);
-	splitIndexes[medianIndex] = splitIndex;
+  // Partition the list according to the splitter, i.e.
+  // Establish invariant: list[i] < splitter <= list[j] for i=from..medianIndex and j=medianIndex+1 .. to
+  int  splitIndex = partition(list,from,to,splitter,comp);
+  splitIndexes[medianIndex] = splitIndex;
 
-	// Optimization: Handle special cases to cut down recursions.
-	if (splitIndex < from) { // no element falls into this bin
-		// all bins with splitters[i] <= splitter are empty
-		int i = medianIndex-1;
-		while (i>=splitFrom && (!(comp.compare(splitter,splitters[i]) < 0))) splitIndexes[i--] = splitIndex;
-		splitFrom = medianIndex+1;
-	}
-	else if (splitIndex >= to) { // all elements fall into this bin
-		// all bins with splitters[i] >= splitter are empty
-		int i = medianIndex+1;
-		while (i<=splitTo && (!(comp.compare(splitter,splitters[i]) > 0))) splitIndexes[i++] = splitIndex;
-		splitTo = medianIndex-1;
-	}
+  // Optimization: Handle special cases to cut down recursions.
+  if (splitIndex < from) { // no element falls into this bin
+    // all bins with splitters[i] <= splitter are empty
+    int i = medianIndex-1;
+    while (i>=splitFrom && (!(comp.compare(splitter,splitters[i]) < 0))) splitIndexes[i--] = splitIndex;
+    splitFrom = medianIndex+1;
+  }
+  else if (splitIndex >= to) { // all elements fall into this bin
+    // all bins with splitters[i] >= splitter are empty
+    int i = medianIndex+1;
+    while (i<=splitTo && (!(comp.compare(splitter,splitters[i]) > 0))) splitIndexes[i++] = splitIndex;
+    splitTo = medianIndex-1;
+  }
 
-	// recursively partition left half
-	if (splitFrom <= medianIndex-1) {
-		partition(list, from,         splitIndex, splitters, splitFrom, medianIndex-1,  splitIndexes, comp);
-	}
-	
-	// recursively partition right half
-	if (medianIndex+1 <= splitTo) {
-		partition(list, splitIndex+1, to,         splitters, medianIndex+1,  splitTo,   splitIndexes, comp);
-	}
+  // recursively partition left half
+  if (splitFrom <= medianIndex-1) {
+    partition(list, from,         splitIndex, splitters, splitFrom, medianIndex-1,  splitIndexes, comp);
+  }
+  
+  // recursively partition right half
+  if (medianIndex+1 <= splitTo) {
+    partition(list, splitIndex+1, to,         splitters, medianIndex+1,  splitTo,   splitIndexes, comp);
+  }
 }
 /**
  * Same as {@link #partition(int[],int,int,int)} 
  * except that it <i>synchronously</i> partitions the objects of the given list by the order of the given comparator.
  */
 public static int partition(Object[] list, int from, int to, Object splitter, java.util.Comparator comp) {
-	Object element;  // int, double --> template type dependent
-	for (int i=from-1; ++i<=to; ) {
-		element = list[i];
-		if (comp.compare(element,splitter) < 0) {
-			// swap x[i] with x[from]
-			list[i] = list[from];
-			list[from] = element;
-			from++;
-		}
-	}
-	return from-1;
+  Object element;  // int, double --> template type dependent
+  for (int i=from-1; ++i<=to; ) {
+    element = list[i];
+    if (comp.compare(element,splitter) < 0) {
+      // swap x[i] with x[from]
+      list[i] = list[from];
+      list[from] = element;
+      from++;
+    }
+  }
+  return from-1;
 }
 /**
  * Equivalent to <tt>partition(list.elements(), from, to, splitters.elements(), 0, splitters.size()-1, splitIndexes.elements())</tt>.
  */
 public static void partition(DoubleArrayList list, int from, int to, DoubleArrayList splitters, IntArrayList splitIndexes) {
-	partition(list.elements(),from,to,splitters.elements(),0,splitters.size()-1,splitIndexes.elements());
+  partition(list.elements(),from,to,splitters.elements(),0,splitters.size()-1,splitIndexes.elements());
 }
 /**
  * Equivalent to <tt>partition(list.elements(), from, to, splitters.elements(), 0, splitters.size()-1, splitIndexes.elements())</tt>.
  */
 public static void partition(IntArrayList list, int from, int to, IntArrayList splitters, IntArrayList splitIndexes) {
-	partition(list.elements(),from,to,splitters.elements(),0,splitters.size()-1,splitIndexes.elements());
+  partition(list.elements(),from,to,splitters.elements(),0,splitters.size()-1,splitIndexes.elements());
 }
 /**
  * Same as {@link #triplePartition(int[],int[],int[],int,int,int[],int,int,int[])}
  * except that it <i>synchronously</i> partitions <tt>double[]</tt> rather than <tt>int[]</tt> arrays.
  */
 public static void triplePartition(double[] list, double[] secondary, double[] tertiary, int from, int to, double[] splitters, int splitFrom, int splitTo, int[] splitIndexes) {
-	double splitter; // int, double --> template type dependent
-	
-	if (splitFrom>splitTo) return; // nothing to do
-	if (from>to) { // all bins are empty
-		from--;
-		for (int i = splitFrom; i<=splitTo; ) splitIndexes[i++] = from;
-		return;
-	}
-	
-	// Choose a partition (pivot) index, m
-	// Ideally, the pivot should be the median, because a median splits a list into two equal sized sublists.
-	// However, computing the median is expensive, so we use an approximation.
-	int medianIndex;
-	if (splitFrom==splitTo) { // we don't really have a choice
-		medianIndex = splitFrom;
-	}
-	else { // we do have a choice
-		int m = (from+to) / 2;       // Small arrays, middle element
-		int len = to-from+1;
-		if (len > SMALL) {
-		    int l = from;
-		    int n = to;
-		    if (len > MEDIUM) {        // Big arrays, pseudomedian of 9
-				int s = len/8;
-				l = med3(list, l,     l+s, l+2*s);
-				m = med3(list, m-s,   m,   m+s);
-				n = med3(list, n-2*s, n-s, n);
-		    }
-		    m = med3(list, l, m, n); // Mid-size, pseudomedian of 3
-		}
-		
-		// Find the splitter closest to the pivot, i.e. the splitter that best splits the list into two equal sized sublists.
-		medianIndex = Sorting.binarySearchFromTo(splitters,list[m],splitFrom,splitTo);
-		if (medianIndex < 0) medianIndex = -medianIndex - 1; // not found
-		if (medianIndex > splitTo) medianIndex = splitTo; // not found, one past the end
-		
-	}
-	splitter = splitters[medianIndex];
+  double splitter; // int, double --> template type dependent
+  
+  if (splitFrom>splitTo) return; // nothing to do
+  if (from>to) { // all bins are empty
+    from--;
+    for (int i = splitFrom; i<=splitTo; ) splitIndexes[i++] = from;
+    return;
+  }
+  
+  // Choose a partition (pivot) index, m
+  // Ideally, the pivot should be the median, because a median splits a list into two equal sized sublists.
+  // However, computing the median is expensive, so we use an approximation.
+  int medianIndex;
+  if (splitFrom==splitTo) { // we don't really have a choice
+    medianIndex = splitFrom;
+  }
+  else { // we do have a choice
+    int m = (from+to) / 2;       // Small arrays, middle element
+    int len = to-from+1;
+    if (len > SMALL) {
+        int l = from;
+        int n = to;
+        if (len > MEDIUM) {        // Big arrays, pseudomedian of 9
+        int s = len/8;
+        l = med3(list, l,     l+s, l+2*s);
+        m = med3(list, m-s,   m,   m+s);
+        n = med3(list, n-2*s, n-s, n);
+        }
+        m = med3(list, l, m, n); // Mid-size, pseudomedian of 3
+    }
+    
+    // Find the splitter closest to the pivot, i.e. the splitter that best splits the list into two equal sized sublists.
+    medianIndex = Sorting.binarySearchFromTo(splitters,list[m],splitFrom,splitTo);
+    if (medianIndex < 0) medianIndex = -medianIndex - 1; // not found
+    if (medianIndex > splitTo) medianIndex = splitTo; // not found, one past the end
+    
+  }
+  splitter = splitters[medianIndex];
 
-	// Partition the list according to the splitter, i.e.
-	// Establish invariant: list[i] < splitter <= list[j] for i=from..medianIndex and j=medianIndex+1 .. to
-	int	splitIndex = triplePartition(list,secondary,tertiary,from,to,splitter);
-	splitIndexes[medianIndex] = splitIndex;
+  // Partition the list according to the splitter, i.e.
+  // Establish invariant: list[i] < splitter <= list[j] for i=from..medianIndex and j=medianIndex+1 .. to
+  int  splitIndex = triplePartition(list,secondary,tertiary,from,to,splitter);
+  splitIndexes[medianIndex] = splitIndex;
 
-	// Optimization: Handle special cases to cut down recursions.
-	if (splitIndex < from) { // no element falls into this bin
-		// all bins with splitters[i] <= splitter are empty
-		int i = medianIndex-1;
-		while (i>=splitFrom && (!(splitter < splitters[i]))) splitIndexes[i--] = splitIndex;
-		splitFrom = medianIndex+1;
-	}
-	else if (splitIndex >= to) { // all elements fall into this bin
-		// all bins with splitters[i] >= splitter are empty
-		int i = medianIndex+1;
-		while (i<=splitTo && (!(splitter > splitters[i]))) splitIndexes[i++] = splitIndex;
-		splitTo = medianIndex-1;
-	}
+  // Optimization: Handle special cases to cut down recursions.
+  if (splitIndex < from) { // no element falls into this bin
+    // all bins with splitters[i] <= splitter are empty
+    int i = medianIndex-1;
+    while (i>=splitFrom && (!(splitter < splitters[i]))) splitIndexes[i--] = splitIndex;
+    splitFrom = medianIndex+1;
+  }
+  else if (splitIndex >= to) { // all elements fall into this bin
+    // all bins with splitters[i] >= splitter are empty
+    int i = medianIndex+1;
+    while (i<=splitTo && (!(splitter > splitters[i]))) splitIndexes[i++] = splitIndex;
+    splitTo = medianIndex-1;
+  }
 
-	// recursively partition left half
-	if (splitFrom <= medianIndex-1) {
-		triplePartition(list, secondary, tertiary, from,         splitIndex, splitters, splitFrom, medianIndex-1,  splitIndexes);
-	}
-	
-	// recursively partition right half
-	if (medianIndex+1 <= splitTo) {
-		triplePartition(list, secondary, tertiary, splitIndex+1, to,         splitters, medianIndex+1,  splitTo,   splitIndexes);
-	}
+  // recursively partition left half
+  if (splitFrom <= medianIndex-1) {
+    triplePartition(list, secondary, tertiary, from,         splitIndex, splitters, splitFrom, medianIndex-1,  splitIndexes);
+  }
+  
+  // recursively partition right half
+  if (medianIndex+1 <= splitTo) {
+    triplePartition(list, secondary, tertiary, splitIndex+1, to,         splitters, medianIndex+1,  splitTo,   splitIndexes);
+  }
 }
 /**
  * Same as {@link #triplePartition(int[],int[],int[],int,int,int)} 
  * except that it <i>synchronously</i> partitions <tt>double[]</tt> rather than <tt>int[]</tt> arrays.
  */
 public static int triplePartition(double[] list, double[] secondary, double[] tertiary, int from, int to, double splitter) {
-	double element;  // int, double --> template type dependent
-	for (int i=from-1; ++i<=to; ) {
-		element = list[i];
-		if (element < splitter) {
-			// swap x[i] with x[from]
-			list[i] = list[from];
-			list[from] = element;
+  double element;  // int, double --> template type dependent
+  for (int i=from-1; ++i<=to; ) {
+    element = list[i];
+    if (element < splitter) {
+      // swap x[i] with x[from]
+      list[i] = list[from];
+      list[from] = element;
 
-			element = secondary[i];
-			secondary[i] = secondary[from];
-			secondary[from] = element;
-			
-			element = tertiary[i];
-			tertiary[i] = tertiary[from];
-			tertiary[from++] = element;
-		}
-	}
+      element = secondary[i];
+      secondary[i] = secondary[from];
+      secondary[from] = element;
+      
+      element = tertiary[i];
+      tertiary[i] = tertiary[from];
+      tertiary[from++] = element;
+    }
+  }
 
-	return from-1;
+  return from-1;
 }
 /**
  * Same as {@link #partition(int[],int,int,int[],int,int,int[])} except that this method <i>synchronously</i> partitions three arrays at the same time;
@@ -1159,73 +1157,73 @@
  * Same as for single-partition methods.
  */
 public static void triplePartition(int[] list, int[] secondary, int[] tertiary, int from, int to, int[] splitters, int splitFrom, int splitTo, int[] splitIndexes) {
-	int splitter; // int, double --> template type dependent
-	
-	if (splitFrom>splitTo) return; // nothing to do
-	if (from>to) { // all bins are empty
-		from--;
-		for (int i = splitFrom; i<=splitTo; ) splitIndexes[i++] = from;
-		return;
-	}
-	
-	// Choose a partition (pivot) index, m
-	// Ideally, the pivot should be the median, because a median splits a list into two equal sized sublists.
-	// However, computing the median is expensive, so we use an approximation.
-	int medianIndex;
-	if (splitFrom==splitTo) { // we don't really have a choice
-		medianIndex = splitFrom;
-	}
-	else { // we do have a choice
-		int m = (from+to) / 2;       // Small arrays, middle element
-		int len = to-from+1;
-		if (len > SMALL) {
-		    int l = from;
-		    int n = to;
-		    if (len > MEDIUM) {        // Big arrays, pseudomedian of 9
-				int s = len/8;
-				l = med3(list, l,     l+s, l+2*s);
-				m = med3(list, m-s,   m,   m+s);
-				n = med3(list, n-2*s, n-s, n);
-		    }
-		    m = med3(list, l, m, n); // Mid-size, pseudomedian of 3
-		}
-		
-		// Find the splitter closest to the pivot, i.e. the splitter that best splits the list into two equal sized sublists.
-		medianIndex = Sorting.binarySearchFromTo(splitters,list[m],splitFrom,splitTo);
-		if (medianIndex < 0) medianIndex = -medianIndex - 1; // not found
-		if (medianIndex > splitTo) medianIndex = splitTo; // not found, one past the end
-		
-	}
-	splitter = splitters[medianIndex];
+  int splitter; // int, double --> template type dependent
+  
+  if (splitFrom>splitTo) return; // nothing to do
+  if (from>to) { // all bins are empty
+    from--;
+    for (int i = splitFrom; i<=splitTo; ) splitIndexes[i++] = from;
+    return;
+  }
+  
+  // Choose a partition (pivot) index, m
+  // Ideally, the pivot should be the median, because a median splits a list into two equal sized sublists.
+  // However, computing the median is expensive, so we use an approximation.
+  int medianIndex;
+  if (splitFrom==splitTo) { // we don't really have a choice
+    medianIndex = splitFrom;
+  }
+  else { // we do have a choice
+    int m = (from+to) / 2;       // Small arrays, middle element
+    int len = to-from+1;
+    if (len > SMALL) {
+        int l = from;
+        int n = to;
+        if (len > MEDIUM) {        // Big arrays, pseudomedian of 9
+        int s = len/8;
+        l = med3(list, l,     l+s, l+2*s);
+        m = med3(list, m-s,   m,   m+s);
+        n = med3(list, n-2*s, n-s, n);
+        }
+        m = med3(list, l, m, n); // Mid-size, pseudomedian of 3
+    }
+    
+    // Find the splitter closest to the pivot, i.e. the splitter that best splits the list into two equal sized sublists.
+    medianIndex = Sorting.binarySearchFromTo(splitters,list[m],splitFrom,splitTo);
+    if (medianIndex < 0) medianIndex = -medianIndex - 1; // not found
+    if (medianIndex > splitTo) medianIndex = splitTo; // not found, one past the end
+    
+  }
+  splitter = splitters[medianIndex];
 
-	// Partition the list according to the splitter, i.e.
-	// Establish invariant: list[i] < splitter <= list[j] for i=from..medianIndex and j=medianIndex+1 .. to
-	int	splitIndex = triplePartition(list,secondary,tertiary,from,to,splitter);
-	splitIndexes[medianIndex] = splitIndex;
+  // Partition the list according to the splitter, i.e.
+  // Establish invariant: list[i] < splitter <= list[j] for i=from..medianIndex and j=medianIndex+1 .. to
+  int  splitIndex = triplePartition(list,secondary,tertiary,from,to,splitter);
+  splitIndexes[medianIndex] = splitIndex;
 
-	// Optimization: Handle special cases to cut down recursions.
-	if (splitIndex < from) { // no element falls into this bin
-		// all bins with splitters[i] <= splitter are empty
-		int i = medianIndex-1;
-		while (i>=splitFrom && (!(splitter < splitters[i]))) splitIndexes[i--] = splitIndex;
-		splitFrom = medianIndex+1;
-	}
-	else if (splitIndex >= to) { // all elements fall into this bin
-		// all bins with splitters[i] >= splitter are empty
-		int i = medianIndex+1;
-		while (i<=splitTo && (!(splitter > splitters[i]))) splitIndexes[i++] = splitIndex;
-		splitTo = medianIndex-1;
-	}
+  // Optimization: Handle special cases to cut down recursions.
+  if (splitIndex < from) { // no element falls into this bin
+    // all bins with splitters[i] <= splitter are empty
+    int i = medianIndex-1;
+    while (i>=splitFrom && (!(splitter < splitters[i]))) splitIndexes[i--] = splitIndex;
+    splitFrom = medianIndex+1;
+  }
+  else if (splitIndex >= to) { // all elements fall into this bin
+    // all bins with splitters[i] >= splitter are empty
+    int i = medianIndex+1;
+    while (i<=splitTo && (!(splitter > splitters[i]))) splitIndexes[i++] = splitIndex;
+    splitTo = medianIndex-1;
+  }
 
-	// recursively partition left half
-	if (splitFrom <= medianIndex-1) {
-		triplePartition(list, secondary, tertiary, from,         splitIndex, splitters, splitFrom, medianIndex-1,  splitIndexes);
-	}
-	
-	// recursively partition right half
-	if (medianIndex+1 <= splitTo) {
-		triplePartition(list, secondary, tertiary, splitIndex+1, to,         splitters, medianIndex+1,  splitTo,   splitIndexes);
-	}
+  // recursively partition left half
+  if (splitFrom <= medianIndex-1) {
+    triplePartition(list, secondary, tertiary, from,         splitIndex, splitters, splitFrom, medianIndex-1,  splitIndexes);
+  }
+  
+  // recursively partition right half
+  if (medianIndex+1 <= splitTo) {
+    triplePartition(list, secondary, tertiary, splitIndex+1, to,         splitters, medianIndex+1,  splitTo,   splitIndexes);
+  }
 }
 /**
  * Same as {@link #partition(int[],int,int,int)} except that this method <i>synchronously</i> partitions three arrays at the same time;
@@ -1237,24 +1235,24 @@
  * Same as for single-partition methods.
  */
 public static int triplePartition(int[] list, int[] secondary, int[] tertiary, int from, int to, int splitter) {
-	int element;  // int, double --> template type dependent
-	for (int i=from-1; ++i<=to; ) {
-		element = list[i];
-		if (element < splitter) {
-			// swap x[i] with x[from]
-			list[i] = list[from];
-			list[from] = element;
+  int element;  // int, double --> template type dependent
+  for (int i=from-1; ++i<=to; ) {
+    element = list[i];
+    if (element < splitter) {
+      // swap x[i] with x[from]
+      list[i] = list[from];
+      list[from] = element;
 
-			element = secondary[i];
-			secondary[i] = secondary[from];
-			secondary[from] = element;
-			
-			element = tertiary[i];
-			tertiary[i] = tertiary[from];
-			tertiary[from++] = element;
-		}
-	}
+      element = secondary[i];
+      secondary[i] = secondary[from];
+      secondary[from] = element;
+      
+      element = tertiary[i];
+      tertiary[i] = tertiary[from];
+      tertiary[from++] = element;
+    }
+  }
 
-	return from-1;
+  return from-1;
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/GenericPermuting.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/GenericPermuting.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/GenericPermuting.java	(working copy)
@@ -138,55 +138,55 @@
 @throws IllegalArgumentException if <tt>p < 1 || N < 0 || p > N!</tt>.
 */
 public static int[] permutation(long p, int N) {
-	if (p<1) throw new IllegalArgumentException("Permutations are enumerated 1 .. N!");
-	if (N<0) throw new IllegalArgumentException("Must satisfy N >= 0");
-	
-	int[] permutation = new int[N];
-	
-	if (N > 20) { // factorial(21) would overflow 64-bit long)
-		// Simply make a list (0,1,..N-1) and randomize it, seeded with "p". 
-		// Note that this is perhaps not what you want...
-		for (int i=N; --i >= 0; ) permutation[i]=i;
-		org.apache.mahout.jet.random.Uniform gen = new org.apache.mahout.jet.random.Uniform(new org.apache.mahout.jet.random.engine.MersenneTwister((int)p));
-		for (int i=0; i<N-1; i++) { 
-			int random = gen.nextIntFromTo(i, N-1);
+  if (p<1) throw new IllegalArgumentException("Permutations are enumerated 1 .. N!");
+  if (N<0) throw new IllegalArgumentException("Must satisfy N >= 0");
+  
+  int[] permutation = new int[N];
+  
+  if (N > 20) { // factorial(21) would overflow 64-bit long)
+    // Simply make a list (0,1,..N-1) and randomize it, seeded with "p". 
+    // Note that this is perhaps not what you want...
+    for (int i=N; --i >= 0; ) permutation[i]=i;
+    org.apache.mahout.jet.random.Uniform gen = new org.apache.mahout.jet.random.Uniform(new org.apache.mahout.jet.random.engine.MersenneTwister((int)p));
+    for (int i=0; i<N-1; i++) { 
+      int random = gen.nextIntFromTo(i, N-1);
 
-			//swap(i, random)
-			int tmp = permutation[random];
-			permutation[random]=permutation[i]; 
-			permutation[i]=tmp; 
-		}  
+      //swap(i, random)
+      int tmp = permutation[random];
+      permutation[random]=permutation[i]; 
+      permutation[i]=tmp; 
+    }  
 
-		return permutation;
-	}
+    return permutation;
+  }
 
-	// the normal case - exact enumeration
-	if (p > org.apache.mahout.jet.math.Arithmetic.longFactorial(N)) throw new IllegalArgumentException("N too large (a sequence of N elements only has N! permutations).");
-	
-	int[] tmp = new int[N];
-	for (int i=1; i<=N; i++) tmp[i-1]= i;
-	
-	long io = p-1;
-	for (int M = N-1; M>=1; M--) {
-		long fac = org.apache.mahout.jet.math.Arithmetic.longFactorial(M);
-		int in = ((int) (io / fac)) + 1;
-		io = io % fac;
-		permutation[N-M-1] = tmp[in-1];
-		
-		for (int j = in; j <= M; j++) tmp[j-1] = tmp[j];
-	}
-	if (N>0) permutation[N-1] = tmp[0];
+  // the normal case - exact enumeration
+  if (p > org.apache.mahout.jet.math.Arithmetic.longFactorial(N)) throw new IllegalArgumentException("N too large (a sequence of N elements only has N! permutations).");
+  
+  int[] tmp = new int[N];
+  for (int i=1; i<=N; i++) tmp[i-1]= i;
+  
+  long io = p-1;
+  for (int M = N-1; M>=1; M--) {
+    long fac = org.apache.mahout.jet.math.Arithmetic.longFactorial(M);
+    int in = ((int) (io / fac)) + 1;
+    io = io % fac;
+    permutation[N-M-1] = tmp[in-1];
+    
+    for (int j = in; j <= M; j++) tmp[j-1] = tmp[j];
+  }
+  if (N>0) permutation[N-1] = tmp[0];
 
-	for (int i=N; --i >= 0; ) permutation[i] = permutation[i]-1;
-	return permutation;
+  for (int i=N; --i >= 0; ) permutation[i] = permutation[i]-1;
+  return permutation;
 }
 /**
 A non-generic variant of reordering, specialized for <tt>int[]</tt>, same semantics.
 Quicker than generic reordering. Also for convenience (forget about the Swapper object).
 */
 public static void permute(int[] list, int[] indexes) {
-	int[] copy = (int[]) list.clone();
-	for (int i=list.length; --i >=0; ) list[i] = copy[indexes[i]];
+  int[] copy = (int[]) list.clone();
+  for (int i=list.length; --i >=0; ) list[i] = copy[indexes[i]];
 }
 /**
 Deprecated. Generically reorders arbitrary shaped generic data <tt>g</tt> such that <tt>g[i] == g[indexes[i]]</tt>.
@@ -212,7 +212,7 @@
 @param   work the working storage, must satisfy <tt>work.length >= indexes.length</tt>; set <tt>work==null</tt> if you don't care about performance.
 */
 public static void permute(int[] indexes, org.apache.mahout.matrix.Swapper swapper, int[] work) {
-	permute(indexes,swapper,work,null);
+  permute(indexes,swapper,work,null);
 }
 /**
 Generically reorders arbitrary shaped generic data <tt>g</tt> such that <tt>g[i] == g[indexes[i]]</tt>.
@@ -238,39 +238,39 @@
 @param   work2 some working storage, must satisfy <tt>work2.length >= indexes.length</tt>; set <tt>work2==null</tt> if you don't care about performance.
 */
 public static void permute(int[] indexes, org.apache.mahout.matrix.Swapper swapper, int[] work1, int[] work2) {
-	// "tracks" and "pos" keeps track of the current indexes of the elements
-	// Example: We have a list==[A,B,C,D,E], indexes==[0,4,1,2,3] and swap B and E we need to know that the element formlerly at index 1 is now at index 4, and the one formerly at index 4 is now at index 1.
-	// Otherwise we stumble over our own feet and produce nonsense.
-	// Initially index i really is at index i, but this will change due to swapping.
+  // "tracks" and "pos" keeps track of the current indexes of the elements
+  // Example: We have a list==[A,B,C,D,E], indexes==[0,4,1,2,3] and swap B and E we need to know that the element formlerly at index 1 is now at index 4, and the one formerly at index 4 is now at index 1.
+  // Otherwise we stumble over our own feet and produce nonsense.
+  // Initially index i really is at index i, but this will change due to swapping.
 
-	// work1, work2 to avoid high frequency memalloc's
-	int s = indexes.length;
-	int[] tracks = work1;
-	int[] pos = work2;
-	if (tracks==null || tracks.length<s) tracks = new int[s];
-	if (pos==null || pos.length<s) pos = new int[s];
-	for (int i=s; --i >= 0; ) {
-		tracks[i] = i;
-		pos[i] = i;
-	}
-	
-	for (int i=0; i<s; i++) {
-		int index = indexes[i];
-		int track = tracks[index];
-		
-		if (i!=track) {
-			swapper.swap(i,track);
-			tracks[index]=i; tracks[pos[i]]=track;
-			int tmp = pos[i]; pos[i]=pos[track]; pos[track]=tmp;
-		}
-	}
+  // work1, work2 to avoid high frequency memalloc's
+  int s = indexes.length;
+  int[] tracks = work1;
+  int[] pos = work2;
+  if (tracks==null || tracks.length<s) tracks = new int[s];
+  if (pos==null || pos.length<s) pos = new int[s];
+  for (int i=s; --i >= 0; ) {
+    tracks[i] = i;
+    pos[i] = i;
+  }
+  
+  for (int i=0; i<s; i++) {
+    int index = indexes[i];
+    int track = tracks[index];
+    
+    if (i!=track) {
+      swapper.swap(i,track);
+      tracks[index]=i; tracks[pos[i]]=track;
+      int tmp = pos[i]; pos[i]=pos[track]; pos[track]=tmp;
+    }
+  }
 }
 /**
 A non-generic variant of reordering, specialized for <tt>Object[]</tt>, same semantics.
 Quicker than generic reordering. Also for convenience (forget about the Swapper object).
 */
 public static void permute(Object[] list, int[] indexes) {
-	Object[] copy = (Object[]) list.clone();
-	for (int i=list.length; --i >=0; ) list[i] = copy[indexes[i]];
+  Object[] copy = (Object[]) list.clone();
+  for (int i=list.length; --i >=0; ) list[i] = copy[indexes[i]];
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/bench/BenchmarkMatrix.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/bench/BenchmarkMatrix.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/bench/BenchmarkMatrix.java	(working copy)
@@ -37,863 +37,863 @@
  * Not yet documented.
  */
 protected static void bench_dgemm(String[] args) {
-	String[] types;
-	int cpus;
-	double minSecs;
-	boolean transposeA;
-	boolean transposeB;
-	double[] densities;
-	int[] sizes;
-	
-	try { // parse
-		int k = 1;
-		types = new String[] {args[k++]};
-		cpus = Integer.parseInt(args[k++]);
-		minSecs = new Double(args[k++]).doubleValue();
-		densities = new double[] {new Double(args[k++]).doubleValue()};
-		transposeA = new Boolean(args[k++]).booleanValue();
-		transposeB = new Boolean(args[k++]).booleanValue();
-		
-		sizes = new int[args.length - k];
-		for (int i=0; k<args.length; k++, i++) sizes[i] = Integer.parseInt(args[k]);
-	}
-	catch (Exception exc) {
-		System.out.println(usage(args[0]));
-		System.out.println("Ignoring command...\n");
-		return;
-	}
+  String[] types;
+  int cpus;
+  double minSecs;
+  boolean transposeA;
+  boolean transposeB;
+  double[] densities;
+  int[] sizes;
+  
+  try { // parse
+    int k = 1;
+    types = new String[] {args[k++]};
+    cpus = Integer.parseInt(args[k++]);
+    minSecs = new Double(args[k++]).doubleValue();
+    densities = new double[] {new Double(args[k++]).doubleValue()};
+    transposeA = new Boolean(args[k++]).booleanValue();
+    transposeB = new Boolean(args[k++]).booleanValue();
+    
+    sizes = new int[args.length - k];
+    for (int i=0; k<args.length; k++, i++) sizes[i] = Integer.parseInt(args[k]);
+  }
+  catch (Exception exc) {
+    System.out.println(usage(args[0]));
+    System.out.println("Ignoring command...\n");
+    return;
+  }
 
-	org.apache.mahout.matrix.matrix.linalg.SmpBlas.allocateBlas(cpus, org.apache.mahout.matrix.matrix.linalg.SeqBlas.seqBlas);
-	Double2DProcedure fun = fun_dgemm(transposeA,transposeB);
-	String title = fun.toString();
-	String params = transposeA +", "+transposeB+", 1, A, B, 0, C";
-	title = title + " dgemm("+params+")";
-	run(minSecs,title,fun,types,sizes,densities);
+  org.apache.mahout.matrix.matrix.linalg.SmpBlas.allocateBlas(cpus, org.apache.mahout.matrix.matrix.linalg.SeqBlas.seqBlas);
+  Double2DProcedure fun = fun_dgemm(transposeA,transposeB);
+  String title = fun.toString();
+  String params = transposeA +", "+transposeB+", 1, A, B, 0, C";
+  title = title + " dgemm("+params+")";
+  run(minSecs,title,fun,types,sizes,densities);
 }
 /**
  * Not yet documented.
  */
 protected static void bench_dgemv(String[] args) {
-	String[] types;
-	int cpus;
-	double minSecs;
-	boolean transposeA;
-	double[] densities;
-	int[] sizes;
-	
-	try { // parse
-		int k = 1;
-		types = new String[] {args[k++]};
-		cpus = Integer.parseInt(args[k++]);
-		minSecs = new Double(args[k++]).doubleValue();
-		densities = new double[] {new Double(args[k++]).doubleValue()};
-		transposeA = new Boolean(args[k++]).booleanValue();
-		
-		sizes = new int[args.length - k];
-		for (int i=0; k<args.length; k++, i++) sizes[i] = Integer.parseInt(args[k]);
-	}
-	catch (Exception exc) {
-		System.out.println(usage(args[0]));
-		System.out.println("Ignoring command...\n");
-		return;
-	}
+  String[] types;
+  int cpus;
+  double minSecs;
+  boolean transposeA;
+  double[] densities;
+  int[] sizes;
+  
+  try { // parse
+    int k = 1;
+    types = new String[] {args[k++]};
+    cpus = Integer.parseInt(args[k++]);
+    minSecs = new Double(args[k++]).doubleValue();
+    densities = new double[] {new Double(args[k++]).doubleValue()};
+    transposeA = new Boolean(args[k++]).booleanValue();
+    
+    sizes = new int[args.length - k];
+    for (int i=0; k<args.length; k++, i++) sizes[i] = Integer.parseInt(args[k]);
+  }
+  catch (Exception exc) {
+    System.out.println(usage(args[0]));
+    System.out.println("Ignoring command...\n");
+    return;
+  }
 
-	org.apache.mahout.matrix.matrix.linalg.SmpBlas.allocateBlas(cpus, org.apache.mahout.matrix.matrix.linalg.SeqBlas.seqBlas);
-	Double2DProcedure fun = fun_dgemv(transposeA);
-	String title = fun.toString();
-	String params = transposeA +", 1, A, B, 0, C";
-	title = title + " dgemv("+params+")";
-	run(minSecs,title,fun,types,sizes,densities);
+  org.apache.mahout.matrix.matrix.linalg.SmpBlas.allocateBlas(cpus, org.apache.mahout.matrix.matrix.linalg.SeqBlas.seqBlas);
+  Double2DProcedure fun = fun_dgemv(transposeA);
+  String title = fun.toString();
+  String params = transposeA +", 1, A, B, 0, C";
+  title = title + " dgemv("+params+")";
+  run(minSecs,title,fun,types,sizes,densities);
 }
 /**
  * Not yet documented.
  */
 protected static void bench_pow(String[] args) {
-	String[] types;
-	int cpus;
-	double minSecs;
-	double[] densities;
-	int exponent;
-	int[] sizes;
-	
-	try { // parse
-		int k = 1;
-		types = new String[] {args[k++]};
-		cpus = Integer.parseInt(args[k++]);
-		minSecs = new Double(args[k++]).doubleValue();
-		densities = new double[] {new Double(args[k++]).doubleValue()};
-		exponent = Integer.parseInt(args[k++]);
-		
-		sizes = new int[args.length - k];
-		for (int i=0; k<args.length; k++, i++) sizes[i] = Integer.parseInt(args[k]);
-	}
-	catch (Exception exc) {
-		System.out.println(usage(args[0]));
-		System.out.println("Ignoring command...\n");
-		return;
-	}
+  String[] types;
+  int cpus;
+  double minSecs;
+  double[] densities;
+  int exponent;
+  int[] sizes;
+  
+  try { // parse
+    int k = 1;
+    types = new String[] {args[k++]};
+    cpus = Integer.parseInt(args[k++]);
+    minSecs = new Double(args[k++]).doubleValue();
+    densities = new double[] {new Double(args[k++]).doubleValue()};
+    exponent = Integer.parseInt(args[k++]);
+    
+    sizes = new int[args.length - k];
+    for (int i=0; k<args.length; k++, i++) sizes[i] = Integer.parseInt(args[k]);
+  }
+  catch (Exception exc) {
+    System.out.println(usage(args[0]));
+    System.out.println("Ignoring command...\n");
+    return;
+  }
 
-	org.apache.mahout.matrix.matrix.linalg.SmpBlas.allocateBlas(cpus, org.apache.mahout.matrix.matrix.linalg.SeqBlas.seqBlas);
-	Double2DProcedure fun = fun_pow(exponent);
-	String title = fun.toString();
-	String params = "A,"+exponent;
-	title = title +" pow("+params+")";
-	run(minSecs,title,fun,types,sizes,densities);
+  org.apache.mahout.matrix.matrix.linalg.SmpBlas.allocateBlas(cpus, org.apache.mahout.matrix.matrix.linalg.SeqBlas.seqBlas);
+  Double2DProcedure fun = fun_pow(exponent);
+  String title = fun.toString();
+  String params = "A,"+exponent;
+  title = title +" pow("+params+")";
+  run(minSecs,title,fun,types,sizes,densities);
 }
 /**
  * Not yet documented.
  */
 protected static void benchGeneric(Double2DProcedure fun, String[] args) {
-	String[] types;
-	int cpus;
-	double minSecs;
-	double[] densities;
-	int[] sizes;
-	
-	try { // parse
-		int k = 1;
-		types = new String[] {args[k++]};
-		cpus = Integer.parseInt(args[k++]);
-		minSecs = new Double(args[k++]).doubleValue();
-		densities = new double[] {new Double(args[k++]).doubleValue()};
-		
-		sizes = new int[args.length - k];
-		for (int i=0; k<args.length; k++, i++) sizes[i] = Integer.parseInt(args[k]);
-	}
-	catch (Exception exc) {
-		System.out.println(usage(args[0]));
-		System.out.println("Ignoring command...\n");
-		return;
-	}
+  String[] types;
+  int cpus;
+  double minSecs;
+  double[] densities;
+  int[] sizes;
+  
+  try { // parse
+    int k = 1;
+    types = new String[] {args[k++]};
+    cpus = Integer.parseInt(args[k++]);
+    minSecs = new Double(args[k++]).doubleValue();
+    densities = new double[] {new Double(args[k++]).doubleValue()};
+    
+    sizes = new int[args.length - k];
+    for (int i=0; k<args.length; k++, i++) sizes[i] = Integer.parseInt(args[k]);
+  }
+  catch (Exception exc) {
+    System.out.println(usage(args[0]));
+    System.out.println("Ignoring command...\n");
+    return;
+  }
 
-	org.apache.mahout.matrix.matrix.linalg.SmpBlas.allocateBlas(cpus, org.apache.mahout.matrix.matrix.linalg.SeqBlas.seqBlas);
-	String title = fun.toString();
-	run(minSecs,title,fun,types,sizes,densities);
+  org.apache.mahout.matrix.matrix.linalg.SmpBlas.allocateBlas(cpus, org.apache.mahout.matrix.matrix.linalg.SeqBlas.seqBlas);
+  String title = fun.toString();
+  run(minSecs,title,fun,types,sizes,densities);
 }
 /**
  * 
  */
 protected static String commands() {
-	return "dgemm, dgemv, pow, assign, assignGetSet, assignGetSetQuick, assignLog, assignPlusMult, elementwiseMult, elementwiseMultB, SOR5, SOR8, LUDecompose, LUSolve";
+  return "dgemm, dgemv, pow, assign, assignGetSet, assignGetSetQuick, assignLog, assignPlusMult, elementwiseMult, elementwiseMultB, SOR5, SOR8, LUDecompose, LUSolve";
 }
 /**
  * Linear algebrax matrix-matrix multiply.
  */
 protected static Double2DProcedure fun_dgemm(final boolean transposeA, final boolean transposeB) {
-	return new Double2DProcedure() {
-		public String toString() { return "Blas matrix-matrix mult";	}
-		public void setParameters(DoubleMatrix2D G, DoubleMatrix2D H) {
-			super.setParameters(G,H);
-			D = new org.apache.mahout.matrix.matrix.impl.DenseDoubleMatrix2D(A.rows(),A.columns()).assign(0.5);
-			C = D.copy();
-			B = D.copy();
-		}
-		public void init() { C.assign(D); }
-		public void apply(org.apache.mahout.matrix.Timer timer) {
-			org.apache.mahout.matrix.matrix.linalg.SmpBlas.smpBlas.dgemm(transposeA,transposeB,1,A,B,0,C);
-		}
-		public double operations() { // Mflops
-			double m = A.rows();
-			double n = A.columns();
-			double p = B.columns();
-			return 2.0*m*n*p / 1.0E6; 
-		}
-	};
+  return new Double2DProcedure() {
+    public String toString() { return "Blas matrix-matrix mult";  }
+    public void setParameters(DoubleMatrix2D G, DoubleMatrix2D H) {
+      super.setParameters(G,H);
+      D = new org.apache.mahout.matrix.matrix.impl.DenseDoubleMatrix2D(A.rows(),A.columns()).assign(0.5);
+      C = D.copy();
+      B = D.copy();
+    }
+    public void init() { C.assign(D); }
+    public void apply(org.apache.mahout.matrix.Timer timer) {
+      org.apache.mahout.matrix.matrix.linalg.SmpBlas.smpBlas.dgemm(transposeA,transposeB,1,A,B,0,C);
+    }
+    public double operations() { // Mflops
+      double m = A.rows();
+      double n = A.columns();
+      double p = B.columns();
+      return 2.0*m*n*p / 1.0E6; 
+    }
+  };
 }
 /**
  * Linear algebrax matrix-matrix multiply.
  */
 protected static Double2DProcedure fun_dgemv(final boolean transposeA) {
-	return new Double2DProcedure() { 
-		public String toString() { return "Blas matrix-vector mult";	}
-		public void setParameters(DoubleMatrix2D G, DoubleMatrix2D H) {
-			super.setParameters(G,H);
-			D = new org.apache.mahout.matrix.matrix.impl.DenseDoubleMatrix2D(A.rows(),A.columns()).assign(0.5);
-			C = D.copy();
-			B = D.copy();
-		}
-		public void init() { C.viewRow(0).assign(D.viewRow(0)); }
-		public void apply(org.apache.mahout.matrix.Timer timer) {
-			org.apache.mahout.matrix.matrix.linalg.SmpBlas.smpBlas.dgemv(transposeA,1,A,B.viewRow(0),0,C.viewRow(0));
-		}
-		public double operations() { // Mflops
-			double m = A.rows();
-			double n = A.columns();
-			//double p = B.columns();
-			return 2.0*m*n / 1.0E6; 
-		}
-	};
+  return new Double2DProcedure() { 
+    public String toString() { return "Blas matrix-vector mult";  }
+    public void setParameters(DoubleMatrix2D G, DoubleMatrix2D H) {
+      super.setParameters(G,H);
+      D = new org.apache.mahout.matrix.matrix.impl.DenseDoubleMatrix2D(A.rows(),A.columns()).assign(0.5);
+      C = D.copy();
+      B = D.copy();
+    }
+    public void init() { C.viewRow(0).assign(D.viewRow(0)); }
+    public void apply(org.apache.mahout.matrix.Timer timer) {
+      org.apache.mahout.matrix.matrix.linalg.SmpBlas.smpBlas.dgemv(transposeA,1,A,B.viewRow(0),0,C.viewRow(0));
+    }
+    public double operations() { // Mflops
+      double m = A.rows();
+      double n = A.columns();
+      //double p = B.columns();
+      return 2.0*m*n / 1.0E6; 
+    }
+  };
 }
 /**
  * 2D assign with get,set
  */
 protected static Double2DProcedure fun_pow(final int k) {
-	return new Double2DProcedure() {
-		public double dummy;
-		public String toString() { return "matrix to the power of an exponent";	}
-		public void setParameters(DoubleMatrix2D A, DoubleMatrix2D B) {
-			if (k<0) { // must be nonsingular for inversion
-				if (!org.apache.mahout.matrix.matrix.linalg.Property.ZERO.isDiagonallyDominantByRow(A) ||
-					!org.apache.mahout.matrix.matrix.linalg.Property.ZERO.isDiagonallyDominantByColumn(A)) {
-						org.apache.mahout.matrix.matrix.linalg.Property.ZERO.generateNonSingular(A);
-					}
-				super.setParameters(A,B);
-			}
-		}
+  return new Double2DProcedure() {
+    public double dummy;
+    public String toString() { return "matrix to the power of an exponent";  }
+    public void setParameters(DoubleMatrix2D A, DoubleMatrix2D B) {
+      if (k<0) { // must be nonsingular for inversion
+        if (!org.apache.mahout.matrix.matrix.linalg.Property.ZERO.isDiagonallyDominantByRow(A) ||
+          !org.apache.mahout.matrix.matrix.linalg.Property.ZERO.isDiagonallyDominantByColumn(A)) {
+            org.apache.mahout.matrix.matrix.linalg.Property.ZERO.generateNonSingular(A);
+          }
+        super.setParameters(A,B);
+      }
+    }
 
-		public void init() {}		
-		public void apply(org.apache.mahout.matrix.Timer timer) {
-			org.apache.mahout.matrix.matrix.linalg.Algebra.DEFAULT.pow(A,k);
-		}
-		public double operations() { // Mflops
-			double m = A.rows();
-			if (k==0) return m; // identity
-			double mflops = 0;
-			if (k<0) {
-				// LU.decompose
-				double N = Math.min(A.rows(),A.columns());
-				mflops += (2.0 * N*N*N / 3.0 / 1.0E6);
+    public void init() {}    
+    public void apply(org.apache.mahout.matrix.Timer timer) {
+      org.apache.mahout.matrix.matrix.linalg.Algebra.DEFAULT.pow(A,k);
+    }
+    public double operations() { // Mflops
+      double m = A.rows();
+      if (k==0) return m; // identity
+      double mflops = 0;
+      if (k<0) {
+        // LU.decompose
+        double N = Math.min(A.rows(),A.columns());
+        mflops += (2.0 * N*N*N / 3.0 / 1.0E6);
 
-				// LU.solve
-				double n = A.columns();
-				double nx = B.columns();
-				mflops += (2.0 * nx*(n*n + n) / 1.0E6); 
-			}
-			// mult
-			mflops += 2.0*(Math.abs(k)-1)*m*m*m / 1.0E6;
-			return mflops; 
-		}
-	};
+        // LU.solve
+        double n = A.columns();
+        double nx = B.columns();
+        mflops += (2.0 * nx*(n*n + n) / 1.0E6); 
+      }
+      // mult
+      mflops += 2.0*(Math.abs(k)-1)*m*m*m / 1.0E6;
+      return mflops; 
+    }
+  };
 }
 /**
  * 2D assign with A.assign(B)
  */
 protected static Double2DProcedure funAssign() {
-	return new Double2DProcedure() {
-		public String toString() { return "A.assign(B) [Mops/sec]";	}
-		public void init() { A.assign(0); }		
-		public void apply(org.apache.mahout.matrix.Timer timer) {
-			A.assign(B);
-		}
-	};
+  return new Double2DProcedure() {
+    public String toString() { return "A.assign(B) [Mops/sec]";  }
+    public void init() { A.assign(0); }    
+    public void apply(org.apache.mahout.matrix.Timer timer) {
+      A.assign(B);
+    }
+  };
 }
 /**
  * 2D assign with get,set
  */
 protected static Double2DProcedure funAssignGetSet() {
-	return new Double2DProcedure() { 
-		public String toString() { return "A.assign(B) via get and set [Mops/sec]";	}
-		public void init() { A.assign(0); }		
-		public void apply(org.apache.mahout.matrix.Timer timer) {
-			int rows=B.rows();
-			int columns=B.columns();
-			/*
-			for (int row=rows; --row >= 0; ) {
-				for (int column=columns; --column >= 0; ) {
-					A.set(row,column, B.get(row,column));
-				}
-			}
-			*/
-			for (int row=0; row < rows; row++) {
-				for (int column=0; column < columns; column++) {
-					A.set(row,column, B.get(row,column));
-				}
-			}
-		}
-	};
+  return new Double2DProcedure() { 
+    public String toString() { return "A.assign(B) via get and set [Mops/sec]";  }
+    public void init() { A.assign(0); }    
+    public void apply(org.apache.mahout.matrix.Timer timer) {
+      int rows=B.rows();
+      int columns=B.columns();
+      /*
+      for (int row=rows; --row >= 0; ) {
+        for (int column=columns; --column >= 0; ) {
+          A.set(row,column, B.get(row,column));
+        }
+      }
+      */
+      for (int row=0; row < rows; row++) {
+        for (int column=0; column < columns; column++) {
+          A.set(row,column, B.get(row,column));
+        }
+      }
+    }
+  };
 }
 /**
  * 2D assign with getQuick,setQuick
  */
 protected static Double2DProcedure funAssignGetSetQuick() {
-	return new Double2DProcedure() { 
-		public String toString() { return "A.assign(B) via getQuick and setQuick [Mops/sec]";	}
-		public void init() { A.assign(0); }		
-		public void apply(org.apache.mahout.matrix.Timer timer) {
-			int rows=B.rows();
-			int columns=B.columns();
-			//for (int row=rows; --row >= 0; ) {
-			//	for (int column=columns; --column >= 0; ) {
-			for (int row=0; row < rows; row++) {
-				for (int column=0; column < columns; column++) {
-					A.setQuick(row,column, B.getQuick(row,column));
-				}
-			}
-		}
-	};
+  return new Double2DProcedure() { 
+    public String toString() { return "A.assign(B) via getQuick and setQuick [Mops/sec]";  }
+    public void init() { A.assign(0); }    
+    public void apply(org.apache.mahout.matrix.Timer timer) {
+      int rows=B.rows();
+      int columns=B.columns();
+      //for (int row=rows; --row >= 0; ) {
+      //  for (int column=columns; --column >= 0; ) {
+      for (int row=0; row < rows; row++) {
+        for (int column=0; column < columns; column++) {
+          A.setQuick(row,column, B.getQuick(row,column));
+        }
+      }
+    }
+  };
 }
 /**
  * 2D assign with A.assign(B)
  */
 protected static Double2DProcedure funAssignLog() {
-	return new Double2DProcedure() { 
-		public String toString() { return "A[i,j] = log(A[i,j]) via Blas.assign(fun) [Mflops/sec]";	}
-		public void init() { A.assign(C); }		
-		public void apply(org.apache.mahout.matrix.Timer timer) {
-			org.apache.mahout.matrix.matrix.linalg.SmpBlas.smpBlas.assign(A, org.apache.mahout.jet.math.Functions.log);
-		}
-	};
+  return new Double2DProcedure() { 
+    public String toString() { return "A[i,j] = log(A[i,j]) via Blas.assign(fun) [Mflops/sec]";  }
+    public void init() { A.assign(C); }    
+    public void apply(org.apache.mahout.matrix.Timer timer) {
+      org.apache.mahout.matrix.matrix.linalg.SmpBlas.smpBlas.assign(A, org.apache.mahout.jet.math.Functions.log);
+    }
+  };
 }
 /**
  * 2D assign with A.assign(B)
  */
 protected static Double2DProcedure funAssignPlusMult() {
-	return new Double2DProcedure() { 
-		public String toString() { return "A[i,j] = A[i,j] + s*B[i,j] via Blas.assign(fun) [Mflops/sec]";	}
-		public void init() { A.assign(C); }		
-		public void apply(org.apache.mahout.matrix.Timer timer) {
-			org.apache.mahout.matrix.matrix.linalg.SmpBlas.smpBlas.assign(A,B, org.apache.mahout.jet.math.Functions.plusMult(0.5));
-		}
-		public double operations() { // Mflops
-			double m = A.rows();
-			double n = A.columns();
-			return 2*m*n / 1.0E6; 
-		}
-	};
+  return new Double2DProcedure() { 
+    public String toString() { return "A[i,j] = A[i,j] + s*B[i,j] via Blas.assign(fun) [Mflops/sec]";  }
+    public void init() { A.assign(C); }    
+    public void apply(org.apache.mahout.matrix.Timer timer) {
+      org.apache.mahout.matrix.matrix.linalg.SmpBlas.smpBlas.assign(A,B, org.apache.mahout.jet.math.Functions.plusMult(0.5));
+    }
+    public double operations() { // Mflops
+      double m = A.rows();
+      double n = A.columns();
+      return 2*m*n / 1.0E6; 
+    }
+  };
 }
 /**
  * Linear algebrax matrix-matrix multiply.
  */
 protected static Double2DProcedure funCorrelation() {
-	return new Double2DProcedure() { 
-		public String toString() { return "xxxxxxx";	}
-		public void init() {  }		
-		public void setParameters(DoubleMatrix2D A, DoubleMatrix2D B) {
-			super.setParameters(A.viewDice(),B); // transposed --> faster (memory aware) iteration in correlation algo
-		}
-		public void apply(org.apache.mahout.matrix.Timer timer) {
-			org.apache.mahout.matrix.matrix.doublealgo.Statistic.correlation(
-				org.apache.mahout.matrix.matrix.doublealgo.Statistic.covariance(A));
-		}
-		public double operations() { // Mflops
-			double m = A.rows();
-			double n = A.columns();
-			return m*(n*n + n) / 1.0E6; 
-		}
-	};
+  return new Double2DProcedure() { 
+    public String toString() { return "xxxxxxx";  }
+    public void init() {  }    
+    public void setParameters(DoubleMatrix2D A, DoubleMatrix2D B) {
+      super.setParameters(A.viewDice(),B); // transposed --> faster (memory aware) iteration in correlation algo
+    }
+    public void apply(org.apache.mahout.matrix.Timer timer) {
+      org.apache.mahout.matrix.matrix.doublealgo.Statistic.correlation(
+        org.apache.mahout.matrix.matrix.doublealgo.Statistic.covariance(A));
+    }
+    public double operations() { // Mflops
+      double m = A.rows();
+      double n = A.columns();
+      return m*(n*n + n) / 1.0E6; 
+    }
+  };
 }
 /**
  * Element-by-element matrix-matrix multiply.
  */
 protected static Double2DProcedure funElementwiseMult() {
-	return new Double2DProcedure() { 
-		public String toString() { return "A.assign(F.mult(0.5)) via Blas [Mflops/sec]";	}
-		public void init() { A.assign(C); }		
-		public void apply(org.apache.mahout.matrix.Timer timer) {
-			org.apache.mahout.matrix.matrix.linalg.SmpBlas.smpBlas.assign(A, org.apache.mahout.jet.math.Functions.mult(0.5));
-		}
-	};
+  return new Double2DProcedure() { 
+    public String toString() { return "A.assign(F.mult(0.5)) via Blas [Mflops/sec]";  }
+    public void init() { A.assign(C); }    
+    public void apply(org.apache.mahout.matrix.Timer timer) {
+      org.apache.mahout.matrix.matrix.linalg.SmpBlas.smpBlas.assign(A, org.apache.mahout.jet.math.Functions.mult(0.5));
+    }
+  };
 }
 /**
  * Element-by-element matrix-matrix multiply.
  */
 protected static Double2DProcedure funElementwiseMultB() {
-	return new Double2DProcedure() { 
-		public String toString() { return "A.assign(B,F.mult) via Blas [Mflops/sec]";	}
-		public void init() { A.assign(C); }		
-		public void apply(org.apache.mahout.matrix.Timer timer) {
-			org.apache.mahout.matrix.matrix.linalg.SmpBlas.smpBlas.assign(A,B, org.apache.mahout.jet.math.Functions.mult);
-		}
-	};
+  return new Double2DProcedure() { 
+    public String toString() { return "A.assign(B,F.mult) via Blas [Mflops/sec]";  }
+    public void init() { A.assign(C); }    
+    public void apply(org.apache.mahout.matrix.Timer timer) {
+      org.apache.mahout.matrix.matrix.linalg.SmpBlas.smpBlas.assign(A,B, org.apache.mahout.jet.math.Functions.mult);
+    }
+  };
 }
 /**
  * 2D assign with get,set
  */
 protected static Double2DProcedure funGetQuick() {
-	return new Double2DProcedure() {
-		public double dummy;
-		public String toString() { return "xxxxxxx";	}
-		public void init() {}		
-		public void apply(org.apache.mahout.matrix.Timer timer) {
-			int rows=B.rows();
-			int columns=B.columns();
-			double sum =0;
-			//for (int row=rows; --row >= 0; ) {
-			//	for (int column=columns; --column >= 0; ) {
-			for (int row=0; row < rows; row++) {
-				for (int column=0; column < columns; column++) {
-					sum += A.getQuick(row,column);
-				}
-			}
-			dummy = sum;
-		}
-	};
+  return new Double2DProcedure() {
+    public double dummy;
+    public String toString() { return "xxxxxxx";  }
+    public void init() {}    
+    public void apply(org.apache.mahout.matrix.Timer timer) {
+      int rows=B.rows();
+      int columns=B.columns();
+      double sum =0;
+      //for (int row=rows; --row >= 0; ) {
+      //  for (int column=columns; --column >= 0; ) {
+      for (int row=0; row < rows; row++) {
+        for (int column=0; column < columns; column++) {
+          sum += A.getQuick(row,column);
+        }
+      }
+      dummy = sum;
+    }
+  };
 }
 /**
  * 2D assign with getQuick,setQuick
  */
 protected static Double2DProcedure funLUDecompose() {
-	return new Double2DProcedure() {
-		org.apache.mahout.matrix.matrix.linalg.LUDecompositionQuick lu = new org.apache.mahout.matrix.matrix.linalg.LUDecompositionQuick(0);
-		public String toString() { return "LU.decompose(A) [Mflops/sec]";	}
-		public void init() { A.assign(C); }
-		public void apply(org.apache.mahout.matrix.Timer timer) {
-			lu.decompose(A);	
-		}
-		public double operations() { // Mflops
-			double N = Math.min(A.rows(),A.columns());
-			return (2.0 * N*N*N / 3.0 / 1.0E6); 
-		}
-	};
+  return new Double2DProcedure() {
+    org.apache.mahout.matrix.matrix.linalg.LUDecompositionQuick lu = new org.apache.mahout.matrix.matrix.linalg.LUDecompositionQuick(0);
+    public String toString() { return "LU.decompose(A) [Mflops/sec]";  }
+    public void init() { A.assign(C); }
+    public void apply(org.apache.mahout.matrix.Timer timer) {
+      lu.decompose(A);  
+    }
+    public double operations() { // Mflops
+      double N = Math.min(A.rows(),A.columns());
+      return (2.0 * N*N*N / 3.0 / 1.0E6); 
+    }
+  };
 }
 /**
  * 2D assign with getQuick,setQuick
  */
 protected static Double2DProcedure funLUSolve() {
-	return new Double2DProcedure() {
-		org.apache.mahout.matrix.matrix.linalg.LUDecompositionQuick lu;
-		public String toString() { return "LU.solve(A) [Mflops/sec]";	}
-		public void setParameters(DoubleMatrix2D A, DoubleMatrix2D B) {
-			lu = null;
-			if (!org.apache.mahout.matrix.matrix.linalg.Property.ZERO.isDiagonallyDominantByRow(A) ||
-				!org.apache.mahout.matrix.matrix.linalg.Property.ZERO.isDiagonallyDominantByColumn(A)) {
-					org.apache.mahout.matrix.matrix.linalg.Property.ZERO.generateNonSingular(A);
-				}
-			super.setParameters(A,B);
-			lu = new org.apache.mahout.matrix.matrix.linalg.LUDecompositionQuick(0);
-			lu.decompose(A);
-		}
-		public void init() { B.assign(D); }
-		public void apply(org.apache.mahout.matrix.Timer timer) {
-			lu.solve(B);	
-		}
-		public double operations() { // Mflops
-			double n = A.columns();
-			double nx = B.columns();
-			return (2.0 * nx*(n*n + n) / 1.0E6); 
-		}
-	};
+  return new Double2DProcedure() {
+    org.apache.mahout.matrix.matrix.linalg.LUDecompositionQuick lu;
+    public String toString() { return "LU.solve(A) [Mflops/sec]";  }
+    public void setParameters(DoubleMatrix2D A, DoubleMatrix2D B) {
+      lu = null;
+      if (!org.apache.mahout.matrix.matrix.linalg.Property.ZERO.isDiagonallyDominantByRow(A) ||
+        !org.apache.mahout.matrix.matrix.linalg.Property.ZERO.isDiagonallyDominantByColumn(A)) {
+          org.apache.mahout.matrix.matrix.linalg.Property.ZERO.generateNonSingular(A);
+        }
+      super.setParameters(A,B);
+      lu = new org.apache.mahout.matrix.matrix.linalg.LUDecompositionQuick(0);
+      lu.decompose(A);
+    }
+    public void init() { B.assign(D); }
+    public void apply(org.apache.mahout.matrix.Timer timer) {
+      lu.solve(B);  
+    }
+    public double operations() { // Mflops
+      double n = A.columns();
+      double nx = B.columns();
+      return (2.0 * nx*(n*n + n) / 1.0E6); 
+    }
+  };
 }
 /**
  * Linear algebrax matrix-matrix multiply.
  */
 protected static Double2DProcedure funMatMultLarge() {
-	return new Double2DProcedure() {
-		public String toString() { return "xxxxxxx";	}
-		public void setParameters(DoubleMatrix2D A, DoubleMatrix2D B) {
-			// do not allocate mem for "D" --> safe some mem
-			this.A = A;
-			this.B = B;
-			this.C = A.copy();
-		}
-		public void init() { C.assign(0); }
-		public void apply(org.apache.mahout.matrix.Timer timer) { A.zMult(B,C); }
-		public double operations() { // Mflops
-			double m = A.rows();
-			double n = A.columns();
-			double p = B.columns();
-			return 2.0*m*n*p / 1.0E6; 
-		}
-	};
+  return new Double2DProcedure() {
+    public String toString() { return "xxxxxxx";  }
+    public void setParameters(DoubleMatrix2D A, DoubleMatrix2D B) {
+      // do not allocate mem for "D" --> safe some mem
+      this.A = A;
+      this.B = B;
+      this.C = A.copy();
+    }
+    public void init() { C.assign(0); }
+    public void apply(org.apache.mahout.matrix.Timer timer) { A.zMult(B,C); }
+    public double operations() { // Mflops
+      double m = A.rows();
+      double n = A.columns();
+      double p = B.columns();
+      return 2.0*m*n*p / 1.0E6; 
+    }
+  };
 }
 /**
  * Linear algebrax matrix-vector multiply.
  */
 protected static Double2DProcedure funMatVectorMult() {
-	return new Double2DProcedure() { 
-		public String toString() { return "xxxxxxx";	}
-		public void setParameters(DoubleMatrix2D G, DoubleMatrix2D H) {
-			super.setParameters(G,H);
-			D = new org.apache.mahout.matrix.matrix.impl.DenseDoubleMatrix2D(A.rows(),A.columns()).assign(0.5);
-			C = D.copy();
-			B = D.copy();
-		}
-		public void init() { C.viewRow(0).assign(D.viewRow(0)); }
-		public void apply(org.apache.mahout.matrix.Timer timer) { A.zMult(B.viewRow(0),C.viewRow(0)); }
-		public double operations() { // Mflops
-			double m = A.rows();
-			double n = A.columns();
-			//double p = B.columns();
-			return 2.0*m*n / 1.0E6; 
-		}
-	};
+  return new Double2DProcedure() { 
+    public String toString() { return "xxxxxxx";  }
+    public void setParameters(DoubleMatrix2D G, DoubleMatrix2D H) {
+      super.setParameters(G,H);
+      D = new org.apache.mahout.matrix.matrix.impl.DenseDoubleMatrix2D(A.rows(),A.columns()).assign(0.5);
+      C = D.copy();
+      B = D.copy();
+    }
+    public void init() { C.viewRow(0).assign(D.viewRow(0)); }
+    public void apply(org.apache.mahout.matrix.Timer timer) { A.zMult(B.viewRow(0),C.viewRow(0)); }
+    public double operations() { // Mflops
+      double m = A.rows();
+      double n = A.columns();
+      //double p = B.columns();
+      return 2.0*m*n / 1.0E6; 
+    }
+  };
 }
 /**
  * 2D assign with get,set
  */
 protected static Double2DProcedure funSetQuick() {
-	return new Double2DProcedure() {
-		private int current;
-		private double density;
-		public String toString() { return "xxxxxxx";	}
-		public void init() { 
-			A.assign(0);
-			int seed = 123456;
-			current = 4*seed+1;
-			density = A.cardinality() / (double) A.size();
-		}		
-		public void apply(org.apache.mahout.matrix.Timer timer) {
-			int rows=B.rows();
-			int columns=B.columns();
-			//for (int row=rows; --row >= 0; ) {
-			//	for (int column=columns; --column >= 0; ) {
-			for (int row=0; row < rows; row++) {
-				for (int column=0; column < columns; column++) {
-					// a very fast random number generator (this is an inline version of class org.apache.mahout.jet.random.engine.DRand)
-					current *= 0x278DDE6D;
-					double random = (double) (current & 0xFFFFFFFFL) * 2.3283064365386963E-10;
-					// random uniform in (0.0,1.0)
-					if (random < density) 
-						A.setQuick(row,column,random);
-					else
-						A.setQuick(row,column,0);
-				}
-			}
-		}
-	};
+  return new Double2DProcedure() {
+    private int current;
+    private double density;
+    public String toString() { return "xxxxxxx";  }
+    public void init() { 
+      A.assign(0);
+      int seed = 123456;
+      current = 4*seed+1;
+      density = A.cardinality() / (double) A.size();
+    }    
+    public void apply(org.apache.mahout.matrix.Timer timer) {
+      int rows=B.rows();
+      int columns=B.columns();
+      //for (int row=rows; --row >= 0; ) {
+      //  for (int column=columns; --column >= 0; ) {
+      for (int row=0; row < rows; row++) {
+        for (int column=0; column < columns; column++) {
+          // a very fast random number generator (this is an inline version of class org.apache.mahout.jet.random.engine.DRand)
+          current *= 0x278DDE6D;
+          double random = (double) (current & 0xFFFFFFFFL) * 2.3283064365386963E-10;
+          // random uniform in (0.0,1.0)
+          if (random < density) 
+            A.setQuick(row,column,random);
+          else
+            A.setQuick(row,column,0);
+        }
+      }
+    }
+  };
 }
 /**
  * 
  */
 protected static Double2DProcedure funSOR5() {
-	return new Double2DProcedure() {
-		double value = 2; 
-		double omega = 1.25;
-		final double alpha = omega * 0.25;
-		final double beta = 1-omega;
-		org.apache.mahout.matrix.function.Double9Function function = new org.apache.mahout.matrix.function.Double9Function() {
-			public final double apply(	
-				double a00, double a01, double a02,
-				double a10, double a11, double a12,
-				double a20, double a21, double a22) {
-				return alpha*a11 + beta*(a01+a10+a12+a21);
-			}
-		};
-		public String toString() { return "A.zAssign8Neighbors(5 point function) [Mflops/sec]";	}
-		public void init() { B.assign(D); }
-		public void apply(org.apache.mahout.matrix.Timer timer) { A.zAssign8Neighbors(B,function); }
-		public double operations() { // Mflops
-			double n = A.columns();
-			double m = A.rows();
-			return 6.0 * m*n / 1.0E6; 
-		}
-	};
+  return new Double2DProcedure() {
+    double value = 2; 
+    double omega = 1.25;
+    final double alpha = omega * 0.25;
+    final double beta = 1-omega;
+    org.apache.mahout.matrix.function.Double9Function function = new org.apache.mahout.matrix.function.Double9Function() {
+      public final double apply(  
+        double a00, double a01, double a02,
+        double a10, double a11, double a12,
+        double a20, double a21, double a22) {
+        return alpha*a11 + beta*(a01+a10+a12+a21);
+      }
+    };
+    public String toString() { return "A.zAssign8Neighbors(5 point function) [Mflops/sec]";  }
+    public void init() { B.assign(D); }
+    public void apply(org.apache.mahout.matrix.Timer timer) { A.zAssign8Neighbors(B,function); }
+    public double operations() { // Mflops
+      double n = A.columns();
+      double m = A.rows();
+      return 6.0 * m*n / 1.0E6; 
+    }
+  };
 }
 /**
  * 
  */
 protected static Double2DProcedure funSOR8() {
-	return new Double2DProcedure() {
-		double value = 2;
-		double omega = 1.25;
-		final double alpha = omega * 0.25;
-		final double beta = 1-omega;
-		org.apache.mahout.matrix.function.Double9Function function = new org.apache.mahout.matrix.function.Double9Function() {
-			public final double apply(	
-				double a00, double a01, double a02,
-				double a10, double a11, double a12,
-				double a20, double a21, double a22) {
-				return alpha*a11 + beta*(a00+a10+a20+a01+a21+a02+a12+a22);
-			}
-		};
-		public String toString() { return "A.zAssign8Neighbors(9 point function) [Mflops/sec]";	}
-		public void init() { B.assign(D); }
-		public void apply(org.apache.mahout.matrix.Timer timer) { A.zAssign8Neighbors(B,function); }
-		public double operations() { // Mflops
-			double n = A.columns();
-			double m = A.rows();
-			return 10.0 * m*n / 1.0E6; 
-		}
-	};
+  return new Double2DProcedure() {
+    double value = 2;
+    double omega = 1.25;
+    final double alpha = omega * 0.25;
+    final double beta = 1-omega;
+    org.apache.mahout.matrix.function.Double9Function function = new org.apache.mahout.matrix.function.Double9Function() {
+      public final double apply(  
+        double a00, double a01, double a02,
+        double a10, double a11, double a12,
+        double a20, double a21, double a22) {
+        return alpha*a11 + beta*(a00+a10+a20+a01+a21+a02+a12+a22);
+      }
+    };
+    public String toString() { return "A.zAssign8Neighbors(9 point function) [Mflops/sec]";  }
+    public void init() { B.assign(D); }
+    public void apply(org.apache.mahout.matrix.Timer timer) { A.zAssign8Neighbors(B,function); }
+    public double operations() { // Mflops
+      double n = A.columns();
+      double m = A.rows();
+      return 10.0 * m*n / 1.0E6; 
+    }
+  };
 }
 /**
  * 
  */
 protected static Double2DProcedure funSort() {
-	return new Double2DProcedure() { 
-		public String toString() { return "xxxxxxx";	}
-		public void init() { A.assign(C); }
-		public void apply(org.apache.mahout.matrix.Timer timer) { A.viewSorted(0); }
-	};
+  return new Double2DProcedure() { 
+    public String toString() { return "xxxxxxx";  }
+    public void init() { A.assign(C); }
+    public void apply(org.apache.mahout.matrix.Timer timer) { A.viewSorted(0); }
+  };
 }
 /**
  * Not yet documented.
  */
 protected static DoubleFactory2D getFactory(String type) {
-	DoubleFactory2D factory;
-	if (type.equals("dense")) return DoubleFactory2D.dense;
-	if (type.equals("sparse")) return DoubleFactory2D.sparse;
-	if (type.equals("rowCompressed")) return DoubleFactory2D.rowCompressed;
-	String s = "type="+type+" is unknown. Use one of {dense,sparse,rowCompressed}";
-	throw new IllegalArgumentException(s);
+  DoubleFactory2D factory;
+  if (type.equals("dense")) return DoubleFactory2D.dense;
+  if (type.equals("sparse")) return DoubleFactory2D.sparse;
+  if (type.equals("rowCompressed")) return DoubleFactory2D.rowCompressed;
+  String s = "type="+type+" is unknown. Use one of {dense,sparse,rowCompressed}";
+  throw new IllegalArgumentException(s);
 }
 /**
  * Not yet documented.
  */
 protected static Double2DProcedure getGenericFunction(String cmd) {
-	if (cmd.equals("dgemm")) return fun_dgemm(false,false);
-	else if (cmd.equals("dgemv")) return fun_dgemv(false);
-	else if (cmd.equals("pow")) return fun_pow(2);
-	else if (cmd.equals("assign")) return funAssign();
-	else if (cmd.equals("assignGetSet")) return funAssignGetSet();
-	else if (cmd.equals("assignGetSetQuick")) return funAssignGetSetQuick();
-	else if (cmd.equals("elementwiseMult")) return funElementwiseMult();
-	else if (cmd.equals("elementwiseMultB")) return funElementwiseMultB();
-	else if (cmd.equals("SOR5")) return funSOR5();
-	else if (cmd.equals("SOR8")) return funSOR8();
-	else if (cmd.equals("LUDecompose")) return funLUDecompose();
-	else if (cmd.equals("LUSolve")) return funLUSolve();
-	else if (cmd.equals("assignLog")) return funAssignLog();
-	else if (cmd.equals("assignPlusMult")) return funAssignPlusMult();
-	/*
-	else if (cmd.equals("xxxxxxxxxxxxxxxxx")) return xxxxx();
-	}
-	*/
-	return null;
+  if (cmd.equals("dgemm")) return fun_dgemm(false,false);
+  else if (cmd.equals("dgemv")) return fun_dgemv(false);
+  else if (cmd.equals("pow")) return fun_pow(2);
+  else if (cmd.equals("assign")) return funAssign();
+  else if (cmd.equals("assignGetSet")) return funAssignGetSet();
+  else if (cmd.equals("assignGetSetQuick")) return funAssignGetSetQuick();
+  else if (cmd.equals("elementwiseMult")) return funElementwiseMult();
+  else if (cmd.equals("elementwiseMultB")) return funElementwiseMultB();
+  else if (cmd.equals("SOR5")) return funSOR5();
+  else if (cmd.equals("SOR8")) return funSOR8();
+  else if (cmd.equals("LUDecompose")) return funLUDecompose();
+  else if (cmd.equals("LUSolve")) return funLUSolve();
+  else if (cmd.equals("assignLog")) return funAssignLog();
+  else if (cmd.equals("assignPlusMult")) return funAssignPlusMult();
+  /*
+  else if (cmd.equals("xxxxxxxxxxxxxxxxx")) return xxxxx();
+  }
+  */
+  return null;
 }
 /**
  * Executes a command
  */
 protected static boolean handle(String[] params) {
-	boolean success = true;
-	String cmd = params[0];
-	if (cmd.equals("dgemm")) bench_dgemm(params);
-	else if (cmd.equals("dgemv")) bench_dgemv(params);
-	else if (cmd.equals("pow")) bench_pow(params);
-	else {
-		Double2DProcedure fun = getGenericFunction(cmd);
-		if (fun!=null) {
-			benchGeneric(fun,params);
-		}
-		else {
-			success = false;
-			String s = "Command="+params[0]+" is illegal or unknown. Should be one of "+commands()+"followed by appropriate parameters.\n"+usage()+"\nIgnoring this line.\n";
-			System.out.println(s);
-		}
-	}				
-	return success;
+  boolean success = true;
+  String cmd = params[0];
+  if (cmd.equals("dgemm")) bench_dgemm(params);
+  else if (cmd.equals("dgemv")) bench_dgemv(params);
+  else if (cmd.equals("pow")) bench_pow(params);
+  else {
+    Double2DProcedure fun = getGenericFunction(cmd);
+    if (fun!=null) {
+      benchGeneric(fun,params);
+    }
+    else {
+      success = false;
+      String s = "Command="+params[0]+" is illegal or unknown. Should be one of "+commands()+"followed by appropriate parameters.\n"+usage()+"\nIgnoring this line.\n";
+      System.out.println(s);
+    }
+  }        
+  return success;
 }
 /**
  * Runs the matrix benchmark operations defined in args or in the file specified by args0.
  * To get detailed help on usage type java org.apache.mahout.matrix.matrix.bench.BenchmarkMatrix -help
  */
 public static void main(String[] args) {
-	int n = args.length;
-	if (n==0 || (n<=1 && args[0].equals("-help"))) { // overall help
-		System.out.println(usage());
-		return;
-	}
-	if (args[0].equals("-help")) { // help on specific command
-		if (commands().indexOf(args[1]) < 0) {
-			System.out.println(args[1]+": no such command available.\n"+usage());
-		}
-		else {
-			System.out.println(usage(args[1]));
-		}
-		return;
-	}
-		
-	System.out.println("Colt Matrix benchmark running on\n");
-	System.out.println(BenchmarkKernel.systemInfo()+"\n");
+  int n = args.length;
+  if (n==0 || (n<=1 && args[0].equals("-help"))) { // overall help
+    System.out.println(usage());
+    return;
+  }
+  if (args[0].equals("-help")) { // help on specific command
+    if (commands().indexOf(args[1]) < 0) {
+      System.out.println(args[1]+": no such command available.\n"+usage());
+    }
+    else {
+      System.out.println(usage(args[1]));
+    }
+    return;
+  }
+    
+  System.out.println("Colt Matrix benchmark running on\n");
+  System.out.println(BenchmarkKernel.systemInfo()+"\n");
     // TODO print out real version info?
-	System.out.println("Colt Version is [unknown - now in Mahout]" + "\n");
+  System.out.println("Colt Version is [unknown - now in Mahout]" + "\n");
 
-	org.apache.mahout.matrix.Timer timer = new org.apache.mahout.matrix.Timer().start();
-	if (!args[0].equals("-file")) { // interactive mode, commands supplied via java class args
-		System.out.println("\n\nExecuting command = "+new org.apache.mahout.matrix.list.ObjectArrayList(args)+" ...");
-		handle(args);
-	}
-	else { // batch mode, read commands from file
-		/* 
-		parse command file in args[0]
-		one command per line (including parameters)
-		for example:
-		// dgemm dense 2 2.0 false true 0.999 10 30 50 100 250 500 1000
-		dgemm dense 2 2.5 false true 0.999 10 50 
-		dgemm sparse 2 2.5 false true 0.001 500 1000  
-		*/
-		java.io.BufferedReader reader=null;
-		try {
-			reader = new java.io.BufferedReader(new java.io.FileReader(args[1]));
-		} catch (java.io.IOException exc) { throw new RuntimeException(exc.getMessage()); }
-		
-		java.io.StreamTokenizer stream = new java.io.StreamTokenizer(reader);
-		stream.eolIsSignificant(true);
-		stream.slashSlashComments(true); // allow // comments
-		stream.slashStarComments(true);  // allow /* comments */
-		try {
-			org.apache.mahout.matrix.list.ObjectArrayList words = new org.apache.mahout.matrix.list.ObjectArrayList();
-			int token;
-			while ((token = stream.nextToken()) != stream.TT_EOF) { // while not end of file
-				if (token == stream.TT_EOL) { // execute a command line at a time
-					//System.out.println(words);
-					if (words.size() > 0) { // ignore emty lines
-						String[] params = new String[words.size()];
-						for (int i=0; i<words.size(); i++) params[i] = (String) words.get(i);
+  org.apache.mahout.matrix.Timer timer = new org.apache.mahout.matrix.Timer().start();
+  if (!args[0].equals("-file")) { // interactive mode, commands supplied via java class args
+    System.out.println("\n\nExecuting command = "+new org.apache.mahout.matrix.list.ObjectArrayList(args)+" ...");
+    handle(args);
+  }
+  else { // batch mode, read commands from file
+    /* 
+    parse command file in args[0]
+    one command per line (including parameters)
+    for example:
+    // dgemm dense 2 2.0 false true 0.999 10 30 50 100 250 500 1000
+    dgemm dense 2 2.5 false true 0.999 10 50 
+    dgemm sparse 2 2.5 false true 0.001 500 1000  
+    */
+    java.io.BufferedReader reader=null;
+    try {
+      reader = new java.io.BufferedReader(new java.io.FileReader(args[1]));
+    } catch (java.io.IOException exc) { throw new RuntimeException(exc.getMessage()); }
+    
+    java.io.StreamTokenizer stream = new java.io.StreamTokenizer(reader);
+    stream.eolIsSignificant(true);
+    stream.slashSlashComments(true); // allow // comments
+    stream.slashStarComments(true);  // allow /* comments */
+    try {
+      org.apache.mahout.matrix.list.ObjectArrayList words = new org.apache.mahout.matrix.list.ObjectArrayList();
+      int token;
+      while ((token = stream.nextToken()) != stream.TT_EOF) { // while not end of file
+        if (token == stream.TT_EOL) { // execute a command line at a time
+          //System.out.println(words);
+          if (words.size() > 0) { // ignore emty lines
+            String[] params = new String[words.size()];
+            for (int i=0; i<words.size(); i++) params[i] = (String) words.get(i);
 
-						// execute command
-						System.out.println("\n\nExecuting command = "+words+" ...");
-						handle(params);
-					}
-					words.clear();
-				}
-				else {
-					String word;
-					org.apache.mahout.matrix.matrix.impl.Former formatter = new org.apache.mahout.matrix.matrix.impl.FormerFactory().create("%G");
-					// ok: 2.0 -> 2   wrong: 2.0 -> 2.0 (kills Integer.parseInt())
-					if (token == stream.TT_NUMBER) 
-						word = formatter.form(stream.nval);
-					else 
-						word = stream.sval;
-					if (word != null) words.add(word);
-				}
-			}
-			reader.close();
+            // execute command
+            System.out.println("\n\nExecuting command = "+words+" ...");
+            handle(params);
+          }
+          words.clear();
+        }
+        else {
+          String word;
+          org.apache.mahout.matrix.matrix.impl.Former formatter = new org.apache.mahout.matrix.matrix.impl.FormerFactory().create("%G");
+          // ok: 2.0 -> 2   wrong: 2.0 -> 2.0 (kills Integer.parseInt())
+          if (token == stream.TT_NUMBER) 
+            word = formatter.form(stream.nval);
+          else 
+            word = stream.sval;
+          if (word != null) words.add(word);
+        }
+      }
+      reader.close();
 
-			System.out.println("\nCommand file name used: "+args[1]+ "\nTo reproduce and compare results, here it's contents:");
-			try {
-				reader = new java.io.BufferedReader(new java.io.FileReader(args[1]));
-			} catch (java.io.IOException exc) { throw new RuntimeException(exc.getMessage()); }
+      System.out.println("\nCommand file name used: "+args[1]+ "\nTo reproduce and compare results, here it's contents:");
+      try {
+        reader = new java.io.BufferedReader(new java.io.FileReader(args[1]));
+      } catch (java.io.IOException exc) { throw new RuntimeException(exc.getMessage()); }
 
-			/*java.io.InputStream input = new java.io.DataInputStream(new java.io.BufferedInputStream(new java.io.FileInputStream(args[1])));
-			BufferedReader d
-						   = new BufferedReader(new InputStreamReader(in));
-						   */
-			String line;
-			while ((line = reader.readLine()) != null) { // while not end of file
-				System.out.println(line);
-			}
-			reader.close();
-			
-		} catch (java.io.IOException exc) { throw new RuntimeException(exc.getMessage()); }
-	}
-	
-	System.out.println("\nProgram execution took a total of "+timer.minutes() +" minutes.");
-	System.out.println("Good bye.");
+      /*java.io.InputStream input = new java.io.DataInputStream(new java.io.BufferedInputStream(new java.io.FileInputStream(args[1])));
+      BufferedReader d
+               = new BufferedReader(new InputStreamReader(in));
+               */
+      String line;
+      while ((line = reader.readLine()) != null) { // while not end of file
+        System.out.println(line);
+      }
+      reader.close();
+      
+    } catch (java.io.IOException exc) { throw new RuntimeException(exc.getMessage()); }
+  }
+  
+  System.out.println("\nProgram execution took a total of "+timer.minutes() +" minutes.");
+  System.out.println("Good bye.");
 }
 /**
  * Executes procedure repeatadly until more than minSeconds have elapsed.
  */
 protected static void run(double minSeconds, String title, Double2DProcedure function, String[] types, int[] sizes, double[] densities) {
-	//int[] sizes = {33,500,1000};
-	//double[] densities = {0.001,0.01,0.99};
-	
-	//int[] sizes = {3,5,7,9,30,45,60,61,100,200,300,500,800,1000};
-	//double[] densities = {0.001,0.01,0.1,0.999};
-	
-	//int[] sizes = {3};
-	//double[] densities = {0.1};
+  //int[] sizes = {33,500,1000};
+  //double[] densities = {0.001,0.01,0.99};
+  
+  //int[] sizes = {3,5,7,9,30,45,60,61,100,200,300,500,800,1000};
+  //double[] densities = {0.001,0.01,0.1,0.999};
+  
+  //int[] sizes = {3};
+  //double[] densities = {0.1};
 
-	DoubleMatrix3D timings = DoubleFactory3D.dense.make(types.length,sizes.length,densities.length);
-	org.apache.mahout.matrix.Timer runTime = new org.apache.mahout.matrix.Timer().start();
-	for (int k=0; k<types.length; k++) {
-		//DoubleFactory2D factory = (k==0 ? DoubleFactory2D.dense : k==1 ? DoubleFactory2D.sparse : DoubleFactory2D.rowCompressed);
-		//DoubleFactory2D factory = (k==0 ? DoubleFactory2D.dense : k==1 ? DoubleFactory2D.sparse : k==2 ? DoubleFactory2D.rowCompressed : DoubleFactory2D.rowCompressedModified);
-		DoubleFactory2D factory = getFactory(types[k]);
-		System.out.print("\n@"); 
+  DoubleMatrix3D timings = DoubleFactory3D.dense.make(types.length,sizes.length,densities.length);
+  org.apache.mahout.matrix.Timer runTime = new org.apache.mahout.matrix.Timer().start();
+  for (int k=0; k<types.length; k++) {
+    //DoubleFactory2D factory = (k==0 ? DoubleFactory2D.dense : k==1 ? DoubleFactory2D.sparse : DoubleFactory2D.rowCompressed);
+    //DoubleFactory2D factory = (k==0 ? DoubleFactory2D.dense : k==1 ? DoubleFactory2D.sparse : k==2 ? DoubleFactory2D.rowCompressed : DoubleFactory2D.rowCompressedModified);
+    DoubleFactory2D factory = getFactory(types[k]);
+    System.out.print("\n@"); 
 
-		for (int i=0; i<sizes.length; i++) {
-			int size = sizes[i];
-			System.out.print("x");
-			//System.out.println("doing size="+size+"...");
+    for (int i=0; i<sizes.length; i++) {
+      int size = sizes[i];
+      System.out.print("x");
+      //System.out.println("doing size="+size+"...");
 
-			for (int j=0; j<densities.length; j++) {
-				final double density = densities[j];
-				System.out.print(".");
-				//System.out.println("   doing density="+density+"...");
-				float opsPerSec;
+      for (int j=0; j<densities.length; j++) {
+        final double density = densities[j];
+        System.out.print(".");
+        //System.out.println("   doing density="+density+"...");
+        float opsPerSec;
 
-				//if (true) {
-				//if (!((k==1 && density >= 0.1 && size >=100) || (size>5000 && (k==0 || density>1.0E-4) ))) {
-				if (!((k>0 && density >= 0.1 && size >=500) )) {
-					double val = 0.5;
-					function.A=null; function.B=null; function.C=null; function.D=null; // --> help gc before allocating new mem
-					DoubleMatrix2D A = factory.sample(size,size,val,density);
-					DoubleMatrix2D B = factory.sample(size,size,val,density);
-					function.setParameters(A,B);
-					A = null; B = null; // help gc
-					double ops = function.operations();
-					double secs = BenchmarkKernel.run(minSeconds,function);
-					opsPerSec = (float) (ops / secs);
-				}
-				else { // skip this parameter combination (not used in practice & would take a lot of memory and time)
-					opsPerSec = Float.NaN;
-				}
-				timings.set(k,i,j,opsPerSec);
-				//System.out.println(secs);
-				//System.out.println(opsPerSec+" Mops/sec\n");
-			}
-		}
-	}
-	runTime.stop();
-	
-	String sliceAxisName = "type";
-	String rowAxisName = "size"; 
-	String colAxisName = "d"; //"density";
-	//String[] sliceNames = {"dense", "sparse"};
-	//String[] sliceNames = {"dense", "sparse", "rowCompressed"};
-	String[] sliceNames = types;
-	//hep.aida.bin.BinFunctions1D F = hep.aida.bin.BinFunctions1D.functions;
-	//hep.aida.bin.BinFunction1D[] aggr = null; //{F.mean, F.median, F.sum};
-	String[] rowNames = new String[sizes.length];
-	String[] colNames = new String[densities.length];
-	for (int i=sizes.length; --i >= 0; ) rowNames[i]=Integer.toString(sizes[i]);
-	for (int j=densities.length; --j >= 0; ) colNames[j]=Double.toString(densities[j]);
-	System.out.println("*");
-	// show transposed
-	String tmp = rowAxisName; rowAxisName = colAxisName; colAxisName = tmp;
-	String[] tmp2 = rowNames; rowNames = colNames; colNames = tmp2;
-	timings = timings.viewDice(0,2,1);
-	//System.out.println(new org.apache.mahout.matrix.matrix.doublealgo.Formatter("%1.3G").toTitleString(timings,sliceNames,rowNames,colNames,sliceAxisName,rowAxisName,colAxisName,"Performance of "+title,aggr));
-	/*
-	title = "Speedup of dense over sparse";
-	DoubleMatrix2D speedup = org.apache.mahout.matrix.matrix.doublealgo.Transform.div(timings.viewSlice(0).copy(),timings.viewSlice(1));
-	System.out.println("\n"+new org.apache.mahout.matrix.matrix.doublealgo.Formatter("%1.3G").toTitleString(speedup,rowNames,colNames,rowAxisName,colAxisName,title,aggr));
-	*/
-	System.out.println("Run took a total of "+runTime+". End of run.");
+        //if (true) {
+        //if (!((k==1 && density >= 0.1 && size >=100) || (size>5000 && (k==0 || density>1.0E-4) ))) {
+        if (!((k>0 && density >= 0.1 && size >=500) )) {
+          double val = 0.5;
+          function.A=null; function.B=null; function.C=null; function.D=null; // --> help gc before allocating new mem
+          DoubleMatrix2D A = factory.sample(size,size,val,density);
+          DoubleMatrix2D B = factory.sample(size,size,val,density);
+          function.setParameters(A,B);
+          A = null; B = null; // help gc
+          double ops = function.operations();
+          double secs = BenchmarkKernel.run(minSeconds,function);
+          opsPerSec = (float) (ops / secs);
+        }
+        else { // skip this parameter combination (not used in practice & would take a lot of memory and time)
+          opsPerSec = Float.NaN;
+        }
+        timings.set(k,i,j,opsPerSec);
+        //System.out.println(secs);
+        //System.out.println(opsPerSec+" Mops/sec\n");
+      }
+    }
+  }
+  runTime.stop();
+  
+  String sliceAxisName = "type";
+  String rowAxisName = "size"; 
+  String colAxisName = "d"; //"density";
+  //String[] sliceNames = {"dense", "sparse"};
+  //String[] sliceNames = {"dense", "sparse", "rowCompressed"};
+  String[] sliceNames = types;
+  //hep.aida.bin.BinFunctions1D F = hep.aida.bin.BinFunctions1D.functions;
+  //hep.aida.bin.BinFunction1D[] aggr = null; //{F.mean, F.median, F.sum};
+  String[] rowNames = new String[sizes.length];
+  String[] colNames = new String[densities.length];
+  for (int i=sizes.length; --i >= 0; ) rowNames[i]=Integer.toString(sizes[i]);
+  for (int j=densities.length; --j >= 0; ) colNames[j]=Double.toString(densities[j]);
+  System.out.println("*");
+  // show transposed
+  String tmp = rowAxisName; rowAxisName = colAxisName; colAxisName = tmp;
+  String[] tmp2 = rowNames; rowNames = colNames; colNames = tmp2;
+  timings = timings.viewDice(0,2,1);
+  //System.out.println(new org.apache.mahout.matrix.matrix.doublealgo.Formatter("%1.3G").toTitleString(timings,sliceNames,rowNames,colNames,sliceAxisName,rowAxisName,colAxisName,"Performance of "+title,aggr));
+  /*
+  title = "Speedup of dense over sparse";
+  DoubleMatrix2D speedup = org.apache.mahout.matrix.matrix.doublealgo.Transform.div(timings.viewSlice(0).copy(),timings.viewSlice(1));
+  System.out.println("\n"+new org.apache.mahout.matrix.matrix.doublealgo.Formatter("%1.3G").toTitleString(speedup,rowNames,colNames,rowAxisName,colAxisName,title,aggr));
+  */
+  System.out.println("Run took a total of "+runTime+". End of run.");
 }
 /**
  * Executes procedure repeatadly until more than minSeconds have elapsed.
  */
 protected static void runSpecial(double minSeconds, String title, Double2DProcedure function) {
-	int[] sizes =        {10000};
-	double[] densities = {0.00001};
-	boolean[] sparses  = {true};
-	
-	DoubleMatrix2D timings = DoubleFactory2D.dense.make(sizes.length,4);
-	org.apache.mahout.matrix.Timer runTime = new org.apache.mahout.matrix.Timer().start();
-	for (int i=0; i<sizes.length; i++) {
-		int size = sizes[i];
-		double density = densities[i];
-		boolean sparse = sparses[i];
-		final DoubleFactory2D factory = (sparse ? DoubleFactory2D.sparse : DoubleFactory2D.dense);
-		System.out.print("\n@"); 
+  int[] sizes =        {10000};
+  double[] densities = {0.00001};
+  boolean[] sparses  = {true};
+  
+  DoubleMatrix2D timings = DoubleFactory2D.dense.make(sizes.length,4);
+  org.apache.mahout.matrix.Timer runTime = new org.apache.mahout.matrix.Timer().start();
+  for (int i=0; i<sizes.length; i++) {
+    int size = sizes[i];
+    double density = densities[i];
+    boolean sparse = sparses[i];
+    final DoubleFactory2D factory = (sparse ? DoubleFactory2D.sparse : DoubleFactory2D.dense);
+    System.out.print("\n@"); 
 
-		System.out.print("x");
-		double val = 0.5;
-		function.A=null; function.B=null; function.C=null; function.D=null; // --> help gc before allocating new mem
-		DoubleMatrix2D A = factory.sample(size,size,val,density);
-		DoubleMatrix2D B = factory.sample(size,size,val,density);
-		function.setParameters(A,B);
-		A = null; B = null; // help gc
-		float secs = BenchmarkKernel.run(minSeconds,function);
-		double ops = function.operations();
-		float opsPerSec = (float) (ops / secs);
-		timings.viewRow(i).set(0,sparse ? 0: 1);
-		timings.viewRow(i).set(1,size);
-		timings.viewRow(i).set(2,density);
-		timings.viewRow(i).set(3,opsPerSec);
-		//System.out.println(secs);
-		//System.out.println(opsPerSec+" Mops/sec\n");
-	}
-	runTime.stop();
-	
-	//hep.aida.bin.BinFunctions1D F = hep.aida.bin.BinFunctions1D.functions;
-	//hep.aida.bin.BinFunction1D[] aggr = null; //{F.mean, F.median, F.sum};
-	String[] rowNames = null;
-	String[] colNames = {"dense (y=1,n=0)", "size", "density", "flops/sec"};
-	String rowAxisName = null;
-	String colAxisName = null;
-	System.out.println("*");
-	//System.out.println(new org.apache.mahout.matrix.matrix.doublealgo.Formatter("%1.3G").toTitleString(timings,rowNames,colNames,rowAxisName,colAxisName,title,aggr));
+    System.out.print("x");
+    double val = 0.5;
+    function.A=null; function.B=null; function.C=null; function.D=null; // --> help gc before allocating new mem
+    DoubleMatrix2D A = factory.sample(size,size,val,density);
+    DoubleMatrix2D B = factory.sample(size,size,val,density);
+    function.setParameters(A,B);
+    A = null; B = null; // help gc
+    float secs = BenchmarkKernel.run(minSeconds,function);
+    double ops = function.operations();
+    float opsPerSec = (float) (ops / secs);
+    timings.viewRow(i).set(0,sparse ? 0: 1);
+    timings.viewRow(i).set(1,size);
+    timings.viewRow(i).set(2,density);
+    timings.viewRow(i).set(3,opsPerSec);
+    //System.out.println(secs);
+    //System.out.println(opsPerSec+" Mops/sec\n");
+  }
+  runTime.stop();
+  
+  //hep.aida.bin.BinFunctions1D F = hep.aida.bin.BinFunctions1D.functions;
+  //hep.aida.bin.BinFunction1D[] aggr = null; //{F.mean, F.median, F.sum};
+  String[] rowNames = null;
+  String[] colNames = {"dense (y=1,n=0)", "size", "density", "flops/sec"};
+  String rowAxisName = null;
+  String colAxisName = null;
+  System.out.println("*");
+  //System.out.println(new org.apache.mahout.matrix.matrix.doublealgo.Formatter("%1.3G").toTitleString(timings,rowNames,colNames,rowAxisName,colAxisName,title,aggr));
 
-	System.out.println("Run took a total of "+runTime+". End of run.");
+  System.out.println("Run took a total of "+runTime+". End of run.");
 }
 /**
  * Overall usage.
  */
 protected static String usage() {
-	String usage = 
+  String usage = 
 "\nUsage (help): To get this help, type java org.apache.mahout.matrix.matrix.bench.BenchmarkMatrix -help\n"+
 "To get help on a command's args, omit args and type java org.apache.mahout.matrix.matrix.bench.BenchmarkMatrix -help <command>\n" +
 "Available commands: "+commands()+"\n\n"+
@@ -912,34 +912,34 @@
 "dgemv rowCompressed 1 2.0 0.001 false 5 10 25 50 100 250 500 1000\n"+
 "*/\n"+
 "// more comments ignored\n";
-	return usage;
+  return usage;
 }
 /**
  * Usage of a specific command.
  */
 protected static String usage(String cmd) {
-	String usage = cmd + " description: " + getGenericFunction(cmd).toString() +
-	"\nArguments to be supplied:\n" +
-	//String usage = "Illegal arguments! Arguments to be supplied:\n" +
-		//"\te.g. "+cmd+" dense 2 2.0 false 0.999 10 30 50 100 250 500 1000\n"+
-		"\t<operation> <type> <cpus> <minSecs> <density>";
-	if (cmd.equals("dgemv")) usage = usage +	" <transposeA>";
-	if (cmd.equals("dgemm")) usage = usage +	" <transposeA> <transposeB>";
-	if (cmd.equals("pow")) usage = usage +	" <exponent>";
-	usage = usage +
-		" {sizes}\n" +
-		"where\n" +
-		"\toperation = the operation to benchmark; in this case: "+cmd+"\n"+
-		"\ttype = matrix type to be used; e.g. dense, sparse or rowCompressed\n"+
-		"\tcpus = #cpus available; e.g. 1 or 2 or ...\n"+
-		"\tminSecs = #seconds each operation shall at least run; e.g. 2.0 is a good number giving realistic timings\n"+
-		"\tdensity = the density of the matrices to be benchmarked; e.g. 0.999 is very dense, 0.001 is very sparse\n";
-		
-	if (cmd.equals("dgemv")) usage = usage +	"\ttransposeA = false or true\n";
-	if (cmd.equals("dgemm")) usage = usage +	"\ttransposeA = false or true\n\ttransposeB = false or true\n";
-	if (cmd.equals("pow")) usage = usage +	"\texponent = the number of times to multiply; e.g. 1000\n";
-	usage = usage +
-		"\tsizes = a list of problem sizes; e.g. 100 200 benchmarks squared 100x100 and 200x200 matrices";
-	return usage;
+  String usage = cmd + " description: " + getGenericFunction(cmd).toString() +
+  "\nArguments to be supplied:\n" +
+  //String usage = "Illegal arguments! Arguments to be supplied:\n" +
+    //"\te.g. "+cmd+" dense 2 2.0 false 0.999 10 30 50 100 250 500 1000\n"+
+    "\t<operation> <type> <cpus> <minSecs> <density>";
+  if (cmd.equals("dgemv")) usage = usage +  " <transposeA>";
+  if (cmd.equals("dgemm")) usage = usage +  " <transposeA> <transposeB>";
+  if (cmd.equals("pow")) usage = usage +  " <exponent>";
+  usage = usage +
+    " {sizes}\n" +
+    "where\n" +
+    "\toperation = the operation to benchmark; in this case: "+cmd+"\n"+
+    "\ttype = matrix type to be used; e.g. dense, sparse or rowCompressed\n"+
+    "\tcpus = #cpus available; e.g. 1 or 2 or ...\n"+
+    "\tminSecs = #seconds each operation shall at least run; e.g. 2.0 is a good number giving realistic timings\n"+
+    "\tdensity = the density of the matrices to be benchmarked; e.g. 0.999 is very dense, 0.001 is very sparse\n";
+    
+  if (cmd.equals("dgemv")) usage = usage +  "\ttransposeA = false or true\n";
+  if (cmd.equals("dgemm")) usage = usage +  "\ttransposeA = false or true\n\ttransposeB = false or true\n";
+  if (cmd.equals("pow")) usage = usage +  "\texponent = the number of times to multiply; e.g. 1000\n";
+  usage = usage +
+    "\tsizes = a list of problem sizes; e.g. 100 200 benchmarks squared 100x100 and 200x200 matrices";
+  return usage;
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/bench/Double2DProcedure.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/bench/Double2DProcedure.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/bench/Double2DProcedure.java	(working copy)
@@ -11,23 +11,23 @@
 import org.apache.mahout.matrix.matrix.DoubleMatrix2D;
 
 abstract class Double2DProcedure implements TimerProcedure {
-	public DoubleMatrix2D A;
-	public DoubleMatrix2D B;
-	public DoubleMatrix2D C;
-	public DoubleMatrix2D D;
+  public DoubleMatrix2D A;
+  public DoubleMatrix2D B;
+  public DoubleMatrix2D C;
+  public DoubleMatrix2D D;
 /**
  * The number of operations a single call to "apply" involves.
  */
 public double operations() {
-	return A.rows()*A.columns() / 1.0E6;
+  return A.rows()*A.columns() / 1.0E6;
 }
 /**
  * Sets the matrices to operate upon.
  */
 public void setParameters(DoubleMatrix2D A, DoubleMatrix2D B) {
-	this.A=A;
-	this.B=B;
-	this.C=A.copy();
-	this.D=B.copy();
+  this.A=A;
+  this.B=B;
+  this.C=A.copy();
+  this.D=B.copy();
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/bench/BenchmarkKernel.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/bench/BenchmarkKernel.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/bench/BenchmarkKernel.java	(working copy)
@@ -11,8 +11,6 @@
 /**
  * Not yet documented.
  * 
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 10-Nov-99
  */
 class BenchmarkKernel {
 /**
@@ -23,79 +21,79 @@
  * Executes procedure repeatadly until more than minSeconds have elapsed.
  */
 public static float run(double minSeconds, TimerProcedure procedure) {
-	long iter=0;
-	long minMillis = (long) (minSeconds * 1000);
-	long begin=System.currentTimeMillis();
-	long limit = begin + minMillis;
-	while (System.currentTimeMillis() < limit) {
-		procedure.init();
-		procedure.apply(null);
-		iter++;
-	}
-	long end = System.currentTimeMillis();
-	if (minSeconds/iter < 0.1) { 
-		// unreliable timing due to very fast iteration;
-		// reading, starting and stopping timer distorts measurement
-		// do it again with minimal timer overhead
-		//System.out.println("iter="+iter+", minSeconds/iter="+minSeconds/iter);
-		begin=System.currentTimeMillis();
-		for (long i=iter; --i >= 0; ) {
-			procedure.init();
-			procedure.apply(null);
-		}
-		end = System.currentTimeMillis();
-	}
+  long iter=0;
+  long minMillis = (long) (minSeconds * 1000);
+  long begin=System.currentTimeMillis();
+  long limit = begin + minMillis;
+  while (System.currentTimeMillis() < limit) {
+    procedure.init();
+    procedure.apply(null);
+    iter++;
+  }
+  long end = System.currentTimeMillis();
+  if (minSeconds/iter < 0.1) { 
+    // unreliable timing due to very fast iteration;
+    // reading, starting and stopping timer distorts measurement
+    // do it again with minimal timer overhead
+    //System.out.println("iter="+iter+", minSeconds/iter="+minSeconds/iter);
+    begin=System.currentTimeMillis();
+    for (long i=iter; --i >= 0; ) {
+      procedure.init();
+      procedure.apply(null);
+    }
+    end = System.currentTimeMillis();
+  }
 
-	long begin2 = System.currentTimeMillis();
-	int dummy=1; // prevent compiler from optimizing away the loop
-	for (long i=iter; --i >= 0; ) {
-		dummy *= i;
-		procedure.init();
-	}
-	long end2 = System.currentTimeMillis();
-	long elapsed = (end-begin) - (end2-begin2);
-	//if (dummy != 0) throw new RuntimeException("dummy != 0");
-	
-	return (float) elapsed/1000.0f / iter;
+  long begin2 = System.currentTimeMillis();
+  int dummy=1; // prevent compiler from optimizing away the loop
+  for (long i=iter; --i >= 0; ) {
+    dummy *= i;
+    procedure.init();
+  }
+  long end2 = System.currentTimeMillis();
+  long elapsed = (end-begin) - (end2-begin2);
+  //if (dummy != 0) throw new RuntimeException("dummy != 0");
+  
+  return (float) elapsed/1000.0f / iter;
 }
 /**
  * Returns a String with the system's properties (vendor, version, operating system, etc.)
  */
 public static String systemInfo() {
-	String[] properties = {
-		"java.vm.vendor",
-		"java.vm.version",
-		"java.vm.name",
-		"os.name",
-		"os.version",
-		"os.arch",
-		"java.version",
-		"java.vendor",
-		"java.vendor.url"
-		/*
-		"java.vm.specification.version",
-		"java.vm.specification.vendor",
-		"java.vm.specification.name",
-		"java.specification.version",
-		"java.specification.vendor",
-		"java.specification.name"
-		*/
-	};
+  String[] properties = {
+    "java.vm.vendor",
+    "java.vm.version",
+    "java.vm.name",
+    "os.name",
+    "os.version",
+    "os.arch",
+    "java.version",
+    "java.vendor",
+    "java.vendor.url"
+    /*
+    "java.vm.specification.version",
+    "java.vm.specification.vendor",
+    "java.vm.specification.name",
+    "java.specification.version",
+    "java.specification.vendor",
+    "java.specification.name"
+    */
+  };
 
-	// build string matrix
-	org.apache.mahout.matrix.matrix.ObjectMatrix2D matrix = new org.apache.mahout.matrix.matrix.impl.DenseObjectMatrix2D(properties.length,2);
-	matrix.viewColumn(0).assign(properties);
+  // build string matrix
+  org.apache.mahout.matrix.matrix.ObjectMatrix2D matrix = new org.apache.mahout.matrix.matrix.impl.DenseObjectMatrix2D(properties.length,2);
+  matrix.viewColumn(0).assign(properties);
 
-	// retrieve property values
-	for (int i=0; i<properties.length; i++) {
-		String value = System.getProperty(properties[i]);
-		if (value==null) value = "?"; // prop not available
-		matrix.set(i,1,value);
-	}
+  // retrieve property values
+  for (int i=0; i<properties.length; i++) {
+    String value = System.getProperty(properties[i]);
+    if (value==null) value = "?"; // prop not available
+    matrix.set(i,1,value);
+  }
 
-	// format matrix
-	org.apache.mahout.matrix.matrix.objectalgo.Formatter formatter = new org.apache.mahout.matrix.matrix.objectalgo.Formatter();
-	formatter.setPrintShape(false);
-	return formatter.toString(matrix);
+  // format matrix
+  org.apache.mahout.matrix.matrix.objectalgo.Formatter formatter = new org.apache.mahout.matrix.matrix.objectalgo.Formatter();
+  formatter.setPrintShape(false);
+  return formatter.toString(matrix);
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/package.html
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/package.html	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/package.html	(working copy)
@@ -464,7 +464,7 @@
   <td>
     <p>Note that the result of a slicing operation is not a 2-d matrix with
       one row, but a true 1-d <b>type</b> with all capabilities of the type,
-      namely {@link cern.colt.matrix.DoubleMatrix1D}, generated in constant
+      namely {@link org.apache.mahout.matrix.matrix.DoubleMatrix1D}, generated in constant
       time.</p>
 
     <p>The slicing view is now fed into some external algorithm expecting a
@@ -561,9 +561,9 @@
   adhere to some common interface.</p>
 
 <p>The common interface for matrices is defined in abstract base classes (e.g.
-  {@link cern.colt.matrix.DoubleMatrix2D}). Note that looking at the documentation
-  of some concrete instantiable class (e.g. {@link cern.colt.matrix.impl.DenseDoubleMatrix2D},
-  {@link cern.colt.matrix.impl.SparseDoubleMatrix2D}, {@link cern.colt.matrix.impl.RCDoubleMatrix2D}<img
+  {@link org.apache.mahout.matrix.matrix.DoubleMatrix2D}). Note that looking at the documentation
+  of some concrete instantiable class (e.g. {@link org.apache.mahout.matrix.matrix.impl.DenseDoubleMatrix2D},
+  {@link org.apache.mahout.matrix.matrix.impl.SparseDoubleMatrix2D}, {@link org.apache.mahout.matrix.matrix.impl.RCDoubleMatrix2D}<img
           src="../doc-files/new.gif" width="32" height="22" align="top">)
   will not reveal more information than can be obtained by looking at the abstract
   base classes. The convention is that concrete classes <i>do no subsetting or
@@ -638,7 +638,7 @@
   over time, as more and more features are added. </p>
 
 <p>Some algorithms for formatting, sorting, statistics and partitioning, are,
-  for example, provided in the package {@link cern.colt.matrix.doublealgo}. </p>
+  for example, provided in the package {@link org.apache.mahout.matrix.matrix.doublealgo}. </p>
 
 <p><a href="#Overview">Back</a> to Overview</p>
 
@@ -646,7 +646,7 @@
 
 <h2><a name="LinearAlgebra"></a>7. Linear Algebra</h2>
 
-<p>See the documentation of the linear algebra package {@link cern.colt.matrix.linalg}.</p>
+<p>See the documentation of the linear algebra package {@link org.apache.mahout.matrix.matrix.linalg}.</p>
 
 <p><a href="#Overview">Back</a> to Overview </p>
 
@@ -659,20 +659,20 @@
   a common abstract base class named <tt>&lt;ValueType&gt;Matrix&lt;Rank&gt;D</tt>,
   which is in many ways equivalent to an &quot;interface&quot;. <b>99% of the
     time you will operate on these abstract classes only</b>. For example, all 2-dimensional
-  matrices operating on <tt>double</tt> values are derived from {@link cern.colt.matrix.DoubleMatrix2D}.
+  matrices operating on <tt>double</tt> values are derived from {@link org.apache.mahout.matrix.matrix.DoubleMatrix2D}.
   This is the interface to operate on.</p>
 
 <p>Class naming for concrete instantiable classes follows the schema <tt>&lt;Property&gt;&lt;ValueType&gt;Matrix&lt;Rank&gt;D</tt>.
-  For example, we have a {@link cern.colt.matrix.impl.DenseDoubleMatrix2D}, a
-  {@link cern.colt.matrix.impl.SparseDoubleMatrix2D}, a {@link cern.colt.matrix.impl.DenseIntMatrix3D},
+  For example, we have a {@link org.apache.mahout.matrix.matrix.impl.DenseDoubleMatrix2D}, a
+  {@link org.apache.mahout.matrix.matrix.impl.SparseDoubleMatrix2D}, a {@link org.apache.mahout.matrix.matrix.impl.DenseIntMatrix3D},
   and so on. All concrete instantiable classes are separated into an extra package,
-  {@link cern.colt.matrix.impl}, to clearly distinguish between interfaces and
+  {@link org.apache.mahout.matrix.matrix.impl}, to clearly distinguish between interfaces and
   implementations.</p>
 
-<p>{@link cern.colt.matrix.DoubleMatrix2D} in turn is derived from an abstract
+<p>{@link org.apache.mahout.matrix.matrix.DoubleMatrix2D} in turn is derived from an abstract
   base class tying together all 2-dimensional matrices regardless of value type,
-  {@link cern.colt.matrix.impl.AbstractMatrix2D}, which finally is rooted in grandmother
-  {@link cern.colt.matrix.impl.AbstractMatrix}.</p>
+  {@link org.apache.mahout.matrix.matrix.impl.AbstractMatrix2D}, which finally is rooted in grandmother
+  {@link org.apache.mahout.matrix.matrix.impl.AbstractMatrix}.</p>
 
 <p>The abstract base classes provide skeleton implementations for all but few
   methods. Experimental data layouts can easily be implemented and inherit a rich
@@ -697,7 +697,7 @@
   no methods to fill results into empty result matrices. Use idioms like <tt>result
     = matrix.copy().mult(5)</tt> to achieve the same functionality. Some convenience
   methods are provided in the factory classes as well as in external packages
-  like {@link cern.colt.matrix.doublealgo}.</p>
+  like {@link org.apache.mahout.matrix.matrix.doublealgo}.</p>
 
 <p><a href="#Overview">Back</a> to Overview
 
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/ObjectMatrix1D.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/ObjectMatrix1D.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/ObjectMatrix1D.java	(working copy)
@@ -52,12 +52,12 @@
 @return the aggregated measure.
 */
 public Object aggregate(org.apache.mahout.matrix.function.ObjectObjectFunction aggr, org.apache.mahout.matrix.function.ObjectFunction f) {
-	if (size==0) return null;
-	Object a = f.apply(getQuick(size-1));
-	for (int i=size-1; --i >= 0; ) {
-		a = aggr.apply(a, f.apply(getQuick(i)));
-	}
-	return a;
+  if (size==0) return null;
+  Object a = f.apply(getQuick(size-1));
+  for (int i=size-1; --i >= 0; ) {
+    a = aggr.apply(a, f.apply(getQuick(i)));
+  }
+  return a;
 }
 /**
 Applies a function to each corresponding cell of two matrices and aggregates the results.
@@ -82,16 +82,16 @@
 @param aggr an aggregation function taking as first argument the current aggregation and as second argument the transformed current cell values.
 @param f a function transforming the current cell values.
 @return the aggregated measure.
-@throws	IllegalArgumentException if <tt>size() != other.size()</tt>.
+@throws  IllegalArgumentException if <tt>size() != other.size()</tt>.
 */
 public Object aggregate(ObjectMatrix1D other, org.apache.mahout.matrix.function.ObjectObjectFunction aggr, org.apache.mahout.matrix.function.ObjectObjectFunction f) {
-	checkSize(other);
-	if (size==0) return null;
-	Object a = f.apply(getQuick(size-1),other.getQuick(size-1));
-	for (int i=size-1; --i >= 0; ) {
-		a = aggr.apply(a, f.apply(getQuick(i),other.getQuick(i)));
-	}
-	return a;
+  checkSize(other);
+  if (size==0) return null;
+  Object a = f.apply(getQuick(size-1),other.getQuick(size-1));
+  for (int i=size-1; --i >= 0; ) {
+    a = aggr.apply(a, f.apply(getQuick(i),other.getQuick(i)));
+  }
+  return a;
 }
 /**
  * Sets all cells to the state specified by <tt>values</tt>.
@@ -104,11 +104,11 @@
  * @throws IllegalArgumentException if <tt>values.length != size()</tt>.
  */
 public ObjectMatrix1D assign(Object[] values) {
-	if (values.length != size) throw new IllegalArgumentException("Must have same number of cells: length="+values.length+", size()="+size());
-	for (int i=size; --i >= 0;) {
-		setQuick(i,values[i]);
-	}
-	return this;
+  if (values.length != size) throw new IllegalArgumentException("Must have same number of cells: length="+values.length+", size()="+size());
+  for (int i=size; --i >= 0;) {
+    setQuick(i,values[i]);
+  }
+  return this;
 }
 /**
 Assigns the result of a function to each cell; <tt>x[i] = function(x[i])</tt>.
@@ -129,10 +129,10 @@
 @see org.apache.mahout.jet.math.Functions
 */
 public ObjectMatrix1D assign(org.apache.mahout.matrix.function.ObjectFunction function) {
-	for (int i=size; --i >= 0; ) {
-		setQuick(i, function.apply(getQuick(i)));
-	}
-	return this;
+  for (int i=size; --i >= 0; ) {
+    setQuick(i, function.apply(getQuick(i)));
+  }
+  return this;
 }
 /**
  * Replaces all cell values of the receiver with the values of another matrix.
@@ -141,17 +141,17 @@
  *
  * @param     other   the source matrix to copy from (may be identical to the receiver).
  * @return <tt>this</tt> (for convenience only).
- * @throws	IllegalArgumentException if <tt>size() != other.size()</tt>.
+ * @throws  IllegalArgumentException if <tt>size() != other.size()</tt>.
  */
 public ObjectMatrix1D assign(ObjectMatrix1D other) {
-	if (other==this) return this;
-	checkSize(other);
-	if (haveSharedCells(other)) other = other.copy();
-	
-	for (int i=size; --i >= 0;) {
-		setQuick(i,other.getQuick(i));
-	}
-	return this;
+  if (other==this) return this;
+  checkSize(other);
+  if (haveSharedCells(other)) other = other.copy();
+  
+  for (int i=size; --i >= 0;) {
+    setQuick(i,other.getQuick(i));
+  }
+  return this;
 }
 /**
 Assigns the result of a function to each cell; <tt>x[i] = function(x[i],y[i])</tt>.
@@ -171,15 +171,15 @@
 @param function a function object taking as first argument the current cell's value of <tt>this</tt>,
 and as second argument the current cell's value of <tt>y</tt>,
 @return <tt>this</tt> (for convenience only).
-@throws	IllegalArgumentException if <tt>size() != y.size()</tt>.
+@throws  IllegalArgumentException if <tt>size() != y.size()</tt>.
 @see org.apache.mahout.jet.math.Functions
 */
 public ObjectMatrix1D assign(ObjectMatrix1D y, org.apache.mahout.matrix.function.ObjectObjectFunction function) {
-	checkSize(y);
-	for (int i=size; --i >= 0; ) {
-		setQuick(i, function.apply(getQuick(i), y.getQuick(i)));
-	}
-	return this;
+  checkSize(y);
+  for (int i=size; --i >= 0; ) {
+    setQuick(i, function.apply(getQuick(i), y.getQuick(i)));
+  }
+  return this;
 }
 /**
  * Sets all cells to the state specified by <tt>value</tt>.
@@ -187,20 +187,20 @@
  * @return <tt>this</tt> (for convenience only).
  */
 public ObjectMatrix1D assign(Object value) {
-	for (int i=size; --i >= 0;) {
-		setQuick(i,value);
-	}
-	return this;
+  for (int i=size; --i >= 0;) {
+    setQuick(i,value);
+  }
+  return this;
 }
 /**
  * Returns the number of cells having non-zero values; ignores tolerance.
  */
 public int cardinality() {
-	int cardinality = 0;
-	for (int i=size; --i >= 0;) {
-		if (getQuick(i) != null) cardinality++;
-	}
-	return cardinality;
+  int cardinality = 0;
+  for (int i=size; --i >= 0;) {
+    if (getQuick(i) != null) cardinality++;
+  }
+  return cardinality;
 }
 /**
  * Constructs and returns a deep copy of the receiver.
@@ -211,9 +211,9 @@
  * @return  a deep copy of the receiver.
  */
 public ObjectMatrix1D copy() {
-	ObjectMatrix1D copy = like();
-	copy.assign(this);
-	return copy;
+  ObjectMatrix1D copy = like();
+  copy.assign(this);
+  return copy;
 }
 /**
 * Compares the specified Object with the receiver for equality.
@@ -223,7 +223,7 @@
 * @return true if the specified Object is equal to the receiver.
 */
 public boolean equals(Object otherObj) { //delta
-	return equals(otherObj, true);
+  return equals(otherObj, true);
 }
 /**
 * Compares the specified Object with the receiver for equality.
@@ -241,24 +241,24 @@
 * @return true if the specified Object is equal to the receiver.
 */
 public boolean equals(Object otherObj, boolean testForEquality) { //delta
-	if (! (otherObj instanceof ObjectMatrix1D)) {return false;}
-	if (this==otherObj) return true;
-	if (otherObj==null) return false;
-	ObjectMatrix1D other = (ObjectMatrix1D) otherObj;
-	if (size!=other.size()) return false;
+  if (! (otherObj instanceof ObjectMatrix1D)) {return false;}
+  if (this==otherObj) return true;
+  if (otherObj==null) return false;
+  ObjectMatrix1D other = (ObjectMatrix1D) otherObj;
+  if (size!=other.size()) return false;
 
-	if (! testForEquality) {
-		for (int i=size; --i >= 0; ) {
-			if (getQuick(i) != other.getQuick(i)) return false;
-		}
-	}
-	else {
-		for (int i=size; --i >= 0; ) {
-			if (!(getQuick(i)==null ? other.getQuick(i)==null : getQuick(i).equals(other.getQuick(i)))) return false;
-		}
-	}
+  if (! testForEquality) {
+    for (int i=size; --i >= 0; ) {
+      if (getQuick(i) != other.getQuick(i)) return false;
+    }
+  }
+  else {
+    for (int i=size; --i >= 0; ) {
+      if (!(getQuick(i)==null ? other.getQuick(i)==null : getQuick(i).equals(other.getQuick(i)))) return false;
+    }
+  }
 
-	return true;
+  return true;
 
 }
 /**
@@ -266,18 +266,18 @@
  *
  * @param     index   the index of the cell.
  * @return    the value of the specified cell.
- * @throws	IndexOutOfBoundsException if <tt>index&lt;0 || index&gt;=size()</tt>.
+ * @throws  IndexOutOfBoundsException if <tt>index&lt;0 || index&gt;=size()</tt>.
  */
 public Object get(int index) {
-	if (index<0 || index>=size) checkIndex(index);
-	return getQuick(index);
+  if (index<0 || index>=size) checkIndex(index);
+  return getQuick(index);
 }
 /**
  * Returns the content of this matrix if it is a wrapper; or <tt>this</tt> otherwise.
  * Override this method in wrappers.
  */
 protected ObjectMatrix1D getContent() {
-	return this;
+  return this;
 }
 /**
 Fills the coordinates and values of cells having non-zero values into the specified lists.
@@ -303,18 +303,18 @@
 @param valueList the list to be filled with values, can have any size.
 */
 public void getNonZeros(IntArrayList indexList, ObjectArrayList valueList) {
-	boolean fillIndexList = indexList != null;
-	boolean fillValueList = valueList != null;
-	if (fillIndexList) indexList.clear(); 
-	if (fillValueList) valueList.clear();
-	int s = size;
-	for (int i=0; i < s; i++) {
-		Object value = getQuick(i);
-		if (value != null) {
-			if (fillIndexList) indexList.add(i);
-			if (fillValueList) valueList.add(value);
-		}
-	}
+  boolean fillIndexList = indexList != null;
+  boolean fillValueList = valueList != null;
+  if (fillIndexList) indexList.clear(); 
+  if (fillValueList) valueList.clear();
+  int s = size;
+  for (int i=0; i < s; i++) {
+    Object value = getQuick(i);
+    if (value != null) {
+      if (fillIndexList) indexList.add(i);
+      if (fillValueList) valueList.add(value);
+    }
+  }
 }
 /**
  * Returns the matrix cell value at coordinate <tt>index</tt>.
@@ -331,16 +331,16 @@
  * Returns <tt>true</tt> if both matrices share at least one identical cell.
  */
 protected boolean haveSharedCells(ObjectMatrix1D other) {
-	if (other==null) return false;
-	if (this==other) return true;
-	return getContent().haveSharedCellsRaw(other.getContent());
-}	
+  if (other==null) return false;
+  if (this==other) return true;
+  return getContent().haveSharedCellsRaw(other.getContent());
+}  
 /**
  * Returns <tt>true</tt> if both matrices share at least one identical cell.
  */
 protected boolean haveSharedCellsRaw(ObjectMatrix1D other) {
-	return false;
-}	
+  return false;
+}  
 /**
  * Construct and returns a new empty matrix <i>of the same dynamic type</i> as the receiver, having the same size.
  * For example, if the receiver is an instance of type <tt>DenseObjectMatrix1D</tt> the new matrix must also be of type <tt>DenseObjectMatrix1D</tt>,
@@ -350,7 +350,7 @@
  * @return  a new empty matrix of the same dynamic type.
  */
 public ObjectMatrix1D like() {
-	return like(size);
+  return like(size);
 }
 /**
  * Construct and returns a new empty matrix <i>of the same dynamic type</i> as the receiver, having the specified size.
@@ -377,11 +377,11 @@
  *
  * @param     index   the index of the cell.
  * @param    value the value to be filled into the specified cell.
- * @throws	IndexOutOfBoundsException if <tt>index&lt;0 || index&gt;=size()</tt>.
+ * @throws  IndexOutOfBoundsException if <tt>index&lt;0 || index&gt;=size()</tt>.
  */
 public void set(int index, Object value) {
-	if (index<0 || index>=size) checkIndex(index);
-	setQuick(index,value);
+  if (index<0 || index>=size) checkIndex(index);
+  setQuick(index,value);
 }
 /**
  * Sets the matrix cell at coordinate <tt>index</tt> to the specified value.
@@ -399,13 +399,13 @@
 @throws IllegalArgumentException if <tt>size() != other.size()</tt>.
 */
 public void swap(ObjectMatrix1D other) {
-	checkSize(other);
-	for (int i=size; --i >= 0; ) {
-		Object tmp = getQuick(i);
-		setQuick(i, other.getQuick(i));
-		other.setQuick(i, tmp);
-	}
-	return;
+  checkSize(other);
+  for (int i=size; --i >= 0; ) {
+    Object tmp = getQuick(i);
+    setQuick(i, other.getQuick(i));
+    other.setQuick(i, tmp);
+  }
+  return;
 }
 /**
 Constructs and returns a 1-dimensional array containing the cell values.
@@ -417,9 +417,9 @@
 @return an array filled with the values of the cells.
 */
 public Object[] toArray() {
-	Object[] values = new Object[size];
-	toArray(values);
-	return values;
+  Object[] values = new Object[size];
+  toArray(values);
+  return values;
 }
 /**
 Fills the cell values into the specified 1-dimensional array.
@@ -431,17 +431,17 @@
 @throws IllegalArgumentException if <tt>values.length < size()</tt>.
 */
 public void toArray(Object[] values) {
-	if (values.length < size) throw new IllegalArgumentException("values too small");
-	for (int i=size; --i >= 0; ) {
-		values[i] = getQuick(i);
-	}
+  if (values.length < size) throw new IllegalArgumentException("values too small");
+  for (int i=size; --i >= 0; ) {
+    values[i] = getQuick(i);
+  }
 }
 /**
  * Returns a string representation using default formatting.
  * @see org.apache.mahout.matrix.matrix.objectalgo.Formatter
  */
 public String toString() {
-	return new org.apache.mahout.matrix.matrix.objectalgo.Formatter().toString(this);
+  return new org.apache.mahout.matrix.matrix.objectalgo.Formatter().toString(this);
 }
 /**
  * Constructs and returns a new view equal to the receiver.
@@ -455,7 +455,7 @@
  * @return  a new view of the receiver.
  */
 protected ObjectMatrix1D view() {
-	return (ObjectMatrix1D) clone();
+  return (ObjectMatrix1D) clone();
 }
 /**
 Constructs and returns a new <i>flip view</i>.
@@ -465,7 +465,7 @@
 @return a new flip view.
 */
 public ObjectMatrix1D viewFlip() {
-	return (ObjectMatrix1D) (view().vFlip());
+  return (ObjectMatrix1D) (view().vFlip());
 }
 /**
 Constructs and returns a new <i>sub-range view</i> that is a <tt>width</tt> sub matrix starting at <tt>index</tt>.
@@ -484,12 +484,12 @@
 
 @param     index   The index of the first cell.
 @param     width   The width of the range.
-@throws	IndexOutOfBoundsException if <tt>index<0 || width<0 || index+width>size()</tt>.
+@throws  IndexOutOfBoundsException if <tt>index<0 || width<0 || index+width>size()</tt>.
 @return the new view.
-		
+    
 */
 public ObjectMatrix1D viewPart(int index, int width) {
-	return (ObjectMatrix1D) (view().vPart(index,width));
+  return (ObjectMatrix1D) (view().vPart(index,width));
 }
 /**
 Constructs and returns a new <i>selection view</i> that is a matrix holding the indicated cells.
@@ -512,18 +512,18 @@
 @throws IndexOutOfBoundsException if <tt>!(0 <= indexes[i] < size())</tt> for any <tt>i=0..indexes.length()-1</tt>.
 */
 public ObjectMatrix1D viewSelection(int[] indexes) {
-	// check for "all"
-	if (indexes==null) {
-		indexes = new int[size];
-		for (int i=size; --i >= 0; ) indexes[i] = i;
-	}
-	
-	checkIndexes(indexes);
-	int[] offsets = new int[indexes.length];
-	for (int i=indexes.length; --i >= 0; ) {
-		offsets[i] = index(indexes[i]);
-	}
-	return viewSelectionLike(offsets);
+  // check for "all"
+  if (indexes==null) {
+    indexes = new int[size];
+    for (int i=size; --i >= 0; ) indexes[i] = i;
+  }
+  
+  checkIndexes(indexes);
+  int[] offsets = new int[indexes.length];
+  for (int i=indexes.length; --i >= 0; ) {
+    offsets[i] = index(indexes[i]);
+  }
+  return viewSelectionLike(offsets);
 }
 /**
 Constructs and returns a new <i>selection view</i> that is a matrix holding the cells matching the given condition.
@@ -549,12 +549,12 @@
 @return the new view.
 */
 public ObjectMatrix1D viewSelection(org.apache.mahout.matrix.function.ObjectProcedure condition) {
-	IntArrayList matches = new IntArrayList();
-	for (int i=0; i < size; i++) {
-		if (condition.apply(getQuick(i))) matches.add(i);
-	}
-	matches.trimToSize();
-	return viewSelection(matches.elements());
+  IntArrayList matches = new IntArrayList();
+  for (int i=0; i < size; i++) {
+    if (condition.apply(getQuick(i))) matches.add(i);
+  }
+  matches.trimToSize();
+  return viewSelection(matches.elements());
 }
 /**
  * Construct and returns a new selection view.
@@ -571,19 +571,19 @@
 @return a new sorted vector (matrix) view.
 */
 public ObjectMatrix1D viewSorted() {
-	return org.apache.mahout.matrix.matrix.objectalgo.Sorting.mergeSort.sort(this);
+  return org.apache.mahout.matrix.matrix.objectalgo.Sorting.mergeSort.sort(this);
 }
 /**
 Constructs and returns a new <i>stride view</i> which is a sub matrix consisting of every i-th cell.
 More specifically, the view has size <tt>this.size()/stride</tt> holding cells <tt>this.get(i*stride)</tt> for all <tt>i = 0..size()/stride - 1</tt>.
 
 @param  stride  the step factor.
-@throws	IndexOutOfBoundsException if <tt>stride <= 0</tt>.
+@throws  IndexOutOfBoundsException if <tt>stride <= 0</tt>.
 @return the new view.
-		
+    
 */
 public ObjectMatrix1D viewStrides(int stride) {
-	return (ObjectMatrix1D) (view().vStrides(stride));
+  return (ObjectMatrix1D) (view().vStrides(stride));
 }
 /**
  * Applies a procedure to each cell's value.
@@ -601,9 +601,9 @@
  * @return <tt>false</tt> if the procedure stopped before all elements where iterated over, <tt>true</tt> otherwise. 
  */
 private boolean xforEach(final org.apache.mahout.matrix.function.ObjectProcedure procedure) {
-	for (int i=size; --i >= 0;) {
-		if (!procedure.apply(getQuick(i))) return false;
-	}
-	return true;
+  for (int i=size; --i >= 0;) {
+    if (!procedure.apply(getQuick(i))) return false;
+  }
+  return true;
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SparseDoubleMatrix1D.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SparseDoubleMatrix1D.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SparseDoubleMatrix1D.java	(working copy)
@@ -53,10 +53,10 @@
  */
 @Deprecated
 public class SparseDoubleMatrix1D extends DoubleMatrix1D {
-	/*
-	 * The elements of the matrix.
-	 */
-	protected AbstractIntDoubleMap elements; 
+  /*
+   * The elements of the matrix.
+   */
+  protected AbstractIntDoubleMap elements; 
 /**
  * Constructs a matrix with a copy of the given values.
  * The values are copied. So subsequent changes in <tt>values</tt> are not reflected in the matrix, and vice-versa.
@@ -64,8 +64,8 @@
  * @param values The values to be filled into the new matrix.
  */
 public SparseDoubleMatrix1D(double[] values) {
-	this(values.length);
-	assign(values);
+  this(values.length);
+  assign(values);
 }
 /**
  * Constructs a matrix with a given number of cells.
@@ -74,7 +74,7 @@
  * @throws IllegalArgumentException if <tt>size<0</tt>.
  */
 public SparseDoubleMatrix1D(int size) {
-	this(size,size/1000,0.2,0.5);
+  this(size,size/1000,0.2,0.5);
 }
 /**
  * Constructs a matrix with a given number of parameters.
@@ -86,12 +86,12 @@
  *                          If not known, set <tt>initialCapacity=0</tt> or small.     
  * @param minLoadFactor        the minimum load factor of the hash map.
  * @param maxLoadFactor        the maximum load factor of the hash map.
- * @throws	IllegalArgumentException if <tt>initialCapacity < 0 || (minLoadFactor < 0.0 || minLoadFactor >= 1.0) || (maxLoadFactor <= 0.0 || maxLoadFactor >= 1.0) || (minLoadFactor >= maxLoadFactor)</tt>.
+ * @throws  IllegalArgumentException if <tt>initialCapacity < 0 || (minLoadFactor < 0.0 || minLoadFactor >= 1.0) || (maxLoadFactor <= 0.0 || maxLoadFactor >= 1.0) || (minLoadFactor >= maxLoadFactor)</tt>.
  * @throws IllegalArgumentException if <tt>size<0</tt>.
  */
 public SparseDoubleMatrix1D(int size, int initialCapacity, double minLoadFactor, double maxLoadFactor) {
-	setUp(size);
-	this.elements = new OpenIntDoubleHashMap(initialCapacity, minLoadFactor, maxLoadFactor);
+  setUp(size);
+  this.elements = new OpenIntDoubleHashMap(initialCapacity, minLoadFactor, maxLoadFactor);
 }
 /**
  * Constructs a matrix view with a given number of parameters.
@@ -103,9 +103,9 @@
  * @throws IllegalArgumentException if <tt>size<0</tt>.
  */
 protected SparseDoubleMatrix1D(int size, AbstractIntDoubleMap elements, int offset, int stride) {
-	setUp(size,offset,stride);
-	this.elements = elements;
-	this.isNoView = false;
+  setUp(size,offset,stride);
+  this.elements = elements;
+  this.isNoView = false;
 }
 /**
  * Sets all cells to the state specified by <tt>value</tt>.
@@ -113,17 +113,17 @@
  * @return <tt>this</tt> (for convenience only).
  */
 public DoubleMatrix1D assign(double value) {
-	// overriden for performance only
-	if (this.isNoView && value==0) this.elements.clear();
-	else super.assign(value);
-	return this;
+  // overriden for performance only
+  if (this.isNoView && value==0) this.elements.clear();
+  else super.assign(value);
+  return this;
 }
 /**
  * Returns the number of cells having non-zero values.
  */
 public int cardinality() {
-	if (this.isNoView) return this.elements.size();
-	else return super.cardinality();
+  if (this.isNoView) return this.elements.size();
+  else return super.cardinality();
 }
 /**
  * Ensures that the receiver can hold at least the specified number of non-zero cells without needing to allocate new internal memory.
@@ -136,7 +136,7 @@
  * @param   minNonZeros   the desired minimum number of non-zero cells.
  */
 public void ensureCapacity(int minCapacity) {
-	this.elements.ensureCapacity(minCapacity);
+  this.elements.ensureCapacity(minCapacity);
 }
 /**
  * Returns the matrix cell value at coordinate <tt>index</tt>.
@@ -149,24 +149,24 @@
  * @return    the value of the specified cell.
  */
 public double getQuick(int index) {
-	//if (debug) if (index<0 || index>=size) checkIndex(index);
-	//return this.elements.get(index(index)); 
-	// manually inlined:
-	return elements.get(zero + index*stride);
+  //if (debug) if (index<0 || index>=size) checkIndex(index);
+  //return this.elements.get(index(index)); 
+  // manually inlined:
+  return elements.get(zero + index*stride);
 }
 /**
  * Returns <tt>true</tt> if both matrices share at least one identical cell.
  */
 protected boolean haveSharedCellsRaw(DoubleMatrix1D other) {
-	if (other instanceof SelectedSparseDoubleMatrix1D) {
-		SelectedSparseDoubleMatrix1D otherMatrix = (SelectedSparseDoubleMatrix1D) other;
-		return this.elements==otherMatrix.elements;
-	}
-	else if (other instanceof SparseDoubleMatrix1D) {
-		SparseDoubleMatrix1D otherMatrix = (SparseDoubleMatrix1D) other;
-		return this.elements==otherMatrix.elements;
-	}
-	return false;
+  if (other instanceof SelectedSparseDoubleMatrix1D) {
+    SelectedSparseDoubleMatrix1D otherMatrix = (SelectedSparseDoubleMatrix1D) other;
+    return this.elements==otherMatrix.elements;
+  }
+  else if (other instanceof SparseDoubleMatrix1D) {
+    SparseDoubleMatrix1D otherMatrix = (SparseDoubleMatrix1D) other;
+    return this.elements==otherMatrix.elements;
+  }
+  return false;
 }
 /**
  * Returns the position of the element with the given relative rank within the (virtual or non-virtual) internal 1-dimensional array.
@@ -175,9 +175,9 @@
  * @param     rank   the rank of the element.
  */
 protected int index(int rank) {
-	// overriden for manual inlining only
-	//return _offset(_rank(rank));
-	return zero + rank*stride;
+  // overriden for manual inlining only
+  //return _offset(_rank(rank));
+  return zero + rank*stride;
 }
 /**
  * Construct and returns a new empty matrix <i>of the same dynamic type</i> as the receiver, having the specified size.
@@ -189,7 +189,7 @@
  * @return  a new empty matrix of the same dynamic type.
  */
 public DoubleMatrix1D like(int size) {
-	return new SparseDoubleMatrix1D(size);
+  return new SparseDoubleMatrix1D(size);
 }
 /**
  * Construct and returns a new 2-d matrix <i>of the corresponding dynamic type</i>, entirelly independent of the receiver.
@@ -201,7 +201,7 @@
  * @return  a new matrix of the corresponding dynamic type.
  */
 public DoubleMatrix2D like2D(int rows, int columns) {
-	return new SparseDoubleMatrix2D(rows,columns);
+  return new SparseDoubleMatrix2D(rows,columns);
 }
 /**
  * Sets the matrix cell at coordinate <tt>index</tt> to the specified value.
@@ -214,14 +214,14 @@
  * @param    value the value to be filled into the specified cell.
  */
 public void setQuick(int index, double value) {
-	//if (debug) if (index<0 || index>=size) checkIndex(index);
-	//int i =	index(index);
-	// manually inlined:
-	int i = zero + index*stride;
-	if (value == 0)
-		this.elements.removeKey(i);
-	else 
-		this.elements.put(i, value);
+  //if (debug) if (index<0 || index>=size) checkIndex(index);
+  //int i =  index(index);
+  // manually inlined:
+  int i = zero + index*stride;
+  if (value == 0)
+    this.elements.removeKey(i);
+  else 
+    this.elements.put(i, value);
 }
 /**
  * Releases any superfluous memory created by explicitly putting zero values into cells formerly having non-zero values; 
@@ -241,7 +241,7 @@
  * Putting zeros into cells already containing zeros does not generate obsolete memory since no memory was allocated to them in the first place.
  */
 public void trimToSize() {
-	this.elements.trimToSize();
+  this.elements.trimToSize();
 }
 /**
  * Construct and returns a new selection view.
@@ -250,6 +250,6 @@
  * @return  a new view.
  */
 protected DoubleMatrix1D viewSelectionLike(int[] offsets) {
-	return new SelectedSparseDoubleMatrix1D(this.elements,offsets);
+  return new SelectedSparseDoubleMatrix1D(this.elements,offsets);
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/DenseDoubleMatrix1D.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/DenseDoubleMatrix1D.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/DenseDoubleMatrix1D.java	(working copy)
@@ -37,10 +37,10 @@
  */
 @Deprecated
 public class DenseDoubleMatrix1D extends DoubleMatrix1D {
-	/**
-	  * The elements of this matrix.
-	  */
-	protected double[] elements;
+  /**
+    * The elements of this matrix.
+    */
+  protected double[] elements;
 /**
  * Constructs a matrix with a copy of the given values.
  * The values are copied. So subsequent changes in <tt>values</tt> are not reflected in the matrix, and vice-versa.
@@ -48,8 +48,8 @@
  * @param values The values to be filled into the new matrix.
  */
 public DenseDoubleMatrix1D(double[] values) {
-	this(values.length);
-	assign(values);
+  this(values.length);
+  assign(values);
 }
 /**
  * Constructs a matrix with a given number of cells.
@@ -58,8 +58,8 @@
  * @throws IllegalArgumentException if <tt>size<0</tt>.
  */
 public DenseDoubleMatrix1D(int size) {
-	setUp(size);
-	this.elements = new double[size];
+  setUp(size);
+  this.elements = new double[size];
 }
 /**
  * Constructs a matrix view with the given parameters.
@@ -70,9 +70,9 @@
  * @throws IllegalArgumentException if <tt>size<0</tt>.
  */
 protected DenseDoubleMatrix1D(int size, double[] elements, int zero, int stride) {
-	setUp(size,zero,stride);
-	this.elements = elements;
-	this.isNoView = false;
+  setUp(size,zero,stride);
+  this.elements = elements;
+  this.isNoView = false;
 }
 /**
  * Sets all cells to the state specified by <tt>values</tt>.
@@ -85,14 +85,14 @@
  * @throws IllegalArgumentException if <tt>values.length != size()</tt>.
  */
 public DoubleMatrix1D assign(double[] values) {
-	if (isNoView) {
-		if (values.length != size) throw new IllegalArgumentException("Must have same number of cells: length="+values.length+"size()="+size());
-		System.arraycopy(values, 0, this.elements, 0, values.length);
-	}
-	else {
-		super.assign(values);
-	}
-	return this;
+  if (isNoView) {
+    if (values.length != size) throw new IllegalArgumentException("Must have same number of cells: length="+values.length+"size()="+size());
+    System.arraycopy(values, 0, this.elements, 0, values.length);
+  }
+  else {
+    super.assign(values);
+  }
+  return this;
 }
 /**
  * Sets all cells to the state specified by <tt>value</tt>.
@@ -100,14 +100,14 @@
  * @return <tt>this</tt> (for convenience only).
  */
 public DoubleMatrix1D assign(double value) {
-	int index = index(0);
-	int s = this.stride;
-	double[] elems = this.elements;
-	for (int i=size; --i >= 0; ) {
-		elems[index] = value;
-		index += s;
-	}
-	return this;
+  int index = index(0);
+  int s = this.stride;
+  double[] elems = this.elements;
+  for (int i=size; --i >= 0; ) {
+    elems[index] = value;
+    index += s;
+  }
+  return this;
 }
 /**
 Assigns the result of a function to each cell; <tt>x[i] = function(x[i])</tt>.
@@ -128,27 +128,27 @@
 @see org.apache.mahout.jet.math.Functions
 */
 public DoubleMatrix1D assign(org.apache.mahout.matrix.function.DoubleFunction function) {
-	int s=stride;
-	int i=index(0);
-	double[] elems = this.elements;
-	if (elems==null) throw new InternalError();
+  int s=stride;
+  int i=index(0);
+  double[] elems = this.elements;
+  if (elems==null) throw new InternalError();
 
-	// specialization for speed
-	if (function instanceof org.apache.mahout.jet.math.Mult) { // x[i] = mult*x[i]
-		double multiplicator = ((org.apache.mahout.jet.math.Mult)function).multiplicator;
-		if (multiplicator==1) return this;
-		for (int k=size; --k >= 0; ) {
-			elems[i] *= multiplicator;
-			i += s;
-		}
-	}
-	else { // the general case x[i] = f(x[i])
-		for (int k=size; --k >= 0; ) {
-			elems[i] = function.apply(elems[i]);
-			i += s;
-		}
-	}
-	return this;
+  // specialization for speed
+  if (function instanceof org.apache.mahout.jet.math.Mult) { // x[i] = mult*x[i]
+    double multiplicator = ((org.apache.mahout.jet.math.Mult)function).multiplicator;
+    if (multiplicator==1) return this;
+    for (int k=size; --k >= 0; ) {
+      elems[i] *= multiplicator;
+      i += s;
+    }
+  }
+  else { // the general case x[i] = f(x[i])
+    for (int k=size; --k >= 0; ) {
+      elems[i] = function.apply(elems[i]);
+      i += s;
+    }
+  }
+  return this;
 }
 /**
  * Replaces all cell values of the receiver with the values of another matrix.
@@ -157,42 +157,42 @@
  *
  * @param     source   the source matrix to copy from (may be identical to the receiver).
  * @return <tt>this</tt> (for convenience only).
- * @throws	IllegalArgumentException if <tt>size() != other.size()</tt>.
+ * @throws  IllegalArgumentException if <tt>size() != other.size()</tt>.
  */
 public DoubleMatrix1D assign(DoubleMatrix1D source) {
-	// overriden for performance only
-	if (! (source instanceof DenseDoubleMatrix1D)) {
-		return super.assign(source);
-	}
-	DenseDoubleMatrix1D other = (DenseDoubleMatrix1D) source;
-	if (other==this) return this;
-	checkSize(other);
-	if (isNoView && other.isNoView) { // quickest
-		System.arraycopy(other.elements, 0, this.elements, 0, this.elements.length);
-		return this;
-	}
-	if (haveSharedCells(other)) {
-		DoubleMatrix1D c = other.copy();
-		if (! (c instanceof DenseDoubleMatrix1D)) { // should not happen
-			return super.assign(source);
-		}
-		other = (DenseDoubleMatrix1D) c;
-	}
+  // overriden for performance only
+  if (! (source instanceof DenseDoubleMatrix1D)) {
+    return super.assign(source);
+  }
+  DenseDoubleMatrix1D other = (DenseDoubleMatrix1D) source;
+  if (other==this) return this;
+  checkSize(other);
+  if (isNoView && other.isNoView) { // quickest
+    System.arraycopy(other.elements, 0, this.elements, 0, this.elements.length);
+    return this;
+  }
+  if (haveSharedCells(other)) {
+    DoubleMatrix1D c = other.copy();
+    if (! (c instanceof DenseDoubleMatrix1D)) { // should not happen
+      return super.assign(source);
+    }
+    other = (DenseDoubleMatrix1D) c;
+  }
 
-	final double[] elems = this.elements;
-	final double[] otherElems = other.elements;
-	if (elements==null || otherElems==null) throw new InternalError();
-	int s = this.stride;
-	int ys = other.stride;
+  final double[] elems = this.elements;
+  final double[] otherElems = other.elements;
+  if (elements==null || otherElems==null) throw new InternalError();
+  int s = this.stride;
+  int ys = other.stride;
 
-	int index = index(0);
-	int otherIndex = other.index(0);
-	for (int k=size; --k >= 0; ) {
-		elems[index] = otherElems[otherIndex];
-		index += s;
-		otherIndex += ys;
-	}
-	return this;
+  int index = index(0);
+  int otherIndex = other.index(0);
+  for (int k=size; --k >= 0; ) {
+    elems[index] = otherElems[otherIndex];
+    index += s;
+    otherIndex += ys;
+  }
+  return this;
 }
 /**
 Assigns the result of a function to each cell; <tt>x[i] = function(x[i],y[i])</tt>.
@@ -220,90 +220,90 @@
 @param function a function object taking as first argument the current cell's value of <tt>this</tt>,
 and as second argument the current cell's value of <tt>y</tt>,
 @return <tt>this</tt> (for convenience only).
-@throws	IllegalArgumentException if <tt>size() != y.size()</tt>.
+@throws  IllegalArgumentException if <tt>size() != y.size()</tt>.
 @see org.apache.mahout.jet.math.Functions
 */
 public DoubleMatrix1D assign(DoubleMatrix1D y, org.apache.mahout.matrix.function.DoubleDoubleFunction function) {
-	// overriden for performance only
-	if (! (y instanceof DenseDoubleMatrix1D)) {
-		return super.assign(y,function);
-	}
-	DenseDoubleMatrix1D other = (DenseDoubleMatrix1D) y;
-	checkSize(y);
-	final double[] elems = this.elements;
-	final double[] otherElems = other.elements;
-	if (elems==null || otherElems==null) throw new InternalError();
-	int s = this.stride;
-	int ys = other.stride;
+  // overriden for performance only
+  if (! (y instanceof DenseDoubleMatrix1D)) {
+    return super.assign(y,function);
+  }
+  DenseDoubleMatrix1D other = (DenseDoubleMatrix1D) y;
+  checkSize(y);
+  final double[] elems = this.elements;
+  final double[] otherElems = other.elements;
+  if (elems==null || otherElems==null) throw new InternalError();
+  int s = this.stride;
+  int ys = other.stride;
 
-	int index = index(0);
-	int otherIndex = other.index(0);
+  int index = index(0);
+  int otherIndex = other.index(0);
 
-	// specialized for speed
-	if (function== org.apache.mahout.jet.math.Functions.mult) {  // x[i] = x[i] * y[i]
-		for (int k=size; --k >= 0; ) {
-			elems[index] *= otherElems[otherIndex];
-			index += s;
-			otherIndex += ys;
-		}
-	}
-	else if (function== org.apache.mahout.jet.math.Functions.div) { // x[i] = x[i] / y[i]
-		for (int k=size; --k >= 0; ) {
-			elems[index] /= otherElems[otherIndex];
-			index += s;
-			otherIndex += ys;
-		}
-	}
-	else if (function instanceof org.apache.mahout.jet.math.PlusMult) {
-		double multiplicator = ((org.apache.mahout.jet.math.PlusMult) function).multiplicator;
-		if (multiplicator == 0) { // x[i] = x[i] + 0*y[i]
-			return this;
-		}
-		else if (multiplicator == 1) { // x[i] = x[i] + y[i]
-			for (int k=size; --k >= 0; ) {
-				elems[index] += otherElems[otherIndex];
-				index += s;
-				otherIndex += ys;
-			}
-		}
-		else if (multiplicator == -1) { // x[i] = x[i] - y[i]
-			for (int k=size; --k >= 0; ) {
-				elems[index] -= otherElems[otherIndex];
-				index += s;
-				otherIndex += ys;
-			}
-		}
-		else { // the general case x[i] = x[i] + mult*y[i]		
-			for (int k=size; --k >= 0; ) {
-				elems[index] += multiplicator*otherElems[otherIndex];
-				index += s;
-				otherIndex += ys;
-			}
-		}
-	}
-	else { // the general case x[i] = f(x[i],y[i])		
-		for (int k=size; --k >= 0; ) {
-			elems[index] = function.apply(elems[index], otherElems[otherIndex]);
-			index += s;
-			otherIndex += ys;
-		}
-	}
-	return this;
+  // specialized for speed
+  if (function== org.apache.mahout.jet.math.Functions.mult) {  // x[i] = x[i] * y[i]
+    for (int k=size; --k >= 0; ) {
+      elems[index] *= otherElems[otherIndex];
+      index += s;
+      otherIndex += ys;
+    }
+  }
+  else if (function== org.apache.mahout.jet.math.Functions.div) { // x[i] = x[i] / y[i]
+    for (int k=size; --k >= 0; ) {
+      elems[index] /= otherElems[otherIndex];
+      index += s;
+      otherIndex += ys;
+    }
+  }
+  else if (function instanceof org.apache.mahout.jet.math.PlusMult) {
+    double multiplicator = ((org.apache.mahout.jet.math.PlusMult) function).multiplicator;
+    if (multiplicator == 0) { // x[i] = x[i] + 0*y[i]
+      return this;
+    }
+    else if (multiplicator == 1) { // x[i] = x[i] + y[i]
+      for (int k=size; --k >= 0; ) {
+        elems[index] += otherElems[otherIndex];
+        index += s;
+        otherIndex += ys;
+      }
+    }
+    else if (multiplicator == -1) { // x[i] = x[i] - y[i]
+      for (int k=size; --k >= 0; ) {
+        elems[index] -= otherElems[otherIndex];
+        index += s;
+        otherIndex += ys;
+      }
+    }
+    else { // the general case x[i] = x[i] + mult*y[i]    
+      for (int k=size; --k >= 0; ) {
+        elems[index] += multiplicator*otherElems[otherIndex];
+        index += s;
+        otherIndex += ys;
+      }
+    }
+  }
+  else { // the general case x[i] = f(x[i],y[i])    
+    for (int k=size; --k >= 0; ) {
+      elems[index] = function.apply(elems[index], otherElems[otherIndex]);
+      index += s;
+      otherIndex += ys;
+    }
+  }
+  return this;
 }
 /**
  * Returns the number of cells having non-zero values, but at most maxCardinality; ignores tolerance.
  */
 protected int cardinality(int maxCardinality) {
-	int cardinality = 0;
-	int index = index(0);
-	int s = this.stride;
-	double[] elems = this.elements;
-	int i=size; 
-	while (--i >= 0 && cardinality < maxCardinality) {
-		if (elems[index] != 0) cardinality++;
-		index += s;
-	}
-	return cardinality;
+  int cardinality = 0;
+  int index = index(0);
+  int s = this.stride;
+  double[] elems = this.elements;
+  int i=size; 
+  while (--i >= 0 && cardinality < maxCardinality) {
+    if (elems[index] != 0) cardinality++;
+    index += s;
+  }
+  return cardinality;
 }
 /**
  * Returns the matrix cell value at coordinate <tt>index</tt>.
@@ -316,24 +316,24 @@
  * @return    the value of the specified cell.
  */
 public double getQuick(int index) {
-	//if (debug) if (index<0 || index>=size) checkIndex(index);
-	//return elements[index(index)];
-	// manually inlined:
-	return elements[zero + index*stride];
+  //if (debug) if (index<0 || index>=size) checkIndex(index);
+  //return elements[index(index)];
+  // manually inlined:
+  return elements[zero + index*stride];
 }
 /**
  * Returns <tt>true</tt> if both matrices share at least one identical cell.
  */
 protected boolean haveSharedCellsRaw(DoubleMatrix1D other) {
-	if (other instanceof SelectedDenseDoubleMatrix1D) {
-		SelectedDenseDoubleMatrix1D otherMatrix = (SelectedDenseDoubleMatrix1D) other;
-		return this.elements==otherMatrix.elements;
-	}
-	else if (other instanceof DenseDoubleMatrix1D) {
-		DenseDoubleMatrix1D otherMatrix = (DenseDoubleMatrix1D) other;
-		return this.elements==otherMatrix.elements;
-	}
-	return false;
+  if (other instanceof SelectedDenseDoubleMatrix1D) {
+    SelectedDenseDoubleMatrix1D otherMatrix = (SelectedDenseDoubleMatrix1D) other;
+    return this.elements==otherMatrix.elements;
+  }
+  else if (other instanceof DenseDoubleMatrix1D) {
+    DenseDoubleMatrix1D otherMatrix = (DenseDoubleMatrix1D) other;
+    return this.elements==otherMatrix.elements;
+  }
+  return false;
 }
 /**
  * Returns the position of the element with the given relative rank within the (virtual or non-virtual) internal 1-dimensional array.
@@ -342,9 +342,9 @@
  * @param     rank   the rank of the element.
  */
 protected int index(int rank) {
-	// overriden for manual inlining only
-	//return _offset(_rank(rank));
-	return zero + rank*stride;
+  // overriden for manual inlining only
+  //return _offset(_rank(rank));
+  return zero + rank*stride;
 }
 /**
  * Construct and returns a new empty matrix <i>of the same dynamic type</i> as the receiver, having the specified size.
@@ -356,7 +356,7 @@
  * @return  a new empty matrix of the same dynamic type.
  */
 public DoubleMatrix1D like(int size) {
-	return new DenseDoubleMatrix1D(size);
+  return new DenseDoubleMatrix1D(size);
 }
 /**
  * Construct and returns a new 2-d matrix <i>of the corresponding dynamic type</i>, entirelly independent of the receiver.
@@ -368,7 +368,7 @@
  * @return  a new matrix of the corresponding dynamic type.
  */
 public DoubleMatrix2D like2D(int rows, int columns) {
-	return new DenseDoubleMatrix2D(rows,columns);
+  return new DenseDoubleMatrix2D(rows,columns);
 }
 /**
  * Sets the matrix cell at coordinate <tt>index</tt> to the specified value.
@@ -381,40 +381,40 @@
  * @param    value the value to be filled into the specified cell.
  */
 public void setQuick(int index, double value) {
-	//if (debug) if (index<0 || index>=size) checkIndex(index);
-	//elements[index(index)] = value;
-	// manually inlined:
-	elements[zero + index*stride] = value;
+  //if (debug) if (index<0 || index>=size) checkIndex(index);
+  //elements[index(index)] = value;
+  // manually inlined:
+  elements[zero + index*stride] = value;
 }
 /**
 Swaps each element <tt>this[i]</tt> with <tt>other[i]</tt>.
 @throws IllegalArgumentException if <tt>size() != other.size()</tt>.
 */
 public void swap(DoubleMatrix1D other) {
-	// overriden for performance only
-	if (! (other instanceof DenseDoubleMatrix1D)) {
-		super.swap(other);
-	}
-	DenseDoubleMatrix1D y = (DenseDoubleMatrix1D) other;
-	if (y==this) return;
-	checkSize(y);
-	
-	final double[] elems = this.elements;
-	final double[] otherElems = y.elements;
-	if (elements==null || otherElems==null) throw new InternalError();
-	int s = this.stride;
-	int ys = y.stride;
+  // overriden for performance only
+  if (! (other instanceof DenseDoubleMatrix1D)) {
+    super.swap(other);
+  }
+  DenseDoubleMatrix1D y = (DenseDoubleMatrix1D) other;
+  if (y==this) return;
+  checkSize(y);
+  
+  final double[] elems = this.elements;
+  final double[] otherElems = y.elements;
+  if (elements==null || otherElems==null) throw new InternalError();
+  int s = this.stride;
+  int ys = y.stride;
 
-	int index = index(0);
-	int otherIndex = y.index(0);
-	for (int k=size; --k >= 0; ) {
-		double tmp = elems[index];
-		elems[index] = otherElems[otherIndex];
-		otherElems[otherIndex] = tmp;
-		index += s;
-		otherIndex += ys;
-	}
-	return;
+  int index = index(0);
+  int otherIndex = y.index(0);
+  for (int k=size; --k >= 0; ) {
+    double tmp = elems[index];
+    elems[index] = otherElems[otherIndex];
+    otherElems[otherIndex] = tmp;
+    index += s;
+    otherIndex += ys;
+  }
+  return;
 }
 /**
 Fills the cell values into the specified 1-dimensional array.
@@ -426,9 +426,9 @@
 @throws IllegalArgumentException if <tt>values.length < size()</tt>.
 */
 public void toArray(double[] values) {
-	if (values.length < size) throw new IllegalArgumentException("values too small");
-	if (this.isNoView) System.arraycopy(this.elements,0,values,0,this.elements.length);
-	else super.toArray(values);
+  if (values.length < size) throw new IllegalArgumentException("values too small");
+  if (this.isNoView) System.arraycopy(this.elements,0,values,0,this.elements.length);
+  else super.toArray(values);
 }
 /**
  * Construct and returns a new selection view.
@@ -437,7 +437,7 @@
  * @return  a new view.
  */
 protected DoubleMatrix1D viewSelectionLike(int[] offsets) {
-	return new SelectedDenseDoubleMatrix1D(this.elements,offsets);
+  return new SelectedDenseDoubleMatrix1D(this.elements,offsets);
 }
 /**
  * Returns the dot product of two vectors x and y, which is <tt>Sum(x[i]*y[i])</tt>.
@@ -449,64 +449,64 @@
  * @return the sum of products; zero if <tt>from<0 || length<0</tt>.
  */
 public double zDotProduct(DoubleMatrix1D y, int from, int length) {
-	if (!(y instanceof DenseDoubleMatrix1D)) {
-		return super.zDotProduct(y, from, length);
-	}
-	DenseDoubleMatrix1D yy = (DenseDoubleMatrix1D) y;
-	
-	int tail = from + length;
-	if (from < 0 || length < 0) return 0;
-	if (size < tail) tail = size;
-	if (y.size < tail) tail = y.size;
-	int min = tail-from;
-	
-	int i = index(from);
-	int j = yy.index(from);
-	int s = stride;
-	int ys = yy.stride;
-	final double[] elems = this.elements;
-	final double[] yElems = yy.elements;
-	if (elems==null || yElems==null) throw new InternalError();
-	
-	double sum = 0;
-	/*
-	// unoptimized
-	for (int k = min; --k >= 0;) {
-		sum += elems[i] * yElems[j];
-		i += s;
-		j += ys;
-	}
-	*/
-	
-	// optimized
-	// loop unrolling
-	i -= s;
-	j -= ys;
-	for (int k=min/4; --k >= 0; ) { 
-		sum += elems[i += s] * yElems[j += ys] + 
-			elems[i += s] * yElems[j += ys] +
-			elems[i += s] * yElems[j += ys] +
-			elems[i += s] * yElems[j += ys];
-	}		
-	for (int k=min%4; --k >= 0; ) {
-		sum += elems[i += s] * yElems[j += ys];
-	}
-	return sum;
+  if (!(y instanceof DenseDoubleMatrix1D)) {
+    return super.zDotProduct(y, from, length);
+  }
+  DenseDoubleMatrix1D yy = (DenseDoubleMatrix1D) y;
+  
+  int tail = from + length;
+  if (from < 0 || length < 0) return 0;
+  if (size < tail) tail = size;
+  if (y.size < tail) tail = y.size;
+  int min = tail-from;
+  
+  int i = index(from);
+  int j = yy.index(from);
+  int s = stride;
+  int ys = yy.stride;
+  final double[] elems = this.elements;
+  final double[] yElems = yy.elements;
+  if (elems==null || yElems==null) throw new InternalError();
+  
+  double sum = 0;
+  /*
+  // unoptimized
+  for (int k = min; --k >= 0;) {
+    sum += elems[i] * yElems[j];
+    i += s;
+    j += ys;
+  }
+  */
+  
+  // optimized
+  // loop unrolling
+  i -= s;
+  j -= ys;
+  for (int k=min/4; --k >= 0; ) { 
+    sum += elems[i += s] * yElems[j += ys] + 
+      elems[i += s] * yElems[j += ys] +
+      elems[i += s] * yElems[j += ys] +
+      elems[i += s] * yElems[j += ys];
+  }    
+  for (int k=min%4; --k >= 0; ) {
+    sum += elems[i += s] * yElems[j += ys];
+  }
+  return sum;
 }
 /**
  * Returns the sum of all cells; <tt>Sum( x[i] )</tt>.
  * @return the sum.
  */
 public double zSum() {
-	double sum = 0;
-	int s=stride;
-	int i=index(0);
-	final double[] elems = this.elements;
-	if (elems==null) throw new InternalError();
-	for (int k=size; --k >= 0; ) {
-		sum += elems[i];
-		i += s;
-	}
-	return sum;
+  double sum = 0;
+  int s=stride;
+  int i=index(0);
+  final double[] elems = this.elements;
+  if (elems==null) throw new InternalError();
+  for (int k=size; --k >= 0; ) {
+    sum += elems[i];
+    i += s;
+  }
+  return sum;
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SparseDoubleMatrix2D.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SparseDoubleMatrix2D.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SparseDoubleMatrix2D.java	(working copy)
@@ -50,19 +50,19 @@
 Setting values in a loop row-by-row is quicker than column-by-column, because fewer hash collisions occur.
 Thus
 <pre>
-	for (int row=0; row < rows; row++) {
-		for (int column=0; column < columns; column++) {
-			matrix.setQuick(row,column,someValue);
-		}
-	}
+  for (int row=0; row < rows; row++) {
+    for (int column=0; column < columns; column++) {
+      matrix.setQuick(row,column,someValue);
+    }
+  }
 </pre>
 is quicker than
 <pre>
-	for (int column=0; column < columns; column++) {
-		for (int row=0; row < rows; row++) {
-			matrix.setQuick(row,column,someValue);
-		}
-	}
+  for (int column=0; column < columns; column++) {
+    for (int row=0; row < rows; row++) {
+      matrix.setQuick(row,column,someValue);
+    }
+  }
 </pre>
 
 @see org.apache.mahout.matrix.map
@@ -75,11 +75,11 @@
  */
 @Deprecated
 public class SparseDoubleMatrix2D extends DoubleMatrix2D {
-	/*
-	 * The elements of the matrix.
-	 */
-	protected AbstractIntDoubleMap elements;
-	protected int dummy;
+  /*
+   * The elements of the matrix.
+   */
+  protected AbstractIntDoubleMap elements;
+  protected int dummy;
 /**
  * Constructs a matrix with a copy of the given values.
  * <tt>values</tt> is required to have the form <tt>values[row][column]</tt>
@@ -91,18 +91,18 @@
  * @throws IllegalArgumentException if <tt>for any 1 &lt;= row &lt; values.length: values[row].length != values[row-1].length</tt>.
  */
 public SparseDoubleMatrix2D(double[][] values) {
-	this(values.length, values.length==0 ? 0: values[0].length);
-	assign(values);
+  this(values.length, values.length==0 ? 0: values[0].length);
+  assign(values);
 }
 /**
  * Constructs a matrix with a given number of rows and columns and default memory usage.
  * All entries are initially <tt>0</tt>.
  * @param rows the number of rows the matrix shall have.
  * @param columns the number of columns the matrix shall have.
- * @throws	IllegalArgumentException if <tt>rows<0 || columns<0 || (double)columns*rows > Integer.MAX_VALUE</tt>.
+ * @throws  IllegalArgumentException if <tt>rows<0 || columns<0 || (double)columns*rows > Integer.MAX_VALUE</tt>.
  */
 public SparseDoubleMatrix2D(int rows, int columns) {
-	this(rows,columns,rows*(columns/1000),0.2,0.5);
+  this(rows,columns,rows*(columns/1000),0.2,0.5);
 }
 /**
  * Constructs a matrix with a given number of rows and columns using memory as specified.
@@ -115,12 +115,12 @@
  *                          If not known, set <tt>initialCapacity=0</tt> or small.     
  * @param minLoadFactor        the minimum load factor of the hash map.
  * @param maxLoadFactor        the maximum load factor of the hash map.
- * @throws	IllegalArgumentException if <tt>initialCapacity < 0 || (minLoadFactor < 0.0 || minLoadFactor >= 1.0) || (maxLoadFactor <= 0.0 || maxLoadFactor >= 1.0) || (minLoadFactor >= maxLoadFactor)</tt>.
- * @throws	IllegalArgumentException if <tt>rows<0 || columns<0 || (double)columns*rows > Integer.MAX_VALUE</tt>.
+ * @throws  IllegalArgumentException if <tt>initialCapacity < 0 || (minLoadFactor < 0.0 || minLoadFactor >= 1.0) || (maxLoadFactor <= 0.0 || maxLoadFactor >= 1.0) || (minLoadFactor >= maxLoadFactor)</tt>.
+ * @throws  IllegalArgumentException if <tt>rows<0 || columns<0 || (double)columns*rows > Integer.MAX_VALUE</tt>.
  */
 public SparseDoubleMatrix2D(int rows, int columns, int initialCapacity, double minLoadFactor, double maxLoadFactor) {
-	setUp(rows,columns); 
-	this.elements = new OpenIntDoubleHashMap(initialCapacity, minLoadFactor, maxLoadFactor);
+  setUp(rows,columns); 
+  this.elements = new OpenIntDoubleHashMap(initialCapacity, minLoadFactor, maxLoadFactor);
 }
 /**
  * Constructs a view with the given parameters.
@@ -131,12 +131,12 @@
  * @param columnZero the position of the first element.
  * @param rowStride the number of elements between two rows, i.e. <tt>index(i+1,j)-index(i,j)</tt>.
  * @param columnStride the number of elements between two columns, i.e. <tt>index(i,j+1)-index(i,j)</tt>.
- * @throws	IllegalArgumentException if <tt>rows<0 || columns<0 || (double)columns*rows > Integer.MAX_VALUE</tt> or flip's are illegal.
+ * @throws  IllegalArgumentException if <tt>rows<0 || columns<0 || (double)columns*rows > Integer.MAX_VALUE</tt> or flip's are illegal.
  */
 protected SparseDoubleMatrix2D(int rows, int columns, AbstractIntDoubleMap elements, int rowZero, int columnZero, int rowStride, int columnStride) {
-	setUp(rows,columns,rowZero,columnZero,rowStride,columnStride);
-	this.elements = elements;
-	this.isNoView = false;
+  setUp(rows,columns,rowZero,columnZero,rowStride,columnStride);
+  this.elements = elements;
+  this.isNoView = false;
 }
 /**
  * Sets all cells to the state specified by <tt>value</tt>.
@@ -144,10 +144,10 @@
  * @return <tt>this</tt> (for convenience only).
  */
 public DoubleMatrix2D assign(double value) {
-	// overriden for performance only
-	if (this.isNoView && value==0) this.elements.clear();
-	else super.assign(value);
-	return this;
+  // overriden for performance only
+  if (this.isNoView && value==0) this.elements.clear();
+  else super.assign(value);
+  return this;
 }
 /**
 Assigns the result of a function to each cell; <tt>x[row,col] = function(x[row,col])</tt>.
@@ -172,13 +172,13 @@
 @see org.apache.mahout.jet.math.Functions
 */
 public DoubleMatrix2D assign(org.apache.mahout.matrix.function.DoubleFunction function) {
-	if (this.isNoView && function instanceof org.apache.mahout.jet.math.Mult) { // x[i] = mult*x[i]
-		this.elements.assign(function);
-	}
-	else {
-		super.assign(function);
-	}
-	return this;
+  if (this.isNoView && function instanceof org.apache.mahout.jet.math.Mult) { // x[i] = mult*x[i]
+    this.elements.assign(function);
+  }
+  else {
+    super.assign(function);
+  }
+  return this;
 }
 /**
  * Replaces all cell values of the receiver with the values of another matrix.
@@ -187,78 +187,78 @@
  *
  * @param     source   the source matrix to copy from (may be identical to the receiver).
  * @return <tt>this</tt> (for convenience only).
- * @throws	IllegalArgumentException if <tt>columns() != source.columns() || rows() != source.rows()</tt>
+ * @throws  IllegalArgumentException if <tt>columns() != source.columns() || rows() != source.rows()</tt>
  */
 public DoubleMatrix2D assign(DoubleMatrix2D source) {
-	// overriden for performance only
-	if (! (source instanceof SparseDoubleMatrix2D)) {
-		return super.assign(source);
-	}
-	SparseDoubleMatrix2D other = (SparseDoubleMatrix2D) source;
-	if (other==this) return this; // nothing to do
-	checkShape(other);
-	
-	if (this.isNoView && other.isNoView) { // quickest
-		this.elements.assign(other.elements);
-		return this;
-	}
-	return super.assign(source);
+  // overriden for performance only
+  if (! (source instanceof SparseDoubleMatrix2D)) {
+    return super.assign(source);
+  }
+  SparseDoubleMatrix2D other = (SparseDoubleMatrix2D) source;
+  if (other==this) return this; // nothing to do
+  checkShape(other);
+  
+  if (this.isNoView && other.isNoView) { // quickest
+    this.elements.assign(other.elements);
+    return this;
+  }
+  return super.assign(source);
 }
 public DoubleMatrix2D assign(final DoubleMatrix2D y, org.apache.mahout.matrix.function.DoubleDoubleFunction function) {
-	if (!this.isNoView) return super.assign(y,function);
-	
-	checkShape(y);
+  if (!this.isNoView) return super.assign(y,function);
+  
+  checkShape(y);
 
-	if (function instanceof org.apache.mahout.jet.math.PlusMult) { // x[i] = x[i] + alpha*y[i]
-		final double alpha = ((org.apache.mahout.jet.math.PlusMult) function).multiplicator;
-		if (alpha==0) return this; // nothing to do
-		y.forEachNonZero(
-			new org.apache.mahout.matrix.function.IntIntDoubleFunction() {
-				public double apply(int i, int j, double value) {
-					setQuick(i,j,getQuick(i,j) + alpha*value);
-					return value;
-				}
-			}
-		);
-		return this;
-	}
+  if (function instanceof org.apache.mahout.jet.math.PlusMult) { // x[i] = x[i] + alpha*y[i]
+    final double alpha = ((org.apache.mahout.jet.math.PlusMult) function).multiplicator;
+    if (alpha==0) return this; // nothing to do
+    y.forEachNonZero(
+      new org.apache.mahout.matrix.function.IntIntDoubleFunction() {
+        public double apply(int i, int j, double value) {
+          setQuick(i,j,getQuick(i,j) + alpha*value);
+          return value;
+        }
+      }
+    );
+    return this;
+  }
 
-	if (function== org.apache.mahout.jet.math.Functions.mult) { // x[i] = x[i] * y[i]
-		this.elements.forEachPair(
-			new org.apache.mahout.matrix.function.IntDoubleProcedure() {
-				public boolean apply(int key, double value) {
-					int i = key/columns;
-					int j = key%columns;
-					double r = value * y.getQuick(i,j);
-					if (r!=value) elements.put(key,r);
-					return true;
-				}
-			}
-		);
-	}
-	
-	if (function== org.apache.mahout.jet.math.Functions.div) { // x[i] = x[i] / y[i]
-		this.elements.forEachPair(
-			new org.apache.mahout.matrix.function.IntDoubleProcedure() {
-				public boolean apply(int key, double value) {
-					int i = key/columns;
-					int j = key%columns;
-					double r = value / y.getQuick(i,j);
-					if (r!=value) elements.put(key,r);
-					return true;
-				}
-			}
-		);
-	}
-	
-	return super.assign(y,function);
+  if (function== org.apache.mahout.jet.math.Functions.mult) { // x[i] = x[i] * y[i]
+    this.elements.forEachPair(
+      new org.apache.mahout.matrix.function.IntDoubleProcedure() {
+        public boolean apply(int key, double value) {
+          int i = key/columns;
+          int j = key%columns;
+          double r = value * y.getQuick(i,j);
+          if (r!=value) elements.put(key,r);
+          return true;
+        }
+      }
+    );
+  }
+  
+  if (function== org.apache.mahout.jet.math.Functions.div) { // x[i] = x[i] / y[i]
+    this.elements.forEachPair(
+      new org.apache.mahout.matrix.function.IntDoubleProcedure() {
+        public boolean apply(int key, double value) {
+          int i = key/columns;
+          int j = key%columns;
+          double r = value / y.getQuick(i,j);
+          if (r!=value) elements.put(key,r);
+          return true;
+        }
+      }
+    );
+  }
+  
+  return super.assign(y,function);
 }
 /**
  * Returns the number of cells having non-zero values.
  */
 public int cardinality() {
-	if (this.isNoView) return this.elements.size();
-	else return super.cardinality();
+  if (this.isNoView) return this.elements.size();
+  else return super.cardinality();
 }
 /**
  * Ensures that the receiver can hold at least the specified number of non-zero cells without needing to allocate new internal memory.
@@ -271,26 +271,26 @@
  * @param   minNonZeros   the desired minimum number of non-zero cells.
  */
 public void ensureCapacity(int minCapacity) {
-	this.elements.ensureCapacity(minCapacity);
+  this.elements.ensureCapacity(minCapacity);
 }
 public DoubleMatrix2D forEachNonZero(final org.apache.mahout.matrix.function.IntIntDoubleFunction function) {
-	if (this.isNoView) {
-		this.elements.forEachPair(
-			new org.apache.mahout.matrix.function.IntDoubleProcedure() {
-				public boolean apply(int key, double value) {
-					int i = key/columns;
-					int j = key%columns;
-					double r = function.apply(i,j,value);
-					if (r!=value) elements.put(key,r);
-					return true;
-				}
-			}
-		);
-	}
-	else {
-		super.forEachNonZero(function);
-	}
-	return this;
+  if (this.isNoView) {
+    this.elements.forEachPair(
+      new org.apache.mahout.matrix.function.IntDoubleProcedure() {
+        public boolean apply(int key, double value) {
+          int i = key/columns;
+          int j = key%columns;
+          double r = function.apply(i,j,value);
+          if (r!=value) elements.put(key,r);
+          return true;
+        }
+      }
+    );
+  }
+  else {
+    super.forEachNonZero(function);
+  }
+  return this;
 }
 /**
  * Returns the matrix cell value at coordinate <tt>[row,column]</tt>.
@@ -304,10 +304,10 @@
  * @return    the value at the specified coordinate.
  */
 public double getQuick(int row, int column) {
-	//if (debug) if (column<0 || column>=columns || row<0 || row>=rows) throw new IndexOutOfBoundsException("row:"+row+", column:"+column);
-	//return this.elements.get(index(row,column));
-	//manually inlined:
-	return this.elements.get(rowZero + row*rowStride + columnZero + column*columnStride);
+  //if (debug) if (column<0 || column>=columns || row<0 || row>=rows) throw new IndexOutOfBoundsException("row:"+row+", column:"+column);
+  //return this.elements.get(index(row,column));
+  //manually inlined:
+  return this.elements.get(rowZero + row*rowStride + columnZero + column*columnStride);
 }
 /**
  * Returns <tt>true</tt> if both matrices share common cells.
@@ -319,15 +319,15 @@
  * </ul>
  */
 protected boolean haveSharedCellsRaw(DoubleMatrix2D other) {
-	if (other instanceof SelectedSparseDoubleMatrix2D) {
-		SelectedSparseDoubleMatrix2D otherMatrix = (SelectedSparseDoubleMatrix2D) other;
-		return this.elements==otherMatrix.elements;
-	}
-	else if (other instanceof SparseDoubleMatrix2D) {
-		SparseDoubleMatrix2D otherMatrix = (SparseDoubleMatrix2D) other;
-		return this.elements==otherMatrix.elements;
-	}
-	return false;
+  if (other instanceof SelectedSparseDoubleMatrix2D) {
+    SelectedSparseDoubleMatrix2D otherMatrix = (SelectedSparseDoubleMatrix2D) other;
+    return this.elements==otherMatrix.elements;
+  }
+  else if (other instanceof SparseDoubleMatrix2D) {
+    SparseDoubleMatrix2D otherMatrix = (SparseDoubleMatrix2D) other;
+    return this.elements==otherMatrix.elements;
+  }
+  return false;
 }
 /**
  * Returns the position of the given coordinate within the (virtual or non-virtual) internal 1-dimensional array. 
@@ -336,9 +336,9 @@
  * @param     column   the index of the column-coordinate.
  */
 protected int index(int row, int column) {
-	// return super.index(row,column);
-	// manually inlined for speed:
-	return rowZero + row*rowStride + columnZero + column*columnStride;
+  // return super.index(row,column);
+  // manually inlined for speed:
+  return rowZero + row*rowStride + columnZero + column*columnStride;
 }
 /**
  * Construct and returns a new empty matrix <i>of the same dynamic type</i> as the receiver, having the specified number of rows and columns.
@@ -351,7 +351,7 @@
  * @return  a new empty matrix of the same dynamic type.
  */
 public DoubleMatrix2D like(int rows, int columns) {
-	return new SparseDoubleMatrix2D(rows, columns);
+  return new SparseDoubleMatrix2D(rows, columns);
 }
 /**
  * Construct and returns a new 1-d matrix <i>of the corresponding dynamic type</i>, entirelly independent of the receiver.
@@ -362,7 +362,7 @@
  * @return  a new matrix of the corresponding dynamic type.
  */
 public DoubleMatrix1D like1D(int size) {
-	return new SparseDoubleMatrix1D(size);
+  return new SparseDoubleMatrix1D(size);
 }
 /**
  * Construct and returns a new 1-d matrix <i>of the corresponding dynamic type</i>, sharing the same cells.
@@ -375,7 +375,7 @@
  * @return  a new matrix of the corresponding dynamic type.
  */
 protected DoubleMatrix1D like1D(int size, int offset, int stride) {
-	return new SparseDoubleMatrix1D(size,this.elements,offset,stride);
+  return new SparseDoubleMatrix1D(size,this.elements,offset,stride);
 }
 /**
  * Sets the matrix cell at coordinate <tt>[row,column]</tt> to the specified value.
@@ -389,16 +389,16 @@
  * @param    value the value to be filled into the specified cell.
  */
 public void setQuick(int row, int column, double value) {
-	//if (debug) if (column<0 || column>=columns || row<0 || row>=rows) throw new IndexOutOfBoundsException("row:"+row+", column:"+column);
-	//int index =	index(row,column);
-	//manually inlined:
-	int index = rowZero + row*rowStride + columnZero + column*columnStride;
+  //if (debug) if (column<0 || column>=columns || row<0 || row>=rows) throw new IndexOutOfBoundsException("row:"+row+", column:"+column);
+  //int index =  index(row,column);
+  //manually inlined:
+  int index = rowZero + row*rowStride + columnZero + column*columnStride;
 
-	//if (value == 0 || Math.abs(value) < TOLERANCE)
-	if (value == 0)
-		this.elements.removeKey(index);
-	else 
-		this.elements.put(index, value);
+  //if (value == 0 || Math.abs(value) < TOLERANCE)
+  if (value == 0)
+    this.elements.removeKey(index);
+  else 
+    this.elements.put(index, value);
 }
 /**
  * Releases any superfluous memory created by explicitly putting zero values into cells formerly having non-zero values; 
@@ -418,7 +418,7 @@
  * Putting zeros into cells already containing zeros does not generate obsolete memory since no memory was allocated to them in the first place.
  */
 public void trimToSize() {
-	this.elements.trimToSize();
+  this.elements.trimToSize();
 }
 /**
  * Construct and returns a new selection view.
@@ -428,117 +428,117 @@
  * @return  a new view.
  */
 protected DoubleMatrix2D viewSelectionLike(int[] rowOffsets, int[] columnOffsets) {
-	return new SelectedSparseDoubleMatrix2D(this.elements,rowOffsets,columnOffsets,0);
+  return new SelectedSparseDoubleMatrix2D(this.elements,rowOffsets,columnOffsets,0);
 }
 public DoubleMatrix1D zMult(DoubleMatrix1D y, DoubleMatrix1D z, double alpha, double beta, final boolean transposeA) {
-	int m = rows;
-	int n = columns;
-	if (transposeA) {
-		m = columns;
-		n = rows;
-	}
+  int m = rows;
+  int n = columns;
+  if (transposeA) {
+    m = columns;
+    n = rows;
+  }
 
-	boolean ignore = (z==null);
-	if (z==null) z = new DenseDoubleMatrix1D(m);
-	
-	if (!(this.isNoView && y instanceof DenseDoubleMatrix1D && z instanceof DenseDoubleMatrix1D)) {
-		return super.zMult(y,z,alpha,beta,transposeA);
-	}
+  boolean ignore = (z==null);
+  if (z==null) z = new DenseDoubleMatrix1D(m);
+  
+  if (!(this.isNoView && y instanceof DenseDoubleMatrix1D && z instanceof DenseDoubleMatrix1D)) {
+    return super.zMult(y,z,alpha,beta,transposeA);
+  }
 
-	if (n != y.size() || m > z.size())	
-		throw new IllegalArgumentException("Incompatible args: "+ ((transposeA ? viewDice() : this).toStringShort()) +", "+y.toStringShort()+", "+z.toStringShort());
+  if (n != y.size() || m > z.size())  
+    throw new IllegalArgumentException("Incompatible args: "+ ((transposeA ? viewDice() : this).toStringShort()) +", "+y.toStringShort()+", "+z.toStringShort());
 
-	if (!ignore) z.assign(org.apache.mahout.jet.math.Functions.mult(beta/alpha));
-	
-	DenseDoubleMatrix1D zz = (DenseDoubleMatrix1D) z;
-	final double[] zElements = zz.elements;
-	final int zStride = zz.stride;
-	final int zi = z.index(0);
-	
-	DenseDoubleMatrix1D yy = (DenseDoubleMatrix1D) y;
-	final double[] yElements = yy.elements;
-	final int yStride = yy.stride;
-	final int yi = y.index(0);
+  if (!ignore) z.assign(org.apache.mahout.jet.math.Functions.mult(beta/alpha));
+  
+  DenseDoubleMatrix1D zz = (DenseDoubleMatrix1D) z;
+  final double[] zElements = zz.elements;
+  final int zStride = zz.stride;
+  final int zi = z.index(0);
+  
+  DenseDoubleMatrix1D yy = (DenseDoubleMatrix1D) y;
+  final double[] yElements = yy.elements;
+  final int yStride = yy.stride;
+  final int yi = y.index(0);
 
-	if (yElements==null || zElements==null) throw new InternalError();
+  if (yElements==null || zElements==null) throw new InternalError();
 
-	this.elements.forEachPair(
-		new org.apache.mahout.matrix.function.IntDoubleProcedure() {
-			public boolean apply(int key, double value) {
-				int i = key/columns;
-				int j = key%columns;
-				if (transposeA) { int tmp=i; i=j; j=tmp; }
-				zElements[zi + zStride*i] += value * yElements[yi + yStride*j];
-				//System.out.println("["+i+","+j+"]-->"+value);
-				return true;
-			}
-		}
-	);
-	
-	/*
-	forEachNonZero(
-		new org.apache.mahout.matrix.function.IntIntDoubleFunction() {
-			public double apply(int i, int j, double value) {
-				if (transposeA) { int tmp=i; i=j; j=tmp; }
-				zElements[zi + zStride*i] += value * yElements[yi + yStride*j];
-				//z.setQuick(row,z.getQuick(row) + value * y.getQuick(column));
-				//System.out.println("["+i+","+j+"]-->"+value);
-				return value;
-			}
-		}
-	);
-	*/
-	
-	if (alpha!=1) z.assign(org.apache.mahout.jet.math.Functions.mult(alpha));
-	return z;
+  this.elements.forEachPair(
+    new org.apache.mahout.matrix.function.IntDoubleProcedure() {
+      public boolean apply(int key, double value) {
+        int i = key/columns;
+        int j = key%columns;
+        if (transposeA) { int tmp=i; i=j; j=tmp; }
+        zElements[zi + zStride*i] += value * yElements[yi + yStride*j];
+        //System.out.println("["+i+","+j+"]-->"+value);
+        return true;
+      }
+    }
+  );
+  
+  /*
+  forEachNonZero(
+    new org.apache.mahout.matrix.function.IntIntDoubleFunction() {
+      public double apply(int i, int j, double value) {
+        if (transposeA) { int tmp=i; i=j; j=tmp; }
+        zElements[zi + zStride*i] += value * yElements[yi + yStride*j];
+        //z.setQuick(row,z.getQuick(row) + value * y.getQuick(column));
+        //System.out.println("["+i+","+j+"]-->"+value);
+        return value;
+      }
+    }
+  );
+  */
+  
+  if (alpha!=1) z.assign(org.apache.mahout.jet.math.Functions.mult(alpha));
+  return z;
 }
 public DoubleMatrix2D zMult(DoubleMatrix2D B, DoubleMatrix2D C, final double alpha, double beta, final boolean transposeA, boolean transposeB) {
-	if (!(this.isNoView)) {
-		return super.zMult(B,C,alpha,beta,transposeA,transposeB);
-	}
-	if (transposeB) B = B.viewDice();
-	int m = rows;
-	int n = columns;
-	if (transposeA) {
-		m = columns;
-		n = rows;
-	}
-	int p = B.columns;
-	boolean ignore = (C==null);
-	if (C==null) C = new DenseDoubleMatrix2D(m,p);
+  if (!(this.isNoView)) {
+    return super.zMult(B,C,alpha,beta,transposeA,transposeB);
+  }
+  if (transposeB) B = B.viewDice();
+  int m = rows;
+  int n = columns;
+  if (transposeA) {
+    m = columns;
+    n = rows;
+  }
+  int p = B.columns;
+  boolean ignore = (C==null);
+  if (C==null) C = new DenseDoubleMatrix2D(m,p);
 
-	if (B.rows != n)
-		throw new IllegalArgumentException("Matrix2D inner dimensions must agree:"+toStringShort()+", "+ (transposeB ? B.viewDice() : B).toStringShort());
-	if (C.rows != m || C.columns != p)
-		throw new IllegalArgumentException("Incompatibel result matrix: "+toStringShort()+", "+ (transposeB ? B.viewDice() : B).toStringShort()+", "+C.toStringShort());
-	if (this == C || B == C)
-		throw new IllegalArgumentException("Matrices must not be identical");
-	
-	if (!ignore) C.assign(org.apache.mahout.jet.math.Functions.mult(beta));
+  if (B.rows != n)
+    throw new IllegalArgumentException("Matrix2D inner dimensions must agree:"+toStringShort()+", "+ (transposeB ? B.viewDice() : B).toStringShort());
+  if (C.rows != m || C.columns != p)
+    throw new IllegalArgumentException("Incompatibel result matrix: "+toStringShort()+", "+ (transposeB ? B.viewDice() : B).toStringShort()+", "+C.toStringShort());
+  if (this == C || B == C)
+    throw new IllegalArgumentException("Matrices must not be identical");
+  
+  if (!ignore) C.assign(org.apache.mahout.jet.math.Functions.mult(beta));
 
-	// cache views	
-	final DoubleMatrix1D[] Brows = new DoubleMatrix1D[n];
-	for (int i=n; --i>=0; ) Brows[i] = B.viewRow(i);
-	final DoubleMatrix1D[] Crows = new DoubleMatrix1D[m];
-	for (int i=m; --i>=0; ) Crows[i] = C.viewRow(i);
+  // cache views  
+  final DoubleMatrix1D[] Brows = new DoubleMatrix1D[n];
+  for (int i=n; --i>=0; ) Brows[i] = B.viewRow(i);
+  final DoubleMatrix1D[] Crows = new DoubleMatrix1D[m];
+  for (int i=m; --i>=0; ) Crows[i] = C.viewRow(i);
 
-	final org.apache.mahout.jet.math.PlusMult fun = org.apache.mahout.jet.math.PlusMult.plusMult(0);
+  final org.apache.mahout.jet.math.PlusMult fun = org.apache.mahout.jet.math.PlusMult.plusMult(0);
 
-	this.elements.forEachPair(
-		new org.apache.mahout.matrix.function.IntDoubleProcedure() {
-			public boolean apply(int key, double value) {
-				int i = key/columns;
-				int j = key%columns;
-				fun.multiplicator = value*alpha;
-				if (!transposeA)
-					Crows[i].assign(Brows[j],fun);
-				else
-					Crows[j].assign(Brows[i],fun);
-				return true;
-			}
-		}
-	);
+  this.elements.forEachPair(
+    new org.apache.mahout.matrix.function.IntDoubleProcedure() {
+      public boolean apply(int key, double value) {
+        int i = key/columns;
+        int j = key%columns;
+        fun.multiplicator = value*alpha;
+        if (!transposeA)
+          Crows[i].assign(Brows[j],fun);
+        else
+          Crows[j].assign(Brows[i],fun);
+        return true;
+      }
+    }
+  );
 
-	return C;
+  return C;
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/TridiagonalDoubleMatrix2D.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/TridiagonalDoubleMatrix2D.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/TridiagonalDoubleMatrix2D.java	(working copy)
@@ -21,29 +21,29 @@
 @version 0.9, 04/14/2000
 */
 class TridiagonalDoubleMatrix2D extends WrapperDoubleMatrix2D {
-	/*
-	 * The non zero elements of the matrix: {lower, diagonal, upper}.
-	 */
-	protected double[] values; 
+  /*
+   * The non zero elements of the matrix: {lower, diagonal, upper}.
+   */
+  protected double[] values; 
 
-	/*
-	 * The startIndexes and number of non zeros: {lowerStart, diagonalStart, upperStart, values.length, lowerNonZeros, diagonalNonZeros, upperNonZeros}.
-	 * lowerStart = 0
-	 * diagonalStart = lowerStart + lower.length
-	 * upperStart = diagonalStart + diagonal.length
-	 */
-	protected int[] dims;
+  /*
+   * The startIndexes and number of non zeros: {lowerStart, diagonalStart, upperStart, values.length, lowerNonZeros, diagonalNonZeros, upperNonZeros}.
+   * lowerStart = 0
+   * diagonalStart = lowerStart + lower.length
+   * upperStart = diagonalStart + diagonal.length
+   */
+  protected int[] dims;
 
-	protected static final int NONZERO = 4;
-	
-	//protected double diagonal[];
-	//protected double lower[];
-	//protected double upper[];
+  protected static final int NONZERO = 4;
+  
+  //protected double diagonal[];
+  //protected double lower[];
+  //protected double upper[];
 
-	//protected int diagonalNonZeros;
-	//protected int lowerNonZeros;
-	//protected int upperNonZeros;
-	//protected int N;
+  //protected int diagonalNonZeros;
+  //protected int lowerNonZeros;
+  //protected int upperNonZeros;
+  //protected int N;
 /**
  * Constructs a matrix with a copy of the given values.
  * <tt>values</tt> is required to have the form <tt>values[row][column]</tt>
@@ -55,37 +55,37 @@
  * @throws IllegalArgumentException if <tt>for any 1 &lt;= row &lt; values.length: values[row].length != values[row-1].length</tt>.
  */
 public TridiagonalDoubleMatrix2D(double[][] values) {
-	this(values.length, values.length==0 ? 0: values[0].length);
-	assign(values);
+  this(values.length, values.length==0 ? 0: values[0].length);
+  assign(values);
 }
 /**
  * Constructs a matrix with a given number of rows and columns.
  * All entries are initially <tt>0</tt>.
  * @param rows the number of rows the matrix shall have.
  * @param columns the number of columns the matrix shall have.
- * @throws	IllegalArgumentException if <tt>rows<0 || columns<0 || (double)columns*rows > Integer.MAX_VALUE</tt>.
+ * @throws  IllegalArgumentException if <tt>rows<0 || columns<0 || (double)columns*rows > Integer.MAX_VALUE</tt>.
  */
 public TridiagonalDoubleMatrix2D(int rows, int columns) {
-	super(null);
-	setUp(rows, columns);
-	
-	int d = Math.min(rows,columns);
-	int u = d-1;
-	int l = d-1;
-	if (rows>columns) l++;
-	if (rows<columns) u++;
+  super(null);
+  setUp(rows, columns);
+  
+  int d = Math.min(rows,columns);
+  int u = d-1;
+  int l = d-1;
+  if (rows>columns) l++;
+  if (rows<columns) u++;
 
-	values = new double[l+d+u]; // {lower, diagonal, upper}
-	int[] dimensions = { 0, l, l+d, l+d+u, 0, 0, 0}; // {lowerStart, diagonalStart, upperStart, values.length, lowerNonZeros, diagonalNonZeros, upperNonZeros}
-	dims = dimensions;
-	
-	//diagonal = new double[d];
-	//lower = new double[l];
-	//upper = new double[u];
+  values = new double[l+d+u]; // {lower, diagonal, upper}
+  int[] dimensions = { 0, l, l+d, l+d+u, 0, 0, 0}; // {lowerStart, diagonalStart, upperStart, values.length, lowerNonZeros, diagonalNonZeros, upperNonZeros}
+  dims = dimensions;
+  
+  //diagonal = new double[d];
+  //lower = new double[l];
+  //upper = new double[u];
 
-	//diagonalNonZeros = 0;
-	//lowerNonZeros = 0;
-	//upperNonZeros = 0;
+  //diagonalNonZeros = 0;
+  //lowerNonZeros = 0;
+  //upperNonZeros = 0;
 }
 /**
  * Sets all cells to the state specified by <tt>value</tt>.
@@ -93,48 +93,48 @@
  * @return <tt>this</tt> (for convenience only).
  */
 public DoubleMatrix2D assign(double value) {
-	// overriden for performance only
-	if (value==0) {
-		for (int i=values.length; --i >= 0; ) values[i]=0;
-		for (int i=dims.length; --i >= NONZERO; ) dims[i]=0;
-		
-		//for (int i=diagonal.length; --i >= 0; ) diagonal[i]=0;
-		//for (int i=upper.length; --i >= 0; ) upper[i]=0;
-		//for (int i=lower.length; --i >= 0; ) lower[i]=0;
-		
-		//diagonalNonZeros = 0;
-		//lowerNonZeros = 0;
-		//upperNonZeros = 0;
-	}
-	else super.assign(value);
-	return this;
+  // overriden for performance only
+  if (value==0) {
+    for (int i=values.length; --i >= 0; ) values[i]=0;
+    for (int i=dims.length; --i >= NONZERO; ) dims[i]=0;
+    
+    //for (int i=diagonal.length; --i >= 0; ) diagonal[i]=0;
+    //for (int i=upper.length; --i >= 0; ) upper[i]=0;
+    //for (int i=lower.length; --i >= 0; ) lower[i]=0;
+    
+    //diagonalNonZeros = 0;
+    //lowerNonZeros = 0;
+    //upperNonZeros = 0;
+  }
+  else super.assign(value);
+  return this;
 }
 public DoubleMatrix2D assign(final org.apache.mahout.matrix.function.DoubleFunction function) {
-	if (function instanceof org.apache.mahout.jet.math.Mult) { // x[i] = mult*x[i]
-		final double alpha = ((org.apache.mahout.jet.math.Mult) function).multiplicator;
-		if (alpha==1) return this;
-		if (alpha==0) return assign(0);
-		if (alpha!=alpha) return assign(alpha); // the funny definition of isNaN(). This should better not happen.
+  if (function instanceof org.apache.mahout.jet.math.Mult) { // x[i] = mult*x[i]
+    final double alpha = ((org.apache.mahout.jet.math.Mult) function).multiplicator;
+    if (alpha==1) return this;
+    if (alpha==0) return assign(0);
+    if (alpha!=alpha) return assign(alpha); // the funny definition of isNaN(). This should better not happen.
 
-		/*
-		double[] vals = values.elements();
-		for (int j=values.size(); --j >= 0; ) {
-			vals[j] *= alpha;
-		}
-		*/
+    /*
+    double[] vals = values.elements();
+    for (int j=values.size(); --j >= 0; ) {
+      vals[j] *= alpha;
+    }
+    */
 
-		forEachNonZero(
-			new org.apache.mahout.matrix.function.IntIntDoubleFunction() {
-				public double apply(int i, int j, double value) {
-					return function.apply(value);
-				}
-			}
-		);
-	}
-	else {
-		super.assign(function);
-	}
-	return this;
+    forEachNonZero(
+      new org.apache.mahout.matrix.function.IntIntDoubleFunction() {
+        public double apply(int i, int j, double value) {
+          return function.apply(value);
+        }
+      }
+    );
+  }
+  else {
+    super.assign(function);
+  }
+  return this;
 }
 /**
  * Replaces all cell values of the receiver with the values of another matrix.
@@ -143,110 +143,110 @@
  *
  * @param     source   the source matrix to copy from (may be identical to the receiver).
  * @return <tt>this</tt> (for convenience only).
- * @throws	IllegalArgumentException if <tt>columns() != source.columns() || rows() != source.rows()</tt>
+ * @throws  IllegalArgumentException if <tt>columns() != source.columns() || rows() != source.rows()</tt>
  */
 public DoubleMatrix2D assign(DoubleMatrix2D source) {
-	// overriden for performance only
-	if (source==this) return this; // nothing to do
-	checkShape(source);
+  // overriden for performance only
+  if (source==this) return this; // nothing to do
+  checkShape(source);
 
-	if (source instanceof TridiagonalDoubleMatrix2D) {
-		// quickest
-		TridiagonalDoubleMatrix2D other = (TridiagonalDoubleMatrix2D) source;
-		
-		System.arraycopy(other.values, 0, this.values, 0, this.values.length);
-		System.arraycopy(other.dims, 0, this.dims, 0, this.dims.length);
-		return this;
-	}
+  if (source instanceof TridiagonalDoubleMatrix2D) {
+    // quickest
+    TridiagonalDoubleMatrix2D other = (TridiagonalDoubleMatrix2D) source;
+    
+    System.arraycopy(other.values, 0, this.values, 0, this.values.length);
+    System.arraycopy(other.dims, 0, this.dims, 0, this.dims.length);
+    return this;
+  }
 
-	if (source instanceof RCDoubleMatrix2D || source instanceof SparseDoubleMatrix2D) {
-		assign(0);
-		source.forEachNonZero(
-			new org.apache.mahout.matrix.function.IntIntDoubleFunction() {
-				public double apply(int i, int j, double value) {
-					setQuick(i,j,value);
-					return value;
-				}
-			}
-		);	
-		return this;
-	}
-	
-	return super.assign(source);
+  if (source instanceof RCDoubleMatrix2D || source instanceof SparseDoubleMatrix2D) {
+    assign(0);
+    source.forEachNonZero(
+      new org.apache.mahout.matrix.function.IntIntDoubleFunction() {
+        public double apply(int i, int j, double value) {
+          setQuick(i,j,value);
+          return value;
+        }
+      }
+    );  
+    return this;
+  }
+  
+  return super.assign(source);
 }
 public DoubleMatrix2D assign(final DoubleMatrix2D y, org.apache.mahout.matrix.function.DoubleDoubleFunction function) {
-	checkShape(y);
+  checkShape(y);
 
-	if (function instanceof org.apache.mahout.jet.math.PlusMult) { // x[i] = x[i] + alpha*y[i]
-		final double alpha = ((org.apache.mahout.jet.math.PlusMult) function).multiplicator;
-		if (alpha==0) return this; // nothing to do
-		y.forEachNonZero(
-			new org.apache.mahout.matrix.function.IntIntDoubleFunction() {
-				public double apply(int i, int j, double value) {
-					setQuick(i,j,getQuick(i,j) + alpha*value);
-					return value;
-				}
-			}
-		);
-		return this;
-	}
+  if (function instanceof org.apache.mahout.jet.math.PlusMult) { // x[i] = x[i] + alpha*y[i]
+    final double alpha = ((org.apache.mahout.jet.math.PlusMult) function).multiplicator;
+    if (alpha==0) return this; // nothing to do
+    y.forEachNonZero(
+      new org.apache.mahout.matrix.function.IntIntDoubleFunction() {
+        public double apply(int i, int j, double value) {
+          setQuick(i,j,getQuick(i,j) + alpha*value);
+          return value;
+        }
+      }
+    );
+    return this;
+  }
 
-	if (function== org.apache.mahout.jet.math.Functions.mult) { // x[i] = x[i] * y[i]
-		forEachNonZero(
-			new org.apache.mahout.matrix.function.IntIntDoubleFunction() {
-				public double apply(int i, int j, double value) {
-					setQuick(i,j,getQuick(i,j) * y.getQuick(i,j));
-					return value;
-				}
-			}
-		);
-		return this;
-	}
-	
-	if (function== org.apache.mahout.jet.math.Functions.div) { // x[i] = x[i] / y[i]
-		forEachNonZero(
-			new org.apache.mahout.matrix.function.IntIntDoubleFunction() {
-				public double apply(int i, int j, double value) {
-					setQuick(i,j,getQuick(i,j) / y.getQuick(i,j));
-					return value;
-				}
-			}
-		);
-		return this;
-	}
-	
-	return super.assign(y,function);
+  if (function== org.apache.mahout.jet.math.Functions.mult) { // x[i] = x[i] * y[i]
+    forEachNonZero(
+      new org.apache.mahout.matrix.function.IntIntDoubleFunction() {
+        public double apply(int i, int j, double value) {
+          setQuick(i,j,getQuick(i,j) * y.getQuick(i,j));
+          return value;
+        }
+      }
+    );
+    return this;
+  }
+  
+  if (function== org.apache.mahout.jet.math.Functions.div) { // x[i] = x[i] / y[i]
+    forEachNonZero(
+      new org.apache.mahout.matrix.function.IntIntDoubleFunction() {
+        public double apply(int i, int j, double value) {
+          setQuick(i,j,getQuick(i,j) / y.getQuick(i,j));
+          return value;
+        }
+      }
+    );
+    return this;
+  }
+  
+  return super.assign(y,function);
 }
 public DoubleMatrix2D forEachNonZero(final org.apache.mahout.matrix.function.IntIntDoubleFunction function) {
-	for (int kind=0; kind<=2; kind++) {
-		int i=0,j=0;
-		switch (kind) {
-			case 0: { i=1; } // lower 
-			// case 1: {   } // diagonal
-			case 2: { j=1; } // upper
-		}
-		int low = dims[kind];
-		int high = dims[kind+1];
-		
-		for (int k=low; k < high; k++, i++, j++) {
-			double value = values[k];
-			if (value!=0) {
-				double r = function.apply(i,j,value);
-				if (r!=value) {
-					if (r==0) dims[kind+NONZERO]++; // one non zero more
-					values[k] = r;
-				}
-			}
-		}
-	}
-	return this;
+  for (int kind=0; kind<=2; kind++) {
+    int i=0,j=0;
+    switch (kind) {
+      case 0: { i=1; } // lower 
+      // case 1: {   } // diagonal
+      case 2: { j=1; } // upper
+    }
+    int low = dims[kind];
+    int high = dims[kind+1];
+    
+    for (int k=low; k < high; k++, i++, j++) {
+      double value = values[k];
+      if (value!=0) {
+        double r = function.apply(i,j,value);
+        if (r!=value) {
+          if (r==0) dims[kind+NONZERO]++; // one non zero more
+          values[k] = r;
+        }
+      }
+    }
+  }
+  return this;
 }
 /**
  * Returns the content of this matrix if it is a wrapper; or <tt>this</tt> otherwise.
  * Override this method in wrappers.
  */
 protected DoubleMatrix2D getContent() {
-	return this;
+  return this;
 }
 /**
  * Returns the matrix cell value at coordinate <tt>[row,column]</tt>.
@@ -260,41 +260,41 @@
  * @return    the value at the specified coordinate.
  */
 public double getQuick(int row, int column) {
-	int i = row;
-	int j = column;
+  int i = row;
+  int j = column;
 
-	int k = j-i+1;
-	int q = i;
-	if (k==0) q=j; // lower diagonal
+  int k = j-i+1;
+  int q = i;
+  if (k==0) q=j; // lower diagonal
 
-	if (k>=0 && k<=2) {
-		return values[dims[k]+q];
-	}
-	return 0;
+  if (k>=0 && k<=2) {
+    return values[dims[k]+q];
+  }
+  return 0;
 
 
-	
-	
-	
-	//int k = -1;
-	//int q = 0;
+  
+  
+  
+  //int k = -1;
+  //int q = 0;
 
-	//if (i==j) { k=0; q=i; }
-	//if (i==j+1) { k=1; q=j; }
-	//if (i==j-1) { k=2; q=i; }
+  //if (i==j) { k=0; q=i; }
+  //if (i==j+1) { k=1; q=j; }
+  //if (i==j-1) { k=2; q=i; }
 
-	//if (k<0) return 0;
-	//return values[dims[k]+q];
+  //if (k<0) return 0;
+  //return values[dims[k]+q];
 
 
 
 
-	
-	//if (i==j) return diagonal[i];
-	//if (i==j+1) return lower[j];
-	//if (i==j-1) return upper[i];
+  
+  //if (i==j) return diagonal[i];
+  //if (i==j+1) return lower[j];
+  //if (i==j-1) return upper[i];
 
-	//return 0;
+  //return 0;
 }
 /**
  * Construct and returns a new empty matrix <i>of the same dynamic type</i> as the receiver, having the specified number of rows and columns.
@@ -307,7 +307,7 @@
  * @return  a new empty matrix of the same dynamic type.
  */
 public DoubleMatrix2D like(int rows, int columns) {
-	return new TridiagonalDoubleMatrix2D(rows,columns);
+  return new TridiagonalDoubleMatrix2D(rows,columns);
 }
 /**
  * Construct and returns a new 1-d matrix <i>of the corresponding dynamic type</i>, entirelly independent of the receiver.
@@ -318,7 +318,7 @@
  * @return  a new matrix of the corresponding dynamic type.
  */
 public DoubleMatrix1D like1D(int size) {
-	return new SparseDoubleMatrix1D(size);
+  return new SparseDoubleMatrix1D(size);
 }
 /**
  * Sets the matrix cell at coordinate <tt>[row,column]</tt> to the specified value.
@@ -332,179 +332,179 @@
  * @param    value the value to be filled into the specified cell.
  */
 public void setQuick(int row, int column, double value) {
-	int i = row;
-	int j = column;
+  int i = row;
+  int j = column;
 
-	boolean isZero = (value==0);
+  boolean isZero = (value==0);
 
-	int k = j-i+1;
-	int q = i;
-	if (k==0) q=j; // lower diagonal
+  int k = j-i+1;
+  int q = i;
+  if (k==0) q=j; // lower diagonal
 
-	if (k>=0 && k<=2) {
-		int index = dims[k]+q;
-		if (values[index]!=0) {
-			if (isZero) dims[k+NONZERO]--; // one nonZero less
-		}
-		else {
-			if (!isZero) dims[k+NONZERO]++; // one nonZero more
-		}
-		values[index] = value;
-		return;
-	}
-	
-	if (!isZero) throw new IllegalArgumentException("Can't store non-zero value to non-tridiagonal coordinate: row="+row+", column="+column+", value="+value);
+  if (k>=0 && k<=2) {
+    int index = dims[k]+q;
+    if (values[index]!=0) {
+      if (isZero) dims[k+NONZERO]--; // one nonZero less
+    }
+    else {
+      if (!isZero) dims[k+NONZERO]++; // one nonZero more
+    }
+    values[index] = value;
+    return;
+  }
+  
+  if (!isZero) throw new IllegalArgumentException("Can't store non-zero value to non-tridiagonal coordinate: row="+row+", column="+column+", value="+value);
 
-	//int k = -1;
-	//int q = 0;
+  //int k = -1;
+  //int q = 0;
 
-	//if (i==j) { k=0; q=i; } // diagonal
-	//if (i==j+1) { k=1; q=j; } // lower diagonal
-	//if (i==j-1) { k=2; q=i; } // upper diagonal
+  //if (i==j) { k=0; q=i; } // diagonal
+  //if (i==j+1) { k=1; q=j; } // lower diagonal
+  //if (i==j-1) { k=2; q=i; } // upper diagonal
 
-	//if (k>0) {
-		//int index = dims[k]+q;
-		//if (values[index]!=0) {
-			//if (isZero) dims[k+NONZERO]--; // one nonZero less
-		//}
-		//else {
-			//if (!isZero) dims[k+NONZERO]++; // one nonZero more
-		//}
-		//values[index] = value;
-		//return;
-	//}
-	
-	//if (!isZero) throw new IllegalArgumentException("Can't store non-zero value to non-tridiagonal coordinate: row="+row+", column="+column+", value="+value);
+  //if (k>0) {
+    //int index = dims[k]+q;
+    //if (values[index]!=0) {
+      //if (isZero) dims[k+NONZERO]--; // one nonZero less
+    //}
+    //else {
+      //if (!isZero) dims[k+NONZERO]++; // one nonZero more
+    //}
+    //values[index] = value;
+    //return;
+  //}
+  
+  //if (!isZero) throw new IllegalArgumentException("Can't store non-zero value to non-tridiagonal coordinate: row="+row+", column="+column+", value="+value);
 
 
 
 
 
-	
-	//if (i==j) {
-		//if (diagonal[i]!=0) {
-			//if (isZero) diagonalNonZeros--;
-		//}
-		//else {
-			//if (!isZero) diagonalNonZeros++;
-		//}
-		//diagonal[i] = value;
-		//return;
-	//}
-	
-	//if (i==j+1) {
-		//if (lower[j]!=0) {
-			//if (isZero) lowerNonZeros--;
-		//}
-		//else {
-			//if (!isZero) lowerNonZeros++;
-		//}
-		//lower[j] = value;
-		//return;
-	//}
-		
-	//if (i==j-1) {
-		//if (upper[i]!=0) {
-			//if (isZero) upperNonZeros--;
-		//}
-		//else {
-			//if (!isZero) upperNonZeros++;
-		//}
-		//upper[i] = value;
-		//return;
-	//}
+  
+  //if (i==j) {
+    //if (diagonal[i]!=0) {
+      //if (isZero) diagonalNonZeros--;
+    //}
+    //else {
+      //if (!isZero) diagonalNonZeros++;
+    //}
+    //diagonal[i] = value;
+    //return;
+  //}
+  
+  //if (i==j+1) {
+    //if (lower[j]!=0) {
+      //if (isZero) lowerNonZeros--;
+    //}
+    //else {
+      //if (!isZero) lowerNonZeros++;
+    //}
+    //lower[j] = value;
+    //return;
+  //}
+    
+  //if (i==j-1) {
+    //if (upper[i]!=0) {
+      //if (isZero) upperNonZeros--;
+    //}
+    //else {
+      //if (!isZero) upperNonZeros++;
+    //}
+    //upper[i] = value;
+    //return;
+  //}
 
-	//if (!isZero) throw new IllegalArgumentException("Can't store non-zero value to non-tridiagonal coordinate: row="+row+", column="+column+", value="+value);
+  //if (!isZero) throw new IllegalArgumentException("Can't store non-zero value to non-tridiagonal coordinate: row="+row+", column="+column+", value="+value);
 }
 public DoubleMatrix1D zMult(DoubleMatrix1D y, DoubleMatrix1D z, double alpha, double beta, final boolean transposeA) {
-	int m = rows;
-	int n = columns;
-	if (transposeA) {
-		m = columns;
-		n = rows;
-	}
+  int m = rows;
+  int n = columns;
+  if (transposeA) {
+    m = columns;
+    n = rows;
+  }
 
-	boolean ignore = (z==null);
-	if (z==null) z = new DenseDoubleMatrix1D(m);
-	
-	if (!(this.isNoView && y instanceof DenseDoubleMatrix1D && z instanceof DenseDoubleMatrix1D)) {
-		return super.zMult(y,z,alpha,beta,transposeA);
-	}
+  boolean ignore = (z==null);
+  if (z==null) z = new DenseDoubleMatrix1D(m);
+  
+  if (!(this.isNoView && y instanceof DenseDoubleMatrix1D && z instanceof DenseDoubleMatrix1D)) {
+    return super.zMult(y,z,alpha,beta,transposeA);
+  }
 
-	if (n != y.size() || m > z.size())	
-		throw new IllegalArgumentException("Incompatible args: "+ ((transposeA ? viewDice() : this).toStringShort()) +", "+y.toStringShort()+", "+z.toStringShort());
+  if (n != y.size() || m > z.size())  
+    throw new IllegalArgumentException("Incompatible args: "+ ((transposeA ? viewDice() : this).toStringShort()) +", "+y.toStringShort()+", "+z.toStringShort());
 
-	if (!ignore) z.assign(org.apache.mahout.jet.math.Functions.mult(beta/alpha));
-	
-	DenseDoubleMatrix1D zz = (DenseDoubleMatrix1D) z;
-	final double[] zElements = zz.elements;
-	final int zStride = zz.stride;
-	final int zi = z.index(0);
-	
-	DenseDoubleMatrix1D yy = (DenseDoubleMatrix1D) y;
-	final double[] yElements = yy.elements;
-	final int yStride = yy.stride;
-	final int yi = y.index(0);
+  if (!ignore) z.assign(org.apache.mahout.jet.math.Functions.mult(beta/alpha));
+  
+  DenseDoubleMatrix1D zz = (DenseDoubleMatrix1D) z;
+  final double[] zElements = zz.elements;
+  final int zStride = zz.stride;
+  final int zi = z.index(0);
+  
+  DenseDoubleMatrix1D yy = (DenseDoubleMatrix1D) y;
+  final double[] yElements = yy.elements;
+  final int yStride = yy.stride;
+  final int yi = y.index(0);
 
-	if (yElements==null || zElements==null) throw new InternalError();
+  if (yElements==null || zElements==null) throw new InternalError();
 
-	forEachNonZero(
-		new org.apache.mahout.matrix.function.IntIntDoubleFunction() {
-			public double apply(int i, int j, double value) {
-				if (transposeA) { int tmp=i; i=j; j=tmp; }
-				zElements[zi + zStride*i] += value * yElements[yi + yStride*j];
-				//z.setQuick(row,z.getQuick(row) + value * y.getQuick(column));
-				//System.out.println("["+i+","+j+"]-->"+value);
-				return value;
-			}
-		}
-	);
-	
-	if (alpha!=1) z.assign(org.apache.mahout.jet.math.Functions.mult(alpha));
-	return z;
+  forEachNonZero(
+    new org.apache.mahout.matrix.function.IntIntDoubleFunction() {
+      public double apply(int i, int j, double value) {
+        if (transposeA) { int tmp=i; i=j; j=tmp; }
+        zElements[zi + zStride*i] += value * yElements[yi + yStride*j];
+        //z.setQuick(row,z.getQuick(row) + value * y.getQuick(column));
+        //System.out.println("["+i+","+j+"]-->"+value);
+        return value;
+      }
+    }
+  );
+  
+  if (alpha!=1) z.assign(org.apache.mahout.jet.math.Functions.mult(alpha));
+  return z;
 }
 public DoubleMatrix2D zMult(DoubleMatrix2D B, DoubleMatrix2D C, final double alpha, double beta, final boolean transposeA, boolean transposeB) {
-	if (transposeB) B = B.viewDice();
-	int m = rows;
-	int n = columns;
-	if (transposeA) {
-		m = columns;
-		n = rows;
-	}
-	int p = B.columns;
-	boolean ignore = (C==null);
-	if (C==null) C = new DenseDoubleMatrix2D(m,p);
+  if (transposeB) B = B.viewDice();
+  int m = rows;
+  int n = columns;
+  if (transposeA) {
+    m = columns;
+    n = rows;
+  }
+  int p = B.columns;
+  boolean ignore = (C==null);
+  if (C==null) C = new DenseDoubleMatrix2D(m,p);
 
-	if (B.rows != n)
-		throw new IllegalArgumentException("Matrix2D inner dimensions must agree:"+toStringShort()+", "+ (transposeB ? B.viewDice() : B).toStringShort());
-	if (C.rows != m || C.columns != p)
-		throw new IllegalArgumentException("Incompatibel result matrix: "+toStringShort()+", "+ (transposeB ? B.viewDice() : B).toStringShort()+", "+C.toStringShort());
-	if (this == C || B == C)
-		throw new IllegalArgumentException("Matrices must not be identical");
-	
-	if (!ignore) C.assign(org.apache.mahout.jet.math.Functions.mult(beta));
+  if (B.rows != n)
+    throw new IllegalArgumentException("Matrix2D inner dimensions must agree:"+toStringShort()+", "+ (transposeB ? B.viewDice() : B).toStringShort());
+  if (C.rows != m || C.columns != p)
+    throw new IllegalArgumentException("Incompatibel result matrix: "+toStringShort()+", "+ (transposeB ? B.viewDice() : B).toStringShort()+", "+C.toStringShort());
+  if (this == C || B == C)
+    throw new IllegalArgumentException("Matrices must not be identical");
+  
+  if (!ignore) C.assign(org.apache.mahout.jet.math.Functions.mult(beta));
 
-	// cache views	
-	final DoubleMatrix1D[] Brows = new DoubleMatrix1D[n];
-	for (int i=n; --i>=0; ) Brows[i] = B.viewRow(i);
-	final DoubleMatrix1D[] Crows = new DoubleMatrix1D[m];
-	for (int i=m; --i>=0; ) Crows[i] = C.viewRow(i);
+  // cache views  
+  final DoubleMatrix1D[] Brows = new DoubleMatrix1D[n];
+  for (int i=n; --i>=0; ) Brows[i] = B.viewRow(i);
+  final DoubleMatrix1D[] Crows = new DoubleMatrix1D[m];
+  for (int i=m; --i>=0; ) Crows[i] = C.viewRow(i);
 
-	final org.apache.mahout.jet.math.PlusMult fun = org.apache.mahout.jet.math.PlusMult.plusMult(0);
+  final org.apache.mahout.jet.math.PlusMult fun = org.apache.mahout.jet.math.PlusMult.plusMult(0);
 
-	forEachNonZero(
-		new org.apache.mahout.matrix.function.IntIntDoubleFunction() {
-			public double apply(int i, int j, double value) {
-				fun.multiplicator = value*alpha;
-				if (!transposeA)
-					Crows[i].assign(Brows[j],fun);
-				else
-					Crows[j].assign(Brows[i],fun);
-				return value;
-			}
-		}
-	);
+  forEachNonZero(
+    new org.apache.mahout.matrix.function.IntIntDoubleFunction() {
+      public double apply(int i, int j, double value) {
+        fun.multiplicator = value*alpha;
+        if (!transposeA)
+          Crows[i].assign(Brows[j],fun);
+        else
+          Crows[j].assign(Brows[i],fun);
+        return value;
+      }
+    }
+  );
 
-	return C;
+  return C;
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/DenseDoubleMatrix2D.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/DenseDoubleMatrix2D.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/DenseDoubleMatrix2D.java	(working copy)
@@ -35,17 +35,17 @@
 Thus
 <pre>
    for (int row=0; row < rows; row++) {
-	  for (int column=0; column < columns; column++) {
-		 matrix.setQuick(row,column,someValue);
-	  }
+    for (int column=0; column < columns; column++) {
+     matrix.setQuick(row,column,someValue);
+    }
    }
 </pre>
 is quicker than
 <pre>
    for (int column=0; column < columns; column++) {
-	  for (int row=0; row < rows; row++) {
-		 matrix.setQuick(row,column,someValue);
-	  }
+    for (int row=0; row < rows; row++) {
+     matrix.setQuick(row,column,someValue);
+    }
    }
 </pre>
 @author wolfgang.hoschek@cern.ch
@@ -56,16 +56,16 @@
  */
 @Deprecated
 public class DenseDoubleMatrix2D extends DoubleMatrix2D {
-	static final long serialVersionUID = 1020177651L;
-	/**
-	  * The elements of this matrix.
-	  * elements are stored in row major, i.e.
-	  * index==row*columns + column
-	  * columnOf(index)==index%columns
-	  * rowOf(index)==index/columns
-	  * i.e. {row0 column0..m}, {row1 column0..m}, ..., {rown column0..m}
-	  */
-	protected double[] elements;
+  static final long serialVersionUID = 1020177651L;
+  /**
+    * The elements of this matrix.
+    * elements are stored in row major, i.e.
+    * index==row*columns + column
+    * columnOf(index)==index%columns
+    * rowOf(index)==index/columns
+    * i.e. {row0 column0..m}, {row1 column0..m}, ..., {rown column0..m}
+    */
+  protected double[] elements;
 /**
  * Constructs a matrix with a copy of the given values.
  * <tt>values</tt> is required to have the form <tt>values[row][column]</tt>
@@ -77,19 +77,19 @@
  * @throws IllegalArgumentException if <tt>for any 1 &lt;= row &lt; values.length: values[row].length != values[row-1].length</tt>.
  */
 public DenseDoubleMatrix2D(double[][] values) {
-	this(values.length, values.length==0 ? 0: values[0].length);
-	assign(values);
+  this(values.length, values.length==0 ? 0: values[0].length);
+  assign(values);
 }
 /**
  * Constructs a matrix with a given number of rows and columns.
  * All entries are initially <tt>0</tt>.
  * @param rows the number of rows the matrix shall have.
  * @param columns the number of columns the matrix shall have.
- * @throws	IllegalArgumentException if <tt>rows<0 || columns<0 || (double)columns*rows > Integer.MAX_VALUE</tt>.
+ * @throws  IllegalArgumentException if <tt>rows<0 || columns<0 || (double)columns*rows > Integer.MAX_VALUE</tt>.
  */
 public DenseDoubleMatrix2D(int rows, int columns) {
-	setUp(rows, columns);
-	this.elements = new double[rows*columns];
+  setUp(rows, columns);
+  this.elements = new double[rows*columns];
 }
 /**
  * Constructs a view with the given parameters.
@@ -100,12 +100,12 @@
  * @param columnZero the position of the first element.
  * @param rowStride the number of elements between two rows, i.e. <tt>index(i+1,j)-index(i,j)</tt>.
  * @param columnStride the number of elements between two columns, i.e. <tt>index(i,j+1)-index(i,j)</tt>.
- * @throws	IllegalArgumentException if <tt>rows<0 || columns<0 || (double)columns*rows > Integer.MAX_VALUE</tt> or flip's are illegal.
+ * @throws  IllegalArgumentException if <tt>rows<0 || columns<0 || (double)columns*rows > Integer.MAX_VALUE</tt> or flip's are illegal.
  */
 protected DenseDoubleMatrix2D(int rows, int columns, double[] elements, int rowZero, int columnZero, int rowStride, int columnStride) {
-	setUp(rows,columns,rowZero,columnZero,rowStride,columnStride);
-	this.elements = elements;
-	this.isNoView = false;
+  setUp(rows,columns,rowZero,columnZero,rowStride,columnStride);
+  this.elements = elements;
+  this.isNoView = false;
 }
 /**
  * Sets all cells to the state specified by <tt>values</tt>.
@@ -119,20 +119,20 @@
  * @throws IllegalArgumentException if <tt>values.length != rows() || for any 0 &lt;= row &lt; rows(): values[row].length != columns()</tt>.
  */
 public DoubleMatrix2D assign(double[][] values) {
-	if (this.isNoView) {
-		if (values.length != rows) throw new IllegalArgumentException("Must have same number of rows: rows="+values.length+"rows()="+rows());
-		int i = columns*(rows-1);
-		for (int row=rows; --row >= 0;) {
-			double[] currentRow = values[row];
-			if (currentRow.length != columns) throw new IllegalArgumentException("Must have same number of columns in every row: columns="+currentRow.length+"columns()="+columns());			
-			System.arraycopy(currentRow, 0, this.elements, i, columns);
-			i -= columns;
-		}
-	}
-	else {
-		super.assign(values);
-	}
-	return this;
+  if (this.isNoView) {
+    if (values.length != rows) throw new IllegalArgumentException("Must have same number of rows: rows="+values.length+"rows()="+rows());
+    int i = columns*(rows-1);
+    for (int row=rows; --row >= 0;) {
+      double[] currentRow = values[row];
+      if (currentRow.length != columns) throw new IllegalArgumentException("Must have same number of columns in every row: columns="+currentRow.length+"columns()="+columns());      
+      System.arraycopy(currentRow, 0, this.elements, i, columns);
+      i -= columns;
+    }
+  }
+  else {
+    super.assign(values);
+  }
+  return this;
 }
 /**
  * Sets all cells to the state specified by <tt>value</tt>.
@@ -140,18 +140,18 @@
  * @return <tt>this</tt> (for convenience only).
  */
 public DoubleMatrix2D assign(double value) {
-	final double[] elems = this.elements;
-	int index = index(0,0);
-	int cs = this.columnStride;
-	int rs = this.rowStride;
-	for (int row=rows; --row >= 0; ) {
-		for (int i=index, column=columns; --column >= 0; ) {
-			elems[i] = value;
-			i += cs;
-		}
-		index += rs;
-	}
-	return this;
+  final double[] elems = this.elements;
+  int index = index(0,0);
+  int cs = this.columnStride;
+  int rs = this.rowStride;
+  for (int row=rows; --row >= 0; ) {
+    for (int i=index, column=columns; --column >= 0; ) {
+      elems[i] = value;
+      i += cs;
+    }
+    index += rs;
+  }
+  return this;
 }
 /**
 Assigns the result of a function to each cell; <tt>x[row,col] = function(x[row,col])</tt>.
@@ -176,35 +176,35 @@
 @see org.apache.mahout.jet.math.Functions
 */
 public DoubleMatrix2D assign(org.apache.mahout.matrix.function.DoubleFunction function) {
-	final double[] elems = this.elements;
-	if (elems==null) throw new InternalError();
-	int index = index(0,0);
-	int cs = this.columnStride;
-	int rs = this.rowStride;
-	
-	// specialization for speed
-	if (function instanceof org.apache.mahout.jet.math.Mult) { // x[i] = mult*x[i]
-		double multiplicator = ((org.apache.mahout.jet.math.Mult)function).multiplicator;
-		if (multiplicator==1) return this;
-		if (multiplicator==0) return assign(0);
-		for (int row=rows; --row >= 0; ) { // the general case
-			for (int i=index, column=columns; --column >= 0; ) {
-				elems[i] *= multiplicator;
-				i += cs;
-			}
-			index += rs;
-		}
-	}
-	else { // the general case x[i] = f(x[i])
-		for (int row=rows; --row >= 0; ) { 
-			for (int i=index, column=columns; --column >= 0; ) {
-				elems[i] = function.apply(elems[i]);
-				i += cs;
-			}
-			index += rs;
-		}
-	}
-	return this;
+  final double[] elems = this.elements;
+  if (elems==null) throw new InternalError();
+  int index = index(0,0);
+  int cs = this.columnStride;
+  int rs = this.rowStride;
+  
+  // specialization for speed
+  if (function instanceof org.apache.mahout.jet.math.Mult) { // x[i] = mult*x[i]
+    double multiplicator = ((org.apache.mahout.jet.math.Mult)function).multiplicator;
+    if (multiplicator==1) return this;
+    if (multiplicator==0) return assign(0);
+    for (int row=rows; --row >= 0; ) { // the general case
+      for (int i=index, column=columns; --column >= 0; ) {
+        elems[i] *= multiplicator;
+        i += cs;
+      }
+      index += rs;
+    }
+  }
+  else { // the general case x[i] = f(x[i])
+    for (int row=rows; --row >= 0; ) { 
+      for (int i=index, column=columns; --column >= 0; ) {
+        elems[i] = function.apply(elems[i]);
+        i += cs;
+      }
+      index += rs;
+    }
+  }
+  return this;
 }
 /**
  * Replaces all cell values of the receiver with the values of another matrix.
@@ -213,50 +213,50 @@
  *
  * @param     source   the source matrix to copy from (may be identical to the receiver).
  * @return <tt>this</tt> (for convenience only).
- * @throws	IllegalArgumentException if <tt>columns() != source.columns() || rows() != source.rows()</tt>
+ * @throws  IllegalArgumentException if <tt>columns() != source.columns() || rows() != source.rows()</tt>
  */
 public DoubleMatrix2D assign(DoubleMatrix2D source) {
-	// overriden for performance only
-	if (! (source instanceof DenseDoubleMatrix2D)) {
-		return super.assign(source);
-	}
-	DenseDoubleMatrix2D other = (DenseDoubleMatrix2D) source;
-	if (other==this) return this; // nothing to do
-	checkShape(other);
-	
-	if (this.isNoView && other.isNoView) { // quickest
-		System.arraycopy(other.elements, 0, this.elements, 0, this.elements.length);
-		return this;
-	}
-	
-	if (haveSharedCells(other)) {
-		DoubleMatrix2D c = other.copy();
-		if (! (c instanceof DenseDoubleMatrix2D)) { // should not happen
-			return super.assign(other);
-		}
-		other = (DenseDoubleMatrix2D) c;
-	}
-	
-	final double[] elems = this.elements;
-	final double[] otherElems = other.elements;
-	if (elems==null || otherElems==null) throw new InternalError();
-	int cs = this.columnStride;
-	int ocs = other.columnStride;
-	int rs = this.rowStride;
-	int ors = other.rowStride;
+  // overriden for performance only
+  if (! (source instanceof DenseDoubleMatrix2D)) {
+    return super.assign(source);
+  }
+  DenseDoubleMatrix2D other = (DenseDoubleMatrix2D) source;
+  if (other==this) return this; // nothing to do
+  checkShape(other);
+  
+  if (this.isNoView && other.isNoView) { // quickest
+    System.arraycopy(other.elements, 0, this.elements, 0, this.elements.length);
+    return this;
+  }
+  
+  if (haveSharedCells(other)) {
+    DoubleMatrix2D c = other.copy();
+    if (! (c instanceof DenseDoubleMatrix2D)) { // should not happen
+      return super.assign(other);
+    }
+    other = (DenseDoubleMatrix2D) c;
+  }
+  
+  final double[] elems = this.elements;
+  final double[] otherElems = other.elements;
+  if (elems==null || otherElems==null) throw new InternalError();
+  int cs = this.columnStride;
+  int ocs = other.columnStride;
+  int rs = this.rowStride;
+  int ors = other.rowStride;
 
-	int otherIndex = other.index(0,0);
-	int index = index(0,0);
-	for (int row=rows; --row >= 0; ) {
-		for (int i=index, j=otherIndex, column=columns; --column >= 0; ) {
-			elems[i] = otherElems[j];
-			i += cs;
-			j += ocs;
-		}
-		index += rs;
-		otherIndex += ors;
-	}
-	return this;
+  int otherIndex = other.index(0,0);
+  int index = index(0,0);
+  for (int row=rows; --row >= 0; ) {
+    for (int i=index, j=otherIndex, column=columns; --column >= 0; ) {
+      elems[i] = otherElems[j];
+      i += cs;
+      j += ocs;
+    }
+    index += rs;
+    otherIndex += ors;
+  }
+  return this;
 }
 /**
 Assigns the result of a function to each cell; <tt>x[row,col] = function(x[row,col],y[row,col])</tt>.
@@ -284,102 +284,102 @@
 @param function a function object taking as first argument the current cell's value of <tt>this</tt>,
 and as second argument the current cell's value of <tt>y</tt>,
 @return <tt>this</tt> (for convenience only).
-@throws	IllegalArgumentException if <tt>columns() != other.columns() || rows() != other.rows()</tt>
+@throws  IllegalArgumentException if <tt>columns() != other.columns() || rows() != other.rows()</tt>
 @see org.apache.mahout.jet.math.Functions
 */
 public DoubleMatrix2D assign(DoubleMatrix2D y, org.apache.mahout.matrix.function.DoubleDoubleFunction function) {
-	// overriden for performance only
-	if (! (y instanceof DenseDoubleMatrix2D)) {
-		return super.assign(y, function);
-	}
-	DenseDoubleMatrix2D other = (DenseDoubleMatrix2D) y;
-	checkShape(y);
-	
-	final double[] elems = this.elements;
-	final double[] otherElems = other.elements;
-	if (elems==null || otherElems==null) throw new InternalError();
-	int cs = this.columnStride;
-	int ocs = other.columnStride;
-	int rs = this.rowStride;
-	int ors = other.rowStride;
+  // overriden for performance only
+  if (! (y instanceof DenseDoubleMatrix2D)) {
+    return super.assign(y, function);
+  }
+  DenseDoubleMatrix2D other = (DenseDoubleMatrix2D) y;
+  checkShape(y);
+  
+  final double[] elems = this.elements;
+  final double[] otherElems = other.elements;
+  if (elems==null || otherElems==null) throw new InternalError();
+  int cs = this.columnStride;
+  int ocs = other.columnStride;
+  int rs = this.rowStride;
+  int ors = other.rowStride;
 
-	int otherIndex = other.index(0,0);
-	int index = index(0,0);
+  int otherIndex = other.index(0,0);
+  int index = index(0,0);
 
-	// specialized for speed
-	if (function== org.apache.mahout.jet.math.Functions.mult) { // x[i] = x[i] * y[i]
-		for (int row=rows; --row >= 0; ) {
-			for (int i=index, j=otherIndex, column=columns; --column >= 0; ) {
-				elems[i] *= otherElems[j];
-				i += cs;
-				j += ocs;
-			}
-			index += rs;
-			otherIndex += ors;
-		}
-	}
-	else if (function== org.apache.mahout.jet.math.Functions.div) { // x[i] = x[i] / y[i]
-		for (int row=rows; --row >= 0; ) {
-			for (int i=index, j=otherIndex, column=columns; --column >= 0; ) {
-				elems[i] /= otherElems[j];
-				i += cs;
-				j += ocs;
-			}
-			index += rs;
-			otherIndex += ors;
-		}
-	}
-	else if (function instanceof org.apache.mahout.jet.math.PlusMult) {
-		double multiplicator = ((org.apache.mahout.jet.math.PlusMult) function).multiplicator;
-		if (multiplicator == 0) { // x[i] = x[i] + 0*y[i]
-			return this;
-		}
-		else if (multiplicator == 1) { // x[i] = x[i] + y[i]
-			for (int row=rows; --row >= 0; ) {
-				for (int i=index, j=otherIndex, column=columns; --column >= 0; ) {
-					elems[i] += otherElems[j];
-					i += cs;
-					j += ocs;
-				}
-				index += rs;
-				otherIndex += ors;
-			}
-		}
-		else if (multiplicator == -1) { // x[i] = x[i] - y[i]
-			for (int row=rows; --row >= 0; ) {
-				for (int i=index, j=otherIndex, column=columns; --column >= 0; ) {
-					elems[i] -= otherElems[j];
-					i += cs;
-					j += ocs;
-				}
-				index += rs;
-				otherIndex += ors;
-			}
-		}
-		else { // the general case
-			for (int row=rows; --row >= 0; ) { // x[i] = x[i] + mult*y[i]
-				for (int i=index, j=otherIndex, column=columns; --column >= 0; ) {
-					elems[i] += multiplicator*otherElems[j];
-					i += cs;
-					j += ocs;
-				}
-				index += rs;
-				otherIndex += ors;
-			}
-		}
-	}
-	else { // the general case x[i] = f(x[i],y[i])
-		for (int row=rows; --row >= 0; ) {
-			for (int i=index, j=otherIndex, column=columns; --column >= 0; ) {
-				elems[i] = function.apply(elems[i], otherElems[j]);
-				i += cs;
-				j += ocs;
-			}
-			index += rs;
-			otherIndex += ors;
-		}
-	}
-	return this;
+  // specialized for speed
+  if (function== org.apache.mahout.jet.math.Functions.mult) { // x[i] = x[i] * y[i]
+    for (int row=rows; --row >= 0; ) {
+      for (int i=index, j=otherIndex, column=columns; --column >= 0; ) {
+        elems[i] *= otherElems[j];
+        i += cs;
+        j += ocs;
+      }
+      index += rs;
+      otherIndex += ors;
+    }
+  }
+  else if (function== org.apache.mahout.jet.math.Functions.div) { // x[i] = x[i] / y[i]
+    for (int row=rows; --row >= 0; ) {
+      for (int i=index, j=otherIndex, column=columns; --column >= 0; ) {
+        elems[i] /= otherElems[j];
+        i += cs;
+        j += ocs;
+      }
+      index += rs;
+      otherIndex += ors;
+    }
+  }
+  else if (function instanceof org.apache.mahout.jet.math.PlusMult) {
+    double multiplicator = ((org.apache.mahout.jet.math.PlusMult) function).multiplicator;
+    if (multiplicator == 0) { // x[i] = x[i] + 0*y[i]
+      return this;
+    }
+    else if (multiplicator == 1) { // x[i] = x[i] + y[i]
+      for (int row=rows; --row >= 0; ) {
+        for (int i=index, j=otherIndex, column=columns; --column >= 0; ) {
+          elems[i] += otherElems[j];
+          i += cs;
+          j += ocs;
+        }
+        index += rs;
+        otherIndex += ors;
+      }
+    }
+    else if (multiplicator == -1) { // x[i] = x[i] - y[i]
+      for (int row=rows; --row >= 0; ) {
+        for (int i=index, j=otherIndex, column=columns; --column >= 0; ) {
+          elems[i] -= otherElems[j];
+          i += cs;
+          j += ocs;
+        }
+        index += rs;
+        otherIndex += ors;
+      }
+    }
+    else { // the general case
+      for (int row=rows; --row >= 0; ) { // x[i] = x[i] + mult*y[i]
+        for (int i=index, j=otherIndex, column=columns; --column >= 0; ) {
+          elems[i] += multiplicator*otherElems[j];
+          i += cs;
+          j += ocs;
+        }
+        index += rs;
+        otherIndex += ors;
+      }
+    }
+  }
+  else { // the general case x[i] = f(x[i],y[i])
+    for (int row=rows; --row >= 0; ) {
+      for (int i=index, j=otherIndex, column=columns; --column >= 0; ) {
+        elems[i] = function.apply(elems[i], otherElems[j]);
+        i += cs;
+        j += ocs;
+      }
+      index += rs;
+      otherIndex += ors;
+    }
+  }
+  return this;
 }
 /**
  * Returns the matrix cell value at coordinate <tt>[row,column]</tt>.
@@ -393,10 +393,10 @@
  * @return    the value at the specified coordinate.
  */
 public double getQuick(int row, int column) {
-	//if (debug) if (column<0 || column>=columns || row<0 || row>=rows) throw new IndexOutOfBoundsException("row:"+row+", column:"+column);
-	//return elements[index(row,column)];
-	//manually inlined:
-	return elements[rowZero + row*rowStride + columnZero + column*columnStride];
+  //if (debug) if (column<0 || column>=columns || row<0 || row>=rows) throw new IndexOutOfBoundsException("row:"+row+", column:"+column);
+  //return elements[index(row,column)];
+  //manually inlined:
+  return elements[rowZero + row*rowStride + columnZero + column*columnStride];
 }
 /**
  * Returns <tt>true</tt> if both matrices share common cells.
@@ -408,15 +408,15 @@
  * </ul>
  */
 protected boolean haveSharedCellsRaw(DoubleMatrix2D other) {
-	if (other instanceof SelectedDenseDoubleMatrix2D) {
-		SelectedDenseDoubleMatrix2D otherMatrix = (SelectedDenseDoubleMatrix2D) other;
-		return this.elements==otherMatrix.elements;
-	}
-	else if (other instanceof DenseDoubleMatrix2D) {
-		DenseDoubleMatrix2D otherMatrix = (DenseDoubleMatrix2D) other;
-		return this.elements==otherMatrix.elements;
-	}
-	return false;
+  if (other instanceof SelectedDenseDoubleMatrix2D) {
+    SelectedDenseDoubleMatrix2D otherMatrix = (SelectedDenseDoubleMatrix2D) other;
+    return this.elements==otherMatrix.elements;
+  }
+  else if (other instanceof DenseDoubleMatrix2D) {
+    DenseDoubleMatrix2D otherMatrix = (DenseDoubleMatrix2D) other;
+    return this.elements==otherMatrix.elements;
+  }
+  return false;
 }
 /**
  * Returns the position of the given coordinate within the (virtual or non-virtual) internal 1-dimensional array. 
@@ -425,9 +425,9 @@
  * @param     column   the index of the column-coordinate.
  */
 protected int index(int row, int column) {
-	// return super.index(row,column);
-	// manually inlined for speed:
-	return rowZero + row*rowStride + columnZero + column*columnStride;
+  // return super.index(row,column);
+  // manually inlined for speed:
+  return rowZero + row*rowStride + columnZero + column*columnStride;
 }
 /**
  * Construct and returns a new empty matrix <i>of the same dynamic type</i> as the receiver, having the specified number of rows and columns.
@@ -440,7 +440,7 @@
  * @return  a new empty matrix of the same dynamic type.
  */
 public DoubleMatrix2D like(int rows, int columns) {
-	return new DenseDoubleMatrix2D(rows, columns);
+  return new DenseDoubleMatrix2D(rows, columns);
 }
 /**
  * Construct and returns a new 1-d matrix <i>of the corresponding dynamic type</i>, entirelly independent of the receiver.
@@ -451,7 +451,7 @@
  * @return  a new matrix of the corresponding dynamic type.
  */
 public DoubleMatrix1D like1D(int size) {
-	return new DenseDoubleMatrix1D(size);
+  return new DenseDoubleMatrix1D(size);
 }
 /**
  * Construct and returns a new 1-d matrix <i>of the corresponding dynamic type</i>, sharing the same cells.
@@ -464,7 +464,7 @@
  * @return  a new matrix of the corresponding dynamic type.
  */
 protected DoubleMatrix1D like1D(int size, int zero, int stride) {
-	return new DenseDoubleMatrix1D(size,this.elements,zero,stride);
+  return new DenseDoubleMatrix1D(size,this.elements,zero,stride);
 }
 /**
  * Sets the matrix cell at coordinate <tt>[row,column]</tt> to the specified value.
@@ -478,10 +478,10 @@
  * @param    value the value to be filled into the specified cell.
  */
 public void setQuick(int row, int column, double value) {
-	//if (debug) if (column<0 || column>=columns || row<0 || row>=rows) throw new IndexOutOfBoundsException("row:"+row+", column:"+column);
-	//elements[index(row,column)] = value;
-	//manually inlined:
-	elements[rowZero + row*rowStride + columnZero + column*columnStride] = value;
+  //if (debug) if (column<0 || column>=columns || row<0 || row>=rows) throw new IndexOutOfBoundsException("row:"+row+", column:"+column);
+  //elements[index(row,column)] = value;
+  //manually inlined:
+  elements[rowZero + row*rowStride + columnZero + column*columnStride] = value;
 }
 /**
  * Construct and returns a new selection view.
@@ -491,7 +491,7 @@
  * @return  a new view.
  */
 protected DoubleMatrix2D viewSelectionLike(int[] rowOffsets, int[] columnOffsets) {
-	return new SelectedDenseDoubleMatrix2D(this.elements,rowOffsets,columnOffsets,0);
+  return new SelectedDenseDoubleMatrix2D(this.elements,rowOffsets,columnOffsets,0);
 }
 /**
 8 neighbor stencil transformation. For efficient finite difference operations.
@@ -541,277 +541,277 @@
 C.zAssign8Neighbors(B,g); // fast, even though it doesn't look like it
 };
 </pre>
-	
+  
 @param B the matrix to hold the results.
 @param function the function to be applied to the 9 cells.
 @throws NullPointerException if <tt>function==null</tt>.
 @throws IllegalArgumentException if <tt>rows() != B.rows() || columns() != B.columns()</tt>.
 */
 public void zAssign8Neighbors(DoubleMatrix2D B, org.apache.mahout.matrix.function.Double9Function function) {
-	// 1. using only 4-5 out of the 9 cells in "function" is *not* the limiting factor for performance.
+  // 1. using only 4-5 out of the 9 cells in "function" is *not* the limiting factor for performance.
 
-	// 2. if the "function" would be hardwired into the innermost loop, a speedup of 1.5-2.0 would be seen
-	// but then the multi-purpose interface is gone...
+  // 2. if the "function" would be hardwired into the innermost loop, a speedup of 1.5-2.0 would be seen
+  // but then the multi-purpose interface is gone...
 
-	if (!(B instanceof DenseDoubleMatrix2D)) {
-		super.zAssign8Neighbors(B, function);
-		return;
-	}
-	if (function==null) throw new NullPointerException("function must not be null.");
-	checkShape(B);
-	int r = rows-1;
-	int c = columns-1;
-	if (rows<3 || columns<3) return; // nothing to do
+  if (!(B instanceof DenseDoubleMatrix2D)) {
+    super.zAssign8Neighbors(B, function);
+    return;
+  }
+  if (function==null) throw new NullPointerException("function must not be null.");
+  checkShape(B);
+  int r = rows-1;
+  int c = columns-1;
+  if (rows<3 || columns<3) return; // nothing to do
 
-	DenseDoubleMatrix2D BB = (DenseDoubleMatrix2D) B;
-	int A_rs = rowStride;
-	int B_rs = BB.rowStride;
-	int A_cs = columnStride;
-	int B_cs = BB.columnStride;
-	double[] elems = this.elements;
-	double[] B_elems = BB.elements;
-	if (elems == null || B_elems==null) throw new InternalError();
+  DenseDoubleMatrix2D BB = (DenseDoubleMatrix2D) B;
+  int A_rs = rowStride;
+  int B_rs = BB.rowStride;
+  int A_cs = columnStride;
+  int B_cs = BB.columnStride;
+  double[] elems = this.elements;
+  double[] B_elems = BB.elements;
+  if (elems == null || B_elems==null) throw new InternalError();
 
-	int A_index = index(1,1);
-	int B_index = BB.index(1,1);
-	for (int i=1; i<r; i++) {
-		double a00, a01, a02;
-		double a10, a11, a12;
-		double a20, a21, a22;
-		
-		int B11 = B_index;
+  int A_index = index(1,1);
+  int B_index = BB.index(1,1);
+  for (int i=1; i<r; i++) {
+    double a00, a01, a02;
+    double a10, a11, a12;
+    double a20, a21, a22;
+    
+    int B11 = B_index;
 
-		int A02 = A_index - A_rs - A_cs;
-		int A12 = A02 + A_rs;
-		int A22 = A12 + A_rs;
+    int A02 = A_index - A_rs - A_cs;
+    int A12 = A02 + A_rs;
+    int A22 = A12 + A_rs;
 
-		// in each step six cells can be remembered in registers - they don't need to be reread from slow memory
-		a00=elems[A02]; A02+=A_cs;   a01=elems[A02]; //A02+=A_cs;
-		a10=elems[A12]; A12+=A_cs;   a11=elems[A12]; //A12+=A_cs;
-		a20=elems[A22]; A22+=A_cs;   a21=elems[A22]; //A22+=A_cs; 
-		
-		for (int j=1; j<c; j++) {
-			//in each step 3 instead of 9 cells need to be read from memory.
-			a02=elems[A02+=A_cs]; 
-			a12=elems[A12+=A_cs]; 
-			a22=elems[A22+=A_cs]; 
-			
-			B_elems[B11] = function.apply(
-				a00, a01, a02,
-				a10, a11, a12,
-				a20, a21, a22);
-			B11 += B_cs;
-			
-			// move remembered cells
-			a00=a01; a01=a02;
-			a10=a11; a11=a12;
-			a20=a21; a21=a22;
-		}
-		A_index += A_rs;
-		B_index += B_rs;
-	}
+    // in each step six cells can be remembered in registers - they don't need to be reread from slow memory
+    a00=elems[A02]; A02+=A_cs;   a01=elems[A02]; //A02+=A_cs;
+    a10=elems[A12]; A12+=A_cs;   a11=elems[A12]; //A12+=A_cs;
+    a20=elems[A22]; A22+=A_cs;   a21=elems[A22]; //A22+=A_cs; 
+    
+    for (int j=1; j<c; j++) {
+      //in each step 3 instead of 9 cells need to be read from memory.
+      a02=elems[A02+=A_cs]; 
+      a12=elems[A12+=A_cs]; 
+      a22=elems[A22+=A_cs]; 
+      
+      B_elems[B11] = function.apply(
+        a00, a01, a02,
+        a10, a11, a12,
+        a20, a21, a22);
+      B11 += B_cs;
+      
+      // move remembered cells
+      a00=a01; a01=a02;
+      a10=a11; a11=a12;
+      a20=a21; a21=a22;
+    }
+    A_index += A_rs;
+    B_index += B_rs;
+  }
 
 }
 public DoubleMatrix1D zMult(DoubleMatrix1D y, DoubleMatrix1D z, double alpha, double beta, boolean transposeA) {
-	if (transposeA) return viewDice().zMult(y,z,alpha,beta,false);
-	if (z==null) z = new DenseDoubleMatrix1D(this.rows);
-	if (!(y instanceof DenseDoubleMatrix1D && z instanceof DenseDoubleMatrix1D)) return super.zMult(y,z,alpha,beta,transposeA);
-	
-	if (columns != y.size || rows > z.size)	
-		throw new IllegalArgumentException("Incompatible args: "+toStringShort()+", "+y.toStringShort()+", "+z.toStringShort());
+  if (transposeA) return viewDice().zMult(y,z,alpha,beta,false);
+  if (z==null) z = new DenseDoubleMatrix1D(this.rows);
+  if (!(y instanceof DenseDoubleMatrix1D && z instanceof DenseDoubleMatrix1D)) return super.zMult(y,z,alpha,beta,transposeA);
+  
+  if (columns != y.size || rows > z.size)  
+    throw new IllegalArgumentException("Incompatible args: "+toStringShort()+", "+y.toStringShort()+", "+z.toStringShort());
 
-	DenseDoubleMatrix1D yy = (DenseDoubleMatrix1D) y;
-	DenseDoubleMatrix1D zz = (DenseDoubleMatrix1D) z;
-	final double[] AElems = this.elements;
-	final double[] yElems = yy.elements;
-	final double[] zElems = zz.elements;
-	if (AElems==null || yElems==null || zElems==null) throw new InternalError();
-	int As = this.columnStride;
-	int ys = yy.stride;
-	int zs = zz.stride;
+  DenseDoubleMatrix1D yy = (DenseDoubleMatrix1D) y;
+  DenseDoubleMatrix1D zz = (DenseDoubleMatrix1D) z;
+  final double[] AElems = this.elements;
+  final double[] yElems = yy.elements;
+  final double[] zElems = zz.elements;
+  if (AElems==null || yElems==null || zElems==null) throw new InternalError();
+  int As = this.columnStride;
+  int ys = yy.stride;
+  int zs = zz.stride;
 
-	int indexA = index(0,0);
-	int indexY = yy.index(0);
-	int indexZ = zz.index(0);
+  int indexA = index(0,0);
+  int indexY = yy.index(0);
+  int indexZ = zz.index(0);
 
-	int cols = columns;
-	for (int row=rows; --row >= 0; ) {
-		double sum = 0;
+  int cols = columns;
+  for (int row=rows; --row >= 0; ) {
+    double sum = 0;
 
-		/*
-		// not loop unrolled
-		for (int i=indexA, j=indexY, column=columns; --column >= 0; ) {
-			sum += AElems[i] * yElems[j];
-			i += As;
-			j += ys;
-		}
-		*/
+    /*
+    // not loop unrolled
+    for (int i=indexA, j=indexY, column=columns; --column >= 0; ) {
+      sum += AElems[i] * yElems[j];
+      i += As;
+      j += ys;
+    }
+    */
 
-		// loop unrolled
-		int i = indexA - As;
-		int j = indexY - ys;	
-		for (int k=cols%4; --k >= 0; ) {
-			sum += AElems[i += As] * yElems[j += ys];
-		}
-		for (int k=cols/4; --k >= 0; ) { 
-			sum += AElems[i += As] * yElems[j += ys] + 
-				AElems[i += As] * yElems[j += ys] +
-				AElems[i += As] * yElems[j += ys] +
-				AElems[i += As] * yElems[j += ys];
-		}		
+    // loop unrolled
+    int i = indexA - As;
+    int j = indexY - ys;  
+    for (int k=cols%4; --k >= 0; ) {
+      sum += AElems[i += As] * yElems[j += ys];
+    }
+    for (int k=cols/4; --k >= 0; ) { 
+      sum += AElems[i += As] * yElems[j += ys] + 
+        AElems[i += As] * yElems[j += ys] +
+        AElems[i += As] * yElems[j += ys] +
+        AElems[i += As] * yElems[j += ys];
+    }    
 
-		zElems[indexZ] = alpha*sum + beta*zElems[indexZ];
-		indexA += this.rowStride;
-		indexZ += zs;
-	}
+    zElems[indexZ] = alpha*sum + beta*zElems[indexZ];
+    indexA += this.rowStride;
+    indexZ += zs;
+  }
 
-	return z;
+  return z;
 }
 public DoubleMatrix2D zMult(DoubleMatrix2D B, DoubleMatrix2D C, double alpha, double beta, boolean transposeA, boolean transposeB) {
-	// overriden for performance only
-	if (transposeA) return viewDice().zMult(B,C,alpha,beta,false,transposeB);
-	if (B instanceof SparseDoubleMatrix2D || B instanceof RCDoubleMatrix2D) {
-		// exploit quick sparse mult
-		// A*B = (B' * A')'
-		if (C==null) {
-			return B.zMult(this, null, alpha,beta,!transposeB,true).viewDice();
-		}
-		else {
-			B.zMult(this, C.viewDice(), alpha,beta,!transposeB,true);
-			return C;
-		}
-		/*
-		final RCDoubleMatrix2D transB = new RCDoubleMatrix2D(B.columns,B.rows);
-		B.forEachNonZero(
-			new org.apache.mahout.matrix.function.IntIntDoubleFunction() {
-				public double apply(int i, int j, double value) {
-					transB.setQuick(j,i,value);
-					return value;
-				}
-			}
-		);
+  // overriden for performance only
+  if (transposeA) return viewDice().zMult(B,C,alpha,beta,false,transposeB);
+  if (B instanceof SparseDoubleMatrix2D || B instanceof RCDoubleMatrix2D) {
+    // exploit quick sparse mult
+    // A*B = (B' * A')'
+    if (C==null) {
+      return B.zMult(this, null, alpha,beta,!transposeB,true).viewDice();
+    }
+    else {
+      B.zMult(this, C.viewDice(), alpha,beta,!transposeB,true);
+      return C;
+    }
+    /*
+    final RCDoubleMatrix2D transB = new RCDoubleMatrix2D(B.columns,B.rows);
+    B.forEachNonZero(
+      new org.apache.mahout.matrix.function.IntIntDoubleFunction() {
+        public double apply(int i, int j, double value) {
+          transB.setQuick(j,i,value);
+          return value;
+        }
+      }
+    );
 
-		return transB.zMult(this.viewDice(),C.viewDice()).viewDice();
-		*/
-	}
-	if (transposeB) return this.zMult(B.viewDice(),C,alpha,beta,transposeA,false);
-	
-	int m = rows;
-	int n = columns;
-	int p = B.columns;
-	if (C==null) C = new DenseDoubleMatrix2D(m,p);
-	if (!(C instanceof DenseDoubleMatrix2D)) return super.zMult(B,C,alpha,beta,transposeA,transposeB);
-	if (B.rows != n)
-		throw new IllegalArgumentException("Matrix2D inner dimensions must agree:"+toStringShort()+", "+B.toStringShort());
-	if (C.rows != m || C.columns != p)
-		throw new IllegalArgumentException("Incompatibel result matrix: "+toStringShort()+", "+B.toStringShort()+", "+C.toStringShort());
-	if (this == C || B == C)
-		throw new IllegalArgumentException("Matrices must not be identical");
+    return transB.zMult(this.viewDice(),C.viewDice()).viewDice();
+    */
+  }
+  if (transposeB) return this.zMult(B.viewDice(),C,alpha,beta,transposeA,false);
+  
+  int m = rows;
+  int n = columns;
+  int p = B.columns;
+  if (C==null) C = new DenseDoubleMatrix2D(m,p);
+  if (!(C instanceof DenseDoubleMatrix2D)) return super.zMult(B,C,alpha,beta,transposeA,transposeB);
+  if (B.rows != n)
+    throw new IllegalArgumentException("Matrix2D inner dimensions must agree:"+toStringShort()+", "+B.toStringShort());
+  if (C.rows != m || C.columns != p)
+    throw new IllegalArgumentException("Incompatibel result matrix: "+toStringShort()+", "+B.toStringShort()+", "+C.toStringShort());
+  if (this == C || B == C)
+    throw new IllegalArgumentException("Matrices must not be identical");
 
-	DenseDoubleMatrix2D BB = (DenseDoubleMatrix2D) B;
-	DenseDoubleMatrix2D CC = (DenseDoubleMatrix2D) C;
-	final double[] AElems = this.elements;
-	final double[] BElems = BB.elements;
-	final double[] CElems = CC.elements;
-	if (AElems==null || BElems==null || CElems==null) throw new InternalError();
+  DenseDoubleMatrix2D BB = (DenseDoubleMatrix2D) B;
+  DenseDoubleMatrix2D CC = (DenseDoubleMatrix2D) C;
+  final double[] AElems = this.elements;
+  final double[] BElems = BB.elements;
+  final double[] CElems = CC.elements;
+  if (AElems==null || BElems==null || CElems==null) throw new InternalError();
 
-	int cA = this.columnStride;
-	int cB = BB.columnStride;
-	int cC = CC.columnStride;
+  int cA = this.columnStride;
+  int cB = BB.columnStride;
+  int cC = CC.columnStride;
 
-	int rA = this.rowStride;
-	int rB = BB.rowStride;
-	int rC = CC.rowStride;
+  int rA = this.rowStride;
+  int rB = BB.rowStride;
+  int rC = CC.rowStride;
 
-	/*
-	A is blocked to hide memory latency
-			xxxxxxx B
-			xxxxxxx
-			xxxxxxx
-	A
-	xxx     xxxxxxx C
-	xxx     xxxxxxx
-	---     -------
-	xxx     xxxxxxx
-	xxx     xxxxxxx
-	---     -------
-	xxx     xxxxxxx
-	*/
-	final int BLOCK_SIZE = 30000; // * 8 == Level 2 cache in bytes
-	//if (n+p == 0) return C;
-	//int m_optimal = (BLOCK_SIZE - n*p) / (n+p);
-	int m_optimal = (BLOCK_SIZE - n) / (n+1);
-	if (m_optimal <= 0) m_optimal = 1;
-	int blocks = m/m_optimal;
-	int rr = 0;
-	if (m%m_optimal != 0) blocks++;
-	for (; --blocks >= 0; ) {
-		int jB = BB.index(0,0);
-		int indexA = index(rr,0);
-		int jC =  CC.index(rr,0);
-		rr += m_optimal;
-		if (blocks==0) m_optimal += m - rr;
-		
-		for (int j = p; --j >= 0; ) {
-			int iA = indexA;
-			int iC = jC;
-			for (int i = m_optimal; --i >= 0; ) {
-				int kA = iA;
-				int kB = jB;
-				double s = 0;
+  /*
+  A is blocked to hide memory latency
+      xxxxxxx B
+      xxxxxxx
+      xxxxxxx
+  A
+  xxx     xxxxxxx C
+  xxx     xxxxxxx
+  ---     -------
+  xxx     xxxxxxx
+  xxx     xxxxxxx
+  ---     -------
+  xxx     xxxxxxx
+  */
+  final int BLOCK_SIZE = 30000; // * 8 == Level 2 cache in bytes
+  //if (n+p == 0) return C;
+  //int m_optimal = (BLOCK_SIZE - n*p) / (n+p);
+  int m_optimal = (BLOCK_SIZE - n) / (n+1);
+  if (m_optimal <= 0) m_optimal = 1;
+  int blocks = m/m_optimal;
+  int rr = 0;
+  if (m%m_optimal != 0) blocks++;
+  for (; --blocks >= 0; ) {
+    int jB = BB.index(0,0);
+    int indexA = index(rr,0);
+    int jC =  CC.index(rr,0);
+    rr += m_optimal;
+    if (blocks==0) m_optimal += m - rr;
+    
+    for (int j = p; --j >= 0; ) {
+      int iA = indexA;
+      int iC = jC;
+      for (int i = m_optimal; --i >= 0; ) {
+        int kA = iA;
+        int kB = jB;
+        double s = 0;
 
-				/*
-				// not unrolled:
-				for (int k = n; --k >= 0; ) {
-					//s += getQuick(i,k) * B.getQuick(k,j);
-					s += AElems[kA] * BElems[kB];
-					kB += rB;
-					kA += cA;
-				}
-				*/
-				
-				// loop unrolled				
-				kA -= cA;
-				kB -= rB;
-				
-				for (int k=n%4; --k >= 0; ) {
-					s += AElems[kA += cA] * BElems[kB += rB];
-				}
-				for (int k=n/4; --k >= 0; ) { 
-					s += AElems[kA += cA] * BElems[kB += rB] + 
-						AElems[kA += cA] * BElems[kB += rB] +
-						AElems[kA += cA] * BElems[kB += rB] +
-						AElems[kA += cA] * BElems[kB += rB];
-				}		
+        /*
+        // not unrolled:
+        for (int k = n; --k >= 0; ) {
+          //s += getQuick(i,k) * B.getQuick(k,j);
+          s += AElems[kA] * BElems[kB];
+          kB += rB;
+          kA += cA;
+        }
+        */
+        
+        // loop unrolled        
+        kA -= cA;
+        kB -= rB;
+        
+        for (int k=n%4; --k >= 0; ) {
+          s += AElems[kA += cA] * BElems[kB += rB];
+        }
+        for (int k=n/4; --k >= 0; ) { 
+          s += AElems[kA += cA] * BElems[kB += rB] + 
+            AElems[kA += cA] * BElems[kB += rB] +
+            AElems[kA += cA] * BElems[kB += rB] +
+            AElems[kA += cA] * BElems[kB += rB];
+        }    
 
-				CElems[iC] = alpha*s + beta*CElems[iC];
-				iA += rA;
-				iC += rC;
-			}
-			jB += cB;
-			jC += cC;
-		}
-	}
-	return C;
+        CElems[iC] = alpha*s + beta*CElems[iC];
+        iA += rA;
+        iC += rC;
+      }
+      jB += cB;
+      jC += cC;
+    }
+  }
+  return C;
 }
 /**
  * Returns the sum of all cells; <tt>Sum( x[i,j] )</tt>.
  * @return the sum.
  */
 public double zSum() {
-	double sum = 0;
-	final double[] elems = this.elements;
-	if (elems==null) throw new InternalError();
-	int index = index(0,0);
-	int cs = this.columnStride;
-	int rs = this.rowStride;
-	for (int row=rows; --row >= 0; ) {
-		for (int i=index, column=columns; --column >= 0; ) {
-			sum += elems[i];
-			i += cs;
-		}
-		index += rs;
-	}
-	return sum;
+  double sum = 0;
+  final double[] elems = this.elements;
+  if (elems==null) throw new InternalError();
+  int index = index(0,0);
+  int cs = this.columnStride;
+  int rs = this.rowStride;
+  for (int row=rows; --row >= 0; ) {
+    for (int i=index, column=columns; --column >= 0; ) {
+      sum += elems[i];
+      i += cs;
+    }
+    index += rs;
+  }
+  return sum;
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SparseDoubleMatrix3D.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SparseDoubleMatrix3D.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SparseDoubleMatrix3D.java	(working copy)
@@ -51,21 +51,21 @@
 Thus
 <pre>
    for (int slice=0; slice < slices; slice++) {
-	  for (int row=0; row < rows; row++) {
-	     for (int column=0; column < columns; column++) {
-			matrix.setQuick(slice,row,column,someValue);
-		 }		    
-	  }
+    for (int row=0; row < rows; row++) {
+       for (int column=0; column < columns; column++) {
+      matrix.setQuick(slice,row,column,someValue);
+     }        
+    }
    }
 </pre>
 is quicker than
 <pre>
    for (int column=0; column < columns; column++) {
-	  for (int row=0; row < rows; row++) {
-	     for (int slice=0; slice < slices; slice++) {
-			matrix.setQuick(slice,row,column,someValue);
-		 }
-	  }
+    for (int row=0; row < rows; row++) {
+       for (int slice=0; slice < slices; slice++) {
+      matrix.setQuick(slice,row,column,someValue);
+     }
+    }
    }
 </pre>
 
@@ -79,10 +79,10 @@
  */
 @Deprecated
 public class SparseDoubleMatrix3D extends DoubleMatrix3D {
-	/*
-	 * The elements of the matrix.
-	 */
-	protected AbstractIntDoubleMap elements; 
+  /*
+   * The elements of the matrix.
+   */
+  protected AbstractIntDoubleMap elements; 
 /**
  * Constructs a matrix with a copy of the given values.
  * <tt>values</tt> is required to have the form <tt>values[slice][row][column]</tt>
@@ -95,8 +95,8 @@
  * @throws IllegalArgumentException if <tt>for any 1 &lt;= row &lt; values[0].length: values[slice][row].length != values[slice][row-1].length</tt>.
  */
 public SparseDoubleMatrix3D(double[][][] values) {
-	this(values.length, (values.length==0 ? 0: values[0].length), (values.length==0 ? 0: values[0].length==0 ? 0 : values[0][0].length));
-	assign(values);
+  this(values.length, (values.length==0 ? 0: values[0].length), (values.length==0 ? 0: values[0].length==0 ? 0 : values[0][0].length));
+  assign(values);
 }
 /**
  * Constructs a matrix with a given number of slices, rows and columns and default memory usage.
@@ -104,11 +104,11 @@
  * @param slices the number of slices the matrix shall have.
  * @param rows the number of rows the matrix shall have.
  * @param columns the number of columns the matrix shall have.
- * @throws	IllegalArgumentException if <tt>(double)slices*columns*rows > Integer.MAX_VALUE</tt>.
- * @throws	IllegalArgumentException if <tt>slices<0 || rows<0 || columns<0</tt>.
+ * @throws  IllegalArgumentException if <tt>(double)slices*columns*rows > Integer.MAX_VALUE</tt>.
+ * @throws  IllegalArgumentException if <tt>slices<0 || rows<0 || columns<0</tt>.
  */
 public SparseDoubleMatrix3D(int slices, int rows, int columns) {
-	this(slices,rows,columns,slices*rows*(columns/1000),0.2,0.5);
+  this(slices,rows,columns,slices*rows*(columns/1000),0.2,0.5);
 }
 /**
  * Constructs a matrix with a given number of slices, rows and columns using memory as specified.
@@ -122,13 +122,13 @@
  *                          If not known, set <tt>initialCapacity=0</tt> or small.     
  * @param minLoadFactor        the minimum load factor of the hash map.
  * @param maxLoadFactor        the maximum load factor of the hash map.
- * @throws	IllegalArgumentException if <tt>initialCapacity < 0 || (minLoadFactor < 0.0 || minLoadFactor >= 1.0) || (maxLoadFactor <= 0.0 || maxLoadFactor >= 1.0) || (minLoadFactor >= maxLoadFactor)</tt>.
- * @throws	IllegalArgumentException if <tt>(double)columns*rows > Integer.MAX_VALUE</tt>.
- * @throws	IllegalArgumentException if <tt>slices<0 || rows<0 || columns<0</tt>.
+ * @throws  IllegalArgumentException if <tt>initialCapacity < 0 || (minLoadFactor < 0.0 || minLoadFactor >= 1.0) || (maxLoadFactor <= 0.0 || maxLoadFactor >= 1.0) || (minLoadFactor >= maxLoadFactor)</tt>.
+ * @throws  IllegalArgumentException if <tt>(double)columns*rows > Integer.MAX_VALUE</tt>.
+ * @throws  IllegalArgumentException if <tt>slices<0 || rows<0 || columns<0</tt>.
  */
 public SparseDoubleMatrix3D(int slices, int rows, int columns, int initialCapacity, double minLoadFactor, double maxLoadFactor) {
-	setUp(slices,rows,columns);
-	this.elements = new OpenIntDoubleHashMap(initialCapacity, minLoadFactor, maxLoadFactor);
+  setUp(slices,rows,columns);
+  this.elements = new OpenIntDoubleHashMap(initialCapacity, minLoadFactor, maxLoadFactor);
 }
 /**
  * Constructs a view with the given parameters.
@@ -142,13 +142,13 @@
  * @param sliceStride the number of elements between two slices, i.e. <tt>index(k+1,i,j)-index(k,i,j)</tt>.
  * @param rowStride the number of elements between two rows, i.e. <tt>index(k,i+1,j)-index(k,i,j)</tt>.
  * @param columnnStride the number of elements between two columns, i.e. <tt>index(k,i,j+1)-index(k,i,j)</tt>.
- * @throws	IllegalArgumentException if <tt>(double)slices*columns*rows > Integer.MAX_VALUE</tt>.
- * @throws	IllegalArgumentException if <tt>slices<0 || rows<0 || columns<0</tt>.
+ * @throws  IllegalArgumentException if <tt>(double)slices*columns*rows > Integer.MAX_VALUE</tt>.
+ * @throws  IllegalArgumentException if <tt>slices<0 || rows<0 || columns<0</tt>.
  */
 protected SparseDoubleMatrix3D(int slices, int rows, int columns, AbstractIntDoubleMap elements, int sliceZero, int rowZero, int columnZero, int sliceStride, int rowStride, int columnStride) {
-	setUp(slices,rows,columns,sliceZero,rowZero,columnZero,sliceStride,rowStride,columnStride);
-	this.elements = elements;
-	this.isNoView = false;
+  setUp(slices,rows,columns,sliceZero,rowZero,columnZero,sliceStride,rowStride,columnStride);
+  this.elements = elements;
+  this.isNoView = false;
 }
 /**
  * Sets all cells to the state specified by <tt>value</tt>.
@@ -156,17 +156,17 @@
  * @return <tt>this</tt> (for convenience only).
  */
 public DoubleMatrix3D assign(double value) {
-	// overriden for performance only
-	if (this.isNoView && value==0) this.elements.clear();
-	else super.assign(value);
-	return this;
+  // overriden for performance only
+  if (this.isNoView && value==0) this.elements.clear();
+  else super.assign(value);
+  return this;
 }
 /**
  * Returns the number of cells having non-zero values.
  */
 public int cardinality() {
-	if (this.isNoView) return this.elements.size();
-	else return super.cardinality();
+  if (this.isNoView) return this.elements.size();
+  else return super.cardinality();
 }
 /**
  * Ensures that the receiver can hold at least the specified number of non-zero cells without needing to allocate new internal memory.
@@ -179,7 +179,7 @@
  * @param   minNonZeros   the desired minimum number of non-zero cells.
  */
 public void ensureCapacity(int minCapacity) {
-	this.elements.ensureCapacity(minCapacity);
+  this.elements.ensureCapacity(minCapacity);
 }
 /**
  * Returns the matrix cell value at coordinate <tt>[slice,row,column]</tt>.
@@ -194,24 +194,24 @@
  * @return    the value at the specified coordinate.
  */
 public double getQuick(int slice, int row, int column) {
-	//if (debug) if (slice<0 || slice>=slices || row<0 || row>=rows || column<0 || column>=columns) throw new IndexOutOfBoundsException("slice:"+slice+", row:"+row+", column:"+column);
-	//return elements.get(index(slice,row,column));
-	//manually inlined:
-	return elements.get(sliceZero + slice*sliceStride + rowZero + row*rowStride + columnZero + column*columnStride);
+  //if (debug) if (slice<0 || slice>=slices || row<0 || row>=rows || column<0 || column>=columns) throw new IndexOutOfBoundsException("slice:"+slice+", row:"+row+", column:"+column);
+  //return elements.get(index(slice,row,column));
+  //manually inlined:
+  return elements.get(sliceZero + slice*sliceStride + rowZero + row*rowStride + columnZero + column*columnStride);
 }
 /**
  * Returns <tt>true</tt> if both matrices share at least one identical cell.
  */
 protected boolean haveSharedCellsRaw(DoubleMatrix3D other) {
-	if (other instanceof SelectedSparseDoubleMatrix3D) {
-		SelectedSparseDoubleMatrix3D otherMatrix = (SelectedSparseDoubleMatrix3D) other;
-		return this.elements==otherMatrix.elements;
-	}
-	else if (other instanceof SparseDoubleMatrix3D) {
-		SparseDoubleMatrix3D otherMatrix = (SparseDoubleMatrix3D) other;
-		return this.elements==otherMatrix.elements;
-	}
-	return false;
+  if (other instanceof SelectedSparseDoubleMatrix3D) {
+    SelectedSparseDoubleMatrix3D otherMatrix = (SelectedSparseDoubleMatrix3D) other;
+    return this.elements==otherMatrix.elements;
+  }
+  else if (other instanceof SparseDoubleMatrix3D) {
+    SparseDoubleMatrix3D otherMatrix = (SparseDoubleMatrix3D) other;
+    return this.elements==otherMatrix.elements;
+  }
+  return false;
 }
 /**
  * Returns the position of the given coordinate within the (virtual or non-virtual) internal 1-dimensional array. 
@@ -221,9 +221,9 @@
  * @param     column   the index of the third-coordinate.
  */
 protected int index(int slice, int row, int column) {
-	//return _sliceOffset(_sliceRank(slice)) + _rowOffset(_rowRank(row)) + _columnOffset(_columnRank(column));
-	//manually inlined:
-	return sliceZero + slice*sliceStride + rowZero + row*rowStride + columnZero + column*columnStride;	
+  //return _sliceOffset(_sliceRank(slice)) + _rowOffset(_rowRank(row)) + _columnOffset(_columnRank(column));
+  //manually inlined:
+  return sliceZero + slice*sliceStride + rowZero + row*rowStride + columnZero + column*columnStride;  
 }
 /**
  * Construct and returns a new empty matrix <i>of the same dynamic type</i> as the receiver, having the specified number of slices, rows and columns.
@@ -237,7 +237,7 @@
  * @return  a new empty matrix of the same dynamic type.
  */
 public DoubleMatrix3D like(int slices, int rows, int columns) {
-	return new SparseDoubleMatrix3D(slices,rows,columns); 
+  return new SparseDoubleMatrix3D(slices,rows,columns); 
 }
 /**
  * Construct and returns a new 2-d matrix <i>of the corresponding dynamic type</i>, sharing the same cells.
@@ -253,7 +253,7 @@
  * @return  a new matrix of the corresponding dynamic type.
  */
 protected DoubleMatrix2D like2D(int rows, int columns, int rowZero, int columnZero, int rowStride, int columnStride) {
-	return new SparseDoubleMatrix2D(rows,columns,this.elements,rowZero,columnZero,rowStride,columnStride);
+  return new SparseDoubleMatrix2D(rows,columns,this.elements,rowZero,columnZero,rowStride,columnStride);
 }
 /**
  * Sets the matrix cell at coordinate <tt>[slice,row,column]</tt> to the specified value.
@@ -268,14 +268,14 @@
  * @param    value the value to be filled into the specified cell.
  */
 public void setQuick(int slice, int row, int column, double value) {
-	//if (debug) if (slice<0 || slice>=slices || row<0 || row>=rows || column<0 || column>=columns) throw new IndexOutOfBoundsException("slice:"+slice+", row:"+row+", column:"+column);
-	//int index =	index(slice,row,column);
-	//manually inlined:
-	int index = sliceZero + slice*sliceStride + rowZero + row*rowStride + columnZero + column*columnStride;
-	if (value == 0)
-		this.elements.removeKey(index);
-	else 
-		this.elements.put(index, value);
+  //if (debug) if (slice<0 || slice>=slices || row<0 || row>=rows || column<0 || column>=columns) throw new IndexOutOfBoundsException("slice:"+slice+", row:"+row+", column:"+column);
+  //int index =  index(slice,row,column);
+  //manually inlined:
+  int index = sliceZero + slice*sliceStride + rowZero + row*rowStride + columnZero + column*columnStride;
+  if (value == 0)
+    this.elements.removeKey(index);
+  else 
+    this.elements.put(index, value);
 }
 /**
  * Releases any superfluous memory created by explicitly putting zero values into cells formerly having non-zero values; 
@@ -295,7 +295,7 @@
  * Putting zeros into cells already containing zeros does not generate obsolete memory since no memory was allocated to them in the first place.
  */
 public void trimToSize() {
-	this.elements.trimToSize();
+  this.elements.trimToSize();
 }
 /**
  * Construct and returns a new selection view.
@@ -306,6 +306,6 @@
  * @return  a new view.
  */
 protected DoubleMatrix3D viewSelectionLike(int[] sliceOffsets, int[] rowOffsets, int[] columnOffsets) {
-	return new SelectedSparseDoubleMatrix3D(this.elements,sliceOffsets,rowOffsets,columnOffsets,0);
+  return new SelectedSparseDoubleMatrix3D(this.elements,sliceOffsets,rowOffsets,columnOffsets,0);
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/DenseDoubleMatrix3D.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/DenseDoubleMatrix3D.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/DenseDoubleMatrix3D.java	(working copy)
@@ -34,21 +34,21 @@
 Thus
 <pre>
    for (int slice=0; slice < slices; slice++) {
-	  for (int row=0; row < rows; row++) {
-	     for (int column=0; column < columns; column++) {
-			matrix.setQuick(slice,row,column,someValue);
-		 }		    
-	  }
+    for (int row=0; row < rows; row++) {
+       for (int column=0; column < columns; column++) {
+      matrix.setQuick(slice,row,column,someValue);
+     }        
+    }
    }
 </pre>
 is quicker than
 <pre>
    for (int column=0; column < columns; column++) {
-	  for (int row=0; row < rows; row++) {
-	     for (int slice=0; slice < slices; slice++) {
-			matrix.setQuick(slice,row,column,someValue);
-		 }
-	  }
+    for (int row=0; row < rows; row++) {
+       for (int slice=0; slice < slices; slice++) {
+      matrix.setQuick(slice,row,column,someValue);
+     }
+    }
    }
 </pre>
 @author wolfgang.hoschek@cern.ch
@@ -59,15 +59,15 @@
  */
 @Deprecated
 public class DenseDoubleMatrix3D extends DoubleMatrix3D {
-	/**
-	  * The elements of this matrix.
-	  * elements are stored in slice major, then row major, then column major, in order of significance, i.e.
-	  * index==slice*sliceStride+ row*rowStride + column*columnStride
-	  * i.e. {slice0 row0..m}, {slice1 row0..m}, ..., {sliceN row0..m}
-	  * with each row storead as 
-	  * {row0 column0..m}, {row1 column0..m}, ..., {rown column0..m}
-	  */
-	protected double[] elements;
+  /**
+    * The elements of this matrix.
+    * elements are stored in slice major, then row major, then column major, in order of significance, i.e.
+    * index==slice*sliceStride+ row*rowStride + column*columnStride
+    * i.e. {slice0 row0..m}, {slice1 row0..m}, ..., {sliceN row0..m}
+    * with each row storead as 
+    * {row0 column0..m}, {row1 column0..m}, ..., {rown column0..m}
+    */
+  protected double[] elements;
 /**
  * Constructs a matrix with a copy of the given values.
  * <tt>values</tt> is required to have the form <tt>values[slice][row][column]</tt>
@@ -80,8 +80,8 @@
  * @throws IllegalArgumentException if <tt>for any 1 &lt;= row &lt; values[0].length: values[slice][row].length != values[slice][row-1].length</tt>.
  */
 public DenseDoubleMatrix3D(double[][][] values) {
-	this(values.length, (values.length==0 ? 0: values[0].length), (values.length==0 ? 0: values[0].length==0 ? 0 : values[0][0].length));
-	assign(values);
+  this(values.length, (values.length==0 ? 0: values[0].length), (values.length==0 ? 0: values[0].length==0 ? 0 : values[0][0].length));
+  assign(values);
 }
 /**
  * Constructs a matrix with a given number of slices, rows and columns.
@@ -89,12 +89,12 @@
  * @param slices the number of slices the matrix shall have.
  * @param rows the number of rows the matrix shall have.
  * @param columns the number of columns the matrix shall have.
- * @throws	IllegalArgumentException if <tt>(double)slices*columns*rows > Integer.MAX_VALUE</tt>.
- * @throws	IllegalArgumentException if <tt>slices<0 || rows<0 || columns<0</tt>.
+ * @throws  IllegalArgumentException if <tt>(double)slices*columns*rows > Integer.MAX_VALUE</tt>.
+ * @throws  IllegalArgumentException if <tt>slices<0 || rows<0 || columns<0</tt>.
  */
 public DenseDoubleMatrix3D(int slices, int rows, int columns) {
-	setUp(slices,rows, columns);
-	this.elements = new double[slices*rows*columns];
+  setUp(slices,rows, columns);
+  this.elements = new double[slices*rows*columns];
 }
 /**
  * Constructs a view with the given parameters.
@@ -108,13 +108,13 @@
  * @param sliceStride the number of elements between two slices, i.e. <tt>index(k+1,i,j)-index(k,i,j)</tt>.
  * @param rowStride the number of elements between two rows, i.e. <tt>index(k,i+1,j)-index(k,i,j)</tt>.
  * @param columnnStride the number of elements between two columns, i.e. <tt>index(k,i,j+1)-index(k,i,j)</tt>.
- * @throws	IllegalArgumentException if <tt>(double)slices*columns*rows > Integer.MAX_VALUE</tt>.
- * @throws	IllegalArgumentException if <tt>slices<0 || rows<0 || columns<0</tt>.
+ * @throws  IllegalArgumentException if <tt>(double)slices*columns*rows > Integer.MAX_VALUE</tt>.
+ * @throws  IllegalArgumentException if <tt>slices<0 || rows<0 || columns<0</tt>.
  */
 protected DenseDoubleMatrix3D(int slices, int rows, int columns, double[] elements, int sliceZero, int rowZero, int columnZero, int sliceStride, int rowStride, int columnStride) {
-	setUp(slices,rows,columns,sliceZero,rowZero,columnZero,sliceStride,rowStride,columnStride);
-	this.elements = elements;
-	this.isNoView = false;
+  setUp(slices,rows,columns,sliceZero,rowZero,columnZero,sliceStride,rowStride,columnStride);
+  this.elements = elements;
+  this.isNoView = false;
 }
 /**
  * Sets all cells to the state specified by <tt>values</tt>.
@@ -129,24 +129,24 @@
  * @throws IllegalArgumentException if <tt>for any 0 &lt;= column &lt; columns(): values[slice][row].length != columns()</tt>.
  */
 public DoubleMatrix3D assign(double[][][] values) {
-	if (this.isNoView) {
-		if (values.length != slices) throw new IllegalArgumentException("Must have same number of slices: slices="+values.length+"slices()="+slices());
-		int i=slices*rows*columns - columns;
-		for (int slice=slices; --slice >= 0;) {
-			double[][] currentSlice = values[slice];
-			if (currentSlice.length != rows) throw new IllegalArgumentException("Must have same number of rows in every slice: rows="+currentSlice.length+"rows()="+rows());
-			for (int row=rows; --row >= 0;) {
-				double[] currentRow = currentSlice[row];
-				if (currentRow.length != columns) throw new IllegalArgumentException("Must have same number of columns in every row: columns="+currentRow.length+"columns()="+columns());			
-				System.arraycopy(currentRow, 0, this.elements, i, columns);
-				i -= columns;
-			}
-		}
-	}
-	else {
-		super.assign(values);
-	}
-	return this;
+  if (this.isNoView) {
+    if (values.length != slices) throw new IllegalArgumentException("Must have same number of slices: slices="+values.length+"slices()="+slices());
+    int i=slices*rows*columns - columns;
+    for (int slice=slices; --slice >= 0;) {
+      double[][] currentSlice = values[slice];
+      if (currentSlice.length != rows) throw new IllegalArgumentException("Must have same number of rows in every slice: rows="+currentSlice.length+"rows()="+rows());
+      for (int row=rows; --row >= 0;) {
+        double[] currentRow = currentSlice[row];
+        if (currentRow.length != columns) throw new IllegalArgumentException("Must have same number of columns in every row: columns="+currentRow.length+"columns()="+columns());      
+        System.arraycopy(currentRow, 0, this.elements, i, columns);
+        i -= columns;
+      }
+    }
+  }
+  else {
+    super.assign(values);
+  }
+  return this;
 }
 /**
  * Replaces all cell values of the receiver with the values of another matrix.
@@ -155,29 +155,29 @@
  *
  * @param     source   the source matrix to copy from (may be identical to the receiver).
  * @return <tt>this</tt> (for convenience only).
- * @throws	IllegalArgumentException if <tt>slices() != source.slices() || rows() != source.rows() || columns() != source.columns()</tt>
+ * @throws  IllegalArgumentException if <tt>slices() != source.slices() || rows() != source.rows() || columns() != source.columns()</tt>
  */
 public DoubleMatrix3D assign(DoubleMatrix3D source) {
-	// overriden for performance only
-	if (! (source instanceof DenseDoubleMatrix3D)) {
-		return super.assign(source);
-	}
-	DenseDoubleMatrix3D other = (DenseDoubleMatrix3D) source;
-	if (other==this) return this;
-	checkShape(other);
-	if (haveSharedCells(other)) {
-		DoubleMatrix3D c = other.copy();
-		if (! (c instanceof DenseDoubleMatrix3D)) { // should not happen
-			return super.assign(source);
-		}
-		other = (DenseDoubleMatrix3D) c;
-	}
+  // overriden for performance only
+  if (! (source instanceof DenseDoubleMatrix3D)) {
+    return super.assign(source);
+  }
+  DenseDoubleMatrix3D other = (DenseDoubleMatrix3D) source;
+  if (other==this) return this;
+  checkShape(other);
+  if (haveSharedCells(other)) {
+    DoubleMatrix3D c = other.copy();
+    if (! (c instanceof DenseDoubleMatrix3D)) { // should not happen
+      return super.assign(source);
+    }
+    other = (DenseDoubleMatrix3D) c;
+  }
 
-	if (this.isNoView && other.isNoView) { // quickest
-		System.arraycopy(other.elements, 0, this.elements, 0, this.elements.length);
-		return this;
-	}
-	return super.assign(other);
+  if (this.isNoView && other.isNoView) { // quickest
+    System.arraycopy(other.elements, 0, this.elements, 0, this.elements.length);
+    return this;
+  }
+  return super.assign(other);
 }
 /**
  * Returns the matrix cell value at coordinate <tt>[slice,row,column]</tt>.
@@ -192,10 +192,10 @@
  * @return    the value at the specified coordinate.
  */
 public double getQuick(int slice, int row, int column) {
-	//if (debug) if (slice<0 || slice>=slices || row<0 || row>=rows || column<0 || column>=columns) throw new IndexOutOfBoundsException("slice:"+slice+", row:"+row+", column:"+column);
-	//return elements[index(slice,row,column)];
-	//manually inlined:
-	return elements[sliceZero + slice*sliceStride + rowZero + row*rowStride + columnZero + column*columnStride];
+  //if (debug) if (slice<0 || slice>=slices || row<0 || row>=rows || column<0 || column>=columns) throw new IndexOutOfBoundsException("slice:"+slice+", row:"+row+", column:"+column);
+  //return elements[index(slice,row,column)];
+  //manually inlined:
+  return elements[sliceZero + slice*sliceStride + rowZero + row*rowStride + columnZero + column*columnStride];
 }
 /**
  * Returns <tt>true</tt> if both matrices share common cells.
@@ -207,15 +207,15 @@
  * </ul>
  */
 protected boolean haveSharedCellsRaw(DoubleMatrix3D other) {
-	if (other instanceof SelectedDenseDoubleMatrix3D) {
-		SelectedDenseDoubleMatrix3D otherMatrix = (SelectedDenseDoubleMatrix3D) other;
-		return this.elements==otherMatrix.elements;
-	}
-	else if (other instanceof DenseDoubleMatrix3D) {
-		DenseDoubleMatrix3D otherMatrix = (DenseDoubleMatrix3D) other;
-		return this.elements==otherMatrix.elements;
-	}
-	return false;
+  if (other instanceof SelectedDenseDoubleMatrix3D) {
+    SelectedDenseDoubleMatrix3D otherMatrix = (SelectedDenseDoubleMatrix3D) other;
+    return this.elements==otherMatrix.elements;
+  }
+  else if (other instanceof DenseDoubleMatrix3D) {
+    DenseDoubleMatrix3D otherMatrix = (DenseDoubleMatrix3D) other;
+    return this.elements==otherMatrix.elements;
+  }
+  return false;
 }
 /**
  * Returns the position of the given coordinate within the (virtual or non-virtual) internal 1-dimensional array. 
@@ -225,9 +225,9 @@
  * @param     column   the index of the third-coordinate.
  */
 protected int index(int slice, int row, int column) {
-	//return _sliceOffset(_sliceRank(slice)) + _rowOffset(_rowRank(row)) + _columnOffset(_columnRank(column));
-	//manually inlined:
-	return sliceZero + slice*sliceStride + rowZero + row*rowStride + columnZero + column*columnStride;	
+  //return _sliceOffset(_sliceRank(slice)) + _rowOffset(_rowRank(row)) + _columnOffset(_columnRank(column));
+  //manually inlined:
+  return sliceZero + slice*sliceStride + rowZero + row*rowStride + columnZero + column*columnStride;  
 }
 /**
  * Construct and returns a new empty matrix <i>of the same dynamic type</i> as the receiver, having the specified number of slices, rows and columns.
@@ -241,7 +241,7 @@
  * @return  a new empty matrix of the same dynamic type.
  */
 public DoubleMatrix3D like(int slices, int rows, int columns) {
-	return new DenseDoubleMatrix3D(slices,rows,columns); 
+  return new DenseDoubleMatrix3D(slices,rows,columns); 
 }
 /**
  * Construct and returns a new 2-d matrix <i>of the corresponding dynamic type</i>, sharing the same cells.
@@ -257,7 +257,7 @@
  * @return  a new matrix of the corresponding dynamic type.
  */
 protected DoubleMatrix2D like2D(int rows, int columns, int rowZero, int columnZero, int rowStride, int columnStride) {
-	return new DenseDoubleMatrix2D(rows,columns,this.elements,rowZero,columnZero,rowStride,columnStride);
+  return new DenseDoubleMatrix2D(rows,columns,this.elements,rowZero,columnZero,rowStride,columnStride);
 }
 /**
  * Sets the matrix cell at coordinate <tt>[slice,row,column]</tt> to the specified value.
@@ -272,10 +272,10 @@
  * @param    value the value to be filled into the specified cell.
  */
 public void setQuick(int slice, int row, int column, double value) {
-	//if (debug) if (slice<0 || slice>=slices || row<0 || row>=rows || column<0 || column>=columns) throw new IndexOutOfBoundsException("slice:"+slice+", row:"+row+", column:"+column);
-	//elements[index(slice,row,column)] = value;
-	//manually inlined:
-	elements[sliceZero + slice*sliceStride + rowZero + row*rowStride + columnZero + column*columnStride] = value;
+  //if (debug) if (slice<0 || slice>=slices || row<0 || row>=rows || column<0 || column>=columns) throw new IndexOutOfBoundsException("slice:"+slice+", row:"+row+", column:"+column);
+  //elements[index(slice,row,column)] = value;
+  //manually inlined:
+  elements[sliceZero + slice*sliceStride + rowZero + row*rowStride + columnZero + column*columnStride] = value;
 }
 /**
  * Construct and returns a new selection view.
@@ -286,7 +286,7 @@
  * @return  a new view.
  */
 protected DoubleMatrix3D viewSelectionLike(int[] sliceOffsets, int[] rowOffsets, int[] columnOffsets) {
-	return new SelectedDenseDoubleMatrix3D(this.elements,sliceOffsets,rowOffsets,columnOffsets,0);
+  return new SelectedDenseDoubleMatrix3D(this.elements,sliceOffsets,rowOffsets,columnOffsets,0);
 }
 /**
 27 neighbor stencil transformation. For efficient finite difference operations.
@@ -340,121 +340,121 @@
 };
 A.zAssign27Neighbors(B,f);
 </pre>
-	
+  
 @param B the matrix to hold the results.
 @param function the function to be applied to the 27 cells.
 @throws NullPointerException if <tt>function==null</tt>.
 @throws IllegalArgumentException if <tt>rows() != B.rows() || columns() != B.columns() || slices() != B.slices() </tt>.
 */
 public void zAssign27Neighbors(DoubleMatrix3D B, org.apache.mahout.matrix.function.Double27Function function) {
-	// overridden for performance only
-	if (!(B instanceof DenseDoubleMatrix3D)) {
-		super.zAssign27Neighbors(B, function);
-		return;
-	}
-	if (function==null) throw new NullPointerException("function must not be null.");
-	checkShape(B);
-	int r = rows-1;
-	int c = columns-1;
-	if (rows<3 || columns<3 || slices<3) return; // nothing to do
+  // overridden for performance only
+  if (!(B instanceof DenseDoubleMatrix3D)) {
+    super.zAssign27Neighbors(B, function);
+    return;
+  }
+  if (function==null) throw new NullPointerException("function must not be null.");
+  checkShape(B);
+  int r = rows-1;
+  int c = columns-1;
+  if (rows<3 || columns<3 || slices<3) return; // nothing to do
 
-	DenseDoubleMatrix3D BB = (DenseDoubleMatrix3D) B;
-	int A_ss = sliceStride;
-	int A_rs = rowStride;
-	int B_rs = BB.rowStride;
-	int A_cs = columnStride;
-	int B_cs = BB.columnStride;
-	double[] elems = this.elements;
-	double[] B_elems = BB.elements;
-	if (elems == null || B_elems==null) throw new InternalError();
+  DenseDoubleMatrix3D BB = (DenseDoubleMatrix3D) B;
+  int A_ss = sliceStride;
+  int A_rs = rowStride;
+  int B_rs = BB.rowStride;
+  int A_cs = columnStride;
+  int B_cs = BB.columnStride;
+  double[] elems = this.elements;
+  double[] B_elems = BB.elements;
+  if (elems == null || B_elems==null) throw new InternalError();
 
-	for (int k=1; k<slices-1; k++) {
-		int A_index = index(k,1,1);
-		int B_index = BB.index(k,1,1);
+  for (int k=1; k<slices-1; k++) {
+    int A_index = index(k,1,1);
+    int B_index = BB.index(k,1,1);
 
-		for (int i=1; i<r; i++) {
-			int A002 = A_index - A_ss - A_rs - A_cs;
-			int A012 = A002 + A_rs;
-			int A022 = A012 + A_rs;
+    for (int i=1; i<r; i++) {
+      int A002 = A_index - A_ss - A_rs - A_cs;
+      int A012 = A002 + A_rs;
+      int A022 = A012 + A_rs;
 
-			int A102 = A002 + A_ss;
-			int A112 = A102 + A_rs;
-			int A122 = A112 + A_rs;
+      int A102 = A002 + A_ss;
+      int A112 = A102 + A_rs;
+      int A122 = A112 + A_rs;
 
-			int A202 = A102 + A_ss;
-			int A212 = A202 + A_rs;
-			int A222 = A212 + A_rs;
+      int A202 = A102 + A_ss;
+      int A212 = A202 + A_rs;
+      int A222 = A212 + A_rs;
 
-			double a000, a001, a002;
-			double a010, a011, a012;
-			double a020, a021, a022;
+      double a000, a001, a002;
+      double a010, a011, a012;
+      double a020, a021, a022;
 
-			double a100, a101, a102;
-			double a110, a111, a112;
-			double a120, a121, a122;
+      double a100, a101, a102;
+      double a110, a111, a112;
+      double a120, a121, a122;
 
-			double a200, a201, a202;
-			double a210, a211, a212;
-			double a220, a221, a222;
-	
-			a000=elems[A002]; A002+=A_cs;   a001=elems[A002];
-			a010=elems[A012]; A012+=A_cs;   a011=elems[A012]; 
-			a020=elems[A022]; A022+=A_cs;   a021=elems[A022]; 
+      double a200, a201, a202;
+      double a210, a211, a212;
+      double a220, a221, a222;
+  
+      a000=elems[A002]; A002+=A_cs;   a001=elems[A002];
+      a010=elems[A012]; A012+=A_cs;   a011=elems[A012]; 
+      a020=elems[A022]; A022+=A_cs;   a021=elems[A022]; 
 
-			a100=elems[A102]; A102+=A_cs;   a101=elems[A102]; 
-			a110=elems[A112]; A112+=A_cs;   a111=elems[A112]; 
-			a120=elems[A122]; A122+=A_cs;   a121=elems[A122]; 
+      a100=elems[A102]; A102+=A_cs;   a101=elems[A102]; 
+      a110=elems[A112]; A112+=A_cs;   a111=elems[A112]; 
+      a120=elems[A122]; A122+=A_cs;   a121=elems[A122]; 
 
-			a200=elems[A202]; A202+=A_cs;   a201=elems[A202];
-			a210=elems[A212]; A212+=A_cs;   a211=elems[A212]; 
-			a220=elems[A222]; A222+=A_cs;   a221=elems[A222]; 
+      a200=elems[A202]; A202+=A_cs;   a201=elems[A202];
+      a210=elems[A212]; A212+=A_cs;   a211=elems[A212]; 
+      a220=elems[A222]; A222+=A_cs;   a221=elems[A222]; 
 
-			int B11 = B_index;
-			for (int j=1; j<c; j++) {
-				// in each step 18 cells can be remembered in registers - they don't need to be reread from slow memory
-				// in each step 9 instead of 27 cells need to be read from memory.
-				a002=elems[A002+=A_cs]; 
-				a012=elems[A012+=A_cs]; 
-				a022=elems[A022+=A_cs]; 
+      int B11 = B_index;
+      for (int j=1; j<c; j++) {
+        // in each step 18 cells can be remembered in registers - they don't need to be reread from slow memory
+        // in each step 9 instead of 27 cells need to be read from memory.
+        a002=elems[A002+=A_cs]; 
+        a012=elems[A012+=A_cs]; 
+        a022=elems[A022+=A_cs]; 
 
-				a102=elems[A102+=A_cs]; 
-				a112=elems[A112+=A_cs]; 
-				a122=elems[A122+=A_cs]; 
+        a102=elems[A102+=A_cs]; 
+        a112=elems[A112+=A_cs]; 
+        a122=elems[A122+=A_cs]; 
 
-				a202=elems[A202+=A_cs]; 
-				a212=elems[A212+=A_cs]; 
-				a222=elems[A222+=A_cs]; 
+        a202=elems[A202+=A_cs]; 
+        a212=elems[A212+=A_cs]; 
+        a222=elems[A222+=A_cs]; 
 
-				B_elems[B11] = function.apply(
-					a000, a001, a002,
-					a010, a011, a012,
-					a020, a021, a022,
-					
-					a100, a101, a102,
-					a110, a111, a112,
-					a120, a121, a122,
-					
-					a200, a201, a202,
-					a210, a211, a212,
-					a220, a221, a222);
-				B11 += B_cs;
-				
-				// move remembered cells
-				a000=a001; a001=a002;
-				a010=a011; a011=a012;
-				a020=a021; a021=a022;
+        B_elems[B11] = function.apply(
+          a000, a001, a002,
+          a010, a011, a012,
+          a020, a021, a022,
+          
+          a100, a101, a102,
+          a110, a111, a112,
+          a120, a121, a122,
+          
+          a200, a201, a202,
+          a210, a211, a212,
+          a220, a221, a222);
+        B11 += B_cs;
+        
+        // move remembered cells
+        a000=a001; a001=a002;
+        a010=a011; a011=a012;
+        a020=a021; a021=a022;
 
-				a100=a101; a101=a102;
-				a110=a111; a111=a112;
-				a120=a121; a121=a122;
+        a100=a101; a101=a102;
+        a110=a111; a111=a112;
+        a120=a121; a121=a122;
 
-				a200=a201; a201=a202;
-				a210=a211; a211=a212;
-				a220=a221; a221=a222;			
-			}
-		A_index += A_rs;
-		B_index += B_rs;
-		}
-	}
+        a200=a201; a201=a202;
+        a210=a211; a211=a212;
+        a220=a221; a221=a222;      
+      }
+    A_index += A_rs;
+    B_index += B_rs;
+    }
+  }
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SelectedSparseObjectMatrix1D.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SelectedSparseObjectMatrix1D.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SelectedSparseObjectMatrix1D.java	(working copy)
@@ -44,20 +44,20 @@
 @version 1.0, 09/24/99
 */
 class SelectedSparseObjectMatrix1D extends ObjectMatrix1D {
-	/*
-	 * The elements of the matrix.
-	 */
-	protected AbstractIntObjectMap elements; 
-	
-	/**
-	  * The offsets of visible indexes of this matrix.
-	  */
-	protected int[] offsets;
+  /*
+   * The elements of the matrix.
+   */
+  protected AbstractIntObjectMap elements; 
+  
+  /**
+    * The offsets of visible indexes of this matrix.
+    */
+  protected int[] offsets;
 
-	/**
-	  * The offset.
-	  */
-	protected int offset;	
+  /**
+    * The offset.
+    */
+  protected int offset;  
 /**
  * Constructs a matrix view with the given parameters.
  * @param size the number of cells the matrix shall have.
@@ -68,12 +68,12 @@
  * @param offset   
  */
 protected SelectedSparseObjectMatrix1D(int size, AbstractIntObjectMap elements, int zero, int stride, int[] offsets, int offset) {
-	setUp(size,zero,stride);
-	
-	this.elements = elements;
-	this.offsets = offsets;
-	this.offset = offset;
-	this.isNoView = false;
+  setUp(size,zero,stride);
+  
+  this.elements = elements;
+  this.offsets = offsets;
+  this.offset = offset;
+  this.isNoView = false;
 }
 /**
  * Constructs a matrix view with the given parameters.
@@ -81,7 +81,7 @@
  * @param  indexes   The indexes of the cells that shall be visible.
  */
 protected SelectedSparseObjectMatrix1D(AbstractIntObjectMap elements, int[] offsets) {
-	this(offsets.length,elements,0,1,offsets,0);
+  this(offsets.length,elements,0,1,offsets,0);
 }
 /**
  * Returns the position of the given absolute rank within the (virtual or non-virtual) internal 1-dimensional array. 
@@ -91,7 +91,7 @@
  * @return the position.
  */
 protected int _offset(int absRank) {
-	return offsets[absRank];
+  return offsets[absRank];
 }
 /**
  * Returns the matrix cell value at coordinate <tt>index</tt>.
@@ -104,24 +104,24 @@
  * @return    the value of the specified cell.
  */
 public Object getQuick(int index) {
-	//if (debug) if (index<0 || index>=size) checkIndex(index);
-	//return elements.get(index(index));
-	//manually inlined:
-	return elements.get(offset + offsets[zero + index*stride]);
+  //if (debug) if (index<0 || index>=size) checkIndex(index);
+  //return elements.get(index(index));
+  //manually inlined:
+  return elements.get(offset + offsets[zero + index*stride]);
 }
 /**
  * Returns <tt>true</tt> if both matrices share at least one identical cell.
  */
 protected boolean haveSharedCellsRaw(ObjectMatrix1D other) {
-	if (other instanceof SelectedSparseObjectMatrix1D) {
-		SelectedSparseObjectMatrix1D otherMatrix = (SelectedSparseObjectMatrix1D) other;
-		return this.elements==otherMatrix.elements;
-	}
-	else if (other instanceof SparseObjectMatrix1D) {
-		SparseObjectMatrix1D otherMatrix = (SparseObjectMatrix1D) other;
-		return this.elements==otherMatrix.elements;
-	}
-	return false;
+  if (other instanceof SelectedSparseObjectMatrix1D) {
+    SelectedSparseObjectMatrix1D otherMatrix = (SelectedSparseObjectMatrix1D) other;
+    return this.elements==otherMatrix.elements;
+  }
+  else if (other instanceof SparseObjectMatrix1D) {
+    SparseObjectMatrix1D otherMatrix = (SparseObjectMatrix1D) other;
+    return this.elements==otherMatrix.elements;
+  }
+  return false;
 }
 /**
  * Returns the position of the element with the given relative rank within the (virtual or non-virtual) internal 1-dimensional array.
@@ -130,9 +130,9 @@
  * @param     rank   the rank of the element.
  */
 protected int index(int rank) {
-	//return this.offset + super.index(rank);
-	// manually inlined:
-	return offset + offsets[zero + rank*stride];
+  //return this.offset + super.index(rank);
+  // manually inlined:
+  return offset + offsets[zero + rank*stride];
 }
 /**
  * Construct and returns a new empty matrix <i>of the same dynamic type</i> as the receiver, having the specified size.
@@ -144,7 +144,7 @@
  * @return  a new empty matrix of the same dynamic type.
  */
 public ObjectMatrix1D like(int size) {
-	return new SparseObjectMatrix1D(size);
+  return new SparseObjectMatrix1D(size);
 }
 /**
  * Construct and returns a new 2-d matrix <i>of the corresponding dynamic type</i>, entirelly independent of the receiver.
@@ -156,7 +156,7 @@
  * @return  a new matrix of the corresponding dynamic type.
  */
 public ObjectMatrix2D like2D(int rows, int columns) {
-	return new SparseObjectMatrix2D(rows,columns);
+  return new SparseObjectMatrix2D(rows,columns);
 }
 /**
  * Sets the matrix cell at coordinate <tt>index</tt> to the specified value.
@@ -169,23 +169,23 @@
  * @param    value the value to be filled into the specified cell.
  */
 public void setQuick(int index, Object value) {
-	//if (debug) if (index<0 || index>=size) checkIndex(index);
-	//int i =	index(index);
-	//manually inlined:
-	int i = offset + offsets[zero + index*stride];
-	if (value == null)
-		this.elements.removeKey(i);
-	else 
-		this.elements.put(i, value);
+  //if (debug) if (index<0 || index>=size) checkIndex(index);
+  //int i =  index(index);
+  //manually inlined:
+  int i = offset + offsets[zero + index*stride];
+  if (value == null)
+    this.elements.removeKey(i);
+  else 
+    this.elements.put(i, value);
 }
 /**
  * Sets up a matrix with a given number of cells.
  * @param size the number of cells the matrix shall have.
  */
 protected void setUp(int size) {
-	super.setUp(size);
-	this.stride = 1;
-	this.offset = 0;
+  super.setUp(size);
+  this.stride = 1;
+  this.offset = 0;
 }
 /**
  * Construct and returns a new selection view.
@@ -194,6 +194,6 @@
  * @return  a new view.
  */
 protected ObjectMatrix1D viewSelectionLike(int[] offsets) {
-	return new SelectedSparseObjectMatrix1D(this.elements,offsets);
+  return new SelectedSparseObjectMatrix1D(this.elements,offsets);
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SelectedSparseObjectMatrix2D.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SelectedSparseObjectMatrix2D.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SelectedSparseObjectMatrix2D.java	(working copy)
@@ -44,21 +44,21 @@
 @version 1.0, 09/24/99
 */
 class SelectedSparseObjectMatrix2D extends ObjectMatrix2D {
-	/*
-	 * The elements of the matrix.
-	 */
-	protected AbstractIntObjectMap elements; 
-	
-	/**
-	  * The offsets of the visible cells of this matrix.
-	  */
-	protected int[] rowOffsets;
-	protected int[] columnOffsets;
-	
-	/**
-	  * The offset.
-	  */
-	protected int offset;	
+  /*
+   * The elements of the matrix.
+   */
+  protected AbstractIntObjectMap elements; 
+  
+  /**
+    * The offsets of the visible cells of this matrix.
+    */
+  protected int[] rowOffsets;
+  protected int[] columnOffsets;
+  
+  /**
+    * The offset.
+    */
+  protected int offset;  
 /**
  * Constructs a matrix view with the given parameters.
  * @param rows the number of rows the matrix shall have.
@@ -73,15 +73,15 @@
  * @param  offset   
  */
 protected SelectedSparseObjectMatrix2D(int rows, int columns, AbstractIntObjectMap elements, int rowZero, int columnZero, int rowStride, int columnStride, int[] rowOffsets, int[] columnOffsets, int offset) {
-	// be sure parameters are valid, we do not check...
-	setUp(rows,columns,rowZero,columnZero,rowStride,columnStride);
-	
-	this.elements = elements;
-	this.rowOffsets = rowOffsets;
-	this.columnOffsets = columnOffsets;
-	this.offset = offset;
-	
-	this.isNoView = false;
+  // be sure parameters are valid, we do not check...
+  setUp(rows,columns,rowZero,columnZero,rowStride,columnStride);
+  
+  this.elements = elements;
+  this.rowOffsets = rowOffsets;
+  this.columnOffsets = columnOffsets;
+  this.offset = offset;
+  
+  this.isNoView = false;
 }
 /**
  * Constructs a matrix view with the given parameters.
@@ -91,7 +91,7 @@
  * @param  offset   
  */
 protected SelectedSparseObjectMatrix2D(AbstractIntObjectMap elements, int[] rowOffsets, int[] columnOffsets, int offset) {
-	this(rowOffsets.length,columnOffsets.length,elements,0,0,1,1,rowOffsets,columnOffsets,offset);
+  this(rowOffsets.length,columnOffsets.length,elements,0,0,1,1,rowOffsets,columnOffsets,offset);
 }
 /**
  * Returns the position of the given absolute rank within the (virtual or non-virtual) internal 1-dimensional array. 
@@ -101,7 +101,7 @@
  * @return the position.
  */
 protected int _columnOffset(int absRank) {
-	return columnOffsets[absRank];
+  return columnOffsets[absRank];
 }
 /**
  * Returns the position of the given absolute rank within the (virtual or non-virtual) internal 1-dimensional array. 
@@ -111,7 +111,7 @@
  * @return the position.
  */
 protected int _rowOffset(int absRank) {
-	return rowOffsets[absRank];
+  return rowOffsets[absRank];
 }
 /**
  * Returns the matrix cell value at coordinate <tt>[row,column]</tt>.
@@ -125,10 +125,10 @@
  * @return    the value at the specified coordinate.
  */
 public Object getQuick(int row, int column) {
-	//if (debug) if (column<0 || column>=columns || row<0 || row>=rows) throw new IndexOutOfBoundsException("row:"+row+", column:"+column);
-	//return elements.get(index(row,column));
-	//manually inlined:
-	return elements.get(offset + rowOffsets[rowZero + row*rowStride] + columnOffsets[columnZero + column*columnStride]);
+  //if (debug) if (column<0 || column>=columns || row<0 || row>=rows) throw new IndexOutOfBoundsException("row:"+row+", column:"+column);
+  //return elements.get(index(row,column));
+  //manually inlined:
+  return elements.get(offset + rowOffsets[rowZero + row*rowStride] + columnOffsets[columnZero + column*columnStride]);
 }
 /**
  * Returns <tt>true</tt> if both matrices share common cells.
@@ -140,15 +140,15 @@
  * </ul>
  */
 protected boolean haveSharedCellsRaw(ObjectMatrix2D other) {
-	if (other instanceof SelectedSparseObjectMatrix2D) {
-		SelectedSparseObjectMatrix2D otherMatrix = (SelectedSparseObjectMatrix2D) other;
-		return this.elements==otherMatrix.elements;
-	}
-	else if (other instanceof SparseObjectMatrix2D) {
-		SparseObjectMatrix2D otherMatrix = (SparseObjectMatrix2D) other;
-		return this.elements==otherMatrix.elements;
-	}
-	return false;
+  if (other instanceof SelectedSparseObjectMatrix2D) {
+    SelectedSparseObjectMatrix2D otherMatrix = (SelectedSparseObjectMatrix2D) other;
+    return this.elements==otherMatrix.elements;
+  }
+  else if (other instanceof SparseObjectMatrix2D) {
+    SparseObjectMatrix2D otherMatrix = (SparseObjectMatrix2D) other;
+    return this.elements==otherMatrix.elements;
+  }
+  return false;
 }
 /**
  * Returns the position of the given coordinate within the (virtual or non-virtual) internal 1-dimensional array. 
@@ -157,9 +157,9 @@
  * @param     column   the index of the column-coordinate.
  */
 protected int index(int row, int column) {
-	//return this.offset + super.index(row,column);
-	//manually inlined:
-	return this.offset + rowOffsets[rowZero + row*rowStride] + columnOffsets[columnZero + column*columnStride];
+  //return this.offset + super.index(row,column);
+  //manually inlined:
+  return this.offset + rowOffsets[rowZero + row*rowStride] + columnOffsets[columnZero + column*columnStride];
 }
 /**
  * Construct and returns a new empty matrix <i>of the same dynamic type</i> as the receiver, having the specified number of rows and columns.
@@ -172,7 +172,7 @@
  * @return  a new empty matrix of the same dynamic type.
  */
 public ObjectMatrix2D like(int rows, int columns) {
-	return new SparseObjectMatrix2D(rows, columns);
+  return new SparseObjectMatrix2D(rows, columns);
 }
 /**
  * Construct and returns a new 1-d matrix <i>of the corresponding dynamic type</i>, entirelly independent of the receiver.
@@ -183,7 +183,7 @@
  * @return  a new matrix of the corresponding dynamic type.
  */
 public ObjectMatrix1D like1D(int size) {
-	return new SparseObjectMatrix1D(size);
+  return new SparseObjectMatrix1D(size);
 }
 /**
  * Construct and returns a new 1-d matrix <i>of the corresponding dynamic type</i>, sharing the same cells.
@@ -196,7 +196,7 @@
  * @return  a new matrix of the corresponding dynamic type.
  */
 protected ObjectMatrix1D like1D(int size, int zero, int stride) {
-	throw new InternalError(); // this method is never called since viewRow() and viewColumn are overridden properly.
+  throw new InternalError(); // this method is never called since viewRow() and viewColumn are overridden properly.
 }
 /**
  * Sets the matrix cell at coordinate <tt>[row,column]</tt> to the specified value.
@@ -210,40 +210,40 @@
  * @param    value the value to be filled into the specified cell.
  */
 public void setQuick(int row, int column, Object value) {
-	//if (debug) if (column<0 || column>=columns || row<0 || row>=rows) throw new IndexOutOfBoundsException("row:"+row+", column:"+column);
-	//int index =	index(row,column);
-	//manually inlined:
-	int index = offset + rowOffsets[rowZero + row*rowStride] + columnOffsets[columnZero + column*columnStride];
+  //if (debug) if (column<0 || column>=columns || row<0 || row>=rows) throw new IndexOutOfBoundsException("row:"+row+", column:"+column);
+  //int index =  index(row,column);
+  //manually inlined:
+  int index = offset + rowOffsets[rowZero + row*rowStride] + columnOffsets[columnZero + column*columnStride];
 
-	if (value == null)
-		this.elements.removeKey(index);
-	else 
-		this.elements.put(index, value);
+  if (value == null)
+    this.elements.removeKey(index);
+  else 
+    this.elements.put(index, value);
 }
 /**
  * Sets up a matrix with a given number of rows and columns.
  * @param rows the number of rows the matrix shall have.
  * @param columns the number of columns the matrix shall have.
- * @throws	IllegalArgumentException if <tt>(Object)columns*rows > Integer.MAX_VALUE</tt>.
+ * @throws  IllegalArgumentException if <tt>(Object)columns*rows > Integer.MAX_VALUE</tt>.
  */
 protected void setUp(int rows, int columns) {
-	super.setUp(rows,columns);
-	this.rowStride = 1;
-	this.columnStride = 1;
-	this.offset = 0;
+  super.setUp(rows,columns);
+  this.rowStride = 1;
+  this.columnStride = 1;
+  this.offset = 0;
 }
 /**
 Self modifying version of viewDice().
 */
 protected AbstractMatrix2D vDice() {
-	super.vDice();
-	// swap
-	int[] tmp = rowOffsets; rowOffsets = columnOffsets; columnOffsets = tmp;
+  super.vDice();
+  // swap
+  int[] tmp = rowOffsets; rowOffsets = columnOffsets; columnOffsets = tmp;
 
-	// flips stay unaffected
+  // flips stay unaffected
 
-	this.isNoView = false;
-	return this;
+  this.isNoView = false;
+  return this;
 }
 /**
 Constructs and returns a new <i>slice view</i> representing the rows of the given column.
@@ -253,12 +253,12 @@
 <b>Example:</b> 
 <table border="0">
   <tr nowrap> 
-	<td valign="top">2 x 3 matrix: <br>
-	  1, 2, 3<br>
-	  4, 5, 6 </td>
-	<td>viewColumn(0) ==></td>
-	<td valign="top">Matrix1D of size 2:<br>
-	  1, 4</td>
+  <td valign="top">2 x 3 matrix: <br>
+    1, 2, 3<br>
+    4, 5, 6 </td>
+  <td>viewColumn(0) ==></td>
+  <td valign="top">Matrix1D of size 2:<br>
+    1, 4</td>
    </tr>
 </table>
 
@@ -268,13 +268,13 @@
 @see #viewRow(int)
 */
 public ObjectMatrix1D viewColumn(int column) {
-	checkColumn(column);
-	int viewSize = this.rows;
-	int viewZero = this.rowZero;
-	int viewStride = this.rowStride;
-	int[] viewOffsets = this.rowOffsets;
-	int viewOffset = this.offset + _columnOffset(_columnRank(column));
-	return new SelectedSparseObjectMatrix1D(viewSize,this.elements,viewZero,viewStride,viewOffsets,viewOffset);
+  checkColumn(column);
+  int viewSize = this.rows;
+  int viewZero = this.rowZero;
+  int viewStride = this.rowStride;
+  int[] viewOffsets = this.rowOffsets;
+  int viewOffset = this.offset + _columnOffset(_columnRank(column));
+  return new SelectedSparseObjectMatrix1D(viewSize,this.elements,viewZero,viewStride,viewOffsets,viewOffset);
 }
 /**
 Constructs and returns a new <i>slice view</i> representing the columns of the given row.
@@ -284,12 +284,12 @@
 <b>Example:</b> 
 <table border="0">
   <tr nowrap> 
-	<td valign="top">2 x 3 matrix: <br>
-	  1, 2, 3<br>
-	  4, 5, 6 </td>
-	<td>viewRow(0) ==></td>
-	<td valign="top">Matrix1D of size 3:<br>
-	  1, 2, 3</td>
+  <td valign="top">2 x 3 matrix: <br>
+    1, 2, 3<br>
+    4, 5, 6 </td>
+  <td>viewRow(0) ==></td>
+  <td valign="top">Matrix1D of size 3:<br>
+    1, 2, 3</td>
    </tr>
 </table>
 
@@ -299,13 +299,13 @@
 @see #viewColumn(int)
 */
 public ObjectMatrix1D viewRow(int row) {
-	checkRow(row);
-	int viewSize = this.columns;
-	int viewZero = columnZero;
-	int viewStride = this.columnStride;
-	int[] viewOffsets = this.columnOffsets;
-	int viewOffset = this.offset + _rowOffset(_rowRank(row));
-	return new SelectedSparseObjectMatrix1D(viewSize,this.elements,viewZero,viewStride,viewOffsets,viewOffset);
+  checkRow(row);
+  int viewSize = this.columns;
+  int viewZero = columnZero;
+  int viewStride = this.columnStride;
+  int[] viewOffsets = this.columnOffsets;
+  int viewOffset = this.offset + _rowOffset(_rowRank(row));
+  return new SelectedSparseObjectMatrix1D(viewSize,this.elements,viewZero,viewStride,viewOffsets,viewOffset);
 }
 /**
  * Construct and returns a new selection view.
@@ -315,6 +315,6 @@
  * @return  a new view.
  */
 protected ObjectMatrix2D viewSelectionLike(int[] rowOffsets, int[] columnOffsets) {
-	return new SelectedSparseObjectMatrix2D(this.elements,rowOffsets,columnOffsets,this.offset);
+  return new SelectedSparseObjectMatrix2D(this.elements,rowOffsets,columnOffsets,this.offset);
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SelectedSparseObjectMatrix3D.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SelectedSparseObjectMatrix3D.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SelectedSparseObjectMatrix3D.java	(working copy)
@@ -44,23 +44,23 @@
 @version 1.0, 09/24/99
 */
 class SelectedSparseObjectMatrix3D extends ObjectMatrix3D {
-	/**
-	  * The elements of this matrix.
-	  */
-	protected AbstractIntObjectMap elements;
-	
-	/**
-	  * The offsets of the visible cells of this matrix.
-	  */
-	protected int[] sliceOffsets;
-	protected int[] rowOffsets;
-	protected int[] columnOffsets;
-	
-	/**
-	  * The offset.
-	  */
-	protected int offset;	
-	
+  /**
+    * The elements of this matrix.
+    */
+  protected AbstractIntObjectMap elements;
+  
+  /**
+    * The offsets of the visible cells of this matrix.
+    */
+  protected int[] sliceOffsets;
+  protected int[] rowOffsets;
+  protected int[] columnOffsets;
+  
+  /**
+    * The offset.
+    */
+  protected int offset;  
+  
 /**
  * Constructs a matrix view with the given parameters.
  * @param elements the cells.
@@ -69,21 +69,21 @@
  * @param  columnOffsets   The column offsets of the cells that shall be visible.
  */
 protected SelectedSparseObjectMatrix3D(AbstractIntObjectMap elements, int[] sliceOffsets, int[] rowOffsets, int[] columnOffsets, int offset) {
-	// be sure parameters are valid, we do not check...
-	int slices = sliceOffsets.length;
-	int rows = rowOffsets.length;
-	int columns = columnOffsets.length;
-	setUp(slices,rows, columns);
-	
-	this.elements = elements;
-	
-	this.sliceOffsets = sliceOffsets;
-	this.rowOffsets = rowOffsets;
-	this.columnOffsets = columnOffsets;
+  // be sure parameters are valid, we do not check...
+  int slices = sliceOffsets.length;
+  int rows = rowOffsets.length;
+  int columns = columnOffsets.length;
+  setUp(slices,rows, columns);
+  
+  this.elements = elements;
+  
+  this.sliceOffsets = sliceOffsets;
+  this.rowOffsets = rowOffsets;
+  this.columnOffsets = columnOffsets;
 
-	this.offset = offset;
-	
-	this.isNoView = false;
+  this.offset = offset;
+  
+  this.isNoView = false;
 }
 /**
  * Returns the position of the given absolute rank within the (virtual or non-virtual) internal 1-dimensional array. 
@@ -93,7 +93,7 @@
  * @return the position.
  */
 protected int _columnOffset(int absRank) {
-	return columnOffsets[absRank];
+  return columnOffsets[absRank];
 }
 /**
  * Returns the position of the given absolute rank within the (virtual or non-virtual) internal 1-dimensional array. 
@@ -103,7 +103,7 @@
  * @return the position.
  */
 protected int _rowOffset(int absRank) {
-	return rowOffsets[absRank];
+  return rowOffsets[absRank];
 }
 /**
  * Returns the position of the given absolute rank within the (virtual or non-virtual) internal 1-dimensional array. 
@@ -113,7 +113,7 @@
  * @return the position.
  */
 protected int _sliceOffset(int absRank) {
-	return sliceOffsets[absRank];
+  return sliceOffsets[absRank];
 }
 /**
  * Returns the matrix cell value at coordinate <tt>[slice,row,column]</tt>.
@@ -128,10 +128,10 @@
  * @return    the value at the specified coordinate.
  */
 public Object getQuick(int slice, int row, int column) {
-	//if (debug) if (slice<0 || slice>=slices || row<0 || row>=rows || column<0 || column>=columns) throw new IndexOutOfBoundsException("slice:"+slice+", row:"+row+", column:"+column);
-	//return elements.get(index(slice,row,column));
-	//manually inlined:
-	return elements.get(offset + sliceOffsets[sliceZero + slice*sliceStride] + rowOffsets[rowZero + row*rowStride] + columnOffsets[columnZero + column*columnStride]);
+  //if (debug) if (slice<0 || slice>=slices || row<0 || row>=rows || column<0 || column>=columns) throw new IndexOutOfBoundsException("slice:"+slice+", row:"+row+", column:"+column);
+  //return elements.get(index(slice,row,column));
+  //manually inlined:
+  return elements.get(offset + sliceOffsets[sliceZero + slice*sliceStride] + rowOffsets[rowZero + row*rowStride] + columnOffsets[columnZero + column*columnStride]);
 }
 /**
  * Returns <tt>true</tt> if both matrices share common cells.
@@ -143,15 +143,15 @@
  * </ul>
  */
 protected boolean haveSharedCellsRaw(ObjectMatrix3D other) {
-	if (other instanceof SelectedSparseObjectMatrix3D) {
-		SelectedSparseObjectMatrix3D otherMatrix = (SelectedSparseObjectMatrix3D) other;
-		return this.elements==otherMatrix.elements;
-	}
-	else if (other instanceof SparseObjectMatrix3D) {
-		SparseObjectMatrix3D otherMatrix = (SparseObjectMatrix3D) other;
-		return this.elements==otherMatrix.elements;
-	}
-	return false;
+  if (other instanceof SelectedSparseObjectMatrix3D) {
+    SelectedSparseObjectMatrix3D otherMatrix = (SelectedSparseObjectMatrix3D) other;
+    return this.elements==otherMatrix.elements;
+  }
+  else if (other instanceof SparseObjectMatrix3D) {
+    SparseObjectMatrix3D otherMatrix = (SparseObjectMatrix3D) other;
+    return this.elements==otherMatrix.elements;
+  }
+  return false;
 }
 /**
  * Returns the position of the given coordinate within the (virtual or non-virtual) internal 1-dimensional array. 
@@ -161,9 +161,9 @@
  * @param     column   the index of the third-coordinate.
  */
 protected int index(int slice, int row, int column) {
-	//return this.offset + super.index(slice,row,column);
-	//manually inlined:
-	return this.offset + sliceOffsets[sliceZero + slice*sliceStride] + rowOffsets[rowZero + row*rowStride] + columnOffsets[columnZero + column*columnStride];
+  //return this.offset + super.index(slice,row,column);
+  //manually inlined:
+  return this.offset + sliceOffsets[sliceZero + slice*sliceStride] + rowOffsets[rowZero + row*rowStride] + columnOffsets[columnZero + column*columnStride];
 }
 /**
  * Construct and returns a new empty matrix <i>of the same dynamic type</i> as the receiver, having the specified number of slices, rows and columns.
@@ -177,7 +177,7 @@
  * @return  a new empty matrix of the same dynamic type.
  */
 public ObjectMatrix3D like(int slices, int rows, int columns) {
-	return new SparseObjectMatrix3D(slices,rows,columns); 
+  return new SparseObjectMatrix3D(slices,rows,columns); 
 }
 /**
  * Construct and returns a new 2-d matrix <i>of the corresponding dynamic type</i>, sharing the same cells.
@@ -193,7 +193,7 @@
  * @return  a new matrix of the corresponding dynamic type.
  */
 protected ObjectMatrix2D like2D(int rows, int columns, int rowZero, int columnZero, int rowStride, int columnStride) {
-	throw new InternalError(); // this method is never called since viewRow() and viewColumn are overridden properly.
+  throw new InternalError(); // this method is never called since viewRow() and viewColumn are overridden properly.
 }
 /**
  * Sets the matrix cell at coordinate <tt>[slice,row,column]</tt> to the specified value.
@@ -208,47 +208,47 @@
  * @param    value the value to be filled into the specified cell.
  */
 public void setQuick(int slice, int row, int column, Object value) {
-	//if (debug) if (slice<0 || slice>=slices || row<0 || row>=rows || column<0 || column>=columns) throw new IndexOutOfBoundsException("slice:"+slice+", row:"+row+", column:"+column);
-	//int index =	index(slice,row,column);
-	//manually inlined:
-	int index = offset + sliceOffsets[sliceZero + slice*sliceStride] + rowOffsets[rowZero + row*rowStride] + columnOffsets[columnZero + column*columnStride];
-	if (value == null)
-		this.elements.removeKey(index);
-	else 
-		this.elements.put(index, value);
+  //if (debug) if (slice<0 || slice>=slices || row<0 || row>=rows || column<0 || column>=columns) throw new IndexOutOfBoundsException("slice:"+slice+", row:"+row+", column:"+column);
+  //int index =  index(slice,row,column);
+  //manually inlined:
+  int index = offset + sliceOffsets[sliceZero + slice*sliceStride] + rowOffsets[rowZero + row*rowStride] + columnOffsets[columnZero + column*columnStride];
+  if (value == null)
+    this.elements.removeKey(index);
+  else 
+    this.elements.put(index, value);
 }
 /**
  * Sets up a matrix with a given number of slices and rows.
  * @param slices the number of slices the matrix shall have.
  * @param rows the number of rows the matrix shall have.
  * @param columns the number of columns the matrix shall have.
- * @throws	IllegalArgumentException if <tt>(Object)rows*slices > Integer.MAX_VALUE</tt>.
+ * @throws  IllegalArgumentException if <tt>(Object)rows*slices > Integer.MAX_VALUE</tt>.
  */
 protected void setUp(int slices, int rows, int columns) {
-	super.setUp(slices,rows,columns);
-	this.sliceStride = 1;
-	this.rowStride = 1;
-	this.columnStride = 1;
-	this.offset = 0;
+  super.setUp(slices,rows,columns);
+  this.sliceStride = 1;
+  this.rowStride = 1;
+  this.columnStride = 1;
+  this.offset = 0;
 }
 /**
 Self modifying version of viewDice().
 @throws IllegalArgumentException if some of the parameters are equal or not in range 0..2.
 */
 protected AbstractMatrix3D vDice(int axis0, int axis1, int axis2) {
-	super.vDice(axis0,axis1,axis2);
-	
-	// swap offsets
-	int[][] offsets = new int[3][];
-	offsets[0] = this.sliceOffsets;
-	offsets[1] = this.rowOffsets;
-	offsets[2] = this.columnOffsets;
+  super.vDice(axis0,axis1,axis2);
+  
+  // swap offsets
+  int[][] offsets = new int[3][];
+  offsets[0] = this.sliceOffsets;
+  offsets[1] = this.rowOffsets;
+  offsets[2] = this.columnOffsets;
 
-	this.sliceOffsets = offsets[axis0];
-	this.rowOffsets = offsets[axis1];
-	this.columnOffsets = offsets[axis2];
+  this.sliceOffsets = offsets[axis0];
+  this.rowOffsets = offsets[axis1];
+  this.columnOffsets = offsets[axis2];
 
-	return this;
+  return this;
 }
 /**
 Constructs and returns a new 2-dimensional <i>slice view</i> representing the slices and rows of the given column.
@@ -265,22 +265,22 @@
 @see #viewRow(int)
 */
 public ObjectMatrix2D viewColumn(int column) {
-	checkColumn(column);
-	
-	int viewRows = this.slices;
-	int viewColumns = this.rows;
-	
-	int viewRowZero = sliceZero;
-	int viewColumnZero = rowZero;
-	int viewOffset = this.offset + _columnOffset(_columnRank(column));
+  checkColumn(column);
+  
+  int viewRows = this.slices;
+  int viewColumns = this.rows;
+  
+  int viewRowZero = sliceZero;
+  int viewColumnZero = rowZero;
+  int viewOffset = this.offset + _columnOffset(_columnRank(column));
 
-	int viewRowStride = this.sliceStride;
-	int viewColumnStride = this.rowStride;
+  int viewRowStride = this.sliceStride;
+  int viewColumnStride = this.rowStride;
 
-	int[] viewRowOffsets = this.sliceOffsets;
-	int[] viewColumnOffsets = this.rowOffsets;
+  int[] viewRowOffsets = this.sliceOffsets;
+  int[] viewColumnOffsets = this.rowOffsets;
 
-	return new SelectedSparseObjectMatrix2D(viewRows,viewColumns,this.elements,viewRowZero,viewColumnZero,viewRowStride,viewColumnStride,viewRowOffsets,viewColumnOffsets,viewOffset);
+  return new SelectedSparseObjectMatrix2D(viewRows,viewColumns,this.elements,viewRowZero,viewColumnZero,viewRowStride,viewColumnStride,viewRowOffsets,viewColumnOffsets,viewOffset);
 }
 /**
 Constructs and returns a new 2-dimensional <i>slice view</i> representing the slices and columns of the given row.
@@ -297,22 +297,22 @@
 @see #viewColumn(int)
 */
 public ObjectMatrix2D viewRow(int row) {
-	checkRow(row);
-	
-	int viewRows = this.slices;
-	int viewColumns = this.columns;
-	
-	int viewRowZero = sliceZero;
-	int viewColumnZero = columnZero;
-	int viewOffset = this.offset + _rowOffset(_rowRank(row));
+  checkRow(row);
+  
+  int viewRows = this.slices;
+  int viewColumns = this.columns;
+  
+  int viewRowZero = sliceZero;
+  int viewColumnZero = columnZero;
+  int viewOffset = this.offset + _rowOffset(_rowRank(row));
 
-	int viewRowStride = this.sliceStride;
-	int viewColumnStride = this.columnStride;
+  int viewRowStride = this.sliceStride;
+  int viewColumnStride = this.columnStride;
 
-	int[] viewRowOffsets = this.sliceOffsets;
-	int[] viewColumnOffsets = this.columnOffsets;
+  int[] viewRowOffsets = this.sliceOffsets;
+  int[] viewColumnOffsets = this.columnOffsets;
 
-	return new SelectedSparseObjectMatrix2D(viewRows,viewColumns,this.elements,viewRowZero,viewColumnZero,viewRowStride,viewColumnStride,viewRowOffsets,viewColumnOffsets,viewOffset);
+  return new SelectedSparseObjectMatrix2D(viewRows,viewColumns,this.elements,viewRowZero,viewColumnZero,viewRowStride,viewColumnStride,viewRowOffsets,viewColumnOffsets,viewOffset);
 }
 /**
  * Construct and returns a new selection view.
@@ -323,7 +323,7 @@
  * @return  a new view.
  */
 protected ObjectMatrix3D viewSelectionLike(int[] sliceOffsets, int[] rowOffsets, int[] columnOffsets) {
-	return new SelectedSparseObjectMatrix3D(this.elements,sliceOffsets,rowOffsets,columnOffsets,this.offset);
+  return new SelectedSparseObjectMatrix3D(this.elements,sliceOffsets,rowOffsets,columnOffsets,this.offset);
 }
 /**
 Constructs and returns a new 2-dimensional <i>slice view</i> representing the rows and columns of the given slice.
@@ -340,21 +340,21 @@
 @see #viewColumn(int)
 */
 public ObjectMatrix2D viewSlice(int slice) {
-	checkSlice(slice);
-	
-	int viewRows = this.rows;
-	int viewColumns = this.columns;
-	
-	int viewRowZero = rowZero;
-	int viewColumnZero = columnZero;
-	int viewOffset = this.offset + _sliceOffset(_sliceRank(slice));
+  checkSlice(slice);
+  
+  int viewRows = this.rows;
+  int viewColumns = this.columns;
+  
+  int viewRowZero = rowZero;
+  int viewColumnZero = columnZero;
+  int viewOffset = this.offset + _sliceOffset(_sliceRank(slice));
 
-	int viewRowStride = this.rowStride;
-	int viewColumnStride = this.columnStride;
+  int viewRowStride = this.rowStride;
+  int viewColumnStride = this.columnStride;
 
-	int[] viewRowOffsets = this.rowOffsets;
-	int[] viewColumnOffsets = this.columnOffsets;
+  int[] viewRowOffsets = this.rowOffsets;
+  int[] viewColumnOffsets = this.columnOffsets;
 
-	return new SelectedSparseObjectMatrix2D(viewRows,viewColumns,this.elements,viewRowZero,viewColumnZero,viewRowStride,viewColumnStride,viewRowOffsets,viewColumnOffsets,viewOffset);
+  return new SelectedSparseObjectMatrix2D(viewRows,viewColumns,this.elements,viewRowZero,viewColumnZero,viewRowStride,viewColumnStride,viewRowOffsets,viewColumnOffsets,viewOffset);
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SelectedDenseDoubleMatrix1D.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SelectedDenseDoubleMatrix1D.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SelectedDenseDoubleMatrix1D.java	(working copy)
@@ -43,27 +43,27 @@
 @version 1.0, 09/24/99
 */
 class SelectedDenseDoubleMatrix1D extends DoubleMatrix1D {
-	/**
-	  * The elements of this matrix.
-	  */
-	protected double[] elements;
-	
-	/**
-	  * The offsets of visible indexes of this matrix.
-	  */
-	protected int[] offsets;
+  /**
+    * The elements of this matrix.
+    */
+  protected double[] elements;
+  
+  /**
+    * The offsets of visible indexes of this matrix.
+    */
+  protected int[] offsets;
 
-	/**
-	  * The offset.
-	  */
-	protected int offset;	
+  /**
+    * The offset.
+    */
+  protected int offset;  
 /**
  * Constructs a matrix view with the given parameters.
  * @param elements the cells.
  * @param  indexes   The indexes of the cells that shall be visible.
  */
 protected SelectedDenseDoubleMatrix1D(double[] elements, int[] offsets) {
-	this(offsets.length,elements,0,1,offsets,0);
+  this(offsets.length,elements,0,1,offsets,0);
 }
 /**
  * Constructs a matrix view with the given parameters.
@@ -75,12 +75,12 @@
  * @param offset   
  */
 protected SelectedDenseDoubleMatrix1D(int size, double[] elements, int zero, int stride, int[] offsets, int offset) {
-	setUp(size,zero,stride);
-	
-	this.elements = elements;
-	this.offsets = offsets;
-	this.offset = offset;
-	this.isNoView = false;
+  setUp(size,zero,stride);
+  
+  this.elements = elements;
+  this.offsets = offsets;
+  this.offset = offset;
+  this.isNoView = false;
 }
 /**
  * Returns the position of the given absolute rank within the (virtual or non-virtual) internal 1-dimensional array. 
@@ -90,7 +90,7 @@
  * @return the position.
  */
 protected int _offset(int absRank) {
-	return offsets[absRank];
+  return offsets[absRank];
 }
 /**
  * Returns the matrix cell value at coordinate <tt>index</tt>.
@@ -103,24 +103,24 @@
  * @return    the value of the specified cell.
  */
 public double getQuick(int index) {
-	//if (debug) if (index<0 || index>=size) checkIndex(index);
-	//return elements[index(index)];
-	//manually inlined:
-	return elements[offset + offsets[zero + index*stride]];
+  //if (debug) if (index<0 || index>=size) checkIndex(index);
+  //return elements[index(index)];
+  //manually inlined:
+  return elements[offset + offsets[zero + index*stride]];
 }
 /**
  * Returns <tt>true</tt> if both matrices share at least one identical cell.
  */
 protected boolean haveSharedCellsRaw(DoubleMatrix1D other) {
-	if (other instanceof SelectedDenseDoubleMatrix1D) {
-		SelectedDenseDoubleMatrix1D otherMatrix = (SelectedDenseDoubleMatrix1D) other;
-		return this.elements==otherMatrix.elements;
-	}
-	else if (other instanceof DenseDoubleMatrix1D) {
-		DenseDoubleMatrix1D otherMatrix = (DenseDoubleMatrix1D) other;
-		return this.elements==otherMatrix.elements;
-	}
-	return false;
+  if (other instanceof SelectedDenseDoubleMatrix1D) {
+    SelectedDenseDoubleMatrix1D otherMatrix = (SelectedDenseDoubleMatrix1D) other;
+    return this.elements==otherMatrix.elements;
+  }
+  else if (other instanceof DenseDoubleMatrix1D) {
+    DenseDoubleMatrix1D otherMatrix = (DenseDoubleMatrix1D) other;
+    return this.elements==otherMatrix.elements;
+  }
+  return false;
 }
 /**
  * Returns the position of the element with the given relative rank within the (virtual or non-virtual) internal 1-dimensional array.
@@ -129,9 +129,9 @@
  * @param     rank   the rank of the element.
  */
 protected int index(int rank) {
-	//return this.offset + super.index(rank);
-	// manually inlined:
-	return offset + offsets[zero + rank*stride];
+  //return this.offset + super.index(rank);
+  // manually inlined:
+  return offset + offsets[zero + rank*stride];
 }
 /**
  * Construct and returns a new empty matrix <i>of the same dynamic type</i> as the receiver, having the specified size.
@@ -143,7 +143,7 @@
  * @return  a new empty matrix of the same dynamic type.
  */
 public DoubleMatrix1D like(int size) {
-	return new DenseDoubleMatrix1D(size);
+  return new DenseDoubleMatrix1D(size);
 }
 /**
  * Construct and returns a new 2-d matrix <i>of the corresponding dynamic type</i>, entirelly independent of the receiver.
@@ -155,7 +155,7 @@
  * @return  a new matrix of the corresponding dynamic type.
  */
 public DoubleMatrix2D like2D(int rows, int columns) {
-	return new DenseDoubleMatrix2D(rows,columns);
+  return new DenseDoubleMatrix2D(rows,columns);
 }
 /**
  * Sets the matrix cell at coordinate <tt>index</tt> to the specified value.
@@ -168,19 +168,19 @@
  * @param    value the value to be filled into the specified cell.
  */
 public void setQuick(int index, double value) {
-	//if (debug) if (index<0 || index>=size) checkIndex(index);
-	//elements[index(index)] = value;
-	//manually inlined:
-	elements[offset + offsets[zero + index*stride]] = value;
+  //if (debug) if (index<0 || index>=size) checkIndex(index);
+  //elements[index(index)] = value;
+  //manually inlined:
+  elements[offset + offsets[zero + index*stride]] = value;
 }
 /**
  * Sets up a matrix with a given number of cells.
  * @param size the number of cells the matrix shall have.
  */
 protected void setUp(int size) {
-	super.setUp(size);
-	this.stride = 1;
-	this.offset = 0;
+  super.setUp(size);
+  this.stride = 1;
+  this.offset = 0;
 }
 /**
  * Construct and returns a new selection view.
@@ -189,6 +189,6 @@
  * @return  a new view.
  */
 protected DoubleMatrix1D viewSelectionLike(int[] offsets) {
-	return new SelectedDenseDoubleMatrix1D(this.elements,offsets);
+  return new SelectedDenseDoubleMatrix1D(this.elements,offsets);
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SelectedDenseDoubleMatrix2D.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SelectedDenseDoubleMatrix2D.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SelectedDenseDoubleMatrix2D.java	(working copy)
@@ -43,21 +43,21 @@
 @version 1.0, 09/24/99
 */
 class SelectedDenseDoubleMatrix2D extends DoubleMatrix2D {
-	/**
-	  * The elements of this matrix.
-	  */
-	protected double[] elements;
-	
-	/**
-	  * The offsets of the visible cells of this matrix.
-	  */
-	protected int[] rowOffsets;
-	protected int[] columnOffsets;
-	
-	/**
-	  * The offset.
-	  */
-	protected int offset;	
+  /**
+    * The elements of this matrix.
+    */
+  protected double[] elements;
+  
+  /**
+    * The offsets of the visible cells of this matrix.
+    */
+  protected int[] rowOffsets;
+  protected int[] columnOffsets;
+  
+  /**
+    * The offset.
+    */
+  protected int offset;  
 /**
  * Constructs a matrix view with the given parameters.
  * @param elements the cells.
@@ -66,7 +66,7 @@
  * @param  offset   
  */
 protected SelectedDenseDoubleMatrix2D(double[] elements, int[] rowOffsets, int[] columnOffsets, int offset) {
-	this(rowOffsets.length,columnOffsets.length,elements,0,0,1,1,rowOffsets,columnOffsets,offset);
+  this(rowOffsets.length,columnOffsets.length,elements,0,0,1,1,rowOffsets,columnOffsets,offset);
 }
 /**
  * Constructs a matrix view with the given parameters.
@@ -82,15 +82,15 @@
  * @param  offset   
  */
 protected SelectedDenseDoubleMatrix2D(int rows, int columns, double[] elements, int rowZero, int columnZero, int rowStride, int columnStride, int[] rowOffsets, int[] columnOffsets, int offset) {
-	// be sure parameters are valid, we do not check...
-	setUp(rows,columns,rowZero,columnZero,rowStride,columnStride);
-	
-	this.elements = elements;
-	this.rowOffsets = rowOffsets;
-	this.columnOffsets = columnOffsets;
-	this.offset = offset;
-	
-	this.isNoView = false;
+  // be sure parameters are valid, we do not check...
+  setUp(rows,columns,rowZero,columnZero,rowStride,columnStride);
+  
+  this.elements = elements;
+  this.rowOffsets = rowOffsets;
+  this.columnOffsets = columnOffsets;
+  this.offset = offset;
+  
+  this.isNoView = false;
 }
 /**
  * Returns the position of the given absolute rank within the (virtual or non-virtual) internal 1-dimensional array. 
@@ -100,7 +100,7 @@
  * @return the position.
  */
 protected int _columnOffset(int absRank) {
-	return columnOffsets[absRank];
+  return columnOffsets[absRank];
 }
 /**
  * Returns the position of the given absolute rank within the (virtual or non-virtual) internal 1-dimensional array. 
@@ -110,7 +110,7 @@
  * @return the position.
  */
 protected int _rowOffset(int absRank) {
-	return rowOffsets[absRank];
+  return rowOffsets[absRank];
 }
 /**
  * Returns the matrix cell value at coordinate <tt>[row,column]</tt>.
@@ -124,10 +124,10 @@
  * @return    the value at the specified coordinate.
  */
 public double getQuick(int row, int column) {
-	//if (debug) if (column<0 || column>=columns || row<0 || row>=rows) throw new IndexOutOfBoundsException("row:"+row+", column:"+column);
-	//return elements[index(row,column)];
-	//manually inlined:
-	return elements[offset + rowOffsets[rowZero + row*rowStride] + columnOffsets[columnZero + column*columnStride]];
+  //if (debug) if (column<0 || column>=columns || row<0 || row>=rows) throw new IndexOutOfBoundsException("row:"+row+", column:"+column);
+  //return elements[index(row,column)];
+  //manually inlined:
+  return elements[offset + rowOffsets[rowZero + row*rowStride] + columnOffsets[columnZero + column*columnStride]];
 }
 /**
  * Returns <tt>true</tt> if both matrices share common cells.
@@ -139,15 +139,15 @@
  * </ul>
  */
 protected boolean haveSharedCellsRaw(DoubleMatrix2D other) {
-	if (other instanceof SelectedDenseDoubleMatrix2D) {
-		SelectedDenseDoubleMatrix2D otherMatrix = (SelectedDenseDoubleMatrix2D) other;
-		return this.elements==otherMatrix.elements;
-	}
-	else if (other instanceof DenseDoubleMatrix2D) {
-		DenseDoubleMatrix2D otherMatrix = (DenseDoubleMatrix2D) other;
-		return this.elements==otherMatrix.elements;
-	}
-	return false;
+  if (other instanceof SelectedDenseDoubleMatrix2D) {
+    SelectedDenseDoubleMatrix2D otherMatrix = (SelectedDenseDoubleMatrix2D) other;
+    return this.elements==otherMatrix.elements;
+  }
+  else if (other instanceof DenseDoubleMatrix2D) {
+    DenseDoubleMatrix2D otherMatrix = (DenseDoubleMatrix2D) other;
+    return this.elements==otherMatrix.elements;
+  }
+  return false;
 }
 /**
  * Returns the position of the given coordinate within the (virtual or non-virtual) internal 1-dimensional array. 
@@ -156,9 +156,9 @@
  * @param     column   the index of the column-coordinate.
  */
 protected int index(int row, int column) {
-	//return this.offset + super.index(row,column);
-	//manually inlined:
-	return this.offset + rowOffsets[rowZero + row*rowStride] + columnOffsets[columnZero + column*columnStride];
+  //return this.offset + super.index(row,column);
+  //manually inlined:
+  return this.offset + rowOffsets[rowZero + row*rowStride] + columnOffsets[columnZero + column*columnStride];
 }
 /**
  * Construct and returns a new empty matrix <i>of the same dynamic type</i> as the receiver, having the specified number of rows and columns.
@@ -171,7 +171,7 @@
  * @return  a new empty matrix of the same dynamic type.
  */
 public DoubleMatrix2D like(int rows, int columns) {
-	return new DenseDoubleMatrix2D(rows, columns);
+  return new DenseDoubleMatrix2D(rows, columns);
 }
 /**
  * Construct and returns a new 1-d matrix <i>of the corresponding dynamic type</i>, entirelly independent of the receiver.
@@ -182,7 +182,7 @@
  * @return  a new matrix of the corresponding dynamic type.
  */
 public DoubleMatrix1D like1D(int size) {
-	return new DenseDoubleMatrix1D(size);
+  return new DenseDoubleMatrix1D(size);
 }
 /**
  * Construct and returns a new 1-d matrix <i>of the corresponding dynamic type</i>, sharing the same cells.
@@ -195,7 +195,7 @@
  * @return  a new matrix of the corresponding dynamic type.
  */
 protected DoubleMatrix1D like1D(int size, int zero, int stride) {
-	throw new InternalError(); // this method is never called since viewRow() and viewColumn are overridden properly.
+  throw new InternalError(); // this method is never called since viewRow() and viewColumn are overridden properly.
 }
 /**
  * Sets the matrix cell at coordinate <tt>[row,column]</tt> to the specified value.
@@ -209,35 +209,35 @@
  * @param    value the value to be filled into the specified cell.
  */
 public void setQuick(int row, int column, double value) {
-	//if (debug) if (column<0 || column>=columns || row<0 || row>=rows) throw new IndexOutOfBoundsException("row:"+row+", column:"+column);
-	//elements[index(row,column)] = value;
-	//manually inlined:
-	elements[offset + rowOffsets[rowZero + row*rowStride] + columnOffsets[columnZero + column*columnStride]] = value;
+  //if (debug) if (column<0 || column>=columns || row<0 || row>=rows) throw new IndexOutOfBoundsException("row:"+row+", column:"+column);
+  //elements[index(row,column)] = value;
+  //manually inlined:
+  elements[offset + rowOffsets[rowZero + row*rowStride] + columnOffsets[columnZero + column*columnStride]] = value;
 }
 /**
  * Sets up a matrix with a given number of rows and columns.
  * @param rows the number of rows the matrix shall have.
  * @param columns the number of columns the matrix shall have.
- * @throws	IllegalArgumentException if <tt>(double)columns*rows > Integer.MAX_VALUE</tt>.
+ * @throws  IllegalArgumentException if <tt>(double)columns*rows > Integer.MAX_VALUE</tt>.
  */
 protected void setUp(int rows, int columns) {
-	super.setUp(rows,columns);
-	this.rowStride = 1;
-	this.columnStride = 1;
-	this.offset = 0;
+  super.setUp(rows,columns);
+  this.rowStride = 1;
+  this.columnStride = 1;
+  this.offset = 0;
 }
 /**
 Self modifying version of viewDice().
 */
 protected AbstractMatrix2D vDice() {
-	super.vDice();
-	// swap
-	int[] tmp = rowOffsets; rowOffsets = columnOffsets; columnOffsets = tmp;
+  super.vDice();
+  // swap
+  int[] tmp = rowOffsets; rowOffsets = columnOffsets; columnOffsets = tmp;
 
-	// flips stay unaffected
+  // flips stay unaffected
 
-	this.isNoView = false;
-	return this;
+  this.isNoView = false;
+  return this;
 }
 /**
 Constructs and returns a new <i>slice view</i> representing the rows of the given column.
@@ -247,12 +247,12 @@
 <b>Example:</b> 
 <table border="0">
   <tr nowrap> 
-	<td valign="top">2 x 3 matrix: <br>
-	  1, 2, 3<br>
-	  4, 5, 6 </td>
-	<td>viewColumn(0) ==></td>
-	<td valign="top">Matrix1D of size 2:<br>
-	  1, 4</td>
+  <td valign="top">2 x 3 matrix: <br>
+    1, 2, 3<br>
+    4, 5, 6 </td>
+  <td>viewColumn(0) ==></td>
+  <td valign="top">Matrix1D of size 2:<br>
+    1, 4</td>
    </tr>
 </table>
 
@@ -262,13 +262,13 @@
 @see #viewRow(int)
 */
 public DoubleMatrix1D viewColumn(int column) {
-	checkColumn(column);
-	int viewSize = this.rows;
-	int viewZero = this.rowZero;
-	int viewStride = this.rowStride;
-	int[] viewOffsets = this.rowOffsets;
-	int viewOffset = this.offset + _columnOffset(_columnRank(column));
-	return new SelectedDenseDoubleMatrix1D(viewSize,this.elements,viewZero,viewStride,viewOffsets,viewOffset);
+  checkColumn(column);
+  int viewSize = this.rows;
+  int viewZero = this.rowZero;
+  int viewStride = this.rowStride;
+  int[] viewOffsets = this.rowOffsets;
+  int viewOffset = this.offset + _columnOffset(_columnRank(column));
+  return new SelectedDenseDoubleMatrix1D(viewSize,this.elements,viewZero,viewStride,viewOffsets,viewOffset);
 }
 /**
 Constructs and returns a new <i>slice view</i> representing the columns of the given row.
@@ -278,12 +278,12 @@
 <b>Example:</b> 
 <table border="0">
   <tr nowrap> 
-	<td valign="top">2 x 3 matrix: <br>
-	  1, 2, 3<br>
-	  4, 5, 6 </td>
-	<td>viewRow(0) ==></td>
-	<td valign="top">Matrix1D of size 3:<br>
-	  1, 2, 3</td>
+  <td valign="top">2 x 3 matrix: <br>
+    1, 2, 3<br>
+    4, 5, 6 </td>
+  <td>viewRow(0) ==></td>
+  <td valign="top">Matrix1D of size 3:<br>
+    1, 2, 3</td>
    </tr>
 </table>
 
@@ -293,13 +293,13 @@
 @see #viewColumn(int)
 */
 public DoubleMatrix1D viewRow(int row) {
-	checkRow(row);
-	int viewSize = this.columns;
-	int viewZero = columnZero;
-	int viewStride = this.columnStride;
-	int[] viewOffsets = this.columnOffsets;
-	int viewOffset = this.offset + _rowOffset(_rowRank(row));
-	return new SelectedDenseDoubleMatrix1D(viewSize,this.elements,viewZero,viewStride,viewOffsets,viewOffset);
+  checkRow(row);
+  int viewSize = this.columns;
+  int viewZero = columnZero;
+  int viewStride = this.columnStride;
+  int[] viewOffsets = this.columnOffsets;
+  int viewOffset = this.offset + _rowOffset(_rowRank(row));
+  return new SelectedDenseDoubleMatrix1D(viewSize,this.elements,viewZero,viewStride,viewOffsets,viewOffset);
 }
 /**
  * Construct and returns a new selection view.
@@ -309,6 +309,6 @@
  * @return  a new view.
  */
 protected DoubleMatrix2D viewSelectionLike(int[] rowOffsets, int[] columnOffsets) {
-	return new SelectedDenseDoubleMatrix2D(this.elements,rowOffsets,columnOffsets,this.offset);
+  return new SelectedDenseDoubleMatrix2D(this.elements,rowOffsets,columnOffsets,this.offset);
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SelectedDenseDoubleMatrix3D.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SelectedDenseDoubleMatrix3D.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SelectedDenseDoubleMatrix3D.java	(working copy)
@@ -43,23 +43,23 @@
 @version 1.0, 09/24/99
 */
 class SelectedDenseDoubleMatrix3D extends DoubleMatrix3D {
-	/**
-	  * The elements of this matrix.
-	  */
-	protected double[] elements;
-	
-	/**
-	  * The offsets of the visible cells of this matrix.
-	  */
-	protected int[] sliceOffsets;
-	protected int[] rowOffsets;
-	protected int[] columnOffsets;
-	
-	/**
-	  * The offset.
-	  */
-	protected int offset;	
-	
+  /**
+    * The elements of this matrix.
+    */
+  protected double[] elements;
+  
+  /**
+    * The offsets of the visible cells of this matrix.
+    */
+  protected int[] sliceOffsets;
+  protected int[] rowOffsets;
+  protected int[] columnOffsets;
+  
+  /**
+    * The offset.
+    */
+  protected int offset;  
+  
 /**
  * Constructs a matrix view with the given parameters.
  * @param elements the cells.
@@ -68,21 +68,21 @@
  * @param  columnOffsets   The column offsets of the cells that shall be visible.
  */
 protected SelectedDenseDoubleMatrix3D(double[] elements, int[] sliceOffsets, int[] rowOffsets, int[] columnOffsets, int offset) {
-	// be sure parameters are valid, we do not check...
-	int slices = sliceOffsets.length;
-	int rows = rowOffsets.length;
-	int columns = columnOffsets.length;
-	setUp(slices,rows, columns);
-	
-	this.elements = elements;
-	
-	this.sliceOffsets = sliceOffsets;
-	this.rowOffsets = rowOffsets;
-	this.columnOffsets = columnOffsets;
+  // be sure parameters are valid, we do not check...
+  int slices = sliceOffsets.length;
+  int rows = rowOffsets.length;
+  int columns = columnOffsets.length;
+  setUp(slices,rows, columns);
+  
+  this.elements = elements;
+  
+  this.sliceOffsets = sliceOffsets;
+  this.rowOffsets = rowOffsets;
+  this.columnOffsets = columnOffsets;
 
-	this.offset = offset;
-	
-	this.isNoView = false;
+  this.offset = offset;
+  
+  this.isNoView = false;
 }
 /**
  * Returns the position of the given absolute rank within the (virtual or non-virtual) internal 1-dimensional array. 
@@ -92,7 +92,7 @@
  * @return the position.
  */
 protected int _columnOffset(int absRank) {
-	return columnOffsets[absRank];
+  return columnOffsets[absRank];
 }
 /**
  * Returns the position of the given absolute rank within the (virtual or non-virtual) internal 1-dimensional array. 
@@ -102,7 +102,7 @@
  * @return the position.
  */
 protected int _rowOffset(int absRank) {
-	return rowOffsets[absRank];
+  return rowOffsets[absRank];
 }
 /**
  * Returns the position of the given absolute rank within the (virtual or non-virtual) internal 1-dimensional array. 
@@ -112,7 +112,7 @@
  * @return the position.
  */
 protected int _sliceOffset(int absRank) {
-	return sliceOffsets[absRank];
+  return sliceOffsets[absRank];
 }
 /**
  * Returns the matrix cell value at coordinate <tt>[slice,row,column]</tt>.
@@ -127,10 +127,10 @@
  * @return    the value at the specified coordinate.
  */
 public double getQuick(int slice, int row, int column) {
-	//if (debug) if (slice<0 || slice>=slices || row<0 || row>=rows || column<0 || column>=columns) throw new IndexOutOfBoundsException("slice:"+slice+", row:"+row+", column:"+column);
-	//return elements[index(slice,row,column)];
-	//manually inlined:
-	return elements[offset + sliceOffsets[sliceZero + slice*sliceStride] + rowOffsets[rowZero + row*rowStride] + columnOffsets[columnZero + column*columnStride]];
+  //if (debug) if (slice<0 || slice>=slices || row<0 || row>=rows || column<0 || column>=columns) throw new IndexOutOfBoundsException("slice:"+slice+", row:"+row+", column:"+column);
+  //return elements[index(slice,row,column)];
+  //manually inlined:
+  return elements[offset + sliceOffsets[sliceZero + slice*sliceStride] + rowOffsets[rowZero + row*rowStride] + columnOffsets[columnZero + column*columnStride]];
 }
 /**
  * Returns <tt>true</tt> if both matrices share common cells.
@@ -142,15 +142,15 @@
  * </ul>
  */
 protected boolean haveSharedCellsRaw(DoubleMatrix3D other) {
-	if (other instanceof SelectedDenseDoubleMatrix3D) {
-		SelectedDenseDoubleMatrix3D otherMatrix = (SelectedDenseDoubleMatrix3D) other;
-		return this.elements==otherMatrix.elements;
-	}
-	else if (other instanceof DenseDoubleMatrix3D) {
-		DenseDoubleMatrix3D otherMatrix = (DenseDoubleMatrix3D) other;
-		return this.elements==otherMatrix.elements;
-	}
-	return false;
+  if (other instanceof SelectedDenseDoubleMatrix3D) {
+    SelectedDenseDoubleMatrix3D otherMatrix = (SelectedDenseDoubleMatrix3D) other;
+    return this.elements==otherMatrix.elements;
+  }
+  else if (other instanceof DenseDoubleMatrix3D) {
+    DenseDoubleMatrix3D otherMatrix = (DenseDoubleMatrix3D) other;
+    return this.elements==otherMatrix.elements;
+  }
+  return false;
 }
 /**
  * Returns the position of the given coordinate within the (virtual or non-virtual) internal 1-dimensional array. 
@@ -160,9 +160,9 @@
  * @param     column   the index of the third-coordinate.
  */
 protected int index(int slice, int row, int column) {
-	//return this.offset + super.index(slice,row,column);
-	//manually inlined:
-	return this.offset + sliceOffsets[sliceZero + slice*sliceStride] + rowOffsets[rowZero + row*rowStride] + columnOffsets[columnZero + column*columnStride];
+  //return this.offset + super.index(slice,row,column);
+  //manually inlined:
+  return this.offset + sliceOffsets[sliceZero + slice*sliceStride] + rowOffsets[rowZero + row*rowStride] + columnOffsets[columnZero + column*columnStride];
 }
 /**
  * Construct and returns a new empty matrix <i>of the same dynamic type</i> as the receiver, having the specified number of slices, rows and columns.
@@ -176,7 +176,7 @@
  * @return  a new empty matrix of the same dynamic type.
  */
 public DoubleMatrix3D like(int slices, int rows, int columns) {
-	return new DenseDoubleMatrix3D(slices,rows,columns); 
+  return new DenseDoubleMatrix3D(slices,rows,columns); 
 }
 /**
  * Construct and returns a new 2-d matrix <i>of the corresponding dynamic type</i>, sharing the same cells.
@@ -192,7 +192,7 @@
  * @return  a new matrix of the corresponding dynamic type.
  */
 protected DoubleMatrix2D like2D(int rows, int columns, int rowZero, int columnZero, int rowStride, int columnStride) {
-	throw new InternalError(); // this method is never called since viewRow() and viewColumn are overridden properly.
+  throw new InternalError(); // this method is never called since viewRow() and viewColumn are overridden properly.
 }
 /**
  * Sets the matrix cell at coordinate <tt>[slice,row,column]</tt> to the specified value.
@@ -207,43 +207,43 @@
  * @param    value the value to be filled into the specified cell.
  */
 public void setQuick(int slice, int row, int column, double value) {
-	//if (debug) if (slice<0 || slice>=slices || row<0 || row>=rows || column<0 || column>=columns) throw new IndexOutOfBoundsException("slice:"+slice+", row:"+row+", column:"+column);
-	//elements[index(slice,row,column)] = value;
-	//manually inlined:
-	elements[offset + sliceOffsets[sliceZero + slice*sliceStride] + rowOffsets[rowZero + row*rowStride] + columnOffsets[columnZero + column*columnStride]] = value;
+  //if (debug) if (slice<0 || slice>=slices || row<0 || row>=rows || column<0 || column>=columns) throw new IndexOutOfBoundsException("slice:"+slice+", row:"+row+", column:"+column);
+  //elements[index(slice,row,column)] = value;
+  //manually inlined:
+  elements[offset + sliceOffsets[sliceZero + slice*sliceStride] + rowOffsets[rowZero + row*rowStride] + columnOffsets[columnZero + column*columnStride]] = value;
 }
 /**
  * Sets up a matrix with a given number of slices and rows.
  * @param slices the number of slices the matrix shall have.
  * @param rows the number of rows the matrix shall have.
  * @param columns the number of columns the matrix shall have.
- * @throws	IllegalArgumentException if <tt>(double)rows*slices > Integer.MAX_VALUE</tt>.
+ * @throws  IllegalArgumentException if <tt>(double)rows*slices > Integer.MAX_VALUE</tt>.
  */
 protected void setUp(int slices, int rows, int columns) {
-	super.setUp(slices,rows,columns);
-	this.sliceStride = 1;
-	this.rowStride = 1;
-	this.columnStride = 1;
-	this.offset = 0;
+  super.setUp(slices,rows,columns);
+  this.sliceStride = 1;
+  this.rowStride = 1;
+  this.columnStride = 1;
+  this.offset = 0;
 }
 /**
 Self modifying version of viewDice().
 @throws IllegalArgumentException if some of the parameters are equal or not in range 0..2.
 */
 protected AbstractMatrix3D vDice(int axis0, int axis1, int axis2) {
-	super.vDice(axis0,axis1,axis2);
-	
-	// swap offsets
-	int[][] offsets = new int[3][];
-	offsets[0] = this.sliceOffsets;
-	offsets[1] = this.rowOffsets;
-	offsets[2] = this.columnOffsets;
+  super.vDice(axis0,axis1,axis2);
+  
+  // swap offsets
+  int[][] offsets = new int[3][];
+  offsets[0] = this.sliceOffsets;
+  offsets[1] = this.rowOffsets;
+  offsets[2] = this.columnOffsets;
 
-	this.sliceOffsets = offsets[axis0];
-	this.rowOffsets = offsets[axis1];
-	this.columnOffsets = offsets[axis2];
+  this.sliceOffsets = offsets[axis0];
+  this.rowOffsets = offsets[axis1];
+  this.columnOffsets = offsets[axis2];
 
-	return this;
+  return this;
 }
 /**
 Constructs and returns a new 2-dimensional <i>slice view</i> representing the slices and rows of the given column.
@@ -260,22 +260,22 @@
 @see #viewRow(int)
 */
 public DoubleMatrix2D viewColumn(int column) {
-	checkColumn(column);
-	
-	int viewRows = this.slices;
-	int viewColumns = this.rows;
-	
-	int viewRowZero = sliceZero;
-	int viewColumnZero = rowZero;
-	int viewOffset = this.offset + _columnOffset(_columnRank(column));
+  checkColumn(column);
+  
+  int viewRows = this.slices;
+  int viewColumns = this.rows;
+  
+  int viewRowZero = sliceZero;
+  int viewColumnZero = rowZero;
+  int viewOffset = this.offset + _columnOffset(_columnRank(column));
 
-	int viewRowStride = this.sliceStride;
-	int viewColumnStride = this.rowStride;
+  int viewRowStride = this.sliceStride;
+  int viewColumnStride = this.rowStride;
 
-	int[] viewRowOffsets = this.sliceOffsets;
-	int[] viewColumnOffsets = this.rowOffsets;
+  int[] viewRowOffsets = this.sliceOffsets;
+  int[] viewColumnOffsets = this.rowOffsets;
 
-	return new SelectedDenseDoubleMatrix2D(viewRows,viewColumns,this.elements,viewRowZero,viewColumnZero,viewRowStride,viewColumnStride,viewRowOffsets,viewColumnOffsets,viewOffset);
+  return new SelectedDenseDoubleMatrix2D(viewRows,viewColumns,this.elements,viewRowZero,viewColumnZero,viewRowStride,viewColumnStride,viewRowOffsets,viewColumnOffsets,viewOffset);
 }
 /**
 Constructs and returns a new 2-dimensional <i>slice view</i> representing the slices and columns of the given row.
@@ -292,22 +292,22 @@
 @see #viewColumn(int)
 */
 public DoubleMatrix2D viewRow(int row) {
-	checkRow(row);
-	
-	int viewRows = this.slices;
-	int viewColumns = this.columns;
-	
-	int viewRowZero = sliceZero;
-	int viewColumnZero = columnZero;
-	int viewOffset = this.offset + _rowOffset(_rowRank(row));
+  checkRow(row);
+  
+  int viewRows = this.slices;
+  int viewColumns = this.columns;
+  
+  int viewRowZero = sliceZero;
+  int viewColumnZero = columnZero;
+  int viewOffset = this.offset + _rowOffset(_rowRank(row));
 
-	int viewRowStride = this.sliceStride;
-	int viewColumnStride = this.columnStride;
+  int viewRowStride = this.sliceStride;
+  int viewColumnStride = this.columnStride;
 
-	int[] viewRowOffsets = this.sliceOffsets;
-	int[] viewColumnOffsets = this.columnOffsets;
+  int[] viewRowOffsets = this.sliceOffsets;
+  int[] viewColumnOffsets = this.columnOffsets;
 
-	return new SelectedDenseDoubleMatrix2D(viewRows,viewColumns,this.elements,viewRowZero,viewColumnZero,viewRowStride,viewColumnStride,viewRowOffsets,viewColumnOffsets,viewOffset);
+  return new SelectedDenseDoubleMatrix2D(viewRows,viewColumns,this.elements,viewRowZero,viewColumnZero,viewRowStride,viewColumnStride,viewRowOffsets,viewColumnOffsets,viewOffset);
 }
 /**
  * Construct and returns a new selection view.
@@ -318,7 +318,7 @@
  * @return  a new view.
  */
 protected DoubleMatrix3D viewSelectionLike(int[] sliceOffsets, int[] rowOffsets, int[] columnOffsets) {
-	return new SelectedDenseDoubleMatrix3D(this.elements,sliceOffsets,rowOffsets,columnOffsets,this.offset);
+  return new SelectedDenseDoubleMatrix3D(this.elements,sliceOffsets,rowOffsets,columnOffsets,this.offset);
 }
 /**
 Constructs and returns a new 2-dimensional <i>slice view</i> representing the rows and columns of the given slice.
@@ -335,21 +335,21 @@
 @see #viewColumn(int)
 */
 public DoubleMatrix2D viewSlice(int slice) {
-	checkSlice(slice);
-	
-	int viewRows = this.rows;
-	int viewColumns = this.columns;
-	
-	int viewRowZero = rowZero;
-	int viewColumnZero = columnZero;
-	int viewOffset = this.offset + _sliceOffset(_sliceRank(slice));
+  checkSlice(slice);
+  
+  int viewRows = this.rows;
+  int viewColumns = this.columns;
+  
+  int viewRowZero = rowZero;
+  int viewColumnZero = columnZero;
+  int viewOffset = this.offset + _sliceOffset(_sliceRank(slice));
 
-	int viewRowStride = this.rowStride;
-	int viewColumnStride = this.columnStride;
+  int viewRowStride = this.rowStride;
+  int viewColumnStride = this.columnStride;
 
-	int[] viewRowOffsets = this.rowOffsets;
-	int[] viewColumnOffsets = this.columnOffsets;
+  int[] viewRowOffsets = this.rowOffsets;
+  int[] viewColumnOffsets = this.columnOffsets;
 
-	return new SelectedDenseDoubleMatrix2D(viewRows,viewColumns,this.elements,viewRowZero,viewColumnZero,viewRowStride,viewColumnStride,viewRowOffsets,viewColumnOffsets,viewOffset);
+  return new SelectedDenseDoubleMatrix2D(viewRows,viewColumns,this.elements,viewRowZero,viewColumnZero,viewRowStride,viewColumnStride,viewRowOffsets,viewColumnOffsets,viewOffset);
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/DelegateDoubleMatrix1D.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/DelegateDoubleMatrix1D.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/DelegateDoubleMatrix1D.java	(working copy)
@@ -17,20 +17,20 @@
 @version 1.0, 09/24/99
 */
 class DelegateDoubleMatrix1D extends WrapperDoubleMatrix1D {
-	/*
-	 * The elements of the matrix.
-	 */
-	protected DoubleMatrix2D content; 
-	/*
-	 * The row this view is bound to.
-	 */
-	protected int row; 
+  /*
+   * The elements of the matrix.
+   */
+  protected DoubleMatrix2D content; 
+  /*
+   * The row this view is bound to.
+   */
+  protected int row; 
 public DelegateDoubleMatrix1D(DoubleMatrix2D newContent, int row) {
-	super(null);
-	if (row < 0 || row >= newContent.rows()) throw new IllegalArgumentException();
-	setUp(newContent.columns());
-	this.row=row;
-	this.content = newContent;
+  super(null);
+  if (row < 0 || row >= newContent.rows()) throw new IllegalArgumentException();
+  setUp(newContent.columns());
+  this.row=row;
+  this.content = newContent;
 }
 /**
  * Returns the matrix cell value at coordinate <tt>index</tt>.
@@ -43,7 +43,7 @@
  * @return    the value of the specified cell.
  */
 public double getQuick(int index) {
-	return content.getQuick(row,index);
+  return content.getQuick(row,index);
 }
 /**
  * Construct and returns a new empty matrix <i>of the same dynamic type</i> as the receiver, having the specified size.
@@ -55,7 +55,7 @@
  * @return  a new empty matrix of the same dynamic type.
  */
 public DoubleMatrix1D like(int size) {
-	return content.like1D(size);
+  return content.like1D(size);
 }
 /**
  * Construct and returns a new 2-d matrix <i>of the corresponding dynamic type</i>, entirelly independent of the receiver.
@@ -67,7 +67,7 @@
  * @return  a new matrix of the corresponding dynamic type.
  */
 public DoubleMatrix2D like2D(int rows, int columns) {
-	return content.like(rows,columns);
+  return content.like(rows,columns);
 }
 /**
  * Sets the matrix cell at coordinate <tt>index</tt> to the specified value.
@@ -80,6 +80,6 @@
  * @param    value the value to be filled into the specified cell.
  */
 public void setQuick(int index, double value) {
-	content.setQuick(row,index, value);
+  content.setQuick(row,index, value);
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/FormerFactory.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/FormerFactory.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/FormerFactory.java	(working copy)
@@ -7,8 +7,6 @@
  * Serves to isolate the interface of String formatting from the actual implementation.
  * If you want to plug in a different String formatting implementation, simply replace this class with your alternative.
  *
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 21/07/00
  */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/WrapperDoubleMatrix1D.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/WrapperDoubleMatrix1D.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/WrapperDoubleMatrix1D.java	(working copy)
@@ -17,20 +17,20 @@
 @version 1.0, 09/24/99
 */
 class WrapperDoubleMatrix1D extends DoubleMatrix1D {
-	/*
-	 * The elements of the matrix.
-	 */
-	protected DoubleMatrix1D content; 
+  /*
+   * The elements of the matrix.
+   */
+  protected DoubleMatrix1D content; 
 public WrapperDoubleMatrix1D(DoubleMatrix1D newContent) {
-	if (newContent != null) setUp(newContent.size());
-	this.content = newContent;
+  if (newContent != null) setUp(newContent.size());
+  this.content = newContent;
 }
 /**
  * Returns the content of this matrix if it is a wrapper; or <tt>this</tt> otherwise.
  * Override this method in wrappers.
  */
 protected DoubleMatrix1D getContent() {
-	return this.content;
+  return this.content;
 }
 /**
  * Returns the matrix cell value at coordinate <tt>index</tt>.
@@ -43,7 +43,7 @@
  * @return    the value of the specified cell.
  */
 public double getQuick(int index) {
-	return content.getQuick(index);
+  return content.getQuick(index);
 }
 /**
  * Construct and returns a new empty matrix <i>of the same dynamic type</i> as the receiver, having the specified size.
@@ -55,7 +55,7 @@
  * @return  a new empty matrix of the same dynamic type.
  */
 public DoubleMatrix1D like(int size) {
-	return content.like(size);
+  return content.like(size);
 }
 /**
  * Construct and returns a new 2-d matrix <i>of the corresponding dynamic type</i>, entirelly independent of the receiver.
@@ -67,7 +67,7 @@
  * @return  a new matrix of the corresponding dynamic type.
  */
 public DoubleMatrix2D like2D(int rows, int columns) {
-	return content.like2D(rows,columns);
+  return content.like2D(rows,columns);
 }
 /**
  * Sets the matrix cell at coordinate <tt>index</tt> to the specified value.
@@ -80,7 +80,7 @@
  * @param    value the value to be filled into the specified cell.
  */
 public void setQuick(int index, double value) {
-	content.setQuick(index, value);
+  content.setQuick(index, value);
 }
 /**
 Constructs and returns a new <i>flip view</i>.
@@ -90,15 +90,15 @@
 @return a new flip view.
 */
 public DoubleMatrix1D viewFlip() {
-	DoubleMatrix1D view = new WrapperDoubleMatrix1D(this) {
-		public double getQuick(int index) {
-			return content.get(size-1-index);
-		}
-		public void setQuick(int index, double value) {
-			content.set(size-1-index,value); 
-		}
-	};
-	return view;
+  DoubleMatrix1D view = new WrapperDoubleMatrix1D(this) {
+    public double getQuick(int index) {
+      return content.get(size-1-index);
+    }
+    public void setQuick(int index, double value) {
+      content.set(size-1-index,value); 
+    }
+  };
+  return view;
 }
 /**
 Constructs and returns a new <i>sub-range view</i> that is a <tt>width</tt> sub matrix starting at <tt>index</tt>.
@@ -117,22 +117,22 @@
 
 @param     index   The index of the first cell.
 @param     width   The width of the range.
-@throws	IndexOutOfBoundsException if <tt>index<0 || width<0 || index+width>size()</tt>.
+@throws  IndexOutOfBoundsException if <tt>index<0 || width<0 || index+width>size()</tt>.
 @return the new view.
-		
+    
 */
 public DoubleMatrix1D viewPart(final int index, int width) {
-	checkRange(index,width);
-	DoubleMatrix1D view = new WrapperDoubleMatrix1D(this) {
-		public double getQuick(int i) {
-			return content.get(index+i);
-		}
-		public void setQuick(int i, double value) {
-			content.set(index+i,value); 
-		}
-	};
-	view.size=width;
-	return view;
+  checkRange(index,width);
+  DoubleMatrix1D view = new WrapperDoubleMatrix1D(this) {
+    public double getQuick(int i) {
+      return content.get(index+i);
+    }
+    public void setQuick(int i, double value) {
+      content.set(index+i,value); 
+    }
+  };
+  view.size=width;
+  return view;
 }
 /**
 Constructs and returns a new <i>selection view</i> that is a matrix holding the indicated cells.
@@ -155,25 +155,25 @@
 @throws IndexOutOfBoundsException if <tt>!(0 <= indexes[i] < size())</tt> for any <tt>i=0..indexes.length()-1</tt>.
 */
 public DoubleMatrix1D viewSelection(int[] indexes) {
-	// check for "all"
-	if (indexes==null) {
-		indexes = new int[size];
-		for (int i=size; --i >= 0; ) indexes[i] = i;
-	}
-	
-	checkIndexes(indexes);
-	final int[] idx = indexes;
+  // check for "all"
+  if (indexes==null) {
+    indexes = new int[size];
+    for (int i=size; --i >= 0; ) indexes[i] = i;
+  }
+  
+  checkIndexes(indexes);
+  final int[] idx = indexes;
 
-	DoubleMatrix1D view = new WrapperDoubleMatrix1D(this) {
-		public double getQuick(int i) {
-			return content.get(idx[i]);
-		}
-		public void setQuick(int i, double value) {
-			content.set(idx[i],value); 
-		}
-	};
-	view.size=indexes.length;
-	return view;
+  DoubleMatrix1D view = new WrapperDoubleMatrix1D(this) {
+    public double getQuick(int i) {
+      return content.get(idx[i]);
+    }
+    public void setQuick(int i, double value) {
+      content.set(idx[i],value); 
+    }
+  };
+  view.size=indexes.length;
+  return view;
 }
 /**
  * Construct and returns a new selection view.
@@ -182,29 +182,29 @@
  * @return  a new view.
  */
 protected DoubleMatrix1D viewSelectionLike(int[] offsets) {
-	throw new InternalError(); // should never get called
+  throw new InternalError(); // should never get called
 }
 /**
 Constructs and returns a new <i>stride view</i> which is a sub matrix consisting of every i-th cell.
 More specifically, the view has size <tt>this.size()/stride</tt> holding cells <tt>this.get(i*stride)</tt> for all <tt>i = 0..size()/stride - 1</tt>.
 
 @param  stride  the step factor.
-@throws	IndexOutOfBoundsException if <tt>stride <= 0</tt>.
+@throws  IndexOutOfBoundsException if <tt>stride <= 0</tt>.
 @return the new view.
-		
+    
 */
 public DoubleMatrix1D viewStrides(final int _stride) {
-	if (stride<=0) throw new IndexOutOfBoundsException("illegal stride: "+stride);
-	DoubleMatrix1D view = new WrapperDoubleMatrix1D(this) {
-		public double getQuick(int index) {
-			return content.get(index*_stride);
-		}
-		public void setQuick(int index, double value) {
-			content.set(index*_stride,value); 
-		}
-	};
-	view.size = size;
-	if (size!=0) view.size = (size-1)/_stride +1;
-	return view;
+  if (stride<=0) throw new IndexOutOfBoundsException("illegal stride: "+stride);
+  DoubleMatrix1D view = new WrapperDoubleMatrix1D(this) {
+    public double getQuick(int index) {
+      return content.get(index*_stride);
+    }
+    public void setQuick(int index, double value) {
+      content.set(index*_stride,value); 
+    }
+  };
+  view.size = size;
+  if (size!=0) view.size = (size-1)/_stride +1;
+  return view;
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/NormInfinityTest.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/NormInfinityTest.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/NormInfinityTest.java	(working copy)
@@ -5,15 +5,15 @@
 
 class NormInfinityTest {
 
-	public static void main(String[] args) {
-		DoubleMatrix1D x1 = DoubleFactory1D.dense
-				.make(new double[] { 1.0, 2.0});
-		DoubleMatrix1D x2 = DoubleFactory1D.dense
-				.make(new double[] { 1.0, -2.0});
-		DoubleMatrix1D x3 = DoubleFactory1D.dense.make(new double[] { -1.0, -2.0});
+  public static void main(String[] args) {
+    DoubleMatrix1D x1 = DoubleFactory1D.dense
+        .make(new double[] { 1.0, 2.0});
+    DoubleMatrix1D x2 = DoubleFactory1D.dense
+        .make(new double[] { 1.0, -2.0});
+    DoubleMatrix1D x3 = DoubleFactory1D.dense.make(new double[] { -1.0, -2.0});
 
-		System.out.println(Algebra.DEFAULT.normInfinity(x1));
-		System.out.println(Algebra.DEFAULT.normInfinity(x2));
-		System.out.println(Algebra.DEFAULT.normInfinity(x3));
-	}
+    System.out.println(Algebra.DEFAULT.normInfinity(x1));
+    System.out.println(Algebra.DEFAULT.normInfinity(x2));
+    System.out.println(Algebra.DEFAULT.normInfinity(x3));
+  }
 }
\ No newline at end of file
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/WrapperDoubleMatrix2D.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/WrapperDoubleMatrix2D.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/WrapperDoubleMatrix2D.java	(working copy)
@@ -17,10 +17,10 @@
 @version 1.0, 04/14/2000
 */
 class WrapperDoubleMatrix2D extends DoubleMatrix2D {
-	/*
-	 * The elements of the matrix.
-	 */
-	protected DoubleMatrix2D content;
+  /*
+   * The elements of the matrix.
+   */
+  protected DoubleMatrix2D content;
 /**
  * Constructs a matrix with a copy of the given values.
  * <tt>values</tt> is required to have the form <tt>values[row][column]</tt>
@@ -32,15 +32,15 @@
  * @throws IllegalArgumentException if <tt>for any 1 &lt;= row &lt; values.length: values[row].length != values[row-1].length</tt>.
  */
 public WrapperDoubleMatrix2D(DoubleMatrix2D newContent) {
-	if (newContent != null) setUp(newContent.rows(),newContent.columns());
-	this.content = newContent;
+  if (newContent != null) setUp(newContent.rows(),newContent.columns());
+  this.content = newContent;
 }
 /**
  * Returns the content of this matrix if it is a wrapper; or <tt>this</tt> otherwise.
  * Override this method in wrappers.
  */
 protected DoubleMatrix2D getContent() {
-	return content;
+  return content;
 }
 /**
  * Returns the matrix cell value at coordinate <tt>[row,column]</tt>.
@@ -54,7 +54,7 @@
  * @return    the value at the specified coordinate.
  */
 public double getQuick(int row, int column) {
-	return content.getQuick(row,column);
+  return content.getQuick(row,column);
 }
 /**
  * Construct and returns a new empty matrix <i>of the same dynamic type</i> as the receiver, having the specified number of rows and columns.
@@ -67,7 +67,7 @@
  * @return  a new empty matrix of the same dynamic type.
  */
 public DoubleMatrix2D like(int rows, int columns) {
-	return content.like(rows,columns);
+  return content.like(rows,columns);
 }
 /**
  * Construct and returns a new 1-d matrix <i>of the corresponding dynamic type</i>, entirelly independent of the receiver.
@@ -78,7 +78,7 @@
  * @return  a new matrix of the corresponding dynamic type.
  */
 public DoubleMatrix1D like1D(int size) {
-	return content.like1D(size);
+  return content.like1D(size);
 }
 /**
  * Construct and returns a new 1-d matrix <i>of the corresponding dynamic type</i>, sharing the same cells.
@@ -91,7 +91,7 @@
  * @return  a new matrix of the corresponding dynamic type.
  */
 protected DoubleMatrix1D like1D(int size, int offset, int stride) {
-	throw new InternalError(); // should never get called
+  throw new InternalError(); // should never get called
 }
 /**
  * Sets the matrix cell at coordinate <tt>[row,column]</tt> to the specified value.
@@ -105,7 +105,7 @@
  * @param    value the value to be filled into the specified cell.
  */
 public void setQuick(int row, int column, double value) {
-	content.setQuick(row,column, value);
+  content.setQuick(row,column, value);
 }
 /**
 Constructs and returns a new <i>slice view</i> representing the rows of the given column.
@@ -115,12 +115,12 @@
 <b>Example:</b> 
 <table border="0">
   <tr nowrap> 
-	<td valign="top">2 x 3 matrix: <br>
-	  1, 2, 3<br>
-	  4, 5, 6 </td>
-	<td>viewColumn(0) ==></td>
-	<td valign="top">Matrix1D of size 2:<br>
-	  1, 4</td>
+  <td valign="top">2 x 3 matrix: <br>
+    1, 2, 3<br>
+    4, 5, 6 </td>
+  <td>viewColumn(0) ==></td>
+  <td valign="top">Matrix1D of size 2:<br>
+    1, 4</td>
    </tr>
 </table>
 
@@ -130,7 +130,7 @@
 @see #viewRow(int)
 */
 public DoubleMatrix1D viewColumn(int column) {
-	return viewDice().viewRow(column);
+  return viewDice().viewRow(column);
 }
 /**
 Constructs and returns a new <i>flip view</i> along the column axis.
@@ -140,17 +140,17 @@
 <b>Example:</b> 
 <table border="0">
   <tr nowrap> 
-	<td valign="top">2 x 3 matrix: <br>
-	  1, 2, 3<br>
-	  4, 5, 6 </td>
-	<td>columnFlip ==></td>
-	<td valign="top">2 x 3 matrix:<br>
-	  3, 2, 1 <br>
-	  6, 5, 4</td>
-	<td>columnFlip ==></td>
-	<td valign="top">2 x 3 matrix: <br>
-	  1, 2, 3<br>
-	  4, 5, 6 </td>
+  <td valign="top">2 x 3 matrix: <br>
+    1, 2, 3<br>
+    4, 5, 6 </td>
+  <td>columnFlip ==></td>
+  <td valign="top">2 x 3 matrix:<br>
+    3, 2, 1 <br>
+    6, 5, 4</td>
+  <td>columnFlip ==></td>
+  <td valign="top">2 x 3 matrix: <br>
+    1, 2, 3<br>
+    4, 5, 6 </td>
   </tr>
 </table>
 
@@ -158,16 +158,16 @@
 @see #viewRowFlip()
 */
 public DoubleMatrix2D viewColumnFlip() {
-	if (columns==0) return this;
-	DoubleMatrix2D view = new WrapperDoubleMatrix2D(this) {
-		public double getQuick(int row, int column) {
-			return content.get(row,columns-1-column);
-		}
-		public void setQuick(int row, int column, double value) {
-			content.set(row,columns-1-column,value); 
-		}
-	};
-	return view;
+  if (columns==0) return this;
+  DoubleMatrix2D view = new WrapperDoubleMatrix2D(this) {
+    public double getQuick(int row, int column) {
+      return content.get(row,columns-1-column);
+    }
+    public void setQuick(int row, int column, double value) {
+      content.set(row,columns-1-column,value); 
+    }
+  };
+  return view;
 }
 /**
 Constructs and returns a new <i>dice (transposition) view</i>; Swaps axes; example: 3 x 4 matrix --> 4 x 3 matrix.
@@ -180,35 +180,35 @@
 <b>Example:</b> 
 <table border="0">
   <tr nowrap> 
-	<td valign="top">2 x 3 matrix: <br>
-	  1, 2, 3<br>
-	  4, 5, 6 </td>
-	<td>transpose ==></td>
-	<td valign="top">3 x 2 matrix:<br>
-	  1, 4 <br>
-	  2, 5 <br>
-	  3, 6</td>
-	<td>transpose ==></td>
-	<td valign="top">2 x 3 matrix: <br>
-	  1, 2, 3<br>
-	  4, 5, 6 </td>
+  <td valign="top">2 x 3 matrix: <br>
+    1, 2, 3<br>
+    4, 5, 6 </td>
+  <td>transpose ==></td>
+  <td valign="top">3 x 2 matrix:<br>
+    1, 4 <br>
+    2, 5 <br>
+    3, 6</td>
+  <td>transpose ==></td>
+  <td valign="top">2 x 3 matrix: <br>
+    1, 2, 3<br>
+    4, 5, 6 </td>
   </tr>
 </table>
 
 @return a new dice view.
 */
 public DoubleMatrix2D viewDice() {
-	DoubleMatrix2D view = new WrapperDoubleMatrix2D(this) {
-		public double getQuick(int row, int column) {
-			return content.get(column,row);
-		}
-		public void setQuick(int row, int column, double value) {
-			content.set(column,row,value); 
-		}
-	};
-	view.rows = columns;
-	view.columns = rows;
-	return view;
+  DoubleMatrix2D view = new WrapperDoubleMatrix2D(this) {
+    public double getQuick(int row, int column) {
+      return content.get(column,row);
+    }
+    public void setQuick(int row, int column, double value) {
+      content.set(column,row,value); 
+    }
+  };
+  view.rows = columns;
+  view.columns = rows;
+  return view;
 }
 /**
 Constructs and returns a new <i>sub-range view</i> that is a <tt>height x width</tt> sub matrix starting at <tt>[row,column]</tt>.
@@ -229,24 +229,24 @@
 @param     column   The index of the column-coordinate.
 @param     height   The height of the box.
 @param     width   The width of the box.
-@throws	IndexOutOfBoundsException if <tt>column<0 || width<0 || column+width>columns() || row<0 || height<0 || row+height>rows()</tt>
+@throws  IndexOutOfBoundsException if <tt>column<0 || width<0 || column+width>columns() || row<0 || height<0 || row+height>rows()</tt>
 @return the new view.
-		
+    
 */
 public DoubleMatrix2D viewPart(final int row, final int column, int height, int width) {
-	checkBox(row,column,height,width);
-	DoubleMatrix2D view = new WrapperDoubleMatrix2D(this) {
-		public double getQuick(int i, int j) {
-			return content.get(row+i,column+j);
-		}
-		public void setQuick(int i, int j, double value) {
-			content.set(row+i,column+j,value); 
-		}
-	};
-	view.rows = height;
-	view.columns = width;
+  checkBox(row,column,height,width);
+  DoubleMatrix2D view = new WrapperDoubleMatrix2D(this) {
+    public double getQuick(int i, int j) {
+      return content.get(row+i,column+j);
+    }
+    public void setQuick(int i, int j, double value) {
+      content.set(row+i,column+j,value); 
+    }
+  };
+  view.rows = height;
+  view.columns = width;
 
-	return view;
+  return view;
 }
 /**
 Constructs and returns a new <i>slice view</i> representing the columns of the given row.
@@ -256,12 +256,12 @@
 <b>Example:</b> 
 <table border="0">
   <tr nowrap> 
-	<td valign="top">2 x 3 matrix: <br>
-	  1, 2, 3<br>
-	  4, 5, 6 </td>
-	<td>viewRow(0) ==></td>
-	<td valign="top">Matrix1D of size 3:<br>
-	  1, 2, 3</td>
+  <td valign="top">2 x 3 matrix: <br>
+    1, 2, 3<br>
+    4, 5, 6 </td>
+  <td>viewRow(0) ==></td>
+  <td valign="top">Matrix1D of size 3:<br>
+    1, 2, 3</td>
    </tr>
 </table>
 
@@ -271,8 +271,8 @@
 @see #viewColumn(int)
 */
 public DoubleMatrix1D viewRow(int row) {
-	checkRow(row);
-	return new DelegateDoubleMatrix1D(this,row);
+  checkRow(row);
+  return new DelegateDoubleMatrix1D(this,row);
 }
 /**
 Constructs and returns a new <i>flip view</i> along the row axis.
@@ -282,17 +282,17 @@
 <b>Example:</b> 
 <table border="0">
   <tr nowrap> 
-	<td valign="top">2 x 3 matrix: <br>
-	  1, 2, 3<br>
-	  4, 5, 6 </td>
-	<td>rowFlip ==></td>
-	<td valign="top">2 x 3 matrix:<br>
-	  4, 5, 6 <br>
-	  1, 2, 3</td>
-	<td>rowFlip ==></td>
-	<td valign="top">2 x 3 matrix: <br>
-	  1, 2, 3<br>
-	  4, 5, 6 </td>
+  <td valign="top">2 x 3 matrix: <br>
+    1, 2, 3<br>
+    4, 5, 6 </td>
+  <td>rowFlip ==></td>
+  <td valign="top">2 x 3 matrix:<br>
+    4, 5, 6 <br>
+    1, 2, 3</td>
+  <td>rowFlip ==></td>
+  <td valign="top">2 x 3 matrix: <br>
+    1, 2, 3<br>
+    4, 5, 6 </td>
   </tr>
 </table>
 
@@ -300,16 +300,16 @@
 @see #viewColumnFlip()
 */
 public DoubleMatrix2D viewRowFlip() {
-	if (rows==0) return this;
-	DoubleMatrix2D view = new WrapperDoubleMatrix2D(this) {
-		public double getQuick(int row, int column) {
-			return content.get(rows-1-row,column);
-		}
-		public void setQuick(int row, int column, double value) {
-			content.set(rows-1-row,column,value); 
-		}
-	};
-	return view;
+  if (rows==0) return this;
+  DoubleMatrix2D view = new WrapperDoubleMatrix2D(this) {
+    public double getQuick(int row, int column) {
+      return content.get(rows-1-row,column);
+    }
+    public void setQuick(int row, int column, double value) {
+      content.set(rows-1-row,column,value); 
+    }
+  };
+  return view;
 }
 /**
 Constructs and returns a new <i>selection view</i> that is a matrix holding the indicated cells.
@@ -339,33 +339,33 @@
 @throws IndexOutOfBoundsException if <tt>!(0 <= columnIndexes[i] < columns())</tt> for any <tt>i=0..columnIndexes.length()-1</tt>.
 */
 public DoubleMatrix2D viewSelection(int[] rowIndexes, int[] columnIndexes) {
-	// check for "all"
-	if (rowIndexes==null) {
-		rowIndexes = new int[rows];
-		for (int i=rows; --i >= 0; ) rowIndexes[i] = i;
-	}
-	if (columnIndexes==null) {
-		columnIndexes = new int[columns];
-		for (int i=columns; --i >= 0; ) columnIndexes[i] = i;
-	}
-	
-	checkRowIndexes(rowIndexes);
-	checkColumnIndexes(columnIndexes);
-	final int[] rix = rowIndexes;
-	final int[] cix = columnIndexes;
-	
-	DoubleMatrix2D view = new WrapperDoubleMatrix2D(this) {
-		public double getQuick(int i, int j) {
-			return content.get(rix[i],cix[j]);
-		}
-		public void setQuick(int i, int j, double value) {
-			content.set(rix[i],cix[j],value); 
-		}
-	};
-	view.rows = rowIndexes.length;
-	view.columns = columnIndexes.length;
+  // check for "all"
+  if (rowIndexes==null) {
+    rowIndexes = new int[rows];
+    for (int i=rows; --i >= 0; ) rowIndexes[i] = i;
+  }
+  if (columnIndexes==null) {
+    columnIndexes = new int[columns];
+    for (int i=columns; --i >= 0; ) columnIndexes[i] = i;
+  }
+  
+  checkRowIndexes(rowIndexes);
+  checkColumnIndexes(columnIndexes);
+  final int[] rix = rowIndexes;
+  final int[] cix = columnIndexes;
+  
+  DoubleMatrix2D view = new WrapperDoubleMatrix2D(this) {
+    public double getQuick(int i, int j) {
+      return content.get(rix[i],cix[j]);
+    }
+    public void setQuick(int i, int j, double value) {
+      content.set(rix[i],cix[j],value); 
+    }
+  };
+  view.rows = rowIndexes.length;
+  view.columns = columnIndexes.length;
 
-	return view;
+  return view;
 }
 /**
  * Construct and returns a new selection view.
@@ -375,7 +375,7 @@
  * @return  a new view.
  */
 protected DoubleMatrix2D viewSelectionLike(int[] rowOffsets, int[] columnOffsets) {
-	throw new InternalError(); // should never be called
+  throw new InternalError(); // should never be called
 }
 /**
 Constructs and returns a new <i>stride view</i> which is a sub matrix consisting of every i-th cell.
@@ -385,22 +385,22 @@
 @param rowStride the row step factor.
 @param columnStride the column step factor.
 @return a new view.
-@throws	IndexOutOfBoundsException if <tt>rowStride<=0 || columnStride<=0</tt>.
+@throws  IndexOutOfBoundsException if <tt>rowStride<=0 || columnStride<=0</tt>.
 */
 public DoubleMatrix2D viewStrides(final int _rowStride, final int _columnStride) {
-	if (_rowStride<=0 || _columnStride<=0) throw new IndexOutOfBoundsException("illegal stride");
-	DoubleMatrix2D view = new WrapperDoubleMatrix2D(this) {
-		public double getQuick(int row, int column) {
-			return content.get(_rowStride*row, _columnStride*column);
-		}
-		public void setQuick(int row, int column, double value) {
-			content.set(_rowStride*row, _columnStride*column, value); 
-		}
-	};
-	view.rows = rows;
-	view.columns = columns;
-	if (rows!=0) view.rows = (rows-1)/_rowStride +1;
-	if (columns!=0) view.columns = (columns-1)/_columnStride +1;
-	return view;
+  if (_rowStride<=0 || _columnStride<=0) throw new IndexOutOfBoundsException("illegal stride");
+  DoubleMatrix2D view = new WrapperDoubleMatrix2D(this) {
+    public double getQuick(int row, int column) {
+      return content.get(_rowStride*row, _columnStride*column);
+    }
+    public void setQuick(int row, int column, double value) {
+      content.set(_rowStride*row, _columnStride*column, value); 
+    }
+  };
+  view.rows = rows;
+  view.columns = columns;
+  if (rows!=0) view.rows = (rows-1)/_rowStride +1;
+  if (columns!=0) view.columns = (columns-1)/_columnStride +1;
+  return view;
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/TestMatrix2D.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/TestMatrix2D.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/TestMatrix2D.java	(working copy)
@@ -24,21 +24,19 @@
 /**
  * Quick and dirty tests.
  *
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 09/24/99
  */
 class TestMatrix2D {
-	private static final org.apache.mahout.jet.math.Functions F = org.apache.mahout.jet.math.Functions.functions;
-	private static final org.apache.mahout.matrix.matrix.DoubleFactory2D Factory2D = org.apache.mahout.matrix.matrix.DoubleFactory2D.dense;
-	private static final org.apache.mahout.matrix.matrix.DoubleFactory1D Factory1D = org.apache.mahout.matrix.matrix.DoubleFactory1D.dense;
-	private static final org.apache.mahout.matrix.matrix.linalg.Algebra LinearAlgebra = org.apache.mahout.matrix.matrix.linalg.Algebra.DEFAULT;
-	private static final org.apache.mahout.matrix.matrix.doublealgo.Transform Transform = org.apache.mahout.matrix.matrix.doublealgo.Transform.transform;
-	private static final org.apache.mahout.matrix.matrix.linalg.Property Property = org.apache.mahout.matrix.matrix.linalg.Property.DEFAULT;
+  private static final org.apache.mahout.jet.math.Functions F = org.apache.mahout.jet.math.Functions.functions;
+  private static final org.apache.mahout.matrix.matrix.DoubleFactory2D Factory2D = org.apache.mahout.matrix.matrix.DoubleFactory2D.dense;
+  private static final org.apache.mahout.matrix.matrix.DoubleFactory1D Factory1D = org.apache.mahout.matrix.matrix.DoubleFactory1D.dense;
+  private static final org.apache.mahout.matrix.matrix.linalg.Algebra LinearAlgebra = org.apache.mahout.matrix.matrix.linalg.Algebra.DEFAULT;
+  private static final org.apache.mahout.matrix.matrix.doublealgo.Transform Transform = org.apache.mahout.matrix.matrix.doublealgo.Transform.transform;
+  private static final org.apache.mahout.matrix.matrix.linalg.Property Property = org.apache.mahout.matrix.matrix.linalg.Property.DEFAULT;
 /**
  * Makes this class non instantiable, but still let's others inherit from it.
  */
 protected TestMatrix2D() {
-	throw new RuntimeException("Non instantiable");
+  throw new RuntimeException("Non instantiable");
 }
 /**
  */
@@ -66,32 +64,32 @@
 /**
  */
 public static void doubleTest(int rows, int columns, int initialCapacity, double minLoadFactor, double maxLoadFactor) {
-	DoubleMatrix2D matrix = new SparseDoubleMatrix2D(rows,columns,initialCapacity,minLoadFactor,maxLoadFactor);
-	System.out.println(matrix);
-	
-	System.out.println("adding...");
-	int i=0;
-	for (int column=0; column < columns; column++) {
-		for (int row=0; row < rows; row++) {
-			//if (i%1000 == 0) { 
- 				matrix.set(row,column,i);
-			//}
-			i++;
-		}
-	}
-	System.out.println(matrix);
+  DoubleMatrix2D matrix = new SparseDoubleMatrix2D(rows,columns,initialCapacity,minLoadFactor,maxLoadFactor);
+  System.out.println(matrix);
+  
+  System.out.println("adding...");
+  int i=0;
+  for (int column=0; column < columns; column++) {
+    for (int row=0; row < rows; row++) {
+      //if (i%1000 == 0) { 
+         matrix.set(row,column,i);
+      //}
+      i++;
+    }
+  }
+  System.out.println(matrix);
 
-	System.out.println("removing...");
-	for (int column=0; column < columns; column++) {
-		for (int row=0; row < rows; row++) {
-			//if (i%1000 == 0) {
-				matrix.set(row,column,0);
-			//}
-		}
-	}
+  System.out.println("removing...");
+  for (int column=0; column < columns; column++) {
+    for (int row=0; row < rows; row++) {
+      //if (i%1000 == 0) {
+        matrix.set(row,column,0);
+      //}
+    }
+  }
 
-	System.out.println(matrix);
-	System.out.println("bye bye.");
+  System.out.println(matrix);
+  System.out.println("bye bye.");
 }
 /**
  */
@@ -184,9 +182,9 @@
 
 // Sum( x[i]*x[i] ) 
 System.out.println(matrix.viewSelection(
-	new org.apache.mahout.matrix.function.DoubleProcedure() {
-		public final boolean apply(double a) { return a % 2 == 0; }
-	}
+  new org.apache.mahout.matrix.function.DoubleProcedure() {
+    public final boolean apply(double a) { return a % 2 == 0; }
+  }
 ));
 //--> 14
 
@@ -225,7 +223,7 @@
 // Product( x[i] ) of all x[i] > limit
 final double limit = 1;
 DoubleFunction f = new DoubleFunction() {
-	public final double apply(double a) { return a>limit ? a : 1; }
+  public final double apply(double a) { return a>limit ? a : 1; }
 };
 System.out.println(matrix.aggregate(F.mult,f));
 //--> 6
@@ -246,7 +244,7 @@
 // or, perhaps less error prone and more readable: 
 System.out.println(matrix.aggregate(otherMatrix1D, F.plus,
    new DoubleDoubleFunction() {
-	  public double apply(double a, double b) { return Math.PI*Math.log(b/a); }
+    public double apply(double a, double b) { return Math.PI*Math.log(b/a); }
    }
 )
 );
@@ -292,16 +290,16 @@
 System.out.println("\n\n");
 double[][] values = 
 {
-	{ 0, 5, 9 },
-	{ 2, 6, 10 },
-	{ 3, 7, 11 }
+  { 0, 5, 9 },
+  { 2, 6, 10 },
+  { 3, 7, 11 }
 };
 
 //DoubleMatrix2D A = Factory2D.make(values);
 DoubleMatrix2D A = Factory2D.make(size,size);
 double value = 5;
 for (int i=size; --i >= 0; ) {
-	A.setQuick(i,i, value);
+  A.setQuick(i,i, value);
 }
 A.viewRow(0).assign(value);
 
@@ -312,14 +310,14 @@
 org.apache.mahout.matrix.Timer timer = new org.apache.mahout.matrix.Timer().start();
 DoubleMatrix2D inv = null;
 for (int run=0; run<runs; run++) {
-	 inv = LinearAlgebra.inverse(A);
+   inv = LinearAlgebra.inverse(A);
 }
 timer.stop().display();
 
 /*
 timer.reset().start();
 for (int run=0; run<runs; run++) {
-	new Jama.Matrix(A.toArray()).inverse();
+  new Jama.Matrix(A.toArray()).inverse();
 }
 timer.stop().display();
 */
@@ -427,10 +425,10 @@
 
 double[][] values5 = 
 {
-	{ 0, 0, 0, 0 },
-	{ 0, 0, 0, 0 },
-	{ 0, 0, 0, 0 },
-	{ 0, 0, 0, 0 }
+  { 0, 0, 0, 0 },
+  { 0, 0, 0, 0 },
+  { 0, 0, 0, 0 },
+  { 0, 0, 0, 0 }
 };
 A = Factory2D.make(values5);
 k = org.apache.mahout.matrix.matrix.linalg.Property.DEFAULT.semiBandwidth(A);
@@ -444,10 +442,10 @@
 
 double[][] values4 = 
 {
-	{ 1, 0, 0, 0 },
-	{ 0, 0, 0, 0 },
-	{ 0, 0, 0, 0 },
-	{ 0, 0, 0, 1 }
+  { 1, 0, 0, 0 },
+  { 0, 0, 0, 0 },
+  { 0, 0, 0, 0 },
+  { 0, 0, 0, 1 }
 };
 A = Factory2D.make(values4);
 k = org.apache.mahout.matrix.matrix.linalg.Property.DEFAULT.semiBandwidth(A);
@@ -460,10 +458,10 @@
 
 double[][] values1 = 
 {
-	{ 1, 1, 0, 0 },
-	{ 1, 1, 1, 0 },
-	{ 0, 1, 1, 1 },
-	{ 0, 0, 1, 1 }
+  { 1, 1, 0, 0 },
+  { 1, 1, 1, 0 },
+  { 0, 1, 1, 1 },
+  { 0, 0, 1, 1 }
 };
 A = Factory2D.make(values1);
 k = org.apache.mahout.matrix.matrix.linalg.Property.DEFAULT.semiBandwidth(A);
@@ -477,10 +475,10 @@
 
 double[][] values6 = 
 {
-	{ 0, 1, 1, 1 },
-	{ 0, 1, 1, 1 },
-	{ 0, 0, 0, 1 },
-	{ 0, 0, 0, 1 }
+  { 0, 1, 1, 1 },
+  { 0, 1, 1, 1 },
+  { 0, 0, 0, 1 },
+  { 0, 0, 0, 1 }
 };
 A = Factory2D.make(values6);
 k = org.apache.mahout.matrix.matrix.linalg.Property.DEFAULT.semiBandwidth(A);
@@ -493,10 +491,10 @@
 
 double[][] values7 = 
 {
-	{ 0, 0, 0, 0 },
-	{ 1, 1, 0, 0 },
-	{ 1, 1, 0, 0 },
-	{ 1, 1, 1, 1 }
+  { 0, 0, 0, 0 },
+  { 1, 1, 0, 0 },
+  { 1, 1, 0, 0 },
+  { 1, 1, 1, 1 }
 };
 A = Factory2D.make(values7);
 k = org.apache.mahout.matrix.matrix.linalg.Property.DEFAULT.semiBandwidth(A);
@@ -510,10 +508,10 @@
 
 double[][] values2 = 
 {
-	{ 1, 1, 0, 0 },
-	{ 0, 1, 1, 0 },
-	{ 0, 1, 0, 1 },
-	{ 1, 0, 1, 1 }
+  { 1, 1, 0, 0 },
+  { 0, 1, 1, 0 },
+  { 0, 1, 0, 1 },
+  { 1, 0, 1, 1 }
 };
 A = Factory2D.make(values2);
 k = org.apache.mahout.matrix.matrix.linalg.Property.DEFAULT.semiBandwidth(A);
@@ -526,10 +524,10 @@
 
 double[][] values3 = 
 {
-	{ 1, 1, 1, 0 },
-	{ 0, 1, 0, 0 },
-	{ 1, 1, 0, 1 },
-	{ 0, 0, 1, 1 }
+  { 1, 1, 1, 0 },
+  { 0, 1, 0, 0 },
+  { 1, 1, 0, 1 },
+  { 0, 0, 1, 1 }
 };
 A = Factory2D.make(values3); 
 k = org.apache.mahout.matrix.matrix.linalg.Property.DEFAULT.semiBandwidth(A);
@@ -639,10 +637,10 @@
 
 double[][] values1 =
 {
-	{ 0, 1, 0, 0 },
-	{ 3, 0, 2, 0 },
-	{ 0, 2, 0, 3 },
-	{ 0, 0, 1, 0 }
+  { 0, 1, 0, 0 },
+  { 3, 0, 2, 0 },
+  { 0, 2, 0, 3 },
+  { 0, 0, 1, 0 }
 };
 A = Factory2D.make(values1);
 
@@ -652,11 +650,11 @@
 
 double[][] values2 =
 {
-	{ 1.0000000000000167, -0.3623577544766736, -0.3623577544766736 },
-	{ 0                 ,  0.9320390859672374, -0.3377315902755755 },
-	{ 0                 ,  0                 ,  0.8686968577706282 },
-	{ 0                 ,  0                 ,  0                  },
-	{ 0                 ,  0                 ,  0                  }
+  { 1.0000000000000167, -0.3623577544766736, -0.3623577544766736 },
+  { 0                 ,  0.9320390859672374, -0.3377315902755755 },
+  { 0                 ,  0                 ,  0.8686968577706282 },
+  { 0                 ,  0                 ,  0                  },
+  { 0                 ,  0                 ,  0                  }
 };
 
 A = Factory2D.make(values2);
@@ -666,14 +664,14 @@
 
 double[][] values3 =
 {
-	{ 611,  196, -192,  407,   -8,  -52,  -49,   29 },
-	{ 196,  899,  113, -192,  -71,  -43,   -8,  -44 },
-	{-192,  113,  899,  196,   61,   49,    8,   52 },
-	{ 407, -192,  196,  611,    8,   44,   59,  -23 },
-	{  -8,  -71,   61,    8,  411, -599,  208,  208 },
-	{ -52,  -43,   49,   44, -599,  411,  208,  208 },
-	{ -49,   -8,    8,   59,  208,  208,   99, -911 },
-	{  29,  -44,   52,  -23,  208,  208, -911,   99 }
+  { 611,  196, -192,  407,   -8,  -52,  -49,   29 },
+  { 196,  899,  113, -192,  -71,  -43,   -8,  -44 },
+  {-192,  113,  899,  196,   61,   49,    8,   52 },
+  { 407, -192,  196,  611,    8,   44,   59,  -23 },
+  {  -8,  -71,   61,    8,  411, -599,  208,  208 },
+  { -52,  -43,   49,   44, -599,  411,  208,  208 },
+  { -49,   -8,    8,   59,  208,  208,   99, -911 },
+  {  29,  -44,   52,  -23,  208,  208, -911,   99 }
 };
 
 
@@ -700,10 +698,10 @@
 
 double[][] values1 =
 {
-	{ 1/3, 2/3, Math.PI, 0 },
-	{ 3, 9, 0, 0 },
-	{ 0, 2, 7, 0 },
-	{ 0, 0, 3, 9 }
+  { 1/3, 2/3, Math.PI, 0 },
+  { 3, 9, 0, 0 },
+  { 0, 2, 7, 0 },
+  { 0, 0, 3, 9 }
 };
 A = Factory2D.make(values1);
 System.out.println(A);
@@ -724,10 +722,10 @@
 
 double[][] values1 =
 {
-	{ 1/3, 2/3, Math.PI, 0 },
-	{ 3, 9, 0, 0 },
-	{ 0, 2, 7, 0 },
-	{ 0, 0, 3, 9 }
+  { 1/3, 2/3, Math.PI, 0 },
+  { 3, 9, 0, 0 },
+  { 0, 2, 7, 0 },
+  { 0, 0, 3, 9 }
 };
 A = Factory2D.make(values1);
 System.out.println(A);
@@ -757,9 +755,9 @@
 System.out.println("sampling...");
 double value = 2;
 if (dense) 
-	A = Factory2D.dense.sample(size,size, value, nonZeroFraction);
+  A = Factory2D.dense.sample(size,size, value, nonZeroFraction);
 else
-	A = Factory2D.sparse.sample(size,size, value, nonZeroFraction);
+  A = Factory2D.sparse.sample(size,size, value, nonZeroFraction);
 b = A.like1D(size).assign(1);
 
 //A.assign(random);
@@ -787,11 +785,11 @@
 System.out.println("benchmarking LU...");
 timer.reset().start();
 for (int i=runs; --i >=0; ) {
-	solved.assign(b);
-	//Inv.assign(I);
-	//lu.decompose(LU);
-	lu.solve(solved);
-	//lu.solve(Inv);
+  solved.assign(b);
+  //Inv.assign(I);
+  //lu.decompose(LU);
+  lu.solve(solved);
+  //lu.solve(Inv);
 }
 timer.stop().display();
 
@@ -800,7 +798,7 @@
 //System.out.println("U="+lu.getU());
 //System.out.println("L="+lu.getL());
 System.out.println("done.");
-	
+  
 }
 /**
  */
@@ -810,10 +808,10 @@
 DoubleMatrix2D A;
 DoubleFactory2D factory;
 if (dense) 
-	factory = Factory2D.dense;
+  factory = Factory2D.dense;
 else 
-	factory = Factory2D.sparse;
-	
+  factory = Factory2D.sparse;
+  
 double value = 2;
 double omega = 1.25;
 final double alpha = omega * 0.25;
@@ -821,15 +819,15 @@
 A = factory.make(size,size,value);
 
 org.apache.mahout.matrix.function.Double9Function function = new org.apache.mahout.matrix.function.Double9Function() {
-	public final double apply(double a00, double a01, double a02, double a10, double a11, double a12, double a20, double a21, double a22) {
-		return alpha*a11 + beta*(a01+a10+a12+a21);
-	}
+  public final double apply(double a00, double a01, double a02, double a10, double a11, double a12, double a20, double a21, double a22) {
+    return alpha*a11 + beta*(a01+a10+a12+a21);
+  }
 };
 org.apache.mahout.matrix.Timer timer = new org.apache.mahout.matrix.Timer().start();
 
 System.out.println("benchmarking stencil...");
 for (int i=0; i<runs; i++) {
-	A.zAssign8Neighbors(A,function);
+  A.zAssign8Neighbors(A,function);
 }
 //A.zSum4Neighbors(A,alpha,beta,runs);
 timer.stop().display();
@@ -841,29 +839,29 @@
 
 System.out.println("benchmarking stencil scimark...");
 for (int i=0; i<runs; i++) {
-//	jnt.scimark2.SOR.execute(omega, B, runs);
+//  jnt.scimark2.SOR.execute(omega, B, runs);
 }
 timer.stop().display();
 
 
 System.out.println("done.");
-	
+  
 }
 /**
  */
 public static void doubleTest25(int size) {
 
-	
+  
 System.out.println("\n\n");
 System.out.println("initializing...");
 boolean dense = true;
 DoubleMatrix2D A;
 DoubleFactory2D factory;
 if (dense) 
-	factory = Factory2D.dense;
+  factory = Factory2D.dense;
 else 
-	factory = Factory2D.sparse;
-	
+  factory = Factory2D.sparse;
+  
 double value = 0.5;
 A = factory.make(size,size,value);
 Property.generateNonSingular(A);
@@ -875,32 +873,32 @@
 timer.stop().display();
 
 System.out.println("done.");
-	
+  
 }
 /**
  */
 public static void doubleTest26(int size) {
 
-	
+  
 System.out.println("\n\n");
 System.out.println("initializing...");
 boolean dense = true;
 DoubleMatrix2D A;
 DoubleFactory2D factory;
 if (dense) 
-	factory = Factory2D.dense;
+  factory = Factory2D.dense;
 else 
-	factory = Factory2D.sparse;
-	
+  factory = Factory2D.sparse;
+  
 double value = 0.5;
 A = factory.make(size,size,value);
 Property.generateNonSingular(A);
 org.apache.mahout.matrix.Timer timer = new org.apache.mahout.matrix.Timer().start();
 
 DoubleMatrix2DComparator fun = new DoubleMatrix2DComparator() {
-	public int compare(DoubleMatrix2D a, DoubleMatrix2D b) {
-		return a.zSum() == b.zSum() ? 1 : 0;
-	}
+  public int compare(DoubleMatrix2D a, DoubleMatrix2D b) {
+    return a.zSum() == b.zSum() ? 1 : 0;
+  }
 };
 
 System.out.println(A);
@@ -909,13 +907,13 @@
 timer.stop().display();
 
 System.out.println("done.");
-	
+  
 }
 /**
  */
 public static void doubleTest27() {
 
-	
+  
 System.out.println("\n\n");
 System.out.println("initializing...");
 
@@ -939,9 +937,9 @@
 
 // copy the patterns into the matrix
 for (patternIndex=0;patternIndex<columns;patternIndex++) {
-	for (unitIndex=0;unitIndex<rows;unitIndex++) {
-		patternMatrix.setQuick (unitIndex, patternIndex, trainingSet[patternIndex][unitIndex]);
-	}
+  for (unitIndex=0;unitIndex<rows;unitIndex++) {
+    patternMatrix.setQuick (unitIndex, patternIndex, trainingSet[patternIndex][unitIndex]);
+  }
 }
 
 transposeMatrix     = Algebra.DEFAULT.transpose (patternMatrix);
@@ -950,60 +948,60 @@
 pseudoInverseMatrix = Algebra.DEFAULT.mult (inverseQMatrix,transposeMatrix);
 weightMatrix        = Algebra.DEFAULT.mult (patternMatrix,pseudoInverseMatrix);
 System.out.println("done.");
-	
+  
 }
 /**
  */
 public static void doubleTest28() {
-	double[] data={1,2,3,4,5,6};
-	double[][] arrMatrix = 
-	{ 
-		{ 1, 2, 3, 4, 5, 6},
-		{ 2, 3, 4, 5, 6, 7}
-	};
-	DoubleFactory2D f = DoubleFactory2D.dense;
-	DoubleMatrix1D vector = new DenseDoubleMatrix1D(data);
-	DoubleMatrix2D matrix = f.make(arrMatrix);
-	DoubleMatrix1D res = vector.like(matrix.rows());
-	
-	matrix.zMult(vector,res);
+  double[] data={1,2,3,4,5,6};
+  double[][] arrMatrix = 
+  { 
+    { 1, 2, 3, 4, 5, 6},
+    { 2, 3, 4, 5, 6, 7}
+  };
+  DoubleFactory2D f = DoubleFactory2D.dense;
+  DoubleMatrix1D vector = new DenseDoubleMatrix1D(data);
+  DoubleMatrix2D matrix = f.make(arrMatrix);
+  DoubleMatrix1D res = vector.like(matrix.rows());
+  
+  matrix.zMult(vector,res);
 
-	System.out.println(res);
+  System.out.println(res);
 }
 /**
  */
 public static void doubleTest28(DoubleFactory2D f) {
-	double[] data={1,2,3,4,5,6};
-	double[][] arrMatrix = 
-	{ 
-		{ 1, 2, 3, 4, 5, 6},
-		{ 2, 3, 4, 5, 6, 7}
-	};
-	
-	DoubleMatrix1D vector = new DenseDoubleMatrix1D(data);
-	DoubleMatrix2D matrix = f.make(arrMatrix);
-	DoubleMatrix1D res = vector.like(matrix.rows());
-	
-	matrix.zMult(vector,res);
+  double[] data={1,2,3,4,5,6};
+  double[][] arrMatrix = 
+  { 
+    { 1, 2, 3, 4, 5, 6},
+    { 2, 3, 4, 5, 6, 7}
+  };
+  
+  DoubleMatrix1D vector = new DenseDoubleMatrix1D(data);
+  DoubleMatrix2D matrix = f.make(arrMatrix);
+  DoubleMatrix1D res = vector.like(matrix.rows());
+  
+  matrix.zMult(vector,res);
 
-	System.out.println(res);
+  System.out.println(res);
 }
 /**
  */
 public static void doubleTest29(int size) {
 /*
-	
+  
 System.out.println("\n\n");
 System.out.println("initializing...");
 boolean dense = false;
 DoubleMatrix2D A;
 DoubleFactory2D factory;
 if (dense) 
-	factory = Factory2D.dense;
+  factory = Factory2D.dense;
 else 
-	factory = Factory2D.sparse;
-	
-double value = 0.5;	
+  factory = Factory2D.sparse;
+  
+double value = 0.5;  
 
 DoubleMatrix2D C = Factory2D.dense.sample(size,size,value,1);
 
@@ -1017,9 +1015,9 @@
 timer.reset().start();
 double sum=0;
 for (int i=0; i<size; i++) {
-	for (int j=0; j<size; j++ ) {
-		sum+=A.getQuick(i,j);
-	}
+  for (int j=0; j<size; j++ ) {
+    sum+=A.getQuick(i,j);
+  }
 }
 timer.stop().display();
 System.out.println(sum);
@@ -1029,11 +1027,11 @@
 JSci.maths.DoubleSparseMatrix B = new JSci.maths.DoubleSparseMatrix(size);
 timer.reset().start();
 //for (int i=size; --i>=0; ) {
-//	for (int j=size; --j>=0; ) {
+//  for (int j=size; --j>=0; ) {
 for (int i=0; i<size; i++) {
-	for (int j=0; j<size; j++ ) {
-		B.setElement3(i,j,C.getQuick(i,j));
-	}
+  for (int j=0; j<size; j++ ) {
+    B.setElement3(i,j,C.getQuick(i,j));
+  }
 }
 //System.out.println(A);
 timer.stop().display();
@@ -1042,9 +1040,9 @@
 timer.reset().start();
 sum=0;
 for (int i=0; i<size; i++) {
-	for (int j=0; j<size; j++ ) {
-		sum+=B.getElement3(i,j);
-	}
+  for (int j=0; j<size; j++ ) {
+    sum+=B.getElement3(i,j);
+  }
 }
 System.out.println(sum);
 timer.stop().display();
@@ -1058,46 +1056,46 @@
 
 
 System.out.println("done.");
-*/	
+*/  
 }
 /**
  */
 public static void doubleTest29(int size,DoubleFactory2D f) {
-	
-	DoubleMatrix2D x = new DenseDoubleMatrix2D(size,size).assign(0.5);
-	DoubleMatrix2D matrix = f.sample(size,size,0.5,0.001);
-	
-	org.apache.mahout.matrix.Timer timer = new org.apache.mahout.matrix.Timer().start();
-	DoubleMatrix2D res = matrix.zMult(x,null);
-	timer.stop().display();
-	
-	//System.out.println(res);
+  
+  DoubleMatrix2D x = new DenseDoubleMatrix2D(size,size).assign(0.5);
+  DoubleMatrix2D matrix = f.sample(size,size,0.5,0.001);
+  
+  org.apache.mahout.matrix.Timer timer = new org.apache.mahout.matrix.Timer().start();
+  DoubleMatrix2D res = matrix.zMult(x,null);
+  timer.stop().display();
+  
+  //System.out.println(res);
 }
 /**
  */
 public static void doubleTest29(DoubleFactory2D f) {
-	double[][] data = 
-	{ 
-		{ 6, 5, 4 },
-		{ 7, 6, 3 },
-		{ 6, 5, 4 },
-		{ 7, 6, 3 },
-		{ 6, 5, 4 },
-		{ 7, 6, 3 }
-	};
-	
-	double[][] arrMatrix = 
-	{ 
-		{ 1, 2, 3, 4, 5, 6},
-		{ 2, 3, 4, 5, 6, 7}
-	};
-	
-	DoubleMatrix2D x = new DenseDoubleMatrix2D(data);
-	DoubleMatrix2D matrix = f.make(arrMatrix);
-	
-	DoubleMatrix2D res = matrix.zMult(x,null);
+  double[][] data = 
+  { 
+    { 6, 5, 4 },
+    { 7, 6, 3 },
+    { 6, 5, 4 },
+    { 7, 6, 3 },
+    { 6, 5, 4 },
+    { 7, 6, 3 }
+  };
+  
+  double[][] arrMatrix = 
+  { 
+    { 1, 2, 3, 4, 5, 6},
+    { 2, 3, 4, 5, 6, 7}
+  };
+  
+  DoubleMatrix2D x = new DenseDoubleMatrix2D(data);
+  DoubleMatrix2D matrix = f.make(arrMatrix);
+  
+  DoubleMatrix2D res = matrix.zMult(x,null);
 
-	System.out.println(res);
+  System.out.println(res);
 }
 /**
  */
@@ -1138,19 +1136,19 @@
 /**
  */
 public static void doubleTest30() {
-	double[][] data = 
-	{ 
-		{ 6, 5 },
-		{ 7, 6 },
-	};
-	
-	double[] x = { 1, 2 };
-	double[] y = { 3, 4 };
+  double[][] data = 
+  { 
+    { 6, 5 },
+    { 7, 6 },
+  };
+  
+  double[] x = { 1, 2 };
+  double[] y = { 3, 4 };
 
-	DoubleMatrix2D A = new DenseDoubleMatrix2D(data);
-	SeqBlas.seqBlas.dger(1,new DenseDoubleMatrix1D(x), new DenseDoubleMatrix1D(y), A);
+  DoubleMatrix2D A = new DenseDoubleMatrix2D(data);
+  SeqBlas.seqBlas.dger(1,new DenseDoubleMatrix1D(x), new DenseDoubleMatrix1D(y), A);
 
-	System.out.println(A);
+  System.out.println(A);
 }
 /**
  */
@@ -1162,9 +1160,9 @@
 int sum=0;
 org.apache.mahout.matrix.Timer timer = new org.apache.mahout.matrix.Timer().start();
 for (int i=size; --i>=0; ) {
-	int k = list.binarySearchFromTo(val,0,values.length-1);
-	System.out.println(list+", "+val+" --> "+k);
-	sum+=k;
+  int k = list.binarySearchFromTo(val,0,values.length-1);
+  System.out.println(list+", "+val+" --> "+k);
+  sum+=k;
 }
 timer.stop().display();
 //System.out.println("sum = "+sum);
@@ -1177,11 +1175,11 @@
 DoubleMatrix2D A;
 DoubleFactory2D factory;
 if (dense) 
-	factory = Factory2D.dense;
+  factory = Factory2D.dense;
 else 
-	factory = Factory2D.sparse;
-	
-double value = 0.5;	
+  factory = Factory2D.sparse;
+  
+double value = 0.5;  
 
 DoubleMatrix2D C = Factory2D.dense.sample(size,size,value,0.01);
 
@@ -1193,9 +1191,9 @@
 timer.reset().start();
 double sum=0;
 for (int i=0; i<size; i++) {
-	for (int j=0; j<size; j++ ) {
-		sum+=A.getQuick(i,j);
-	}
+  for (int j=0; j<size; j++ ) {
+    sum+=A.getQuick(i,j);
+  }
 }
 timer.stop().display();
 System.out.println(sum);
@@ -1204,11 +1202,11 @@
 JSci.maths.DoubleSparseMatrix B = new JSci.maths.DoubleSparseMatrix(size);
 timer.reset().start();
 for (int i=size; --i>=0; ) {
-	for (int j=size; --j>=0; ) {
+  for (int j=size; --j>=0; ) {
 //for (int i=0; i<size; i++) {
-//	for (int j=0; j<size; j++ ) {
-		B.setElement2(i,j,C.getQuick(i,j));
-	}
+//  for (int j=0; j<size; j++ ) {
+    B.setElement2(i,j,C.getQuick(i,j));
+  }
 }
 //System.out.println(A);
 timer.stop().display();
@@ -1216,9 +1214,9 @@
 timer.reset().start();
 sum=0;
 for (int i=0; i<size; i++) {
-	for (int j=0; j<size; j++ ) {
-		sum+=B.getElement2(i,j);
-	}
+  for (int j=0; j<size; j++ ) {
+    sum+=B.getElement2(i,j);
+  }
 }
 System.out.println(sum);
 timer.stop().display();
@@ -1238,10 +1236,10 @@
 int sum=0;
 org.apache.mahout.matrix.Timer timer = new org.apache.mahout.matrix.Timer().start();
 for (int i=size; --i>=0; ) {
-	int k = org.apache.mahout.matrix.Sorting.binarySearchFromTo(values,val,0,l);
-	//int k = list.binarySearchFromTo(val,0,l);
-	//System.out.println(list+", "+val+" --> i="+k+", -i-1="+(-k-1));
-	sum+=k;
+  int k = org.apache.mahout.matrix.Sorting.binarySearchFromTo(values,val,0,l);
+  //int k = list.binarySearchFromTo(val,0,l);
+  //System.out.println(list+", "+val+" --> i="+k+", -i-1="+(-k-1));
+  sum+=k;
 }
 timer.stop().display();
 System.out.println("sum = "+sum);
@@ -1254,11 +1252,11 @@
 DoubleMatrix2D A;
 DoubleFactory2D factory;
 if (dense) 
-	factory = Factory2D.dense;
+  factory = Factory2D.dense;
 else 
-	factory = Factory2D.sparse;
-	
-double value = 0.5;	
+  factory = Factory2D.sparse;
+  
+double value = 0.5;  
 
 DoubleMatrix2D C = Factory2D.dense.sample(size,size,value,0.01);
 
@@ -1270,9 +1268,9 @@
 timer.reset().start();
 double sum=0;
 for (int i=0; i<size; i++) {
-	for (int j=0; j<size; j++ ) {
-		sum+=A.getQuick(i,j);
-	}
+  for (int j=0; j<size; j++ ) {
+    sum+=A.getQuick(i,j);
+  }
 }
 timer.stop().display();
 System.out.println(sum);
@@ -1281,11 +1279,11 @@
 JSci.maths.DoubleSparseMatrix B = new JSci.maths.DoubleSparseMatrix(size);
 timer.reset().start();
 for (int i=size; --i>=0; ) {
-	for (int j=size; --j>=0; ) {
+  for (int j=size; --j>=0; ) {
 //for (int i=0; i<size; i++) {
-//	for (int j=0; j<size; j++ ) {
-		B.setElement2(i,j,C.getQuick(i,j));
-	}
+//  for (int j=0; j<size; j++ ) {
+    B.setElement2(i,j,C.getQuick(i,j));
+  }
 }
 //System.out.println(A);
 timer.stop().display();
@@ -1293,9 +1291,9 @@
 timer.reset().start();
 sum=0;
 for (int i=0; i<size; i++) {
-	for (int j=0; j<size; j++ ) {
-		sum+=B.getElement2(i,j);
-	}
+  for (int j=0; j<size; j++ ) {
+    sum+=B.getElement2(i,j);
+  }
 }
 System.out.println(sum);
 timer.stop().display();
@@ -1328,154 +1326,152 @@
 /**
  */
 public static void doubleTest32() {
-	double[][] data = 
-	{ 
-		{ 1, 4, 0 },
-		{ 6, 2, 5 },
-		{ 0, 7, 3 },
-		{ 0, 0, 8 },
-		{ 0, 0, 0 },
-		{ 0, 0, 0 }
-	};
-	
-	DoubleMatrix2D x = new TridiagonalDoubleMatrix2D(data);
-	
+  double[][] data = 
+  { 
+    { 1, 4, 0 },
+    { 6, 2, 5 },
+    { 0, 7, 3 },
+    { 0, 0, 8 },
+    { 0, 0, 0 },
+    { 0, 0, 0 }
+  };
+  
+  DoubleMatrix2D x = new TridiagonalDoubleMatrix2D(data);
+  
 
-	System.out.println("\n\n\n"+x);
-	System.out.println("\n"+new DenseDoubleMatrix2D(data));
+  System.out.println("\n\n\n"+x);
+  System.out.println("\n"+new DenseDoubleMatrix2D(data));
 }
 /**
  */
 public static void doubleTest33() {
-	double nan = Double.NaN;
-	double inf = Double.POSITIVE_INFINITY;
-	double ninf = Double.NEGATIVE_INFINITY;
-	
-	double[][] data =
-	{{ ninf, nan}};
-	/*
-	{ 
-		{ 1, 4, 0 },
-		{ 6, 2, 5 },
-		{ 0, 7, 3 },
-		{ 0, 0, 8 },
-		{ 0, 0, 0 },
-		{ 0, 0, 0 }
-	};
-	*/
-	
-	DoubleMatrix2D x = new DenseDoubleMatrix2D(data);
+  double nan = Double.NaN;
+  double inf = Double.POSITIVE_INFINITY;
+  double ninf = Double.NEGATIVE_INFINITY;
+  
+  double[][] data =
+  {{ ninf, nan}};
+  /*
+  { 
+    { 1, 4, 0 },
+    { 6, 2, 5 },
+    { 0, 7, 3 },
+    { 0, 0, 8 },
+    { 0, 0, 0 },
+    { 0, 0, 0 }
+  };
+  */
+  
+  DoubleMatrix2D x = new DenseDoubleMatrix2D(data);
 
-	System.out.println("\n\n\n"+x);
-	System.out.println("\n"+ x.equals(ninf));
+  System.out.println("\n\n\n"+x);
+  System.out.println("\n"+ x.equals(ninf));
 }
 /**
  */
 public static void doubleTest34() {
-	double[][] data = 
-	{ 
-		{ 3, 0, 0, 0 },
-		{ 0, 4, 2, 0 },
-		{ 0, 0, 0, 0 },
-		{ 0, 0, 0, 0 },
-	};
-	
-	DoubleMatrix2D A = new DenseDoubleMatrix2D(data);
-	Property.DEFAULT.generateNonSingular(A);
-	DoubleMatrix2D inv = Algebra.DEFAULT.inverse(A);
+  double[][] data = 
+  { 
+    { 3, 0, 0, 0 },
+    { 0, 4, 2, 0 },
+    { 0, 0, 0, 0 },
+    { 0, 0, 0, 0 },
+  };
+  
+  DoubleMatrix2D A = new DenseDoubleMatrix2D(data);
+  Property.DEFAULT.generateNonSingular(A);
+  DoubleMatrix2D inv = Algebra.DEFAULT.inverse(A);
 
 
-	System.out.println("\n\n\n"+A);
-	System.out.println("\n"+inv);
-	DoubleMatrix2D B = A.zMult(inv,null);
-	System.out.println(B);
-	if (!(B.equals(DoubleFactory2D.dense.identity(A.rows)))) {
-		throw new InternalError();
-	}
+  System.out.println("\n\n\n"+A);
+  System.out.println("\n"+inv);
+  DoubleMatrix2D B = A.zMult(inv,null);
+  System.out.println(B);
+  if (!(B.equals(DoubleFactory2D.dense.identity(A.rows)))) {
+    throw new InternalError();
+  }
 }
 /**
  * Title:        Aero3D<p>
  * Description:  A Program to analyse aeroelestic evects in transonic wings<p>
  * Copyright:    Copyright (c) 1998<p>
  * Company:      PIERSOL Engineering Inc.<p>
- * @author John R. Piersol
  * @version
  */
 public static void doubleTest35() {
-	/*
-	final int DOF = 200;
-	final org.apache.mahout.jet.random.engine.MersenneTwister RANDOM = new org.apache.mahout.jet.random.engine.MersenneTwister();
-	final Algebra ALGEBRA = new Algebra();
-	
-	System.out.println("\n\n\nStarting...");
-	double[][] k = randomMatrix(DOF, RANDOM);
-	DoubleMatrix2D kd = new DenseDoubleMatrix2D(k);
-	Jama.Matrix km = new Jama.Matrix(k);
+  /*
+  final int DOF = 200;
+  final org.apache.mahout.jet.random.engine.MersenneTwister RANDOM = new org.apache.mahout.jet.random.engine.MersenneTwister();
+  final Algebra ALGEBRA = new Algebra();
+  
+  System.out.println("\n\n\nStarting...");
+  double[][] k = randomMatrix(DOF, RANDOM);
+  DoubleMatrix2D kd = new DenseDoubleMatrix2D(k);
+  Jama.Matrix km = new Jama.Matrix(k);
 
 
-	
+  
 
 
-	DoubleMatrix2D coltL = new LUDecomposition(kd).getL();
-	DoubleMatrix2D coltU = new LUDecomposition(kd).getU();
-	Jama.Matrix jamaL = new Jama.LUDecomposition(km).getL();
-	Jama.Matrix jamaU = new Jama.LUDecomposition(km).getU();
+  DoubleMatrix2D coltL = new LUDecomposition(kd).getL();
+  DoubleMatrix2D coltU = new LUDecomposition(kd).getU();
+  Jama.Matrix jamaL = new Jama.LUDecomposition(km).getL();
+  Jama.Matrix jamaU = new Jama.LUDecomposition(km).getU();
 
-	System.out.println(coltL.equals(kd.like().assign(jamaL.getArrayCopy())));
-	System.out.println(coltL.aggregate(F.plus,F.abs));
-	double s = 0;
-	double[] temp2 = jamaL.getColumnPackedCopy();
-	for (int i = 0, n = temp2.length; i < n; ++i) s += Math.abs(temp2[i]);
-	System.out.println(s);
+  System.out.println(coltL.equals(kd.like().assign(jamaL.getArrayCopy())));
+  System.out.println(coltL.aggregate(F.plus,F.abs));
+  double s = 0;
+  double[] temp2 = jamaL.getColumnPackedCopy();
+  for (int i = 0, n = temp2.length; i < n; ++i) s += Math.abs(temp2[i]);
+  System.out.println(s);
 
-	System.out.println(coltU.equals(kd.like().assign(jamaU.getArrayCopy())));
-	System.out.println(coltU.aggregate(F.plus,F.abs));
-	s = 0;
-	temp2 = jamaU.getColumnPackedCopy();
-	for (int i = 0, n = temp2.length; i < n; ++i) s += Math.abs(temp2[i]);
-	System.out.println(s);
+  System.out.println(coltU.equals(kd.like().assign(jamaU.getArrayCopy())));
+  System.out.println(coltU.aggregate(F.plus,F.abs));
+  s = 0;
+  temp2 = jamaU.getColumnPackedCopy();
+  for (int i = 0, n = temp2.length; i < n; ++i) s += Math.abs(temp2[i]);
+  System.out.println(s);
 
-	//System.out.println("colt="+new LUDecomposition(kd).toString());
-	//System.out.println("jama="+new Jama.LUDecomposition(km).toString());
+  //System.out.println("colt="+new LUDecomposition(kd).toString());
+  //System.out.println("jama="+new Jama.LUDecomposition(km).toString());
 
 
 
-	Jama.Matrix kmi = km.inverse();
+  Jama.Matrix kmi = km.inverse();
 
-	DoubleMatrix2D kdi = Algebra.DEFAULT.inverse(kd);
-	DoubleMatrix2D checkColt = Algebra.DEFAULT.mult(kd, kdi);
-	System.out.println("Colt checksum = " + checkColt.aggregate(F.plus,F.abs) + ", correct = " + DOF);
+  DoubleMatrix2D kdi = Algebra.DEFAULT.inverse(kd);
+  DoubleMatrix2D checkColt = Algebra.DEFAULT.mult(kd, kdi);
+  System.out.println("Colt checksum = " + checkColt.aggregate(F.plus,F.abs) + ", correct = " + DOF);
 
-	Jama.Matrix checkJama = kmi.times(km);
-	double checksum = 0;
-	double[] temp = checkJama.getColumnPackedCopy();
-	for (int i = 0, n = temp.length; i < n; ++i) checksum += Math.abs(temp[i]);
-	System.out.println("Jama checksum = " + checksum + ", correct = " + DOF);
+  Jama.Matrix checkJama = kmi.times(km);
+  double checksum = 0;
+  double[] temp = checkJama.getColumnPackedCopy();
+  for (int i = 0, n = temp.length; i < n; ++i) checksum += Math.abs(temp[i]);
+  System.out.println("Jama checksum = " + checksum + ", correct = " + DOF);
 
-	System.out.println("done\n");
-	*/
+  System.out.println("done\n");
+  */
 }
 /**
  * Title:        Aero3D<p>
  * Description:  A Program to analyse aeroelestic evects in transonic wings<p>
  * Copyright:    Copyright (c) 1998<p>
  * Company:      PIERSOL Engineering Inc.<p>
- * @author John R. Piersol
  * @version
  */
 public static void doubleTest36() {
-	double[] testSort = new double[5];
-	testSort[0] = 5;
-	testSort[1] = Double.NaN;
-	testSort[2] = 2;
-	testSort[3] = Double.NaN;
-	testSort[4] = 1;
-	DoubleMatrix1D doubleDense = new DenseDoubleMatrix1D(testSort);
-	System.out.println("orig = "+doubleDense);
-	doubleDense = doubleDense.viewSorted();
-	doubleDense.toArray(testSort);
-	System.out.println("sort = "+doubleDense);
-	System.out.println("done\n");
+  double[] testSort = new double[5];
+  testSort[0] = 5;
+  testSort[1] = Double.NaN;
+  testSort[2] = 2;
+  testSort[3] = Double.NaN;
+  testSort[4] = 1;
+  DoubleMatrix1D doubleDense = new DenseDoubleMatrix1D(testSort);
+  System.out.println("orig = "+doubleDense);
+  doubleDense = doubleDense.viewSorted();
+  doubleDense.toArray(testSort);
+  System.out.println("sort = "+doubleDense);
+  System.out.println("done\n");
 }
 /**
  */
@@ -1509,7 +1505,7 @@
 /**
  */
 public static void doubleTest5() {
-	/*
+  /*
 int rows = 4;
 int columns = 5; // make a 4*5 matrix
 DoubleMatrix2D master = new DenseDoubleMatrix2D(rows,columns);
@@ -1518,10 +1514,10 @@
 DoubleMatrix2D view = master.viewPart(2,0,2,3);
 view.assign(0);
 for (int i=0; i<rows; i++) {
-	for (int j=0; j<columns; j++) {
-		boolean hasIndex = view.hasIndex(master.index(i,j));
-		System.out.println("("+i+","+j+"):"+hasIndex);
-	}
+  for (int j=0; j<columns; j++) {
+    boolean hasIndex = view.hasIndex(master.index(i,j));
+    System.out.println("("+i+","+j+"):"+hasIndex);
+  }
 }
 System.out.println("\n"+master);
 System.out.println("\n"+view);
@@ -1641,93 +1637,93 @@
 }
 public static void doubleTestQR() {
 // test case0...
-	double x0[] = { -6.221564, -9.002113, 2.678001, 6.483597, -7.934148 };
-	double y0[] = { -7.291898, -7.346928, 0.520158, 5.012548, -8.223725 };
-	double x1[] = { 1.185925, -2.523077, 0.135380 , 0.412556, -2.980280 };
-	double y1[] = {13.561087, -15.204410, 16.496829, 16.470860, 0.822198};
+  double x0[] = { -6.221564, -9.002113, 2.678001, 6.483597, -7.934148 };
+  double y0[] = { -7.291898, -7.346928, 0.520158, 5.012548, -8.223725 };
+  double x1[] = { 1.185925, -2.523077, 0.135380 , 0.412556, -2.980280 };
+  double y1[] = {13.561087, -15.204410, 16.496829, 16.470860, 0.822198};
 
-	solve(x1.length, x1, y1);
-	solve(x0.length, x0, y0);
+  solve(x1.length, x1, y1);
+  solve(x0.length, x0, y0);
 }   
 /**
  */
 public static void main(String[] args) {
-	int runs = Integer.parseInt(args[0]);
-	int val = Integer.parseInt(args[1]);
-	doubleTest30(runs, val);
-	/*
-	int runs = Integer.parseInt(args[0]);
-	int size = Integer.parseInt(args[1]);
-	double nonZeroFraction = new Double(args[2]).doubleValue();
-	boolean dense = args[3].equals("dense");
-	//doubleTest23(runs, size, nonZeroFraction, dense);
-	doubleTest24(runs, size, dense);
-	*/
+  int runs = Integer.parseInt(args[0]);
+  int val = Integer.parseInt(args[1]);
+  doubleTest30(runs, val);
+  /*
+  int runs = Integer.parseInt(args[0]);
+  int size = Integer.parseInt(args[1]);
+  double nonZeroFraction = new Double(args[2]).doubleValue();
+  boolean dense = args[3].equals("dense");
+  //doubleTest23(runs, size, nonZeroFraction, dense);
+  doubleTest24(runs, size, dense);
+  */
 }
 public static double[][] randomMatrix(int dof, org.apache.mahout.jet.random.engine.MersenneTwister RANDOM) {
-	double[][] m = new double[dof][dof];
-	/*
-	for (int i = 0; i < dof; ++i) {
-		for (int j = i - 1, n = i + 1; j <= n; ++j) {
-			if (j < dof && j > -1)
-				m[i][j] = RANDOM.nextDouble();
-		}
-	}
-	*/
-	for (int i = 0; i < dof; ++i) {
-		for (int j = 0; j < dof; j++) {
-			m[i][j] = 5;
-		}
-	}
-	//        for (int i = 0; i < dof; ++i)
-	//            for (int j = 0; j < dof; ++j) m[i][j] = RANDOM.nextDouble();
-	return m;
+  double[][] m = new double[dof][dof];
+  /*
+  for (int i = 0; i < dof; ++i) {
+    for (int j = i - 1, n = i + 1; j <= n; ++j) {
+      if (j < dof && j > -1)
+        m[i][j] = RANDOM.nextDouble();
+    }
+  }
+  */
+  for (int i = 0; i < dof; ++i) {
+    for (int j = 0; j < dof; j++) {
+      m[i][j] = 5;
+    }
+  }
+  //        for (int i = 0; i < dof; ++i)
+  //            for (int j = 0; j < dof; ++j) m[i][j] = RANDOM.nextDouble();
+  return m;
 }
 public static void solve(int numpnt, double x[], double y[]) {
-	/*
-	// create the matrix object
-	DoubleMatrix2D A = new DenseDoubleMatrix2D(numpnt, 5);
-	DoubleMatrix2D B = new DenseDoubleMatrix2D(numpnt, 1);
-	//fillout the matrix
-	for (int i = 0; i < numpnt; i++) {
-		A.setQuick(i, 0, x[i] * y[i]);
-		A.setQuick(i, 1, y[i] * y[i]);
-		A.setQuick(i, 2, x[i]);
-		A.setQuick(i, 3, y[i]);
-		A.setQuick(i, 4, 1.0);
-		B.setQuick(i, 0, -x[i] * x[i]);
-	}
-	System.out.println(A);
-	//test the matrix condition
-	SingularValueDecomposition svd = new SingularValueDecomposition(A);
-	System.out.println(svd);
-	// Using Algebra to solve the equation
-	Algebra alg = new Algebra();
-	DoubleMatrix2D resAlg = alg.solve(A.copy(), B.copy());
-	System.out.println("Using Algebra...");
-	System.out.println(resAlg);
-	// Using QRDecomposition to solve the problem..
-	QRDecomposition qrd = new QRDecomposition(A);
-	DoubleMatrix2D resQRD = qrd.solve(B);
-	System.out.println("Using QRDecomposition...");
-	System.out.println(resQRD);
-	// Using Jama.QRDecomposition to solve the problem..
-	Jama.QRDecomposition qrdJama = new Jama.QRDecomposition(new Jama.Matrix(A.toArray()));
-	resQRD = new DenseDoubleMatrix2D(qrdJama.solve(new Jama.Matrix(B.toArray())).getArrayCopy());
-	System.out.println("Using Jama.QRDecomposition...");
-	System.out.println(resQRD);
-	*/
+  /*
+  // create the matrix object
+  DoubleMatrix2D A = new DenseDoubleMatrix2D(numpnt, 5);
+  DoubleMatrix2D B = new DenseDoubleMatrix2D(numpnt, 1);
+  //fillout the matrix
+  for (int i = 0; i < numpnt; i++) {
+    A.setQuick(i, 0, x[i] * y[i]);
+    A.setQuick(i, 1, y[i] * y[i]);
+    A.setQuick(i, 2, x[i]);
+    A.setQuick(i, 3, y[i]);
+    A.setQuick(i, 4, 1.0);
+    B.setQuick(i, 0, -x[i] * x[i]);
+  }
+  System.out.println(A);
+  //test the matrix condition
+  SingularValueDecomposition svd = new SingularValueDecomposition(A);
+  System.out.println(svd);
+  // Using Algebra to solve the equation
+  Algebra alg = new Algebra();
+  DoubleMatrix2D resAlg = alg.solve(A.copy(), B.copy());
+  System.out.println("Using Algebra...");
+  System.out.println(resAlg);
+  // Using QRDecomposition to solve the problem..
+  QRDecomposition qrd = new QRDecomposition(A);
+  DoubleMatrix2D resQRD = qrd.solve(B);
+  System.out.println("Using QRDecomposition...");
+  System.out.println(resQRD);
+  // Using Jama.QRDecomposition to solve the problem..
+  Jama.QRDecomposition qrdJama = new Jama.QRDecomposition(new Jama.Matrix(A.toArray()));
+  resQRD = new DenseDoubleMatrix2D(qrdJama.solve(new Jama.Matrix(B.toArray())).getArrayCopy());
+  System.out.println("Using Jama.QRDecomposition...");
+  System.out.println(resQRD);
+  */
 }
 /**
  */
 public static void testLU() {
 double[][] vals = {
-	{-0.074683,  0.321248,-0.014656, 0.286586,0},
-	{-0.344852, -0.16278 , 0.173711, 0.00064 ,0},
-	{-0.181924, -0.092926, 0.184153, 0.177966,1},
-	{-0.166829, -0.10321 , 0.582301, 0.142583,0},
-	{ 0       , -0.112952,-0.04932 ,-0.700157,0},
-	{ 0       , 0        ,0        ,0        ,0}
+  {-0.074683,  0.321248,-0.014656, 0.286586,0},
+  {-0.344852, -0.16278 , 0.173711, 0.00064 ,0},
+  {-0.181924, -0.092926, 0.184153, 0.177966,1},
+  {-0.166829, -0.10321 , 0.582301, 0.142583,0},
+  { 0       , -0.112952,-0.04932 ,-0.700157,0},
+  { 0       , 0        ,0        ,0        ,0}
 };
  
 DoubleMatrix2D H = new DenseDoubleMatrix2D( vals ); // see values below...
@@ -1737,27 +1733,27 @@
 Hplus.assign(org.apache.mahout.jet.math.Functions.round(1.0E-10));
 System.out.println("\nHplus="+Hplus);
 
-		/*
+    /*
 DoubleMatrix2D HtH = new DenseDoubleMatrix2D( 5, 5 );
 DoubleMatrix2D Hplus = new DenseDoubleMatrix2D( 5, 6 );
 LUDecompositionQuick LUD = new LUDecompositionQuick();
-		//H.zMult( H, HtH, 1, 0, true, false );
-		//DoubleMatrix2D res = Algebra.DEFAULT.inverse(HtH).zMult(H,null,1,0,false,true);
-		LUD.decompose( HtH );
-		// first fill Hplus with the transpose of H...
-		for (int i = 0; i < 6; i++ ) {
-			for ( int j = 0; j < 5; j++ ) {
-				Hplus.set( j, i, H.get( i, j ) );
-			}
-		}
-		LUD.solve( Hplus );
+    //H.zMult( H, HtH, 1, 0, true, false );
+    //DoubleMatrix2D res = Algebra.DEFAULT.inverse(HtH).zMult(H,null,1,0,false,true);
+    LUD.decompose( HtH );
+    // first fill Hplus with the transpose of H...
+    for (int i = 0; i < 6; i++ ) {
+      for ( int j = 0; j < 5; j++ ) {
+        Hplus.set( j, i, H.get( i, j ) );
+      }
+    }
+    LUD.solve( Hplus );
 
-		DoubleMatrix2D perm = Algebra.DEFAULT.permute(Hplus, null,LUD.getPivot());
-		DoubleMatrix2D inv = Algebra.DEFAULT.inverse(HtH);//.zMult(H,null,1,0,false,true);
-		*/
+    DoubleMatrix2D perm = Algebra.DEFAULT.permute(Hplus, null,LUD.getPivot());
+    DoubleMatrix2D inv = Algebra.DEFAULT.inverse(HtH);//.zMult(H,null,1,0,false,true);
+    */
 
-		// in matlab...
-		// Hplus = inv(H' * H) * H'
+    // in matlab...
+    // Hplus = inv(H' * H) * H'
 
 //System.out.println("\nLU="+LUD);
 //System.out.println("\nHplus="+Hplus);
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/Benchmark.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/Benchmark.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/Benchmark.java	(working copy)
@@ -21,178 +21,178 @@
  * Makes this class non instantiable, but still let's others inherit from it.
  */
 protected Benchmark() {
-	throw new RuntimeException("Non instantiable");
+  throw new RuntimeException("Non instantiable");
 }
 /**
  * Runs a bench on matrices holding double elements.
  */
 public static void benchmark(int runs, int size, String kind, boolean print, int initialCapacity, double minLoadFactor, double maxLoadFactor, double percentNonZero) {
-	// certain loops need to be constructed so that the jitter can't optimize them away and we get fantastic numbers.
-	// this involves primarly read-loops
+  // certain loops need to be constructed so that the jitter can't optimize them away and we get fantastic numbers.
+  // this involves primarly read-loops
 
-	org.apache.mahout.matrix.Timer timer1 = new org.apache.mahout.matrix.Timer();
-	org.apache.mahout.matrix.Timer timer2 = new org.apache.mahout.matrix.Timer();
-	org.apache.mahout.matrix.Timer timer3 = new org.apache.mahout.matrix.Timer();
-	org.apache.mahout.matrix.Timer timer4 = new org.apache.mahout.matrix.Timer();
-	org.apache.mahout.matrix.Timer timer5 = new org.apache.mahout.matrix.Timer();
-	org.apache.mahout.matrix.Timer timer6 = new org.apache.mahout.matrix.Timer();
+  org.apache.mahout.matrix.Timer timer1 = new org.apache.mahout.matrix.Timer();
+  org.apache.mahout.matrix.Timer timer2 = new org.apache.mahout.matrix.Timer();
+  org.apache.mahout.matrix.Timer timer3 = new org.apache.mahout.matrix.Timer();
+  org.apache.mahout.matrix.Timer timer4 = new org.apache.mahout.matrix.Timer();
+  org.apache.mahout.matrix.Timer timer5 = new org.apache.mahout.matrix.Timer();
+  org.apache.mahout.matrix.Timer timer6 = new org.apache.mahout.matrix.Timer();
 
-	DoubleMatrix2D  matrix = null;
-	if (kind.equals("sparse")) matrix = new SparseDoubleMatrix2D(size,size,initialCapacity,minLoadFactor,maxLoadFactor);
-	else if (kind.equals("dense")) matrix = org.apache.mahout.matrix.matrix.DoubleFactory2D.dense.make(size,size);
-	//else if (kind.equals("denseArray")) matrix = new DoubleArrayMatrix2D(size,size);
-	else throw new RuntimeException("unknown kind");
-	
-	System.out.println("\nNow initializing...");
-	//Matrix AJ = new Matrix(columnwise,3);
-	//Basic.random(matrix, new org.apache.mahout.jet.random.Uniform(new org.apache.mahout.jet.random.engine.MersenneTwister()));
-	double value = 2;
-	DoubleMatrix2D tmp = DoubleFactory2D.dense.sample(matrix.rows(), matrix.columns(), value, percentNonZero);
-	matrix.assign(tmp);
-	tmp = null;
-	/*
-	long NN = matrix.size();
-	int nn = (int) (NN*percentNonZero);
-	long[] nonZeroIndexes = new long[nn];
-	org.apache.mahout.jet.random.sampling.RandomSampler sampler = new org.apache.mahout.jet.random.sampling.RandomSampler(nn,NN,0,new org.apache.mahout.jet.random.engine.MersenneTwister());
-	sampler.nextBlock(nn,nonZeroIndexes,0);
-	for (int i=nn; --i >=0; ) {
-		int row = (int) (nonZeroIndexes[i]/size);
-		int column = (int) (nonZeroIndexes[i]%size);
-		matrix.set(row,column, value);
-	}
-	*/
+  DoubleMatrix2D  matrix = null;
+  if (kind.equals("sparse")) matrix = new SparseDoubleMatrix2D(size,size,initialCapacity,minLoadFactor,maxLoadFactor);
+  else if (kind.equals("dense")) matrix = org.apache.mahout.matrix.matrix.DoubleFactory2D.dense.make(size,size);
+  //else if (kind.equals("denseArray")) matrix = new DoubleArrayMatrix2D(size,size);
+  else throw new RuntimeException("unknown kind");
+  
+  System.out.println("\nNow initializing...");
+  //Matrix AJ = new Matrix(columnwise,3);
+  //Basic.random(matrix, new org.apache.mahout.jet.random.Uniform(new org.apache.mahout.jet.random.engine.MersenneTwister()));
+  double value = 2;
+  DoubleMatrix2D tmp = DoubleFactory2D.dense.sample(matrix.rows(), matrix.columns(), value, percentNonZero);
+  matrix.assign(tmp);
+  tmp = null;
+  /*
+  long NN = matrix.size();
+  int nn = (int) (NN*percentNonZero);
+  long[] nonZeroIndexes = new long[nn];
+  org.apache.mahout.jet.random.sampling.RandomSampler sampler = new org.apache.mahout.jet.random.sampling.RandomSampler(nn,NN,0,new org.apache.mahout.jet.random.engine.MersenneTwister());
+  sampler.nextBlock(nn,nonZeroIndexes,0);
+  for (int i=nn; --i >=0; ) {
+    int row = (int) (nonZeroIndexes[i]/size);
+    int column = (int) (nonZeroIndexes[i]%size);
+    matrix.set(row,column, value);
+  }
+  */
 
-	/*
-	timer1.start();
-	for (int i=0; i<runs; i++) {
-		LUDecomposition LU = new LUDecomposition(matrix);
-	}
-	timer1.stop();
-	timer1.display();
+  /*
+  timer1.start();
+  for (int i=0; i<runs; i++) {
+    LUDecomposition LU = new LUDecomposition(matrix);
+  }
+  timer1.stop();
+  timer1.display();
 
-	{
-		Jama.Matrix jmatrix = new Jama.Matrix(matrix.toArray());
-		timer2.start();
-		for (int i=0; i<runs; i++) {
-			Jama.LUDecomposition LU = new Jama.LUDecomposition(jmatrix);
-		}
-		timer2.stop();
-		timer2.display();
-	}
-	*/
-	System.out.println("\ntesting...");
-	if (print) System.out.println(matrix);
-	DoubleMatrix2D dense = DoubleFactory2D.dense.make(size,size);
-	dense.assign(matrix);
-	if (! dense.equals(matrix)) throw new InternalError();
-	DoubleMatrix2D ADense = dense.copy();
-	DoubleMatrix2D BDense = dense.copy();
-	DoubleMatrix2D CDense = dense.copy();
-	ADense.zMult(BDense,CDense);
-	System.out.println("\nNext testing...");
-	/*
-	{
-		timer6.start();
-		double a = cubicLoop(runs,size);
-		timer6.stop();
-		timer6.display();
-		System.out.println(a);
-	}
-	*/
-	
+  {
+    Jama.Matrix jmatrix = new Jama.Matrix(matrix.toArray());
+    timer2.start();
+    for (int i=0; i<runs; i++) {
+      Jama.LUDecomposition LU = new Jama.LUDecomposition(jmatrix);
+    }
+    timer2.stop();
+    timer2.display();
+  }
+  */
+  System.out.println("\ntesting...");
+  if (print) System.out.println(matrix);
+  DoubleMatrix2D dense = DoubleFactory2D.dense.make(size,size);
+  dense.assign(matrix);
+  if (! dense.equals(matrix)) throw new InternalError();
+  DoubleMatrix2D ADense = dense.copy();
+  DoubleMatrix2D BDense = dense.copy();
+  DoubleMatrix2D CDense = dense.copy();
+  ADense.zMult(BDense,CDense);
+  System.out.println("\nNext testing...");
+  /*
+  {
+    timer6.start();
+    double a = cubicLoop(runs,size);
+    timer6.stop();
+    timer6.display();
+    System.out.println(a);
+  }
+  */
+  
 
-	{
-		DoubleMatrix2D A = matrix.copy();
-		DoubleMatrix2D B = matrix.copy();
-		//DoubleMatrix2D C = Basic.product(A,B);
-		DoubleMatrix2D C = matrix.copy();
-		A.zMult(B,C);
-		if (! (C.equals(CDense))) throw new InternalError();
-		C.assign(matrix);
-		System.out.println("\nNow benchmarking...");
-		
-		timer3.start();
-		for (int i=0; i<runs; i++) {
-			A.zMult(B,C);
-		}
-		timer3.stop();
-		timer3.display();
-		int m = A.rows();
-		int n = A.columns();
-		int p = B.rows();
-		int reps = runs;
-		double mflops = 1.0e-3*(2.0*m*n*p*reps)/timer3.millis();
-		System.out.println("mflops: "+mflops);
-	}
-	
-	/*
-	{
-		DoubleMatrix2D A = matrix.like().assign(value);
-		DoubleMatrix2D B = matrix.like().assign(value);
-		DoubleMatrix2D C = Basic.product(A,B);
-		timer5.start();
-		for (int i=0; i<runs; i++) {
-			org.apache.mahout.matrix.matrix.Blas.matrixMultiply(A,B,C);
-		}
-		timer5.stop();
-		timer5.display();
-	}
-	*/
-	
+  {
+    DoubleMatrix2D A = matrix.copy();
+    DoubleMatrix2D B = matrix.copy();
+    //DoubleMatrix2D C = Basic.product(A,B);
+    DoubleMatrix2D C = matrix.copy();
+    A.zMult(B,C);
+    if (! (C.equals(CDense))) throw new InternalError();
+    C.assign(matrix);
+    System.out.println("\nNow benchmarking...");
+    
+    timer3.start();
+    for (int i=0; i<runs; i++) {
+      A.zMult(B,C);
+    }
+    timer3.stop();
+    timer3.display();
+    int m = A.rows();
+    int n = A.columns();
+    int p = B.rows();
+    int reps = runs;
+    double mflops = 1.0e-3*(2.0*m*n*p*reps)/timer3.millis();
+    System.out.println("mflops: "+mflops);
+  }
+  
+  /*
+  {
+    DoubleMatrix2D A = matrix.like().assign(value);
+    DoubleMatrix2D B = matrix.like().assign(value);
+    DoubleMatrix2D C = Basic.product(A,B);
+    timer5.start();
+    for (int i=0; i<runs; i++) {
+      org.apache.mahout.matrix.matrix.Blas.matrixMultiply(A,B,C);
+    }
+    timer5.stop();
+    timer5.display();
+  }
+  */
+  
 
 /*
 {
-		Jama.Matrix A = new Jama.Matrix(size,size);
-		Jama.Matrix B = new Jama.Matrix(size,size);
-		Jama.Matrix C;
-		timer4.start();
-		for (int i=0; i<runs; i++) {
-			C = A.times(B);
-		}
-		timer4.stop();
-		timer4.display();
-	}
+    Jama.Matrix A = new Jama.Matrix(size,size);
+    Jama.Matrix B = new Jama.Matrix(size,size);
+    Jama.Matrix C;
+    timer4.start();
+    for (int i=0; i<runs; i++) {
+      C = A.times(B);
+    }
+    timer4.stop();
+    timer4.display();
+  }
 */
 
-	if (print) System.out.println(matrix);
+  if (print) System.out.println(matrix);
 
-	System.out.println("bye bye.");
+  System.out.println("bye bye.");
 }
 /**
  * 
  */
 protected static double cubicLoop(int runs, int size) {
-	double a = 1.123;
-	double b = 1.000000000012345;
-	for (int r=0; r<runs; r++) {
-		for (int i=size; --i >= 0; ) {
-			for (int j=size; --j >= 0; ) {
-				for (int k=size; --k >= 0; ) {
-					a *= b;
-				}
-			}
-		}
-	}
-	return a;
+  double a = 1.123;
+  double b = 1.000000000012345;
+  for (int r=0; r<runs; r++) {
+    for (int i=size; --i >= 0; ) {
+      for (int j=size; --j >= 0; ) {
+        for (int k=size; --k >= 0; ) {
+          a *= b;
+        }
+      }
+    }
+  }
+  return a;
 }
 /**
  * Benchmarks various matrix methods.
  */
 public static void main(String args[]) {
-	int runs = Integer.parseInt(args[0]);
-	int rows = Integer.parseInt(args[1]);
-	int columns = Integer.parseInt(args[2]);
-	//int size = Integer.parseInt(args[3]);
-	//boolean isSparse = args[4].equals("sparse");
-	String kind = args[3];
-	int initialCapacity = Integer.parseInt(args[4]);
-	double minLoadFactor = new Double(args[5]).doubleValue();
-	double maxLoadFactor = new Double(args[6]).doubleValue();
-	boolean print = args[7].equals("print");
-	double initialValue = new Double(args[8]).doubleValue();
-	int size = rows;
-	
-	benchmark(runs,size,kind,print,initialCapacity,minLoadFactor,maxLoadFactor,initialValue);
+  int runs = Integer.parseInt(args[0]);
+  int rows = Integer.parseInt(args[1]);
+  int columns = Integer.parseInt(args[2]);
+  //int size = Integer.parseInt(args[3]);
+  //boolean isSparse = args[4].equals("sparse");
+  String kind = args[3];
+  int initialCapacity = Integer.parseInt(args[4]);
+  double minLoadFactor = new Double(args[5]).doubleValue();
+  double maxLoadFactor = new Double(args[6]).doubleValue();
+  boolean print = args[7].equals("print");
+  double initialValue = new Double(args[8]).doubleValue();
+  int size = rows;
+  
+  benchmark(runs,size,kind,print,initialCapacity,minLoadFactor,maxLoadFactor,initialValue);
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SparseObjectMatrix1D.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SparseObjectMatrix1D.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SparseObjectMatrix1D.java	(working copy)
@@ -53,10 +53,10 @@
  */
 @Deprecated
 public class SparseObjectMatrix1D extends ObjectMatrix1D {
-	/*
-	 * The elements of the matrix.
-	 */
-	protected AbstractIntObjectMap elements; 
+  /*
+   * The elements of the matrix.
+   */
+  protected AbstractIntObjectMap elements; 
 /**
  * Constructs a matrix with a copy of the given values.
  * The values are copied. So subsequent changes in <tt>values</tt> are not reflected in the matrix, and vice-versa.
@@ -64,8 +64,8 @@
  * @param values The values to be filled into the new matrix.
  */
 public SparseObjectMatrix1D(Object[] values) {
-	this(values.length);
-	assign(values);
+  this(values.length);
+  assign(values);
 }
 /**
  * Constructs a matrix with a given number of cells.
@@ -74,7 +74,7 @@
  * @throws IllegalArgumentException if <tt>size<0</tt>.
  */
 public SparseObjectMatrix1D(int size) {
-	this(size,size/1000,0.2,0.5);
+  this(size,size/1000,0.2,0.5);
 }
 /**
  * Constructs a matrix with a given number of parameters.
@@ -86,12 +86,12 @@
  *                          If not known, set <tt>initialCapacity=0</tt> or small.     
  * @param minLoadFactor        the minimum load factor of the hash map.
  * @param maxLoadFactor        the maximum load factor of the hash map.
- * @throws	IllegalArgumentException if <tt>initialCapacity < 0 || (minLoadFactor < 0.0 || minLoadFactor >= 1.0) || (maxLoadFactor <= 0.0 || maxLoadFactor >= 1.0) || (minLoadFactor >= maxLoadFactor)</tt>.
+ * @throws  IllegalArgumentException if <tt>initialCapacity < 0 || (minLoadFactor < 0.0 || minLoadFactor >= 1.0) || (maxLoadFactor <= 0.0 || maxLoadFactor >= 1.0) || (minLoadFactor >= maxLoadFactor)</tt>.
  * @throws IllegalArgumentException if <tt>size<0</tt>.
  */
 public SparseObjectMatrix1D(int size, int initialCapacity, double minLoadFactor, double maxLoadFactor) {
-	setUp(size);
-	this.elements = new OpenIntObjectHashMap(initialCapacity, minLoadFactor, maxLoadFactor);
+  setUp(size);
+  this.elements = new OpenIntObjectHashMap(initialCapacity, minLoadFactor, maxLoadFactor);
 }
 /**
  * Constructs a matrix view with a given number of parameters.
@@ -103,16 +103,16 @@
  * @throws IllegalArgumentException if <tt>size<0</tt>.
  */
 protected SparseObjectMatrix1D(int size, AbstractIntObjectMap elements, int offset, int stride) {
-	setUp(size,offset,stride);
-	this.elements = elements;
-	this.isNoView = false;
+  setUp(size,offset,stride);
+  this.elements = elements;
+  this.isNoView = false;
 }
 /**
  * Returns the number of cells having non-zero values.
  */
 public int cardinality() {
-	if (this.isNoView) return this.elements.size();
-	else return super.cardinality();
+  if (this.isNoView) return this.elements.size();
+  else return super.cardinality();
 }
 /**
  * Ensures that the receiver can hold at least the specified number of non-zero cells without needing to allocate new internal memory.
@@ -125,7 +125,7 @@
  * @param   minNonZeros   the desired minimum number of non-zero cells.
  */
 public void ensureCapacity(int minCapacity) {
-	this.elements.ensureCapacity(minCapacity);
+  this.elements.ensureCapacity(minCapacity);
 }
 /**
  * Returns the matrix cell value at coordinate <tt>index</tt>.
@@ -138,24 +138,24 @@
  * @return    the value of the specified cell.
  */
 public Object getQuick(int index) {
-	//if (debug) if (index<0 || index>=size) checkIndex(index);
-	//return this.elements.get(index(index)); 
-	// manually inlined:
-	return elements.get(zero + index*stride);
+  //if (debug) if (index<0 || index>=size) checkIndex(index);
+  //return this.elements.get(index(index)); 
+  // manually inlined:
+  return elements.get(zero + index*stride);
 }
 /**
  * Returns <tt>true</tt> if both matrices share at least one identical cell.
  */
 protected boolean haveSharedCellsRaw(ObjectMatrix1D other) {
-	if (other instanceof SelectedSparseObjectMatrix1D) {
-		SelectedSparseObjectMatrix1D otherMatrix = (SelectedSparseObjectMatrix1D) other;
-		return this.elements==otherMatrix.elements;
-	}
-	else if (other instanceof SparseObjectMatrix1D) {
-		SparseObjectMatrix1D otherMatrix = (SparseObjectMatrix1D) other;
-		return this.elements==otherMatrix.elements;
-	}
-	return false;
+  if (other instanceof SelectedSparseObjectMatrix1D) {
+    SelectedSparseObjectMatrix1D otherMatrix = (SelectedSparseObjectMatrix1D) other;
+    return this.elements==otherMatrix.elements;
+  }
+  else if (other instanceof SparseObjectMatrix1D) {
+    SparseObjectMatrix1D otherMatrix = (SparseObjectMatrix1D) other;
+    return this.elements==otherMatrix.elements;
+  }
+  return false;
 }
 /**
  * Returns the position of the element with the given relative rank within the (virtual or non-virtual) internal 1-dimensional array.
@@ -164,9 +164,9 @@
  * @param     rank   the rank of the element.
  */
 protected int index(int rank) {
-	// overriden for manual inlining only
-	//return _offset(_rank(rank));
-	return zero + rank*stride;
+  // overriden for manual inlining only
+  //return _offset(_rank(rank));
+  return zero + rank*stride;
 }
 /**
  * Construct and returns a new empty matrix <i>of the same dynamic type</i> as the receiver, having the specified size.
@@ -178,7 +178,7 @@
  * @return  a new empty matrix of the same dynamic type.
  */
 public ObjectMatrix1D like(int size) {
-	return new SparseObjectMatrix1D(size);
+  return new SparseObjectMatrix1D(size);
 }
 /**
  * Construct and returns a new 2-d matrix <i>of the corresponding dynamic type</i>, entirelly independent of the receiver.
@@ -190,7 +190,7 @@
  * @return  a new matrix of the corresponding dynamic type.
  */
 public ObjectMatrix2D like2D(int rows, int columns) {
-	return new SparseObjectMatrix2D(rows,columns);
+  return new SparseObjectMatrix2D(rows,columns);
 }
 /**
  * Sets the matrix cell at coordinate <tt>index</tt> to the specified value.
@@ -203,14 +203,14 @@
  * @param    value the value to be filled into the specified cell.
  */
 public void setQuick(int index, Object value) {
-	//if (debug) if (index<0 || index>=size) checkIndex(index);
-	//int i =	index(index);
-	// manually inlined:
-	int i = zero + index*stride;
-	if (value == null)
-		this.elements.removeKey(i);
-	else 
-		this.elements.put(i, value);
+  //if (debug) if (index<0 || index>=size) checkIndex(index);
+  //int i =  index(index);
+  // manually inlined:
+  int i = zero + index*stride;
+  if (value == null)
+    this.elements.removeKey(i);
+  else 
+    this.elements.put(i, value);
 }
 /**
  * Releases any superfluous memory created by explicitly putting zero values into cells formerly having non-zero values; 
@@ -230,7 +230,7 @@
  * Putting zeros into cells already containing zeros does not generate obsolete memory since no memory was allocated to them in the first place.
  */
 public void trimToSize() {
-	this.elements.trimToSize();
+  this.elements.trimToSize();
 }
 /**
  * Construct and returns a new selection view.
@@ -239,6 +239,6 @@
  * @return  a new view.
  */
 protected ObjectMatrix1D viewSelectionLike(int[] offsets) {
-	return new SelectedSparseObjectMatrix1D(this.elements,offsets);
+  return new SelectedSparseObjectMatrix1D(this.elements,offsets);
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SparseObjectMatrix2D.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SparseObjectMatrix2D.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SparseObjectMatrix2D.java	(working copy)
@@ -50,19 +50,19 @@
 Setting values in a loop row-by-row is quicker than column-by-column, because fewer hash collisions occur.
 Thus
 <pre>
-	for (int row=0; row < rows; row++) {
-		for (int column=0; column < columns; column++) {
-			matrix.setQuick(row,column,someValue);
-		}
-	}
+  for (int row=0; row < rows; row++) {
+    for (int column=0; column < columns; column++) {
+      matrix.setQuick(row,column,someValue);
+    }
+  }
 </pre>
 is quicker than
 <pre>
-	for (int column=0; column < columns; column++) {
-		for (int row=0; row < rows; row++) {
-			matrix.setQuick(row,column,someValue);
-		}
-	}
+  for (int column=0; column < columns; column++) {
+    for (int row=0; row < rows; row++) {
+      matrix.setQuick(row,column,someValue);
+    }
+  }
 </pre>
 
 @see org.apache.mahout.matrix.map
@@ -75,10 +75,10 @@
  */
 @Deprecated
 public class SparseObjectMatrix2D extends ObjectMatrix2D {
-	/*
-	 * The elements of the matrix.
-	 */
-	protected AbstractIntObjectMap elements; 
+  /*
+   * The elements of the matrix.
+   */
+  protected AbstractIntObjectMap elements; 
 /**
  * Constructs a matrix with a copy of the given values.
  * <tt>values</tt> is required to have the form <tt>values[row][column]</tt>
@@ -90,18 +90,18 @@
  * @throws IllegalArgumentException if <tt>for any 1 &lt;= row &lt; values.length: values[row].length != values[row-1].length</tt>.
  */
 public SparseObjectMatrix2D(Object[][] values) {
-	this(values.length, values.length==0 ? 0: values[0].length);
-	assign(values);
+  this(values.length, values.length==0 ? 0: values[0].length);
+  assign(values);
 }
 /**
  * Constructs a matrix with a given number of rows and columns and default memory usage.
  * All entries are initially <tt>null</tt>.
  * @param rows the number of rows the matrix shall have.
  * @param columns the number of columns the matrix shall have.
- * @throws	IllegalArgumentException if <tt>rows<0 || columns<0 || (double)columns*rows > Integer.MAX_VALUE</tt>.
+ * @throws  IllegalArgumentException if <tt>rows<0 || columns<0 || (double)columns*rows > Integer.MAX_VALUE</tt>.
  */
 public SparseObjectMatrix2D(int rows, int columns) {
-	this(rows,columns,rows*(columns/1000),0.2,0.5);
+  this(rows,columns,rows*(columns/1000),0.2,0.5);
 }
 /**
  * Constructs a matrix with a given number of rows and columns using memory as specified.
@@ -114,12 +114,12 @@
  *                          If not known, set <tt>initialCapacity=0</tt> or small.     
  * @param minLoadFactor        the minimum load factor of the hash map.
  * @param maxLoadFactor        the maximum load factor of the hash map.
- * @throws	IllegalArgumentException if <tt>initialCapacity < 0 || (minLoadFactor < 0.0 || minLoadFactor >= 1.0) || (maxLoadFactor <= 0.0 || maxLoadFactor >= 1.0) || (minLoadFactor >= maxLoadFactor)</tt>.
- * @throws	IllegalArgumentException if <tt>rows<0 || columns<0 || (double)columns*rows > Integer.MAX_VALUE</tt>.
+ * @throws  IllegalArgumentException if <tt>initialCapacity < 0 || (minLoadFactor < 0.0 || minLoadFactor >= 1.0) || (maxLoadFactor <= 0.0 || maxLoadFactor >= 1.0) || (minLoadFactor >= maxLoadFactor)</tt>.
+ * @throws  IllegalArgumentException if <tt>rows<0 || columns<0 || (double)columns*rows > Integer.MAX_VALUE</tt>.
  */
 public SparseObjectMatrix2D(int rows, int columns, int initialCapacity, double minLoadFactor, double maxLoadFactor) {
-	setUp(rows,columns); 
-	this.elements = new OpenIntObjectHashMap(initialCapacity, minLoadFactor, maxLoadFactor);
+  setUp(rows,columns); 
+  this.elements = new OpenIntObjectHashMap(initialCapacity, minLoadFactor, maxLoadFactor);
 }
 /**
  * Constructs a view with the given parameters.
@@ -130,19 +130,19 @@
  * @param columnZero the position of the first element.
  * @param rowStride the number of elements between two rows, i.e. <tt>index(i+1,j)-index(i,j)</tt>.
  * @param columnStride the number of elements between two columns, i.e. <tt>index(i,j+1)-index(i,j)</tt>.
- * @throws	IllegalArgumentException if <tt>rows<0 || columns<0 || (double)columns*rows > Integer.MAX_VALUE</tt> or flip's are illegal.
+ * @throws  IllegalArgumentException if <tt>rows<0 || columns<0 || (double)columns*rows > Integer.MAX_VALUE</tt> or flip's are illegal.
  */
 protected SparseObjectMatrix2D(int rows, int columns, AbstractIntObjectMap elements, int rowZero, int columnZero, int rowStride, int columnStride) {
-	setUp(rows,columns,rowZero,columnZero,rowStride,columnStride);
-	this.elements = elements;
-	this.isNoView = false;
+  setUp(rows,columns,rowZero,columnZero,rowStride,columnStride);
+  this.elements = elements;
+  this.isNoView = false;
 }
 /**
  * Returns the number of cells having non-zero values.
  */
 public int cardinality() {
-	if (this.isNoView) return this.elements.size();
-	else return super.cardinality();
+  if (this.isNoView) return this.elements.size();
+  else return super.cardinality();
 }
 /**
  * Ensures that the receiver can hold at least the specified number of non-zero cells without needing to allocate new internal memory.
@@ -155,7 +155,7 @@
  * @param   minNonZeros   the desired minimum number of non-zero cells.
  */
 public void ensureCapacity(int minCapacity) {
-	this.elements.ensureCapacity(minCapacity);
+  this.elements.ensureCapacity(minCapacity);
 }
 /**
  * Returns the matrix cell value at coordinate <tt>[row,column]</tt>.
@@ -169,10 +169,10 @@
  * @return    the value at the specified coordinate.
  */
 public Object getQuick(int row, int column) {
-	//if (debug) if (column<0 || column>=columns || row<0 || row>=rows) throw new IndexOutOfBoundsException("row:"+row+", column:"+column);
-	//return this.elements.get(index(row,column));
-	//manually inlined:
-	return this.elements.get(rowZero + row*rowStride + columnZero + column*columnStride);
+  //if (debug) if (column<0 || column>=columns || row<0 || row>=rows) throw new IndexOutOfBoundsException("row:"+row+", column:"+column);
+  //return this.elements.get(index(row,column));
+  //manually inlined:
+  return this.elements.get(rowZero + row*rowStride + columnZero + column*columnStride);
 }
 /**
  * Returns <tt>true</tt> if both matrices share common cells.
@@ -184,15 +184,15 @@
  * </ul>
  */
 protected boolean haveSharedCellsRaw(ObjectMatrix2D other) {
-	if (other instanceof SelectedSparseObjectMatrix2D) {
-		SelectedSparseObjectMatrix2D otherMatrix = (SelectedSparseObjectMatrix2D) other;
-		return this.elements==otherMatrix.elements;
-	}
-	else if (other instanceof SparseObjectMatrix2D) {
-		SparseObjectMatrix2D otherMatrix = (SparseObjectMatrix2D) other;
-		return this.elements==otherMatrix.elements;
-	}
-	return false;
+  if (other instanceof SelectedSparseObjectMatrix2D) {
+    SelectedSparseObjectMatrix2D otherMatrix = (SelectedSparseObjectMatrix2D) other;
+    return this.elements==otherMatrix.elements;
+  }
+  else if (other instanceof SparseObjectMatrix2D) {
+    SparseObjectMatrix2D otherMatrix = (SparseObjectMatrix2D) other;
+    return this.elements==otherMatrix.elements;
+  }
+  return false;
 }
 /**
  * Returns the position of the given coordinate within the (virtual or non-virtual) internal 1-dimensional array. 
@@ -201,9 +201,9 @@
  * @param     column   the index of the column-coordinate.
  */
 protected int index(int row, int column) {
-	// return super.index(row,column);
-	// manually inlined for speed:
-	return rowZero + row*rowStride + columnZero + column*columnStride;
+  // return super.index(row,column);
+  // manually inlined for speed:
+  return rowZero + row*rowStride + columnZero + column*columnStride;
 }
 /**
  * Construct and returns a new empty matrix <i>of the same dynamic type</i> as the receiver, having the specified number of rows and columns.
@@ -216,7 +216,7 @@
  * @return  a new empty matrix of the same dynamic type.
  */
 public ObjectMatrix2D like(int rows, int columns) {
-	return new SparseObjectMatrix2D(rows, columns);
+  return new SparseObjectMatrix2D(rows, columns);
 }
 /**
  * Construct and returns a new 1-d matrix <i>of the corresponding dynamic type</i>, entirelly independent of the receiver.
@@ -227,7 +227,7 @@
  * @return  a new matrix of the corresponding dynamic type.
  */
 public ObjectMatrix1D like1D(int size) {
-	return new SparseObjectMatrix1D(size);
+  return new SparseObjectMatrix1D(size);
 }
 /**
  * Construct and returns a new 1-d matrix <i>of the corresponding dynamic type</i>, sharing the same cells.
@@ -240,7 +240,7 @@
  * @return  a new matrix of the corresponding dynamic type.
  */
 protected ObjectMatrix1D like1D(int size, int offset, int stride) {
-	return new SparseObjectMatrix1D(size,this.elements,offset,stride);
+  return new SparseObjectMatrix1D(size,this.elements,offset,stride);
 }
 /**
  * Sets the matrix cell at coordinate <tt>[row,column]</tt> to the specified value.
@@ -254,15 +254,15 @@
  * @param    value the value to be filled into the specified cell.
  */
 public void setQuick(int row, int column, Object value) {
-	//if (debug) if (column<0 || column>=columns || row<0 || row>=rows) throw new IndexOutOfBoundsException("row:"+row+", column:"+column);
-	//int index =	index(row,column);
-	//manually inlined:
-	int index = rowZero + row*rowStride + columnZero + column*columnStride;
+  //if (debug) if (column<0 || column>=columns || row<0 || row>=rows) throw new IndexOutOfBoundsException("row:"+row+", column:"+column);
+  //int index =  index(row,column);
+  //manually inlined:
+  int index = rowZero + row*rowStride + columnZero + column*columnStride;
 
-	if (value == null)
-		this.elements.removeKey(index);
-	else 
-		this.elements.put(index, value);
+  if (value == null)
+    this.elements.removeKey(index);
+  else 
+    this.elements.put(index, value);
 }
 /**
  * Releases any superfluous memory created by explicitly putting zero values into cells formerly having non-zero values; 
@@ -282,7 +282,7 @@
  * Putting zeros into cells already containing zeros does not generate obsolete memory since no memory was allocated to them in the first place.
  */
 public void trimToSize() {
-	this.elements.trimToSize();
+  this.elements.trimToSize();
 }
 /**
  * Construct and returns a new selection view.
@@ -292,6 +292,6 @@
  * @return  a new view.
  */
 protected ObjectMatrix2D viewSelectionLike(int[] rowOffsets, int[] columnOffsets) {
-	return new SelectedSparseObjectMatrix2D(this.elements,rowOffsets,columnOffsets,0);
+  return new SelectedSparseObjectMatrix2D(this.elements,rowOffsets,columnOffsets,0);
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/DenseObjectMatrix1D.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/DenseObjectMatrix1D.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/DenseObjectMatrix1D.java	(working copy)
@@ -37,10 +37,10 @@
  */
 @Deprecated
 public class DenseObjectMatrix1D extends ObjectMatrix1D {
-	/**
-	  * The elements of this matrix.
-	  */
-	protected Object[] elements;
+  /**
+    * The elements of this matrix.
+    */
+  protected Object[] elements;
 /**
  * Constructs a matrix with a copy of the given values.
  * The values are copied. So subsequent changes in <tt>values</tt> are not reflected in the matrix, and vice-versa.
@@ -48,8 +48,8 @@
  * @param values The values to be filled into the new matrix.
  */
 public DenseObjectMatrix1D(Object[] values) {
-	this(values.length);
-	assign(values);
+  this(values.length);
+  assign(values);
 }
 /**
  * Constructs a matrix with a given number of cells.
@@ -58,8 +58,8 @@
  * @throws IllegalArgumentException if <tt>size<0</tt>.
  */
 public DenseObjectMatrix1D(int size) {
-	setUp(size);
-	this.elements = new Object[size];
+  setUp(size);
+  this.elements = new Object[size];
 }
 /**
  * Constructs a matrix view with the given parameters.
@@ -70,9 +70,9 @@
  * @throws IllegalArgumentException if <tt>size<0</tt>.
  */
 protected DenseObjectMatrix1D(int size, Object[] elements, int zero, int stride) {
-	setUp(size,zero,stride);
-	this.elements = elements;
-	this.isNoView = false;
+  setUp(size,zero,stride);
+  this.elements = elements;
+  this.isNoView = false;
 }
 /**
  * Sets all cells to the state specified by <tt>values</tt>.
@@ -85,14 +85,14 @@
  * @throws IllegalArgumentException if <tt>values.length != size()</tt>.
  */
 public ObjectMatrix1D assign(Object[] values) {
-	if (isNoView) {
-		if (values.length != size) throw new IllegalArgumentException("Must have same number of cells: length="+values.length+"size()="+size());
-		System.arraycopy(values, 0, this.elements, 0, values.length);
-	}
-	else {
-		super.assign(values);
-	}
-	return this;
+  if (isNoView) {
+    if (values.length != size) throw new IllegalArgumentException("Must have same number of cells: length="+values.length+"size()="+size());
+    System.arraycopy(values, 0, this.elements, 0, values.length);
+  }
+  else {
+    super.assign(values);
+  }
+  return this;
 }
 /**
 Assigns the result of a function to each cell; <tt>x[i] = function(x[i])</tt>.
@@ -113,17 +113,17 @@
 @see org.apache.mahout.jet.math.Functions
 */
 public ObjectMatrix1D assign(org.apache.mahout.matrix.function.ObjectFunction function) {
-	int s=stride;
-	int i=index(0);
-	Object[] elems = this.elements;
-	if (elements==null) throw new InternalError();
+  int s=stride;
+  int i=index(0);
+  Object[] elems = this.elements;
+  if (elements==null) throw new InternalError();
 
-	// the general case x[i] = f(x[i])
-	for (int k=size; --k >= 0; ) {
-		elems[i] = function.apply(elems[i]);
-		i += s;
-	}
-	return this;
+  // the general case x[i] = f(x[i])
+  for (int k=size; --k >= 0; ) {
+    elems[i] = function.apply(elems[i]);
+    i += s;
+  }
+  return this;
 }
 /**
  * Replaces all cell values of the receiver with the values of another matrix.
@@ -132,42 +132,42 @@
  *
  * @param     source   the source matrix to copy from (may be identical to the receiver).
  * @return <tt>this</tt> (for convenience only).
- * @throws	IllegalArgumentException if <tt>size() != other.size()</tt>.
+ * @throws  IllegalArgumentException if <tt>size() != other.size()</tt>.
  */
 public ObjectMatrix1D assign(ObjectMatrix1D source) {
-	// overriden for performance only
-	if (! (source instanceof DenseObjectMatrix1D)) {
-		return super.assign(source);
-	}
-	DenseObjectMatrix1D other = (DenseObjectMatrix1D) source;
-	if (other==this) return this;
-	checkSize(other);
-	if (isNoView && other.isNoView) { // quickest
-		System.arraycopy(other.elements, 0, this.elements, 0, this.elements.length);
-		return this;
-	}
-	if (haveSharedCells(other)) {
-		ObjectMatrix1D c = other.copy();
-		if (! (c instanceof DenseObjectMatrix1D)) { // should not happen
-			return super.assign(source);
-		}
-		other = (DenseObjectMatrix1D) c;
-	}
+  // overriden for performance only
+  if (! (source instanceof DenseObjectMatrix1D)) {
+    return super.assign(source);
+  }
+  DenseObjectMatrix1D other = (DenseObjectMatrix1D) source;
+  if (other==this) return this;
+  checkSize(other);
+  if (isNoView && other.isNoView) { // quickest
+    System.arraycopy(other.elements, 0, this.elements, 0, this.elements.length);
+    return this;
+  }
+  if (haveSharedCells(other)) {
+    ObjectMatrix1D c = other.copy();
+    if (! (c instanceof DenseObjectMatrix1D)) { // should not happen
+      return super.assign(source);
+    }
+    other = (DenseObjectMatrix1D) c;
+  }
 
-	final Object[] elems = this.elements;
-	final Object[] otherElems = other.elements;
-	if (elements==null || otherElems==null) throw new InternalError();
-	int s = this.stride;
-	int ys = other.stride;
+  final Object[] elems = this.elements;
+  final Object[] otherElems = other.elements;
+  if (elements==null || otherElems==null) throw new InternalError();
+  int s = this.stride;
+  int ys = other.stride;
 
-	int index = index(0);
-	int otherIndex = other.index(0);
-	for (int k=size; --k >= 0; ) {
-		elems[index] = otherElems[otherIndex];
-		index += s;
-		otherIndex += ys;
-	}
-	return this;
+  int index = index(0);
+  int otherIndex = other.index(0);
+  for (int k=size; --k >= 0; ) {
+    elems[index] = otherElems[otherIndex];
+    index += s;
+    otherIndex += ys;
+  }
+  return this;
 }
 /**
 Assigns the result of a function to each cell; <tt>x[i] = function(x[i],y[i])</tt>.
@@ -195,32 +195,32 @@
 @param function a function object taking as first argument the current cell's value of <tt>this</tt>,
 and as second argument the current cell's value of <tt>y</tt>,
 @return <tt>this</tt> (for convenience only).
-@throws	IllegalArgumentException if <tt>size() != y.size()</tt>.
+@throws  IllegalArgumentException if <tt>size() != y.size()</tt>.
 @see org.apache.mahout.jet.math.Functions
 */
 public ObjectMatrix1D assign(ObjectMatrix1D y, org.apache.mahout.matrix.function.ObjectObjectFunction function) {
-	// overriden for performance only
-	if (! (y instanceof DenseObjectMatrix1D)) {
-		return super.assign(y,function);
-	}
-	DenseObjectMatrix1D other = (DenseObjectMatrix1D) y;
-	checkSize(y);
-	final Object[] elems = this.elements;
-	final Object[] otherElems = other.elements;
-	if (elements==null || otherElems==null) throw new InternalError();
-	int s = this.stride;
-	int ys = other.stride;
+  // overriden for performance only
+  if (! (y instanceof DenseObjectMatrix1D)) {
+    return super.assign(y,function);
+  }
+  DenseObjectMatrix1D other = (DenseObjectMatrix1D) y;
+  checkSize(y);
+  final Object[] elems = this.elements;
+  final Object[] otherElems = other.elements;
+  if (elements==null || otherElems==null) throw new InternalError();
+  int s = this.stride;
+  int ys = other.stride;
 
-	int index = index(0);
-	int otherIndex = other.index(0);
+  int index = index(0);
+  int otherIndex = other.index(0);
 
-	// the general case x[i] = f(x[i],y[i])		
-	for (int k=size; --k >= 0; ) {
-		elems[index] = function.apply(elems[index], otherElems[otherIndex]);
-		index += s;
-		otherIndex += ys;
-	}
-	return this;
+  // the general case x[i] = f(x[i],y[i])    
+  for (int k=size; --k >= 0; ) {
+    elems[index] = function.apply(elems[index], otherElems[otherIndex]);
+    index += s;
+    otherIndex += ys;
+  }
+  return this;
 }
 /**
  * Returns the matrix cell value at coordinate <tt>index</tt>.
@@ -233,24 +233,24 @@
  * @return    the value of the specified cell.
  */
 public Object getQuick(int index) {
-	//if (debug) if (index<0 || index>=size) checkIndex(index);
-	//return elements[index(index)];
-	// manually inlined:
-	return elements[zero + index*stride];
+  //if (debug) if (index<0 || index>=size) checkIndex(index);
+  //return elements[index(index)];
+  // manually inlined:
+  return elements[zero + index*stride];
 }
 /**
  * Returns <tt>true</tt> if both matrices share at least one identical cell.
  */
 protected boolean haveSharedCellsRaw(ObjectMatrix1D other) {
-	if (other instanceof SelectedDenseObjectMatrix1D) {
-		SelectedDenseObjectMatrix1D otherMatrix = (SelectedDenseObjectMatrix1D) other;
-		return this.elements==otherMatrix.elements;
-	}
-	else if (other instanceof DenseObjectMatrix1D) {
-		DenseObjectMatrix1D otherMatrix = (DenseObjectMatrix1D) other;
-		return this.elements==otherMatrix.elements;
-	}
-	return false;
+  if (other instanceof SelectedDenseObjectMatrix1D) {
+    SelectedDenseObjectMatrix1D otherMatrix = (SelectedDenseObjectMatrix1D) other;
+    return this.elements==otherMatrix.elements;
+  }
+  else if (other instanceof DenseObjectMatrix1D) {
+    DenseObjectMatrix1D otherMatrix = (DenseObjectMatrix1D) other;
+    return this.elements==otherMatrix.elements;
+  }
+  return false;
 }
 /**
  * Returns the position of the element with the given relative rank within the (virtual or non-virtual) internal 1-dimensional array.
@@ -259,9 +259,9 @@
  * @param     rank   the rank of the element.
  */
 protected int index(int rank) {
-	// overriden for manual inlining only
-	//return _offset(_rank(rank));
-	return zero + rank*stride;
+  // overriden for manual inlining only
+  //return _offset(_rank(rank));
+  return zero + rank*stride;
 }
 /**
  * Construct and returns a new empty matrix <i>of the same dynamic type</i> as the receiver, having the specified size.
@@ -273,7 +273,7 @@
  * @return  a new empty matrix of the same dynamic type.
  */
 public ObjectMatrix1D like(int size) {
-	return new DenseObjectMatrix1D(size);
+  return new DenseObjectMatrix1D(size);
 }
 /**
  * Construct and returns a new 2-d matrix <i>of the corresponding dynamic type</i>, entirelly independent of the receiver.
@@ -285,7 +285,7 @@
  * @return  a new matrix of the corresponding dynamic type.
  */
 public ObjectMatrix2D like2D(int rows, int columns) {
-	return new DenseObjectMatrix2D(rows,columns);
+  return new DenseObjectMatrix2D(rows,columns);
 }
 /**
  * Sets the matrix cell at coordinate <tt>index</tt> to the specified value.
@@ -298,40 +298,40 @@
  * @param    value the value to be filled into the specified cell.
  */
 public void setQuick(int index, Object value) {
-	//if (debug) if (index<0 || index>=size) checkIndex(index);
-	//elements[index(index)] = value;
-	// manually inlined:
-	elements[zero + index*stride] = value;
+  //if (debug) if (index<0 || index>=size) checkIndex(index);
+  //elements[index(index)] = value;
+  // manually inlined:
+  elements[zero + index*stride] = value;
 }
 /**
 Swaps each element <tt>this[i]</tt> with <tt>other[i]</tt>.
 @throws IllegalArgumentException if <tt>size() != other.size()</tt>.
 */
 public void swap(ObjectMatrix1D other) {
-	// overriden for performance only
-	if (! (other instanceof DenseObjectMatrix1D)) {
-		super.swap(other);
-	}
-	DenseObjectMatrix1D y = (DenseObjectMatrix1D) other;
-	if (y==this) return;
-	checkSize(y);
-	
-	final Object[] elems = this.elements;
-	final Object[] otherElems = y.elements;
-	if (elements==null || otherElems==null) throw new InternalError();
-	int s = this.stride;
-	int ys = y.stride;
+  // overriden for performance only
+  if (! (other instanceof DenseObjectMatrix1D)) {
+    super.swap(other);
+  }
+  DenseObjectMatrix1D y = (DenseObjectMatrix1D) other;
+  if (y==this) return;
+  checkSize(y);
+  
+  final Object[] elems = this.elements;
+  final Object[] otherElems = y.elements;
+  if (elements==null || otherElems==null) throw new InternalError();
+  int s = this.stride;
+  int ys = y.stride;
 
-	int index = index(0);
-	int otherIndex = y.index(0);
-	for (int k=size; --k >= 0; ) {
-		Object tmp = elems[index];
-		elems[index] = otherElems[otherIndex];
-		otherElems[otherIndex] = tmp;
-		index += s;
-		otherIndex += ys;
-	}
-	return;
+  int index = index(0);
+  int otherIndex = y.index(0);
+  for (int k=size; --k >= 0; ) {
+    Object tmp = elems[index];
+    elems[index] = otherElems[otherIndex];
+    otherElems[otherIndex] = tmp;
+    index += s;
+    otherIndex += ys;
+  }
+  return;
 }
 /**
 Fills the cell values into the specified 1-dimensional array.
@@ -343,9 +343,9 @@
 @throws IllegalArgumentException if <tt>values.length < size()</tt>.
 */
 public void toArray(Object[] values) {
-	if (values.length < size) throw new IllegalArgumentException("values too small");
-	if (this.isNoView) System.arraycopy(this.elements,0,values,0,this.elements.length);
-	else super.toArray(values);
+  if (values.length < size) throw new IllegalArgumentException("values too small");
+  if (this.isNoView) System.arraycopy(this.elements,0,values,0,this.elements.length);
+  else super.toArray(values);
 }
 /**
  * Construct and returns a new selection view.
@@ -354,6 +354,6 @@
  * @return  a new view.
  */
 protected ObjectMatrix1D viewSelectionLike(int[] offsets) {
-	return new SelectedDenseObjectMatrix1D(this.elements,offsets);
+  return new SelectedDenseObjectMatrix1D(this.elements,offsets);
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SparseObjectMatrix3D.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SparseObjectMatrix3D.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SparseObjectMatrix3D.java	(working copy)
@@ -51,21 +51,21 @@
 Thus
 <pre>
    for (int slice=0; slice < slices; slice++) {
-	  for (int row=0; row < rows; row++) {
-	     for (int column=0; column < columns; column++) {
-			matrix.setQuick(slice,row,column,someValue);
-		 }		    
-	  }
+    for (int row=0; row < rows; row++) {
+       for (int column=0; column < columns; column++) {
+      matrix.setQuick(slice,row,column,someValue);
+     }        
+    }
    }
 </pre>
 is quicker than
 <pre>
    for (int column=0; column < columns; column++) {
-	  for (int row=0; row < rows; row++) {
-	     for (int slice=0; slice < slices; slice++) {
-			matrix.setQuick(slice,row,column,someValue);
-		 }
-	  }
+    for (int row=0; row < rows; row++) {
+       for (int slice=0; slice < slices; slice++) {
+      matrix.setQuick(slice,row,column,someValue);
+     }
+    }
    }
 </pre>
 
@@ -79,10 +79,10 @@
  */
 @Deprecated
 public class SparseObjectMatrix3D extends ObjectMatrix3D {
-	/*
-	 * The elements of the matrix.
-	 */
-	protected AbstractIntObjectMap elements; 
+  /*
+   * The elements of the matrix.
+   */
+  protected AbstractIntObjectMap elements; 
 /**
  * Constructs a matrix with a copy of the given values.
  * <tt>values</tt> is required to have the form <tt>values[slice][row][column]</tt>
@@ -95,8 +95,8 @@
  * @throws IllegalArgumentException if <tt>for any 1 &lt;= row &lt; values[0].length: values[slice][row].length != values[slice][row-1].length</tt>.
  */
 public SparseObjectMatrix3D(Object[][][] values) {
-	this(values.length, (values.length==0 ? 0: values[0].length), (values.length==0 ? 0: values[0].length==0 ? 0 : values[0][0].length));
-	assign(values);
+  this(values.length, (values.length==0 ? 0: values[0].length), (values.length==0 ? 0: values[0].length==0 ? 0 : values[0][0].length));
+  assign(values);
 }
 /**
  * Constructs a matrix with a given number of slices, rows and columns and default memory usage.
@@ -104,11 +104,11 @@
  * @param slices the number of slices the matrix shall have.
  * @param rows the number of rows the matrix shall have.
  * @param columns the number of columns the matrix shall have.
- * @throws	IllegalArgumentException if <tt>(double)slices*columns*rows > Integer.MAX_VALUE</tt>.
- * @throws	IllegalArgumentException if <tt>slices<0 || rows<0 || columns<0</tt>.
+ * @throws  IllegalArgumentException if <tt>(double)slices*columns*rows > Integer.MAX_VALUE</tt>.
+ * @throws  IllegalArgumentException if <tt>slices<0 || rows<0 || columns<0</tt>.
  */
 public SparseObjectMatrix3D(int slices, int rows, int columns) {
-	this(slices,rows,columns,slices*rows*(columns/1000),0.2,0.5);
+  this(slices,rows,columns,slices*rows*(columns/1000),0.2,0.5);
 }
 /**
  * Constructs a matrix with a given number of slices, rows and columns using memory as specified.
@@ -122,13 +122,13 @@
  *                          If not known, set <tt>initialCapacity=0</tt> or small.     
  * @param minLoadFactor        the minimum load factor of the hash map.
  * @param maxLoadFactor        the maximum load factor of the hash map.
- * @throws	IllegalArgumentException if <tt>initialCapacity < 0 || (minLoadFactor < 0.0 || minLoadFactor >= 1.0) || (maxLoadFactor <= 0.0 || maxLoadFactor >= 1.0) || (minLoadFactor >= maxLoadFactor)</tt>.
- * @throws	IllegalArgumentException if <tt>(double)slices*columns*rows > Integer.MAX_VALUE</tt>.
- * @throws	IllegalArgumentException if <tt>slices<0 || rows<0 || columns<0</tt>.
+ * @throws  IllegalArgumentException if <tt>initialCapacity < 0 || (minLoadFactor < 0.0 || minLoadFactor >= 1.0) || (maxLoadFactor <= 0.0 || maxLoadFactor >= 1.0) || (minLoadFactor >= maxLoadFactor)</tt>.
+ * @throws  IllegalArgumentException if <tt>(double)slices*columns*rows > Integer.MAX_VALUE</tt>.
+ * @throws  IllegalArgumentException if <tt>slices<0 || rows<0 || columns<0</tt>.
  */
 public SparseObjectMatrix3D(int slices, int rows, int columns, int initialCapacity, double minLoadFactor, double maxLoadFactor) {
-	setUp(slices,rows,columns);
-	this.elements = new OpenIntObjectHashMap(initialCapacity, minLoadFactor, maxLoadFactor);
+  setUp(slices,rows,columns);
+  this.elements = new OpenIntObjectHashMap(initialCapacity, minLoadFactor, maxLoadFactor);
 }
 /**
  * Constructs a view with the given parameters.
@@ -142,20 +142,20 @@
  * @param sliceStride the number of elements between two slices, i.e. <tt>index(k+1,i,j)-index(k,i,j)</tt>.
  * @param rowStride the number of elements between two rows, i.e. <tt>index(k,i+1,j)-index(k,i,j)</tt>.
  * @param columnnStride the number of elements between two columns, i.e. <tt>index(k,i,j+1)-index(k,i,j)</tt>.
- * @throws	IllegalArgumentException if <tt>(Object)slices*columns*rows > Integer.MAX_VALUE</tt>.
- * @throws	IllegalArgumentException if <tt>slices<0 || rows<0 || columns<0</tt>.
+ * @throws  IllegalArgumentException if <tt>(Object)slices*columns*rows > Integer.MAX_VALUE</tt>.
+ * @throws  IllegalArgumentException if <tt>slices<0 || rows<0 || columns<0</tt>.
  */
 protected SparseObjectMatrix3D(int slices, int rows, int columns, AbstractIntObjectMap elements, int sliceZero, int rowZero, int columnZero, int sliceStride, int rowStride, int columnStride) {
-	setUp(slices,rows,columns,sliceZero,rowZero,columnZero,sliceStride,rowStride,columnStride);
-	this.elements = elements;
-	this.isNoView = false;
+  setUp(slices,rows,columns,sliceZero,rowZero,columnZero,sliceStride,rowStride,columnStride);
+  this.elements = elements;
+  this.isNoView = false;
 }
 /**
  * Returns the number of cells having non-zero values.
  */
 public int cardinality() {
-	if (this.isNoView) return this.elements.size();
-	else return super.cardinality();
+  if (this.isNoView) return this.elements.size();
+  else return super.cardinality();
 }
 /**
  * Ensures that the receiver can hold at least the specified number of non-zero cells without needing to allocate new internal memory.
@@ -168,7 +168,7 @@
  * @param   minNonZeros   the desired minimum number of non-zero cells.
  */
 public void ensureCapacity(int minCapacity) {
-	this.elements.ensureCapacity(minCapacity);
+  this.elements.ensureCapacity(minCapacity);
 }
 /**
  * Returns the matrix cell value at coordinate <tt>[slice,row,column]</tt>.
@@ -183,24 +183,24 @@
  * @return    the value at the specified coordinate.
  */
 public Object getQuick(int slice, int row, int column) {
-	//if (debug) if (slice<0 || slice>=slices || row<0 || row>=rows || column<0 || column>=columns) throw new IndexOutOfBoundsException("slice:"+slice+", row:"+row+", column:"+column);
-	//return elements.get(index(slice,row,column));
-	//manually inlined:
-	return elements.get(sliceZero + slice*sliceStride + rowZero + row*rowStride + columnZero + column*columnStride);
+  //if (debug) if (slice<0 || slice>=slices || row<0 || row>=rows || column<0 || column>=columns) throw new IndexOutOfBoundsException("slice:"+slice+", row:"+row+", column:"+column);
+  //return elements.get(index(slice,row,column));
+  //manually inlined:
+  return elements.get(sliceZero + slice*sliceStride + rowZero + row*rowStride + columnZero + column*columnStride);
 }
 /**
  * Returns <tt>true</tt> if both matrices share at least one identical cell.
  */
 protected boolean haveSharedCellsRaw(ObjectMatrix3D other) {
-	if (other instanceof SelectedSparseObjectMatrix3D) {
-		SelectedSparseObjectMatrix3D otherMatrix = (SelectedSparseObjectMatrix3D) other;
-		return this.elements==otherMatrix.elements;
-	}
-	else if (other instanceof SparseObjectMatrix3D) {
-		SparseObjectMatrix3D otherMatrix = (SparseObjectMatrix3D) other;
-		return this.elements==otherMatrix.elements;
-	}
-	return false;
+  if (other instanceof SelectedSparseObjectMatrix3D) {
+    SelectedSparseObjectMatrix3D otherMatrix = (SelectedSparseObjectMatrix3D) other;
+    return this.elements==otherMatrix.elements;
+  }
+  else if (other instanceof SparseObjectMatrix3D) {
+    SparseObjectMatrix3D otherMatrix = (SparseObjectMatrix3D) other;
+    return this.elements==otherMatrix.elements;
+  }
+  return false;
 }
 /**
  * Returns the position of the given coordinate within the (virtual or non-virtual) internal 1-dimensional array. 
@@ -210,9 +210,9 @@
  * @param     column   the index of the third-coordinate.
  */
 protected int index(int slice, int row, int column) {
-	//return _sliceOffset(_sliceRank(slice)) + _rowOffset(_rowRank(row)) + _columnOffset(_columnRank(column));
-	//manually inlined:
-	return sliceZero + slice*sliceStride + rowZero + row*rowStride + columnZero + column*columnStride;	
+  //return _sliceOffset(_sliceRank(slice)) + _rowOffset(_rowRank(row)) + _columnOffset(_columnRank(column));
+  //manually inlined:
+  return sliceZero + slice*sliceStride + rowZero + row*rowStride + columnZero + column*columnStride;  
 }
 /**
  * Construct and returns a new empty matrix <i>of the same dynamic type</i> as the receiver, having the specified number of slices, rows and columns.
@@ -226,7 +226,7 @@
  * @return  a new empty matrix of the same dynamic type.
  */
 public ObjectMatrix3D like(int slices, int rows, int columns) {
-	return new SparseObjectMatrix3D(slices,rows,columns); 
+  return new SparseObjectMatrix3D(slices,rows,columns); 
 }
 /**
  * Construct and returns a new 2-d matrix <i>of the corresponding dynamic type</i>, sharing the same cells.
@@ -242,7 +242,7 @@
  * @return  a new matrix of the corresponding dynamic type.
  */
 protected ObjectMatrix2D like2D(int rows, int columns, int rowZero, int columnZero, int rowStride, int columnStride) {
-	return new SparseObjectMatrix2D(rows,columns,this.elements,rowZero,columnZero,rowStride,columnStride);
+  return new SparseObjectMatrix2D(rows,columns,this.elements,rowZero,columnZero,rowStride,columnStride);
 }
 /**
  * Sets the matrix cell at coordinate <tt>[slice,row,column]</tt> to the specified value.
@@ -257,14 +257,14 @@
  * @param    value the value to be filled into the specified cell.
  */
 public void setQuick(int slice, int row, int column, Object value) {
-	//if (debug) if (slice<0 || slice>=slices || row<0 || row>=rows || column<0 || column>=columns) throw new IndexOutOfBoundsException("slice:"+slice+", row:"+row+", column:"+column);
-	//int index =	index(slice,row,column);
-	//manually inlined:
-	int index = sliceZero + slice*sliceStride + rowZero + row*rowStride + columnZero + column*columnStride;
-	if (value == null)
-		this.elements.removeKey(index);
-	else 
-		this.elements.put(index, value);
+  //if (debug) if (slice<0 || slice>=slices || row<0 || row>=rows || column<0 || column>=columns) throw new IndexOutOfBoundsException("slice:"+slice+", row:"+row+", column:"+column);
+  //int index =  index(slice,row,column);
+  //manually inlined:
+  int index = sliceZero + slice*sliceStride + rowZero + row*rowStride + columnZero + column*columnStride;
+  if (value == null)
+    this.elements.removeKey(index);
+  else 
+    this.elements.put(index, value);
 }
 /**
  * Releases any superfluous memory created by explicitly putting zero values into cells formerly having non-zero values; 
@@ -284,7 +284,7 @@
  * Putting zeros into cells already containing zeros does not generate obsolete memory since no memory was allocated to them in the first place.
  */
 public void trimToSize() {
-	this.elements.trimToSize();
+  this.elements.trimToSize();
 }
 /**
  * Construct and returns a new selection view.
@@ -295,6 +295,6 @@
  * @return  a new view.
  */
 protected ObjectMatrix3D viewSelectionLike(int[] sliceOffsets, int[] rowOffsets, int[] columnOffsets) {
-	return new SelectedSparseObjectMatrix3D(this.elements,sliceOffsets,rowOffsets,columnOffsets,0);
+  return new SelectedSparseObjectMatrix3D(this.elements,sliceOffsets,rowOffsets,columnOffsets,0);
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/DenseObjectMatrix2D.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/DenseObjectMatrix2D.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/DenseObjectMatrix2D.java	(working copy)
@@ -35,17 +35,17 @@
 Thus
 <pre>
    for (int row=0; row < rows; row++) {
-	  for (int column=0; column < columns; column++) {
-		 matrix.setQuick(row,column,someValue);
-	  }
+    for (int column=0; column < columns; column++) {
+     matrix.setQuick(row,column,someValue);
+    }
    }
 </pre>
 is quicker than
 <pre>
    for (int column=0; column < columns; column++) {
-	  for (int row=0; row < rows; row++) {
-		 matrix.setQuick(row,column,someValue);
-	  }
+    for (int row=0; row < rows; row++) {
+     matrix.setQuick(row,column,someValue);
+    }
    }
 </pre>
 @author wolfgang.hoschek@cern.ch
@@ -56,15 +56,15 @@
  */
 @Deprecated
 public class DenseObjectMatrix2D extends ObjectMatrix2D {
-	/**
-	  * The elements of this matrix.
-	  * elements are stored in row major, i.e.
-	  * index==row*columns + column
-	  * columnOf(index)==index%columns
-	  * rowOf(index)==index/columns
-	  * i.e. {row0 column0..m}, {row1 column0..m}, ..., {rown column0..m}
-	  */
-	protected Object[] elements;
+  /**
+    * The elements of this matrix.
+    * elements are stored in row major, i.e.
+    * index==row*columns + column
+    * columnOf(index)==index%columns
+    * rowOf(index)==index/columns
+    * i.e. {row0 column0..m}, {row1 column0..m}, ..., {rown column0..m}
+    */
+  protected Object[] elements;
 /**
  * Constructs a matrix with a copy of the given values.
  * <tt>values</tt> is required to have the form <tt>values[row][column]</tt>
@@ -76,19 +76,19 @@
  * @throws IllegalArgumentException if <tt>for any 1 &lt;= row &lt; values.length: values[row].length != values[row-1].length</tt>.
  */
 public DenseObjectMatrix2D(Object[][] values) {
-	this(values.length, values.length==0 ? 0: values[0].length);
-	assign(values);
+  this(values.length, values.length==0 ? 0: values[0].length);
+  assign(values);
 }
 /**
  * Constructs a matrix with a given number of rows and columns.
  * All entries are initially <tt>0</tt>.
  * @param rows the number of rows the matrix shall have.
  * @param columns the number of columns the matrix shall have.
- * @throws	IllegalArgumentException if <tt>rows<0 || columns<0 || (Object)columns*rows > Integer.MAX_VALUE</tt>.
+ * @throws  IllegalArgumentException if <tt>rows<0 || columns<0 || (Object)columns*rows > Integer.MAX_VALUE</tt>.
  */
 public DenseObjectMatrix2D(int rows, int columns) {
-	setUp(rows, columns);
-	this.elements = new Object[rows*columns];
+  setUp(rows, columns);
+  this.elements = new Object[rows*columns];
 }
 /**
  * Constructs a view with the given parameters.
@@ -99,12 +99,12 @@
  * @param columnZero the position of the first element.
  * @param rowStride the number of elements between two rows, i.e. <tt>index(i+1,j)-index(i,j)</tt>.
  * @param columnStride the number of elements between two columns, i.e. <tt>index(i,j+1)-index(i,j)</tt>.
- * @throws	IllegalArgumentException if <tt>rows<0 || columns<0 || (Object)columns*rows > Integer.MAX_VALUE</tt> or flip's are illegal.
+ * @throws  IllegalArgumentException if <tt>rows<0 || columns<0 || (Object)columns*rows > Integer.MAX_VALUE</tt> or flip's are illegal.
  */
 protected DenseObjectMatrix2D(int rows, int columns, Object[] elements, int rowZero, int columnZero, int rowStride, int columnStride) {
-	setUp(rows,columns,rowZero,columnZero,rowStride,columnStride);
-	this.elements = elements;
-	this.isNoView = false;
+  setUp(rows,columns,rowZero,columnZero,rowStride,columnStride);
+  this.elements = elements;
+  this.isNoView = false;
 }
 /**
  * Sets all cells to the state specified by <tt>values</tt>.
@@ -118,20 +118,20 @@
  * @throws IllegalArgumentException if <tt>values.length != rows() || for any 0 &lt;= row &lt; rows(): values[row].length != columns()</tt>.
  */
 public ObjectMatrix2D assign(Object[][] values) {
-	if (this.isNoView) {
-		if (values.length != rows) throw new IllegalArgumentException("Must have same number of rows: rows="+values.length+"rows()="+rows());
-		int i = columns*(rows-1);
-		for (int row=rows; --row >= 0;) {
-			Object[] currentRow = values[row];
-			if (currentRow.length != columns) throw new IllegalArgumentException("Must have same number of columns in every row: columns="+currentRow.length+"columns()="+columns());			
-			System.arraycopy(currentRow, 0, this.elements, i, columns);
-			i -= columns;
-		}
-	}
-	else {
-		super.assign(values);
-	}
-	return this;
+  if (this.isNoView) {
+    if (values.length != rows) throw new IllegalArgumentException("Must have same number of rows: rows="+values.length+"rows()="+rows());
+    int i = columns*(rows-1);
+    for (int row=rows; --row >= 0;) {
+      Object[] currentRow = values[row];
+      if (currentRow.length != columns) throw new IllegalArgumentException("Must have same number of columns in every row: columns="+currentRow.length+"columns()="+columns());      
+      System.arraycopy(currentRow, 0, this.elements, i, columns);
+      i -= columns;
+    }
+  }
+  else {
+    super.assign(values);
+  }
+  return this;
 }
 /**
 Assigns the result of a function to each cell; <tt>x[row,col] = function(x[row,col])</tt>.
@@ -156,21 +156,21 @@
 @see org.apache.mahout.jet.math.Functions
 */
 public ObjectMatrix2D assign(org.apache.mahout.matrix.function.ObjectFunction function) {
-	final Object[] elems = this.elements;
-	if (elems==null) throw new InternalError();
-	int index = index(0,0);
-	int cs = this.columnStride;
-	int rs = this.rowStride;
-	
-	// the general case x[i] = f(x[i])
-	for (int row=rows; --row >= 0; ) { 
-		for (int i=index, column=columns; --column >= 0; ) {
-			elems[i] = function.apply(elems[i]);
-			i += cs;
-		}
-		index += rs;
-	}
-	return this;
+  final Object[] elems = this.elements;
+  if (elems==null) throw new InternalError();
+  int index = index(0,0);
+  int cs = this.columnStride;
+  int rs = this.rowStride;
+  
+  // the general case x[i] = f(x[i])
+  for (int row=rows; --row >= 0; ) { 
+    for (int i=index, column=columns; --column >= 0; ) {
+      elems[i] = function.apply(elems[i]);
+      i += cs;
+    }
+    index += rs;
+  }
+  return this;
 }
 /**
  * Replaces all cell values of the receiver with the values of another matrix.
@@ -179,50 +179,50 @@
  *
  * @param     source   the source matrix to copy from (may be identical to the receiver).
  * @return <tt>this</tt> (for convenience only).
- * @throws	IllegalArgumentException if <tt>columns() != source.columns() || rows() != source.rows()</tt>
+ * @throws  IllegalArgumentException if <tt>columns() != source.columns() || rows() != source.rows()</tt>
  */
 public ObjectMatrix2D assign(ObjectMatrix2D source) {
-	// overriden for performance only
-	if (! (source instanceof DenseObjectMatrix2D)) {
-		return super.assign(source);
-	}
-	DenseObjectMatrix2D other = (DenseObjectMatrix2D) source;
-	if (other==this) return this; // nothing to do
-	checkShape(other);
-	
-	if (this.isNoView && other.isNoView) { // quickest
-		System.arraycopy(other.elements, 0, this.elements, 0, this.elements.length);
-		return this;
-	}
-	
-	if (haveSharedCells(other)) {
-		ObjectMatrix2D c = other.copy();
-		if (! (c instanceof DenseObjectMatrix2D)) { // should not happen
-			return super.assign(other);
-		}
-		other = (DenseObjectMatrix2D) c;
-	}
-	
-	final Object[] elems = this.elements;
-	final Object[] otherElems = other.elements;
-	if (elements==null || otherElems==null) throw new InternalError();
-	int cs = this.columnStride;
-	int ocs = other.columnStride;
-	int rs = this.rowStride;
-	int ors = other.rowStride;
+  // overriden for performance only
+  if (! (source instanceof DenseObjectMatrix2D)) {
+    return super.assign(source);
+  }
+  DenseObjectMatrix2D other = (DenseObjectMatrix2D) source;
+  if (other==this) return this; // nothing to do
+  checkShape(other);
+  
+  if (this.isNoView && other.isNoView) { // quickest
+    System.arraycopy(other.elements, 0, this.elements, 0, this.elements.length);
+    return this;
+  }
+  
+  if (haveSharedCells(other)) {
+    ObjectMatrix2D c = other.copy();
+    if (! (c instanceof DenseObjectMatrix2D)) { // should not happen
+      return super.assign(other);
+    }
+    other = (DenseObjectMatrix2D) c;
+  }
+  
+  final Object[] elems = this.elements;
+  final Object[] otherElems = other.elements;
+  if (elements==null || otherElems==null) throw new InternalError();
+  int cs = this.columnStride;
+  int ocs = other.columnStride;
+  int rs = this.rowStride;
+  int ors = other.rowStride;
 
-	int otherIndex = other.index(0,0);
-	int index = index(0,0);
-	for (int row=rows; --row >= 0; ) {
-		for (int i=index, j=otherIndex, column=columns; --column >= 0; ) {
-			elems[i] = otherElems[j];
-			i += cs;
-			j += ocs;
-		}
-		index += rs;
-		otherIndex += ors;
-	}
-	return this;
+  int otherIndex = other.index(0,0);
+  int index = index(0,0);
+  for (int row=rows; --row >= 0; ) {
+    for (int i=index, j=otherIndex, column=columns; --column >= 0; ) {
+      elems[i] = otherElems[j];
+      i += cs;
+      j += ocs;
+    }
+    index += rs;
+    otherIndex += ors;
+  }
+  return this;
 }
 /**
 Assigns the result of a function to each cell; <tt>x[row,col] = function(x[row,col],y[row,col])</tt>.
@@ -250,39 +250,39 @@
 @param function a function object taking as first argument the current cell's value of <tt>this</tt>,
 and as second argument the current cell's value of <tt>y</tt>,
 @return <tt>this</tt> (for convenience only).
-@throws	IllegalArgumentException if <tt>columns() != other.columns() || rows() != other.rows()</tt>
+@throws  IllegalArgumentException if <tt>columns() != other.columns() || rows() != other.rows()</tt>
 @see org.apache.mahout.jet.math.Functions
 */
 public ObjectMatrix2D assign(ObjectMatrix2D y, org.apache.mahout.matrix.function.ObjectObjectFunction function) {
-	// overriden for performance only
-	if (! (y instanceof DenseObjectMatrix2D)) {
-		return super.assign(y, function);
-	}
-	DenseObjectMatrix2D other = (DenseObjectMatrix2D) y;
-	checkShape(y);
-	
-	final Object[] elems = this.elements;
-	final Object[] otherElems = other.elements;
-	if (elems==null || otherElems==null) throw new InternalError();
-	int cs = this.columnStride;
-	int ocs = other.columnStride;
-	int rs = this.rowStride;
-	int ors = other.rowStride;
+  // overriden for performance only
+  if (! (y instanceof DenseObjectMatrix2D)) {
+    return super.assign(y, function);
+  }
+  DenseObjectMatrix2D other = (DenseObjectMatrix2D) y;
+  checkShape(y);
+  
+  final Object[] elems = this.elements;
+  final Object[] otherElems = other.elements;
+  if (elems==null || otherElems==null) throw new InternalError();
+  int cs = this.columnStride;
+  int ocs = other.columnStride;
+  int rs = this.rowStride;
+  int ors = other.rowStride;
 
-	int otherIndex = other.index(0,0);
-	int index = index(0,0);
+  int otherIndex = other.index(0,0);
+  int index = index(0,0);
 
-	// the general case x[i] = f(x[i],y[i])
-	for (int row=rows; --row >= 0; ) {
-		for (int i=index, j=otherIndex, column=columns; --column >= 0; ) {
-			elems[i] = function.apply(elems[i], otherElems[j]);
-			i += cs;
-			j += ocs;
-		}
-		index += rs;
-		otherIndex += ors;
-	}
-	return this;
+  // the general case x[i] = f(x[i],y[i])
+  for (int row=rows; --row >= 0; ) {
+    for (int i=index, j=otherIndex, column=columns; --column >= 0; ) {
+      elems[i] = function.apply(elems[i], otherElems[j]);
+      i += cs;
+      j += ocs;
+    }
+    index += rs;
+    otherIndex += ors;
+  }
+  return this;
 }
 /**
  * Returns the matrix cell value at coordinate <tt>[row,column]</tt>.
@@ -296,10 +296,10 @@
  * @return    the value at the specified coordinate.
  */
 public Object getQuick(int row, int column) {
-	//if (debug) if (column<0 || column>=columns || row<0 || row>=rows) throw new IndexOutOfBoundsException("row:"+row+", column:"+column);
-	//return elements[index(row,column)];
-	//manually inlined:
-	return elements[rowZero + row*rowStride + columnZero + column*columnStride];
+  //if (debug) if (column<0 || column>=columns || row<0 || row>=rows) throw new IndexOutOfBoundsException("row:"+row+", column:"+column);
+  //return elements[index(row,column)];
+  //manually inlined:
+  return elements[rowZero + row*rowStride + columnZero + column*columnStride];
 }
 /**
  * Returns <tt>true</tt> if both matrices share common cells.
@@ -311,15 +311,15 @@
  * </ul>
  */
 protected boolean haveSharedCellsRaw(ObjectMatrix2D other) {
-	if (other instanceof SelectedDenseObjectMatrix2D) {
-		SelectedDenseObjectMatrix2D otherMatrix = (SelectedDenseObjectMatrix2D) other;
-		return this.elements==otherMatrix.elements;
-	}
-	else if (other instanceof DenseObjectMatrix2D) {
-		DenseObjectMatrix2D otherMatrix = (DenseObjectMatrix2D) other;
-		return this.elements==otherMatrix.elements;
-	}
-	return false;
+  if (other instanceof SelectedDenseObjectMatrix2D) {
+    SelectedDenseObjectMatrix2D otherMatrix = (SelectedDenseObjectMatrix2D) other;
+    return this.elements==otherMatrix.elements;
+  }
+  else if (other instanceof DenseObjectMatrix2D) {
+    DenseObjectMatrix2D otherMatrix = (DenseObjectMatrix2D) other;
+    return this.elements==otherMatrix.elements;
+  }
+  return false;
 }
 /**
  * Returns the position of the given coordinate within the (virtual or non-virtual) internal 1-dimensional array. 
@@ -328,9 +328,9 @@
  * @param     column   the index of the column-coordinate.
  */
 protected int index(int row, int column) {
-	// return super.index(row,column);
-	// manually inlined for speed:
-	return rowZero + row*rowStride + columnZero + column*columnStride;
+  // return super.index(row,column);
+  // manually inlined for speed:
+  return rowZero + row*rowStride + columnZero + column*columnStride;
 }
 /**
  * Construct and returns a new empty matrix <i>of the same dynamic type</i> as the receiver, having the specified number of rows and columns.
@@ -343,7 +343,7 @@
  * @return  a new empty matrix of the same dynamic type.
  */
 public ObjectMatrix2D like(int rows, int columns) {
-	return new DenseObjectMatrix2D(rows, columns);
+  return new DenseObjectMatrix2D(rows, columns);
 }
 /**
  * Construct and returns a new 1-d matrix <i>of the corresponding dynamic type</i>, entirelly independent of the receiver.
@@ -354,7 +354,7 @@
  * @return  a new matrix of the corresponding dynamic type.
  */
 public ObjectMatrix1D like1D(int size) {
-	return new DenseObjectMatrix1D(size);
+  return new DenseObjectMatrix1D(size);
 }
 /**
  * Construct and returns a new 1-d matrix <i>of the corresponding dynamic type</i>, sharing the same cells.
@@ -367,7 +367,7 @@
  * @return  a new matrix of the corresponding dynamic type.
  */
 protected ObjectMatrix1D like1D(int size, int zero, int stride) {
-	return new DenseObjectMatrix1D(size,this.elements,zero,stride);
+  return new DenseObjectMatrix1D(size,this.elements,zero,stride);
 }
 /**
  * Sets the matrix cell at coordinate <tt>[row,column]</tt> to the specified value.
@@ -381,10 +381,10 @@
  * @param    value the value to be filled into the specified cell.
  */
 public void setQuick(int row, int column, Object value) {
-	//if (debug) if (column<0 || column>=columns || row<0 || row>=rows) throw new IndexOutOfBoundsException("row:"+row+", column:"+column);
-	//elements[index(row,column)] = value;
-	//manually inlined:
-	elements[rowZero + row*rowStride + columnZero + column*columnStride] = value;
+  //if (debug) if (column<0 || column>=columns || row<0 || row>=rows) throw new IndexOutOfBoundsException("row:"+row+", column:"+column);
+  //elements[index(row,column)] = value;
+  //manually inlined:
+  elements[rowZero + row*rowStride + columnZero + column*columnStride] = value;
 }
 /**
  * Construct and returns a new selection view.
@@ -394,6 +394,6 @@
  * @return  a new view.
  */
 protected ObjectMatrix2D viewSelectionLike(int[] rowOffsets, int[] columnOffsets) {
-	return new SelectedDenseObjectMatrix2D(this.elements,rowOffsets,columnOffsets,0);
+  return new SelectedDenseObjectMatrix2D(this.elements,rowOffsets,columnOffsets,0);
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/DenseObjectMatrix3D.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/DenseObjectMatrix3D.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/DenseObjectMatrix3D.java	(working copy)
@@ -34,21 +34,21 @@
 Thus
 <pre>
    for (int slice=0; slice < slices; slice++) {
-	  for (int row=0; row < rows; row++) {
-	     for (int column=0; column < columns; column++) {
-			matrix.setQuick(slice,row,column,someValue);
-		 }		    
-	  }
+    for (int row=0; row < rows; row++) {
+       for (int column=0; column < columns; column++) {
+      matrix.setQuick(slice,row,column,someValue);
+     }        
+    }
    }
 </pre>
 is quicker than
 <pre>
    for (int column=0; column < columns; column++) {
-	  for (int row=0; row < rows; row++) {
-	     for (int slice=0; slice < slices; slice++) {
-			matrix.setQuick(slice,row,column,someValue);
-		 }
-	  }
+    for (int row=0; row < rows; row++) {
+       for (int slice=0; slice < slices; slice++) {
+      matrix.setQuick(slice,row,column,someValue);
+     }
+    }
    }
 </pre>
 @author wolfgang.hoschek@cern.ch
@@ -59,15 +59,15 @@
  */
 @Deprecated
 public class DenseObjectMatrix3D extends ObjectMatrix3D {
-	/**
-	  * The elements of this matrix.
-	  * elements are stored in slice major, then row major, then column major, in order of significance, i.e.
-	  * index==slice*sliceStride+ row*rowStride + column*columnStride
-	  * i.e. {slice0 row0..m}, {slice1 row0..m}, ..., {sliceN row0..m}
-	  * with each row storead as 
-	  * {row0 column0..m}, {row1 column0..m}, ..., {rown column0..m}
-	  */
-	protected Object[] elements;
+  /**
+    * The elements of this matrix.
+    * elements are stored in slice major, then row major, then column major, in order of significance, i.e.
+    * index==slice*sliceStride+ row*rowStride + column*columnStride
+    * i.e. {slice0 row0..m}, {slice1 row0..m}, ..., {sliceN row0..m}
+    * with each row storead as 
+    * {row0 column0..m}, {row1 column0..m}, ..., {rown column0..m}
+    */
+  protected Object[] elements;
 /**
  * Constructs a matrix with a copy of the given values.
  * <tt>values</tt> is required to have the form <tt>values[slice][row][column]</tt>
@@ -80,8 +80,8 @@
  * @throws IllegalArgumentException if <tt>for any 1 &lt;= row &lt; values[0].length: values[slice][row].length != values[slice][row-1].length</tt>.
  */
 public DenseObjectMatrix3D(Object[][][] values) {
-	this(values.length, (values.length==0 ? 0: values[0].length), (values.length==0 ? 0: values[0].length==0 ? 0 : values[0][0].length));
-	assign(values);
+  this(values.length, (values.length==0 ? 0: values[0].length), (values.length==0 ? 0: values[0].length==0 ? 0 : values[0][0].length));
+  assign(values);
 }
 /**
  * Constructs a matrix with a given number of slices, rows and columns.
@@ -89,12 +89,12 @@
  * @param slices the number of slices the matrix shall have.
  * @param rows the number of rows the matrix shall have.
  * @param columns the number of columns the matrix shall have.
- * @throws	IllegalArgumentException if <tt>(Object)slices*columns*rows > Integer.MAX_VALUE</tt>.
- * @throws	IllegalArgumentException if <tt>slices<0 || rows<0 || columns<0</tt>.
+ * @throws  IllegalArgumentException if <tt>(Object)slices*columns*rows > Integer.MAX_VALUE</tt>.
+ * @throws  IllegalArgumentException if <tt>slices<0 || rows<0 || columns<0</tt>.
  */
 public DenseObjectMatrix3D(int slices, int rows, int columns) {
-	setUp(slices,rows, columns);
-	this.elements = new Object[slices*rows*columns];
+  setUp(slices,rows, columns);
+  this.elements = new Object[slices*rows*columns];
 }
 /**
  * Constructs a view with the given parameters.
@@ -108,13 +108,13 @@
  * @param sliceStride the number of elements between two slices, i.e. <tt>index(k+1,i,j)-index(k,i,j)</tt>.
  * @param rowStride the number of elements between two rows, i.e. <tt>index(k,i+1,j)-index(k,i,j)</tt>.
  * @param columnnStride the number of elements between two columns, i.e. <tt>index(k,i,j+1)-index(k,i,j)</tt>.
- * @throws	IllegalArgumentException if <tt>(Object)slices*columns*rows > Integer.MAX_VALUE</tt>.
- * @throws	IllegalArgumentException if <tt>slices<0 || rows<0 || columns<0</tt>.
+ * @throws  IllegalArgumentException if <tt>(Object)slices*columns*rows > Integer.MAX_VALUE</tt>.
+ * @throws  IllegalArgumentException if <tt>slices<0 || rows<0 || columns<0</tt>.
  */
 protected DenseObjectMatrix3D(int slices, int rows, int columns, Object[] elements, int sliceZero, int rowZero, int columnZero, int sliceStride, int rowStride, int columnStride) {
-	setUp(slices,rows,columns,sliceZero,rowZero,columnZero,sliceStride,rowStride,columnStride);
-	this.elements = elements;
-	this.isNoView = false;
+  setUp(slices,rows,columns,sliceZero,rowZero,columnZero,sliceStride,rowStride,columnStride);
+  this.elements = elements;
+  this.isNoView = false;
 }
 /**
  * Sets all cells to the state specified by <tt>values</tt>.
@@ -129,24 +129,24 @@
  * @throws IllegalArgumentException if <tt>for any 0 &lt;= column &lt; columns(): values[slice][row].length != columns()</tt>.
  */
 public ObjectMatrix3D assign(Object[][][] values) {
-	if (this.isNoView) {
-		if (values.length != slices) throw new IllegalArgumentException("Must have same number of slices: slices="+values.length+"slices()="+slices());
-		int i=slices*rows*columns - columns;
-		for (int slice=slices; --slice >= 0;) {
-			Object[][] currentSlice = values[slice];
-			if (currentSlice.length != rows) throw new IllegalArgumentException("Must have same number of rows in every slice: rows="+currentSlice.length+"rows()="+rows());
-			for (int row=rows; --row >= 0;) {
-				Object[] currentRow = currentSlice[row];
-				if (currentRow.length != columns) throw new IllegalArgumentException("Must have same number of columns in every row: columns="+currentRow.length+"columns()="+columns());			
-				System.arraycopy(currentRow, 0, this.elements, i, columns);
-				i -= columns;
-			}
-		}
-	}
-	else {
-		super.assign(values);
-	}
-	return this;
+  if (this.isNoView) {
+    if (values.length != slices) throw new IllegalArgumentException("Must have same number of slices: slices="+values.length+"slices()="+slices());
+    int i=slices*rows*columns - columns;
+    for (int slice=slices; --slice >= 0;) {
+      Object[][] currentSlice = values[slice];
+      if (currentSlice.length != rows) throw new IllegalArgumentException("Must have same number of rows in every slice: rows="+currentSlice.length+"rows()="+rows());
+      for (int row=rows; --row >= 0;) {
+        Object[] currentRow = currentSlice[row];
+        if (currentRow.length != columns) throw new IllegalArgumentException("Must have same number of columns in every row: columns="+currentRow.length+"columns()="+columns());      
+        System.arraycopy(currentRow, 0, this.elements, i, columns);
+        i -= columns;
+      }
+    }
+  }
+  else {
+    super.assign(values);
+  }
+  return this;
 }
 /**
  * Replaces all cell values of the receiver with the values of another matrix.
@@ -155,29 +155,29 @@
  *
  * @param     source   the source matrix to copy from (may be identical to the receiver).
  * @return <tt>this</tt> (for convenience only).
- * @throws	IllegalArgumentException if <tt>slices() != source.slices() || rows() != source.rows() || columns() != source.columns()</tt>
+ * @throws  IllegalArgumentException if <tt>slices() != source.slices() || rows() != source.rows() || columns() != source.columns()</tt>
  */
 public ObjectMatrix3D assign(ObjectMatrix3D source) {
-	// overriden for performance only
-	if (! (source instanceof DenseObjectMatrix3D)) {
-		return super.assign(source);
-	}
-	DenseObjectMatrix3D other = (DenseObjectMatrix3D) source;
-	if (other==this) return this;
-	checkShape(other);
-	if (haveSharedCells(other)) {
-		ObjectMatrix3D c = other.copy();
-		if (! (c instanceof DenseObjectMatrix3D)) { // should not happen
-			return super.assign(source);
-		}
-		other = (DenseObjectMatrix3D) c;
-	}
+  // overriden for performance only
+  if (! (source instanceof DenseObjectMatrix3D)) {
+    return super.assign(source);
+  }
+  DenseObjectMatrix3D other = (DenseObjectMatrix3D) source;
+  if (other==this) return this;
+  checkShape(other);
+  if (haveSharedCells(other)) {
+    ObjectMatrix3D c = other.copy();
+    if (! (c instanceof DenseObjectMatrix3D)) { // should not happen
+      return super.assign(source);
+    }
+    other = (DenseObjectMatrix3D) c;
+  }
 
-	if (this.isNoView && other.isNoView) { // quickest
-		System.arraycopy(other.elements, 0, this.elements, 0, this.elements.length);
-		return this;
-	}
-	return super.assign(other);
+  if (this.isNoView && other.isNoView) { // quickest
+    System.arraycopy(other.elements, 0, this.elements, 0, this.elements.length);
+    return this;
+  }
+  return super.assign(other);
 }
 /**
  * Returns the matrix cell value at coordinate <tt>[slice,row,column]</tt>.
@@ -192,10 +192,10 @@
  * @return    the value at the specified coordinate.
  */
 public Object getQuick(int slice, int row, int column) {
-	//if (debug) if (slice<0 || slice>=slices || row<0 || row>=rows || column<0 || column>=columns) throw new IndexOutOfBoundsException("slice:"+slice+", row:"+row+", column:"+column);
-	//return elements[index(slice,row,column)];
-	//manually inlined:
-	return elements[sliceZero + slice*sliceStride + rowZero + row*rowStride + columnZero + column*columnStride];
+  //if (debug) if (slice<0 || slice>=slices || row<0 || row>=rows || column<0 || column>=columns) throw new IndexOutOfBoundsException("slice:"+slice+", row:"+row+", column:"+column);
+  //return elements[index(slice,row,column)];
+  //manually inlined:
+  return elements[sliceZero + slice*sliceStride + rowZero + row*rowStride + columnZero + column*columnStride];
 }
 /**
  * Returns <tt>true</tt> if both matrices share common cells.
@@ -207,15 +207,15 @@
  * </ul>
  */
 protected boolean haveSharedCellsRaw(ObjectMatrix3D other) {
-	if (other instanceof SelectedDenseObjectMatrix3D) {
-		SelectedDenseObjectMatrix3D otherMatrix = (SelectedDenseObjectMatrix3D) other;
-		return this.elements==otherMatrix.elements;
-	}
-	else if (other instanceof DenseObjectMatrix3D) {
-		DenseObjectMatrix3D otherMatrix = (DenseObjectMatrix3D) other;
-		return this.elements==otherMatrix.elements;
-	}
-	return false;
+  if (other instanceof SelectedDenseObjectMatrix3D) {
+    SelectedDenseObjectMatrix3D otherMatrix = (SelectedDenseObjectMatrix3D) other;
+    return this.elements==otherMatrix.elements;
+  }
+  else if (other instanceof DenseObjectMatrix3D) {
+    DenseObjectMatrix3D otherMatrix = (DenseObjectMatrix3D) other;
+    return this.elements==otherMatrix.elements;
+  }
+  return false;
 }
 /**
  * Returns the position of the given coordinate within the (virtual or non-virtual) internal 1-dimensional array. 
@@ -225,9 +225,9 @@
  * @param     column   the index of the third-coordinate.
  */
 protected int index(int slice, int row, int column) {
-	//return _sliceOffset(_sliceRank(slice)) + _rowOffset(_rowRank(row)) + _columnOffset(_columnRank(column));
-	//manually inlined:
-	return sliceZero + slice*sliceStride + rowZero + row*rowStride + columnZero + column*columnStride;	
+  //return _sliceOffset(_sliceRank(slice)) + _rowOffset(_rowRank(row)) + _columnOffset(_columnRank(column));
+  //manually inlined:
+  return sliceZero + slice*sliceStride + rowZero + row*rowStride + columnZero + column*columnStride;  
 }
 /**
  * Construct and returns a new empty matrix <i>of the same dynamic type</i> as the receiver, having the specified number of slices, rows and columns.
@@ -241,7 +241,7 @@
  * @return  a new empty matrix of the same dynamic type.
  */
 public ObjectMatrix3D like(int slices, int rows, int columns) {
-	return new DenseObjectMatrix3D(slices,rows,columns); 
+  return new DenseObjectMatrix3D(slices,rows,columns); 
 }
 /**
  * Construct and returns a new 2-d matrix <i>of the corresponding dynamic type</i>, sharing the same cells.
@@ -257,7 +257,7 @@
  * @return  a new matrix of the corresponding dynamic type.
  */
 protected ObjectMatrix2D like2D(int rows, int columns, int rowZero, int columnZero, int rowStride, int columnStride) {
-	return new DenseObjectMatrix2D(rows,columns,this.elements,rowZero,columnZero,rowStride,columnStride);
+  return new DenseObjectMatrix2D(rows,columns,this.elements,rowZero,columnZero,rowStride,columnStride);
 }
 /**
  * Sets the matrix cell at coordinate <tt>[slice,row,column]</tt> to the specified value.
@@ -272,10 +272,10 @@
  * @param    value the value to be filled into the specified cell.
  */
 public void setQuick(int slice, int row, int column, Object value) {
-	//if (debug) if (slice<0 || slice>=slices || row<0 || row>=rows || column<0 || column>=columns) throw new IndexOutOfBoundsException("slice:"+slice+", row:"+row+", column:"+column);
-	//elements[index(slice,row,column)] = value;
-	//manually inlined:
-	elements[sliceZero + slice*sliceStride + rowZero + row*rowStride + columnZero + column*columnStride] = value;
+  //if (debug) if (slice<0 || slice>=slices || row<0 || row>=rows || column<0 || column>=columns) throw new IndexOutOfBoundsException("slice:"+slice+", row:"+row+", column:"+column);
+  //elements[index(slice,row,column)] = value;
+  //manually inlined:
+  elements[sliceZero + slice*sliceStride + rowZero + row*rowStride + columnZero + column*columnStride] = value;
 }
 /**
  * Construct and returns a new selection view.
@@ -286,6 +286,6 @@
  * @return  a new view.
  */
 protected ObjectMatrix3D viewSelectionLike(int[] sliceOffsets, int[] rowOffsets, int[] columnOffsets) {
-	return new SelectedDenseObjectMatrix3D(this.elements,sliceOffsets,rowOffsets,columnOffsets,0);
+  return new SelectedDenseObjectMatrix3D(this.elements,sliceOffsets,rowOffsets,columnOffsets,0);
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/BenchmarkMatrix2D.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/BenchmarkMatrix2D.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/BenchmarkMatrix2D.java	(working copy)
@@ -16,60 +16,60 @@
 <p> 
 <center>
   <table border cellpadding="3" cellspacing="0" align="center">
-	<tr valign="middle" bgcolor="#33CC66" nowrap align="center"> 
-	  <td nowrap colspan="7"> <font size="+2">Iteration Performance [million method 
-		calls per second]</font><br>
-		<font size="-1">Pentium Pro 200 Mhz, SunJDK 1.2.2, NT, java -classic,<br>
-		60 times repeating the same iteration </font></td>
-	</tr>
-	<tr valign="middle" bgcolor="#33CC66" nowrap align="center"> 
-	  <td nowrap> 
-		<div align="left"> Element type</div>
-	  </td>
-	  <td nowrap colspan="6"> Matrix2D type </td>
-	</tr>
-	<tr valign="middle" bgcolor="#66CCFF" nowrap align="center"> 
-	  <td nowrap bgcolor="#FF9966" rowspan="2"> 
-		<div align="left"> .</div>
-	  </td>
-	  <td bgcolor="#FF9966" colspan="2"> 
-		<p><tt>DenseDoubleMatrix2D</tt><br>
-		  1000 x 1000 </p>
-	  </td>
-	  <td bgcolor="#FF9966" colspan="2">&nbsp;</td>
-	  <td bgcolor="#FF9966" colspan="2"> 
-		<p><tt>SparseDoubleMatrix2D</tt><br>
-		  100 x 1000,<br>
-		  <font size="-1"> minLoadFactor=0.2, maxLoadFactor=0.5, initialCapacity 
-		  = 0</font></p>
-	  </td>
-	</tr>
-	<tr valign="middle" bgcolor="#66CCFF" nowrap align="center"> 
-	  <td bgcolor="#FF9966"> getQuick</td>
-	  <td bgcolor="#FF9966"> setQuick</td>
-	  <td bgcolor="#FF9966">&nbsp;</td>
-	  <td bgcolor="#FF9966">&nbsp;</td>
-	  <td bgcolor="#FF9966"> getQuick</td>
-	  <td bgcolor="#FF9966">setQuick</td>
-	</tr>
-	<tr valign="middle" bgcolor="#66CCFF" nowrap align="center"> 
-	  <td nowrap bgcolor="#FF9966">double</td>
-	  <td nowrap>5</td>
-	  <td nowrap>5</td>
-	  <td nowrap>&nbsp;</td>
-	  <td nowrap>&nbsp;</td>
-	  <td nowrap>1</td>
-	  <td nowrap>0.27</td>
-	</tr>
-	<tr valign="middle" bgcolor="#66CCFF" nowrap align="center"> 
-	  <td nowrap bgcolor="#FF9966"> int</td>
-	  <td nowrap>5 </td>
-	  <td nowrap>5.5 </td>
-	  <td nowrap>&nbsp;</td>
-	  <td nowrap>&nbsp;</td>
-	  <td nowrap>1 </td>
-	  <td nowrap>0.3</td>
-	</tr>
+  <tr valign="middle" bgcolor="#33CC66" nowrap align="center"> 
+    <td nowrap colspan="7"> <font size="+2">Iteration Performance [million method 
+    calls per second]</font><br>
+    <font size="-1">Pentium Pro 200 Mhz, SunJDK 1.2.2, NT, java -classic,<br>
+    60 times repeating the same iteration </font></td>
+  </tr>
+  <tr valign="middle" bgcolor="#33CC66" nowrap align="center"> 
+    <td nowrap> 
+    <div align="left"> Element type</div>
+    </td>
+    <td nowrap colspan="6"> Matrix2D type </td>
+  </tr>
+  <tr valign="middle" bgcolor="#66CCFF" nowrap align="center"> 
+    <td nowrap bgcolor="#FF9966" rowspan="2"> 
+    <div align="left"> .</div>
+    </td>
+    <td bgcolor="#FF9966" colspan="2"> 
+    <p><tt>DenseDoubleMatrix2D</tt><br>
+      1000 x 1000 </p>
+    </td>
+    <td bgcolor="#FF9966" colspan="2">&nbsp;</td>
+    <td bgcolor="#FF9966" colspan="2"> 
+    <p><tt>SparseDoubleMatrix2D</tt><br>
+      100 x 1000,<br>
+      <font size="-1"> minLoadFactor=0.2, maxLoadFactor=0.5, initialCapacity 
+      = 0</font></p>
+    </td>
+  </tr>
+  <tr valign="middle" bgcolor="#66CCFF" nowrap align="center"> 
+    <td bgcolor="#FF9966"> getQuick</td>
+    <td bgcolor="#FF9966"> setQuick</td>
+    <td bgcolor="#FF9966">&nbsp;</td>
+    <td bgcolor="#FF9966">&nbsp;</td>
+    <td bgcolor="#FF9966"> getQuick</td>
+    <td bgcolor="#FF9966">setQuick</td>
+  </tr>
+  <tr valign="middle" bgcolor="#66CCFF" nowrap align="center"> 
+    <td nowrap bgcolor="#FF9966">double</td>
+    <td nowrap>5</td>
+    <td nowrap>5</td>
+    <td nowrap>&nbsp;</td>
+    <td nowrap>&nbsp;</td>
+    <td nowrap>1</td>
+    <td nowrap>0.27</td>
+  </tr>
+  <tr valign="middle" bgcolor="#66CCFF" nowrap align="center"> 
+    <td nowrap bgcolor="#FF9966"> int</td>
+    <td nowrap>5 </td>
+    <td nowrap>5.5 </td>
+    <td nowrap>&nbsp;</td>
+    <td nowrap>&nbsp;</td>
+    <td nowrap>1 </td>
+    <td nowrap>0.3</td>
+  </tr>
   </table>
 </center>
 <p align="left"> As can be seen, sparse matrices are certainly not quite as quick 
@@ -84,73 +84,73 @@
 <p> 
 <center>
   <table border cellpadding="3" cellspacing="0" align="center" width="617">
-	<tr valign="middle" bgcolor="#33CC66" nowrap align="center"> 
-	  <td height="30" nowrap colspan="7"> <font size="+2">Iteration Performance 
-		[million element accesses per second]</font><br>
-		<font size="-1">Pentium Pro 200 Mhz, SunJDK 1.2.2, NT, java -classic,<br>
-		200 times repeating the same iteration </font></td>
-	</tr>
-	<tr valign="middle" bgcolor="#33CC66" nowrap align="center"> 
-	  <td width="78" height="30" nowrap> 
-		<div align="left"> Element type</div>
-	  </td>
-	  <td height="30" nowrap colspan="6"> 
-		<div align="center">Matrix2D type = Java array <tt>double[][]</tt></div>
-	  </td>
-	</tr>
-	<tr valign="middle" bgcolor="#66CCFF" nowrap align="center"> 
-	  <td width="78" height="60" nowrap bgcolor="#FF9966" rowspan="2"> 
-		<div align="left"> .</div>
-	  </td>
-	  <td height="132" bgcolor="#FF9966" colspan="2"> 
-		<p>Unoptimized Form<br>
-		  1000 x 1000<br>
-		<div align="left"> <font size="-1"> 
-		  <pre>
+  <tr valign="middle" bgcolor="#33CC66" nowrap align="center"> 
+    <td height="30" nowrap colspan="7"> <font size="+2">Iteration Performance 
+    [million element accesses per second]</font><br>
+    <font size="-1">Pentium Pro 200 Mhz, SunJDK 1.2.2, NT, java -classic,<br>
+    200 times repeating the same iteration </font></td>
+  </tr>
+  <tr valign="middle" bgcolor="#33CC66" nowrap align="center"> 
+    <td width="78" height="30" nowrap> 
+    <div align="left"> Element type</div>
+    </td>
+    <td height="30" nowrap colspan="6"> 
+    <div align="center">Matrix2D type = Java array <tt>double[][]</tt></div>
+    </td>
+  </tr>
+  <tr valign="middle" bgcolor="#66CCFF" nowrap align="center"> 
+    <td width="78" height="60" nowrap bgcolor="#FF9966" rowspan="2"> 
+    <div align="left"> .</div>
+    </td>
+    <td height="132" bgcolor="#FF9966" colspan="2"> 
+    <p>Unoptimized Form<br>
+      1000 x 1000<br>
+    <div align="left"> <font size="-1"> 
+      <pre>
 for (int row=0; row < rows; row++) { 
    for (int col=0; col < columns; ) { 
-	  value = m[row][col++];
-	  ...
+    value = m[row][col++];
+    ...
    }
 }
 </pre>
-		  </font> </div>
-	  </td>
-	  <td height="132" bgcolor="#FF9966" colspan="4"> Optimized Form<br>
-		1000 x 1000 
-		<div align="left"> <font size="-1"> 
-		  <pre>
+      </font> </div>
+    </td>
+    <td height="132" bgcolor="#FF9966" colspan="4"> Optimized Form<br>
+    1000 x 1000 
+    <div align="left"> <font size="-1"> 
+      <pre>
 for (int row=0; row < rows; row++) { 
    int[] r = matrix[row]; 
    for (int col=0; col < columns; ) { 
-	  value = r[col++];
-	  ...
+    value = r[col++];
+    ...
    }
 }
 </pre>
-		  </font> </div>
-	  </td>
-	</tr>
-	<tr valign="middle" bgcolor="#66CCFF" nowrap align="center"> 
-	  <td width="152" height="30" bgcolor="#FF9966"> getting</td>
-	  <td width="144" height="30" bgcolor="#FF9966"> setting</td>
-	  <td width="150" height="30" bgcolor="#FF9966"> getting</td>
-	  <td width="138" height="30" bgcolor="#FF9966" colspan="3"> setting</td>
-	</tr>
-	<tr valign="middle" bgcolor="#66CCFF" nowrap align="center"> 
-	  <td width="78" height="30" nowrap bgcolor="#FF9966">double</td>
-	  <td width="152" height="30" nowrap>1.6</td>
-	  <td width="144" height="30" nowrap>1.8</td>
-	  <td width="150" height="30" nowrap>18</td>
-	  <td width="138" height="30" nowrap colspan="3">11</td>
-	</tr>
-	<tr valign="middle" bgcolor="#66CCFF" nowrap align="center"> 
-	  <td width="78" height="30" nowrap bgcolor="#FF9966"> int</td>
-	  <td width="152" height="30" nowrap>1.5 </td>
-	  <td width="144" height="30" nowrap>1.8</td>
-	  <td width="150" height="30" nowrap>28</td>
-	  <td width="138" height="30" nowrap colspan="3">26</td>
-	</tr>
+      </font> </div>
+    </td>
+  </tr>
+  <tr valign="middle" bgcolor="#66CCFF" nowrap align="center"> 
+    <td width="152" height="30" bgcolor="#FF9966"> getting</td>
+    <td width="144" height="30" bgcolor="#FF9966"> setting</td>
+    <td width="150" height="30" bgcolor="#FF9966"> getting</td>
+    <td width="138" height="30" bgcolor="#FF9966" colspan="3"> setting</td>
+  </tr>
+  <tr valign="middle" bgcolor="#66CCFF" nowrap align="center"> 
+    <td width="78" height="30" nowrap bgcolor="#FF9966">double</td>
+    <td width="152" height="30" nowrap>1.6</td>
+    <td width="144" height="30" nowrap>1.8</td>
+    <td width="150" height="30" nowrap>18</td>
+    <td width="138" height="30" nowrap colspan="3">11</td>
+  </tr>
+  <tr valign="middle" bgcolor="#66CCFF" nowrap align="center"> 
+    <td width="78" height="30" nowrap bgcolor="#FF9966"> int</td>
+    <td width="152" height="30" nowrap>1.5 </td>
+    <td width="144" height="30" nowrap>1.8</td>
+    <td width="150" height="30" nowrap>28</td>
+    <td width="138" height="30" nowrap colspan="3">26</td>
+  </tr>
   </table>
 </center>
 <left> 
@@ -163,877 +163,877 @@
  * Makes this class non instantiable, but still let's others inherit from it.
  */
 protected BenchmarkMatrix2D() {
-	throw new RuntimeException("Non instantiable");
+  throw new RuntimeException("Non instantiable");
 }
 /**
  * Runs a bench on matrices holding double elements.
  */
 public static void doubleBenchmark(int runs, int rows, int columns, String kind, boolean print, int initialCapacity, double minLoadFactor, double maxLoadFactor) {
-	System.out.println("benchmarking double matrix");
-	// certain loops need to be constructed so that the jitter can't optimize them away and we get fantastic numbers.
-	// this involves primarly read-loops
+  System.out.println("benchmarking double matrix");
+  // certain loops need to be constructed so that the jitter can't optimize them away and we get fantastic numbers.
+  // this involves primarly read-loops
 
-	org.apache.mahout.matrix.Timer timer1 = new org.apache.mahout.matrix.Timer();
-	org.apache.mahout.matrix.Timer timer2 = new org.apache.mahout.matrix.Timer();
-	org.apache.mahout.matrix.Timer timer3 = new org.apache.mahout.matrix.Timer();
-	org.apache.mahout.matrix.Timer timer4 = new org.apache.mahout.matrix.Timer();
-	org.apache.mahout.matrix.Timer emptyLoop = new org.apache.mahout.matrix.Timer();
-	org.apache.mahout.matrix.Timer emptyLoop2 = new org.apache.mahout.matrix.Timer();
+  org.apache.mahout.matrix.Timer timer1 = new org.apache.mahout.matrix.Timer();
+  org.apache.mahout.matrix.Timer timer2 = new org.apache.mahout.matrix.Timer();
+  org.apache.mahout.matrix.Timer timer3 = new org.apache.mahout.matrix.Timer();
+  org.apache.mahout.matrix.Timer timer4 = new org.apache.mahout.matrix.Timer();
+  org.apache.mahout.matrix.Timer emptyLoop = new org.apache.mahout.matrix.Timer();
+  org.apache.mahout.matrix.Timer emptyLoop2 = new org.apache.mahout.matrix.Timer();
 
-	emptyLoop.start();
-	int dummy = 0;
-	for (int i=0; i<runs; i++) {
-		for (int column=0; column < columns; column++) {
-			for (int row=0; row < rows; row++) {
-				dummy++;
-			}
-		}
-	}
-	emptyLoop.stop();
-	System.out.println(dummy); // !!! so that the jitter can't optimize away the whole loop
-	
-	emptyLoop2.start();
-	dummy = 3;
-	double dummy2 = 0;
-	for (int i=0; i<runs; i++) {
-		for (int value = 0, column=0; column < columns; column++) {
-			for (int row=0; row < rows; row++) {
-				dummy2 += dummy;
-			}
-		}
-	}
-	emptyLoop2.stop();
-	System.out.println(dummy2); // !!! so that the jitter can't optimize away the whole loop
-	
+  emptyLoop.start();
+  int dummy = 0;
+  for (int i=0; i<runs; i++) {
+    for (int column=0; column < columns; column++) {
+      for (int row=0; row < rows; row++) {
+        dummy++;
+      }
+    }
+  }
+  emptyLoop.stop();
+  System.out.println(dummy); // !!! so that the jitter can't optimize away the whole loop
+  
+  emptyLoop2.start();
+  dummy = 3;
+  double dummy2 = 0;
+  for (int i=0; i<runs; i++) {
+    for (int value = 0, column=0; column < columns; column++) {
+      for (int row=0; row < rows; row++) {
+        dummy2 += dummy;
+      }
+    }
+  }
+  emptyLoop2.stop();
+  System.out.println(dummy2); // !!! so that the jitter can't optimize away the whole loop
+  
 
-	long before = Runtime.getRuntime().freeMemory();
-	long size = (((long)rows)*columns)*runs;
+  long before = Runtime.getRuntime().freeMemory();
+  long size = (((long)rows)*columns)*runs;
 
-	DoubleMatrix2D  matrix = null;
-	if (kind.equals("sparse")) matrix = new SparseDoubleMatrix2D(rows,columns,initialCapacity,minLoadFactor,maxLoadFactor);
-	else if (kind.equals("dense")) matrix = new DenseDoubleMatrix2D(rows,columns);
-	//else if (kind.equals("denseArray")) matrix = new DoubleArrayMatrix2D(rows,columns);
-	else throw new RuntimeException("unknown kind");
-	
-	System.out.println("\nNow filling...");
-	//if (kind.equals("sparse")) ((SparseDoubleMatrix2D)matrix).elements.hashCollisions = 0;
-	for (int i=0; i<runs; i++) {
-		matrix.assign(0);
-		matrix.ensureCapacity(initialCapacity);
-		if (kind.equals("sparse")) ((SparseDoubleMatrix2D)matrix).ensureCapacity(initialCapacity);
-		timer1.start();
-		int value = 0;
-		for (int row=0; row < rows; row++) {
-			for (int column=0; column < columns; column++) {
-				matrix.setQuick(row,column,value++);
-			}
-		}
-		timer1.stop();
-	}
-	timer1.display();
-	timer1.minus(emptyLoop).display();
-	System.out.println(size / timer1.minus(emptyLoop).seconds() +" elements / sec");
-	
-	Runtime.getRuntime().gc(); // invite gc
-	try { Thread.currentThread().sleep(1000); } catch (InterruptedException exc) {};
-	long after = Runtime.getRuntime().freeMemory();
-	System.out.println("KB needed="+(before-after) / 1024);
-	System.out.println("bytes needed per non-zero="+(before-after) / (double)matrix.cardinality());
-	if (print) {
-		System.out.println(matrix);
-		if (kind.equals("sparse")) System.out.println("map="+((SparseDoubleMatrix2D)matrix).elements);
-	}
-	/*
-	if (kind.equals("sparse")) {
-		int hashCollisions = ((SparseDoubleMatrix2D)matrix).elements.hashCollisions;
-		System.out.println("hashCollisions="+hashCollisions);
-		System.out.println("--> "+ ((double)hashCollisions / (rows*columns)) +" hashCollisions/element on average.");
-	}
-	*/
-	
-	System.out.println("\nNow reading...");
-	//if (kind.equals("sparse")) ((SparseDoubleMatrix2D)matrix).elements.hashCollisions = 0;
-	timer2.start();
-	double element=0;
-	for (int i=0; i<runs; i++) {
-		for (int row=0; row < rows; row++) {
-			for (int column=0; column < columns; column++) {
-				element += matrix.getQuick(row,column);
-			}
-		}		
-	}
-	timer2.stop().display();	
-	timer2.minus(emptyLoop2).display();
-	System.out.println(size / timer2.minus(emptyLoop2).seconds() +" elements / sec");
-	if (print) System.out.println(matrix);
-	//if (kind.equals("sparse")) System.out.println("hashCollisions="+((SparseDoubleMatrix2D)matrix).elements.hashCollisions);
-	System.out.println(element); // !!! so that the jitter can't optimize away the whole loop
-	
-	System.out.println("\nNow reading view...");
-	DoubleMatrix2D view = matrix.viewPart(0,0,rows,columns);
-	timer4.start();
-	element=0;
-	for (int i=0; i<runs; i++) {
-		for (int row=0; row < rows; row++) {
-			for (int column=0; column < columns; column++) {
-				element += view.getQuick(row,column);
-			}
-		}		
-	}
-	timer4.stop().display();	
-	timer4.minus(emptyLoop2).display();
-	System.out.println(size / timer4.minus(emptyLoop2).seconds() +" elements / sec");
-	if (print) System.out.println(view);
-	//if (kind.equals("sparse")) System.out.println("hashCollisions="+((SparseDoubleMatrix2D)view).elements.hashCollisions);
-	System.out.println(element); // !!! so that the jitter can't optimize away the whole loop
-	
-	System.out.println("\nNow removing...");
-	before = Runtime.getRuntime().freeMemory();
-	//if (kind.equals("sparse")) ((SparseDoubleMatrix2D)matrix).elements.hashCollisions = 0;
-	for (int i=0; i<runs; i++) {
-		// initializing
-		for (int row=0; row < rows; row++) {
-			for (int column=0; column < columns; column++) {
-				matrix.setQuick(row,column,1);
-			}
-		}
-		timer3.start();
-		for (int row=0; row < rows; row++) {
-			for (int column=0; column < columns; column++) {
-				matrix.setQuick(row,column,0);
-			}
-		}		
-		timer3.stop();
-	}
-	timer3.display();
-	timer3.minus(emptyLoop).display();
-	System.out.println(size / timer3.minus(emptyLoop).seconds() +" elements / sec");
-	Runtime.getRuntime().gc(); // invite gc
-	try { Thread.currentThread().sleep(1000); } catch (InterruptedException exc) {};
-	after = Runtime.getRuntime().freeMemory();
-	System.out.println("KB needed="+(before-after)/1024);
-	System.out.println("KB free="+(after/1024));
-	
-	if (print) System.out.println(matrix);
-	//if (kind.equals("sparse")) System.out.println("hashCollisions"+((SparseDoubleMatrix2D)matrix).elements.hashCollisions);
+  DoubleMatrix2D  matrix = null;
+  if (kind.equals("sparse")) matrix = new SparseDoubleMatrix2D(rows,columns,initialCapacity,minLoadFactor,maxLoadFactor);
+  else if (kind.equals("dense")) matrix = new DenseDoubleMatrix2D(rows,columns);
+  //else if (kind.equals("denseArray")) matrix = new DoubleArrayMatrix2D(rows,columns);
+  else throw new RuntimeException("unknown kind");
+  
+  System.out.println("\nNow filling...");
+  //if (kind.equals("sparse")) ((SparseDoubleMatrix2D)matrix).elements.hashCollisions = 0;
+  for (int i=0; i<runs; i++) {
+    matrix.assign(0);
+    matrix.ensureCapacity(initialCapacity);
+    if (kind.equals("sparse")) ((SparseDoubleMatrix2D)matrix).ensureCapacity(initialCapacity);
+    timer1.start();
+    int value = 0;
+    for (int row=0; row < rows; row++) {
+      for (int column=0; column < columns; column++) {
+        matrix.setQuick(row,column,value++);
+      }
+    }
+    timer1.stop();
+  }
+  timer1.display();
+  timer1.minus(emptyLoop).display();
+  System.out.println(size / timer1.minus(emptyLoop).seconds() +" elements / sec");
+  
+  Runtime.getRuntime().gc(); // invite gc
+  try { Thread.currentThread().sleep(1000); } catch (InterruptedException exc) {};
+  long after = Runtime.getRuntime().freeMemory();
+  System.out.println("KB needed="+(before-after) / 1024);
+  System.out.println("bytes needed per non-zero="+(before-after) / (double)matrix.cardinality());
+  if (print) {
+    System.out.println(matrix);
+    if (kind.equals("sparse")) System.out.println("map="+((SparseDoubleMatrix2D)matrix).elements);
+  }
+  /*
+  if (kind.equals("sparse")) {
+    int hashCollisions = ((SparseDoubleMatrix2D)matrix).elements.hashCollisions;
+    System.out.println("hashCollisions="+hashCollisions);
+    System.out.println("--> "+ ((double)hashCollisions / (rows*columns)) +" hashCollisions/element on average.");
+  }
+  */
+  
+  System.out.println("\nNow reading...");
+  //if (kind.equals("sparse")) ((SparseDoubleMatrix2D)matrix).elements.hashCollisions = 0;
+  timer2.start();
+  double element=0;
+  for (int i=0; i<runs; i++) {
+    for (int row=0; row < rows; row++) {
+      for (int column=0; column < columns; column++) {
+        element += matrix.getQuick(row,column);
+      }
+    }    
+  }
+  timer2.stop().display();  
+  timer2.minus(emptyLoop2).display();
+  System.out.println(size / timer2.minus(emptyLoop2).seconds() +" elements / sec");
+  if (print) System.out.println(matrix);
+  //if (kind.equals("sparse")) System.out.println("hashCollisions="+((SparseDoubleMatrix2D)matrix).elements.hashCollisions);
+  System.out.println(element); // !!! so that the jitter can't optimize away the whole loop
+  
+  System.out.println("\nNow reading view...");
+  DoubleMatrix2D view = matrix.viewPart(0,0,rows,columns);
+  timer4.start();
+  element=0;
+  for (int i=0; i<runs; i++) {
+    for (int row=0; row < rows; row++) {
+      for (int column=0; column < columns; column++) {
+        element += view.getQuick(row,column);
+      }
+    }    
+  }
+  timer4.stop().display();  
+  timer4.minus(emptyLoop2).display();
+  System.out.println(size / timer4.minus(emptyLoop2).seconds() +" elements / sec");
+  if (print) System.out.println(view);
+  //if (kind.equals("sparse")) System.out.println("hashCollisions="+((SparseDoubleMatrix2D)view).elements.hashCollisions);
+  System.out.println(element); // !!! so that the jitter can't optimize away the whole loop
+  
+  System.out.println("\nNow removing...");
+  before = Runtime.getRuntime().freeMemory();
+  //if (kind.equals("sparse")) ((SparseDoubleMatrix2D)matrix).elements.hashCollisions = 0;
+  for (int i=0; i<runs; i++) {
+    // initializing
+    for (int row=0; row < rows; row++) {
+      for (int column=0; column < columns; column++) {
+        matrix.setQuick(row,column,1);
+      }
+    }
+    timer3.start();
+    for (int row=0; row < rows; row++) {
+      for (int column=0; column < columns; column++) {
+        matrix.setQuick(row,column,0);
+      }
+    }    
+    timer3.stop();
+  }
+  timer3.display();
+  timer3.minus(emptyLoop).display();
+  System.out.println(size / timer3.minus(emptyLoop).seconds() +" elements / sec");
+  Runtime.getRuntime().gc(); // invite gc
+  try { Thread.currentThread().sleep(1000); } catch (InterruptedException exc) {};
+  after = Runtime.getRuntime().freeMemory();
+  System.out.println("KB needed="+(before-after)/1024);
+  System.out.println("KB free="+(after/1024));
+  
+  if (print) System.out.println(matrix);
+  //if (kind.equals("sparse")) System.out.println("hashCollisions"+((SparseDoubleMatrix2D)matrix).elements.hashCollisions);
 
 
-	System.out.println("bye bye.");
+  System.out.println("bye bye.");
 }
 /**
  * Runs a bench on matrices holding double elements.
  */
 public static void doubleBenchmarkMult(int runs, int rows, int columns, String kind, boolean print, int initialCapacity, double minLoadFactor, double maxLoadFactor) {
-	System.out.println("benchmarking double matrix");
-	// certain loops need to be constructed so that the jitter can't optimize them away and we get fantastic numbers.
-	// this involves primarly read-loops
+  System.out.println("benchmarking double matrix");
+  // certain loops need to be constructed so that the jitter can't optimize them away and we get fantastic numbers.
+  // this involves primarly read-loops
 
-	org.apache.mahout.matrix.Timer timer1 = new org.apache.mahout.matrix.Timer();
-	org.apache.mahout.matrix.Timer timer2 = new org.apache.mahout.matrix.Timer();
+  org.apache.mahout.matrix.Timer timer1 = new org.apache.mahout.matrix.Timer();
+  org.apache.mahout.matrix.Timer timer2 = new org.apache.mahout.matrix.Timer();
 
-	long size = (((long)rows)*columns)*runs;
+  long size = (((long)rows)*columns)*runs;
 
-	DoubleMatrix2D  matrix = null;
-	if (kind.equals("sparse")) matrix = new SparseDoubleMatrix2D(rows,columns,initialCapacity,minLoadFactor,maxLoadFactor);
-	else if (kind.equals("dense")) matrix = new DenseDoubleMatrix2D(rows,columns);
-	//else if (kind.equals("denseArray")) matrix = new DoubleArrayMatrix2D(rows,columns);
-	else throw new RuntimeException("unknown kind");
-	
-	System.out.println("\nNow multiplying...");
-	matrix.assign(1);
-	//if (kind.equals("sparse")) ((SparseDoubleMatrix2D)matrix).elements.hashCollisions = 0;
-	for (int i=0; i<runs; i++) {
-		timer1.start();
-		org.apache.mahout.matrix.matrix.doublealgo.Transform.mult(matrix, 3);
-		timer1.stop();
-	}
-	timer1.display();
-	System.out.println(size / timer1.seconds() +" elements / sec");
-	
-	if (print) {
-		System.out.println(matrix);
-	}
-	/*
-	if (kind.equals("sparse")) {
-		int hashCollisions = ((SparseDoubleMatrix2D)matrix).elements.hashCollisions;
-		System.out.println("hashCollisions="+hashCollisions);
-		System.out.println("--> "+ ((double)hashCollisions / (rows*columns)) +" hashCollisions/element on average.");
-	}
-	*/
-	
-	System.out.println("\nNow multiplying2...");
-	matrix.assign(1);
-	//if (kind.equals("sparse")) ((SparseDoubleMatrix2D)matrix).elements.hashCollisions = 0;
-	for (int i=0; i<runs; i++) {
-		timer2.start();
-		org.apache.mahout.matrix.matrix.doublealgo.Transform.mult(matrix,3);
-		timer2.stop();
-	}
-	timer2.display();
-	System.out.println(size / timer2.seconds() +" elements / sec");
-	
-	if (print) {
-		System.out.println(matrix);
-	}
-	/*
-	if (kind.equals("sparse")) {
-		int hashCollisions = ((SparseDoubleMatrix2D)matrix).elements.hashCollisions;
-		System.out.println("hashCollisions="+hashCollisions);
-		System.out.println("--> "+ ((double)hashCollisions / (rows*columns)) +" hashCollisions/element on average.");
-	}
-	*/
-	System.out.println("bye bye.");
+  DoubleMatrix2D  matrix = null;
+  if (kind.equals("sparse")) matrix = new SparseDoubleMatrix2D(rows,columns,initialCapacity,minLoadFactor,maxLoadFactor);
+  else if (kind.equals("dense")) matrix = new DenseDoubleMatrix2D(rows,columns);
+  //else if (kind.equals("denseArray")) matrix = new DoubleArrayMatrix2D(rows,columns);
+  else throw new RuntimeException("unknown kind");
+  
+  System.out.println("\nNow multiplying...");
+  matrix.assign(1);
+  //if (kind.equals("sparse")) ((SparseDoubleMatrix2D)matrix).elements.hashCollisions = 0;
+  for (int i=0; i<runs; i++) {
+    timer1.start();
+    org.apache.mahout.matrix.matrix.doublealgo.Transform.mult(matrix, 3);
+    timer1.stop();
+  }
+  timer1.display();
+  System.out.println(size / timer1.seconds() +" elements / sec");
+  
+  if (print) {
+    System.out.println(matrix);
+  }
+  /*
+  if (kind.equals("sparse")) {
+    int hashCollisions = ((SparseDoubleMatrix2D)matrix).elements.hashCollisions;
+    System.out.println("hashCollisions="+hashCollisions);
+    System.out.println("--> "+ ((double)hashCollisions / (rows*columns)) +" hashCollisions/element on average.");
+  }
+  */
+  
+  System.out.println("\nNow multiplying2...");
+  matrix.assign(1);
+  //if (kind.equals("sparse")) ((SparseDoubleMatrix2D)matrix).elements.hashCollisions = 0;
+  for (int i=0; i<runs; i++) {
+    timer2.start();
+    org.apache.mahout.matrix.matrix.doublealgo.Transform.mult(matrix,3);
+    timer2.stop();
+  }
+  timer2.display();
+  System.out.println(size / timer2.seconds() +" elements / sec");
+  
+  if (print) {
+    System.out.println(matrix);
+  }
+  /*
+  if (kind.equals("sparse")) {
+    int hashCollisions = ((SparseDoubleMatrix2D)matrix).elements.hashCollisions;
+    System.out.println("hashCollisions="+hashCollisions);
+    System.out.println("--> "+ ((double)hashCollisions / (rows*columns)) +" hashCollisions/element on average.");
+  }
+  */
+  System.out.println("bye bye.");
 }
 /**
  * Runs a bench on matrices holding double elements.
  */
 public static void doubleBenchmarkPrimitive(int runs, int rows, int columns, boolean print) {
-	// certain loops need to be constructed so that the jitter can't optimize them away and we get fantastic numbers.
-	// this involves primarly read-loops
-	org.apache.mahout.matrix.Timer timer1 = new org.apache.mahout.matrix.Timer();
-	org.apache.mahout.matrix.Timer timer2 = new org.apache.mahout.matrix.Timer();
-	org.apache.mahout.matrix.Timer timer3 = new org.apache.mahout.matrix.Timer();
-	org.apache.mahout.matrix.Timer emptyLoop = new org.apache.mahout.matrix.Timer();
-	org.apache.mahout.matrix.Timer emptyLoop2 = new org.apache.mahout.matrix.Timer();
+  // certain loops need to be constructed so that the jitter can't optimize them away and we get fantastic numbers.
+  // this involves primarly read-loops
+  org.apache.mahout.matrix.Timer timer1 = new org.apache.mahout.matrix.Timer();
+  org.apache.mahout.matrix.Timer timer2 = new org.apache.mahout.matrix.Timer();
+  org.apache.mahout.matrix.Timer timer3 = new org.apache.mahout.matrix.Timer();
+  org.apache.mahout.matrix.Timer emptyLoop = new org.apache.mahout.matrix.Timer();
+  org.apache.mahout.matrix.Timer emptyLoop2 = new org.apache.mahout.matrix.Timer();
 
-	emptyLoop.start();
-	int dummy = 0;
-	for (int i=0; i<runs; i++) {
-		for (int column=0; column < columns; column++) {
-			for (int row=0; row < rows; row++) {
-				dummy++;
-			}
-		}
-	}
-	emptyLoop.stop();
-	System.out.println(dummy); // !!! so that the jitter can't optimize away the whole loop
-	
-	emptyLoop2.start();
-	dummy = 3;
-	double dummy2 = 0;
-	for (int i=0; i<runs; i++) {
-		for (int column=0; column < columns; column++) {
-			for (int row=0; row < rows; row++) {
-				dummy2 += dummy;
-			}
-		}
-	}
-	emptyLoop2.stop();
-	System.out.println(dummy2); // !!! so that the jitter can't optimize away the whole loop
+  emptyLoop.start();
+  int dummy = 0;
+  for (int i=0; i<runs; i++) {
+    for (int column=0; column < columns; column++) {
+      for (int row=0; row < rows; row++) {
+        dummy++;
+      }
+    }
+  }
+  emptyLoop.stop();
+  System.out.println(dummy); // !!! so that the jitter can't optimize away the whole loop
+  
+  emptyLoop2.start();
+  dummy = 3;
+  double dummy2 = 0;
+  for (int i=0; i<runs; i++) {
+    for (int column=0; column < columns; column++) {
+      for (int row=0; row < rows; row++) {
+        dummy2 += dummy;
+      }
+    }
+  }
+  emptyLoop2.stop();
+  System.out.println(dummy2); // !!! so that the jitter can't optimize away the whole loop
 
-	long before = Runtime.getRuntime().freeMemory();
-	long size = (((long)rows)*columns)*runs;
+  long before = Runtime.getRuntime().freeMemory();
+  long size = (((long)rows)*columns)*runs;
 
-	double[][] matrix = new double[rows][columns];
-	
-	System.out.println("\nNow filling...");
-	for (int i=0; i<runs; i++) {
-		timer1.start();
-		int value = 0;
-		for (int column=0; column < columns; column++) {
-			for (int row=0; row < rows; row++) {
-				matrix[row][column] = value++;
-			}
-		}
-		timer1.stop();
-	}
-	timer1.display();
-	timer1.minus(emptyLoop).display();
-	System.out.println(size / timer1.minus(emptyLoop).seconds() +" elements / sec");
-	
-	Runtime.getRuntime().gc(); // invite gc
-	try { Thread.currentThread().sleep(1000); } catch (InterruptedException exc) {};
-	long after = Runtime.getRuntime().freeMemory();
-	System.out.println("KB needed="+(before-after) / 1024);
-	if (print) {
-		DenseDoubleMatrix2D m = new DenseDoubleMatrix2D(rows,columns);
-		m.assign(matrix);
-		System.out.println(m);
-	}
-	
-	System.out.println("\nNow reading...");
-	timer2.start();
-	double element=0;
-	for (int i=0; i<runs; i++) {
-		for (int column=0; column < columns; column++) {
-			for (int row=0; row < rows; row++) {
-				element += matrix[row][column]; 
-			}
-		}		
-	}
-	timer2.stop().display();	
-	timer2.minus(emptyLoop2).display();
-	System.out.println(size / timer2.minus(emptyLoop2).seconds() +" elements / sec");
-	if (print) {
-		DenseDoubleMatrix2D m = new DenseDoubleMatrix2D(rows,columns);
-		m.assign(matrix);
-		System.out.println(m);
-	}
-	System.out.println(element); // !!! so that the jitter can't optimize away the whole loop
-	
-	System.out.println("\nNow removing...");
-	before = Runtime.getRuntime().freeMemory();
-	for (int i=0; i<runs; i++) {
-		/*
-		// initializing
-		for (int column=0; column < columns; column++) {
-			for (int row=0; row < rows; row++) {
-				matrix.setQuick(row,column,1);
-			}
-		}
-		*/
-		timer3.start();
-		for (int column=0; column < columns; column++) {
-			for (int row=0; row < rows; row++) {
-				matrix[row][column] = 0;
-			}
-		}		
-		timer3.stop();
-	}
-	timer3.display();
-	timer3.minus(emptyLoop).display();
-	System.out.println(size / timer3.minus(emptyLoop).seconds() +" elements / sec");
-	Runtime.getRuntime().gc(); // invite gc
-	try { Thread.currentThread().sleep(1000); } catch (InterruptedException exc) {};
-	after = Runtime.getRuntime().freeMemory();
-	System.out.println("KB needed="+(before-after)/1024);
-	System.out.println("KB free="+(after/1024));
-	
-	if (print) {
-		DenseDoubleMatrix2D m = new DenseDoubleMatrix2D(rows,columns);
-		m.assign(matrix);
-		System.out.println(m);
-	}
+  double[][] matrix = new double[rows][columns];
+  
+  System.out.println("\nNow filling...");
+  for (int i=0; i<runs; i++) {
+    timer1.start();
+    int value = 0;
+    for (int column=0; column < columns; column++) {
+      for (int row=0; row < rows; row++) {
+        matrix[row][column] = value++;
+      }
+    }
+    timer1.stop();
+  }
+  timer1.display();
+  timer1.minus(emptyLoop).display();
+  System.out.println(size / timer1.minus(emptyLoop).seconds() +" elements / sec");
+  
+  Runtime.getRuntime().gc(); // invite gc
+  try { Thread.currentThread().sleep(1000); } catch (InterruptedException exc) {};
+  long after = Runtime.getRuntime().freeMemory();
+  System.out.println("KB needed="+(before-after) / 1024);
+  if (print) {
+    DenseDoubleMatrix2D m = new DenseDoubleMatrix2D(rows,columns);
+    m.assign(matrix);
+    System.out.println(m);
+  }
+  
+  System.out.println("\nNow reading...");
+  timer2.start();
+  double element=0;
+  for (int i=0; i<runs; i++) {
+    for (int column=0; column < columns; column++) {
+      for (int row=0; row < rows; row++) {
+        element += matrix[row][column]; 
+      }
+    }    
+  }
+  timer2.stop().display();  
+  timer2.minus(emptyLoop2).display();
+  System.out.println(size / timer2.minus(emptyLoop2).seconds() +" elements / sec");
+  if (print) {
+    DenseDoubleMatrix2D m = new DenseDoubleMatrix2D(rows,columns);
+    m.assign(matrix);
+    System.out.println(m);
+  }
+  System.out.println(element); // !!! so that the jitter can't optimize away the whole loop
+  
+  System.out.println("\nNow removing...");
+  before = Runtime.getRuntime().freeMemory();
+  for (int i=0; i<runs; i++) {
+    /*
+    // initializing
+    for (int column=0; column < columns; column++) {
+      for (int row=0; row < rows; row++) {
+        matrix.setQuick(row,column,1);
+      }
+    }
+    */
+    timer3.start();
+    for (int column=0; column < columns; column++) {
+      for (int row=0; row < rows; row++) {
+        matrix[row][column] = 0;
+      }
+    }    
+    timer3.stop();
+  }
+  timer3.display();
+  timer3.minus(emptyLoop).display();
+  System.out.println(size / timer3.minus(emptyLoop).seconds() +" elements / sec");
+  Runtime.getRuntime().gc(); // invite gc
+  try { Thread.currentThread().sleep(1000); } catch (InterruptedException exc) {};
+  after = Runtime.getRuntime().freeMemory();
+  System.out.println("KB needed="+(before-after)/1024);
+  System.out.println("KB free="+(after/1024));
+  
+  if (print) {
+    DenseDoubleMatrix2D m = new DenseDoubleMatrix2D(rows,columns);
+    m.assign(matrix);
+    System.out.println(m);
+  }
 
-	System.out.println("bye bye.");
+  System.out.println("bye bye.");
 }
 /**
  * Runs a bench on matrices holding double elements.
  */
 public static void doubleBenchmarkPrimitiveOptimized(int runs, int rows, int columns, boolean print) {
-	// certain loops need to be constructed so that the jitter can't optimize them away and we get fantastic numbers.
-	// this involves primarly read-loops
-	org.apache.mahout.matrix.Timer timer1 = new org.apache.mahout.matrix.Timer();
-	org.apache.mahout.matrix.Timer timer2 = new org.apache.mahout.matrix.Timer();
-	org.apache.mahout.matrix.Timer timer3 = new org.apache.mahout.matrix.Timer();
-	org.apache.mahout.matrix.Timer emptyLoop = new org.apache.mahout.matrix.Timer();
-	org.apache.mahout.matrix.Timer emptyLoop2 = new org.apache.mahout.matrix.Timer();
+  // certain loops need to be constructed so that the jitter can't optimize them away and we get fantastic numbers.
+  // this involves primarly read-loops
+  org.apache.mahout.matrix.Timer timer1 = new org.apache.mahout.matrix.Timer();
+  org.apache.mahout.matrix.Timer timer2 = new org.apache.mahout.matrix.Timer();
+  org.apache.mahout.matrix.Timer timer3 = new org.apache.mahout.matrix.Timer();
+  org.apache.mahout.matrix.Timer emptyLoop = new org.apache.mahout.matrix.Timer();
+  org.apache.mahout.matrix.Timer emptyLoop2 = new org.apache.mahout.matrix.Timer();
 
-	emptyLoop.start();
-	int dummy = 0;
-	for (int i=0; i<runs; i++) {
-		for (int column=0; column < columns; column++) {
-			for (int row=0; row < rows; row++) {
-				dummy++;
-			}
-		}
-	}
-	emptyLoop.stop();
-	System.out.println(dummy); // !!! so that the jitter can't optimize away the whole loop
-	
-	emptyLoop2.start();
-	dummy = 3;
-	double dummy2 = 0;
-	for (int i=0; i<runs; i++) {
-		for (int column=0; column < columns; column++) {
-			for (int row=0; row < rows; row++) {
-				dummy2 += dummy;
-			}
-		}
-	}
-	emptyLoop2.stop();
-	System.out.println(dummy2); // !!! so that the jitter can't optimize away the whole loop
+  emptyLoop.start();
+  int dummy = 0;
+  for (int i=0; i<runs; i++) {
+    for (int column=0; column < columns; column++) {
+      for (int row=0; row < rows; row++) {
+        dummy++;
+      }
+    }
+  }
+  emptyLoop.stop();
+  System.out.println(dummy); // !!! so that the jitter can't optimize away the whole loop
+  
+  emptyLoop2.start();
+  dummy = 3;
+  double dummy2 = 0;
+  for (int i=0; i<runs; i++) {
+    for (int column=0; column < columns; column++) {
+      for (int row=0; row < rows; row++) {
+        dummy2 += dummy;
+      }
+    }
+  }
+  emptyLoop2.stop();
+  System.out.println(dummy2); // !!! so that the jitter can't optimize away the whole loop
 
-	long before = Runtime.getRuntime().freeMemory();
-	long size = (((long)rows)*columns)*runs;
+  long before = Runtime.getRuntime().freeMemory();
+  long size = (((long)rows)*columns)*runs;
 
-	double[][] matrix = new double[rows][columns];
-	
-	System.out.println("\nNow filling...");
-	for (int i=0; i<runs; i++) {
-		timer1.start();
-		int value = 0;
-		for (int row=0; row < rows; row++) {
-			double[] r = matrix[row];
-			for (int column=0; column < columns; column++) {
-				r[column] = value++;
-				//matrix[row][column] = value++;
-			}
-		}
-		timer1.stop();
-	}
-	timer1.display();
-	timer1.minus(emptyLoop).display();
-	System.out.println(size / timer1.minus(emptyLoop).seconds() +" elements / sec");
-	
-	Runtime.getRuntime().gc(); // invite gc
-	try { Thread.currentThread().sleep(1000); } catch (InterruptedException exc) {};
-	long after = Runtime.getRuntime().freeMemory();
-	System.out.println("KB needed="+(before-after) / 1024);
-	if (print) {
-		DenseDoubleMatrix2D m = new DenseDoubleMatrix2D(rows,columns);
-		m.assign(matrix);
-		System.out.println(m);
-	}
-	
-	System.out.println("\nNow reading...");
-	timer2.start();
-	double element=0;
-	for (int i=0; i<runs; i++) {
-		for (int row=0; row < rows; row++) {
-			double[] r = matrix[row];
-			for (int column=0; column < columns; column++) {
-				element += r[column];
-				//element += matrix[row][column]; 
-			}
-		}		
-	}
-	timer2.stop().display();	
-	timer2.minus(emptyLoop2).display();
-	System.out.println(size / timer2.minus(emptyLoop2).seconds() +" elements / sec");
-	if (print) {
-		DenseDoubleMatrix2D m = new DenseDoubleMatrix2D(rows,columns);
-		m.assign(matrix);
-		System.out.println(m);
-	}
-	System.out.println(element); // !!! so that the jitter can't optimize away the whole loop
-	
-	System.out.println("\nNow removing...");
-	before = Runtime.getRuntime().freeMemory();
-	for (int i=0; i<runs; i++) {
-		timer3.start();
-		for (int row=0; row < rows; row++) {
-			double[] r = matrix[row];
-			for (int column=0; column < columns; column++) {
-				r[column] = 0;
-				//matrix[row][column] = 0;
-			}
-		}		
-		timer3.stop();
-	}
-	timer3.display();
-	timer3.minus(emptyLoop).display();
-	System.out.println(size / timer3.minus(emptyLoop).seconds() +" elements / sec");
-	Runtime.getRuntime().gc(); // invite gc
-	try { Thread.currentThread().sleep(1000); } catch (InterruptedException exc) {};
-	after = Runtime.getRuntime().freeMemory();
-	System.out.println("KB needed="+(before-after)/1024);
-	System.out.println("KB free="+(after/1024));
-	
-	if (print) {
-		DenseDoubleMatrix2D m = new DenseDoubleMatrix2D(rows,columns);
-		m.assign(matrix);
-		System.out.println(m);
-	}
+  double[][] matrix = new double[rows][columns];
+  
+  System.out.println("\nNow filling...");
+  for (int i=0; i<runs; i++) {
+    timer1.start();
+    int value = 0;
+    for (int row=0; row < rows; row++) {
+      double[] r = matrix[row];
+      for (int column=0; column < columns; column++) {
+        r[column] = value++;
+        //matrix[row][column] = value++;
+      }
+    }
+    timer1.stop();
+  }
+  timer1.display();
+  timer1.minus(emptyLoop).display();
+  System.out.println(size / timer1.minus(emptyLoop).seconds() +" elements / sec");
+  
+  Runtime.getRuntime().gc(); // invite gc
+  try { Thread.currentThread().sleep(1000); } catch (InterruptedException exc) {};
+  long after = Runtime.getRuntime().freeMemory();
+  System.out.println("KB needed="+(before-after) / 1024);
+  if (print) {
+    DenseDoubleMatrix2D m = new DenseDoubleMatrix2D(rows,columns);
+    m.assign(matrix);
+    System.out.println(m);
+  }
+  
+  System.out.println("\nNow reading...");
+  timer2.start();
+  double element=0;
+  for (int i=0; i<runs; i++) {
+    for (int row=0; row < rows; row++) {
+      double[] r = matrix[row];
+      for (int column=0; column < columns; column++) {
+        element += r[column];
+        //element += matrix[row][column]; 
+      }
+    }    
+  }
+  timer2.stop().display();  
+  timer2.minus(emptyLoop2).display();
+  System.out.println(size / timer2.minus(emptyLoop2).seconds() +" elements / sec");
+  if (print) {
+    DenseDoubleMatrix2D m = new DenseDoubleMatrix2D(rows,columns);
+    m.assign(matrix);
+    System.out.println(m);
+  }
+  System.out.println(element); // !!! so that the jitter can't optimize away the whole loop
+  
+  System.out.println("\nNow removing...");
+  before = Runtime.getRuntime().freeMemory();
+  for (int i=0; i<runs; i++) {
+    timer3.start();
+    for (int row=0; row < rows; row++) {
+      double[] r = matrix[row];
+      for (int column=0; column < columns; column++) {
+        r[column] = 0;
+        //matrix[row][column] = 0;
+      }
+    }    
+    timer3.stop();
+  }
+  timer3.display();
+  timer3.minus(emptyLoop).display();
+  System.out.println(size / timer3.minus(emptyLoop).seconds() +" elements / sec");
+  Runtime.getRuntime().gc(); // invite gc
+  try { Thread.currentThread().sleep(1000); } catch (InterruptedException exc) {};
+  after = Runtime.getRuntime().freeMemory();
+  System.out.println("KB needed="+(before-after)/1024);
+  System.out.println("KB free="+(after/1024));
+  
+  if (print) {
+    DenseDoubleMatrix2D m = new DenseDoubleMatrix2D(rows,columns);
+    m.assign(matrix);
+    System.out.println(m);
+  }
 
-	System.out.println("bye bye.");
+  System.out.println("bye bye.");
 }
 /**
  * Runs a bench on matrices holding int elements.
  */
 public static void intBenchmark(int runs, int rows, int columns, String kind, boolean print, int initialCapacity, double minLoadFactor, double maxLoadFactor) {
-	throw new InternalError();
-	/*
-	// certain loops need to be constructed so that the jitter can't optimize them away and we get fantastic numbers.
-	// this involves primarly read-loops
+  throw new InternalError();
+  /*
+  // certain loops need to be constructed so that the jitter can't optimize them away and we get fantastic numbers.
+  // this involves primarly read-loops
 
-	org.apache.mahout.matrix.Timer timer1 = new org.apache.mahout.matrix.Timer();
-	org.apache.mahout.matrix.Timer timer2 = new org.apache.mahout.matrix.Timer();
-	org.apache.mahout.matrix.Timer timer3 = new org.apache.mahout.matrix.Timer();
-	org.apache.mahout.matrix.Timer emptyLoop = new org.apache.mahout.matrix.Timer();
-	org.apache.mahout.matrix.Timer emptyLoop2 = new org.apache.mahout.matrix.Timer();
+  org.apache.mahout.matrix.Timer timer1 = new org.apache.mahout.matrix.Timer();
+  org.apache.mahout.matrix.Timer timer2 = new org.apache.mahout.matrix.Timer();
+  org.apache.mahout.matrix.Timer timer3 = new org.apache.mahout.matrix.Timer();
+  org.apache.mahout.matrix.Timer emptyLoop = new org.apache.mahout.matrix.Timer();
+  org.apache.mahout.matrix.Timer emptyLoop2 = new org.apache.mahout.matrix.Timer();
 
-	emptyLoop.start();
-	int dummy = 0;
-	for (int i=0; i<runs; i++) {
-		for (int column=0; column < columns; column++) {
-			for (int row=0; row < rows; row++) {
-				dummy++;
-			}
-		}
-	}
-	emptyLoop.stop();
-	System.out.println(dummy); // !!! so that the jitter can't optimize away the whole loop
-	
-	emptyLoop2.start();
-	dummy = 3;
-	int dummy2 = 0;
-	for (int i=0; i<runs; i++) {
-		for (int value = 0, column=0; column < columns; column++) {
-			for (int row=0; row < rows; row++) {
-				dummy2 += dummy;
-			}
-		}
-	}
-	emptyLoop2.stop();
-	System.out.println(dummy2); // !!! so that the jitter can't optimize away the whole loop
+  emptyLoop.start();
+  int dummy = 0;
+  for (int i=0; i<runs; i++) {
+    for (int column=0; column < columns; column++) {
+      for (int row=0; row < rows; row++) {
+        dummy++;
+      }
+    }
+  }
+  emptyLoop.stop();
+  System.out.println(dummy); // !!! so that the jitter can't optimize away the whole loop
+  
+  emptyLoop2.start();
+  dummy = 3;
+  int dummy2 = 0;
+  for (int i=0; i<runs; i++) {
+    for (int value = 0, column=0; column < columns; column++) {
+      for (int row=0; row < rows; row++) {
+        dummy2 += dummy;
+      }
+    }
+  }
+  emptyLoop2.stop();
+  System.out.println(dummy2); // !!! so that the jitter can't optimize away the whole loop
 
-	long before = Runtime.getRuntime().freeMemory();
-	long size = (((long)rows)*columns)*runs;
+  long before = Runtime.getRuntime().freeMemory();
+  long size = (((long)rows)*columns)*runs;
 
-	AbstractIntMatrix2D  matrix = null;
-	if (kind.equals("sparse")) matrix = new SparseIntMatrix2D(rows,columns,initialCapacity,minLoadFactor,maxLoadFactor);
-	else if (kind.equals("dense")) matrix = new DenseIntMatrix2D(rows,columns);
-	//else if (kind.equals("denseArray")) matrix = new DoubleArrayMatrix2D(rows,columns);
-	else throw new RuntimeException("unknown kind");
-	
-	System.out.println("\nNow filling...");
-	if (kind.equals("sparse")) ((SparseIntMatrix2D)matrix).elements.hashCollisions = 0;
-	for (int i=0; i<runs; i++) {
-		matrix.assign(0);
-		matrix.ensureCapacity(initialCapacity);
-		if (kind.equals("sparse")) ((SparseIntMatrix2D)matrix).ensureCapacity(initialCapacity);
-		timer1.start();
-		int value = 0;
-		for (int column=0; column < columns; column++) {
-			for (int row=0; row < rows; row++) {
-				matrix.setQuick(row,column,value++);
-			}
-		}
-		timer1.stop();
-	}
-	timer1.display();
-	timer1.minus(emptyLoop).display();
-	System.out.println(size / timer1.minus(emptyLoop).seconds() +" elements / sec");
-	
-	Runtime.getRuntime().gc(); // invite gc
-	try { Thread.currentThread().sleep(1000); } catch (InterruptedException exc) {};
-	long after = Runtime.getRuntime().freeMemory();
-	System.out.println("KB needed="+(before-after) / 1024);
-	System.out.println("bytes needed per non-zero="+(before-after) / (double)matrix.cardinality());
-	if (print) {
-		System.out.println(matrix);
-		if (kind.equals("sparse")) System.out.println("map="+((SparseIntMatrix2D)matrix).elements);
-	}
-	if (kind.equals("sparse")) {
-		int hashCollisions = ((SparseIntMatrix2D)matrix).elements.hashCollisions;
-		System.out.println("hashCollisions="+hashCollisions);
-		System.out.println("--> "+ ((double)hashCollisions / (rows*columns)) +" probes/element on average.");
-	}
-	
-	System.out.println("\nNow reading...");
-	if (kind.equals("sparse")) ((SparseIntMatrix2D)matrix).elements.hashCollisions = 0;
-	timer2.start();
-	int element=0;
-	for (int i=0; i<runs; i++) {
-		for (int column=0; column < columns; column++) {
-			for (int row=0; row < rows; row++) {
-				element += matrix.getQuick(row,column);
-			}
-		}		
-	}
-	timer2.stop().display();	
-	timer2.minus(emptyLoop2).display();
-	System.out.println(size / timer2.minus(emptyLoop2).seconds() +" elements / sec");
-	if (print) System.out.println(matrix);
-	if (kind.equals("sparse")) System.out.println("hashCollisions="+((SparseIntMatrix2D)matrix).elements.hashCollisions);
-	System.out.println(element); // !!! so that the jitter can't optimize away the whole loop
-	
-	System.out.println("\nNow removing...");
-	before = Runtime.getRuntime().freeMemory();
-	if (kind.equals("sparse")) ((SparseIntMatrix2D)matrix).elements.hashCollisions = 0;
-	for (int i=0; i<runs; i++) {
-		// initializing
-		for (int column=0; column < columns; column++) {
-			for (int row=0; row < rows; row++) {
-				matrix.setQuick(row,column,1);
-			}
-		}
-		timer3.start();
-		for (int column=0; column < columns; column++) {
-			for (int row=0; row < rows; row++) {
-				matrix.setQuick(row,column,0);
-			}
-		}		
-		timer3.stop();
-	}
-	timer3.display();
-	timer3.minus(emptyLoop).display();
-	System.out.println(size / timer3.minus(emptyLoop).seconds() +" elements / sec");
-	Runtime.getRuntime().gc(); // invite gc
-	try { Thread.currentThread().sleep(1000); } catch (InterruptedException exc) {};
-	after = Runtime.getRuntime().freeMemory();
-	System.out.println("KB needed="+(before-after)/1024);
-	System.out.println("KB free="+(after/1024));
-	
-	if (print) System.out.println(matrix);
-	if (kind.equals("sparse")) System.out.println("hashCollisions="+((SparseIntMatrix2D)matrix).elements.hashCollisions);
+  AbstractIntMatrix2D  matrix = null;
+  if (kind.equals("sparse")) matrix = new SparseIntMatrix2D(rows,columns,initialCapacity,minLoadFactor,maxLoadFactor);
+  else if (kind.equals("dense")) matrix = new DenseIntMatrix2D(rows,columns);
+  //else if (kind.equals("denseArray")) matrix = new DoubleArrayMatrix2D(rows,columns);
+  else throw new RuntimeException("unknown kind");
+  
+  System.out.println("\nNow filling...");
+  if (kind.equals("sparse")) ((SparseIntMatrix2D)matrix).elements.hashCollisions = 0;
+  for (int i=0; i<runs; i++) {
+    matrix.assign(0);
+    matrix.ensureCapacity(initialCapacity);
+    if (kind.equals("sparse")) ((SparseIntMatrix2D)matrix).ensureCapacity(initialCapacity);
+    timer1.start();
+    int value = 0;
+    for (int column=0; column < columns; column++) {
+      for (int row=0; row < rows; row++) {
+        matrix.setQuick(row,column,value++);
+      }
+    }
+    timer1.stop();
+  }
+  timer1.display();
+  timer1.minus(emptyLoop).display();
+  System.out.println(size / timer1.minus(emptyLoop).seconds() +" elements / sec");
+  
+  Runtime.getRuntime().gc(); // invite gc
+  try { Thread.currentThread().sleep(1000); } catch (InterruptedException exc) {};
+  long after = Runtime.getRuntime().freeMemory();
+  System.out.println("KB needed="+(before-after) / 1024);
+  System.out.println("bytes needed per non-zero="+(before-after) / (double)matrix.cardinality());
+  if (print) {
+    System.out.println(matrix);
+    if (kind.equals("sparse")) System.out.println("map="+((SparseIntMatrix2D)matrix).elements);
+  }
+  if (kind.equals("sparse")) {
+    int hashCollisions = ((SparseIntMatrix2D)matrix).elements.hashCollisions;
+    System.out.println("hashCollisions="+hashCollisions);
+    System.out.println("--> "+ ((double)hashCollisions / (rows*columns)) +" probes/element on average.");
+  }
+  
+  System.out.println("\nNow reading...");
+  if (kind.equals("sparse")) ((SparseIntMatrix2D)matrix).elements.hashCollisions = 0;
+  timer2.start();
+  int element=0;
+  for (int i=0; i<runs; i++) {
+    for (int column=0; column < columns; column++) {
+      for (int row=0; row < rows; row++) {
+        element += matrix.getQuick(row,column);
+      }
+    }    
+  }
+  timer2.stop().display();  
+  timer2.minus(emptyLoop2).display();
+  System.out.println(size / timer2.minus(emptyLoop2).seconds() +" elements / sec");
+  if (print) System.out.println(matrix);
+  if (kind.equals("sparse")) System.out.println("hashCollisions="+((SparseIntMatrix2D)matrix).elements.hashCollisions);
+  System.out.println(element); // !!! so that the jitter can't optimize away the whole loop
+  
+  System.out.println("\nNow removing...");
+  before = Runtime.getRuntime().freeMemory();
+  if (kind.equals("sparse")) ((SparseIntMatrix2D)matrix).elements.hashCollisions = 0;
+  for (int i=0; i<runs; i++) {
+    // initializing
+    for (int column=0; column < columns; column++) {
+      for (int row=0; row < rows; row++) {
+        matrix.setQuick(row,column,1);
+      }
+    }
+    timer3.start();
+    for (int column=0; column < columns; column++) {
+      for (int row=0; row < rows; row++) {
+        matrix.setQuick(row,column,0);
+      }
+    }    
+    timer3.stop();
+  }
+  timer3.display();
+  timer3.minus(emptyLoop).display();
+  System.out.println(size / timer3.minus(emptyLoop).seconds() +" elements / sec");
+  Runtime.getRuntime().gc(); // invite gc
+  try { Thread.currentThread().sleep(1000); } catch (InterruptedException exc) {};
+  after = Runtime.getRuntime().freeMemory();
+  System.out.println("KB needed="+(before-after)/1024);
+  System.out.println("KB free="+(after/1024));
+  
+  if (print) System.out.println(matrix);
+  if (kind.equals("sparse")) System.out.println("hashCollisions="+((SparseIntMatrix2D)matrix).elements.hashCollisions);
 
 
-	System.out.println("bye bye.");
-	*/
+  System.out.println("bye bye.");
+  */
 }
 /**
  * Runs a bench on matrices holding int elements.
  */
 public static void intBenchmarkPrimitive(int runs, int rows, int columns, boolean print) {
-	throw new InternalError();
-	/*
-	// certain loops need to be constructed so that the jitter can't optimize them away and we get fantastic numbers.
-	// this involves primarly read-loops
-	org.apache.mahout.matrix.Timer timer1 = new org.apache.mahout.matrix.Timer();
-	org.apache.mahout.matrix.Timer timer2 = new org.apache.mahout.matrix.Timer();
-	org.apache.mahout.matrix.Timer timer3 = new org.apache.mahout.matrix.Timer();
-	org.apache.mahout.matrix.Timer emptyLoop = new org.apache.mahout.matrix.Timer();
-	org.apache.mahout.matrix.Timer emptyLoop2 = new org.apache.mahout.matrix.Timer();
+  throw new InternalError();
+  /*
+  // certain loops need to be constructed so that the jitter can't optimize them away and we get fantastic numbers.
+  // this involves primarly read-loops
+  org.apache.mahout.matrix.Timer timer1 = new org.apache.mahout.matrix.Timer();
+  org.apache.mahout.matrix.Timer timer2 = new org.apache.mahout.matrix.Timer();
+  org.apache.mahout.matrix.Timer timer3 = new org.apache.mahout.matrix.Timer();
+  org.apache.mahout.matrix.Timer emptyLoop = new org.apache.mahout.matrix.Timer();
+  org.apache.mahout.matrix.Timer emptyLoop2 = new org.apache.mahout.matrix.Timer();
 
-	emptyLoop.start();
-	int dummy = 0;
-	for (int i=0; i<runs; i++) {
-		for (int column=0; column < columns; column++) {
-			for (int row=0; row < rows; row++) {
-				dummy++;
-			}
-		}
-	}
-	emptyLoop.stop();
-	System.out.println(dummy); // !!! so that the jitter can't optimize away the whole loop
-	
-	emptyLoop2.start();
-	dummy = 3;
-	int dummy2 = 0;
-	for (int i=0; i<runs; i++) {
-		for (int column=0; column < columns; column++) {
-			for (int row=0; row < rows; row++) {
-				dummy2 += dummy;
-			}
-		}
-	}
-	emptyLoop2.stop();
-	System.out.println(dummy2); // !!! so that the jitter can't optimize away the whole loop
+  emptyLoop.start();
+  int dummy = 0;
+  for (int i=0; i<runs; i++) {
+    for (int column=0; column < columns; column++) {
+      for (int row=0; row < rows; row++) {
+        dummy++;
+      }
+    }
+  }
+  emptyLoop.stop();
+  System.out.println(dummy); // !!! so that the jitter can't optimize away the whole loop
+  
+  emptyLoop2.start();
+  dummy = 3;
+  int dummy2 = 0;
+  for (int i=0; i<runs; i++) {
+    for (int column=0; column < columns; column++) {
+      for (int row=0; row < rows; row++) {
+        dummy2 += dummy;
+      }
+    }
+  }
+  emptyLoop2.stop();
+  System.out.println(dummy2); // !!! so that the jitter can't optimize away the whole loop
 
-	long before = Runtime.getRuntime().freeMemory();
-	long size = (((long)rows)*columns)*runs;
+  long before = Runtime.getRuntime().freeMemory();
+  long size = (((long)rows)*columns)*runs;
 
-	int[][] matrix = new int[rows][columns];
-	
-	System.out.println("\nNow filling...");
-	for (int i=0; i<runs; i++) {
-		timer1.start();
-		int value = 0;
-		for (int column=0; column < columns; column++) {
-			for (int row=0; row < rows; row++) {
-				matrix[row][column] = value++;
-			}
-		}
-		timer1.stop();
-	}
-	timer1.display();
-	timer1.minus(emptyLoop).display();
-	System.out.println(size / timer1.minus(emptyLoop).seconds() +" elements / sec");
-	
-	Runtime.getRuntime().gc(); // invite gc
-	try { Thread.currentThread().sleep(1000); } catch (InterruptedException exc) {};
-	long after = Runtime.getRuntime().freeMemory();
-	System.out.println("KB needed="+(before-after) / 1024);
-	if (print) {
-		DenseIntMatrix2D m = new DenseIntMatrix2D(rows,columns);
-		m.assign(matrix);
-		System.out.println(m);
-	}
-	
-	System.out.println("\nNow reading...");
-	timer2.start();
-	int element=0;
-	for (int i=0; i<runs; i++) {
-		for (int column=0; column < columns; column++) {
-			for (int row=0; row < rows; row++) {
-				element += matrix[row][column]; 
-			}
-		}		
-	}
-	timer2.stop().display();	
-	timer2.minus(emptyLoop2).display();
-	System.out.println(size / timer2.minus(emptyLoop2).seconds() +" elements / sec");
-	if (print) {
-		DenseIntMatrix2D m = new DenseIntMatrix2D(rows,columns);
-		m.assign(matrix);
-		System.out.println(m);
-	}
-	System.out.println(element); // !!! so that the jitter can't optimize away the whole loop
-	
-	System.out.println("\nNow removing...");
-	before = Runtime.getRuntime().freeMemory();
-	for (int i=0; i<runs; i++) {
-		timer3.start();
-		for (int column=0; column < columns; column++) {
-			for (int row=0; row < rows; row++) {
-				matrix[row][column] = 0;
-			}
-		}		
-		timer3.stop();
-	}
-	timer3.display();
-	timer3.minus(emptyLoop).display();
-	System.out.println(size / timer3.minus(emptyLoop).seconds() +" elements / sec");
-	Runtime.getRuntime().gc(); // invite gc
-	try { Thread.currentThread().sleep(1000); } catch (InterruptedException exc) {};
-	after = Runtime.getRuntime().freeMemory();
-	System.out.println("KB needed="+(before-after)/1024);
-	System.out.println("KB free="+(after/1024));
-	
-	if (print) {
-		DenseIntMatrix2D m = new DenseIntMatrix2D(rows,columns);
-		m.assign(matrix);
-		System.out.println(m);
-	}
+  int[][] matrix = new int[rows][columns];
+  
+  System.out.println("\nNow filling...");
+  for (int i=0; i<runs; i++) {
+    timer1.start();
+    int value = 0;
+    for (int column=0; column < columns; column++) {
+      for (int row=0; row < rows; row++) {
+        matrix[row][column] = value++;
+      }
+    }
+    timer1.stop();
+  }
+  timer1.display();
+  timer1.minus(emptyLoop).display();
+  System.out.println(size / timer1.minus(emptyLoop).seconds() +" elements / sec");
+  
+  Runtime.getRuntime().gc(); // invite gc
+  try { Thread.currentThread().sleep(1000); } catch (InterruptedException exc) {};
+  long after = Runtime.getRuntime().freeMemory();
+  System.out.println("KB needed="+(before-after) / 1024);
+  if (print) {
+    DenseIntMatrix2D m = new DenseIntMatrix2D(rows,columns);
+    m.assign(matrix);
+    System.out.println(m);
+  }
+  
+  System.out.println("\nNow reading...");
+  timer2.start();
+  int element=0;
+  for (int i=0; i<runs; i++) {
+    for (int column=0; column < columns; column++) {
+      for (int row=0; row < rows; row++) {
+        element += matrix[row][column]; 
+      }
+    }    
+  }
+  timer2.stop().display();  
+  timer2.minus(emptyLoop2).display();
+  System.out.println(size / timer2.minus(emptyLoop2).seconds() +" elements / sec");
+  if (print) {
+    DenseIntMatrix2D m = new DenseIntMatrix2D(rows,columns);
+    m.assign(matrix);
+    System.out.println(m);
+  }
+  System.out.println(element); // !!! so that the jitter can't optimize away the whole loop
+  
+  System.out.println("\nNow removing...");
+  before = Runtime.getRuntime().freeMemory();
+  for (int i=0; i<runs; i++) {
+    timer3.start();
+    for (int column=0; column < columns; column++) {
+      for (int row=0; row < rows; row++) {
+        matrix[row][column] = 0;
+      }
+    }    
+    timer3.stop();
+  }
+  timer3.display();
+  timer3.minus(emptyLoop).display();
+  System.out.println(size / timer3.minus(emptyLoop).seconds() +" elements / sec");
+  Runtime.getRuntime().gc(); // invite gc
+  try { Thread.currentThread().sleep(1000); } catch (InterruptedException exc) {};
+  after = Runtime.getRuntime().freeMemory();
+  System.out.println("KB needed="+(before-after)/1024);
+  System.out.println("KB free="+(after/1024));
+  
+  if (print) {
+    DenseIntMatrix2D m = new DenseIntMatrix2D(rows,columns);
+    m.assign(matrix);
+    System.out.println(m);
+  }
 
-	System.out.println("bye bye.");
-	*/
+  System.out.println("bye bye.");
+  */
 }
 /**
  * Runs a bench on matrices holding int elements.
  */
 public static void intBenchmarkPrimitiveOptimized(int runs, int rows, int columns, boolean print) {
-	throw new InternalError();
-	/*
-	// certain loops need to be constructed so that the jitter can't optimize them away and we get fantastic numbers.
-	// this involves primarly read-loops
-	org.apache.mahout.matrix.Timer timer1 = new org.apache.mahout.matrix.Timer();
-	org.apache.mahout.matrix.Timer timer2 = new org.apache.mahout.matrix.Timer();
-	org.apache.mahout.matrix.Timer timer3 = new org.apache.mahout.matrix.Timer();
-	org.apache.mahout.matrix.Timer emptyLoop = new org.apache.mahout.matrix.Timer();
-	org.apache.mahout.matrix.Timer emptyLoop2 = new org.apache.mahout.matrix.Timer();
+  throw new InternalError();
+  /*
+  // certain loops need to be constructed so that the jitter can't optimize them away and we get fantastic numbers.
+  // this involves primarly read-loops
+  org.apache.mahout.matrix.Timer timer1 = new org.apache.mahout.matrix.Timer();
+  org.apache.mahout.matrix.Timer timer2 = new org.apache.mahout.matrix.Timer();
+  org.apache.mahout.matrix.Timer timer3 = new org.apache.mahout.matrix.Timer();
+  org.apache.mahout.matrix.Timer emptyLoop = new org.apache.mahout.matrix.Timer();
+  org.apache.mahout.matrix.Timer emptyLoop2 = new org.apache.mahout.matrix.Timer();
 
-	emptyLoop.start();
-	int dummy = 0;
-	for (int i=0; i<runs; i++) {
-		for (int column=0; column < columns; column++) {
-			for (int row=0; row < rows; row++) {
-				dummy++;
-			}
-		}
-	}
-	emptyLoop.stop();
-	System.out.println(dummy); // !!! so that the jitter can't optimize away the whole loop
-	
-	int[][] matrix = new int[rows][columns];
-	emptyLoop2.start();
-	dummy = 3;
-	int dummy2 = 7;
-	System.out.println(dummy2); // !!! so that the jitter can't optimize away the whole loop
-	for (int i=0; i<runs; i++) {
-		for (int column=0; column < columns; column++) {
-			for (int row=0; row < rows; row++) {
-				dummy2 += dummy; //matrix[row][column];
-			}
-		}
-	}
-	emptyLoop2.stop();
-	System.out.println(dummy2); // !!! so that the jitter can't optimize away the whole loop
+  emptyLoop.start();
+  int dummy = 0;
+  for (int i=0; i<runs; i++) {
+    for (int column=0; column < columns; column++) {
+      for (int row=0; row < rows; row++) {
+        dummy++;
+      }
+    }
+  }
+  emptyLoop.stop();
+  System.out.println(dummy); // !!! so that the jitter can't optimize away the whole loop
+  
+  int[][] matrix = new int[rows][columns];
+  emptyLoop2.start();
+  dummy = 3;
+  int dummy2 = 7;
+  System.out.println(dummy2); // !!! so that the jitter can't optimize away the whole loop
+  for (int i=0; i<runs; i++) {
+    for (int column=0; column < columns; column++) {
+      for (int row=0; row < rows; row++) {
+        dummy2 += dummy; //matrix[row][column];
+      }
+    }
+  }
+  emptyLoop2.stop();
+  System.out.println(dummy2); // !!! so that the jitter can't optimize away the whole loop
 
-	long before = Runtime.getRuntime().freeMemory();
-	long size = (((long)rows)*columns)*runs;
+  long before = Runtime.getRuntime().freeMemory();
+  long size = (((long)rows)*columns)*runs;
 
-	
-	System.out.println("\nNow filling...");
-	for (int i=0; i<runs; i++) {
-		timer1.start();
-		int value = 0;
-		for (int row=0; row < rows; row++) {
-			int[] r = matrix[row];
-			for (int column=0; column < columns; column++) {
-				r[column] = value++;
-				//matrix[row][column] = value++;
-			}
-		}
-		timer1.stop();
-	}
-	timer1.display();
-	timer1.minus(emptyLoop).display();
-	System.out.println(size / timer1.minus(emptyLoop).seconds() +" elements / sec");
-	
-	Runtime.getRuntime().gc(); // invite gc
-	try { Thread.currentThread().sleep(1000); } catch (InterruptedException exc) {};
-	long after = Runtime.getRuntime().freeMemory();
-	System.out.println("KB needed="+(before-after) / 1024);
-	if (print) {
-		DenseIntMatrix2D m = new DenseIntMatrix2D(rows,columns);
-		m.assign(matrix);
-		System.out.println(m);
-	}
-	
-	System.out.println("\nNow reading...");
-	timer2.start();
-	int element=0;
-	for (int i=0; i<runs; i++) {
-		for (int row=0; row < rows; row++) {
-			int[] r = matrix[row];
-			for (int column=0; column < columns; column++) {
-				element += r[column];
-				//element += matrix[row][column]; 
-			}
-		}		
-	}
-	timer2.stop().display();	
-	timer2.minus(emptyLoop2).display();
-	System.out.println(size / timer2.minus(emptyLoop2).seconds() +" elements / sec");
-	if (print) {
-		DenseIntMatrix2D m = new DenseIntMatrix2D(rows,columns);
-		m.assign(matrix);
-		System.out.println(m);
-	}
-	System.out.println(element); // !!! so that the jitter can't optimize away the whole loop
-	
-	System.out.println("\nNow removing...");
-	before = Runtime.getRuntime().freeMemory();
-	for (int i=0; i<runs; i++) {
-		timer3.start();
-		for (int row=0; row < rows; row++) {
-			int[] r = matrix[row];
-			for (int column=0; column < columns; column++) {
-				r[column] = 0;
-				//matrix[row][column] = 0;
-			}
-		}		
-		timer3.stop();
-	}
-	timer3.display();
-	timer3.minus(emptyLoop).display();
-	System.out.println(size / timer3.minus(emptyLoop).seconds() +" elements / sec");
-	Runtime.getRuntime().gc(); // invite gc
-	try { Thread.currentThread().sleep(1000); } catch (InterruptedException exc) {};
-	after = Runtime.getRuntime().freeMemory();
-	System.out.println("KB needed="+(before-after)/1024);
-	System.out.println("KB free="+(after/1024));
-	
-	if (print) {
-		DenseIntMatrix2D m = new DenseIntMatrix2D(rows,columns);
-		m.assign(matrix);
-		System.out.println(m);
-	}
+  
+  System.out.println("\nNow filling...");
+  for (int i=0; i<runs; i++) {
+    timer1.start();
+    int value = 0;
+    for (int row=0; row < rows; row++) {
+      int[] r = matrix[row];
+      for (int column=0; column < columns; column++) {
+        r[column] = value++;
+        //matrix[row][column] = value++;
+      }
+    }
+    timer1.stop();
+  }
+  timer1.display();
+  timer1.minus(emptyLoop).display();
+  System.out.println(size / timer1.minus(emptyLoop).seconds() +" elements / sec");
+  
+  Runtime.getRuntime().gc(); // invite gc
+  try { Thread.currentThread().sleep(1000); } catch (InterruptedException exc) {};
+  long after = Runtime.getRuntime().freeMemory();
+  System.out.println("KB needed="+(before-after) / 1024);
+  if (print) {
+    DenseIntMatrix2D m = new DenseIntMatrix2D(rows,columns);
+    m.assign(matrix);
+    System.out.println(m);
+  }
+  
+  System.out.println("\nNow reading...");
+  timer2.start();
+  int element=0;
+  for (int i=0; i<runs; i++) {
+    for (int row=0; row < rows; row++) {
+      int[] r = matrix[row];
+      for (int column=0; column < columns; column++) {
+        element += r[column];
+        //element += matrix[row][column]; 
+      }
+    }    
+  }
+  timer2.stop().display();  
+  timer2.minus(emptyLoop2).display();
+  System.out.println(size / timer2.minus(emptyLoop2).seconds() +" elements / sec");
+  if (print) {
+    DenseIntMatrix2D m = new DenseIntMatrix2D(rows,columns);
+    m.assign(matrix);
+    System.out.println(m);
+  }
+  System.out.println(element); // !!! so that the jitter can't optimize away the whole loop
+  
+  System.out.println("\nNow removing...");
+  before = Runtime.getRuntime().freeMemory();
+  for (int i=0; i<runs; i++) {
+    timer3.start();
+    for (int row=0; row < rows; row++) {
+      int[] r = matrix[row];
+      for (int column=0; column < columns; column++) {
+        r[column] = 0;
+        //matrix[row][column] = 0;
+      }
+    }    
+    timer3.stop();
+  }
+  timer3.display();
+  timer3.minus(emptyLoop).display();
+  System.out.println(size / timer3.minus(emptyLoop).seconds() +" elements / sec");
+  Runtime.getRuntime().gc(); // invite gc
+  try { Thread.currentThread().sleep(1000); } catch (InterruptedException exc) {};
+  after = Runtime.getRuntime().freeMemory();
+  System.out.println("KB needed="+(before-after)/1024);
+  System.out.println("KB free="+(after/1024));
+  
+  if (print) {
+    DenseIntMatrix2D m = new DenseIntMatrix2D(rows,columns);
+    m.assign(matrix);
+    System.out.println(m);
+  }
 
-	System.out.println("bye bye.");
-	*/
+  System.out.println("bye bye.");
+  */
 }
 /**
  * Benchmarks various methods of this class.
  */
 public static void main(String args[]) {
-	int runs = Integer.parseInt(args[0]);
-	int rows = Integer.parseInt(args[1]);
-	int columns = Integer.parseInt(args[2]);
-	//int size = Integer.parseInt(args[3]);
-	//boolean isSparse = args[4].equals("sparse");
-	String kind = args[3];
-	int initialCapacity = Integer.parseInt(args[4]);
-	double minLoadFactor = new Double(args[5]).doubleValue();
-	double maxLoadFactor = new Double(args[6]).doubleValue();
-	boolean print = args[7].equals("print");
-	String type = args[8];
-	String command = args[9];
-	
-	if (type.equals("int")) {
-		if (kind.equals("primitive")) intBenchmarkPrimitive(runs,rows,columns,print);
-		else if (kind.equals("primitiveOpt")) intBenchmarkPrimitiveOptimized(runs,rows,columns,print);
-		else intBenchmark(runs,rows,columns,kind,print,initialCapacity,minLoadFactor,maxLoadFactor);
-	}
-	else if (type.equals("double")) {
-		if (kind.equals("primitive")) doubleBenchmarkPrimitive(runs,rows,columns,print);
-		else if (kind.equals("primitiveOpt")) doubleBenchmarkPrimitiveOptimized(runs,rows,columns,print);
-		else if (command.equals("mult")) doubleBenchmarkMult(runs,rows,columns,kind,print,initialCapacity,minLoadFactor,maxLoadFactor);
-		else doubleBenchmark(runs,rows,columns,kind,print,initialCapacity,minLoadFactor,maxLoadFactor);
-	}
-	 
+  int runs = Integer.parseInt(args[0]);
+  int rows = Integer.parseInt(args[1]);
+  int columns = Integer.parseInt(args[2]);
+  //int size = Integer.parseInt(args[3]);
+  //boolean isSparse = args[4].equals("sparse");
+  String kind = args[3];
+  int initialCapacity = Integer.parseInt(args[4]);
+  double minLoadFactor = new Double(args[5]).doubleValue();
+  double maxLoadFactor = new Double(args[6]).doubleValue();
+  boolean print = args[7].equals("print");
+  String type = args[8];
+  String command = args[9];
+  
+  if (type.equals("int")) {
+    if (kind.equals("primitive")) intBenchmarkPrimitive(runs,rows,columns,print);
+    else if (kind.equals("primitiveOpt")) intBenchmarkPrimitiveOptimized(runs,rows,columns,print);
+    else intBenchmark(runs,rows,columns,kind,print,initialCapacity,minLoadFactor,maxLoadFactor);
+  }
+  else if (type.equals("double")) {
+    if (kind.equals("primitive")) doubleBenchmarkPrimitive(runs,rows,columns,print);
+    else if (kind.equals("primitiveOpt")) doubleBenchmarkPrimitiveOptimized(runs,rows,columns,print);
+    else if (command.equals("mult")) doubleBenchmarkMult(runs,rows,columns,kind,print,initialCapacity,minLoadFactor,maxLoadFactor);
+    else doubleBenchmark(runs,rows,columns,kind,print,initialCapacity,minLoadFactor,maxLoadFactor);
+  }
+   
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SelectedDenseObjectMatrix1D.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SelectedDenseObjectMatrix1D.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SelectedDenseObjectMatrix1D.java	(working copy)
@@ -43,27 +43,27 @@
 @version 1.0, 09/24/99
 */
 class SelectedDenseObjectMatrix1D extends ObjectMatrix1D {
-	/**
-	  * The elements of this matrix.
-	  */
-	protected Object[] elements;
-	
-	/**
-	  * The offsets of visible indexes of this matrix.
-	  */
-	protected int[] offsets;
+  /**
+    * The elements of this matrix.
+    */
+  protected Object[] elements;
+  
+  /**
+    * The offsets of visible indexes of this matrix.
+    */
+  protected int[] offsets;
 
-	/**
-	  * The offset.
-	  */
-	protected int offset;	
+  /**
+    * The offset.
+    */
+  protected int offset;  
 /**
  * Constructs a matrix view with the given parameters.
  * @param elements the cells.
  * @param  indexes   The indexes of the cells that shall be visible.
  */
 protected SelectedDenseObjectMatrix1D(Object[] elements, int[] offsets) {
-	this(offsets.length,elements,0,1,offsets,0);
+  this(offsets.length,elements,0,1,offsets,0);
 }
 /**
  * Constructs a matrix view with the given parameters.
@@ -75,12 +75,12 @@
  * @param offset   
  */
 protected SelectedDenseObjectMatrix1D(int size, Object[] elements, int zero, int stride, int[] offsets, int offset) {
-	setUp(size,zero,stride);
-	
-	this.elements = elements;
-	this.offsets = offsets;
-	this.offset = offset;
-	this.isNoView = false;
+  setUp(size,zero,stride);
+  
+  this.elements = elements;
+  this.offsets = offsets;
+  this.offset = offset;
+  this.isNoView = false;
 }
 /**
  * Returns the position of the given absolute rank within the (virtual or non-virtual) internal 1-dimensional array. 
@@ -90,7 +90,7 @@
  * @return the position.
  */
 protected int _offset(int absRank) {
-	return offsets[absRank];
+  return offsets[absRank];
 }
 /**
  * Returns the matrix cell value at coordinate <tt>index</tt>.
@@ -103,24 +103,24 @@
  * @return    the value of the specified cell.
  */
 public Object getQuick(int index) {
-	//if (debug) if (index<0 || index>=size) checkIndex(index);
-	//return elements[index(index)];
-	//manually inlined:
-	return elements[offset + offsets[zero + index*stride]];
+  //if (debug) if (index<0 || index>=size) checkIndex(index);
+  //return elements[index(index)];
+  //manually inlined:
+  return elements[offset + offsets[zero + index*stride]];
 }
 /**
  * Returns <tt>true</tt> if both matrices share at least one identical cell.
  */
 protected boolean haveSharedCellsRaw(ObjectMatrix1D other) {
-	if (other instanceof SelectedDenseObjectMatrix1D) {
-		SelectedDenseObjectMatrix1D otherMatrix = (SelectedDenseObjectMatrix1D) other;
-		return this.elements==otherMatrix.elements;
-	}
-	else if (other instanceof DenseObjectMatrix1D) {
-		DenseObjectMatrix1D otherMatrix = (DenseObjectMatrix1D) other;
-		return this.elements==otherMatrix.elements;
-	}
-	return false;
+  if (other instanceof SelectedDenseObjectMatrix1D) {
+    SelectedDenseObjectMatrix1D otherMatrix = (SelectedDenseObjectMatrix1D) other;
+    return this.elements==otherMatrix.elements;
+  }
+  else if (other instanceof DenseObjectMatrix1D) {
+    DenseObjectMatrix1D otherMatrix = (DenseObjectMatrix1D) other;
+    return this.elements==otherMatrix.elements;
+  }
+  return false;
 }
 /**
  * Returns the position of the element with the given relative rank within the (virtual or non-virtual) internal 1-dimensional array.
@@ -129,9 +129,9 @@
  * @param     rank   the rank of the element.
  */
 protected int index(int rank) {
-	//return this.offset + super.index(rank);
-	// manually inlined:
-	return offset + offsets[zero + rank*stride];
+  //return this.offset + super.index(rank);
+  // manually inlined:
+  return offset + offsets[zero + rank*stride];
 }
 /**
  * Construct and returns a new empty matrix <i>of the same dynamic type</i> as the receiver, having the specified size.
@@ -143,7 +143,7 @@
  * @return  a new empty matrix of the same dynamic type.
  */
 public ObjectMatrix1D like(int size) {
-	return new DenseObjectMatrix1D(size);
+  return new DenseObjectMatrix1D(size);
 }
 /**
  * Construct and returns a new 2-d matrix <i>of the corresponding dynamic type</i>, entirelly independent of the receiver.
@@ -155,7 +155,7 @@
  * @return  a new matrix of the corresponding dynamic type.
  */
 public ObjectMatrix2D like2D(int rows, int columns) {
-	return new DenseObjectMatrix2D(rows,columns);
+  return new DenseObjectMatrix2D(rows,columns);
 }
 /**
  * Sets the matrix cell at coordinate <tt>index</tt> to the specified value.
@@ -168,19 +168,19 @@
  * @param    value the value to be filled into the specified cell.
  */
 public void setQuick(int index, Object value) {
-	//if (debug) if (index<0 || index>=size) checkIndex(index);
-	//elements[index(index)] = value;
-	//manually inlined:
-	elements[offset + offsets[zero + index*stride]] = value;
+  //if (debug) if (index<0 || index>=size) checkIndex(index);
+  //elements[index(index)] = value;
+  //manually inlined:
+  elements[offset + offsets[zero + index*stride]] = value;
 }
 /**
  * Sets up a matrix with a given number of cells.
  * @param size the number of cells the matrix shall have.
  */
 protected void setUp(int size) {
-	super.setUp(size);
-	this.stride = 1;
-	this.offset = 0;
+  super.setUp(size);
+  this.stride = 1;
+  this.offset = 0;
 }
 /**
  * Construct and returns a new selection view.
@@ -189,6 +189,6 @@
  * @return  a new view.
  */
 protected ObjectMatrix1D viewSelectionLike(int[] offsets) {
-	return new SelectedDenseObjectMatrix1D(this.elements,offsets);
+  return new SelectedDenseObjectMatrix1D(this.elements,offsets);
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SelectedDenseObjectMatrix2D.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SelectedDenseObjectMatrix2D.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SelectedDenseObjectMatrix2D.java	(working copy)
@@ -43,21 +43,21 @@
 @version 1.0, 09/24/99
 */
 class SelectedDenseObjectMatrix2D extends ObjectMatrix2D {
-	/**
-	  * The elements of this matrix.
-	  */
-	protected Object[] elements;
-	
-	/**
-	  * The offsets of the visible cells of this matrix.
-	  */
-	protected int[] rowOffsets;
-	protected int[] columnOffsets;
-	
-	/**
-	  * The offset.
-	  */
-	protected int offset;	
+  /**
+    * The elements of this matrix.
+    */
+  protected Object[] elements;
+  
+  /**
+    * The offsets of the visible cells of this matrix.
+    */
+  protected int[] rowOffsets;
+  protected int[] columnOffsets;
+  
+  /**
+    * The offset.
+    */
+  protected int offset;  
 /**
  * Constructs a matrix view with the given parameters.
  * @param elements the cells.
@@ -66,7 +66,7 @@
  * @param  offset   
  */
 protected SelectedDenseObjectMatrix2D(Object[] elements, int[] rowOffsets, int[] columnOffsets, int offset) {
-	this(rowOffsets.length,columnOffsets.length,elements,0,0,1,1,rowOffsets,columnOffsets,offset);
+  this(rowOffsets.length,columnOffsets.length,elements,0,0,1,1,rowOffsets,columnOffsets,offset);
 }
 /**
  * Constructs a matrix view with the given parameters.
@@ -82,15 +82,15 @@
  * @param  offset   
  */
 protected SelectedDenseObjectMatrix2D(int rows, int columns, Object[] elements, int rowZero, int columnZero, int rowStride, int columnStride, int[] rowOffsets, int[] columnOffsets, int offset) {
-	// be sure parameters are valid, we do not check...
-	setUp(rows,columns,rowZero,columnZero,rowStride,columnStride);
-	
-	this.elements = elements;
-	this.rowOffsets = rowOffsets;
-	this.columnOffsets = columnOffsets;
-	this.offset = offset;
-	
-	this.isNoView = false;
+  // be sure parameters are valid, we do not check...
+  setUp(rows,columns,rowZero,columnZero,rowStride,columnStride);
+  
+  this.elements = elements;
+  this.rowOffsets = rowOffsets;
+  this.columnOffsets = columnOffsets;
+  this.offset = offset;
+  
+  this.isNoView = false;
 }
 /**
  * Returns the position of the given absolute rank within the (virtual or non-virtual) internal 1-dimensional array. 
@@ -100,7 +100,7 @@
  * @return the position.
  */
 protected int _columnOffset(int absRank) {
-	return columnOffsets[absRank];
+  return columnOffsets[absRank];
 }
 /**
  * Returns the position of the given absolute rank within the (virtual or non-virtual) internal 1-dimensional array. 
@@ -110,7 +110,7 @@
  * @return the position.
  */
 protected int _rowOffset(int absRank) {
-	return rowOffsets[absRank];
+  return rowOffsets[absRank];
 }
 /**
  * Returns the matrix cell value at coordinate <tt>[row,column]</tt>.
@@ -124,10 +124,10 @@
  * @return    the value at the specified coordinate.
  */
 public Object getQuick(int row, int column) {
-	//if (debug) if (column<0 || column>=columns || row<0 || row>=rows) throw new IndexOutOfBoundsException("row:"+row+", column:"+column);
-	//return elements[index(row,column)];
-	//manually inlined:
-	return elements[offset + rowOffsets[rowZero + row*rowStride] + columnOffsets[columnZero + column*columnStride]];
+  //if (debug) if (column<0 || column>=columns || row<0 || row>=rows) throw new IndexOutOfBoundsException("row:"+row+", column:"+column);
+  //return elements[index(row,column)];
+  //manually inlined:
+  return elements[offset + rowOffsets[rowZero + row*rowStride] + columnOffsets[columnZero + column*columnStride]];
 }
 /**
  * Returns <tt>true</tt> if both matrices share common cells.
@@ -139,15 +139,15 @@
  * </ul>
  */
 protected boolean haveSharedCellsRaw(ObjectMatrix2D other) {
-	if (other instanceof SelectedDenseObjectMatrix2D) {
-		SelectedDenseObjectMatrix2D otherMatrix = (SelectedDenseObjectMatrix2D) other;
-		return this.elements==otherMatrix.elements;
-	}
-	else if (other instanceof DenseObjectMatrix2D) {
-		DenseObjectMatrix2D otherMatrix = (DenseObjectMatrix2D) other;
-		return this.elements==otherMatrix.elements;
-	}
-	return false;
+  if (other instanceof SelectedDenseObjectMatrix2D) {
+    SelectedDenseObjectMatrix2D otherMatrix = (SelectedDenseObjectMatrix2D) other;
+    return this.elements==otherMatrix.elements;
+  }
+  else if (other instanceof DenseObjectMatrix2D) {
+    DenseObjectMatrix2D otherMatrix = (DenseObjectMatrix2D) other;
+    return this.elements==otherMatrix.elements;
+  }
+  return false;
 }
 /**
  * Returns the position of the given coordinate within the (virtual or non-virtual) internal 1-dimensional array. 
@@ -156,9 +156,9 @@
  * @param     column   the index of the column-coordinate.
  */
 protected int index(int row, int column) {
-	//return this.offset + super.index(row,column);
-	//manually inlined:
-	return this.offset + rowOffsets[rowZero + row*rowStride] + columnOffsets[columnZero + column*columnStride];
+  //return this.offset + super.index(row,column);
+  //manually inlined:
+  return this.offset + rowOffsets[rowZero + row*rowStride] + columnOffsets[columnZero + column*columnStride];
 }
 /**
  * Construct and returns a new empty matrix <i>of the same dynamic type</i> as the receiver, having the specified number of rows and columns.
@@ -171,7 +171,7 @@
  * @return  a new empty matrix of the same dynamic type.
  */
 public ObjectMatrix2D like(int rows, int columns) {
-	return new DenseObjectMatrix2D(rows, columns);
+  return new DenseObjectMatrix2D(rows, columns);
 }
 /**
  * Construct and returns a new 1-d matrix <i>of the corresponding dynamic type</i>, entirelly independent of the receiver.
@@ -182,7 +182,7 @@
  * @return  a new matrix of the corresponding dynamic type.
  */
 public ObjectMatrix1D like1D(int size) {
-	return new DenseObjectMatrix1D(size);
+  return new DenseObjectMatrix1D(size);
 }
 /**
  * Construct and returns a new 1-d matrix <i>of the corresponding dynamic type</i>, sharing the same cells.
@@ -195,7 +195,7 @@
  * @return  a new matrix of the corresponding dynamic type.
  */
 protected ObjectMatrix1D like1D(int size, int zero, int stride) {
-	throw new InternalError(); // this method is never called since viewRow() and viewColumn are overridden properly.
+  throw new InternalError(); // this method is never called since viewRow() and viewColumn are overridden properly.
 }
 /**
  * Sets the matrix cell at coordinate <tt>[row,column]</tt> to the specified value.
@@ -209,35 +209,35 @@
  * @param    value the value to be filled into the specified cell.
  */
 public void setQuick(int row, int column, Object value) {
-	//if (debug) if (column<0 || column>=columns || row<0 || row>=rows) throw new IndexOutOfBoundsException("row:"+row+", column:"+column);
-	//elements[index(row,column)] = value;
-	//manually inlined:
-	elements[offset + rowOffsets[rowZero + row*rowStride] + columnOffsets[columnZero + column*columnStride]] = value;
+  //if (debug) if (column<0 || column>=columns || row<0 || row>=rows) throw new IndexOutOfBoundsException("row:"+row+", column:"+column);
+  //elements[index(row,column)] = value;
+  //manually inlined:
+  elements[offset + rowOffsets[rowZero + row*rowStride] + columnOffsets[columnZero + column*columnStride]] = value;
 }
 /**
  * Sets up a matrix with a given number of rows and columns.
  * @param rows the number of rows the matrix shall have.
  * @param columns the number of columns the matrix shall have.
- * @throws	IllegalArgumentException if <tt>(Object)columns*rows > Integer.MAX_VALUE</tt>.
+ * @throws  IllegalArgumentException if <tt>(Object)columns*rows > Integer.MAX_VALUE</tt>.
  */
 protected void setUp(int rows, int columns) {
-	super.setUp(rows,columns);
-	this.rowStride = 1;
-	this.columnStride = 1;
-	this.offset = 0;
+  super.setUp(rows,columns);
+  this.rowStride = 1;
+  this.columnStride = 1;
+  this.offset = 0;
 }
 /**
 Self modifying version of viewDice().
 */
 protected AbstractMatrix2D vDice() {
-	super.vDice();
-	// swap
-	int[] tmp = rowOffsets; rowOffsets = columnOffsets; columnOffsets = tmp;
+  super.vDice();
+  // swap
+  int[] tmp = rowOffsets; rowOffsets = columnOffsets; columnOffsets = tmp;
 
-	// flips stay unaffected
+  // flips stay unaffected
 
-	this.isNoView = false;
-	return this;
+  this.isNoView = false;
+  return this;
 }
 /**
 Constructs and returns a new <i>slice view</i> representing the rows of the given column.
@@ -247,12 +247,12 @@
 <b>Example:</b> 
 <table border="0">
   <tr nowrap> 
-	<td valign="top">2 x 3 matrix: <br>
-	  1, 2, 3<br>
-	  4, 5, 6 </td>
-	<td>viewColumn(0) ==></td>
-	<td valign="top">Matrix1D of size 2:<br>
-	  1, 4</td>
+  <td valign="top">2 x 3 matrix: <br>
+    1, 2, 3<br>
+    4, 5, 6 </td>
+  <td>viewColumn(0) ==></td>
+  <td valign="top">Matrix1D of size 2:<br>
+    1, 4</td>
    </tr>
 </table>
 
@@ -262,13 +262,13 @@
 @see #viewRow(int)
 */
 public ObjectMatrix1D viewColumn(int column) {
-	checkColumn(column);
-	int viewSize = this.rows;
-	int viewZero = this.rowZero;
-	int viewStride = this.rowStride;
-	int[] viewOffsets = this.rowOffsets;
-	int viewOffset = this.offset + _columnOffset(_columnRank(column));
-	return new SelectedDenseObjectMatrix1D(viewSize,this.elements,viewZero,viewStride,viewOffsets,viewOffset);
+  checkColumn(column);
+  int viewSize = this.rows;
+  int viewZero = this.rowZero;
+  int viewStride = this.rowStride;
+  int[] viewOffsets = this.rowOffsets;
+  int viewOffset = this.offset + _columnOffset(_columnRank(column));
+  return new SelectedDenseObjectMatrix1D(viewSize,this.elements,viewZero,viewStride,viewOffsets,viewOffset);
 }
 /**
 Constructs and returns a new <i>slice view</i> representing the columns of the given row.
@@ -278,12 +278,12 @@
 <b>Example:</b> 
 <table border="0">
   <tr nowrap> 
-	<td valign="top">2 x 3 matrix: <br>
-	  1, 2, 3<br>
-	  4, 5, 6 </td>
-	<td>viewRow(0) ==></td>
-	<td valign="top">Matrix1D of size 3:<br>
-	  1, 2, 3</td>
+  <td valign="top">2 x 3 matrix: <br>
+    1, 2, 3<br>
+    4, 5, 6 </td>
+  <td>viewRow(0) ==></td>
+  <td valign="top">Matrix1D of size 3:<br>
+    1, 2, 3</td>
    </tr>
 </table>
 
@@ -293,13 +293,13 @@
 @see #viewColumn(int)
 */
 public ObjectMatrix1D viewRow(int row) {
-	checkRow(row);
-	int viewSize = this.columns;
-	int viewZero = columnZero;
-	int viewStride = this.columnStride;
-	int[] viewOffsets = this.columnOffsets;
-	int viewOffset = this.offset + _rowOffset(_rowRank(row));
-	return new SelectedDenseObjectMatrix1D(viewSize,this.elements,viewZero,viewStride,viewOffsets,viewOffset);
+  checkRow(row);
+  int viewSize = this.columns;
+  int viewZero = columnZero;
+  int viewStride = this.columnStride;
+  int[] viewOffsets = this.columnOffsets;
+  int viewOffset = this.offset + _rowOffset(_rowRank(row));
+  return new SelectedDenseObjectMatrix1D(viewSize,this.elements,viewZero,viewStride,viewOffsets,viewOffset);
 }
 /**
  * Construct and returns a new selection view.
@@ -309,6 +309,6 @@
  * @return  a new view.
  */
 protected ObjectMatrix2D viewSelectionLike(int[] rowOffsets, int[] columnOffsets) {
-	return new SelectedDenseObjectMatrix2D(this.elements,rowOffsets,columnOffsets,this.offset);
+  return new SelectedDenseObjectMatrix2D(this.elements,rowOffsets,columnOffsets,this.offset);
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/RCDoubleMatrix2D.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/RCDoubleMatrix2D.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/RCDoubleMatrix2D.java	(working copy)
@@ -120,13 +120,13 @@
  */
 @Deprecated
 public class RCDoubleMatrix2D extends WrapperDoubleMatrix2D {
-	/*
-	 * The elements of the matrix.
-	 */
-	protected IntArrayList indexes;
-	protected DoubleArrayList values;
-	protected int[] starts;
-	//protected int N;
+  /*
+   * The elements of the matrix.
+   */
+  protected IntArrayList indexes;
+  protected DoubleArrayList values;
+  protected int[] starts;
+  //protected int N;
 /**
  * Constructs a matrix with a copy of the given values.
  * <tt>values</tt> is required to have the form <tt>values[row][column]</tt>
@@ -138,27 +138,27 @@
  * @throws IllegalArgumentException if <tt>for any 1 &lt;= row &lt; values.length: values[row].length != values[row-1].length</tt>.
  */
 public RCDoubleMatrix2D(double[][] values) {
-	this(values.length, values.length==0 ? 0: values[0].length);
-	assign(values);
+  this(values.length, values.length==0 ? 0: values[0].length);
+  assign(values);
 }
 /**
  * Constructs a matrix with a given number of rows and columns.
  * All entries are initially <tt>0</tt>.
  * @param rows the number of rows the matrix shall have.
  * @param columns the number of columns the matrix shall have.
- * @throws	IllegalArgumentException if <tt>rows<0 || columns<0 || (double)columns*rows > Integer.MAX_VALUE</tt>.
+ * @throws  IllegalArgumentException if <tt>rows<0 || columns<0 || (double)columns*rows > Integer.MAX_VALUE</tt>.
  */
 public RCDoubleMatrix2D(int rows, int columns) {
-	super(null);
-	try {
-		setUp(rows, columns);
-	}
-	catch (IllegalArgumentException exc) { // we can hold rows*columns>Integer.MAX_VALUE cells !
-		if (! "matrix too large".equals(exc.getMessage())) throw exc;
-	}
-	indexes = new IntArrayList();
-	values = new DoubleArrayList();
-	starts = new int[rows+1];
+  super(null);
+  try {
+    setUp(rows, columns);
+  }
+  catch (IllegalArgumentException exc) { // we can hold rows*columns>Integer.MAX_VALUE cells !
+    if (! "matrix too large".equals(exc.getMessage())) throw exc;
+  }
+  indexes = new IntArrayList();
+  values = new DoubleArrayList();
+  starts = new int[rows+1];
 }
 /**
  * Sets all cells to the state specified by <tt>value</tt>.
@@ -166,41 +166,41 @@
  * @return <tt>this</tt> (for convenience only).
  */
 public DoubleMatrix2D assign(double value) {
-	// overriden for performance only
-	if (value==0) {
-		indexes.clear();
-		values.clear();
-		for (int i=starts.length; --i >= 0; ) starts[i] = 0;
-	}
-	else super.assign(value);
-	return this;
+  // overriden for performance only
+  if (value==0) {
+    indexes.clear();
+    values.clear();
+    for (int i=starts.length; --i >= 0; ) starts[i] = 0;
+  }
+  else super.assign(value);
+  return this;
 }
 public DoubleMatrix2D assign(final org.apache.mahout.matrix.function.DoubleFunction function) {
-	if (function instanceof org.apache.mahout.jet.math.Mult) { // x[i] = mult*x[i]
-		final double alpha = ((org.apache.mahout.jet.math.Mult) function).multiplicator;
-		if (alpha==1) return this;
-		if (alpha==0) return assign(0);
-		if (alpha!=alpha) return assign(alpha); // the funny definition of isNaN(). This should better not happen.
+  if (function instanceof org.apache.mahout.jet.math.Mult) { // x[i] = mult*x[i]
+    final double alpha = ((org.apache.mahout.jet.math.Mult) function).multiplicator;
+    if (alpha==1) return this;
+    if (alpha==0) return assign(0);
+    if (alpha!=alpha) return assign(alpha); // the funny definition of isNaN(). This should better not happen.
 
-		double[] vals = values.elements();
-		for (int j=values.size(); --j >= 0; ) {
-			vals[j] *= alpha;
-		}
+    double[] vals = values.elements();
+    for (int j=values.size(); --j >= 0; ) {
+      vals[j] *= alpha;
+    }
 
-		/*
-		forEachNonZero(
-			new org.apache.mahout.matrix.function.IntIntDoubleFunction() {
-				public double apply(int i, int j, double value) {
-					return function.apply(value);
-				}
-			}
-		);
-		*/
-	}
-	else {
-		super.assign(function);
-	}
-	return this;
+    /*
+    forEachNonZero(
+      new org.apache.mahout.matrix.function.IntIntDoubleFunction() {
+        public double apply(int i, int j, double value) {
+          return function.apply(value);
+        }
+      }
+    );
+    */
+  }
+  else {
+    super.assign(function);
+  }
+  return this;
 }
 /**
  * Replaces all cell values of the receiver with the values of another matrix.
@@ -209,126 +209,126 @@
  *
  * @param     source   the source matrix to copy from (may be identical to the receiver).
  * @return <tt>this</tt> (for convenience only).
- * @throws	IllegalArgumentException if <tt>columns() != source.columns() || rows() != source.rows()</tt>
+ * @throws  IllegalArgumentException if <tt>columns() != source.columns() || rows() != source.rows()</tt>
  */
 public DoubleMatrix2D assign(DoubleMatrix2D source) {
-	if (source==this) return this; // nothing to do
-	checkShape(source);
-	// overriden for performance only
-	if (! (source instanceof RCDoubleMatrix2D)) {
-		//return super.assign(source);
+  if (source==this) return this; // nothing to do
+  checkShape(source);
+  // overriden for performance only
+  if (! (source instanceof RCDoubleMatrix2D)) {
+    //return super.assign(source);
 
-		assign(0);
-		source.forEachNonZero(
-			new org.apache.mahout.matrix.function.IntIntDoubleFunction() {
-				public double apply(int i, int j, double value) {
-					setQuick(i,j,value);
-					return value;
-				}
-			}
-		);
-		/*
-		indexes.clear();
-		values.clear();
-		int nonZeros=0;
-		for (int row=0; row<rows; row++) {
-			starts[row]=nonZeros;
-			for (int column=0; column<columns; column++) {
-				double v = source.getQuick(row,column);
-				if (v!=0) {
-					values.add(v);
-					indexes.add(column);
-					nonZeros++;
-				}
-			}
-		}
-		starts[rows]=nonZeros;
-		*/
-		return this;
-	}
+    assign(0);
+    source.forEachNonZero(
+      new org.apache.mahout.matrix.function.IntIntDoubleFunction() {
+        public double apply(int i, int j, double value) {
+          setQuick(i,j,value);
+          return value;
+        }
+      }
+    );
+    /*
+    indexes.clear();
+    values.clear();
+    int nonZeros=0;
+    for (int row=0; row<rows; row++) {
+      starts[row]=nonZeros;
+      for (int column=0; column<columns; column++) {
+        double v = source.getQuick(row,column);
+        if (v!=0) {
+          values.add(v);
+          indexes.add(column);
+          nonZeros++;
+        }
+      }
+    }
+    starts[rows]=nonZeros;
+    */
+    return this;
+  }
 
-	// even quicker
-	RCDoubleMatrix2D other = (RCDoubleMatrix2D) source;
-	
-	System.arraycopy(other.starts, 0, this.starts, 0, this.starts.length);
-	int s = other.indexes.size();
-	this.indexes.setSize(s);
-	this.values.setSize(s);
-	this.indexes.replaceFromToWithFrom(0,s-1,other.indexes,0);
-	this.values.replaceFromToWithFrom(0,s-1,other.values,0);
-	
-	return this;
+  // even quicker
+  RCDoubleMatrix2D other = (RCDoubleMatrix2D) source;
+  
+  System.arraycopy(other.starts, 0, this.starts, 0, this.starts.length);
+  int s = other.indexes.size();
+  this.indexes.setSize(s);
+  this.values.setSize(s);
+  this.indexes.replaceFromToWithFrom(0,s-1,other.indexes,0);
+  this.values.replaceFromToWithFrom(0,s-1,other.values,0);
+  
+  return this;
 }
 public DoubleMatrix2D assign(DoubleMatrix2D y, org.apache.mahout.matrix.function.DoubleDoubleFunction function) {
-	checkShape(y);
+  checkShape(y);
 
-	if (function instanceof org.apache.mahout.jet.math.PlusMult) { // x[i] = x[i] + alpha*y[i]
-		final double alpha = ((org.apache.mahout.jet.math.PlusMult) function).multiplicator;
-		if (alpha==0) return this; // nothing to do
-		y.forEachNonZero(
-			new org.apache.mahout.matrix.function.IntIntDoubleFunction() {
-				public double apply(int i, int j, double value) {
-					setQuick(i,j,getQuick(i,j) + alpha*value);
-					return value;
-				}
-			}
-		);
-		return this;
-	}
+  if (function instanceof org.apache.mahout.jet.math.PlusMult) { // x[i] = x[i] + alpha*y[i]
+    final double alpha = ((org.apache.mahout.jet.math.PlusMult) function).multiplicator;
+    if (alpha==0) return this; // nothing to do
+    y.forEachNonZero(
+      new org.apache.mahout.matrix.function.IntIntDoubleFunction() {
+        public double apply(int i, int j, double value) {
+          setQuick(i,j,getQuick(i,j) + alpha*value);
+          return value;
+        }
+      }
+    );
+    return this;
+  }
 
-	if (function== org.apache.mahout.jet.math.Functions.mult) { // x[i] = x[i] * y[i]
-		int[] idx = indexes.elements();
-		double[] vals = values.elements();
+  if (function== org.apache.mahout.jet.math.Functions.mult) { // x[i] = x[i] * y[i]
+    int[] idx = indexes.elements();
+    double[] vals = values.elements();
 
-		for (int i=starts.length-1; --i >= 0; ) {
-			int low = starts[i];
-			for (int k=starts[i+1]; --k >= low; ) {
-				int j = idx[k];
-				vals[k] *= y.getQuick(i,j);
-				if (vals[k]==0) remove(i,j);
-			}
-		}
-		return this;
-	}
-	
-	if (function== org.apache.mahout.jet.math.Functions.div) { // x[i] = x[i] / y[i]
-		int[] idx = indexes.elements();
-		double[] vals = values.elements();
+    for (int i=starts.length-1; --i >= 0; ) {
+      int low = starts[i];
+      for (int k=starts[i+1]; --k >= low; ) {
+        int j = idx[k];
+        vals[k] *= y.getQuick(i,j);
+        if (vals[k]==0) remove(i,j);
+      }
+    }
+    return this;
+  }
+  
+  if (function== org.apache.mahout.jet.math.Functions.div) { // x[i] = x[i] / y[i]
+    int[] idx = indexes.elements();
+    double[] vals = values.elements();
 
-		for (int i=starts.length-1; --i >= 0; ) {
-			int low = starts[i];
-			for (int k=starts[i+1]; --k >= low; ) {
-				int j = idx[k];
-				vals[k] /= y.getQuick(i,j);
-				if (vals[k]==0) remove(i,j);
-			}
-		}
-		return this;
-	}
-	
-	return super.assign(y,function);
+    for (int i=starts.length-1; --i >= 0; ) {
+      int low = starts[i];
+      for (int k=starts[i+1]; --k >= low; ) {
+        int j = idx[k];
+        vals[k] /= y.getQuick(i,j);
+        if (vals[k]==0) remove(i,j);
+      }
+    }
+    return this;
+  }
+  
+  return super.assign(y,function);
 }
 public DoubleMatrix2D forEachNonZero(final org.apache.mahout.matrix.function.IntIntDoubleFunction function) {
-	int[] idx = indexes.elements();
-	double[] vals = values.elements();
+  int[] idx = indexes.elements();
+  double[] vals = values.elements();
 
-	for (int i=starts.length-1; --i >= 0; ) {
-		int low = starts[i];
-		for (int k=starts[i+1]; --k >= low; ) {
-			int j = idx[k];
-			double value = vals[k];
-			double r = function.apply(i,j,value);
-			if (r!=value) vals[k]=r;
-		}
-	}
-	return this;
+  for (int i=starts.length-1; --i >= 0; ) {
+    int low = starts[i];
+    for (int k=starts[i+1]; --k >= low; ) {
+      int j = idx[k];
+      double value = vals[k];
+      double r = function.apply(i,j,value);
+      if (r!=value) vals[k]=r;
+    }
+  }
+  return this;
 }
 /**
  * Returns the content of this matrix if it is a wrapper; or <tt>this</tt> otherwise.
  * Override this method in wrappers.
  */
 protected DoubleMatrix2D getContent() {
-	return this;
+  return this;
 }
 /**
  * Returns the matrix cell value at coordinate <tt>[row,column]</tt>.
@@ -342,15 +342,15 @@
  * @return    the value at the specified coordinate.
  */
 public double getQuick(int row, int column) {
-	int k = indexes.binarySearchFromTo(column,starts[row],starts[row+1]-1);
-	double v = 0;
-	if (k>=0) v = values.getQuick(k);
-	return v;
+  int k = indexes.binarySearchFromTo(column,starts[row],starts[row+1]-1);
+  double v = 0;
+  if (k>=0) v = values.getQuick(k);
+  return v;
 }
 protected void insert(int row, int column, int index, double value) {
-	indexes.beforeInsert(index,column);
-	values.beforeInsert(index,value);
-	for (int i=starts.length; --i > row; ) starts[i]++;
+  indexes.beforeInsert(index,column);
+  values.beforeInsert(index,value);
+  for (int i=starts.length; --i > row; ) starts[i]++;
 }
 /**
  * Construct and returns a new empty matrix <i>of the same dynamic type</i> as the receiver, having the specified number of rows and columns.
@@ -363,7 +363,7 @@
  * @return  a new empty matrix of the same dynamic type.
  */
 public DoubleMatrix2D like(int rows, int columns) {
-	return new RCDoubleMatrix2D(rows,columns);
+  return new RCDoubleMatrix2D(rows,columns);
 }
 /**
  * Construct and returns a new 1-d matrix <i>of the corresponding dynamic type</i>, entirelly independent of the receiver.
@@ -374,12 +374,12 @@
  * @return  a new matrix of the corresponding dynamic type.
  */
 public DoubleMatrix1D like1D(int size) {
-	return new SparseDoubleMatrix1D(size);
+  return new SparseDoubleMatrix1D(size);
 }
 protected void remove(int row, int index) {
-	indexes.remove(index);
-	values.remove(index);
-	for (int i=starts.length; --i > row; ) starts[i]--;
+  indexes.remove(index);
+  values.remove(index);
+  for (int i=starts.length; --i > row; ) starts[i]--;
 }
 /**
  * Sets the matrix cell at coordinate <tt>[row,column]</tt> to the specified value.
@@ -393,140 +393,140 @@
  * @param    value the value to be filled into the specified cell.
  */
 public void setQuick(int row, int column, double value) {
-	int k = indexes.binarySearchFromTo(column,starts[row],starts[row+1]-1);
-	if (k>=0) { // found
-		if (value==0) 
-			remove(row,k);
-		else 
-			values.setQuick(k,value);
-		return;
-	}
+  int k = indexes.binarySearchFromTo(column,starts[row],starts[row+1]-1);
+  if (k>=0) { // found
+    if (value==0) 
+      remove(row,k);
+    else 
+      values.setQuick(k,value);
+    return;
+  }
 
-	if (value!=0) {
-		k = -k-1;
-		insert(row,column,k,value);
-	}
+  if (value!=0) {
+    k = -k-1;
+    insert(row,column,k,value);
+  }
 }
 public void trimToSize() {
-	indexes.trimToSize();
-	values.trimToSize();
+  indexes.trimToSize();
+  values.trimToSize();
 }
 public DoubleMatrix1D zMult(DoubleMatrix1D y, DoubleMatrix1D z, double alpha, double beta, boolean transposeA) {
-	int m = rows;
-	int n = columns;
-	if (transposeA) {
-		m = columns;
-		n = rows;
-	}
+  int m = rows;
+  int n = columns;
+  if (transposeA) {
+    m = columns;
+    n = rows;
+  }
 
-	boolean ignore = (z==null || !transposeA);
-	if (z==null) z = new DenseDoubleMatrix1D(m);
+  boolean ignore = (z==null || !transposeA);
+  if (z==null) z = new DenseDoubleMatrix1D(m);
 
-	if (!(y instanceof DenseDoubleMatrix1D && z instanceof DenseDoubleMatrix1D)) {
-		return super.zMult(y,z,alpha,beta,transposeA);
-	}
-	
-	if (n != y.size() || m > z.size())	
-		throw new IllegalArgumentException("Incompatible args: "+ ((transposeA ? viewDice() : this).toStringShort()) +", "+y.toStringShort()+", "+z.toStringShort());
+  if (!(y instanceof DenseDoubleMatrix1D && z instanceof DenseDoubleMatrix1D)) {
+    return super.zMult(y,z,alpha,beta,transposeA);
+  }
+  
+  if (n != y.size() || m > z.size())  
+    throw new IllegalArgumentException("Incompatible args: "+ ((transposeA ? viewDice() : this).toStringShort()) +", "+y.toStringShort()+", "+z.toStringShort());
 
-	DenseDoubleMatrix1D zz = (DenseDoubleMatrix1D) z;
-	final double[] zElements = zz.elements;
-	final int zStride = zz.stride;
-	int zi = z.index(0);
-	
-	DenseDoubleMatrix1D yy = (DenseDoubleMatrix1D) y;
-	final double[] yElements = yy.elements;
-	final int yStride = yy.stride;
-	final int yi = y.index(0);
+  DenseDoubleMatrix1D zz = (DenseDoubleMatrix1D) z;
+  final double[] zElements = zz.elements;
+  final int zStride = zz.stride;
+  int zi = z.index(0);
+  
+  DenseDoubleMatrix1D yy = (DenseDoubleMatrix1D) y;
+  final double[] yElements = yy.elements;
+  final int yStride = yy.stride;
+  final int yi = y.index(0);
 
-	if (yElements==null || zElements==null) throw new InternalError();
+  if (yElements==null || zElements==null) throw new InternalError();
 
-	/*
-	forEachNonZero(
-		new org.apache.mahout.matrix.function.IntIntDoubleFunction() {
-			public double apply(int i, int j, double value) {
-				zElements[zi + zStride*i] += value * yElements[yi + yStride*j];
-				//z.setQuick(row,z.getQuick(row) + value * y.getQuick(column));
-				//System.out.println("["+i+","+j+"]-->"+value);
-				return value;
-			}
-		}
-	);
-	*/
+  /*
+  forEachNonZero(
+    new org.apache.mahout.matrix.function.IntIntDoubleFunction() {
+      public double apply(int i, int j, double value) {
+        zElements[zi + zStride*i] += value * yElements[yi + yStride*j];
+        //z.setQuick(row,z.getQuick(row) + value * y.getQuick(column));
+        //System.out.println("["+i+","+j+"]-->"+value);
+        return value;
+      }
+    }
+  );
+  */
 
-	
-	int[] idx = indexes.elements();
-	double[] vals = values.elements();
-	int s = starts.length-1;
-	if (!transposeA) {
-		for (int i=0; i < s; i++) {
-			int high = starts[i+1];
-			double sum = 0;
-			for (int k=starts[i]; k < high; k++) {
-				int j = idx[k];
-				sum += vals[k]*yElements[yi + yStride*j];
-			}
-			zElements[zi] = alpha*sum + beta*zElements[zi];
-			zi += zStride;
-		}
-	}
-	else {
-		if (!ignore) z.assign(org.apache.mahout.jet.math.Functions.mult(beta));
-		for (int i=0; i < s; i++) {
-			int high = starts[i+1];
-			double yElem = alpha * yElements[yi + yStride*i];
-			for (int k=starts[i]; k < high; k++) {
-				int j = idx[k];
-				zElements[zi + zStride*j] += vals[k]*yElem;
-			}
-		}
-	}
-	
-	return z;
+  
+  int[] idx = indexes.elements();
+  double[] vals = values.elements();
+  int s = starts.length-1;
+  if (!transposeA) {
+    for (int i=0; i < s; i++) {
+      int high = starts[i+1];
+      double sum = 0;
+      for (int k=starts[i]; k < high; k++) {
+        int j = idx[k];
+        sum += vals[k]*yElements[yi + yStride*j];
+      }
+      zElements[zi] = alpha*sum + beta*zElements[zi];
+      zi += zStride;
+    }
+  }
+  else {
+    if (!ignore) z.assign(org.apache.mahout.jet.math.Functions.mult(beta));
+    for (int i=0; i < s; i++) {
+      int high = starts[i+1];
+      double yElem = alpha * yElements[yi + yStride*i];
+      for (int k=starts[i]; k < high; k++) {
+        int j = idx[k];
+        zElements[zi + zStride*j] += vals[k]*yElem;
+      }
+    }
+  }
+  
+  return z;
 }
 public DoubleMatrix2D zMult(DoubleMatrix2D B, DoubleMatrix2D C, final double alpha, double beta, boolean transposeA, boolean transposeB) {
-	if (transposeB) B = B.viewDice();
-	int m = rows;
-	int n = columns;
-	if (transposeA) {
-		m = columns;
-		n = rows;
-	}
-	int p = B.columns;
-	boolean ignore = (C==null);
-	if (C==null) C = new DenseDoubleMatrix2D(m,p);
+  if (transposeB) B = B.viewDice();
+  int m = rows;
+  int n = columns;
+  if (transposeA) {
+    m = columns;
+    n = rows;
+  }
+  int p = B.columns;
+  boolean ignore = (C==null);
+  if (C==null) C = new DenseDoubleMatrix2D(m,p);
 
-	if (B.rows != n)
-		throw new IllegalArgumentException("Matrix2D inner dimensions must agree:"+toStringShort()+", "+ (transposeB ? B.viewDice() : B).toStringShort());
-	if (C.rows != m || C.columns != p)
-		throw new IllegalArgumentException("Incompatibel result matrix: "+toStringShort()+", "+ (transposeB ? B.viewDice() : B).toStringShort()+", "+C.toStringShort());
-	if (this == C || B == C)
-		throw new IllegalArgumentException("Matrices must not be identical");
-	
-	if (!ignore) C.assign(org.apache.mahout.jet.math.Functions.mult(beta));
+  if (B.rows != n)
+    throw new IllegalArgumentException("Matrix2D inner dimensions must agree:"+toStringShort()+", "+ (transposeB ? B.viewDice() : B).toStringShort());
+  if (C.rows != m || C.columns != p)
+    throw new IllegalArgumentException("Incompatibel result matrix: "+toStringShort()+", "+ (transposeB ? B.viewDice() : B).toStringShort()+", "+C.toStringShort());
+  if (this == C || B == C)
+    throw new IllegalArgumentException("Matrices must not be identical");
+  
+  if (!ignore) C.assign(org.apache.mahout.jet.math.Functions.mult(beta));
 
-	// cache views	
-	final DoubleMatrix1D[] Brows = new DoubleMatrix1D[n];
-	for (int i=n; --i>=0; ) Brows[i] = B.viewRow(i);
-	final DoubleMatrix1D[] Crows = new DoubleMatrix1D[m];
-	for (int i=m; --i>=0; ) Crows[i] = C.viewRow(i);
+  // cache views  
+  final DoubleMatrix1D[] Brows = new DoubleMatrix1D[n];
+  for (int i=n; --i>=0; ) Brows[i] = B.viewRow(i);
+  final DoubleMatrix1D[] Crows = new DoubleMatrix1D[m];
+  for (int i=m; --i>=0; ) Crows[i] = C.viewRow(i);
 
-	final org.apache.mahout.jet.math.PlusMult fun = org.apache.mahout.jet.math.PlusMult.plusMult(0);
+  final org.apache.mahout.jet.math.PlusMult fun = org.apache.mahout.jet.math.PlusMult.plusMult(0);
 
-	int[] idx = indexes.elements();
-	double[] vals = values.elements();
-	for (int i=starts.length-1; --i >= 0; ) {
-		int low = starts[i];
-		for (int k=starts[i+1]; --k >= low; ) {
-			int j = idx[k];
-			fun.multiplicator = vals[k]*alpha;
-			if (!transposeA)
-				Crows[i].assign(Brows[j],fun);
-			else
-				Crows[j].assign(Brows[i],fun);
-		}
-	}
+  int[] idx = indexes.elements();
+  double[] vals = values.elements();
+  for (int i=starts.length-1; --i >= 0; ) {
+    int low = starts[i];
+    for (int k=starts[i+1]; --k >= low; ) {
+      int j = idx[k];
+      fun.multiplicator = vals[k]*alpha;
+      if (!transposeA)
+        Crows[i].assign(Brows[j],fun);
+      else
+        Crows[j].assign(Brows[i],fun);
+    }
+  }
 
-	return C;
+  return C;
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SelectedDenseObjectMatrix3D.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SelectedDenseObjectMatrix3D.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SelectedDenseObjectMatrix3D.java	(working copy)
@@ -43,23 +43,23 @@
 @version 1.0, 09/24/99
 */
 class SelectedDenseObjectMatrix3D extends ObjectMatrix3D {
-	/**
-	  * The elements of this matrix.
-	  */
-	protected Object[] elements;
-	
-	/**
-	  * The offsets of the visible cells of this matrix.
-	  */
-	protected int[] sliceOffsets;
-	protected int[] rowOffsets;
-	protected int[] columnOffsets;
-	
-	/**
-	  * The offset.
-	  */
-	protected int offset;	
-	
+  /**
+    * The elements of this matrix.
+    */
+  protected Object[] elements;
+  
+  /**
+    * The offsets of the visible cells of this matrix.
+    */
+  protected int[] sliceOffsets;
+  protected int[] rowOffsets;
+  protected int[] columnOffsets;
+  
+  /**
+    * The offset.
+    */
+  protected int offset;  
+  
 /**
  * Constructs a matrix view with the given parameters.
  * @param elements the cells.
@@ -68,21 +68,21 @@
  * @param  columnOffsets   The column offsets of the cells that shall be visible.
  */
 protected SelectedDenseObjectMatrix3D(Object[] elements, int[] sliceOffsets, int[] rowOffsets, int[] columnOffsets, int offset) {
-	// be sure parameters are valid, we do not check...
-	int slices = sliceOffsets.length;
-	int rows = rowOffsets.length;
-	int columns = columnOffsets.length;
-	setUp(slices,rows, columns);
-	
-	this.elements = elements;
-	
-	this.sliceOffsets = sliceOffsets;
-	this.rowOffsets = rowOffsets;
-	this.columnOffsets = columnOffsets;
+  // be sure parameters are valid, we do not check...
+  int slices = sliceOffsets.length;
+  int rows = rowOffsets.length;
+  int columns = columnOffsets.length;
+  setUp(slices,rows, columns);
+  
+  this.elements = elements;
+  
+  this.sliceOffsets = sliceOffsets;
+  this.rowOffsets = rowOffsets;
+  this.columnOffsets = columnOffsets;
 
-	this.offset = offset;
-	
-	this.isNoView = false;
+  this.offset = offset;
+  
+  this.isNoView = false;
 }
 /**
  * Returns the position of the given absolute rank within the (virtual or non-virtual) internal 1-dimensional array. 
@@ -92,7 +92,7 @@
  * @return the position.
  */
 protected int _columnOffset(int absRank) {
-	return columnOffsets[absRank];
+  return columnOffsets[absRank];
 }
 /**
  * Returns the position of the given absolute rank within the (virtual or non-virtual) internal 1-dimensional array. 
@@ -102,7 +102,7 @@
  * @return the position.
  */
 protected int _rowOffset(int absRank) {
-	return rowOffsets[absRank];
+  return rowOffsets[absRank];
 }
 /**
  * Returns the position of the given absolute rank within the (virtual or non-virtual) internal 1-dimensional array. 
@@ -112,7 +112,7 @@
  * @return the position.
  */
 protected int _sliceOffset(int absRank) {
-	return sliceOffsets[absRank];
+  return sliceOffsets[absRank];
 }
 /**
  * Returns the matrix cell value at coordinate <tt>[slice,row,column]</tt>.
@@ -127,10 +127,10 @@
  * @return    the value at the specified coordinate.
  */
 public Object getQuick(int slice, int row, int column) {
-	//if (debug) if (slice<0 || slice>=slices || row<0 || row>=rows || column<0 || column>=columns) throw new IndexOutOfBoundsException("slice:"+slice+", row:"+row+", column:"+column);
-	//return elements[index(slice,row,column)];
-	//manually inlined:
-	return elements[offset + sliceOffsets[sliceZero + slice*sliceStride] + rowOffsets[rowZero + row*rowStride] + columnOffsets[columnZero + column*columnStride]];
+  //if (debug) if (slice<0 || slice>=slices || row<0 || row>=rows || column<0 || column>=columns) throw new IndexOutOfBoundsException("slice:"+slice+", row:"+row+", column:"+column);
+  //return elements[index(slice,row,column)];
+  //manually inlined:
+  return elements[offset + sliceOffsets[sliceZero + slice*sliceStride] + rowOffsets[rowZero + row*rowStride] + columnOffsets[columnZero + column*columnStride]];
 }
 /**
  * Returns <tt>true</tt> if both matrices share common cells.
@@ -142,15 +142,15 @@
  * </ul>
  */
 protected boolean haveSharedCellsRaw(ObjectMatrix3D other) {
-	if (other instanceof SelectedDenseObjectMatrix3D) {
-		SelectedDenseObjectMatrix3D otherMatrix = (SelectedDenseObjectMatrix3D) other;
-		return this.elements==otherMatrix.elements;
-	}
-	else if (other instanceof DenseObjectMatrix3D) {
-		DenseObjectMatrix3D otherMatrix = (DenseObjectMatrix3D) other;
-		return this.elements==otherMatrix.elements;
-	}
-	return false;
+  if (other instanceof SelectedDenseObjectMatrix3D) {
+    SelectedDenseObjectMatrix3D otherMatrix = (SelectedDenseObjectMatrix3D) other;
+    return this.elements==otherMatrix.elements;
+  }
+  else if (other instanceof DenseObjectMatrix3D) {
+    DenseObjectMatrix3D otherMatrix = (DenseObjectMatrix3D) other;
+    return this.elements==otherMatrix.elements;
+  }
+  return false;
 }
 /**
  * Returns the position of the given coordinate within the (virtual or non-virtual) internal 1-dimensional array. 
@@ -160,9 +160,9 @@
  * @param     column   the index of the third-coordinate.
  */
 protected int index(int slice, int row, int column) {
-	//return this.offset + super.index(slice,row,column);
-	//manually inlined:
-	return this.offset + sliceOffsets[sliceZero + slice*sliceStride] + rowOffsets[rowZero + row*rowStride] + columnOffsets[columnZero + column*columnStride];
+  //return this.offset + super.index(slice,row,column);
+  //manually inlined:
+  return this.offset + sliceOffsets[sliceZero + slice*sliceStride] + rowOffsets[rowZero + row*rowStride] + columnOffsets[columnZero + column*columnStride];
 }
 /**
  * Construct and returns a new empty matrix <i>of the same dynamic type</i> as the receiver, having the specified number of slices, rows and columns.
@@ -176,7 +176,7 @@
  * @return  a new empty matrix of the same dynamic type.
  */
 public ObjectMatrix3D like(int slices, int rows, int columns) {
-	return new DenseObjectMatrix3D(slices,rows,columns); 
+  return new DenseObjectMatrix3D(slices,rows,columns); 
 }
 /**
  * Construct and returns a new 2-d matrix <i>of the corresponding dynamic type</i>, sharing the same cells.
@@ -192,7 +192,7 @@
  * @return  a new matrix of the corresponding dynamic type.
  */
 protected ObjectMatrix2D like2D(int rows, int columns, int rowZero, int columnZero, int rowStride, int columnStride) {
-	throw new InternalError(); // this method is never called since viewRow() and viewColumn are overridden properly.
+  throw new InternalError(); // this method is never called since viewRow() and viewColumn are overridden properly.
 }
 /**
  * Sets the matrix cell at coordinate <tt>[slice,row,column]</tt> to the specified value.
@@ -207,43 +207,43 @@
  * @param    value the value to be filled into the specified cell.
  */
 public void setQuick(int slice, int row, int column, Object value) {
-	//if (debug) if (slice<0 || slice>=slices || row<0 || row>=rows || column<0 || column>=columns) throw new IndexOutOfBoundsException("slice:"+slice+", row:"+row+", column:"+column);
-	//elements[index(slice,row,column)] = value;
-	//manually inlined:
-	elements[offset + sliceOffsets[sliceZero + slice*sliceStride] + rowOffsets[rowZero + row*rowStride] + columnOffsets[columnZero + column*columnStride]] = value;
+  //if (debug) if (slice<0 || slice>=slices || row<0 || row>=rows || column<0 || column>=columns) throw new IndexOutOfBoundsException("slice:"+slice+", row:"+row+", column:"+column);
+  //elements[index(slice,row,column)] = value;
+  //manually inlined:
+  elements[offset + sliceOffsets[sliceZero + slice*sliceStride] + rowOffsets[rowZero + row*rowStride] + columnOffsets[columnZero + column*columnStride]] = value;
 }
 /**
  * Sets up a matrix with a given number of slices and rows.
  * @param slices the number of slices the matrix shall have.
  * @param rows the number of rows the matrix shall have.
  * @param columns the number of columns the matrix shall have.
- * @throws	IllegalArgumentException if <tt>(Object)rows*slices > Integer.MAX_VALUE</tt>.
+ * @throws  IllegalArgumentException if <tt>(Object)rows*slices > Integer.MAX_VALUE</tt>.
  */
 protected void setUp(int slices, int rows, int columns) {
-	super.setUp(slices,rows,columns);
-	this.sliceStride = 1;
-	this.rowStride = 1;
-	this.columnStride = 1;
-	this.offset = 0;
+  super.setUp(slices,rows,columns);
+  this.sliceStride = 1;
+  this.rowStride = 1;
+  this.columnStride = 1;
+  this.offset = 0;
 }
 /**
 Self modifying version of viewDice().
 @throws IllegalArgumentException if some of the parameters are equal or not in range 0..2.
 */
 protected AbstractMatrix3D vDice(int axis0, int axis1, int axis2) {
-	super.vDice(axis0,axis1,axis2);
-	
-	// swap offsets
-	int[][] offsets = new int[3][];
-	offsets[0] = this.sliceOffsets;
-	offsets[1] = this.rowOffsets;
-	offsets[2] = this.columnOffsets;
+  super.vDice(axis0,axis1,axis2);
+  
+  // swap offsets
+  int[][] offsets = new int[3][];
+  offsets[0] = this.sliceOffsets;
+  offsets[1] = this.rowOffsets;
+  offsets[2] = this.columnOffsets;
 
-	this.sliceOffsets = offsets[axis0];
-	this.rowOffsets = offsets[axis1];
-	this.columnOffsets = offsets[axis2];
+  this.sliceOffsets = offsets[axis0];
+  this.rowOffsets = offsets[axis1];
+  this.columnOffsets = offsets[axis2];
 
-	return this;
+  return this;
 }
 /**
 Constructs and returns a new 2-dimensional <i>slice view</i> representing the slices and rows of the given column.
@@ -260,22 +260,22 @@
 @see #viewRow(int)
 */
 public ObjectMatrix2D viewColumn(int column) {
-	checkColumn(column);
-	
-	int viewRows = this.slices;
-	int viewColumns = this.rows;
-	
-	int viewRowZero = sliceZero;
-	int viewColumnZero = rowZero;
-	int viewOffset = this.offset + _columnOffset(_columnRank(column));
+  checkColumn(column);
+  
+  int viewRows = this.slices;
+  int viewColumns = this.rows;
+  
+  int viewRowZero = sliceZero;
+  int viewColumnZero = rowZero;
+  int viewOffset = this.offset + _columnOffset(_columnRank(column));
 
-	int viewRowStride = this.sliceStride;
-	int viewColumnStride = this.rowStride;
+  int viewRowStride = this.sliceStride;
+  int viewColumnStride = this.rowStride;
 
-	int[] viewRowOffsets = this.sliceOffsets;
-	int[] viewColumnOffsets = this.rowOffsets;
+  int[] viewRowOffsets = this.sliceOffsets;
+  int[] viewColumnOffsets = this.rowOffsets;
 
-	return new SelectedDenseObjectMatrix2D(viewRows,viewColumns,this.elements,viewRowZero,viewColumnZero,viewRowStride,viewColumnStride,viewRowOffsets,viewColumnOffsets,viewOffset);
+  return new SelectedDenseObjectMatrix2D(viewRows,viewColumns,this.elements,viewRowZero,viewColumnZero,viewRowStride,viewColumnStride,viewRowOffsets,viewColumnOffsets,viewOffset);
 }
 /**
 Constructs and returns a new 2-dimensional <i>slice view</i> representing the slices and columns of the given row.
@@ -292,22 +292,22 @@
 @see #viewColumn(int)
 */
 public ObjectMatrix2D viewRow(int row) {
-	checkRow(row);
-	
-	int viewRows = this.slices;
-	int viewColumns = this.columns;
-	
-	int viewRowZero = sliceZero;
-	int viewColumnZero = columnZero;
-	int viewOffset = this.offset + _rowOffset(_rowRank(row));
+  checkRow(row);
+  
+  int viewRows = this.slices;
+  int viewColumns = this.columns;
+  
+  int viewRowZero = sliceZero;
+  int viewColumnZero = columnZero;
+  int viewOffset = this.offset + _rowOffset(_rowRank(row));
 
-	int viewRowStride = this.sliceStride;
-	int viewColumnStride = this.columnStride;
+  int viewRowStride = this.sliceStride;
+  int viewColumnStride = this.columnStride;
 
-	int[] viewRowOffsets = this.sliceOffsets;
-	int[] viewColumnOffsets = this.columnOffsets;
+  int[] viewRowOffsets = this.sliceOffsets;
+  int[] viewColumnOffsets = this.columnOffsets;
 
-	return new SelectedDenseObjectMatrix2D(viewRows,viewColumns,this.elements,viewRowZero,viewColumnZero,viewRowStride,viewColumnStride,viewRowOffsets,viewColumnOffsets,viewOffset);
+  return new SelectedDenseObjectMatrix2D(viewRows,viewColumns,this.elements,viewRowZero,viewColumnZero,viewRowStride,viewColumnStride,viewRowOffsets,viewColumnOffsets,viewOffset);
 }
 /**
  * Construct and returns a new selection view.
@@ -318,7 +318,7 @@
  * @return  a new view.
  */
 protected ObjectMatrix3D viewSelectionLike(int[] sliceOffsets, int[] rowOffsets, int[] columnOffsets) {
-	return new SelectedDenseObjectMatrix3D(this.elements,sliceOffsets,rowOffsets,columnOffsets,this.offset);
+  return new SelectedDenseObjectMatrix3D(this.elements,sliceOffsets,rowOffsets,columnOffsets,this.offset);
 }
 /**
 Constructs and returns a new 2-dimensional <i>slice view</i> representing the rows and columns of the given slice.
@@ -335,21 +335,21 @@
 @see #viewColumn(int)
 */
 public ObjectMatrix2D viewSlice(int slice) {
-	checkSlice(slice);
-	
-	int viewRows = this.rows;
-	int viewColumns = this.columns;
-	
-	int viewRowZero = rowZero;
-	int viewColumnZero = columnZero;
-	int viewOffset = this.offset + _sliceOffset(_sliceRank(slice));
+  checkSlice(slice);
+  
+  int viewRows = this.rows;
+  int viewColumns = this.columns;
+  
+  int viewRowZero = rowZero;
+  int viewColumnZero = columnZero;
+  int viewOffset = this.offset + _sliceOffset(_sliceRank(slice));
 
-	int viewRowStride = this.rowStride;
-	int viewColumnStride = this.columnStride;
+  int viewRowStride = this.rowStride;
+  int viewColumnStride = this.columnStride;
 
-	int[] viewRowOffsets = this.rowOffsets;
-	int[] viewColumnOffsets = this.columnOffsets;
+  int[] viewRowOffsets = this.rowOffsets;
+  int[] viewColumnOffsets = this.columnOffsets;
 
-	return new SelectedDenseObjectMatrix2D(viewRows,viewColumns,this.elements,viewRowZero,viewColumnZero,viewRowStride,viewColumnStride,viewRowOffsets,viewColumnOffsets,viewOffset);
+  return new SelectedDenseObjectMatrix2D(viewRows,viewColumns,this.elements,viewRowZero,viewColumnZero,viewRowStride,viewColumnStride,viewRowOffsets,viewColumnOffsets,viewOffset);
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SelectedSparseDoubleMatrix1D.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SelectedSparseDoubleMatrix1D.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SelectedSparseDoubleMatrix1D.java	(working copy)
@@ -44,20 +44,20 @@
 @version 1.0, 09/24/99
 */
 class SelectedSparseDoubleMatrix1D extends DoubleMatrix1D {
-	/*
-	 * The elements of the matrix.
-	 */
-	protected AbstractIntDoubleMap elements; 
-	
-	/**
-	  * The offsets of visible indexes of this matrix.
-	  */
-	protected int[] offsets;
+  /*
+   * The elements of the matrix.
+   */
+  protected AbstractIntDoubleMap elements; 
+  
+  /**
+    * The offsets of visible indexes of this matrix.
+    */
+  protected int[] offsets;
 
-	/**
-	  * The offset.
-	  */
-	protected int offset;	
+  /**
+    * The offset.
+    */
+  protected int offset;  
 /**
  * Constructs a matrix view with the given parameters.
  * @param size the number of cells the matrix shall have.
@@ -68,12 +68,12 @@
  * @param offset   
  */
 protected SelectedSparseDoubleMatrix1D(int size, AbstractIntDoubleMap elements, int zero, int stride, int[] offsets, int offset) {
-	setUp(size,zero,stride);
-	
-	this.elements = elements;
-	this.offsets = offsets;
-	this.offset = offset;
-	this.isNoView = false;
+  setUp(size,zero,stride);
+  
+  this.elements = elements;
+  this.offsets = offsets;
+  this.offset = offset;
+  this.isNoView = false;
 }
 /**
  * Constructs a matrix view with the given parameters.
@@ -81,7 +81,7 @@
  * @param  indexes   The indexes of the cells that shall be visible.
  */
 protected SelectedSparseDoubleMatrix1D(AbstractIntDoubleMap elements, int[] offsets) {
-	this(offsets.length,elements,0,1,offsets,0);
+  this(offsets.length,elements,0,1,offsets,0);
 }
 /**
  * Returns the position of the given absolute rank within the (virtual or non-virtual) internal 1-dimensional array. 
@@ -91,7 +91,7 @@
  * @return the position.
  */
 protected int _offset(int absRank) {
-	return offsets[absRank];
+  return offsets[absRank];
 }
 /**
  * Returns the matrix cell value at coordinate <tt>index</tt>.
@@ -104,24 +104,24 @@
  * @return    the value of the specified cell.
  */
 public double getQuick(int index) {
-	//if (debug) if (index<0 || index>=size) checkIndex(index);
-	//return elements.get(index(index));
-	//manually inlined:
-	return elements.get(offset + offsets[zero + index*stride]);
+  //if (debug) if (index<0 || index>=size) checkIndex(index);
+  //return elements.get(index(index));
+  //manually inlined:
+  return elements.get(offset + offsets[zero + index*stride]);
 }
 /**
  * Returns <tt>true</tt> if both matrices share at least one identical cell.
  */
 protected boolean haveSharedCellsRaw(DoubleMatrix1D other) {
-	if (other instanceof SelectedSparseDoubleMatrix1D) {
-		SelectedSparseDoubleMatrix1D otherMatrix = (SelectedSparseDoubleMatrix1D) other;
-		return this.elements==otherMatrix.elements;
-	}
-	else if (other instanceof SparseDoubleMatrix1D) {
-		SparseDoubleMatrix1D otherMatrix = (SparseDoubleMatrix1D) other;
-		return this.elements==otherMatrix.elements;
-	}
-	return false;
+  if (other instanceof SelectedSparseDoubleMatrix1D) {
+    SelectedSparseDoubleMatrix1D otherMatrix = (SelectedSparseDoubleMatrix1D) other;
+    return this.elements==otherMatrix.elements;
+  }
+  else if (other instanceof SparseDoubleMatrix1D) {
+    SparseDoubleMatrix1D otherMatrix = (SparseDoubleMatrix1D) other;
+    return this.elements==otherMatrix.elements;
+  }
+  return false;
 }
 /**
  * Returns the position of the element with the given relative rank within the (virtual or non-virtual) internal 1-dimensional array.
@@ -130,9 +130,9 @@
  * @param     rank   the rank of the element.
  */
 protected int index(int rank) {
-	//return this.offset + super.index(rank);
-	// manually inlined:
-	return offset + offsets[zero + rank*stride];
+  //return this.offset + super.index(rank);
+  // manually inlined:
+  return offset + offsets[zero + rank*stride];
 }
 /**
  * Construct and returns a new empty matrix <i>of the same dynamic type</i> as the receiver, having the specified size.
@@ -144,7 +144,7 @@
  * @return  a new empty matrix of the same dynamic type.
  */
 public DoubleMatrix1D like(int size) {
-	return new SparseDoubleMatrix1D(size);
+  return new SparseDoubleMatrix1D(size);
 }
 /**
  * Construct and returns a new 2-d matrix <i>of the corresponding dynamic type</i>, entirelly independent of the receiver.
@@ -156,7 +156,7 @@
  * @return  a new matrix of the corresponding dynamic type.
  */
 public DoubleMatrix2D like2D(int rows, int columns) {
-	return new SparseDoubleMatrix2D(rows,columns);
+  return new SparseDoubleMatrix2D(rows,columns);
 }
 /**
  * Sets the matrix cell at coordinate <tt>index</tt> to the specified value.
@@ -169,23 +169,23 @@
  * @param    value the value to be filled into the specified cell.
  */
 public void setQuick(int index, double value) {
-	//if (debug) if (index<0 || index>=size) checkIndex(index);
-	//int i =	index(index);
-	//manually inlined:
-	int i = offset + offsets[zero + index*stride];
-	if (value == 0)
-		this.elements.removeKey(i);
-	else 
-		this.elements.put(i, value);
+  //if (debug) if (index<0 || index>=size) checkIndex(index);
+  //int i =  index(index);
+  //manually inlined:
+  int i = offset + offsets[zero + index*stride];
+  if (value == 0)
+    this.elements.removeKey(i);
+  else 
+    this.elements.put(i, value);
 }
 /**
  * Sets up a matrix with a given number of cells.
  * @param size the number of cells the matrix shall have.
  */
 protected void setUp(int size) {
-	super.setUp(size);
-	this.stride = 1;
-	this.offset = 0;
+  super.setUp(size);
+  this.stride = 1;
+  this.offset = 0;
 }
 /**
  * Construct and returns a new selection view.
@@ -194,6 +194,6 @@
  * @return  a new view.
  */
 protected DoubleMatrix1D viewSelectionLike(int[] offsets) {
-	return new SelectedSparseDoubleMatrix1D(this.elements,offsets);
+  return new SelectedSparseDoubleMatrix1D(this.elements,offsets);
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SelectedSparseDoubleMatrix2D.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SelectedSparseDoubleMatrix2D.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SelectedSparseDoubleMatrix2D.java	(working copy)
@@ -44,21 +44,21 @@
 @version 1.0, 09/24/99
 */
 class SelectedSparseDoubleMatrix2D extends DoubleMatrix2D {
-	/*
-	 * The elements of the matrix.
-	 */
-	protected AbstractIntDoubleMap elements; 
-	
-	/**
-	  * The offsets of the visible cells of this matrix.
-	  */
-	protected int[] rowOffsets;
-	protected int[] columnOffsets;
-	
-	/**
-	  * The offset.
-	  */
-	protected int offset;	
+  /*
+   * The elements of the matrix.
+   */
+  protected AbstractIntDoubleMap elements; 
+  
+  /**
+    * The offsets of the visible cells of this matrix.
+    */
+  protected int[] rowOffsets;
+  protected int[] columnOffsets;
+  
+  /**
+    * The offset.
+    */
+  protected int offset;  
 /**
  * Constructs a matrix view with the given parameters.
  * @param rows the number of rows the matrix shall have.
@@ -73,15 +73,15 @@
  * @param  offset   
  */
 protected SelectedSparseDoubleMatrix2D(int rows, int columns, AbstractIntDoubleMap elements, int rowZero, int columnZero, int rowStride, int columnStride, int[] rowOffsets, int[] columnOffsets, int offset) {
-	// be sure parameters are valid, we do not check...
-	setUp(rows,columns,rowZero,columnZero,rowStride,columnStride);
-	
-	this.elements = elements;
-	this.rowOffsets = rowOffsets;
-	this.columnOffsets = columnOffsets;
-	this.offset = offset;
-	
-	this.isNoView = false;
+  // be sure parameters are valid, we do not check...
+  setUp(rows,columns,rowZero,columnZero,rowStride,columnStride);
+  
+  this.elements = elements;
+  this.rowOffsets = rowOffsets;
+  this.columnOffsets = columnOffsets;
+  this.offset = offset;
+  
+  this.isNoView = false;
 }
 /**
  * Constructs a matrix view with the given parameters.
@@ -91,7 +91,7 @@
  * @param  offset   
  */
 protected SelectedSparseDoubleMatrix2D(AbstractIntDoubleMap elements, int[] rowOffsets, int[] columnOffsets, int offset) {
-	this(rowOffsets.length,columnOffsets.length,elements,0,0,1,1,rowOffsets,columnOffsets,offset);
+  this(rowOffsets.length,columnOffsets.length,elements,0,0,1,1,rowOffsets,columnOffsets,offset);
 }
 /**
  * Returns the position of the given absolute rank within the (virtual or non-virtual) internal 1-dimensional array. 
@@ -101,7 +101,7 @@
  * @return the position.
  */
 protected int _columnOffset(int absRank) {
-	return columnOffsets[absRank];
+  return columnOffsets[absRank];
 }
 /**
  * Returns the position of the given absolute rank within the (virtual or non-virtual) internal 1-dimensional array. 
@@ -111,7 +111,7 @@
  * @return the position.
  */
 protected int _rowOffset(int absRank) {
-	return rowOffsets[absRank];
+  return rowOffsets[absRank];
 }
 /**
  * Returns the matrix cell value at coordinate <tt>[row,column]</tt>.
@@ -125,10 +125,10 @@
  * @return    the value at the specified coordinate.
  */
 public double getQuick(int row, int column) {
-	//if (debug) if (column<0 || column>=columns || row<0 || row>=rows) throw new IndexOutOfBoundsException("row:"+row+", column:"+column);
-	//return elements.get(index(row,column));
-	//manually inlined:
-	return elements.get(offset + rowOffsets[rowZero + row*rowStride] + columnOffsets[columnZero + column*columnStride]);
+  //if (debug) if (column<0 || column>=columns || row<0 || row>=rows) throw new IndexOutOfBoundsException("row:"+row+", column:"+column);
+  //return elements.get(index(row,column));
+  //manually inlined:
+  return elements.get(offset + rowOffsets[rowZero + row*rowStride] + columnOffsets[columnZero + column*columnStride]);
 }
 /**
  * Returns <tt>true</tt> if both matrices share common cells.
@@ -140,15 +140,15 @@
  * </ul>
  */
 protected boolean haveSharedCellsRaw(DoubleMatrix2D other) {
-	if (other instanceof SelectedSparseDoubleMatrix2D) {
-		SelectedSparseDoubleMatrix2D otherMatrix = (SelectedSparseDoubleMatrix2D) other;
-		return this.elements==otherMatrix.elements;
-	}
-	else if (other instanceof SparseDoubleMatrix2D) {
-		SparseDoubleMatrix2D otherMatrix = (SparseDoubleMatrix2D) other;
-		return this.elements==otherMatrix.elements;
-	}
-	return false;
+  if (other instanceof SelectedSparseDoubleMatrix2D) {
+    SelectedSparseDoubleMatrix2D otherMatrix = (SelectedSparseDoubleMatrix2D) other;
+    return this.elements==otherMatrix.elements;
+  }
+  else if (other instanceof SparseDoubleMatrix2D) {
+    SparseDoubleMatrix2D otherMatrix = (SparseDoubleMatrix2D) other;
+    return this.elements==otherMatrix.elements;
+  }
+  return false;
 }
 /**
  * Returns the position of the given coordinate within the (virtual or non-virtual) internal 1-dimensional array. 
@@ -157,9 +157,9 @@
  * @param     column   the index of the column-coordinate.
  */
 protected int index(int row, int column) {
-	//return this.offset + super.index(row,column);
-	//manually inlined:
-	return this.offset + rowOffsets[rowZero + row*rowStride] + columnOffsets[columnZero + column*columnStride];
+  //return this.offset + super.index(row,column);
+  //manually inlined:
+  return this.offset + rowOffsets[rowZero + row*rowStride] + columnOffsets[columnZero + column*columnStride];
 }
 /**
  * Construct and returns a new empty matrix <i>of the same dynamic type</i> as the receiver, having the specified number of rows and columns.
@@ -172,7 +172,7 @@
  * @return  a new empty matrix of the same dynamic type.
  */
 public DoubleMatrix2D like(int rows, int columns) {
-	return new SparseDoubleMatrix2D(rows, columns);
+  return new SparseDoubleMatrix2D(rows, columns);
 }
 /**
  * Construct and returns a new 1-d matrix <i>of the corresponding dynamic type</i>, entirelly independent of the receiver.
@@ -183,7 +183,7 @@
  * @return  a new matrix of the corresponding dynamic type.
  */
 public DoubleMatrix1D like1D(int size) {
-	return new SparseDoubleMatrix1D(size);
+  return new SparseDoubleMatrix1D(size);
 }
 /**
  * Construct and returns a new 1-d matrix <i>of the corresponding dynamic type</i>, sharing the same cells.
@@ -196,7 +196,7 @@
  * @return  a new matrix of the corresponding dynamic type.
  */
 protected DoubleMatrix1D like1D(int size, int zero, int stride) {
-	throw new InternalError(); // this method is never called since viewRow() and viewColumn are overridden properly.
+  throw new InternalError(); // this method is never called since viewRow() and viewColumn are overridden properly.
 }
 /**
  * Sets the matrix cell at coordinate <tt>[row,column]</tt> to the specified value.
@@ -210,40 +210,40 @@
  * @param    value the value to be filled into the specified cell.
  */
 public void setQuick(int row, int column, double value) {
-	//if (debug) if (column<0 || column>=columns || row<0 || row>=rows) throw new IndexOutOfBoundsException("row:"+row+", column:"+column);
-	//int index =	index(row,column);
-	//manually inlined:
-	int index = offset + rowOffsets[rowZero + row*rowStride] + columnOffsets[columnZero + column*columnStride];
+  //if (debug) if (column<0 || column>=columns || row<0 || row>=rows) throw new IndexOutOfBoundsException("row:"+row+", column:"+column);
+  //int index =  index(row,column);
+  //manually inlined:
+  int index = offset + rowOffsets[rowZero + row*rowStride] + columnOffsets[columnZero + column*columnStride];
 
-	if (value == 0)
-		this.elements.removeKey(index);
-	else 
-		this.elements.put(index, value);
+  if (value == 0)
+    this.elements.removeKey(index);
+  else 
+    this.elements.put(index, value);
 }
 /**
  * Sets up a matrix with a given number of rows and columns.
  * @param rows the number of rows the matrix shall have.
  * @param columns the number of columns the matrix shall have.
- * @throws	IllegalArgumentException if <tt>(double)columns*rows > Integer.MAX_VALUE</tt>.
+ * @throws  IllegalArgumentException if <tt>(double)columns*rows > Integer.MAX_VALUE</tt>.
  */
 protected void setUp(int rows, int columns) {
-	super.setUp(rows,columns);
-	this.rowStride = 1;
-	this.columnStride = 1;
-	this.offset = 0;
+  super.setUp(rows,columns);
+  this.rowStride = 1;
+  this.columnStride = 1;
+  this.offset = 0;
 }
 /**
 Self modifying version of viewDice().
 */
 protected AbstractMatrix2D vDice() {
-	super.vDice();
-	// swap
-	int[] tmp = rowOffsets; rowOffsets = columnOffsets; columnOffsets = tmp;
+  super.vDice();
+  // swap
+  int[] tmp = rowOffsets; rowOffsets = columnOffsets; columnOffsets = tmp;
 
-	// flips stay unaffected
+  // flips stay unaffected
 
-	this.isNoView = false;
-	return this;
+  this.isNoView = false;
+  return this;
 }
 /**
 Constructs and returns a new <i>slice view</i> representing the rows of the given column.
@@ -253,12 +253,12 @@
 <b>Example:</b> 
 <table border="0">
   <tr nowrap> 
-	<td valign="top">2 x 3 matrix: <br>
-	  1, 2, 3<br>
-	  4, 5, 6 </td>
-	<td>viewColumn(0) ==></td>
-	<td valign="top">Matrix1D of size 2:<br>
-	  1, 4</td>
+  <td valign="top">2 x 3 matrix: <br>
+    1, 2, 3<br>
+    4, 5, 6 </td>
+  <td>viewColumn(0) ==></td>
+  <td valign="top">Matrix1D of size 2:<br>
+    1, 4</td>
    </tr>
 </table>
 
@@ -268,13 +268,13 @@
 @see #viewRow(int)
 */
 public DoubleMatrix1D viewColumn(int column) {
-	checkColumn(column);
-	int viewSize = this.rows;
-	int viewZero = this.rowZero;
-	int viewStride = this.rowStride;
-	int[] viewOffsets = this.rowOffsets;
-	int viewOffset = this.offset + _columnOffset(_columnRank(column));
-	return new SelectedSparseDoubleMatrix1D(viewSize,this.elements,viewZero,viewStride,viewOffsets,viewOffset);
+  checkColumn(column);
+  int viewSize = this.rows;
+  int viewZero = this.rowZero;
+  int viewStride = this.rowStride;
+  int[] viewOffsets = this.rowOffsets;
+  int viewOffset = this.offset + _columnOffset(_columnRank(column));
+  return new SelectedSparseDoubleMatrix1D(viewSize,this.elements,viewZero,viewStride,viewOffsets,viewOffset);
 }
 /**
 Constructs and returns a new <i>slice view</i> representing the columns of the given row.
@@ -284,12 +284,12 @@
 <b>Example:</b> 
 <table border="0">
   <tr nowrap> 
-	<td valign="top">2 x 3 matrix: <br>
-	  1, 2, 3<br>
-	  4, 5, 6 </td>
-	<td>viewRow(0) ==></td>
-	<td valign="top">Matrix1D of size 3:<br>
-	  1, 2, 3</td>
+  <td valign="top">2 x 3 matrix: <br>
+    1, 2, 3<br>
+    4, 5, 6 </td>
+  <td>viewRow(0) ==></td>
+  <td valign="top">Matrix1D of size 3:<br>
+    1, 2, 3</td>
    </tr>
 </table>
 
@@ -299,13 +299,13 @@
 @see #viewColumn(int)
 */
 public DoubleMatrix1D viewRow(int row) {
-	checkRow(row);
-	int viewSize = this.columns;
-	int viewZero = columnZero;
-	int viewStride = this.columnStride;
-	int[] viewOffsets = this.columnOffsets;
-	int viewOffset = this.offset + _rowOffset(_rowRank(row));
-	return new SelectedSparseDoubleMatrix1D(viewSize,this.elements,viewZero,viewStride,viewOffsets,viewOffset);
+  checkRow(row);
+  int viewSize = this.columns;
+  int viewZero = columnZero;
+  int viewStride = this.columnStride;
+  int[] viewOffsets = this.columnOffsets;
+  int viewOffset = this.offset + _rowOffset(_rowRank(row));
+  return new SelectedSparseDoubleMatrix1D(viewSize,this.elements,viewZero,viewStride,viewOffsets,viewOffset);
 }
 /**
  * Construct and returns a new selection view.
@@ -315,6 +315,6 @@
  * @return  a new view.
  */
 protected DoubleMatrix2D viewSelectionLike(int[] rowOffsets, int[] columnOffsets) {
-	return new SelectedSparseDoubleMatrix2D(this.elements,rowOffsets,columnOffsets,this.offset);
+  return new SelectedSparseDoubleMatrix2D(this.elements,rowOffsets,columnOffsets,this.offset);
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SelectedSparseDoubleMatrix3D.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SelectedSparseDoubleMatrix3D.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/SelectedSparseDoubleMatrix3D.java	(working copy)
@@ -44,23 +44,23 @@
 @version 1.0, 09/24/99
 */
 class SelectedSparseDoubleMatrix3D extends DoubleMatrix3D {
-	/**
-	  * The elements of this matrix.
-	  */
-	protected AbstractIntDoubleMap elements;
-	
-	/**
-	  * The offsets of the visible cells of this matrix.
-	  */
-	protected int[] sliceOffsets;
-	protected int[] rowOffsets;
-	protected int[] columnOffsets;
-	
-	/**
-	  * The offset.
-	  */
-	protected int offset;	
-	
+  /**
+    * The elements of this matrix.
+    */
+  protected AbstractIntDoubleMap elements;
+  
+  /**
+    * The offsets of the visible cells of this matrix.
+    */
+  protected int[] sliceOffsets;
+  protected int[] rowOffsets;
+  protected int[] columnOffsets;
+  
+  /**
+    * The offset.
+    */
+  protected int offset;  
+  
 /**
  * Constructs a matrix view with the given parameters.
  * @param elements the cells.
@@ -69,21 +69,21 @@
  * @param  columnOffsets   The column offsets of the cells that shall be visible.
  */
 protected SelectedSparseDoubleMatrix3D(AbstractIntDoubleMap elements, int[] sliceOffsets, int[] rowOffsets, int[] columnOffsets, int offset) {
-	// be sure parameters are valid, we do not check...
-	int slices = sliceOffsets.length;
-	int rows = rowOffsets.length;
-	int columns = columnOffsets.length;
-	setUp(slices,rows, columns);
-	
-	this.elements = elements;
-	
-	this.sliceOffsets = sliceOffsets;
-	this.rowOffsets = rowOffsets;
-	this.columnOffsets = columnOffsets;
+  // be sure parameters are valid, we do not check...
+  int slices = sliceOffsets.length;
+  int rows = rowOffsets.length;
+  int columns = columnOffsets.length;
+  setUp(slices,rows, columns);
+  
+  this.elements = elements;
+  
+  this.sliceOffsets = sliceOffsets;
+  this.rowOffsets = rowOffsets;
+  this.columnOffsets = columnOffsets;
 
-	this.offset = offset;
-	
-	this.isNoView = false;
+  this.offset = offset;
+  
+  this.isNoView = false;
 }
 /**
  * Returns the position of the given absolute rank within the (virtual or non-virtual) internal 1-dimensional array. 
@@ -93,7 +93,7 @@
  * @return the position.
  */
 protected int _columnOffset(int absRank) {
-	return columnOffsets[absRank];
+  return columnOffsets[absRank];
 }
 /**
  * Returns the position of the given absolute rank within the (virtual or non-virtual) internal 1-dimensional array. 
@@ -103,7 +103,7 @@
  * @return the position.
  */
 protected int _rowOffset(int absRank) {
-	return rowOffsets[absRank];
+  return rowOffsets[absRank];
 }
 /**
  * Returns the position of the given absolute rank within the (virtual or non-virtual) internal 1-dimensional array. 
@@ -113,7 +113,7 @@
  * @return the position.
  */
 protected int _sliceOffset(int absRank) {
-	return sliceOffsets[absRank];
+  return sliceOffsets[absRank];
 }
 /**
  * Returns the matrix cell value at coordinate <tt>[slice,row,column]</tt>.
@@ -128,10 +128,10 @@
  * @return    the value at the specified coordinate.
  */
 public double getQuick(int slice, int row, int column) {
-	//if (debug) if (slice<0 || slice>=slices || row<0 || row>=rows || column<0 || column>=columns) throw new IndexOutOfBoundsException("slice:"+slice+", row:"+row+", column:"+column);
-	//return elements.get(index(slice,row,column));
-	//manually inlined:
-	return elements.get(offset + sliceOffsets[sliceZero + slice*sliceStride] + rowOffsets[rowZero + row*rowStride] + columnOffsets[columnZero + column*columnStride]);
+  //if (debug) if (slice<0 || slice>=slices || row<0 || row>=rows || column<0 || column>=columns) throw new IndexOutOfBoundsException("slice:"+slice+", row:"+row+", column:"+column);
+  //return elements.get(index(slice,row,column));
+  //manually inlined:
+  return elements.get(offset + sliceOffsets[sliceZero + slice*sliceStride] + rowOffsets[rowZero + row*rowStride] + columnOffsets[columnZero + column*columnStride]);
 }
 /**
  * Returns <tt>true</tt> if both matrices share common cells.
@@ -143,15 +143,15 @@
  * </ul>
  */
 protected boolean haveSharedCellsRaw(DoubleMatrix3D other) {
-	if (other instanceof SelectedSparseDoubleMatrix3D) {
-		SelectedSparseDoubleMatrix3D otherMatrix = (SelectedSparseDoubleMatrix3D) other;
-		return this.elements==otherMatrix.elements;
-	}
-	else if (other instanceof SparseDoubleMatrix3D) {
-		SparseDoubleMatrix3D otherMatrix = (SparseDoubleMatrix3D) other;
-		return this.elements==otherMatrix.elements;
-	}
-	return false;
+  if (other instanceof SelectedSparseDoubleMatrix3D) {
+    SelectedSparseDoubleMatrix3D otherMatrix = (SelectedSparseDoubleMatrix3D) other;
+    return this.elements==otherMatrix.elements;
+  }
+  else if (other instanceof SparseDoubleMatrix3D) {
+    SparseDoubleMatrix3D otherMatrix = (SparseDoubleMatrix3D) other;
+    return this.elements==otherMatrix.elements;
+  }
+  return false;
 }
 /**
  * Returns the position of the given coordinate within the (virtual or non-virtual) internal 1-dimensional array. 
@@ -161,9 +161,9 @@
  * @param     column   the index of the third-coordinate.
  */
 protected int index(int slice, int row, int column) {
-	//return this.offset + super.index(slice,row,column);
-	//manually inlined:
-	return this.offset + sliceOffsets[sliceZero + slice*sliceStride] + rowOffsets[rowZero + row*rowStride] + columnOffsets[columnZero + column*columnStride];
+  //return this.offset + super.index(slice,row,column);
+  //manually inlined:
+  return this.offset + sliceOffsets[sliceZero + slice*sliceStride] + rowOffsets[rowZero + row*rowStride] + columnOffsets[columnZero + column*columnStride];
 }
 /**
  * Construct and returns a new empty matrix <i>of the same dynamic type</i> as the receiver, having the specified number of slices, rows and columns.
@@ -177,7 +177,7 @@
  * @return  a new empty matrix of the same dynamic type.
  */
 public DoubleMatrix3D like(int slices, int rows, int columns) {
-	return new SparseDoubleMatrix3D(slices,rows,columns); 
+  return new SparseDoubleMatrix3D(slices,rows,columns); 
 }
 /**
  * Construct and returns a new 2-d matrix <i>of the corresponding dynamic type</i>, sharing the same cells.
@@ -193,7 +193,7 @@
  * @return  a new matrix of the corresponding dynamic type.
  */
 protected DoubleMatrix2D like2D(int rows, int columns, int rowZero, int columnZero, int rowStride, int columnStride) {
-	throw new InternalError(); // this method is never called since viewRow() and viewColumn are overridden properly.
+  throw new InternalError(); // this method is never called since viewRow() and viewColumn are overridden properly.
 }
 /**
  * Sets the matrix cell at coordinate <tt>[slice,row,column]</tt> to the specified value.
@@ -208,47 +208,47 @@
  * @param    value the value to be filled into the specified cell.
  */
 public void setQuick(int slice, int row, int column, double value) {
-	//if (debug) if (slice<0 || slice>=slices || row<0 || row>=rows || column<0 || column>=columns) throw new IndexOutOfBoundsException("slice:"+slice+", row:"+row+", column:"+column);
-	//int index =	index(slice,row,column);
-	//manually inlined:
-	int index = offset + sliceOffsets[sliceZero + slice*sliceStride] + rowOffsets[rowZero + row*rowStride] + columnOffsets[columnZero + column*columnStride];
-	if (value == 0)
-		this.elements.removeKey(index);
-	else 
-		this.elements.put(index, value);
+  //if (debug) if (slice<0 || slice>=slices || row<0 || row>=rows || column<0 || column>=columns) throw new IndexOutOfBoundsException("slice:"+slice+", row:"+row+", column:"+column);
+  //int index =  index(slice,row,column);
+  //manually inlined:
+  int index = offset + sliceOffsets[sliceZero + slice*sliceStride] + rowOffsets[rowZero + row*rowStride] + columnOffsets[columnZero + column*columnStride];
+  if (value == 0)
+    this.elements.removeKey(index);
+  else 
+    this.elements.put(index, value);
 }
 /**
  * Sets up a matrix with a given number of slices and rows.
  * @param slices the number of slices the matrix shall have.
  * @param rows the number of rows the matrix shall have.
  * @param columns the number of columns the matrix shall have.
- * @throws	IllegalArgumentException if <tt>(double)rows*slices > Integer.MAX_VALUE</tt>.
+ * @throws  IllegalArgumentException if <tt>(double)rows*slices > Integer.MAX_VALUE</tt>.
  */
 protected void setUp(int slices, int rows, int columns) {
-	super.setUp(slices,rows,columns);
-	this.sliceStride = 1;
-	this.rowStride = 1;
-	this.columnStride = 1;
-	this.offset = 0;
+  super.setUp(slices,rows,columns);
+  this.sliceStride = 1;
+  this.rowStride = 1;
+  this.columnStride = 1;
+  this.offset = 0;
 }
 /**
 Self modifying version of viewDice().
 @throws IllegalArgumentException if some of the parameters are equal or not in range 0..2.
 */
 protected AbstractMatrix3D vDice(int axis0, int axis1, int axis2) {
-	super.vDice(axis0,axis1,axis2);
-	
-	// swap offsets
-	int[][] offsets = new int[3][];
-	offsets[0] = this.sliceOffsets;
-	offsets[1] = this.rowOffsets;
-	offsets[2] = this.columnOffsets;
+  super.vDice(axis0,axis1,axis2);
+  
+  // swap offsets
+  int[][] offsets = new int[3][];
+  offsets[0] = this.sliceOffsets;
+  offsets[1] = this.rowOffsets;
+  offsets[2] = this.columnOffsets;
 
-	this.sliceOffsets = offsets[axis0];
-	this.rowOffsets = offsets[axis1];
-	this.columnOffsets = offsets[axis2];
+  this.sliceOffsets = offsets[axis0];
+  this.rowOffsets = offsets[axis1];
+  this.columnOffsets = offsets[axis2];
 
-	return this;
+  return this;
 }
 /**
 Constructs and returns a new 2-dimensional <i>slice view</i> representing the slices and rows of the given column.
@@ -265,22 +265,22 @@
 @see #viewRow(int)
 */
 public DoubleMatrix2D viewColumn(int column) {
-	checkColumn(column);
-	
-	int viewRows = this.slices;
-	int viewColumns = this.rows;
-	
-	int viewRowZero = sliceZero;
-	int viewColumnZero = rowZero;
-	int viewOffset = this.offset + _columnOffset(_columnRank(column));
+  checkColumn(column);
+  
+  int viewRows = this.slices;
+  int viewColumns = this.rows;
+  
+  int viewRowZero = sliceZero;
+  int viewColumnZero = rowZero;
+  int viewOffset = this.offset + _columnOffset(_columnRank(column));
 
-	int viewRowStride = this.sliceStride;
-	int viewColumnStride = this.rowStride;
+  int viewRowStride = this.sliceStride;
+  int viewColumnStride = this.rowStride;
 
-	int[] viewRowOffsets = this.sliceOffsets;
-	int[] viewColumnOffsets = this.rowOffsets;
+  int[] viewRowOffsets = this.sliceOffsets;
+  int[] viewColumnOffsets = this.rowOffsets;
 
-	return new SelectedSparseDoubleMatrix2D(viewRows,viewColumns,this.elements,viewRowZero,viewColumnZero,viewRowStride,viewColumnStride,viewRowOffsets,viewColumnOffsets,viewOffset);
+  return new SelectedSparseDoubleMatrix2D(viewRows,viewColumns,this.elements,viewRowZero,viewColumnZero,viewRowStride,viewColumnStride,viewRowOffsets,viewColumnOffsets,viewOffset);
 }
 /**
 Constructs and returns a new 2-dimensional <i>slice view</i> representing the slices and columns of the given row.
@@ -297,22 +297,22 @@
 @see #viewColumn(int)
 */
 public DoubleMatrix2D viewRow(int row) {
-	checkRow(row);
-	
-	int viewRows = this.slices;
-	int viewColumns = this.columns;
-	
-	int viewRowZero = sliceZero;
-	int viewColumnZero = columnZero;
-	int viewOffset = this.offset + _rowOffset(_rowRank(row));
+  checkRow(row);
+  
+  int viewRows = this.slices;
+  int viewColumns = this.columns;
+  
+  int viewRowZero = sliceZero;
+  int viewColumnZero = columnZero;
+  int viewOffset = this.offset + _rowOffset(_rowRank(row));
 
-	int viewRowStride = this.sliceStride;
-	int viewColumnStride = this.columnStride;
+  int viewRowStride = this.sliceStride;
+  int viewColumnStride = this.columnStride;
 
-	int[] viewRowOffsets = this.sliceOffsets;
-	int[] viewColumnOffsets = this.columnOffsets;
+  int[] viewRowOffsets = this.sliceOffsets;
+  int[] viewColumnOffsets = this.columnOffsets;
 
-	return new SelectedSparseDoubleMatrix2D(viewRows,viewColumns,this.elements,viewRowZero,viewColumnZero,viewRowStride,viewColumnStride,viewRowOffsets,viewColumnOffsets,viewOffset);
+  return new SelectedSparseDoubleMatrix2D(viewRows,viewColumns,this.elements,viewRowZero,viewColumnZero,viewRowStride,viewColumnStride,viewRowOffsets,viewColumnOffsets,viewOffset);
 }
 /**
  * Construct and returns a new selection view.
@@ -323,7 +323,7 @@
  * @return  a new view.
  */
 protected DoubleMatrix3D viewSelectionLike(int[] sliceOffsets, int[] rowOffsets, int[] columnOffsets) {
-	return new SelectedSparseDoubleMatrix3D(this.elements,sliceOffsets,rowOffsets,columnOffsets,this.offset);
+  return new SelectedSparseDoubleMatrix3D(this.elements,sliceOffsets,rowOffsets,columnOffsets,this.offset);
 }
 /**
 Constructs and returns a new 2-dimensional <i>slice view</i> representing the rows and columns of the given slice.
@@ -340,21 +340,21 @@
 @see #viewColumn(int)
 */
 public DoubleMatrix2D viewSlice(int slice) {
-	checkSlice(slice);
-	
-	int viewRows = this.rows;
-	int viewColumns = this.columns;
-	
-	int viewRowZero = rowZero;
-	int viewColumnZero = columnZero;
-	int viewOffset = this.offset + _sliceOffset(_sliceRank(slice));
+  checkSlice(slice);
+  
+  int viewRows = this.rows;
+  int viewColumns = this.columns;
+  
+  int viewRowZero = rowZero;
+  int viewColumnZero = columnZero;
+  int viewOffset = this.offset + _sliceOffset(_sliceRank(slice));
 
-	int viewRowStride = this.rowStride;
-	int viewColumnStride = this.columnStride;
+  int viewRowStride = this.rowStride;
+  int viewColumnStride = this.columnStride;
 
-	int[] viewRowOffsets = this.rowOffsets;
-	int[] viewColumnOffsets = this.columnOffsets;
+  int[] viewRowOffsets = this.rowOffsets;
+  int[] viewColumnOffsets = this.columnOffsets;
 
-	return new SelectedSparseDoubleMatrix2D(viewRows,viewColumns,this.elements,viewRowZero,viewColumnZero,viewRowStride,viewColumnStride,viewRowOffsets,viewColumnOffsets,viewOffset);
+  return new SelectedSparseDoubleMatrix2D(viewRows,viewColumns,this.elements,viewRowZero,viewColumnZero,viewRowStride,viewColumnStride,viewRowOffsets,viewColumnOffsets,viewOffset);
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/AbstractMatrix1D.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/AbstractMatrix1D.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/AbstractMatrix1D.java	(working copy)
@@ -22,29 +22,29 @@
  */
 @Deprecated
 public abstract class AbstractMatrix1D extends AbstractMatrix {
-	/** the number of cells this matrix (view) has */
-	protected int size;
+  /** the number of cells this matrix (view) has */
+  protected int size;
 
-	
- 	/** the index of the first element */
-	protected int zero;
+  
+   /** the index of the first element */
+  protected int zero;
 
-	/** the number of indexes between any two elements, i.e. <tt>index(i+1) - index(i)</tt>. */
-	protected int stride;
+  /** the number of indexes between any two elements, i.e. <tt>index(i+1) - index(i)</tt>. */
+  protected int stride;
 
-	/** 
-	 * Indicates non-flipped state (flip==1) or flipped state (flip==-1).
-	 * see _setFlip() for further info.
-	 */
-	//protected int flip;
+  /** 
+   * Indicates non-flipped state (flip==1) or flipped state (flip==-1).
+   * see _setFlip() for further info.
+   */
+  //protected int flip;
 
-	/** 
-	 * Indicates non-flipped state or flipped state.
-	 * see _setFlip() for further info.
-	 */
-	//protected int flipMask;
+  /** 
+   * Indicates non-flipped state or flipped state.
+   * see _setFlip() for further info.
+   */
+  //protected int flipMask;
 
-	// this.isNoView implies: offset==0, stride==1
+  // this.isNoView implies: offset==0, stride==1
 /**
  * Makes this class non instantiable, but still let's others inherit from it.
  */
@@ -57,7 +57,7 @@
  * @return the position.
  */
 protected int _offset(int absRank) {
-	return absRank;
+  return absRank;
 }
 /**
  * Returns the absolute rank of the given relative rank. 
@@ -66,48 +66,48 @@
  * @return the absolute rank of the element.
  */
 protected int _rank(int rank) {
-	return zero + rank*stride;
-	//return zero + ((rank+flipMask)^flipMask);
-	//return zero + rank*flip; // slower
+  return zero + rank*stride;
+  //return zero + ((rank+flipMask)^flipMask);
+  //return zero + rank*flip; // slower
 }
 /**
  * Sanity check for operations requiring an index to be within bounds.
  * @throws IndexOutOfBoundsException if <tt>index < 0 || index >= size()</tt>.
  */
 protected void checkIndex(int index) {
-	if (index < 0 || index >= size) throw new IndexOutOfBoundsException("Attempted to access "+toStringShort()+" at index="+index);
+  if (index < 0 || index >= size) throw new IndexOutOfBoundsException("Attempted to access "+toStringShort()+" at index="+index);
 }
 /**
  * Checks whether indexes are legal and throws an exception, if necessary.
  * @throws IndexOutOfBoundsException if <tt>! (0 <= indexes[i] < size())</tt> for any i=0..indexes.length()-1.
  */
 protected void checkIndexes(int[] indexes) {
-	for (int i=indexes.length; --i >= 0; ) {
-		int index = indexes[i];
-		if (index < 0 || index >= size) checkIndex(index);
-	}
+  for (int i=indexes.length; --i >= 0; ) {
+    int index = indexes[i];
+    if (index < 0 || index >= size) checkIndex(index);
+  }
 }
 /**
  * Checks whether the receiver contains the given range and throws an exception, if necessary.
- * @throws	IndexOutOfBoundsException if <tt>index<0 || index+width>size()</tt>.
+ * @throws  IndexOutOfBoundsException if <tt>index<0 || index+width>size()</tt>.
  */
 protected void checkRange(int index, int width) {
-	if (index<0 || index+width>size)
-		throw new IndexOutOfBoundsException("index: "+index+", width: "+width+", size="+size);
+  if (index<0 || index+width>size)
+    throw new IndexOutOfBoundsException("index: "+index+", width: "+width+", size="+size);
 }
 /**
  * Sanity check for operations requiring two matrices with the same size.
  * @throws IllegalArgumentException if <tt>size() != B.size()</tt>.
  */
 protected void checkSize(double[] B) {
-	if (size != B.length) throw new IllegalArgumentException("Incompatible sizes: "+toStringShort()+" and "+B.length);
+  if (size != B.length) throw new IllegalArgumentException("Incompatible sizes: "+toStringShort()+" and "+B.length);
 }
 /**
  * Sanity check for operations requiring two matrices with the same size.
  * @throws IllegalArgumentException if <tt>size() != B.size()</tt>.
  */
 public void checkSize(AbstractMatrix1D B) {
-	if (size != B.size) throw new IllegalArgumentException("Incompatible sizes: "+toStringShort()+" and "+B.toStringShort());
+  if (size != B.size) throw new IllegalArgumentException("Incompatible sizes: "+toStringShort()+" and "+B.toStringShort());
 }
 /**
  * Returns the position of the element with the given relative rank within the (virtual or non-virtual) internal 1-dimensional array.
@@ -116,7 +116,7 @@
  * @param     rank   the rank of the element.
  */
 protected int index(int rank) {
-	return _offset(_rank(rank));
+  return _offset(_rank(rank));
 }
 /**
  * Sets up a matrix with a given number of cells.
@@ -124,7 +124,7 @@
  * @throws IllegalArgumentException if <tt>size<0</tt>.
  */
 protected void setUp(int size) {
-	setUp(size,0,1);
+  setUp(size,0,1);
 }
 /**
  * Sets up a matrix with the given parameters.
@@ -134,18 +134,18 @@
  * @throws IllegalArgumentException if <tt>size<0</tt>.
  */
 protected void setUp(int size, int zero, int stride) {
-	if (size<0) throw new IllegalArgumentException("negative size");
+  if (size<0) throw new IllegalArgumentException("negative size");
 
-	this.size = size;
-	this.zero = zero;
-	this.stride = stride;
-	this.isNoView = true;
+  this.size = size;
+  this.zero = zero;
+  this.stride = stride;
+  this.isNoView = true;
 }
 /**
  * Returns the number of cells.
  */
 public int size() {
-	return size;
+  return size;
 }
 /**
  * Returns the stride of the given dimension (axis, rank). 
@@ -155,47 +155,47 @@
  * @throws IllegalArgumentException if <tt>dimension != 0</tt>.
  */
 protected int stride(int dimension) {
-	if (dimension != 0) throw new IllegalArgumentException("invalid dimension: "+dimension+"used to access"+toStringShort());
-	return this.stride;
+  if (dimension != 0) throw new IllegalArgumentException("invalid dimension: "+dimension+"used to access"+toStringShort());
+  return this.stride;
 }
 /**
  * Returns a string representation of the receiver's shape.
  */
 public String toStringShort() {
-	return AbstractFormatter.shape(this);
+  return AbstractFormatter.shape(this);
 }
 /**
 Self modifying version of viewFlip().
 What used to be index <tt>0</tt> is now index <tt>size()-1</tt>, ..., what used to be index <tt>size()-1</tt> is now index <tt>0</tt>.
 */
 protected AbstractMatrix1D vFlip() {
-	if (size>0) {
-		this.zero += (this.size-1)*this.stride;
-		this.stride = - this.stride;
-		this.isNoView = false;
-	}
-	return this;
+  if (size>0) {
+    this.zero += (this.size-1)*this.stride;
+    this.stride = - this.stride;
+    this.isNoView = false;
+  }
+  return this;
 }
 /**
 Self modifying version of viewPart().
-@throws	IndexOutOfBoundsException if <tt>index<0 || index+width>size()</tt>.
+@throws  IndexOutOfBoundsException if <tt>index<0 || index+width>size()</tt>.
 */
 protected AbstractMatrix1D vPart(int index, int width) {
-	checkRange(index,width);
-	this.zero += this.stride * index;
-	this.size = width;
-	this.isNoView = false;
-	return this;
+  checkRange(index,width);
+  this.zero += this.stride * index;
+  this.size = width;
+  this.isNoView = false;
+  return this;
 }
 /**
 Self modifying version of viewStrides().
-@throws	IndexOutOfBoundsException if <tt>stride <= 0</tt>.
+@throws  IndexOutOfBoundsException if <tt>stride <= 0</tt>.
 */
 protected AbstractMatrix1D vStrides(int stride) {
-	if (stride<=0) throw new IndexOutOfBoundsException("illegal stride: "+stride);
-	this.stride *= stride;
-	if (this.size!=0) this.size = (this.size-1)/stride +1;
-	this.isNoView = false;
-	return this;
+  if (stride<=0) throw new IndexOutOfBoundsException("illegal stride: "+stride);
+  this.stride *= stride;
+  if (this.size!=0) this.size = (this.size-1)/stride +1;
+  this.isNoView = false;
+  return this;
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/AbstractMatrix2D.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/AbstractMatrix2D.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/AbstractMatrix2D.java	(working copy)
@@ -22,30 +22,30 @@
  */
 @Deprecated
 public abstract class AbstractMatrix2D extends AbstractMatrix {
- 	/** the number of colums and rows this matrix (view) has */
-	protected int columns, rows;
-	
-	/** the number of elements between two rows, i.e. <tt>index(i+1,j,k) - index(i,j,k)</tt>. */
-	protected int rowStride;
-	
-	/** the number of elements between two columns, i.e. <tt>index(i,j+1,k) - index(i,j,k)</tt>. */
-	protected int columnStride;
+   /** the number of colums and rows this matrix (view) has */
+  protected int columns, rows;
+  
+  /** the number of elements between two rows, i.e. <tt>index(i+1,j,k) - index(i,j,k)</tt>. */
+  protected int rowStride;
+  
+  /** the number of elements between two columns, i.e. <tt>index(i,j+1,k) - index(i,j,k)</tt>. */
+  protected int columnStride;
 
-	
- 	/** the index of the first element */
-	protected int rowZero, columnZero;
+  
+   /** the index of the first element */
+  protected int rowZero, columnZero;
 
-	/** 
-	 * Indicates non-flipped state (flip==1) or flipped state (flip==-1).
-	 * see _setFlip() for further info.
-	 */
-	//protected int rowFlip, columnFlip;
+  /** 
+   * Indicates non-flipped state (flip==1) or flipped state (flip==-1).
+   * see _setFlip() for further info.
+   */
+  //protected int rowFlip, columnFlip;
 
-	/** 
-	 * Indicates non-flipped state or flipped state.
-	 * see _setFlip() for further info.
-	 */
-	//protected int rowFlipMask, columnFlipMask;
+  /** 
+   * Indicates non-flipped state or flipped state.
+   * see _setFlip() for further info.
+   */
+  //protected int rowFlipMask, columnFlipMask;
 
 /**
  * Makes this class non instantiable, but still let's others inherit from it.
@@ -59,7 +59,7 @@
  * @return the position.
  */
 protected int _columnOffset(int absRank) {
-	return absRank;
+  return absRank;
 }
 /**
  * Returns the absolute rank of the given relative rank. 
@@ -68,9 +68,9 @@
  * @return the absolute rank of the element.
  */
 protected int _columnRank(int rank) {
-	return columnZero + rank*columnStride;
-	//return columnZero + ((rank+columnFlipMask)^columnFlipMask);
-	//return columnZero + rank*columnFlip; // slower
+  return columnZero + rank*columnStride;
+  //return columnZero + ((rank+columnFlipMask)^columnFlipMask);
+  //return columnZero + rank*columnFlip; // slower
 }
 /**
  * Returns the position of the given absolute rank within the (virtual or non-virtual) internal 1-dimensional array. 
@@ -80,7 +80,7 @@
  * @return the position.
  */
 protected int _rowOffset(int absRank) {
-	return absRank;
+  return absRank;
 }
 /**
  * Returns the absolute rank of the given relative rank. 
@@ -89,70 +89,70 @@
  * @return the absolute rank of the element.
  */
 protected int _rowRank(int rank) {
-	return rowZero + rank*rowStride;
-	//return rowZero + ((rank+rowFlipMask)^rowFlipMask);
-	//return rowZero + rank*rowFlip; // slower
+  return rowZero + rank*rowStride;
+  //return rowZero + ((rank+rowFlipMask)^rowFlipMask);
+  //return rowZero + rank*rowFlip; // slower
 }
 /**
  * Checks whether the receiver contains the given box and throws an exception, if necessary.
- * @throws	IndexOutOfBoundsException if <tt>column<0 || width<0 || column+width>columns() || row<0 || height<0 || row+height>rows()</tt>
+ * @throws  IndexOutOfBoundsException if <tt>column<0 || width<0 || column+width>columns() || row<0 || height<0 || row+height>rows()</tt>
  */
 protected void checkBox(int row, int column, int height, int width) {
-	if (column<0 || width<0 || column+width>columns || row<0 || height<0 || row+height>rows) throw new IndexOutOfBoundsException(toStringShort()+", column:"+column+", row:"+row+" ,width:"+width+", height:"+height);
+  if (column<0 || width<0 || column+width>columns || row<0 || height<0 || row+height>rows) throw new IndexOutOfBoundsException(toStringShort()+", column:"+column+", row:"+row+" ,width:"+width+", height:"+height);
 }
 /**
  * Sanity check for operations requiring a column index to be within bounds.
  * @throws IndexOutOfBoundsException if <tt>column < 0 || column >= columns()</tt>.
  */
 protected void checkColumn(int column) {
-	if (column < 0 || column >= columns) throw new IndexOutOfBoundsException("Attempted to access "+toStringShort()+" at column="+column);
+  if (column < 0 || column >= columns) throw new IndexOutOfBoundsException("Attempted to access "+toStringShort()+" at column="+column);
 }
 /**
  * Checks whether indexes are legal and throws an exception, if necessary.
  * @throws IndexOutOfBoundsException if <tt>! (0 <= indexes[i] < columns())</tt> for any i=0..indexes.length()-1.
  */
 protected void checkColumnIndexes(int[] indexes) {
-	for (int i=indexes.length; --i >= 0; ) {
-		int index = indexes[i];
-		if (index < 0 || index >= columns) checkColumn(index);
-	}
+  for (int i=indexes.length; --i >= 0; ) {
+    int index = indexes[i];
+    if (index < 0 || index >= columns) checkColumn(index);
+  }
 }
 /**
  * Sanity check for operations requiring a row index to be within bounds.
  * @throws IndexOutOfBoundsException if <tt>row < 0 || row >= rows()</tt>.
  */
 protected void checkRow(int row) {
-	if (row < 0 || row >= rows) throw new IndexOutOfBoundsException("Attempted to access "+toStringShort()+" at row="+row);
+  if (row < 0 || row >= rows) throw new IndexOutOfBoundsException("Attempted to access "+toStringShort()+" at row="+row);
 }
 /**
  * Checks whether indexes are legal and throws an exception, if necessary.
  * @throws IndexOutOfBoundsException if <tt>! (0 <= indexes[i] < rows())</tt> for any i=0..indexes.length()-1.
  */
 protected void checkRowIndexes(int[] indexes) {
-	for (int i=indexes.length; --i >= 0; ) {
-		int index = indexes[i];
-		if (index < 0 || index >= rows) checkRow(index);
-	}
+  for (int i=indexes.length; --i >= 0; ) {
+    int index = indexes[i];
+    if (index < 0 || index >= rows) checkRow(index);
+  }
 }
 /**
  * Sanity check for operations requiring two matrices with the same number of columns and rows.
  * @throws IllegalArgumentException if <tt>columns() != B.columns() || rows() != B.rows()</tt>.
  */
 public void checkShape(AbstractMatrix2D B) {
-	if (columns != B.columns || rows != B.rows) throw new IllegalArgumentException("Incompatible dimensions: "+toStringShort()+" and "+B.toStringShort());
+  if (columns != B.columns || rows != B.rows) throw new IllegalArgumentException("Incompatible dimensions: "+toStringShort()+" and "+B.toStringShort());
 }
 /**
  * Sanity check for operations requiring matrices with the same number of columns and rows.
  * @throws IllegalArgumentException if <tt>columns() != B.columns() || rows() != B.rows() || columns() != C.columns() || rows() != C.rows()</tt>.
  */
 public void checkShape(AbstractMatrix2D B, AbstractMatrix2D C) {
-	if (columns != B.columns || rows != B.rows || columns != C.columns || rows != C.rows) throw new IllegalArgumentException("Incompatible dimensions: "+toStringShort()+", "+B.toStringShort()+", "+C.toStringShort());
+  if (columns != B.columns || rows != B.rows || columns != C.columns || rows != C.rows) throw new IllegalArgumentException("Incompatible dimensions: "+toStringShort()+", "+B.toStringShort()+", "+C.toStringShort());
 }
 /**
  * Returns the number of columns.
  */
 public int columns() {
-	return columns;
+  return columns;
 }
 /**
  * Returns the position of the given coordinate within the (virtual or non-virtual) internal 1-dimensional array. 
@@ -161,22 +161,22 @@
  * @param     column   the index of the column-coordinate.
  */
 protected int index(int row, int column) {
-	return _rowOffset(_rowRank(row)) + _columnOffset(_columnRank(column));
+  return _rowOffset(_rowRank(row)) + _columnOffset(_columnRank(column));
 }
 /**
  * Returns the number of rows.
  */
 public int rows() {
-	return rows;
+  return rows;
 }
 /**
  * Sets up a matrix with a given number of rows and columns.
  * @param rows the number of rows the matrix shall have.
  * @param columns the number of columns the matrix shall have.
- * @throws	IllegalArgumentException if <tt>rows<0 || columns<0 || (double)columns*rows > Integer.MAX_VALUE</tt>.
+ * @throws  IllegalArgumentException if <tt>rows<0 || columns<0 || (double)columns*rows > Integer.MAX_VALUE</tt>.
  */
 protected void setUp(int rows, int columns) {
-	setUp(rows,columns,0,0,columns,1);
+  setUp(rows,columns,0,0,columns,1);
 }
 /**
  * Sets up a matrix with a given number of rows and columns and the given strides.
@@ -186,95 +186,95 @@
  * @param columnZero the position of the first element.
  * @param rowStride the number of elements between two rows, i.e. <tt>index(i+1,j)-index(i,j)</tt>.
  * @param columnStride the number of elements between two columns, i.e. <tt>index(i,j+1)-index(i,j)</tt>.
- * @throws	IllegalArgumentException if <tt>rows<0 || columns<0 || (double)columns*rows > Integer.MAX_VALUE</tt> or flip's are illegal.
+ * @throws  IllegalArgumentException if <tt>rows<0 || columns<0 || (double)columns*rows > Integer.MAX_VALUE</tt> or flip's are illegal.
  */
 protected void setUp(int rows, int columns, int rowZero, int columnZero, int rowStride, int columnStride) {
-	if (rows<0 || columns<0) throw new IllegalArgumentException("negative size");
-	this.rows = rows;
-	this.columns = columns;
-	
-	this.rowZero = rowZero;
-	this.columnZero = columnZero;
+  if (rows<0 || columns<0) throw new IllegalArgumentException("negative size");
+  this.rows = rows;
+  this.columns = columns;
+  
+  this.rowZero = rowZero;
+  this.columnZero = columnZero;
 
-	this.rowStride = rowStride;
-	this.columnStride = columnStride;
-	
-	this.isNoView = true;
-	if ((double)columns*rows > Integer.MAX_VALUE) throw new IllegalArgumentException("matrix too large");
+  this.rowStride = rowStride;
+  this.columnStride = columnStride;
+  
+  this.isNoView = true;
+  if ((double)columns*rows > Integer.MAX_VALUE) throw new IllegalArgumentException("matrix too large");
 }
 /**
  * Returns the number of cells which is <tt>rows()*columns()</tt>.
  */
 public int size() {
-	return rows*columns;
+  return rows*columns;
 }
 /**
  * Returns a string representation of the receiver's shape.
  */
 public String toStringShort() {
-	return AbstractFormatter.shape(this);
+  return AbstractFormatter.shape(this);
 }
 /**
 Self modifying version of viewColumnFlip().
 */
 protected AbstractMatrix2D vColumnFlip() {
-	if (columns>0) {
-		columnZero += (columns-1)*columnStride;
-		columnStride = -columnStride;
-		this.isNoView = false;
-	}
-	return this;
+  if (columns>0) {
+    columnZero += (columns-1)*columnStride;
+    columnStride = -columnStride;
+    this.isNoView = false;
+  }
+  return this;
 }
 /**
 Self modifying version of viewDice().
 */
 protected AbstractMatrix2D vDice() {
-	int tmp;
-	// swap;
-	tmp = rows; rows = columns; columns = tmp;
-	tmp = rowStride; rowStride = columnStride; columnStride = tmp;
-	tmp = rowZero; rowZero = columnZero; columnZero = tmp;
+  int tmp;
+  // swap;
+  tmp = rows; rows = columns; columns = tmp;
+  tmp = rowStride; rowStride = columnStride; columnStride = tmp;
+  tmp = rowZero; rowZero = columnZero; columnZero = tmp;
 
-	// flips stay unaffected
+  // flips stay unaffected
 
-	this.isNoView = false;
-	return this;
+  this.isNoView = false;
+  return this;
 }
 /**
 Self modifying version of viewPart().
-@throws	IndexOutOfBoundsException if <tt>column<0 || width<0 || column+width>columns() || row<0 || height<0 || row+height>rows()</tt>
+@throws  IndexOutOfBoundsException if <tt>column<0 || width<0 || column+width>columns() || row<0 || height<0 || row+height>rows()</tt>
 */
 protected AbstractMatrix2D vPart(int row, int column, int height, int width) {
-	checkBox(row,column,height,width);
-	this.rowZero += this.rowStride * row;
-	this.columnZero += this.columnStride * column;
-	this.rows = height;
-	this.columns = width;
-	this.isNoView = false;
-	return this;
+  checkBox(row,column,height,width);
+  this.rowZero += this.rowStride * row;
+  this.columnZero += this.columnStride * column;
+  this.rows = height;
+  this.columns = width;
+  this.isNoView = false;
+  return this;
 }
 /**
 Self modifying version of viewRowFlip().
 */
 protected AbstractMatrix2D vRowFlip() {
-	if (rows>0) {
-		rowZero += (rows-1)*rowStride;
-		rowStride = -rowStride;
-		this.isNoView = false;
-	}
-	return this;
+  if (rows>0) {
+    rowZero += (rows-1)*rowStride;
+    rowStride = -rowStride;
+    this.isNoView = false;
+  }
+  return this;
 }
 /**
 Self modifying version of viewStrides().
-@throws	IndexOutOfBoundsException if <tt>rowStride<=0 || columnStride<=0</tt>.
+@throws  IndexOutOfBoundsException if <tt>rowStride<=0 || columnStride<=0</tt>.
 */
 protected AbstractMatrix2D vStrides(int rowStride, int columnStride) {
-	if (rowStride<=0 || columnStride<=0) throw new IndexOutOfBoundsException("illegal strides: "+rowStride+", "+columnStride);
-	this.rowStride *= rowStride;
-	this.columnStride *= columnStride;
-	if (this.rows!=0) this.rows = (this.rows-1)/rowStride +1;
-	if (this.columns!=0) this.columns = (this.columns-1)/columnStride +1;
-	this.isNoView = false;
-	return this;
+  if (rowStride<=0 || columnStride<=0) throw new IndexOutOfBoundsException("illegal strides: "+rowStride+", "+columnStride);
+  this.rowStride *= rowStride;
+  this.columnStride *= columnStride;
+  if (this.rows!=0) this.rows = (this.rows-1)/rowStride +1;
+  if (this.columns!=0) this.columns = (this.columns-1)/columnStride +1;
+  this.isNoView = false;
+  return this;
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/package.html
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/package.html	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/package.html	(working copy)
@@ -1,6 +1,6 @@
 <HTML>
 <BODY>
 Matrix <i>implementations</i>; You normally need not look at this package, because all concrete classes implement the
-abstract interfaces of {@link cern.colt.matrix}, <i>without subsetting or supersetting</i>.
+abstract interfaces of {@link org.apache.mahout.matrix.matrix}, <i>without subsetting or supersetting</i>.
 </BODY>
 </HTML>
\ No newline at end of file
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/AbstractMatrix3D.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/AbstractMatrix3D.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/AbstractMatrix3D.java	(working copy)
@@ -22,28 +22,28 @@
  */
 @Deprecated
 public abstract class AbstractMatrix3D extends AbstractMatrix {
- 	/** the number of slices this matrix (view) has */
-	protected int slices;
+   /** the number of slices this matrix (view) has */
+  protected int slices;
 
- 	/** the number of rows this matrix (view) has */
-	protected int rows;
-	
- 	/** the number of columns this matrix (view) has */
-	protected int columns;
+   /** the number of rows this matrix (view) has */
+  protected int rows;
+  
+   /** the number of columns this matrix (view) has */
+  protected int columns;
 
-	
-	/** the number of elements between two slices, i.e. <tt>index(k+1,i,j) - index(k,i,j)</tt>. */
-	protected int sliceStride;
-	
-	/** the number of elements between two rows, i.e. <tt>index(k,i+1,j) - index(k,i,j)</tt>. */
-	protected int rowStride;
+  
+  /** the number of elements between two slices, i.e. <tt>index(k+1,i,j) - index(k,i,j)</tt>. */
+  protected int sliceStride;
+  
+  /** the number of elements between two rows, i.e. <tt>index(k,i+1,j) - index(k,i,j)</tt>. */
+  protected int rowStride;
 
-	/** the number of elements between two columns, i.e. <tt>index(k,i,j+1) - index(k,i,j)</tt>. */
-	protected int columnStride;
+  /** the number of elements between two columns, i.e. <tt>index(k,i,j+1) - index(k,i,j)</tt>. */
+  protected int columnStride;
 
- 	/** the index of the first element */
-	protected int sliceZero, rowZero, columnZero;
-	// this.isNoView implies: offset==0, sliceStride==rows*slices, rowStride==columns, columnStride==1
+   /** the index of the first element */
+  protected int sliceZero, rowZero, columnZero;
+  // this.isNoView implies: offset==0, sliceStride==rows*slices, rowStride==columns, columnStride==1
 /**
  * Makes this class non instantiable, but still let's others inherit from it.
  */
@@ -56,7 +56,7 @@
  * @return the position.
  */
 protected int _columnOffset(int absRank) {
-	return absRank;
+  return absRank;
 }
 /**
  * Returns the absolute rank of the given relative rank. 
@@ -65,7 +65,7 @@
  * @return the absolute rank of the element.
  */
 protected int _columnRank(int rank) {
-	return columnZero + rank*columnStride;
+  return columnZero + rank*columnStride;
 }
 /**
  * Returns the position of the given absolute rank within the (virtual or non-virtual) internal 1-dimensional array. 
@@ -75,7 +75,7 @@
  * @return the position.
  */
 protected int _rowOffset(int absRank) {
-	return absRank;
+  return absRank;
 }
 /**
  * Returns the absolute rank of the given relative rank. 
@@ -84,7 +84,7 @@
  * @return the absolute rank of the element.
  */
 protected int _rowRank(int rank) {
-	return rowZero + rank*rowStride;
+  return rowZero + rank*rowStride;
 }
 /**
  * Returns the position of the given absolute rank within the (virtual or non-virtual) internal 1-dimensional array. 
@@ -94,7 +94,7 @@
  * @return the position.
  */
 protected int _sliceOffset(int absRank) {
-	return absRank;
+  return absRank;
 }
 /**
  * Returns the absolute rank of the given relative rank. 
@@ -103,85 +103,85 @@
  * @return the absolute rank of the element.
  */
 protected int _sliceRank(int rank) {
-	return sliceZero + rank*sliceStride;
+  return sliceZero + rank*sliceStride;
 }
 /**
  * Checks whether the receiver contains the given box and throws an exception, if necessary.
- * @throws	IndexOutOfBoundsException if <tt>row<0 || height<0 || row+height>rows || slice<0 || depth<0 || slice+depth>slices  || column<0 || width<0 || column+width>columns</tt>
+ * @throws  IndexOutOfBoundsException if <tt>row<0 || height<0 || row+height>rows || slice<0 || depth<0 || slice+depth>slices  || column<0 || width<0 || column+width>columns</tt>
  */
 protected void checkBox(int slice, int row, int column, int depth, int height, int width) {
-	if (slice<0 || depth<0 || slice+depth>slices  || row<0 || height<0 || row+height>rows || column<0 || width<0 || column+width>columns) throw new IndexOutOfBoundsException(toStringShort()+", slice:"+slice+", row:"+row+" ,column:"+column+", depth:"+depth+" ,height:"+height+", width:"+width);
+  if (slice<0 || depth<0 || slice+depth>slices  || row<0 || height<0 || row+height>rows || column<0 || width<0 || column+width>columns) throw new IndexOutOfBoundsException(toStringShort()+", slice:"+slice+", row:"+row+" ,column:"+column+", depth:"+depth+" ,height:"+height+", width:"+width);
 }
 /**
  * Sanity check for operations requiring a column index to be within bounds.
  * @throws IndexOutOfBoundsException if <tt>column < 0 || column >= columns()</tt>.
  */
 protected void checkColumn(int column) {
-	if (column < 0 || column >= columns) throw new IndexOutOfBoundsException("Attempted to access "+toStringShort()+" at column="+column);
+  if (column < 0 || column >= columns) throw new IndexOutOfBoundsException("Attempted to access "+toStringShort()+" at column="+column);
 }
 /**
  * Checks whether indexes are legal and throws an exception, if necessary.
  * @throws IndexOutOfBoundsException if <tt>! (0 <= indexes[i] < columns())</tt> for any i=0..indexes.length()-1.
  */
 protected void checkColumnIndexes(int[] indexes) {
-	for (int i=indexes.length; --i >= 0; ) {
-		int index = indexes[i];
-		if (index < 0 || index >= columns) checkColumn(index);
-	}
+  for (int i=indexes.length; --i >= 0; ) {
+    int index = indexes[i];
+    if (index < 0 || index >= columns) checkColumn(index);
+  }
 }
 /**
  * Sanity check for operations requiring a row index to be within bounds.
  * @throws IndexOutOfBoundsException if <tt>row < 0 || row >= rows()</tt>.
  */
 protected void checkRow(int row) {
-	if (row < 0 || row >= rows) throw new IndexOutOfBoundsException("Attempted to access "+toStringShort()+" at row="+row);
+  if (row < 0 || row >= rows) throw new IndexOutOfBoundsException("Attempted to access "+toStringShort()+" at row="+row);
 }
 /**
  * Checks whether indexes are legal and throws an exception, if necessary.
  * @throws IndexOutOfBoundsException if <tt>! (0 <= indexes[i] < rows())</tt> for any i=0..indexes.length()-1.
  */
 protected void checkRowIndexes(int[] indexes) {
-	for (int i=indexes.length; --i >= 0; ) {
-		int index = indexes[i];
-		if (index < 0 || index >= rows) checkRow(index);
-	}
+  for (int i=indexes.length; --i >= 0; ) {
+    int index = indexes[i];
+    if (index < 0 || index >= rows) checkRow(index);
+  }
 }
 /**
  * Sanity check for operations requiring two matrices with the same number of slices, rows and columns.
  * @throws IllegalArgumentException if <tt>slices() != B.slices() || rows() != B.rows() || columns() != B.columns()</tt>.
  */
 public void checkShape(AbstractMatrix3D B) {
-	if (slices != B.slices || rows != B.rows || columns != B.columns) throw new IllegalArgumentException("Incompatible dimensions: "+toStringShort()+" and "+B.toStringShort());
+  if (slices != B.slices || rows != B.rows || columns != B.columns) throw new IllegalArgumentException("Incompatible dimensions: "+toStringShort()+" and "+B.toStringShort());
 }
 /**
  * Sanity check for operations requiring matrices with the same number of slices, rows and columns.
  * @throws IllegalArgumentException if <tt>slices() != B.slices() || rows() != B.rows() || columns() != B.columns() || slices() != C.slices() || rows() != C.rows() || columns() != C.columns()</tt>.
  */
 public void checkShape(AbstractMatrix3D B, AbstractMatrix3D C) {
-	if (slices != B.slices || rows != B.rows || columns != B.columns || slices != C.slices || rows != C.rows || columns != C.columns) throw new IllegalArgumentException("Incompatible dimensions: "+toStringShort()+", "+B.toStringShort()+", "+C.toStringShort());
+  if (slices != B.slices || rows != B.rows || columns != B.columns || slices != C.slices || rows != C.rows || columns != C.columns) throw new IllegalArgumentException("Incompatible dimensions: "+toStringShort()+", "+B.toStringShort()+", "+C.toStringShort());
 }
 /**
  * Sanity check for operations requiring a slice index to be within bounds.
  * @throws IndexOutOfBoundsException if <tt>slice < 0 || slice >= slices()</tt>.
  */
 protected void checkSlice(int slice) {
-	if (slice < 0 || slice >= slices) throw new IndexOutOfBoundsException("Attempted to access "+toStringShort()+" at slice="+slice);
+  if (slice < 0 || slice >= slices) throw new IndexOutOfBoundsException("Attempted to access "+toStringShort()+" at slice="+slice);
 }
 /**
  * Checks whether indexes are legal and throws an exception, if necessary.
  * @throws IndexOutOfBoundsException if <tt>! (0 <= indexes[i] < slices())</tt> for any i=0..indexes.length()-1.
  */
 protected void checkSliceIndexes(int[] indexes) {
-	for (int i=indexes.length; --i >= 0; ) {
-		int index = indexes[i];
-		if (index < 0 || index >= slices) checkSlice(index);
-	}
+  for (int i=indexes.length; --i >= 0; ) {
+    int index = indexes[i];
+    if (index < 0 || index >= slices) checkSlice(index);
+  }
 }
 /**
  * Returns the number of columns.
  */
 public int columns() {
-	return columns;
+  return columns;
 }
 /**
  * Returns the position of the given coordinate within the (virtual or non-virtual) internal 1-dimensional array. 
@@ -191,24 +191,24 @@
  * @param     column   the index of the third-coordinate.
  */
 protected int index(int slice, int row, int column) {
-	return _sliceOffset(_sliceRank(slice)) + _rowOffset(_rowRank(row)) + _columnOffset(_columnRank(column));
+  return _sliceOffset(_sliceRank(slice)) + _rowOffset(_rowRank(row)) + _columnOffset(_columnRank(column));
 }
 /**
  * Returns the number of rows.
  */
 public int rows() {
-	return rows;
+  return rows;
 }
 /**
  * Sets up a matrix with a given number of slices and rows.
  * @param slices the number of slices the matrix shall have.
  * @param rows the number of rows the matrix shall have.
  * @param columns the number of columns the matrix shall have.
- * @throws	IllegalArgumentException if <tt>(double)rows*slices > Integer.MAX_VALUE</tt>.
- * @throws	IllegalArgumentException if <tt>slices<0 || rows<0 || columns<0</tt>.
+ * @throws  IllegalArgumentException if <tt>(double)rows*slices > Integer.MAX_VALUE</tt>.
+ * @throws  IllegalArgumentException if <tt>slices<0 || rows<0 || columns<0</tt>.
  */
 protected void setUp(int slices, int rows, int columns) {
-	setUp(slices,rows,columns,0,0,0,rows*columns,columns,1);
+  setUp(slices,rows,columns,0,0,0,rows*columns,columns,1);
 }
 /**
  * Sets up a matrix with a given number of slices and rows and the given strides.
@@ -221,150 +221,150 @@
  * @param sliceStride the number of elements between two slices, i.e. <tt>index(k+1,i,j)-index(k,i,j)</tt>.
  * @param rowStride the number of elements between two rows, i.e. <tt>index(k,i+1,j)-index(k,i,j)</tt>.
  * @param columnnStride the number of elements between two columns, i.e. <tt>index(k,i,j+1)-index(k,i,j)</tt>.
- * @throws	IllegalArgumentException if <tt>(double)slices*rows*columnss > Integer.MAX_VALUE</tt>.
- * @throws	IllegalArgumentException if <tt>slices<0 || rows<0 || columns<0</tt>.
+ * @throws  IllegalArgumentException if <tt>(double)slices*rows*columnss > Integer.MAX_VALUE</tt>.
+ * @throws  IllegalArgumentException if <tt>slices<0 || rows<0 || columns<0</tt>.
  */
 protected void setUp(int slices, int rows, int columns, int sliceZero, int rowZero, int columnZero, int sliceStride, int rowStride, int columnStride) {
-	if (slices<0 || rows<0 || columns<0) throw new IllegalArgumentException("negative size");
-	if ((double)slices*rows*columns > Integer.MAX_VALUE) throw new IllegalArgumentException("matrix too large");
-	
-	this.slices = slices;
-	this.rows = rows;
-	this.columns = columns;
-	
-	this.sliceZero = sliceZero;
-	this.rowZero = rowZero;
-	this.columnZero = columnZero;
+  if (slices<0 || rows<0 || columns<0) throw new IllegalArgumentException("negative size");
+  if ((double)slices*rows*columns > Integer.MAX_VALUE) throw new IllegalArgumentException("matrix too large");
+  
+  this.slices = slices;
+  this.rows = rows;
+  this.columns = columns;
+  
+  this.sliceZero = sliceZero;
+  this.rowZero = rowZero;
+  this.columnZero = columnZero;
 
-	this.sliceStride = sliceStride;
-	this.rowStride = rowStride;
-	this.columnStride = columnStride;
-	
-	this.isNoView = true;
+  this.sliceStride = sliceStride;
+  this.rowStride = rowStride;
+  this.columnStride = columnStride;
+  
+  this.isNoView = true;
 }
 protected int[] shape() { 
-	int[] shape = new int[3];
-	shape[0] = slices;
-	shape[1] = rows;
-	shape[2] = columns;
-	return shape;
+  int[] shape = new int[3];
+  shape[0] = slices;
+  shape[1] = rows;
+  shape[2] = columns;
+  return shape;
 }
 /**
  * Returns the number of cells which is <tt>slices()*rows()*columns()</tt>.
  */
 public int size() {
-	return slices*rows*columns;
+  return slices*rows*columns;
 }
 /**
  * Returns the number of slices.
  */
 public int slices() {
-	return slices;
+  return slices;
 }
 /**
  * Returns a string representation of the receiver's shape.
  */
 public String toStringShort() {
-	return AbstractFormatter.shape(this);
+  return AbstractFormatter.shape(this);
 }
 /**
 Self modifying version of viewColumnFlip().
 */
 protected AbstractMatrix3D vColumnFlip() {
-	if (columns>0) {
-		columnZero += (columns-1)*columnStride;
-		columnStride = -columnStride;
-		this.isNoView = false;
-	}
-	return this;
+  if (columns>0) {
+    columnZero += (columns-1)*columnStride;
+    columnStride = -columnStride;
+    this.isNoView = false;
+  }
+  return this;
 }
 /**
 Self modifying version of viewDice().
 @throws IllegalArgumentException if some of the parameters are equal or not in range 0..2.
 */
 protected AbstractMatrix3D vDice(int axis0, int axis1, int axis2) {
-	int d = 3;
-	if (axis0 < 0 || axis0 >= d || axis1 < 0 || axis1 >= d || axis2 < 0 || axis2 >= d ||
-		axis0 == axis1 || axis0 == axis2 || axis1 == axis2) {
-		throw new IllegalArgumentException("Illegal Axes: "+axis0+", "+axis1+", "+axis2);
-	}
+  int d = 3;
+  if (axis0 < 0 || axis0 >= d || axis1 < 0 || axis1 >= d || axis2 < 0 || axis2 >= d ||
+    axis0 == axis1 || axis0 == axis2 || axis1 == axis2) {
+    throw new IllegalArgumentException("Illegal Axes: "+axis0+", "+axis1+", "+axis2);
+  }
 
-	// swap shape
-	int[] shape = shape();
-	
-	this.slices = shape[axis0];
-	this.rows = shape[axis1];
-	this.columns = shape[axis2];
-	
-	// swap strides
-	int[] strides = new int[3];
-	strides[0] = this.sliceStride;
-	strides[1] = this.rowStride;
-	strides[2] = this.columnStride;
+  // swap shape
+  int[] shape = shape();
+  
+  this.slices = shape[axis0];
+  this.rows = shape[axis1];
+  this.columns = shape[axis2];
+  
+  // swap strides
+  int[] strides = new int[3];
+  strides[0] = this.sliceStride;
+  strides[1] = this.rowStride;
+  strides[2] = this.columnStride;
 
-	this.sliceStride = strides[axis0];
-	this.rowStride = strides[axis1];
-	this.columnStride = strides[axis2];
+  this.sliceStride = strides[axis0];
+  this.rowStride = strides[axis1];
+  this.columnStride = strides[axis2];
 
-	this.isNoView = false;
-	return this;
+  this.isNoView = false;
+  return this;
 }
 /**
 Self modifying version of viewPart().
 @throws IndexOutOfBoundsException if <tt>slice<0 || depth<0 || slice+depth>slices() || row<0 || height<0 || row+height>rows() || column<0 || width<0 || column+width>columns()</tt>
 */
 protected AbstractMatrix3D vPart(int slice, int row, int column, int depth, int height, int width) {
-	checkBox(slice,row,column,depth,height,width);
-	
-	this.sliceZero += this.sliceStride * slice;
-	this.rowZero += this.rowStride * row;
-	this.columnZero += this.columnStride * column;
-	
-	this.slices = depth;
-	this.rows = height;
-	this.columns = width;
-	
-	this.isNoView = false;
-	return this;
+  checkBox(slice,row,column,depth,height,width);
+  
+  this.sliceZero += this.sliceStride * slice;
+  this.rowZero += this.rowStride * row;
+  this.columnZero += this.columnStride * column;
+  
+  this.slices = depth;
+  this.rows = height;
+  this.columns = width;
+  
+  this.isNoView = false;
+  return this;
 }
 /**
 Self modifying version of viewRowFlip().
 */
 protected AbstractMatrix3D vRowFlip() {
-	if (rows>0) {
-		rowZero += (rows-1)*rowStride;
-		rowStride = -rowStride;
-		this.isNoView = false;
-	}
-	return this;
+  if (rows>0) {
+    rowZero += (rows-1)*rowStride;
+    rowStride = -rowStride;
+    this.isNoView = false;
+  }
+  return this;
 }
 /**
 Self modifying version of viewSliceFlip().
 */
 protected AbstractMatrix3D vSliceFlip() {
-	if (slices>0) {
-		sliceZero += (slices-1)*sliceStride;
-		sliceStride = -sliceStride;
-		this.isNoView = false;
-	}
-	return this;
+  if (slices>0) {
+    sliceZero += (slices-1)*sliceStride;
+    sliceStride = -sliceStride;
+    this.isNoView = false;
+  }
+  return this;
 }
 /**
 Self modifying version of viewStrides().
-@throws	IndexOutOfBoundsException if <tt>sliceStride<=0 || rowStride<=0 || columnStride<=0</tt>.
+@throws  IndexOutOfBoundsException if <tt>sliceStride<=0 || rowStride<=0 || columnStride<=0</tt>.
 */
 protected AbstractMatrix3D vStrides(int sliceStride, int rowStride, int columnStride) {
-	if (sliceStride<=0 || rowStride<=0 || columnStride<=0) throw new IndexOutOfBoundsException("illegal strides: "+sliceStride+", "+rowStride+", "+columnStride);
-	
-	this.sliceStride *= sliceStride;
-	this.rowStride *= rowStride;
-	this.columnStride *= columnStride;
-	
-	if (this.slices!=0) this.slices = (this.slices-1)/sliceStride +1;
-	if (this.rows!=0) this.rows = (this.rows-1)/rowStride +1;
-	if (this.columns!=0) this.columns = (this.columns-1)/columnStride +1;
-	
-	this.isNoView = false;
-	return this;
+  if (sliceStride<=0 || rowStride<=0 || columnStride<=0) throw new IndexOutOfBoundsException("illegal strides: "+sliceStride+", "+rowStride+", "+columnStride);
+  
+  this.sliceStride *= sliceStride;
+  this.rowStride *= rowStride;
+  this.columnStride *= columnStride;
+  
+  if (this.slices!=0) this.slices = (this.slices-1)/sliceStride +1;
+  if (this.rows!=0) this.rows = (this.rows-1)/rowStride +1;
+  if (this.columns!=0) this.columns = (this.columns-1)/columnStride +1;
+  
+  this.isNoView = false;
+  return this;
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/QRTest.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/QRTest.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/QRTest.java	(working copy)
@@ -9,12 +9,12 @@
 
 class QRTest {
 
-	/**
-	 * Constructor for QRTest.
-	 */
-	public QRTest() {
-		super();
-	}
+  /**
+   * Constructor for QRTest.
+   */
+  public QRTest() {
+    super();
+  }
 
     public static void main(String args[]) {
 
@@ -96,7 +96,7 @@
        amatrix.print(8,5);
        bmatrix.print(8,5);
        cmatrix.print(8,5);
-		*/
+    */
     }
 
 
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/RCMDoubleMatrix2D.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/RCMDoubleMatrix2D.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/RCMDoubleMatrix2D.java	(working copy)
@@ -18,11 +18,11 @@
 @version 0.9, 04/14/2000
 */
 class RCMDoubleMatrix2D extends WrapperDoubleMatrix2D {
-	/*
-	 * The elements of the matrix.
-	 */
-	private IntArrayList[] indexes;
-	private DoubleArrayList[] values;
+  /*
+   * The elements of the matrix.
+   */
+  private IntArrayList[] indexes;
+  private DoubleArrayList[] values;
 /**
  * Constructs a matrix with a copy of the given values.
  * <tt>values</tt> is required to have the form <tt>values[row][column]</tt>
@@ -34,21 +34,21 @@
  * @throws IllegalArgumentException if <tt>for any 1 &lt;= row &lt; values.length: values[row].length != values[row-1].length</tt>.
  */
 public RCMDoubleMatrix2D(double[][] values) {
-	this(values.length, values.length==0 ? 0: values[0].length);
-	assign(values);
+  this(values.length, values.length==0 ? 0: values[0].length);
+  assign(values);
 }
 /**
  * Constructs a matrix with a given number of rows and columns.
  * All entries are initially <tt>0</tt>.
  * @param rows the number of rows the matrix shall have.
  * @param columns the number of columns the matrix shall have.
- * @throws	IllegalArgumentException if <tt>rows<0 || columns<0 || (double)columns*rows > Integer.MAX_VALUE</tt>.
+ * @throws  IllegalArgumentException if <tt>rows<0 || columns<0 || (double)columns*rows > Integer.MAX_VALUE</tt>.
  */
 public RCMDoubleMatrix2D(int rows, int columns) {
-	super(null);
-	setUp(rows, columns);
-	indexes = new IntArrayList[rows];
-	values = new DoubleArrayList[rows];
+  super(null);
+  setUp(rows, columns);
+  indexes = new IntArrayList[rows];
+  values = new DoubleArrayList[rows];
 }
 /**
  * Sets all cells to the state specified by <tt>value</tt>.
@@ -56,22 +56,22 @@
  * @return <tt>this</tt> (for convenience only).
  */
 public DoubleMatrix2D assign(double value) {
-	// overriden for performance only
-	if (value==0) {
-		for (int row=rows; --row>=0; ) {
-			indexes[row]=null;
-			values[row]=null;
-		}
-	}
-	else super.assign(value);
-	return this;
+  // overriden for performance only
+  if (value==0) {
+    for (int row=rows; --row>=0; ) {
+      indexes[row]=null;
+      values[row]=null;
+    }
+  }
+  else super.assign(value);
+  return this;
 }
 /**
  * Returns the content of this matrix if it is a wrapper; or <tt>this</tt> otherwise.
  * Override this method in wrappers.
  */
 protected DoubleMatrix2D getContent() {
-	return this;
+  return this;
 }
 /**
  * Returns the matrix cell value at coordinate <tt>[row,column]</tt>.
@@ -85,10 +85,10 @@
  * @return    the value at the specified coordinate.
  */
 public double getQuick(int row, int column) {
-	int k=-1;
-	if (indexes[row] != null) k = indexes[row].binarySearch(column);
-	if (k<0) return 0;
-	return values[row].getQuick(k);
+  int k=-1;
+  if (indexes[row] != null) k = indexes[row].binarySearch(column);
+  if (k<0) return 0;
+  return values[row].getQuick(k);
 }
 /**
  * Construct and returns a new empty matrix <i>of the same dynamic type</i> as the receiver, having the specified number of rows and columns.
@@ -101,7 +101,7 @@
  * @return  a new empty matrix of the same dynamic type.
  */
 public DoubleMatrix2D like(int rows, int columns) {
-	return new RCMDoubleMatrix2D(rows,columns);
+  return new RCMDoubleMatrix2D(rows,columns);
 }
 /**
  * Construct and returns a new 1-d matrix <i>of the corresponding dynamic type</i>, entirelly independent of the receiver.
@@ -112,7 +112,7 @@
  * @return  a new matrix of the corresponding dynamic type.
  */
 public DoubleMatrix1D like1D(int size) {
-	return new SparseDoubleMatrix1D(size);
+  return new SparseDoubleMatrix1D(size);
 }
 /**
  * Sets the matrix cell at coordinate <tt>[row,column]</tt> to the specified value.
@@ -126,45 +126,45 @@
  * @param    value the value to be filled into the specified cell.
  */
 public void setQuick(int row, int column, double value) {
-	int i=row;
-	int j=column;
-	
-	int k=-1;
-	IntArrayList indexList = indexes[i];
-	if (indexList != null) k = indexList.binarySearch(j);
-	
-	if (k>=0) { // found
-		if (value==0) {
-			DoubleArrayList valueList = values[i];
-			indexList.remove(k);
-			valueList.remove(k);
-			int s = indexList.size();
-			if (s>2 && s*3 < indexList.elements().length) {
-				indexList.setSize(s*3/2);
-				indexList.trimToSize();
-				indexList.setSize(s);
-				
-				valueList.setSize(s*3/2);
-				valueList.trimToSize();
-				valueList.setSize(s);		
-			}
-		}
-		else {
-			values[i].setQuick(k,value);
-		}
-	}
-	else { // not found
-		if (value==0) return;
+  int i=row;
+  int j=column;
+  
+  int k=-1;
+  IntArrayList indexList = indexes[i];
+  if (indexList != null) k = indexList.binarySearch(j);
+  
+  if (k>=0) { // found
+    if (value==0) {
+      DoubleArrayList valueList = values[i];
+      indexList.remove(k);
+      valueList.remove(k);
+      int s = indexList.size();
+      if (s>2 && s*3 < indexList.elements().length) {
+        indexList.setSize(s*3/2);
+        indexList.trimToSize();
+        indexList.setSize(s);
+        
+        valueList.setSize(s*3/2);
+        valueList.trimToSize();
+        valueList.setSize(s);    
+      }
+    }
+    else {
+      values[i].setQuick(k,value);
+    }
+  }
+  else { // not found
+    if (value==0) return;
 
-		k = -k-1;
+    k = -k-1;
 
-		if (indexList == null) {
-			indexes[i] = new IntArrayList(3);
-			values[i]  = new DoubleArrayList(3);
-		}
-		indexes[i].beforeInsert(k,j);
-		values[i].beforeInsert(k,value);
-	}
+    if (indexList == null) {
+      indexes[i] = new IntArrayList(3);
+      values[i]  = new DoubleArrayList(3);
+    }
+    indexes[i].beforeInsert(k,j);
+    values[i].beforeInsert(k,value);
+  }
 }
 /**
  * Linear algebraic matrix-vector multiplication; <tt>z = A * y</tt>.
@@ -176,20 +176,20 @@
  * @throws IllegalArgumentException if <tt>A.columns() != y.size() || A.rows() > z.size())</tt>.
  */
 protected void zMult(final DoubleMatrix1D y, final DoubleMatrix1D z, org.apache.mahout.matrix.list.IntArrayList nonZeroIndexes, DoubleMatrix1D[] allRows, final double alpha, final double beta) {
-	if (columns != y.size() || rows > z.size())	
-		throw new IllegalArgumentException("Incompatible args: "+toStringShort()+", "+y.toStringShort()+", "+z.toStringShort());
+  if (columns != y.size() || rows > z.size())  
+    throw new IllegalArgumentException("Incompatible args: "+toStringShort()+", "+y.toStringShort()+", "+z.toStringShort());
 
-	z.assign(org.apache.mahout.jet.math.Functions.mult(beta/alpha));
-	for (int i = indexes.length; --i >= 0; ) {
-		if (indexes[i] != null) {
-			for (int k = indexes[i].size(); --k >= 0; ) {
-				int j = indexes[i].getQuick(k);
-				double value = values[i].getQuick(k);
-				z.setQuick(i,z.getQuick(i) + value * y.getQuick(j));
-			}
-		}
-	}
-		
-	z.assign(org.apache.mahout.jet.math.Functions.mult(alpha));
+  z.assign(org.apache.mahout.jet.math.Functions.mult(beta/alpha));
+  for (int i = indexes.length; --i >= 0; ) {
+    if (indexes[i] != null) {
+      for (int k = indexes[i].size(); --k >= 0; ) {
+        int j = indexes[i].getQuick(k);
+        double value = values[i].getQuick(k);
+        z.setQuick(i,z.getQuick(i) + value * y.getQuick(j));
+      }
+    }
+  }
+    
+  z.assign(org.apache.mahout.jet.math.Functions.mult(alpha));
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/AbstractFormatter.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/AbstractFormatter.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/AbstractFormatter.java	(working copy)
@@ -27,90 +27,90 @@
  */
 @Deprecated
 public abstract class AbstractFormatter extends org.apache.mahout.matrix.PersistentObject {
- 	/**
- 	 * The alignment string aligning the cells of a column to the left.
- 	 */
- 	public static final String LEFT = "left";
-	
- 	/**
- 	 * The alignment string aligning the cells of a column to its center.
- 	 */
- 	public static final String CENTER = "center";
-	
- 	/**
- 	 * The alignment string aligning the cells of a column to the right.
- 	 */
- 	public static final String RIGHT = "right";
-	
- 	/**
- 	 * The alignment string aligning the cells of a column to the decimal point.
- 	 */
- 	public static final String DECIMAL = "decimal";
+   /**
+    * The alignment string aligning the cells of a column to the left.
+    */
+   public static final String LEFT = "left";
+  
+   /**
+    * The alignment string aligning the cells of a column to its center.
+    */
+   public static final String CENTER = "center";
+  
+   /**
+    * The alignment string aligning the cells of a column to the right.
+    */
+   public static final String RIGHT = "right";
+  
+   /**
+    * The alignment string aligning the cells of a column to the decimal point.
+    */
+   public static final String DECIMAL = "decimal";
 
- 	/**
- 	 * The default minimum number of characters a column may have; currently <tt>1</tt>.
- 	 */
-	public static final int DEFAULT_MIN_COLUMN_WIDTH = 1;
-	
- 	/**
- 	 * The default string separating any two columns from another; currently <tt>" "</tt>.
- 	 */
-	public static final String DEFAULT_COLUMN_SEPARATOR = " ";
+   /**
+    * The default minimum number of characters a column may have; currently <tt>1</tt>.
+    */
+  public static final int DEFAULT_MIN_COLUMN_WIDTH = 1;
+  
+   /**
+    * The default string separating any two columns from another; currently <tt>" "</tt>.
+    */
+  public static final String DEFAULT_COLUMN_SEPARATOR = " ";
 
- 	/**
- 	 * The default string separating any two rows from another; currently <tt>"\n"</tt>.
- 	 */
-	public static final String DEFAULT_ROW_SEPARATOR = "\n";
+   /**
+    * The default string separating any two rows from another; currently <tt>"\n"</tt>.
+    */
+  public static final String DEFAULT_ROW_SEPARATOR = "\n";
 
-	/**
- 	 * The default string separating any two slices from another; currently <tt>"\n\n"</tt>.
- 	 */
-	public static final String DEFAULT_SLICE_SEPARATOR = "\n\n";
+  /**
+    * The default string separating any two slices from another; currently <tt>"\n\n"</tt>.
+    */
+  public static final String DEFAULT_SLICE_SEPARATOR = "\n\n";
 
-	
- 	/**
- 	 * The default format string for formatting a single cell value; currently <tt>"%G"</tt>.
- 	 */
- 	protected String alignment = LEFT;
-	
- 	/**
- 	 * The default format string for formatting a single cell value; currently <tt>"%G"</tt>.
- 	 */
- 	protected String format = "%G";
-	
- 	/**
- 	 * The default minimum number of characters a column may have; currently <tt>1</tt>.
- 	 */
-	protected int minColumnWidth = DEFAULT_MIN_COLUMN_WIDTH;
-	
- 	/**
- 	 * The default string separating any two columns from another; currently <tt>" "</tt>.
- 	 */
-	protected String columnSeparator= DEFAULT_COLUMN_SEPARATOR;
+  
+   /**
+    * The default format string for formatting a single cell value; currently <tt>"%G"</tt>.
+    */
+   protected String alignment = LEFT;
+  
+   /**
+    * The default format string for formatting a single cell value; currently <tt>"%G"</tt>.
+    */
+   protected String format = "%G";
+  
+   /**
+    * The default minimum number of characters a column may have; currently <tt>1</tt>.
+    */
+  protected int minColumnWidth = DEFAULT_MIN_COLUMN_WIDTH;
+  
+   /**
+    * The default string separating any two columns from another; currently <tt>" "</tt>.
+    */
+  protected String columnSeparator= DEFAULT_COLUMN_SEPARATOR;
 
- 	/**
- 	 * The default string separating any two rows from another; currently <tt>"\n"</tt>.
- 	 */
-	protected String rowSeparator = DEFAULT_ROW_SEPARATOR;
+   /**
+    * The default string separating any two rows from another; currently <tt>"\n"</tt>.
+    */
+  protected String rowSeparator = DEFAULT_ROW_SEPARATOR;
 
-	/**
- 	 * The default string separating any two slices from another; currently <tt>"\n\n"</tt>.
- 	 */
-	protected String sliceSeparator = DEFAULT_SLICE_SEPARATOR;
+  /**
+    * The default string separating any two slices from another; currently <tt>"\n\n"</tt>.
+    */
+  protected String sliceSeparator = DEFAULT_SLICE_SEPARATOR;
 
-	/**
- 	 * Tells whether String representations are to be preceded with summary of the shape; currently <tt>true</tt>.
- 	 */
-	protected boolean printShape = true;
-	
+  /**
+    * Tells whether String representations are to be preceded with summary of the shape; currently <tt>true</tt>.
+    */
+  protected boolean printShape = true;
+  
 
-	private static String[] blanksCache; // for efficient String manipulations
+  private static String[] blanksCache; // for efficient String manipulations
 
-	protected static final FormerFactory factory = new FormerFactory();
+  protected static final FormerFactory factory = new FormerFactory();
 
-	static {
-		setupBlanksCache();
-	}
+  static {
+    setupBlanksCache();
+  }
 /**
  * Makes this class non instantiable, but still let's others inherit from it.
  */
@@ -119,101 +119,101 @@
  * Modifies the strings in a column of the string matrix to be aligned (left,centered,right,decimal).
  */
 protected void align(String[][] strings) {
-	int rows = strings.length;
-	int columns = 0;
-	if (rows>0) columns = strings[0].length;
+  int rows = strings.length;
+  int columns = 0;
+  if (rows>0) columns = strings[0].length;
 
-	int[] maxColWidth = new int[columns];
-	int[] maxColLead = null;
-	boolean isDecimal = alignment.equals(DECIMAL);
-	if (isDecimal) maxColLead = new int[columns];
-	//int[] maxColTrail = new int[columns];
+  int[] maxColWidth = new int[columns];
+  int[] maxColLead = null;
+  boolean isDecimal = alignment.equals(DECIMAL);
+  if (isDecimal) maxColLead = new int[columns];
+  //int[] maxColTrail = new int[columns];
 
-	// for each column, determine alignment parameters
-	for (int column=0; column<columns; column++) {
-		int maxWidth = minColumnWidth;
-		int maxLead  = Integer.MIN_VALUE;
-		//int maxTrail = Integer.MIN_VALUE;
-		for (int row=0; row<rows; row++) {
-			String s = strings[row][column];
-			maxWidth = Math.max(maxWidth, s.length());
-			if (isDecimal) maxLead = Math.max(maxLead, lead(s));
-			//maxTrail = Math.max(maxTrail, trail(s));
-		}
-		maxColWidth[column] = maxWidth;
-		if (isDecimal) maxColLead[column] = maxLead;
-		//maxColTrail[column] = maxTrail;
-	}
+  // for each column, determine alignment parameters
+  for (int column=0; column<columns; column++) {
+    int maxWidth = minColumnWidth;
+    int maxLead  = Integer.MIN_VALUE;
+    //int maxTrail = Integer.MIN_VALUE;
+    for (int row=0; row<rows; row++) {
+      String s = strings[row][column];
+      maxWidth = Math.max(maxWidth, s.length());
+      if (isDecimal) maxLead = Math.max(maxLead, lead(s));
+      //maxTrail = Math.max(maxTrail, trail(s));
+    }
+    maxColWidth[column] = maxWidth;
+    if (isDecimal) maxColLead[column] = maxLead;
+    //maxColTrail[column] = maxTrail;
+  }
 
-	// format each row according to alignment parameters
-	//StringBuffer total = new StringBuffer();
-	for (int row=0; row<rows; row++) {
-		alignRow(strings[row], maxColWidth, maxColLead);
-	}
+  // format each row according to alignment parameters
+  //StringBuffer total = new StringBuffer();
+  for (int row=0; row<rows; row++) {
+    alignRow(strings[row], maxColWidth, maxColLead);
+  }
 
 }
 /**
  * Converts a row into a string.
  */
 protected int alignmentCode(String alignment) {
-	//{-1,0,1,2} = {left,centered,right,decimal point}
-	if (alignment.equals(LEFT)) return -1;
-	else if (alignment.equals(CENTER)) return 0;
-	else if (alignment.equals(RIGHT)) return 1;
-	else if (alignment.equals(DECIMAL)) return 2;
-	else throw new IllegalArgumentException("unknown alignment: "+alignment);
+  //{-1,0,1,2} = {left,centered,right,decimal point}
+  if (alignment.equals(LEFT)) return -1;
+  else if (alignment.equals(CENTER)) return 0;
+  else if (alignment.equals(RIGHT)) return 1;
+  else if (alignment.equals(DECIMAL)) return 2;
+  else throw new IllegalArgumentException("unknown alignment: "+alignment);
 }
 /**
  * Modifies the strings the string matrix to be aligned (left,centered,right,decimal).
  */
 protected void alignRow(String[] row, int[] maxColWidth, int[] maxColLead) {
-	int align = alignmentCode(alignment); //{-1,0,1,2} = {left,centered,right,decimal point}
-	StringBuffer s = new StringBuffer();
+  int align = alignmentCode(alignment); //{-1,0,1,2} = {left,centered,right,decimal point}
+  StringBuffer s = new StringBuffer();
 
-	int columns = row.length;
-	for (int column=0; column<columns; column++) {
-		s.setLength(0);
-		String c = row[column];
-		//if (alignment==1) {
-		if (alignment.equals(RIGHT)) {
-			s.append(blanks(maxColWidth[column] - s.length()));
-			s.append(c);
-		}
-		//else if (alignment==2) {
-		else if (alignment.equals(DECIMAL)) {
-			s.append(blanks(maxColLead[column] - lead(c)));
-			s.append(c);
-			s.append(blanks(maxColWidth[column] - s.length()));
-		}
-		//else if (align==0) {
-		else if (alignment.equals(CENTER)) {
-			s.append(blanks((maxColWidth[column] - c.length()) / 2));
-			s.append(c);
-			s.append(blanks(maxColWidth[column] - s.length()));
+  int columns = row.length;
+  for (int column=0; column<columns; column++) {
+    s.setLength(0);
+    String c = row[column];
+    //if (alignment==1) {
+    if (alignment.equals(RIGHT)) {
+      s.append(blanks(maxColWidth[column] - s.length()));
+      s.append(c);
+    }
+    //else if (alignment==2) {
+    else if (alignment.equals(DECIMAL)) {
+      s.append(blanks(maxColLead[column] - lead(c)));
+      s.append(c);
+      s.append(blanks(maxColWidth[column] - s.length()));
+    }
+    //else if (align==0) {
+    else if (alignment.equals(CENTER)) {
+      s.append(blanks((maxColWidth[column] - c.length()) / 2));
+      s.append(c);
+      s.append(blanks(maxColWidth[column] - s.length()));
 
-		}
-		//else if (align<0) {
-		else if (alignment.equals(LEFT)) {
-			s.append(c);
-			s.append(blanks(maxColWidth[column] - s.length()));
-		}
-		else throw new InternalError();
-		
-		row[column] = s.toString();
-	}
+    }
+    //else if (align<0) {
+    else if (alignment.equals(LEFT)) {
+      s.append(c);
+      s.append(blanks(maxColWidth[column] - s.length()));
+    }
+    else throw new InternalError();
+    
+    row[column] = s.toString();
+  }
 }
 /**
  * Returns a String with <tt>length</tt> blanks.
  */
 protected String blanks(int length) {
-	if (length < 0) length = 0;
-	if (length < blanksCache.length) return blanksCache[length];
-	
-	StringBuffer buf = new StringBuffer(length);
-	for (int k = 0; k < length; k++) {
-		buf.append(' ');
-	}
-	return buf.toString();
+  if (length < 0) length = 0;
+  if (length < blanksCache.length) return blanksCache[length];
+  
+  StringBuffer buf = new StringBuffer(length);
+  for (int k = 0; k < length; k++) {
+    buf.append(' ');
+  }
+  return buf.toString();
 }
 /**
  * Demonstrates how to use this class.
@@ -222,11 +222,11 @@
 /*
 // parameters
 Object[][] values = {
-	{3,     0,        -3.4, 0},
-	{5.1   ,0,        +3.0123456789, 0},
-	{16.37, 0.0,       2.5, 0},
-	{-16.3, 0,        -3.012345678E-4, -1},
-	{1236.3456789, 0,  7, -1.2}
+  {3,     0,        -3.4, 0},
+  {5.1   ,0,        +3.0123456789, 0},
+  {16.37, 0.0,       2.5, 0},
+  {-16.3, 0,        -3.012345678E-4, -1},
+  {1236.3456789, 0,  7, -1.2}
 };
 String[] formats =         {"%G", "%1.10G", "%f", "%1.2f", "%0.2e", null};
 
@@ -240,26 +240,26 @@
 String[] htmlSourceCodes = new String[size];
 
 for (int i=0; i<size; i++) {
-	String format = formats[i];
-	strings[i] = toString(matrix,format);
-	sourceCodes[i] = toSourceCode(matrix,format);
+  String format = formats[i];
+  strings[i] = toString(matrix,format);
+  sourceCodes[i] = toSourceCode(matrix,format);
 
-	// may not compile because of packages not included in the distribution
-	//htmlStrings[i] = org.apache.mahout.matrix.matrixpattern.Converting.toHTML(strings[i]);
-	//htmlSourceCodes[i] = org.apache.mahout.matrix.matrixpattern.Converting.toHTML(sourceCodes[i]);
+  // may not compile because of packages not included in the distribution
+  //htmlStrings[i] = org.apache.mahout.matrix.matrixpattern.Converting.toHTML(strings[i]);
+  //htmlSourceCodes[i] = org.apache.mahout.matrix.matrixpattern.Converting.toHTML(sourceCodes[i]);
 }
 
 System.out.println("original:\n"+toString(matrix));
 
 // may not compile because of packages not included in the distribution
 for (int i=0; i<size; i++) {
-	//System.out.println("\nhtmlString("+formats[i]+"):\n"+htmlStrings[i]);
-	//System.out.println("\nhtmlSourceCode("+formats[i]+"):\n"+htmlSourceCodes[i]);
+  //System.out.println("\nhtmlString("+formats[i]+"):\n"+htmlStrings[i]);
+  //System.out.println("\nhtmlSourceCode("+formats[i]+"):\n"+htmlSourceCodes[i]);
 }
 
 for (int i=0; i<size; i++) {
-	System.out.println("\nstring("+formats[i]+"):\n"+strings[i]);
-	System.out.println("\nsourceCode("+formats[i]+"):\n"+sourceCodes[i]);
+  System.out.println("\nstring("+formats[i]+"):\n"+strings[i]);
+  System.out.println("\nsourceCode("+formats[i]+"):\n"+sourceCodes[i]);
 }
 */
 }
@@ -270,9 +270,9 @@
 /*
 // parameters
 Object[] values = {
-	//5, 0.0, -0.0, -Object.NaN, Object.NaN, 0.0/0.0, Object.NEGATIVE_INFINITY, Object.POSITIVE_INFINITY, Object.MIN_VALUE, Object.MAX_VALUE
-	5, 0.0, -0.0, -Object.NaN, Object.NaN, 0.0/0.0, Object.MIN_VALUE, Object.MAX_VALUE , Object.NEGATIVE_INFINITY, Object.POSITIVE_INFINITY
-	//Object.MIN_VALUE, Object.MAX_VALUE //, Object.NEGATIVE_INFINITY, Object.POSITIVE_INFINITY
+  //5, 0.0, -0.0, -Object.NaN, Object.NaN, 0.0/0.0, Object.NEGATIVE_INFINITY, Object.POSITIVE_INFINITY, Object.MIN_VALUE, Object.MAX_VALUE
+  5, 0.0, -0.0, -Object.NaN, Object.NaN, 0.0/0.0, Object.MIN_VALUE, Object.MAX_VALUE , Object.NEGATIVE_INFINITY, Object.POSITIVE_INFINITY
+  //Object.MIN_VALUE, Object.MAX_VALUE //, Object.NEGATIVE_INFINITY, Object.POSITIVE_INFINITY
 };
 //String[] formats =         {"%G", "%1.10G", "%f", "%1.2f", "%0.2e"};
 String[] formats =         {"%G", "%1.19G"};
@@ -286,17 +286,17 @@
 //String[] javaStrings = new String[size];
 
 for (int i=0; i<size; i++) {
-	String format = formats[i];
-	strings[i] = toString(matrix,format);
-	for (int j=0; j<matrix.size(); j++) {
-		System.out.println(String.valueOf(matrix.get(j)));
-	}
+  String format = formats[i];
+  strings[i] = toString(matrix,format);
+  for (int j=0; j<matrix.size(); j++) {
+    System.out.println(String.valueOf(matrix.get(j)));
+  }
 }
 
 System.out.println("original:\n"+toString(matrix));
 
 for (int i=0; i<size; i++) {
-	System.out.println("\nstring("+formats[i]+"):\n"+strings[i]);
+  System.out.println("\nstring("+formats[i]+"):\n"+strings[i]);
 }
 */
 }
@@ -317,152 +317,152 @@
  * Returns a string representations of all cells; no alignment considered.
  */
 protected String[] formatRow(AbstractMatrix1D vector) {
-	Former formatter = null;
-	formatter = factory.create(format);
-	int s = vector.size();
-	String[] strings = new String[s];
-	for (int i=0; i<s; i++) {
-		strings[i] = form(vector,i,formatter);
-	}
-	return strings;
+  Former formatter = null;
+  formatter = factory.create(format);
+  int s = vector.size();
+  String[] strings = new String[s];
+  for (int i=0; i<s; i++) {
+    strings[i] = form(vector,i,formatter);
+  }
+  return strings;
 }
 /**
  * Returns the number of characters or the number of characters before the decimal point.
  */
 protected int lead(String s) {
-	return s.length();
+  return s.length();
 }
 /**
  * Returns a String with the given character repeated <tt>length</tt> times.
  */
 protected String repeat(char character, int length) {
-	if (character==' ') return blanks(length);
-	if (length < 0) length = 0;
-	StringBuffer buf = new StringBuffer(length);
-	for (int k = 0; k < length; k++) {
-		buf.append(character);
-	}
-	return buf.toString();
+  if (character==' ') return blanks(length);
+  if (length < 0) length = 0;
+  StringBuffer buf = new StringBuffer(length);
+  for (int k = 0; k < length; k++) {
+    buf.append(character);
+  }
+  return buf.toString();
 }
 /**
  * Sets the column alignment (left,center,right,decimal).
  * @param alignment the new alignment to be used; must be one of <tt>{LEFT,CENTER,RIGHT,DECIMAL}</tt>.
  */
 public void setAlignment(String alignment) {
-	this.alignment = alignment;
+  this.alignment = alignment;
 }
 /**
  * Sets the string separating any two columns from another.
  * @param columnSeparator the new columnSeparator to be used.
  */
 public void setColumnSeparator(String columnSeparator) {
-	this.columnSeparator = columnSeparator;
+  this.columnSeparator = columnSeparator;
 }
 /**
  * Sets the way a <i>single</i> cell value is to be formatted.
  * @param format the new format to be used.
  */
 public void setFormat(String format) {
-	this.format = format;
+  this.format = format;
 }
 /**
  * Sets the minimum number of characters a column may have.
  * @param minColumnWidth the new minColumnWidth to be used.
  */
 public void setMinColumnWidth(int minColumnWidth) {
-	if (minColumnWidth<0) throw new IllegalArgumentException();
-	this.minColumnWidth = minColumnWidth;
+  if (minColumnWidth<0) throw new IllegalArgumentException();
+  this.minColumnWidth = minColumnWidth;
 }
 /**
  * Specifies whether a string representation of a matrix is to be preceded with a summary of its shape.
  * @param printShape <tt>true</tt> shape summary is printed, otherwise not printed.
  */
 public void setPrintShape(boolean printShape) {
-	this.printShape = printShape;
+  this.printShape = printShape;
 }
 /**
  * Sets the string separating any two rows from another.
  * @param rowSeparator the new rowSeparator to be used.
  */
 public void setRowSeparator(String rowSeparator) {
-	this.rowSeparator = rowSeparator;
+  this.rowSeparator = rowSeparator;
 }
 /**
  * Sets the string separating any two slices from another.
  * @param sliceSeparator the new sliceSeparator to be used.
  */
 public void setSliceSeparator(String sliceSeparator) {
-	this.sliceSeparator = sliceSeparator;
+  this.sliceSeparator = sliceSeparator;
 }
 /**
  * Cache for faster string processing.
  */
 protected static void setupBlanksCache() {
-	// Pre-fabricate 40 static strings with 0,1,2,..,39 blanks, for usage within method blanks(length).
-	// Now, we don't need to construct and fill them on demand, and garbage collect them again.
-	// All 40 strings share the identical char[] array, only with different offset and length --> somewhat smaller static memory footprint
-	int size = 40;
-	blanksCache = new String[size];
-	StringBuffer buf = new StringBuffer(size);
-	for (int i=size; --i >= 0; ) buf.append(' ');
-	String str = buf.toString();
-	for (int i=size; --i >= 0; ) {
-		blanksCache[i] = str.substring(0,i);
-		//System.out.println(i+"-"+blanksCache[i]+"-");
-	}
+  // Pre-fabricate 40 static strings with 0,1,2,..,39 blanks, for usage within method blanks(length).
+  // Now, we don't need to construct and fill them on demand, and garbage collect them again.
+  // All 40 strings share the identical char[] array, only with different offset and length --> somewhat smaller static memory footprint
+  int size = 40;
+  blanksCache = new String[size];
+  StringBuffer buf = new StringBuffer(size);
+  for (int i=size; --i >= 0; ) buf.append(' ');
+  String str = buf.toString();
+  for (int i=size; --i >= 0; ) {
+    blanksCache[i] = str.substring(0,i);
+    //System.out.println(i+"-"+blanksCache[i]+"-");
+  }
 }
 /**
  * Returns a short string representation describing the shape of the matrix.
  */
 public static String shape(AbstractMatrix1D matrix) {
-	//return "Matrix1D of size="+matrix.size();
-	//return matrix.size()+" element matrix";
-	//return "matrix("+matrix.size()+")";
-	return matrix.size()+" matrix";
+  //return "Matrix1D of size="+matrix.size();
+  //return matrix.size()+" element matrix";
+  //return "matrix("+matrix.size()+")";
+  return matrix.size()+" matrix";
 }
 /**
  * Returns a short string representation describing the shape of the matrix.
  */
 public static String shape(AbstractMatrix2D matrix) {
-	return matrix.rows()+" x "+matrix.columns()+" matrix";
+  return matrix.rows()+" x "+matrix.columns()+" matrix";
 }
 /**
  * Returns a short string representation describing the shape of the matrix.
  */
 public static String shape(AbstractMatrix3D matrix) {
-	return matrix.slices()+" x "+matrix.rows()+" x "+matrix.columns()+" matrix";
+  return matrix.slices()+" x "+matrix.rows()+" x "+matrix.columns()+" matrix";
 }
 /**
  * Returns a single string representation of the given string matrix.
  * @param strings the matrix to be converted to a single string.
  */
 protected String toString(String[][] strings) {
-	int rows = strings.length;
-	int columns = strings.length<=0 ? 0: strings[0].length;
+  int rows = strings.length;
+  int columns = strings.length<=0 ? 0: strings[0].length;
 
-	StringBuffer total = new StringBuffer();
-	StringBuffer s = new StringBuffer();
-	for (int row=0; row<rows; row++) {
-		s.setLength(0);
-		for (int column=0; column<columns; column++) {
-			s.append(strings[row][column]);
-			if (column<columns-1) s.append(columnSeparator);
-		}
-		total.append(s);
-		if (row<rows-1) total.append(rowSeparator);
-	}
+  StringBuffer total = new StringBuffer();
+  StringBuffer s = new StringBuffer();
+  for (int row=0; row<rows; row++) {
+    s.setLength(0);
+    for (int column=0; column<columns; column++) {
+      s.append(strings[row][column]);
+      if (column<columns-1) s.append(columnSeparator);
+    }
+    total.append(s);
+    if (row<rows-1) total.append(rowSeparator);
+  }
 
-	return total.toString();
+  return total.toString();
 }
 /**
  * Returns a string representation of the given matrix.
  * @param matrix the matrix to convert.
  */
 protected String toString(AbstractMatrix2D matrix) {
-	String[][] strings = this.format(matrix);
-	align(strings);
-	StringBuffer total = new StringBuffer(toString(strings));
-	if (printShape) total.insert(0, shape(matrix) + "\n");
-	return total.toString();
+  String[][] strings = this.format(matrix);
+  align(strings);
+  StringBuffer total = new StringBuffer(toString(strings));
+  if (printShape) total.insert(0, shape(matrix) + "\n");
+  return total.toString();
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/AbstractMatrix.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/AbstractMatrix.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/AbstractMatrix.java	(working copy)
@@ -22,8 +22,8 @@
  */
 @Deprecated
 public abstract class AbstractMatrix extends org.apache.mahout.matrix.PersistentObject {
-	protected boolean isNoView = true;
-	//public static boolean debug = true;
+  protected boolean isNoView = true;
+  //public static boolean debug = true;
 /**
  * Makes this class non instantiable, but still let's others inherit from it.
  */
@@ -41,7 +41,7 @@
  * Returns whether the receiver is a view or not.
  */
 protected boolean isView() {
-	return ! this.isNoView;
+  return ! this.isNoView;
 }
 /**
  * Returns the number of cells.
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/Former.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/Former.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/impl/Former.java	(working copy)
@@ -11,8 +11,6 @@
 /**
  * Formats a double into a string (like sprintf in C).
  *
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 21/07/00
  * @see java.util.Comparator
  * @see org.apache.mahout.colt
  * @see org.apache.mahout.matrix.Sorting
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/ObjectMatrix2D.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/ObjectMatrix2D.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/ObjectMatrix2D.java	(working copy)
@@ -57,16 +57,16 @@
 @see org.apache.mahout.jet.math.Functions
 */
 public Object aggregate(org.apache.mahout.matrix.function.ObjectObjectFunction aggr, org.apache.mahout.matrix.function.ObjectFunction f) {
-	if (size()==0) return null;
-	Object a = f.apply(getQuick(rows-1,columns-1));
-	int d = 1; // last cell already done
-	for (int row=rows; --row >= 0; ) {
-		for (int column=columns-d; --column >= 0; ) {
-			a = aggr.apply(a, f.apply(getQuick(row,column)));
-		}
-		d = 0;
-	}
-	return a;
+  if (size()==0) return null;
+  Object a = f.apply(getQuick(rows-1,columns-1));
+  int d = 1; // last cell already done
+  for (int row=rows; --row >= 0; ) {
+    for (int column=columns-d; --column >= 0; ) {
+      a = aggr.apply(a, f.apply(getQuick(row,column)));
+    }
+    d = 0;
+  }
+  return a;
 }
 /**
 Applies a function to each corresponding cell of two matrices and aggregates the results.
@@ -96,21 +96,21 @@
 @param aggr an aggregation function taking as first argument the current aggregation and as second argument the transformed current cell values.
 @param f a function transforming the current cell values.
 @return the aggregated measure.
-@throws	IllegalArgumentException if <tt>columns() != other.columns() || rows() != other.rows()</tt>
+@throws  IllegalArgumentException if <tt>columns() != other.columns() || rows() != other.rows()</tt>
 @see org.apache.mahout.jet.math.Functions
 */
 public Object aggregate(ObjectMatrix2D other, org.apache.mahout.matrix.function.ObjectObjectFunction aggr, org.apache.mahout.matrix.function.ObjectObjectFunction f) {
-	checkShape(other);
-	if (size()==0) return null;
-	Object a = f.apply(getQuick(rows-1,columns-1),other.getQuick(rows-1,columns-1));
-	int d = 1; // last cell already done
-	for (int row=rows; --row >= 0; ) {
-		for (int column=columns-d; --column >= 0; ) {
-			a = aggr.apply(a, f.apply(getQuick(row,column), other.getQuick(row,column)));
-		}
-		d = 0;
-	}
-	return a;
+  checkShape(other);
+  if (size()==0) return null;
+  Object a = f.apply(getQuick(rows-1,columns-1),other.getQuick(rows-1,columns-1));
+  int d = 1; // last cell already done
+  for (int row=rows; --row >= 0; ) {
+    for (int column=columns-d; --column >= 0; ) {
+      a = aggr.apply(a, f.apply(getQuick(row,column), other.getQuick(row,column)));
+    }
+    d = 0;
+  }
+  return a;
 }
 /**
  * Sets all cells to the state specified by <tt>values</tt>.
@@ -124,15 +124,15 @@
  * @throws IllegalArgumentException if <tt>values.length != rows() || for any 0 &lt;= row &lt; rows(): values[row].length != columns()</tt>.
  */
 public ObjectMatrix2D assign(Object[][] values) {
-	if (values.length != rows) throw new IllegalArgumentException("Must have same number of rows: rows="+values.length+"rows()="+rows());
-	for (int row=rows; --row >= 0;) {
-		Object[] currentRow = values[row];
-		if (currentRow.length != columns) throw new IllegalArgumentException("Must have same number of columns in every row: columns="+currentRow.length+"columns()="+columns());
-		for (int column=columns; --column >= 0;) {
-			setQuick(row,column,currentRow[column]);
-		}
-	}
-	return this;
+  if (values.length != rows) throw new IllegalArgumentException("Must have same number of rows: rows="+values.length+"rows()="+rows());
+  for (int row=rows; --row >= 0;) {
+    Object[] currentRow = values[row];
+    if (currentRow.length != columns) throw new IllegalArgumentException("Must have same number of columns in every row: columns="+currentRow.length+"columns()="+columns());
+    for (int column=columns; --column >= 0;) {
+      setQuick(row,column,currentRow[column]);
+    }
+  }
+  return this;
 }
 /**
 Assigns the result of a function to each cell; <tt>x[row,col] = function(x[row,col])</tt>.
@@ -157,12 +157,12 @@
 @see org.apache.mahout.jet.math.Functions
 */
 public ObjectMatrix2D assign(org.apache.mahout.matrix.function.ObjectFunction function) {
-	for (int row=rows; --row >= 0; ) {
-		for (int column=columns; --column >= 0; ) {
-			setQuick(row,column, function.apply(getQuick(row,column)));
-		}
-	}
-	return this;
+  for (int row=rows; --row >= 0; ) {
+    for (int column=columns; --column >= 0; ) {
+      setQuick(row,column, function.apply(getQuick(row,column)));
+    }
+  }
+  return this;
 }
 /**
  * Replaces all cell values of the receiver with the values of another matrix.
@@ -171,19 +171,19 @@
  *
  * @param     other   the source matrix to copy from (may be identical to the receiver).
  * @return <tt>this</tt> (for convenience only).
- * @throws	IllegalArgumentException if <tt>columns() != other.columns() || rows() != other.rows()</tt>
+ * @throws  IllegalArgumentException if <tt>columns() != other.columns() || rows() != other.rows()</tt>
  */
 public ObjectMatrix2D assign(ObjectMatrix2D other) {
-	if (other==this) return this;
-	checkShape(other);
-	if (haveSharedCells(other)) other = other.copy();
-	
-	for (int row=rows; --row >= 0;) {
-		for (int column=columns; --column >= 0;) {
-			setQuick(row,column,other.getQuick(row,column));
-		}
-	}
-	return this;
+  if (other==this) return this;
+  checkShape(other);
+  if (haveSharedCells(other)) other = other.copy();
+  
+  for (int row=rows; --row >= 0;) {
+    for (int column=columns; --column >= 0;) {
+      setQuick(row,column,other.getQuick(row,column));
+    }
+  }
+  return this;
 }
 /**
 Assigns the result of a function to each cell; <tt>x[row,col] = function(x[row,col],y[row,col])</tt>.
@@ -211,17 +211,17 @@
 @param function a function object taking as first argument the current cell's value of <tt>this</tt>,
 and as second argument the current cell's value of <tt>y</tt>,
 @return <tt>this</tt> (for convenience only).
-@throws	IllegalArgumentException if <tt>columns() != other.columns() || rows() != other.rows()</tt>
+@throws  IllegalArgumentException if <tt>columns() != other.columns() || rows() != other.rows()</tt>
 @see org.apache.mahout.jet.math.Functions
 */
 public ObjectMatrix2D assign(ObjectMatrix2D y, org.apache.mahout.matrix.function.ObjectObjectFunction function) {
-	checkShape(y);
-	for (int row=rows; --row >= 0; ) {
-		for (int column=columns; --column >= 0; ) {
-			setQuick(row,column, function.apply(getQuick(row,column), y.getQuick(row,column)));
-		}
-	}
-	return this;
+  checkShape(y);
+  for (int row=rows; --row >= 0; ) {
+    for (int column=columns; --column >= 0; ) {
+      setQuick(row,column, function.apply(getQuick(row,column), y.getQuick(row,column)));
+    }
+  }
+  return this;
 }
 /**
  * Sets all cells to the state specified by <tt>value</tt>.
@@ -229,24 +229,24 @@
  * @return <tt>this</tt> (for convenience only).
  */
 public ObjectMatrix2D assign(Object value) {
-	for (int row=rows; --row >= 0;) {
-		for (int column=columns; --column >= 0;) {
-			setQuick(row,column,value);
-		}
-	}
-	return this;
+  for (int row=rows; --row >= 0;) {
+    for (int column=columns; --column >= 0;) {
+      setQuick(row,column,value);
+    }
+  }
+  return this;
 }
 /**
  * Returns the number of cells having non-zero values; ignores tolerance.
  */
 public int cardinality() {
-	int cardinality = 0;
-	for (int row=rows; --row >= 0;) {
-		for (int column=columns; --column >= 0;) {
-			if (getQuick(row,column) != null) cardinality++;
-		}
-	}
-	return cardinality;
+  int cardinality = 0;
+  for (int row=rows; --row >= 0;) {
+    for (int column=columns; --column >= 0;) {
+      if (getQuick(row,column) != null) cardinality++;
+    }
+  }
+  return cardinality;
 }
 /**
  * Constructs and returns a deep copy of the receiver.
@@ -257,7 +257,7 @@
  * @return  a deep copy of the receiver.
  */
 public ObjectMatrix2D copy() {
-	return like().assign(this);
+  return like().assign(this);
 }
 /**
 * Compares the specified Object with the receiver for equality.
@@ -267,7 +267,7 @@
 * @return true if the specified Object is equal to the receiver.
 */
 public boolean equals(Object otherObj) { //delta
-	return equals(otherObj, true);
+  return equals(otherObj, true);
 }
 /**
 * Compares the specified Object with the receiver for equality.
@@ -285,29 +285,29 @@
 * @return true if the specified Object is equal to the receiver.
 */
 public boolean equals(Object otherObj, boolean testForEquality) { //delta
-	if (! (otherObj instanceof ObjectMatrix2D)) {return false;}
-	if (this==otherObj) return true;
-	if (otherObj==null) return false;
-	ObjectMatrix2D other = (ObjectMatrix2D) otherObj;
-	if (rows!=other.rows()) return false;
-	if (columns!=other.columns()) return false;
+  if (! (otherObj instanceof ObjectMatrix2D)) {return false;}
+  if (this==otherObj) return true;
+  if (otherObj==null) return false;
+  ObjectMatrix2D other = (ObjectMatrix2D) otherObj;
+  if (rows!=other.rows()) return false;
+  if (columns!=other.columns()) return false;
 
-	if (! testForEquality) {
-		for (int row=rows; --row >= 0; ) {
-			for (int column=columns; --column >= 0; ) {
-				if (getQuick(row,column) != other.getQuick(row,column)) return false;
-			}
-		}
-	}
-	else {
-		for (int row=rows; --row >= 0; ) {
-			for (int column=columns; --column >= 0; ) {
-				if (!(getQuick(row,column)==null ? other.getQuick(row,column)==null : getQuick(row,column).equals(other.getQuick(row,column)))) return false;
-			}
-		}
-	}
+  if (! testForEquality) {
+    for (int row=rows; --row >= 0; ) {
+      for (int column=columns; --column >= 0; ) {
+        if (getQuick(row,column) != other.getQuick(row,column)) return false;
+      }
+    }
+  }
+  else {
+    for (int row=rows; --row >= 0; ) {
+      for (int column=columns; --column >= 0; ) {
+        if (!(getQuick(row,column)==null ? other.getQuick(row,column)==null : getQuick(row,column).equals(other.getQuick(row,column)))) return false;
+      }
+    }
+  }
 
-	return true;
+  return true;
 
 }
 /**
@@ -316,18 +316,18 @@
  * @param     row   the index of the row-coordinate.
  * @param     column   the index of the column-coordinate.
  * @return    the value of the specified cell.
- * @throws	IndexOutOfBoundsException if <tt>column&lt;0 || column&gt;=columns() || row&lt;0 || row&gt;=rows()</tt>
+ * @throws  IndexOutOfBoundsException if <tt>column&lt;0 || column&gt;=columns() || row&lt;0 || row&gt;=rows()</tt>
  */
 public Object get(int row, int column) {
-	if (column<0 || column>=columns || row<0 || row>=rows) throw new IndexOutOfBoundsException("row:"+row+", column:"+column);
-	return getQuick(row,column);
+  if (column<0 || column>=columns || row<0 || row>=rows) throw new IndexOutOfBoundsException("row:"+row+", column:"+column);
+  return getQuick(row,column);
 }
 /**
  * Returns the content of this matrix if it is a wrapper; or <tt>this</tt> otherwise.
  * Override this method in wrappers.
  */
 protected ObjectMatrix2D getContent() {
-	return this;
+  return this;
 }
 /**
 Fills the coordinates and values of cells having non-zero values into the specified lists.
@@ -357,21 +357,21 @@
 @param valueList the list to be filled with values, can have any size.
 */
 public void getNonZeros(IntArrayList rowList, IntArrayList columnList, ObjectArrayList valueList) {
-	rowList.clear(); 
-	columnList.clear(); 
-	valueList.clear();
-	int r = rows;
-	int c = columns;
-	for (int row=0; row < r; row++) {
-		for (int column=0; column < c; column++) {
-			Object value = getQuick(row,column);
-			if (value != null) {
-				rowList.add(row);
-				columnList.add(column);
-				valueList.add(value);
-			}
-		}
-	}
+  rowList.clear(); 
+  columnList.clear(); 
+  valueList.clear();
+  int r = rows;
+  int c = columns;
+  for (int row=0; row < r; row++) {
+    for (int column=0; column < c; column++) {
+      Object value = getQuick(row,column);
+      if (value != null) {
+        rowList.add(row);
+        columnList.add(column);
+        valueList.add(value);
+      }
+    }
+  }
 }
 /**
  * Returns the matrix cell value at coordinate <tt>[row,column]</tt>.
@@ -389,16 +389,16 @@
  * Returns <tt>true</tt> if both matrices share at least one identical cell.
  */
 protected boolean haveSharedCells(ObjectMatrix2D other) {
-	if (other==null) return false;
-	if (this==other) return true;
-	return getContent().haveSharedCellsRaw(other.getContent());
-}	
+  if (other==null) return false;
+  if (this==other) return true;
+  return getContent().haveSharedCellsRaw(other.getContent());
+}  
 /**
  * Returns <tt>true</tt> if both matrices share at least one identical cell.
  */
 protected boolean haveSharedCellsRaw(ObjectMatrix2D other) {
-	return false;
-}	
+  return false;
+}  
 /**
  * Construct and returns a new empty matrix <i>of the same dynamic type</i> as the receiver, having the same number of rows and columns.
  * For example, if the receiver is an instance of type <tt>DenseObjectMatrix2D</tt> the new matrix must also be of type <tt>DenseObjectMatrix2D</tt>,
@@ -408,7 +408,7 @@
  * @return  a new empty matrix of the same dynamic type.
  */
 public ObjectMatrix2D like() {
-	return like(rows,columns);
+  return like(rows,columns);
 }
 /**
  * Construct and returns a new empty matrix <i>of the same dynamic type</i> as the receiver, having the specified number of rows and columns.
@@ -447,11 +447,11 @@
  * @param     row   the index of the row-coordinate.
  * @param     column   the index of the column-coordinate.
  * @param    value the value to be filled into the specified cell.
- * @throws	IndexOutOfBoundsException if <tt>column&lt;0 || column&gt;=columns() || row&lt;0 || row&gt;=rows()</tt>
+ * @throws  IndexOutOfBoundsException if <tt>column&lt;0 || column&gt;=columns() || row&lt;0 || row&gt;=rows()</tt>
  */
 public void set(int row, int column, Object value) {
-	if (column<0 || column>=columns || row<0 || row>=rows) throw new IndexOutOfBoundsException("row:"+row+", column:"+column);
-	setQuick(row,column,value);
+  if (column<0 || column>=columns || row<0 || row>=rows) throw new IndexOutOfBoundsException("row:"+row+", column:"+column);
+  setQuick(row,column,value);
 }
 /**
  * Sets the matrix cell at coordinate <tt>[row,column]</tt> to the specified value.
@@ -475,21 +475,21 @@
  * @return an array filled with the values of the cells.
  */
 public Object[][] toArray() {
-	Object[][] values = new Object[rows][columns];
-	for (int row=rows; --row >= 0;) {
-		Object[] currentRow = values[row];
-		for (int column=columns; --column >= 0;) {
-			currentRow[column] = getQuick(row,column);
-		}
-	}
-	return values;
+  Object[][] values = new Object[rows][columns];
+  for (int row=rows; --row >= 0;) {
+    Object[] currentRow = values[row];
+    for (int column=columns; --column >= 0;) {
+      currentRow[column] = getQuick(row,column);
+    }
+  }
+  return values;
 }
 /**
  * Returns a string representation using default formatting.
  * @see org.apache.mahout.matrix.matrix.objectalgo.Formatter
  */
 public String toString() {
-	return new org.apache.mahout.matrix.matrix.objectalgo.Formatter().toString(this);
+  return new org.apache.mahout.matrix.matrix.objectalgo.Formatter().toString(this);
 }
 /**
  * Constructs and returns a new view equal to the receiver.
@@ -503,7 +503,7 @@
  * @return  a new view of the receiver.
  */
 protected ObjectMatrix2D view() {
-	return (ObjectMatrix2D) clone();
+  return (ObjectMatrix2D) clone();
 }
 /**
 Constructs and returns a new <i>slice view</i> representing the rows of the given column.
@@ -513,12 +513,12 @@
 <b>Example:</b> 
 <table border="0">
   <tr nowrap> 
-	<td valign="top">2 x 3 matrix: <br>
-	  1, 2, 3<br>
-	  4, 5, 6 </td>
-	<td>viewColumn(0) ==></td>
-	<td valign="top">Matrix1D of size 2:<br>
-	  1, 4</td>
+  <td valign="top">2 x 3 matrix: <br>
+    1, 2, 3<br>
+    4, 5, 6 </td>
+  <td>viewColumn(0) ==></td>
+  <td valign="top">Matrix1D of size 2:<br>
+    1, 4</td>
    </tr>
 </table>
 
@@ -528,11 +528,11 @@
 @see #viewRow(int)
 */
 public ObjectMatrix1D viewColumn(int column) {
-	checkColumn(column);
-	int viewSize = this.rows;
-	int viewZero = index(0,column);
-	int viewStride = this.rowStride;
-	return like1D(viewSize,viewZero,viewStride);
+  checkColumn(column);
+  int viewSize = this.rows;
+  int viewZero = index(0,column);
+  int viewStride = this.rowStride;
+  return like1D(viewSize,viewZero,viewStride);
 }
 /**
 Constructs and returns a new <i>flip view</i> along the column axis.
@@ -542,17 +542,17 @@
 <b>Example:</b> 
 <table border="0">
   <tr nowrap> 
-	<td valign="top">2 x 3 matrix: <br>
-	  1, 2, 3<br>
-	  4, 5, 6 </td>
-	<td>columnFlip ==></td>
-	<td valign="top">2 x 3 matrix:<br>
-	  3, 2, 1 <br>
-	  6, 5, 4</td>
-	<td>columnFlip ==></td>
-	<td valign="top">2 x 3 matrix: <br>
-	  1, 2, 3<br>
-	  4, 5, 6 </td>
+  <td valign="top">2 x 3 matrix: <br>
+    1, 2, 3<br>
+    4, 5, 6 </td>
+  <td>columnFlip ==></td>
+  <td valign="top">2 x 3 matrix:<br>
+    3, 2, 1 <br>
+    6, 5, 4</td>
+  <td>columnFlip ==></td>
+  <td valign="top">2 x 3 matrix: <br>
+    1, 2, 3<br>
+    4, 5, 6 </td>
   </tr>
 </table>
 
@@ -560,7 +560,7 @@
 @see #viewRowFlip()
 */
 public ObjectMatrix2D viewColumnFlip() {
-	return (ObjectMatrix2D) (view().vColumnFlip());
+  return (ObjectMatrix2D) (view().vColumnFlip());
 }
 /**
 Constructs and returns a new <i>dice (transposition) view</i>; Swaps axes; example: 3 x 4 matrix --> 4 x 3 matrix.
@@ -573,25 +573,25 @@
 <b>Example:</b> 
 <table border="0">
   <tr nowrap> 
-	<td valign="top">2 x 3 matrix: <br>
-	  1, 2, 3<br>
-	  4, 5, 6 </td>
-	<td>transpose ==></td>
-	<td valign="top">3 x 2 matrix:<br>
-	  1, 4 <br>
-	  2, 5 <br>
-	  3, 6</td>
-	<td>transpose ==></td>
-	<td valign="top">2 x 3 matrix: <br>
-	  1, 2, 3<br>
-	  4, 5, 6 </td>
+  <td valign="top">2 x 3 matrix: <br>
+    1, 2, 3<br>
+    4, 5, 6 </td>
+  <td>transpose ==></td>
+  <td valign="top">3 x 2 matrix:<br>
+    1, 4 <br>
+    2, 5 <br>
+    3, 6</td>
+  <td>transpose ==></td>
+  <td valign="top">2 x 3 matrix: <br>
+    1, 2, 3<br>
+    4, 5, 6 </td>
   </tr>
 </table>
 
 @return a new dice view.
 */
 public ObjectMatrix2D viewDice() {
-	return (ObjectMatrix2D) (view().vDice());
+  return (ObjectMatrix2D) (view().vDice());
 }
 /**
 Constructs and returns a new <i>sub-range view</i> that is a <tt>height x width</tt> sub matrix starting at <tt>[row,column]</tt>.
@@ -612,12 +612,12 @@
 @param     column   The index of the column-coordinate.
 @param     height   The height of the box.
 @param     width   The width of the box.
-@throws	IndexOutOfBoundsException if <tt>column<0 || width<0 || column+width>columns() || row<0 || height<0 || row+height>rows()</tt>
+@throws  IndexOutOfBoundsException if <tt>column<0 || width<0 || column+width>columns() || row<0 || height<0 || row+height>rows()</tt>
 @return the new view.
-		
+    
 */
 public ObjectMatrix2D viewPart(int row, int column, int height, int width) {
-	return (ObjectMatrix2D) (view().vPart(row,column,height,width));
+  return (ObjectMatrix2D) (view().vPart(row,column,height,width));
 }
 /**
 Constructs and returns a new <i>slice view</i> representing the columns of the given row.
@@ -627,12 +627,12 @@
 <b>Example:</b> 
 <table border="0">
   <tr nowrap> 
-	<td valign="top">2 x 3 matrix: <br>
-	  1, 2, 3<br>
-	  4, 5, 6 </td>
-	<td>viewRow(0) ==></td>
-	<td valign="top">Matrix1D of size 3:<br>
-	  1, 2, 3</td>
+  <td valign="top">2 x 3 matrix: <br>
+    1, 2, 3<br>
+    4, 5, 6 </td>
+  <td>viewRow(0) ==></td>
+  <td valign="top">Matrix1D of size 3:<br>
+    1, 2, 3</td>
    </tr>
 </table>
 
@@ -642,11 +642,11 @@
 @see #viewColumn(int)
 */
 public ObjectMatrix1D viewRow(int row) {
-	checkRow(row);
-	int viewSize = this.columns;
-	int viewZero = index(row,0);
-	int viewStride = this.columnStride;
-	return like1D(viewSize,viewZero,viewStride);
+  checkRow(row);
+  int viewSize = this.columns;
+  int viewZero = index(row,0);
+  int viewStride = this.columnStride;
+  return like1D(viewSize,viewZero,viewStride);
 }
 /**
 Constructs and returns a new <i>flip view</i> along the row axis.
@@ -656,17 +656,17 @@
 <b>Example:</b> 
 <table border="0">
   <tr nowrap> 
-	<td valign="top">2 x 3 matrix: <br>
-	  1, 2, 3<br>
-	  4, 5, 6 </td>
-	<td>rowFlip ==></td>
-	<td valign="top">2 x 3 matrix:<br>
-	  4, 5, 6 <br>
-	  1, 2, 3</td>
-	<td>rowFlip ==></td>
-	<td valign="top">2 x 3 matrix: <br>
-	  1, 2, 3<br>
-	  4, 5, 6 </td>
+  <td valign="top">2 x 3 matrix: <br>
+    1, 2, 3<br>
+    4, 5, 6 </td>
+  <td>rowFlip ==></td>
+  <td valign="top">2 x 3 matrix:<br>
+    4, 5, 6 <br>
+    1, 2, 3</td>
+  <td>rowFlip ==></td>
+  <td valign="top">2 x 3 matrix: <br>
+    1, 2, 3<br>
+    4, 5, 6 </td>
   </tr>
 </table>
 
@@ -674,7 +674,7 @@
 @see #viewColumnFlip()
 */
 public ObjectMatrix2D viewRowFlip() {
-	return (ObjectMatrix2D) (view().vRowFlip());
+  return (ObjectMatrix2D) (view().vRowFlip());
 }
 /**
 Constructs and returns a new <i>selection view</i> that is a matrix holding the indicated cells.
@@ -704,27 +704,27 @@
 @throws IndexOutOfBoundsException if <tt>!(0 <= columnIndexes[i] < columns())</tt> for any <tt>i=0..columnIndexes.length()-1</tt>.
 */
 public ObjectMatrix2D viewSelection(int[] rowIndexes, int[] columnIndexes) {
-	// check for "all"
-	if (rowIndexes==null) {
-		rowIndexes = new int[rows];
-		for (int i=rows; --i >= 0; ) rowIndexes[i] = i;
-	}
-	if (columnIndexes==null) {
-		columnIndexes = new int[columns];
-		for (int i=columns; --i >= 0; ) columnIndexes[i] = i;
-	}
-	
-	checkRowIndexes(rowIndexes);
-	checkColumnIndexes(columnIndexes);
-	int[] rowOffsets = new int[rowIndexes.length];
-	int[] columnOffsets = new int[columnIndexes.length];
-	for (int i=rowIndexes.length; --i >= 0; ) {
-		rowOffsets[i] = _rowOffset(_rowRank(rowIndexes[i]));
-	}
-	for (int i=columnIndexes.length; --i >= 0; ) {
-		columnOffsets[i] = _columnOffset(_columnRank(columnIndexes[i]));
-	}
-	return viewSelectionLike(rowOffsets,columnOffsets);
+  // check for "all"
+  if (rowIndexes==null) {
+    rowIndexes = new int[rows];
+    for (int i=rows; --i >= 0; ) rowIndexes[i] = i;
+  }
+  if (columnIndexes==null) {
+    columnIndexes = new int[columns];
+    for (int i=columns; --i >= 0; ) columnIndexes[i] = i;
+  }
+  
+  checkRowIndexes(rowIndexes);
+  checkColumnIndexes(columnIndexes);
+  int[] rowOffsets = new int[rowIndexes.length];
+  int[] columnOffsets = new int[columnIndexes.length];
+  for (int i=rowIndexes.length; --i >= 0; ) {
+    rowOffsets[i] = _rowOffset(_rowRank(rowIndexes[i]));
+  }
+  for (int i=columnIndexes.length; --i >= 0; ) {
+    columnOffsets[i] = _columnOffset(_columnRank(columnIndexes[i]));
+  }
+  return viewSelectionLike(rowOffsets,columnOffsets);
 }
 /**
 Constructs and returns a new <i>selection view</i> that is a matrix holding all <b>rows</b> matching the given condition.
@@ -759,13 +759,13 @@
 @return the new view.
 */
 public ObjectMatrix2D viewSelection(ObjectMatrix1DProcedure condition) {
-	IntArrayList matches = new IntArrayList();
-	for (int i=0; i < rows; i++) {
-		if (condition.apply(viewRow(i))) matches.add(i);
-	}
-	
-	matches.trimToSize();
-	return viewSelection(matches.elements(), null); // take all columns
+  IntArrayList matches = new IntArrayList();
+  for (int i=0; i < rows; i++) {
+    if (condition.apply(viewRow(i))) matches.add(i);
+  }
+  
+  matches.trimToSize();
+  return viewSelection(matches.elements(), null); // take all columns
 }
 /**
  * Construct and returns a new selection view.
@@ -784,7 +784,7 @@
 @throws IndexOutOfBoundsException if <tt>column < 0 || column >= columns()</tt>.
 */
 public ObjectMatrix2D viewSorted(int column) {
-	return org.apache.mahout.matrix.matrix.objectalgo.Sorting.mergeSort.sort(this,column);
+  return org.apache.mahout.matrix.matrix.objectalgo.Sorting.mergeSort.sort(this,column);
 }
 /**
 Constructs and returns a new <i>stride view</i> which is a sub matrix consisting of every i-th cell.
@@ -794,10 +794,10 @@
 @param rowStride the row step factor.
 @param columnStride the column step factor.
 @return a new view.
-@throws	IndexOutOfBoundsException if <tt>rowStride<=0 || columnStride<=0</tt>.
+@throws  IndexOutOfBoundsException if <tt>rowStride<=0 || columnStride<=0</tt>.
 */
 public ObjectMatrix2D viewStrides(int rowStride, int columnStride) {
-	return (ObjectMatrix2D) (view().vStrides(rowStride, columnStride));
+  return (ObjectMatrix2D) (view().vStrides(rowStride, columnStride));
 }
 /**
  * Applies a procedure to each cell's value.
@@ -817,11 +817,11 @@
  * @return <tt>false</tt> if the procedure stopped before all elements where iterated over, <tt>true</tt> otherwise. 
  */
 private boolean xforEach(final org.apache.mahout.matrix.function.ObjectProcedure procedure) {
-	for (int row=rows; --row >= 0;) {
-		for (int column=columns; --column >= 0;) {
-			if (!procedure.apply(getQuick(row,column))) return false;
-		}
-	}
-	return true;
+  for (int row=rows; --row >= 0;) {
+    for (int column=columns; --column >= 0;) {
+      if (!procedure.apply(getQuick(row,column))) return false;
+    }
+  }
+  return true;
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/ObjectMatrix3D.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/ObjectMatrix3D.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/ObjectMatrix3D.java	(working copy)
@@ -60,18 +60,18 @@
 @see org.apache.mahout.jet.math.Functions
 */
 public Object aggregate(org.apache.mahout.matrix.function.ObjectObjectFunction aggr, org.apache.mahout.matrix.function.ObjectFunction f) {
-	if (size()==0) return null;
-	Object a = f.apply(getQuick(slices-1,rows-1,columns-1));
-	int d = 1; // last cell already done
-	for (int slice=slices; --slice >= 0; ) {
-		for (int row=rows; --row >= 0; ) {
-			for (int column=columns-d; --column >= 0; ) {
-				a = aggr.apply(a, f.apply(getQuick(slice,row,column)));
-			}
-			d = 0;
-		}
-	}
-	return a;
+  if (size()==0) return null;
+  Object a = f.apply(getQuick(slices-1,rows-1,columns-1));
+  int d = 1; // last cell already done
+  for (int slice=slices; --slice >= 0; ) {
+    for (int row=rows; --row >= 0; ) {
+      for (int column=columns-d; --column >= 0; ) {
+        a = aggr.apply(a, f.apply(getQuick(slice,row,column)));
+      }
+      d = 0;
+    }
+  }
+  return a;
 }
 /**
 Applies a function to each corresponding cell of two matrices and aggregates the results.
@@ -107,23 +107,23 @@
 @param aggr an aggregation function taking as first argument the current aggregation and as second argument the transformed current cell values.
 @param f a function transforming the current cell values.
 @return the aggregated measure.
-@throws	IllegalArgumentException if <tt>slices() != other.slices() || rows() != other.rows() || columns() != other.columns()</tt>
+@throws  IllegalArgumentException if <tt>slices() != other.slices() || rows() != other.rows() || columns() != other.columns()</tt>
 @see org.apache.mahout.jet.math.Functions
 */
 public Object aggregate(ObjectMatrix3D other, org.apache.mahout.matrix.function.ObjectObjectFunction aggr, org.apache.mahout.matrix.function.ObjectObjectFunction f) {
-	checkShape(other);
-	if (size()==0) return null;
-	Object a = f.apply(getQuick(slices-1,rows-1,columns-1),other.getQuick(slices-1,rows-1,columns-1));
-	int d = 1; // last cell already done
-	for (int slice=slices; --slice >= 0; ) {
-		for (int row=rows; --row >= 0; ) {
-			for (int column=columns-d; --column >= 0; ) {
-				a = aggr.apply(a, f.apply(getQuick(slice,row,column), other.getQuick(slice,row,column)));
-			}
-			d = 0;
-		}
-	}
-	return a;
+  checkShape(other);
+  if (size()==0) return null;
+  Object a = f.apply(getQuick(slices-1,rows-1,columns-1),other.getQuick(slices-1,rows-1,columns-1));
+  int d = 1; // last cell already done
+  for (int slice=slices; --slice >= 0; ) {
+    for (int row=rows; --row >= 0; ) {
+      for (int column=columns-d; --column >= 0; ) {
+        a = aggr.apply(a, f.apply(getQuick(slice,row,column), other.getQuick(slice,row,column)));
+      }
+      d = 0;
+    }
+  }
+  return a;
 }
 /**
  * Sets all cells to the state specified by <tt>values</tt>.
@@ -138,19 +138,19 @@
  * @throws IllegalArgumentException if <tt>for any 0 &lt;= column &lt; columns(): values[slice][row].length != columns()</tt>.
  */
 public ObjectMatrix3D assign(Object[][][] values) {
-	if (values.length != slices) throw new IllegalArgumentException("Must have same number of slices: slices="+values.length+"slices()="+slices());
-	for (int slice=slices; --slice >= 0;) {
-		Object[][] currentSlice = values[slice];
-		if (currentSlice.length != rows) throw new IllegalArgumentException("Must have same number of rows in every slice: rows="+currentSlice.length+"rows()="+rows());
-		for (int row=rows; --row >= 0;) {
-			Object[] currentRow = currentSlice[row];
-			if (currentRow.length != columns) throw new IllegalArgumentException("Must have same number of columns in every row: columns="+currentRow.length+"columns()="+columns());
-			for (int column=columns; --column >= 0;) {
-				setQuick(slice,row,column,currentRow[column]);
-			}
-		}
-	}
-	return this;
+  if (values.length != slices) throw new IllegalArgumentException("Must have same number of slices: slices="+values.length+"slices()="+slices());
+  for (int slice=slices; --slice >= 0;) {
+    Object[][] currentSlice = values[slice];
+    if (currentSlice.length != rows) throw new IllegalArgumentException("Must have same number of rows in every slice: rows="+currentSlice.length+"rows()="+rows());
+    for (int row=rows; --row >= 0;) {
+      Object[] currentRow = currentSlice[row];
+      if (currentRow.length != columns) throw new IllegalArgumentException("Must have same number of columns in every row: columns="+currentRow.length+"columns()="+columns());
+      for (int column=columns; --column >= 0;) {
+        setQuick(slice,row,column,currentRow[column]);
+      }
+    }
+  }
+  return this;
 }
 /**
 Assigns the result of a function to each cell; <tt>x[slice,row,col] = function(x[slice,row,col])</tt>.
@@ -175,14 +175,14 @@
 @see org.apache.mahout.jet.math.Functions
 */
 public ObjectMatrix3D assign(org.apache.mahout.matrix.function.ObjectFunction function) {
-	for (int slice=slices; --slice >= 0; ) {
-		for (int row=rows; --row >= 0; ) {
-			for (int column=columns; --column >= 0; ) {
-				setQuick(slice,row,column, function.apply(getQuick(slice,row,column)));
-			}
-		}
-	}
-	return this;
+  for (int slice=slices; --slice >= 0; ) {
+    for (int row=rows; --row >= 0; ) {
+      for (int column=columns; --column >= 0; ) {
+        setQuick(slice,row,column, function.apply(getQuick(slice,row,column)));
+      }
+    }
+  }
+  return this;
 }
 /**
  * Replaces all cell values of the receiver with the values of another matrix.
@@ -191,21 +191,21 @@
  *
  * @param     other   the source matrix to copy from (may be identical to the receiver).
  * @return <tt>this</tt> (for convenience only).
- * @throws	IllegalArgumentException if <tt>slices() != other.slices() || rows() != other.rows() || columns() != other.columns()</tt>
+ * @throws  IllegalArgumentException if <tt>slices() != other.slices() || rows() != other.rows() || columns() != other.columns()</tt>
  */
 public ObjectMatrix3D assign(ObjectMatrix3D other) {
-	if (other==this) return this;
-	checkShape(other);
-	if (haveSharedCells(other)) other = other.copy();
-	
-	for (int slice=slices; --slice >= 0;) {
-		for (int row=rows; --row >= 0;) {
-			for (int column=columns; --column >= 0;) {
-				setQuick(slice,row,column,other.getQuick(slice,row,column));
-			}
-		}
-	}
-	return this;
+  if (other==this) return this;
+  checkShape(other);
+  if (haveSharedCells(other)) other = other.copy();
+  
+  for (int slice=slices; --slice >= 0;) {
+    for (int row=rows; --row >= 0;) {
+      for (int column=columns; --column >= 0;) {
+        setQuick(slice,row,column,other.getQuick(slice,row,column));
+      }
+    }
+  }
+  return this;
 }
 /**
 Assigns the result of a function to each cell; <tt>x[row,col] = function(x[row,col],y[row,col])</tt>.
@@ -233,19 +233,19 @@
 @param function a function object taking as first argument the current cell's value of <tt>this</tt>,
 and as second argument the current cell's value of <tt>y</tt>,
 @return <tt>this</tt> (for convenience only).
-@throws	IllegalArgumentException if <tt>slices() != other.slices() || rows() != other.rows() || columns() != other.columns()</tt>
+@throws  IllegalArgumentException if <tt>slices() != other.slices() || rows() != other.rows() || columns() != other.columns()</tt>
 @see org.apache.mahout.jet.math.Functions
 */
 public ObjectMatrix3D assign(ObjectMatrix3D y, org.apache.mahout.matrix.function.ObjectObjectFunction function) {
-	checkShape(y);
-	for (int slice=slices; --slice >= 0; ) {
-		for (int row=rows; --row >= 0; ) {
-			for (int column=columns; --column >= 0; ) {
-				setQuick(slice,row,column, function.apply(getQuick(slice,row,column), y.getQuick(slice,row,column)));
-			}
-		}
-	}
-	return this;
+  checkShape(y);
+  for (int slice=slices; --slice >= 0; ) {
+    for (int row=rows; --row >= 0; ) {
+      for (int column=columns; --column >= 0; ) {
+        setQuick(slice,row,column, function.apply(getQuick(slice,row,column), y.getQuick(slice,row,column)));
+      }
+    }
+  }
+  return this;
 }
 /**
  * Sets all cells to the state specified by <tt>value</tt>.
@@ -253,28 +253,28 @@
  * @return <tt>this</tt> (for convenience only).
  */
 public ObjectMatrix3D assign(Object value) {
-	for (int slice=slices; --slice >= 0;) {
-		for (int row=rows; --row >= 0;) {
-			for (int column=columns; --column >= 0;) {
-				setQuick(slice,row,column,value);
-			}
-		}
-	}
-	return this;
+  for (int slice=slices; --slice >= 0;) {
+    for (int row=rows; --row >= 0;) {
+      for (int column=columns; --column >= 0;) {
+        setQuick(slice,row,column,value);
+      }
+    }
+  }
+  return this;
 }
 /**
  * Returns the number of cells having non-zero values; ignores tolerance.
  */
 public int cardinality() {
-	int cardinality = 0;
-	for (int slice=slices; --slice >= 0;) {
-		for (int row=rows; --row >= 0;) {
-			for (int column=columns; --column >= 0;) {
-				if (getQuick(slice,row,column) != null) cardinality++;
-			}
-		}
-	}
-	return cardinality;
+  int cardinality = 0;
+  for (int slice=slices; --slice >= 0;) {
+    for (int row=rows; --row >= 0;) {
+      for (int column=columns; --column >= 0;) {
+        if (getQuick(slice,row,column) != null) cardinality++;
+      }
+    }
+  }
+  return cardinality;
 }
 /**
  * Constructs and returns a deep copy of the receiver.
@@ -285,7 +285,7 @@
  * @return  a deep copy of the receiver.
  */
 public ObjectMatrix3D copy() {
-	return like().assign(this);
+  return like().assign(this);
 }
 /**
 * Compares the specified Object with the receiver for equality.
@@ -295,7 +295,7 @@
 * @return true if the specified Object is equal to the receiver.
 */
 public boolean equals(Object otherObj) { //delta
-	return equals(otherObj, true);
+  return equals(otherObj, true);
 }
 /**
 * Compares the specified Object with the receiver for equality.
@@ -313,33 +313,33 @@
 * @return true if the specified Object is equal to the receiver.
 */
 public boolean equals(Object otherObj, boolean testForEquality) { //delta
-	if (! (otherObj instanceof ObjectMatrix3D)) {return false;}
-	if (this==otherObj) return true;
-	if (otherObj==null) return false;
-	ObjectMatrix3D other = (ObjectMatrix3D) otherObj;
-	if (rows!=other.rows()) return false;
-	if (columns!=other.columns()) return false;
+  if (! (otherObj instanceof ObjectMatrix3D)) {return false;}
+  if (this==otherObj) return true;
+  if (otherObj==null) return false;
+  ObjectMatrix3D other = (ObjectMatrix3D) otherObj;
+  if (rows!=other.rows()) return false;
+  if (columns!=other.columns()) return false;
 
-	if (! testForEquality) {
-		for (int slice=slices; --slice >= 0; ) {
-			for (int row=rows; --row >= 0; ) {
-				for (int column=columns; --column >= 0; ) {
-					if (getQuick(slice,row,column) != other.getQuick(slice,row,column)) return false;
-				}
-			}
-		}
-	}
-	else {
-		for (int slice=slices; --slice >= 0; ) {
-			for (int row=rows; --row >= 0; ) {
-				for (int column=columns; --column >= 0; ) {
-				if (!(getQuick(slice,row,column)==null ? other.getQuick(slice,row,column)==null : getQuick(slice,row,column).equals(other.getQuick(slice,row,column)))) return false;
-				}
-			}
-		}
-	}
-	
-	return true;
+  if (! testForEquality) {
+    for (int slice=slices; --slice >= 0; ) {
+      for (int row=rows; --row >= 0; ) {
+        for (int column=columns; --column >= 0; ) {
+          if (getQuick(slice,row,column) != other.getQuick(slice,row,column)) return false;
+        }
+      }
+    }
+  }
+  else {
+    for (int slice=slices; --slice >= 0; ) {
+      for (int row=rows; --row >= 0; ) {
+        for (int column=columns; --column >= 0; ) {
+        if (!(getQuick(slice,row,column)==null ? other.getQuick(slice,row,column)==null : getQuick(slice,row,column).equals(other.getQuick(slice,row,column)))) return false;
+        }
+      }
+    }
+  }
+  
+  return true;
 }
 /**
  * Returns the matrix cell value at coordinate <tt>[slice,row,column]</tt>.
@@ -348,18 +348,18 @@
  * @param     row   the index of the row-coordinate.
  * @param     column   the index of the column-coordinate.
  * @return    the value of the specified cell.
- * @throws	IndexOutOfBoundsException if <tt>slice&lt;0 || slice&gt;=slices() || row&lt;0 || row&gt;=rows() || column&lt;0 || column&gt;=column()</tt>.
+ * @throws  IndexOutOfBoundsException if <tt>slice&lt;0 || slice&gt;=slices() || row&lt;0 || row&gt;=rows() || column&lt;0 || column&gt;=column()</tt>.
  */
 public Object get(int slice, int row, int column) {
-	if (slice<0 || slice>=slices || row<0 || row>=rows || column<0 || column>=columns) throw new IndexOutOfBoundsException("slice:"+slice+", row:"+row+", column:"+column);
-	return getQuick(slice,row,column);
+  if (slice<0 || slice>=slices || row<0 || row>=rows || column<0 || column>=columns) throw new IndexOutOfBoundsException("slice:"+slice+", row:"+row+", column:"+column);
+  return getQuick(slice,row,column);
 }
 /**
  * Returns the content of this matrix if it is a wrapper; or <tt>this</tt> otherwise.
  * Override this method in wrappers.
  */
 protected ObjectMatrix3D getContent() {
-	return this;
+  return this;
 }
 /**
 Fills the coordinates and values of cells having non-zero values into the specified lists.
@@ -378,26 +378,26 @@
 @param valueList the list to be filled with values, can have any size.
 */
 public void getNonZeros(IntArrayList sliceList, IntArrayList rowList, IntArrayList columnList, ObjectArrayList valueList) {
-	sliceList.clear(); 
-	rowList.clear(); 
-	columnList.clear(); 
-	valueList.clear();
-	int s = slices;
-	int r = rows;
-	int c = columns;
-	for (int slice=0; slice < s; slice++) {
-		for (int row=0; row < r; row++) {
-			for (int column=0; column < c; column++) {
-				Object value = getQuick(slice,row,column);
-				if (value != null) {
-					sliceList.add(slice);
-					rowList.add(row);
-					columnList.add(column);
-					valueList.add(value);
-				}
-			}
-		}
-	}
+  sliceList.clear(); 
+  rowList.clear(); 
+  columnList.clear(); 
+  valueList.clear();
+  int s = slices;
+  int r = rows;
+  int c = columns;
+  for (int slice=0; slice < s; slice++) {
+    for (int row=0; row < r; row++) {
+      for (int column=0; column < c; column++) {
+        Object value = getQuick(slice,row,column);
+        if (value != null) {
+          sliceList.add(slice);
+          rowList.add(row);
+          columnList.add(column);
+          valueList.add(value);
+        }
+      }
+    }
+  }
 }
 /**
  * Returns the matrix cell value at coordinate <tt>[slice,row,column]</tt>.
@@ -416,16 +416,16 @@
  * Returns <tt>true</tt> if both matrices share at least one identical cell.
  */
 protected boolean haveSharedCells(ObjectMatrix3D other) {
-	if (other==null) return false;
-	if (this==other) return true;
-	return getContent().haveSharedCellsRaw(other.getContent());
-}	
+  if (other==null) return false;
+  if (this==other) return true;
+  return getContent().haveSharedCellsRaw(other.getContent());
+}  
 /**
  * Returns <tt>true</tt> if both matrices share at least one identical cell.
  */
 protected boolean haveSharedCellsRaw(ObjectMatrix3D other) {
-	return false;
-}	
+  return false;
+}  
 /**
  * Construct and returns a new empty matrix <i>of the same dynamic type</i> as the receiver, having the same number of slices, rows and columns.
  * For example, if the receiver is an instance of type <tt>DenseObjectMatrix3D</tt> the new matrix must also be of type <tt>DenseObjectMatrix3D</tt>,
@@ -435,7 +435,7 @@
  * @return  a new empty matrix of the same dynamic type.
  */
 public ObjectMatrix3D like() {
-	return like(slices,rows,columns);
+  return like(slices,rows,columns);
 }
 /**
  * Construct and returns a new empty matrix <i>of the same dynamic type</i> as the receiver, having the specified number of slices, rows and columns.
@@ -470,11 +470,11 @@
  * @param     row   the index of the row-coordinate.
  * @param     column   the index of the column-coordinate.
  * @param    value the value to be filled into the specified cell.
- * @throws	IndexOutOfBoundsException if <tt>row&lt;0 || row&gt;=rows() || slice&lt;0 || slice&gt;=slices() || column&lt;0 || column&gt;=column()</tt>.
+ * @throws  IndexOutOfBoundsException if <tt>row&lt;0 || row&gt;=rows() || slice&lt;0 || slice&gt;=slices() || column&lt;0 || column&gt;=column()</tt>.
  */
 public void set(int slice, int row, int column, Object value) {
-	if (slice<0 || slice>=slices || row<0 || row>=rows || column<0 || column>=columns) throw new IndexOutOfBoundsException("slice:"+slice+", row:"+row+", column:"+column);
-	setQuick(slice,row,column,value);
+  if (slice<0 || slice>=slices || row<0 || row>=rows || column<0 || column>=columns) throw new IndexOutOfBoundsException("slice:"+slice+", row:"+row+", column:"+column);
+  setQuick(slice,row,column,value);
 }
 /**
  * Sets the matrix cell at coordinate <tt>[slice,row,column]</tt> to the specified value.
@@ -499,24 +499,24 @@
  * @return an array filled with the values of the cells.
  */
 public Object[][][] toArray() {
-	Object[][][] values = new Object[slices][rows][columns];
-	for (int slice=slices; --slice >= 0;) {
-		Object[][] currentSlice = values[slice];
-		for (int row=rows; --row >= 0;) {
-			Object[] currentRow = currentSlice[row];
-			for (int column=columns; --column >= 0;) {
-				currentRow[column] = getQuick(slice,row,column);
-			}
-		}
-	}
-	return values;
+  Object[][][] values = new Object[slices][rows][columns];
+  for (int slice=slices; --slice >= 0;) {
+    Object[][] currentSlice = values[slice];
+    for (int row=rows; --row >= 0;) {
+      Object[] currentRow = currentSlice[row];
+      for (int column=columns; --column >= 0;) {
+        currentRow[column] = getQuick(slice,row,column);
+      }
+    }
+  }
+  return values;
 }
 /**
  * Returns a string representation using default formatting.
  * @see org.apache.mahout.matrix.matrix.objectalgo.Formatter
  */
 public String toString() {
-	return new org.apache.mahout.matrix.matrix.objectalgo.Formatter().toString(this);
+  return new org.apache.mahout.matrix.matrix.objectalgo.Formatter().toString(this);
 }
 /**
  * Constructs and returns a new view equal to the receiver.
@@ -530,7 +530,7 @@
  * @return  a new view of the receiver.
  */
 protected ObjectMatrix3D view() {
-	return (ObjectMatrix3D) clone();
+  return (ObjectMatrix3D) clone();
 }
 /**
 Constructs and returns a new 2-dimensional <i>slice view</i> representing the slices and rows of the given column.
@@ -547,17 +547,17 @@
 @see #viewRow(int)
 */
 public ObjectMatrix2D viewColumn(int column) {
-	checkColumn(column);
-	int sliceRows = this.slices;
-	int sliceColumns = this.rows;
+  checkColumn(column);
+  int sliceRows = this.slices;
+  int sliceColumns = this.rows;
 
-	//int sliceOffset = index(0,0,column);
-	int sliceRowZero = sliceZero;
-	int sliceColumnZero = rowZero + _columnOffset(_columnRank(column));
-	
-	int sliceRowStride = this.sliceStride;
-	int sliceColumnStride = this.rowStride;
-	return like2D(sliceRows,sliceColumns,sliceRowZero,sliceColumnZero,sliceRowStride,sliceColumnStride);
+  //int sliceOffset = index(0,0,column);
+  int sliceRowZero = sliceZero;
+  int sliceColumnZero = rowZero + _columnOffset(_columnRank(column));
+  
+  int sliceRowStride = this.sliceStride;
+  int sliceColumnStride = this.rowStride;
+  return like2D(sliceRows,sliceColumns,sliceRowZero,sliceColumnZero,sliceRowStride,sliceColumnStride);
 }
 /**
 Constructs and returns a new <i>flip view</i> along the column axis.
@@ -569,7 +569,7 @@
 @see #viewRowFlip()
 */
 public ObjectMatrix3D viewColumnFlip() {
-	return (ObjectMatrix3D) (view().vColumnFlip());
+  return (ObjectMatrix3D) (view().vColumnFlip());
 }
 /**
 Constructs and returns a new <i>dice view</i>; Swaps dimensions (axes); Example: 3 x 4 x 5 matrix --> 4 x 3 x 5 matrix.
@@ -583,7 +583,7 @@
 @throws IllegalArgumentException if some of the parameters are equal or not in range 0..2.
 */
 public ObjectMatrix3D viewDice(int axis0, int axis1, int axis2) {
-	return (ObjectMatrix3D) (view().vDice(axis0,axis1,axis2));
+  return (ObjectMatrix3D) (view().vDice(axis0,axis1,axis2));
 }
 /**
 Constructs and returns a new <i>sub-range view</i> that is a <tt>depth x height x width</tt> sub matrix starting at <tt>[slice,row,column]</tt>;
@@ -596,12 +596,12 @@
 @param     depth   The depth of the box.
 @param     height   The height of the box.
 @param     width   The width of the box.
-@throws	IndexOutOfBoundsException if <tt>slice<0 || depth<0 || slice+depth>slices() || row<0 || height<0 || row+height>rows() || column<0 || width<0 || column+width>columns()</tt>
+@throws  IndexOutOfBoundsException if <tt>slice<0 || depth<0 || slice+depth>slices() || row<0 || height<0 || row+height>rows() || column<0 || width<0 || column+width>columns()</tt>
 @return the new view.
-		
+    
 */
 public ObjectMatrix3D viewPart(int slice, int row, int column, int depth, int height, int width) {
-	return (ObjectMatrix3D) (view().vPart(slice,row,column,depth,height,width));
+  return (ObjectMatrix3D) (view().vPart(slice,row,column,depth,height,width));
 }
 /**
 Constructs and returns a new 2-dimensional <i>slice view</i> representing the slices and columns of the given row.
@@ -618,17 +618,17 @@
 @see #viewColumn(int)
 */
 public ObjectMatrix2D viewRow(int row) {
-	checkRow(row);
-	int sliceRows = this.slices;
-	int sliceColumns = this.columns;
-	
-	//int sliceOffset = index(0,row,0);
-	int sliceRowZero = sliceZero ;
-	int sliceColumnZero = columnZero + _rowOffset(_rowRank(row));
-	
-	int sliceRowStride = this.sliceStride;
-	int sliceColumnStride = this.columnStride;
-	return like2D(sliceRows,sliceColumns,sliceRowZero,sliceColumnZero,sliceRowStride,sliceColumnStride);
+  checkRow(row);
+  int sliceRows = this.slices;
+  int sliceColumns = this.columns;
+  
+  //int sliceOffset = index(0,row,0);
+  int sliceRowZero = sliceZero ;
+  int sliceColumnZero = columnZero + _rowOffset(_rowRank(row));
+  
+  int sliceRowStride = this.sliceStride;
+  int sliceColumnStride = this.columnStride;
+  return like2D(sliceRows,sliceColumns,sliceRowZero,sliceColumnZero,sliceRowStride,sliceColumnStride);
 }
 /**
 Constructs and returns a new <i>flip view</i> along the row axis.
@@ -640,7 +640,7 @@
 @see #viewColumnFlip()
 */
 public ObjectMatrix3D viewRowFlip() {
-	return (ObjectMatrix3D) (view().vRowFlip());
+  return (ObjectMatrix3D) (view().vRowFlip());
 }
 /**
 Constructs and returns a new <i>selection view</i> that is a matrix holding the indicated cells.
@@ -661,39 +661,39 @@
 @throws IndexOutOfBoundsException if <tt>!(0 <= columnIndexes[i] < columns())</tt> for any <tt>i=0..columnIndexes.length()-1</tt>.
 */
 public ObjectMatrix3D viewSelection(int[] sliceIndexes, int[] rowIndexes, int[] columnIndexes) {
-	// check for "all"
-	if (sliceIndexes==null) {
-		sliceIndexes = new int[slices];
-		for (int i=slices; --i >= 0; ) sliceIndexes[i] = i;
-	}
-	if (rowIndexes==null) {
-		rowIndexes = new int[rows];
-		for (int i=rows; --i >= 0; ) rowIndexes[i] = i;
-	}
-	if (columnIndexes==null) {
-		columnIndexes = new int[columns];
-		for (int i=columns; --i >= 0; ) columnIndexes[i] = i;
-	}
-	
-	checkSliceIndexes(sliceIndexes);
-	checkRowIndexes(rowIndexes);
-	checkColumnIndexes(columnIndexes);
-	
-	int[] sliceOffsets = new int[sliceIndexes.length];
-	int[] rowOffsets = new int[rowIndexes.length];
-	int[] columnOffsets = new int[columnIndexes.length];
-	
-	for (int i=sliceIndexes.length; --i >= 0; ) {
-		sliceOffsets[i] = _sliceOffset(_sliceRank(sliceIndexes[i]));
-	}
-	for (int i=rowIndexes.length; --i >= 0; ) {
-		rowOffsets[i] = _rowOffset(_rowRank(rowIndexes[i]));
-	}
-	for (int i=columnIndexes.length; --i >= 0; ) {
-		columnOffsets[i] = _columnOffset(_columnRank(columnIndexes[i]));
-	}
-	
-	return viewSelectionLike(sliceOffsets,rowOffsets,columnOffsets);
+  // check for "all"
+  if (sliceIndexes==null) {
+    sliceIndexes = new int[slices];
+    for (int i=slices; --i >= 0; ) sliceIndexes[i] = i;
+  }
+  if (rowIndexes==null) {
+    rowIndexes = new int[rows];
+    for (int i=rows; --i >= 0; ) rowIndexes[i] = i;
+  }
+  if (columnIndexes==null) {
+    columnIndexes = new int[columns];
+    for (int i=columns; --i >= 0; ) columnIndexes[i] = i;
+  }
+  
+  checkSliceIndexes(sliceIndexes);
+  checkRowIndexes(rowIndexes);
+  checkColumnIndexes(columnIndexes);
+  
+  int[] sliceOffsets = new int[sliceIndexes.length];
+  int[] rowOffsets = new int[rowIndexes.length];
+  int[] columnOffsets = new int[columnIndexes.length];
+  
+  for (int i=sliceIndexes.length; --i >= 0; ) {
+    sliceOffsets[i] = _sliceOffset(_sliceRank(sliceIndexes[i]));
+  }
+  for (int i=rowIndexes.length; --i >= 0; ) {
+    rowOffsets[i] = _rowOffset(_rowRank(rowIndexes[i]));
+  }
+  for (int i=columnIndexes.length; --i >= 0; ) {
+    columnOffsets[i] = _columnOffset(_columnRank(columnIndexes[i]));
+  }
+  
+  return viewSelectionLike(sliceOffsets,rowOffsets,columnOffsets);
 }
 /**
 Constructs and returns a new <i>selection view</i> that is a matrix holding all <b>slices</b> matching the given condition.
@@ -717,13 +717,13 @@
 @return the new view.
 */
 public ObjectMatrix3D viewSelection(ObjectMatrix2DProcedure condition) {
-	IntArrayList matches = new IntArrayList();
-	for (int i=0; i < slices; i++) {
-		if (condition.apply(viewSlice(i))) matches.add(i);
-	}
-	
-	matches.trimToSize();
-	return viewSelection(matches.elements(), null, null); // take all rows and columns
+  IntArrayList matches = new IntArrayList();
+  for (int i=0; i < slices; i++) {
+    if (condition.apply(viewSlice(i))) matches.add(i);
+  }
+  
+  matches.trimToSize();
+  return viewSelection(matches.elements(), null, null); // take all rows and columns
 }
 /**
  * Construct and returns a new selection view.
@@ -749,17 +749,17 @@
 @see #viewColumn(int)
 */
 public ObjectMatrix2D viewSlice(int slice) {
-	checkSlice(slice);
-	int sliceRows = this.rows;
-	int sliceColumns = this.columns;
-	
-	//int sliceOffset = index(slice,0,0);
-	int sliceRowZero = rowZero;
-	int sliceColumnZero = columnZero + _sliceOffset(_sliceRank(slice));
+  checkSlice(slice);
+  int sliceRows = this.rows;
+  int sliceColumns = this.columns;
+  
+  //int sliceOffset = index(slice,0,0);
+  int sliceRowZero = rowZero;
+  int sliceColumnZero = columnZero + _sliceOffset(_sliceRank(slice));
 
-	int sliceRowStride = this.rowStride;
-	int sliceColumnStride = this.columnStride;
-	return like2D(sliceRows,sliceColumns,sliceRowZero,sliceColumnZero,sliceRowStride,sliceColumnStride);
+  int sliceRowStride = this.rowStride;
+  int sliceColumnStride = this.columnStride;
+  return like2D(sliceRows,sliceColumns,sliceRowZero,sliceColumnZero,sliceRowStride,sliceColumnStride);
 }
 /**
 Constructs and returns a new <i>flip view</i> along the slice axis.
@@ -771,7 +771,7 @@
 @see #viewColumnFlip()
 */
 public ObjectMatrix3D viewSliceFlip() {
-	return (ObjectMatrix3D) (view().vSliceFlip());
+  return (ObjectMatrix3D) (view().vSliceFlip());
 }
 /**
 Sorts the matrix slices into ascending order, according to the <i>natural ordering</i> of the matrix values in the given <tt>[row,column]</tt> position.
@@ -782,7 +782,7 @@
 @throws IndexOutOfBoundsException if <tt>row < 0 || row >= rows() || column < 0 || column >= columns()</tt>.
 */
 public ObjectMatrix3D viewSorted(int row, int column) {
-	return org.apache.mahout.matrix.matrix.objectalgo.Sorting.mergeSort.sort(this,row,column);
+  return org.apache.mahout.matrix.matrix.objectalgo.Sorting.mergeSort.sort(this,row,column);
 }
 /**
 Constructs and returns a new <i>stride view</i> which is a sub matrix consisting of every i-th cell.
@@ -794,10 +794,10 @@
 @param rowStride the row step factor.
 @param columnStride the column step factor.
 @return a new view.
-@throws	IndexOutOfBoundsException if <tt>sliceStride<=0 || rowStride<=0 || columnStride<=0</tt>.
+@throws  IndexOutOfBoundsException if <tt>sliceStride<=0 || rowStride<=0 || columnStride<=0</tt>.
 */
 public ObjectMatrix3D viewStrides(int sliceStride, int rowStride, int columnStride) {
-	return (ObjectMatrix3D) (view().vStrides(sliceStride, rowStride, columnStride));
+  return (ObjectMatrix3D) (view().vStrides(sliceStride, rowStride, columnStride));
 }
 /**
  * Applies a procedure to each cell's value.
@@ -819,14 +819,14 @@
  * @return <tt>false</tt> if the procedure stopped before all elements where iterated over, <tt>true</tt> otherwise. 
  */
 private boolean xforEach(final org.apache.mahout.matrix.function.ObjectProcedure procedure) {
-	for (int slice=slices; --slice >= 0;) {
-		for (int row=rows; --row >= 0;) {
-			for (int column=columns; --column >= 0;) {
-				if (!procedure.apply(getQuick(slice,row,column))) return false;
-			}
-		}
-	}
-	return true;
+  for (int slice=slices; --slice >= 0;) {
+    for (int row=rows; --row >= 0;) {
+      for (int column=columns; --column >= 0;) {
+        if (!procedure.apply(getQuick(slice,row,column))) return false;
+      }
+    }
+  }
+  return true;
 }
 /**
  * Applies a procedure to each cell's coordinate.
@@ -848,13 +848,13 @@
  * @return <tt>false</tt> if the procedure stopped before all elements where iterated over, <tt>true</tt> otherwise. 
  */
 private boolean xforEachCoordinate(final org.apache.mahout.matrix.function.IntIntIntProcedure procedure) {
-	for (int column=columns; --column >= 0;) {
-		for (int slice=slices; --slice >=0;) {
-			for (int row=rows; --row >= 0;) {
-				if (!procedure.apply(slice,row,column)) return false;
-			}
-		}
-	}
-	return true;
+  for (int column=columns; --column >= 0;) {
+    for (int slice=slices; --slice >=0;) {
+      for (int row=rows; --row >= 0;) {
+        if (!procedure.apply(slice,row,column)) return false;
+      }
+    }
+  }
+  return true;
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/ObjectFactory1D.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/ObjectFactory1D.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/ObjectFactory1D.java	(working copy)
@@ -35,15 +35,15 @@
  */
 @Deprecated
 public class ObjectFactory1D extends org.apache.mahout.matrix.PersistentObject {
-	/**
-	 * A factory producing dense matrices.
-	 */
-	public static final ObjectFactory1D dense  = new ObjectFactory1D();
+  /**
+   * A factory producing dense matrices.
+   */
+  public static final ObjectFactory1D dense  = new ObjectFactory1D();
 
-	/**
-	 * A factory producing sparse matrices.
-	 */
-	public static final ObjectFactory1D sparse = new ObjectFactory1D();
+  /**
+   * A factory producing sparse matrices.
+   */
+  public static final ObjectFactory1D sparse = new ObjectFactory1D();
 /**
  * Makes this class non instantiable, but still let's others inherit from it.
  */
@@ -53,30 +53,30 @@
 Example: <tt>0 1</tt> append <tt>3 4</tt> --> <tt>0 1 3 4</tt>.
 */
 public ObjectMatrix1D append(ObjectMatrix1D A, ObjectMatrix1D B) {
-	// concatenate
-	ObjectMatrix1D matrix = make(A.size()+B.size());
-	matrix.viewPart(0,A.size()).assign(A);
-	matrix.viewPart(A.size(),B.size()).assign(B);
-	return matrix;
+  // concatenate
+  ObjectMatrix1D matrix = make(A.size()+B.size());
+  matrix.viewPart(0,A.size()).assign(A);
+  matrix.viewPart(A.size(),B.size()).assign(B);
+  return matrix;
 }
 /**
 Constructs a matrix which is the concatenation of all given parts.
 Cells are copied.
 */
 public ObjectMatrix1D make(ObjectMatrix1D[] parts) {
-	if (parts.length==0) return make(0);
-	
-	int size = 0;
-	for (int i=0; i < parts.length; i++) size += parts[i].size();
+  if (parts.length==0) return make(0);
+  
+  int size = 0;
+  for (int i=0; i < parts.length; i++) size += parts[i].size();
 
-	ObjectMatrix1D vector = make(size);
-	size = 0;
-	for (int i=0; i < parts.length; i++) {
-		vector.viewPart(size,parts[i].size()).assign(parts[i]);
-		size += parts[i].size();
-	}
+  ObjectMatrix1D vector = make(size);
+  size = 0;
+  for (int i=0; i < parts.length; i++) {
+    vector.viewPart(size,parts[i].size()).assign(parts[i]);
+    size += parts[i].size();
+  }
 
-	return vector;
+  return vector;
 }
 /**
  * Constructs a matrix with the given cell values.
@@ -85,21 +85,21 @@
  * @param values The values to be filled into the new matrix.
  */
 public ObjectMatrix1D make(Object[] values) {
-	if (this==sparse) return new SparseObjectMatrix1D(values);
-	else return new DenseObjectMatrix1D(values);
+  if (this==sparse) return new SparseObjectMatrix1D(values);
+  else return new DenseObjectMatrix1D(values);
 }
 /**
  * Constructs a matrix with the given shape, each cell initialized with zero.
  */
 public ObjectMatrix1D make(int size) {
-	if (this==sparse) return new SparseObjectMatrix1D(size);
-	return new DenseObjectMatrix1D(size);
+  if (this==sparse) return new SparseObjectMatrix1D(size);
+  return new DenseObjectMatrix1D(size);
 }
 /**
  * Constructs a matrix with the given shape, each cell initialized with the given value.
  */
 public ObjectMatrix1D make(int size, Object initialValue) {
-	return make(size).assign(initialValue);
+  return make(size).assign(initialValue);
 }
 /**
  * Constructs a matrix from the values of the given list.
@@ -109,10 +109,10 @@
  * @return a new matrix.
  */
 public ObjectMatrix1D make(org.apache.mahout.matrix.list.ObjectArrayList values) {
-	int size = values.size();
-	ObjectMatrix1D vector = make(size);
-	for (int i=size; --i >= 0; ) vector.set(i, values.get(i));
-	return vector;
+  int size = values.size();
+  ObjectMatrix1D vector = make(size);
+  for (int i=size; --i >= 0; ) vector.set(i, values.get(i));
+  return vector;
 }
 /**
 C = A||A||..||A; Constructs a new matrix which is concatenated <tt>repeat</tt> times.
@@ -124,12 +124,12 @@
 </pre>
 */
 public ObjectMatrix1D repeat(ObjectMatrix1D A, int repeat) {
-	int size = A.size();
-	ObjectMatrix1D matrix = make(repeat * size);
-	for (int i=repeat; --i >= 0; ) {
-		matrix.viewPart(size*i,size).assign(A);
-	}
-	return matrix;
+  int size = A.size();
+  ObjectMatrix1D matrix = make(repeat * size);
+  for (int i=repeat; --i >= 0; ) {
+    matrix.viewPart(size*i,size).assign(A);
+  }
+  return matrix;
 }
 /**
  * Constructs a list from the given matrix.
@@ -139,10 +139,10 @@
  * @return a new list.
  */
 public org.apache.mahout.matrix.list.ObjectArrayList toList(ObjectMatrix1D values) {
-	int size = values.size();
-	org.apache.mahout.matrix.list.ObjectArrayList list = new org.apache.mahout.matrix.list.ObjectArrayList(size);
-	list.setSize(size);
-	for (int i=size; --i >= 0; ) list.set(i, values.get(i));
-	return list;
+  int size = values.size();
+  org.apache.mahout.matrix.list.ObjectArrayList list = new org.apache.mahout.matrix.list.ObjectArrayList(size);
+  list.setSize(size);
+  for (int i=size; --i >= 0; ) list.set(i, values.get(i));
+  return list;
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/DoubleMatrix1D.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/DoubleMatrix1D.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/DoubleMatrix1D.java	(working copy)
@@ -53,12 +53,12 @@
 @see org.apache.mahout.jet.math.Functions
 */
 public double aggregate(org.apache.mahout.matrix.function.DoubleDoubleFunction aggr, org.apache.mahout.matrix.function.DoubleFunction f) {
-	if (size==0) return Double.NaN;
-	double a = f.apply(getQuick(size-1));
-	for (int i=size-1; --i >= 0; ) {
-		a = aggr.apply(a, f.apply(getQuick(i)));
-	}
-	return a;
+  if (size==0) return Double.NaN;
+  double a = f.apply(getQuick(size-1));
+  for (int i=size-1; --i >= 0; ) {
+    a = aggr.apply(a, f.apply(getQuick(i)));
+  }
+  return a;
 }
 /**
 Applies a function to each corresponding cell of two matrices and aggregates the results.
@@ -83,17 +83,17 @@
 @param aggr an aggregation function taking as first argument the current aggregation and as second argument the transformed current cell values.
 @param f a function transforming the current cell values.
 @return the aggregated measure.
-@throws	IllegalArgumentException if <tt>size() != other.size()</tt>.
+@throws  IllegalArgumentException if <tt>size() != other.size()</tt>.
 @see org.apache.mahout.jet.math.Functions
 */
 public double aggregate(DoubleMatrix1D other, org.apache.mahout.matrix.function.DoubleDoubleFunction aggr, org.apache.mahout.matrix.function.DoubleDoubleFunction f) {
-	checkSize(other);
-	if (size==0) return Double.NaN;
-	double a = f.apply(getQuick(size-1),other.getQuick(size-1));
-	for (int i=size-1; --i >= 0; ) {
-		a = aggr.apply(a, f.apply(getQuick(i),other.getQuick(i)));
-	}
-	return a;
+  checkSize(other);
+  if (size==0) return Double.NaN;
+  double a = f.apply(getQuick(size-1),other.getQuick(size-1));
+  for (int i=size-1; --i >= 0; ) {
+    a = aggr.apply(a, f.apply(getQuick(i),other.getQuick(i)));
+  }
+  return a;
 }
 /**
  * Sets all cells to the state specified by <tt>values</tt>.
@@ -106,11 +106,11 @@
  * @throws IllegalArgumentException if <tt>values.length != size()</tt>.
  */
 public DoubleMatrix1D assign(double[] values) {
-	if (values.length != size) throw new IllegalArgumentException("Must have same number of cells: length="+values.length+"size()="+size());
-	for (int i=size; --i >= 0;) {
-		setQuick(i,values[i]);
-	}
-	return this;
+  if (values.length != size) throw new IllegalArgumentException("Must have same number of cells: length="+values.length+"size()="+size());
+  for (int i=size; --i >= 0;) {
+    setQuick(i,values[i]);
+  }
+  return this;
 }
 /**
  * Sets all cells to the state specified by <tt>value</tt>.
@@ -118,10 +118,10 @@
  * @return <tt>this</tt> (for convenience only).
  */
 public DoubleMatrix1D assign(double value) {
-	for (int i=size; --i >= 0;) {
-		setQuick(i,value);
-	}
-	return this;
+  for (int i=size; --i >= 0;) {
+    setQuick(i,value);
+  }
+  return this;
 }
 /**
 Assigns the result of a function to each cell; <tt>x[i] = function(x[i])</tt>.
@@ -142,10 +142,10 @@
 @see org.apache.mahout.jet.math.Functions
 */
 public DoubleMatrix1D assign(org.apache.mahout.matrix.function.DoubleFunction function) {
-	for (int i=size; --i >= 0; ) {
-		setQuick(i, function.apply(getQuick(i)));
-	}
-	return this;
+  for (int i=size; --i >= 0; ) {
+    setQuick(i, function.apply(getQuick(i)));
+  }
+  return this;
 }
 /**
  * Replaces all cell values of the receiver with the values of another matrix.
@@ -154,17 +154,17 @@
  *
  * @param     other   the source matrix to copy from (may be identical to the receiver).
  * @return <tt>this</tt> (for convenience only).
- * @throws	IllegalArgumentException if <tt>size() != other.size()</tt>.
+ * @throws  IllegalArgumentException if <tt>size() != other.size()</tt>.
  */
 public DoubleMatrix1D assign(DoubleMatrix1D other) {
-	if (other==this) return this;
-	checkSize(other);
-	if (haveSharedCells(other)) other = other.copy();
-	
-	for (int i=size; --i >= 0;) {
-		setQuick(i,other.getQuick(i));
-	}
-	return this;
+  if (other==this) return this;
+  checkSize(other);
+  if (haveSharedCells(other)) other = other.copy();
+  
+  for (int i=size; --i >= 0;) {
+    setQuick(i,other.getQuick(i));
+  }
+  return this;
 }
 /**
 Assigns the result of a function to each cell; <tt>x[i] = function(x[i],y[i])</tt>.
@@ -184,15 +184,15 @@
 @param function a function object taking as first argument the current cell's value of <tt>this</tt>,
 and as second argument the current cell's value of <tt>y</tt>,
 @return <tt>this</tt> (for convenience only).
-@throws	IllegalArgumentException if <tt>size() != y.size()</tt>.
+@throws  IllegalArgumentException if <tt>size() != y.size()</tt>.
 @see org.apache.mahout.jet.math.Functions
 */
 public DoubleMatrix1D assign(DoubleMatrix1D y, org.apache.mahout.matrix.function.DoubleDoubleFunction function) {
-	checkSize(y);
-	for (int i=size; --i >= 0; ) {
-		setQuick(i, function.apply(getQuick(i), y.getQuick(i)));
-	}
-	return this;
+  checkSize(y);
+  for (int i=size; --i >= 0; ) {
+    setQuick(i, function.apply(getQuick(i), y.getQuick(i)));
+  }
+  return this;
 }
 /**
 Assigns the result of a function to each cell; <tt>x[i] = function(x[i],y[i])</tt>.
@@ -220,72 +220,72 @@
 @param function a function object taking as first argument the current cell's value of <tt>this</tt>,
 and as second argument the current cell's value of <tt>y</tt>,
 @return <tt>this</tt> (for convenience only).
-@throws	IllegalArgumentException if <tt>size() != y.size()</tt>.
+@throws  IllegalArgumentException if <tt>size() != y.size()</tt>.
 @see org.apache.mahout.jet.math.Functions
 */
 public DoubleMatrix1D assign(DoubleMatrix1D y, org.apache.mahout.matrix.function.DoubleDoubleFunction function, org.apache.mahout.matrix.list.IntArrayList nonZeroIndexes) {
-	checkSize(y);
-	int[] nonZeroElements = nonZeroIndexes.elements();
+  checkSize(y);
+  int[] nonZeroElements = nonZeroIndexes.elements();
 
-	// specialized for speed
-	if (function== org.apache.mahout.jet.math.Functions.mult) {  // x[i] = x[i] * y[i]
-	    int j = 0;
-		for (int index=nonZeroIndexes.size(); --index >= 0; ) {
-			int i = nonZeroElements[index];
-			for (; j<i; j++) setQuick(j,0); // x[i] = 0 for all zeros
-			setQuick(i, getQuick(i) * y.getQuick(i));  // x[i] * y[i] for all nonZeros
-			j++;
-		}
-	}
-	else if (function instanceof org.apache.mahout.jet.math.PlusMult) {
-		double multiplicator = ((org.apache.mahout.jet.math.PlusMult) function).multiplicator;
-		if (multiplicator == 0) { // x[i] = x[i] + 0*y[i]
-			return this;
-		}
-		else if (multiplicator == 1) { // x[i] = x[i] + y[i]
-			for (int index=nonZeroIndexes.size(); --index >= 0; ) {
-				int i = nonZeroElements[index];
-				setQuick(i, getQuick(i) + y.getQuick(i));
-			}
-		}
-		else if (multiplicator == -1) { // x[i] = x[i] - y[i]
-			for (int index=nonZeroIndexes.size(); --index >= 0; ) {
-				int i = nonZeroElements[index];
-				setQuick(i, getQuick(i) - y.getQuick(i));
-			}
-		}
-		else { // the general case x[i] = x[i] + mult*y[i]
-			for (int index=nonZeroIndexes.size(); --index >= 0; ) {
-				int i = nonZeroElements[index];
-				setQuick(i, getQuick(i) + multiplicator*y.getQuick(i));
-			}
-		}
-	}
-	else { // the general case x[i] = f(x[i],y[i])
-		return assign(y,function);
-	}
-	return this;
+  // specialized for speed
+  if (function== org.apache.mahout.jet.math.Functions.mult) {  // x[i] = x[i] * y[i]
+      int j = 0;
+    for (int index=nonZeroIndexes.size(); --index >= 0; ) {
+      int i = nonZeroElements[index];
+      for (; j<i; j++) setQuick(j,0); // x[i] = 0 for all zeros
+      setQuick(i, getQuick(i) * y.getQuick(i));  // x[i] * y[i] for all nonZeros
+      j++;
+    }
+  }
+  else if (function instanceof org.apache.mahout.jet.math.PlusMult) {
+    double multiplicator = ((org.apache.mahout.jet.math.PlusMult) function).multiplicator;
+    if (multiplicator == 0) { // x[i] = x[i] + 0*y[i]
+      return this;
+    }
+    else if (multiplicator == 1) { // x[i] = x[i] + y[i]
+      for (int index=nonZeroIndexes.size(); --index >= 0; ) {
+        int i = nonZeroElements[index];
+        setQuick(i, getQuick(i) + y.getQuick(i));
+      }
+    }
+    else if (multiplicator == -1) { // x[i] = x[i] - y[i]
+      for (int index=nonZeroIndexes.size(); --index >= 0; ) {
+        int i = nonZeroElements[index];
+        setQuick(i, getQuick(i) - y.getQuick(i));
+      }
+    }
+    else { // the general case x[i] = x[i] + mult*y[i]
+      for (int index=nonZeroIndexes.size(); --index >= 0; ) {
+        int i = nonZeroElements[index];
+        setQuick(i, getQuick(i) + multiplicator*y.getQuick(i));
+      }
+    }
+  }
+  else { // the general case x[i] = f(x[i],y[i])
+    return assign(y,function);
+  }
+  return this;
 }
 /**
  * Returns the number of cells having non-zero values; ignores tolerance.
  */
 public int cardinality() {
-	int cardinality = 0;
-	for (int i=size; --i >= 0;) {
-		if (getQuick(i) != 0) cardinality++;
-	}
-	return cardinality;
+  int cardinality = 0;
+  for (int i=size; --i >= 0;) {
+    if (getQuick(i) != 0) cardinality++;
+  }
+  return cardinality;
 }
 /**
  * Returns the number of cells having non-zero values, but at most maxCardinality; ignores tolerance.
  */
 protected int cardinality(int maxCardinality) {
-	int cardinality = 0;
-	int i=size; 
-	while (--i >= 0 && cardinality < maxCardinality) {
-		if (getQuick(i) != 0) cardinality++;
-	}
-	return cardinality;
+  int cardinality = 0;
+  int i=size; 
+  while (--i >= 0 && cardinality < maxCardinality) {
+    if (getQuick(i) != 0) cardinality++;
+  }
+  return cardinality;
 }
 /**
  * Constructs and returns a deep copy of the receiver.
@@ -296,9 +296,9 @@
  * @return  a deep copy of the receiver.
  */
 public DoubleMatrix1D copy() {
-	DoubleMatrix1D copy = like();
-	copy.assign(this);
-	return copy;
+  DoubleMatrix1D copy = like();
+  copy.assign(this);
+  return copy;
 }
 /**
  * Returns whether all cells are equal to the given value.
@@ -307,7 +307,7 @@
  * @return    <tt>true</tt> if all cells are equal to the given value, <tt>false</tt> otherwise.
  */
 public boolean equals(double value) {
-	return org.apache.mahout.matrix.matrix.linalg.Property.DEFAULT.equals(this,value);
+  return org.apache.mahout.matrix.matrix.linalg.Property.DEFAULT.equals(this,value);
 }
 /**
  * Compares this object against the specified object.
@@ -320,29 +320,29 @@
  *          <code>false</code> otherwise.
  */
 public boolean equals(Object obj) {
-	if (this == obj) return true;
-	if (obj == null) return false;
-	if (!(obj instanceof DoubleMatrix1D)) return false;
+  if (this == obj) return true;
+  if (obj == null) return false;
+  if (!(obj instanceof DoubleMatrix1D)) return false;
 
-	return org.apache.mahout.matrix.matrix.linalg.Property.DEFAULT.equals(this,(DoubleMatrix1D) obj);
+  return org.apache.mahout.matrix.matrix.linalg.Property.DEFAULT.equals(this,(DoubleMatrix1D) obj);
 }
 /**
  * Returns the matrix cell value at coordinate <tt>index</tt>.
  *
  * @param     index   the index of the cell.
  * @return    the value of the specified cell.
- * @throws	IndexOutOfBoundsException if <tt>index&lt;0 || index&gt;=size()</tt>.
+ * @throws  IndexOutOfBoundsException if <tt>index&lt;0 || index&gt;=size()</tt>.
  */
 public double get(int index) {
-	if (index<0 || index>=size) checkIndex(index);
-	return getQuick(index);
+  if (index<0 || index>=size) checkIndex(index);
+  return getQuick(index);
 }
 /**
  * Returns the content of this matrix if it is a wrapper; or <tt>this</tt> otherwise.
  * Override this method in wrappers.
  */
 protected DoubleMatrix1D getContent() {
-	return this;
+  return this;
 }
 /**
 Fills the coordinates and values of cells having non-zero values into the specified lists.
@@ -368,18 +368,18 @@
 @param valueList the list to be filled with values, can have any size.
 */
 public void getNonZeros(IntArrayList indexList, DoubleArrayList valueList) {
-	boolean fillIndexList = indexList != null;
-	boolean fillValueList = valueList != null;
-	if (fillIndexList) indexList.clear(); 
-	if (fillValueList) valueList.clear();
-	int s = size;
-	for (int i=0; i < s; i++) {
-		double value = getQuick(i);
-		if (value != 0) {
-			if (fillIndexList) indexList.add(i);
-			if (fillValueList) valueList.add(value);
-		}
-	}
+  boolean fillIndexList = indexList != null;
+  boolean fillValueList = valueList != null;
+  if (fillIndexList) indexList.clear(); 
+  if (fillValueList) valueList.clear();
+  int s = size;
+  for (int i=0; i < s; i++) {
+    double value = getQuick(i);
+    if (value != 0) {
+      if (fillIndexList) indexList.add(i);
+      if (fillValueList) valueList.add(value);
+    }
+  }
 }
 /**
 Fills the coordinates and values of cells having non-zero values into the specified lists.
@@ -405,23 +405,23 @@
 @param valueList the list to be filled with values, can have any size.
 */
 public void getNonZeros(IntArrayList indexList, DoubleArrayList valueList, int maxCardinality) {
-	boolean fillIndexList = indexList != null;
-	boolean fillValueList = valueList != null;
-	int card = cardinality(maxCardinality);
-	if (fillIndexList) indexList.setSize(card);
-	if (fillValueList) valueList.setSize(card);
-	if (!(card<maxCardinality)) return;
+  boolean fillIndexList = indexList != null;
+  boolean fillValueList = valueList != null;
+  int card = cardinality(maxCardinality);
+  if (fillIndexList) indexList.setSize(card);
+  if (fillValueList) valueList.setSize(card);
+  if (!(card<maxCardinality)) return;
 
-	if (fillIndexList) indexList.setSize(0);
-	if (fillValueList) valueList.setSize(0);
-	int s = size;
-	for (int i=0; i < s; i++) {
-		double value = getQuick(i);
-		if (value != 0) {
-			if (fillIndexList) indexList.add(i);
-			if (fillValueList) valueList.add(value);
-		}
-	}
+  if (fillIndexList) indexList.setSize(0);
+  if (fillValueList) valueList.setSize(0);
+  int s = size;
+  for (int i=0; i < s; i++) {
+    double value = getQuick(i);
+    if (value != 0) {
+      if (fillIndexList) indexList.add(i);
+      if (fillValueList) valueList.add(value);
+    }
+  }
 }
 /**
  * Returns the matrix cell value at coordinate <tt>index</tt>.
@@ -438,16 +438,16 @@
  * Returns <tt>true</tt> if both matrices share at least one identical cell.
  */
 protected boolean haveSharedCells(DoubleMatrix1D other) {
-	if (other==null) return false;
-	if (this==other) return true;
-	return getContent().haveSharedCellsRaw(other.getContent());
-}	
+  if (other==null) return false;
+  if (this==other) return true;
+  return getContent().haveSharedCellsRaw(other.getContent());
+}  
 /**
  * Returns <tt>true</tt> if both matrices share at least one identical cell.
  */
 protected boolean haveSharedCellsRaw(DoubleMatrix1D other) {
-	return false;
-}	
+  return false;
+}  
 /**
  * Construct and returns a new empty matrix <i>of the same dynamic type</i> as the receiver, having the same size.
  * For example, if the receiver is an instance of type <tt>DenseDoubleMatrix1D</tt> the new matrix must also be of type <tt>DenseDoubleMatrix1D</tt>,
@@ -457,7 +457,7 @@
  * @return  a new empty matrix of the same dynamic type.
  */
 public DoubleMatrix1D like() {
-	return like(size);
+  return like(size);
 }
 /**
  * Construct and returns a new empty matrix <i>of the same dynamic type</i> as the receiver, having the specified size.
@@ -484,11 +484,11 @@
  *
  * @param     index   the index of the cell.
  * @param    value the value to be filled into the specified cell.
- * @throws	IndexOutOfBoundsException if <tt>index&lt;0 || index&gt;=size()</tt>.
+ * @throws  IndexOutOfBoundsException if <tt>index&lt;0 || index&gt;=size()</tt>.
  */
 public void set(int index, double value) {
-	if (index<0 || index>=size) checkIndex(index);
-	setQuick(index,value);
+  if (index<0 || index>=size) checkIndex(index);
+  setQuick(index,value);
 }
 /**
  * Sets the matrix cell at coordinate <tt>index</tt> to the specified value.
@@ -506,13 +506,13 @@
 @throws IllegalArgumentException if <tt>size() != other.size()</tt>.
 */
 public void swap(DoubleMatrix1D other) {
-	checkSize(other);
-	for (int i=size; --i >= 0; ) {
-		double tmp = getQuick(i);
-		setQuick(i, other.getQuick(i));
-		other.setQuick(i, tmp);
-	}
-	return;
+  checkSize(other);
+  for (int i=size; --i >= 0; ) {
+    double tmp = getQuick(i);
+    setQuick(i, other.getQuick(i));
+    other.setQuick(i, tmp);
+  }
+  return;
 }
 /**
 Constructs and returns a 1-dimensional array containing the cell values.
@@ -524,9 +524,9 @@
 @return an array filled with the values of the cells.
 */
 public double[] toArray() {
-	double[] values = new double[size];
-	toArray(values);
-	return values;
+  double[] values = new double[size];
+  toArray(values);
+  return values;
 }
 /**
 Fills the cell values into the specified 1-dimensional array.
@@ -538,17 +538,17 @@
 @throws IllegalArgumentException if <tt>values.length < size()</tt>.
 */
 public void toArray(double[] values) {
-	if (values.length < size) throw new IllegalArgumentException("values too small");
-	for (int i=size; --i >= 0; ) {
-		values[i] = getQuick(i);
-	}
+  if (values.length < size) throw new IllegalArgumentException("values too small");
+  for (int i=size; --i >= 0; ) {
+    values[i] = getQuick(i);
+  }
 }
 /**
  * Returns a string representation using default formatting.
  * @see org.apache.mahout.matrix.matrix.doublealgo.Formatter
  */
 public String toString() {
-	return new org.apache.mahout.matrix.matrix.doublealgo.Formatter().toString(this);
+  return new org.apache.mahout.matrix.matrix.doublealgo.Formatter().toString(this);
 }
 /**
  * Constructs and returns a new view equal to the receiver.
@@ -562,7 +562,7 @@
  * @return  a new view of the receiver.
  */
 protected DoubleMatrix1D view() {
-	return (DoubleMatrix1D) clone();
+  return (DoubleMatrix1D) clone();
 }
 /**
 Constructs and returns a new <i>flip view</i>.
@@ -572,7 +572,7 @@
 @return a new flip view.
 */
 public DoubleMatrix1D viewFlip() {
-	return (DoubleMatrix1D) (view().vFlip());
+  return (DoubleMatrix1D) (view().vFlip());
 }
 /**
 Constructs and returns a new <i>sub-range view</i> that is a <tt>width</tt> sub matrix starting at <tt>index</tt>.
@@ -591,12 +591,12 @@
 
 @param     index   The index of the first cell.
 @param     width   The width of the range.
-@throws	IndexOutOfBoundsException if <tt>index<0 || width<0 || index+width>size()</tt>.
+@throws  IndexOutOfBoundsException if <tt>index<0 || width<0 || index+width>size()</tt>.
 @return the new view.
-		
+    
 */
 public DoubleMatrix1D viewPart(int index, int width) {
-	return (DoubleMatrix1D) (view().vPart(index,width));
+  return (DoubleMatrix1D) (view().vPart(index,width));
 }
 /**
 Constructs and returns a new <i>selection view</i> that is a matrix holding the indicated cells.
@@ -619,18 +619,18 @@
 @throws IndexOutOfBoundsException if <tt>!(0 <= indexes[i] < size())</tt> for any <tt>i=0..indexes.length()-1</tt>.
 */
 public DoubleMatrix1D viewSelection(int[] indexes) {
-	// check for "all"
-	if (indexes==null) {
-		indexes = new int[size];
-		for (int i=size; --i >= 0; ) indexes[i] = i;
-	}
-	
-	checkIndexes(indexes);
-	int[] offsets = new int[indexes.length];
-	for (int i=indexes.length; --i >= 0; ) {
-		offsets[i] = index(indexes[i]);
-	}
-	return viewSelectionLike(offsets);
+  // check for "all"
+  if (indexes==null) {
+    indexes = new int[size];
+    for (int i=size; --i >= 0; ) indexes[i] = i;
+  }
+  
+  checkIndexes(indexes);
+  int[] offsets = new int[indexes.length];
+  for (int i=indexes.length; --i >= 0; ) {
+    offsets[i] = index(indexes[i]);
+  }
+  return viewSelectionLike(offsets);
 }
 /**
 Constructs and returns a new <i>selection view</i> that is a matrix holding the cells matching the given condition.
@@ -656,12 +656,12 @@
 @return the new view.
 */
 public DoubleMatrix1D viewSelection(org.apache.mahout.matrix.function.DoubleProcedure condition) {
-	IntArrayList matches = new IntArrayList();
-	for (int i=0; i < size; i++) {
-		if (condition.apply(getQuick(i))) matches.add(i);
-	}
-	matches.trimToSize();
-	return viewSelection(matches.elements());
+  IntArrayList matches = new IntArrayList();
+  for (int i=0; i < size; i++) {
+    if (condition.apply(getQuick(i))) matches.add(i);
+  }
+  matches.trimToSize();
+  return viewSelection(matches.elements());
 }
 /**
  * Construct and returns a new selection view.
@@ -678,19 +678,19 @@
 @return a new sorted vector (matrix) view.
 */
 public DoubleMatrix1D viewSorted() {
-	return org.apache.mahout.matrix.matrix.doublealgo.Sorting.mergeSort.sort(this);
+  return org.apache.mahout.matrix.matrix.doublealgo.Sorting.mergeSort.sort(this);
 }
 /**
 Constructs and returns a new <i>stride view</i> which is a sub matrix consisting of every i-th cell.
 More specifically, the view has size <tt>this.size()/stride</tt> holding cells <tt>this.get(i*stride)</tt> for all <tt>i = 0..size()/stride - 1</tt>.
 
 @param  stride  the step factor.
-@throws	IndexOutOfBoundsException if <tt>stride <= 0</tt>.
+@throws  IndexOutOfBoundsException if <tt>stride <= 0</tt>.
 @return the new view.
-		
+    
 */
 public DoubleMatrix1D viewStrides(int stride) {
-	return (DoubleMatrix1D) (view().vStrides(stride));
+  return (DoubleMatrix1D) (view().vStrides(stride));
 }
 /**
  * Applies a procedure to each cell's value.
@@ -708,10 +708,10 @@
  * @return <tt>false</tt> if the procedure stopped before all elements where iterated over, <tt>true</tt> otherwise. 
  */
 private boolean xforEach(final org.apache.mahout.matrix.function.DoubleProcedure procedure) {
-	for (int i=size; --i >= 0;) {
-		if (!procedure.apply(getQuick(i))) return false;
-	}
-	return true;
+  for (int i=size; --i >= 0;) {
+    if (!procedure.apply(getQuick(i))) return false;
+  }
+  return true;
 }
 /**
  * Returns the dot product of two vectors x and y, which is <tt>Sum(x[i]*y[i])</tt>.
@@ -721,7 +721,7 @@
  * @return the sum of products.
  */
 public double zDotProduct(DoubleMatrix1D y) {
-	return zDotProduct(y,0,size);
+  return zDotProduct(y,0,size);
 }
 /**
  * Returns the dot product of two vectors x and y, which is <tt>Sum(x[i]*y[i])</tt>.
@@ -733,19 +733,19 @@
  * @return the sum of products; zero if <tt>from<0 || length<0</tt>.
  */
 public double zDotProduct(DoubleMatrix1D y, int from, int length) {
-	if (from<0 || length<=0) return 0;
-	
-	int tail = from+length;
-	if (size < tail) tail = size;
-	if (y.size < tail) tail = y.size;
-	length = tail-from;
-	
-	double sum = 0;
-	int i = tail-1;
-	for (int k=length; --k >= 0; i--) {
-		sum += getQuick(i) * y.getQuick(i);
-	}
-	return sum;
+  if (from<0 || length<=0) return 0;
+  
+  int tail = from+length;
+  if (size < tail) tail = size;
+  if (y.size < tail) tail = y.size;
+  length = tail-from;
+  
+  double sum = 0;
+  int i = tail-1;
+  for (int k=length; --k >= 0; i--) {
+    sum += getQuick(i) * y.getQuick(i);
+  }
+  return sum;
 }
 /**
  * Returns the dot product of two vectors x and y, which is <tt>Sum(x[i]*y[i])</tt>.
@@ -755,32 +755,32 @@
  * @return the sum of products.
  */
 public double zDotProduct(DoubleMatrix1D y, int from, int length, IntArrayList nonZeroIndexes) {
-	// determine minimum length
-	if (from<0 || length<=0) return 0;
-	
-	int tail = from+length;
-	if (size < tail) tail = size;
-	if (y.size < tail) tail = y.size;
-	length = tail-from;
-	if (length<=0) return 0;
+  // determine minimum length
+  if (from<0 || length<=0) return 0;
+  
+  int tail = from+length;
+  if (size < tail) tail = size;
+  if (y.size < tail) tail = y.size;
+  length = tail-from;
+  if (length<=0) return 0;
 
-	// setup
-	int[] nonZeroIndexElements = nonZeroIndexes.elements();
-	int index = 0;
-	int s = nonZeroIndexes.size();
-	
-	// skip to start	
-	while ((index < s) && nonZeroIndexElements[index]<from) index++; 
+  // setup
+  int[] nonZeroIndexElements = nonZeroIndexes.elements();
+  int index = 0;
+  int s = nonZeroIndexes.size();
+  
+  // skip to start  
+  while ((index < s) && nonZeroIndexElements[index]<from) index++; 
 
-	// now the sparse dot product
-	int i;
-	double sum = 0;
-	while ((--length >= 0) && (index < s) && ((i=nonZeroIndexElements[index]) < tail)) {
-		sum += getQuick(i) * y.getQuick(i);
-		index++;
-	}
-	
-	return sum;
+  // now the sparse dot product
+  int i;
+  double sum = 0;
+  while ((--length >= 0) && (index < s) && ((i=nonZeroIndexElements[index]) < tail)) {
+    sum += getQuick(i) * y.getQuick(i);
+    index++;
+  }
+  
+  return sum;
 }
 /**
  * Returns the dot product of two vectors x and y, which is <tt>Sum(x[i]*y[i])</tt>.
@@ -790,23 +790,23 @@
  * @return the sum of products.
  */
 protected double zDotProduct(DoubleMatrix1D y, IntArrayList nonZeroIndexes) {
-	return zDotProduct(y,0,size,nonZeroIndexes);
-	/*
-	double sum = 0;
-	int[] nonZeroIndexElements = nonZeroIndexes.elements();
-	for (int index=nonZeroIndexes.size(); --index >= 0; ) {
-		int i = nonZeroIndexElements[index];
-		sum += getQuick(i) * y.getQuick(i);
-	}
-	return sum;
-	*/
+  return zDotProduct(y,0,size,nonZeroIndexes);
+  /*
+  double sum = 0;
+  int[] nonZeroIndexElements = nonZeroIndexes.elements();
+  for (int index=nonZeroIndexes.size(); --index >= 0; ) {
+    int i = nonZeroIndexElements[index];
+    sum += getQuick(i) * y.getQuick(i);
+  }
+  return sum;
+  */
 }
 /**
  * Returns the sum of all cells; <tt>Sum( x[i] )</tt>.
  * @return the sum.
  */
 public double zSum() {
-	if (size()==0) return 0;
-	return aggregate(org.apache.mahout.jet.math.Functions.plus, org.apache.mahout.jet.math.Functions.identity);
+  if (size()==0) return 0;
+  return aggregate(org.apache.mahout.jet.math.Functions.plus, org.apache.mahout.jet.math.Functions.identity);
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/ObjectFactory2D.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/ObjectFactory2D.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/ObjectFactory2D.java	(working copy)
@@ -17,31 +17,31 @@
 <p>&nbsp; </p>
 <table border="0" cellspacing="0">
   <tr align="left" valign="top"> 
-	<td><i>Construction</i></td>
-	<td>Use idioms like <tt>ObjectFactory2D.dense.make(4,4)</tt> to construct 
-	  dense matrices, <tt>ObjectFactory2D.sparse.make(4,4)</tt> to construct sparse 
-	  matrices.</td>
+  <td><i>Construction</i></td>
+  <td>Use idioms like <tt>ObjectFactory2D.dense.make(4,4)</tt> to construct 
+    dense matrices, <tt>ObjectFactory2D.sparse.make(4,4)</tt> to construct sparse 
+    matrices.</td>
   </tr>
   <tr align="left" valign="top"> 
-	<td><i> Construction with initial values </i></td>
-	<td>Use other <tt>make</tt> methods to construct matrices with given initial 
-	  values. </td>
+  <td><i> Construction with initial values </i></td>
+  <td>Use other <tt>make</tt> methods to construct matrices with given initial 
+    values. </td>
   </tr>
   <tr align="left" valign="top"> 
-	<td><i> Appending rows and columns </i></td>
-	<td>Use methods {@link #appendColumns(ObjectMatrix2D,ObjectMatrix2D) appendColumns}, 
-	  {@link #appendColumns(ObjectMatrix2D,ObjectMatrix2D) appendRows} and {@link 
-	  #repeat(ObjectMatrix2D,int,int) repeat} to append rows and columns. </td>
+  <td><i> Appending rows and columns </i></td>
+  <td>Use methods {@link #appendColumns(ObjectMatrix2D,ObjectMatrix2D) appendColumns}, 
+    {@link #appendColumns(ObjectMatrix2D,ObjectMatrix2D) appendRows} and {@link 
+    #repeat(ObjectMatrix2D,int,int) repeat} to append rows and columns. </td>
   </tr>
   <tr align="left" valign="top"> 
-	<td><i> General block matrices </i></td>
-	<td>Use methods {@link #compose(ObjectMatrix2D[][]) compose} and {@link #decompose(ObjectMatrix2D[][],ObjectMatrix2D) 
-	  decompose} to work with general block matrices. </td>
+  <td><i> General block matrices </i></td>
+  <td>Use methods {@link #compose(ObjectMatrix2D[][]) compose} and {@link #decompose(ObjectMatrix2D[][],ObjectMatrix2D) 
+    decompose} to work with general block matrices. </td>
   </tr>
   <tr align="left" valign="top"> 
-	<td><i> Diagonal block matrices </i></td>
-	<td>Use method {@link #composeDiagonal(ObjectMatrix2D,ObjectMatrix2D,ObjectMatrix2D) 
-	  composeDiagonal} to work with diagonal block matrices. </td>
+  <td><i> Diagonal block matrices </i></td>
+  <td>Use method {@link #composeDiagonal(ObjectMatrix2D,ObjectMatrix2D,ObjectMatrix2D) 
+    composeDiagonal} to work with diagonal block matrices. </td>
   </tr>
 </table>
 <p>&nbsp;</p>
@@ -49,7 +49,7 @@
   For example by aliasing: </p>
 <table>
   <td class="PRE"> 
-	<pre>
+  <pre>
 ObjectFactory2D F = ObjectFactory2D.dense;
 F.make(4,4);
 ...
@@ -65,15 +65,15 @@
  */
 @Deprecated
 public class ObjectFactory2D extends org.apache.mahout.matrix.PersistentObject {
-	/**
-	 * A factory producing dense matrices.
-	 */
-	public static final ObjectFactory2D dense  = new ObjectFactory2D();
+  /**
+   * A factory producing dense matrices.
+   */
+  public static final ObjectFactory2D dense  = new ObjectFactory2D();
 
-	/**
-	 * A factory producing sparse matrices.
-	 */
-	public static final ObjectFactory2D sparse = new ObjectFactory2D();
+  /**
+   * A factory producing sparse matrices.
+   */
+  public static final ObjectFactory2D sparse = new ObjectFactory2D();
 /**
  * Makes this class non instantiable, but still let's others inherit from it.
  */
@@ -92,18 +92,18 @@
 </pre>
 */
 public ObjectMatrix2D appendColumns(ObjectMatrix2D A, ObjectMatrix2D B) {
-	// force both to have maximal shared number of rows.
-	if (B.rows() > A.rows()) B = B.viewPart(0,0,A.rows(),B.columns());
-	else if (B.rows() < A.rows()) A = A.viewPart(0,0,B.rows(),A.columns());
+  // force both to have maximal shared number of rows.
+  if (B.rows() > A.rows()) B = B.viewPart(0,0,A.rows(),B.columns());
+  else if (B.rows() < A.rows()) A = A.viewPart(0,0,B.rows(),A.columns());
 
-	// concatenate
-	int ac = A.columns();
-	int bc = B.columns();
-	int r = A.rows();
-	ObjectMatrix2D matrix = make(r,ac+bc);
-	matrix.viewPart(0,0,r,ac).assign(A);
-	matrix.viewPart(0,ac,r,bc).assign(B);
-	return matrix;
+  // concatenate
+  int ac = A.columns();
+  int bc = B.columns();
+  int r = A.rows();
+  ObjectMatrix2D matrix = make(r,ac+bc);
+  matrix.viewPart(0,0,r,ac).assign(A);
+  matrix.viewPart(0,ac,r,bc).assign(B);
+  return matrix;
 }
 /**
 C = A||B; Constructs a new matrix which is the row-wise concatenation of two other matrices.
@@ -123,44 +123,44 @@
 </pre>
 */
 public ObjectMatrix2D appendRows(ObjectMatrix2D A, ObjectMatrix2D B) {
-	// force both to have maximal shared number of columns.
-	if (B.columns() > A.columns()) B = B.viewPart(0,0,B.rows(),A.columns());
-	else if (B.columns() < A.columns()) A = A.viewPart(0,0,A.rows(),B.columns());
+  // force both to have maximal shared number of columns.
+  if (B.columns() > A.columns()) B = B.viewPart(0,0,B.rows(),A.columns());
+  else if (B.columns() < A.columns()) A = A.viewPart(0,0,A.rows(),B.columns());
 
-	// concatenate
-	int ar = A.rows();
-	int br = B.rows();
-	int c = A.columns();
-	ObjectMatrix2D matrix = make(ar+br, c);
-	matrix.viewPart(0,0,ar,c).assign(A);
-	matrix.viewPart(ar,0,br,c).assign(B);
-	return matrix;
+  // concatenate
+  int ar = A.rows();
+  int br = B.rows();
+  int c = A.columns();
+  ObjectMatrix2D matrix = make(ar+br, c);
+  matrix.viewPart(0,0,ar,c).assign(A);
+  matrix.viewPart(ar,0,br,c).assign(B);
+  return matrix;
 }
 /**
 Checks whether the given array is rectangular, that is, whether all rows have the same number of columns.
 @throws IllegalArgumentException if the array is not rectangular.
 */
 protected static void checkRectangularShape(ObjectMatrix2D[][] array) {
-	int columns = -1;
-	for (int row=array.length; --row >= 0; ) {
-		if (array[row] != null) {
-			if (columns == -1) columns = array[row].length;
-			if (array[row].length != columns) throw new IllegalArgumentException("All rows of array must have same number of columns.");
-		}
-	}
+  int columns = -1;
+  for (int row=array.length; --row >= 0; ) {
+    if (array[row] != null) {
+      if (columns == -1) columns = array[row].length;
+      if (array[row].length != columns) throw new IllegalArgumentException("All rows of array must have same number of columns.");
+    }
+  }
 }
 /**
 Checks whether the given array is rectangular, that is, whether all rows have the same number of columns.
 @throws IllegalArgumentException if the array is not rectangular.
 */
 protected static void checkRectangularShape(Object[][] array) {
-	int columns = -1;
-	for (int row=array.length; --row >= 0; ) {
-		if (array[row] != null) {
-			if (columns == -1) columns = array[row].length;
-			if (array[row].length != columns) throw new IllegalArgumentException("All rows of array must have same number of columns.");
-		}
-	}
+  int columns = -1;
+  for (int row=array.length; --row >= 0; ) {
+    if (array[row] != null) {
+      if (columns == -1) columns = array[row].length;
+      if (array[row].length != columns) throw new IllegalArgumentException("All rows of array must have same number of columns.");
+    }
+  }
 }
 /**
 Constructs a block matrix made from the given parts.
@@ -174,12 +174,12 @@
 Example:
 <table border="1" cellspacing="0">
   <tr align="left" valign="top"> 
-	<td><tt>Code</tt></td>
-	<td><tt>Result</tt></td>
+  <td><tt>Code</tt></td>
+  <td><tt>Result</tt></td>
   </tr>
   <tr align="left" valign="top"> 
-	<td> 
-	  <pre>
+  <td> 
+    <pre>
 ObjectMatrix2D[][] parts1 = 
 {
 &nbsp;&nbsp;&nbsp;{ null,        make(2,2,1), null        },
@@ -188,20 +188,20 @@
 };
 System.out.println(compose(parts1));
 </pre>
-	</td>
-	<td><tt>8&nbsp;x&nbsp;9&nbsp;matrix<br>
-	  0&nbsp;0&nbsp;0&nbsp;0&nbsp;1&nbsp;1&nbsp;0&nbsp;0&nbsp;0<br>
-	  0&nbsp;0&nbsp;0&nbsp;0&nbsp;1&nbsp;1&nbsp;0&nbsp;0&nbsp;0<br>
-	  2&nbsp;2&nbsp;2&nbsp;2&nbsp;0&nbsp;0&nbsp;3&nbsp;3&nbsp;3<br>
-	  2&nbsp;2&nbsp;2&nbsp;2&nbsp;0&nbsp;0&nbsp;3&nbsp;3&nbsp;3<br>
-	  2&nbsp;2&nbsp;2&nbsp;2&nbsp;0&nbsp;0&nbsp;3&nbsp;3&nbsp;3<br>
-	  2&nbsp;2&nbsp;2&nbsp;2&nbsp;0&nbsp;0&nbsp;3&nbsp;3&nbsp;3<br>
-	  0&nbsp;0&nbsp;0&nbsp;0&nbsp;4&nbsp;4&nbsp;0&nbsp;0&nbsp;0<br>
-	  0&nbsp;0&nbsp;0&nbsp;0&nbsp;4&nbsp;4&nbsp;0&nbsp;0&nbsp;0</tt></td>
+  </td>
+  <td><tt>8&nbsp;x&nbsp;9&nbsp;matrix<br>
+    0&nbsp;0&nbsp;0&nbsp;0&nbsp;1&nbsp;1&nbsp;0&nbsp;0&nbsp;0<br>
+    0&nbsp;0&nbsp;0&nbsp;0&nbsp;1&nbsp;1&nbsp;0&nbsp;0&nbsp;0<br>
+    2&nbsp;2&nbsp;2&nbsp;2&nbsp;0&nbsp;0&nbsp;3&nbsp;3&nbsp;3<br>
+    2&nbsp;2&nbsp;2&nbsp;2&nbsp;0&nbsp;0&nbsp;3&nbsp;3&nbsp;3<br>
+    2&nbsp;2&nbsp;2&nbsp;2&nbsp;0&nbsp;0&nbsp;3&nbsp;3&nbsp;3<br>
+    2&nbsp;2&nbsp;2&nbsp;2&nbsp;0&nbsp;0&nbsp;3&nbsp;3&nbsp;3<br>
+    0&nbsp;0&nbsp;0&nbsp;0&nbsp;4&nbsp;4&nbsp;0&nbsp;0&nbsp;0<br>
+    0&nbsp;0&nbsp;0&nbsp;0&nbsp;4&nbsp;4&nbsp;0&nbsp;0&nbsp;0</tt></td>
   </tr>
   <tr align="left" valign="top"> 
-	<td> 
-	  <pre>
+  <td> 
+    <pre>
 ObjectMatrix2D[][] parts3 = 
 {
 &nbsp;&nbsp;&nbsp;{ identity(3),               null,                        },
@@ -210,21 +210,21 @@
 };
 System.out.println("\n"+make(parts3));
 </pre>
-	</td>
-	<td><tt>9&nbsp;x&nbsp;6&nbsp;matrix<br>
-	  1&nbsp;0&nbsp;0&nbsp;0&nbsp;0&nbsp;0<br>
-	  0&nbsp;1&nbsp;0&nbsp;0&nbsp;0&nbsp;0<br>
-	  0&nbsp;0&nbsp;1&nbsp;0&nbsp;0&nbsp;0<br>
-	  0&nbsp;0&nbsp;0&nbsp;0&nbsp;0&nbsp;1<br>
-	  0&nbsp;0&nbsp;0&nbsp;0&nbsp;1&nbsp;0<br>
-	  0&nbsp;0&nbsp;0&nbsp;1&nbsp;0&nbsp;0<br>
-	  0&nbsp;0&nbsp;1&nbsp;0&nbsp;0&nbsp;0<br>
-	  0&nbsp;1&nbsp;0&nbsp;0&nbsp;0&nbsp;0<br>
-	  1&nbsp;0&nbsp;0&nbsp;0&nbsp;0&nbsp;0 </tt></td>
+  </td>
+  <td><tt>9&nbsp;x&nbsp;6&nbsp;matrix<br>
+    1&nbsp;0&nbsp;0&nbsp;0&nbsp;0&nbsp;0<br>
+    0&nbsp;1&nbsp;0&nbsp;0&nbsp;0&nbsp;0<br>
+    0&nbsp;0&nbsp;1&nbsp;0&nbsp;0&nbsp;0<br>
+    0&nbsp;0&nbsp;0&nbsp;0&nbsp;0&nbsp;1<br>
+    0&nbsp;0&nbsp;0&nbsp;0&nbsp;1&nbsp;0<br>
+    0&nbsp;0&nbsp;0&nbsp;1&nbsp;0&nbsp;0<br>
+    0&nbsp;0&nbsp;1&nbsp;0&nbsp;0&nbsp;0<br>
+    0&nbsp;1&nbsp;0&nbsp;0&nbsp;0&nbsp;0<br>
+    1&nbsp;0&nbsp;0&nbsp;0&nbsp;0&nbsp;0 </tt></td>
   </tr>
   <tr align="left" valign="top"> 
-	<td> 
-	  <pre>
+  <td> 
+    <pre>
 ObjectMatrix2D A = ascending(2,2);
 ObjectMatrix2D B = descending(2,2);
 ObjectMatrix2D _ = null;
@@ -236,16 +236,16 @@
 };
 System.out.println("\n"+make(parts4));
 </pre>
-	</td>
-	<td><tt>4&nbsp;x&nbsp;8&nbsp;matrix<br>
-	  1&nbsp;2&nbsp;0&nbsp;0&nbsp;1&nbsp;2&nbsp;0&nbsp;0<br>
-	  3&nbsp;4&nbsp;0&nbsp;0&nbsp;3&nbsp;4&nbsp;0&nbsp;0<br>
-	  0&nbsp;0&nbsp;1&nbsp;2&nbsp;0&nbsp;0&nbsp;3&nbsp;2<br>
-	  0&nbsp;0&nbsp;3&nbsp;4&nbsp;0&nbsp;0&nbsp;1&nbsp;0 </tt></td>
+  </td>
+  <td><tt>4&nbsp;x&nbsp;8&nbsp;matrix<br>
+    1&nbsp;2&nbsp;0&nbsp;0&nbsp;1&nbsp;2&nbsp;0&nbsp;0<br>
+    3&nbsp;4&nbsp;0&nbsp;0&nbsp;3&nbsp;4&nbsp;0&nbsp;0<br>
+    0&nbsp;0&nbsp;1&nbsp;2&nbsp;0&nbsp;0&nbsp;3&nbsp;2<br>
+    0&nbsp;0&nbsp;3&nbsp;4&nbsp;0&nbsp;0&nbsp;1&nbsp;0 </tt></td>
   </tr>
   <tr align="left" valign="top"> 
-	<td> 
-	  <pre>
+  <td> 
+    <pre>
 ObjectMatrix2D[][] parts2 = 
 {
 &nbsp;&nbsp;&nbsp;{ null,        make(2,2,1), null        },
@@ -254,77 +254,77 @@
 };
 System.out.println("\n"+Factory2D.make(parts2));
 </pre>
-	</td>
-	<td><tt>IllegalArgumentException<br>
-	  A[0,1].cols != A[2,1].cols<br>
-	  (2 != 3)</tt></td>
+  </td>
+  <td><tt>IllegalArgumentException<br>
+    A[0,1].cols != A[2,1].cols<br>
+    (2 != 3)</tt></td>
   </tr>
 </table>
 @throws IllegalArgumentException subject to the conditions outlined above.
 */
 public ObjectMatrix2D compose(ObjectMatrix2D[][] parts) {
-	checkRectangularShape(parts);
-	int rows = parts.length;
-	int columns = 0;
-	if (parts.length > 0) columns = parts[0].length;
-	ObjectMatrix2D empty = make(0,0);
-	
-	if (rows==0 || columns==0) return empty;
+  checkRectangularShape(parts);
+  int rows = parts.length;
+  int columns = 0;
+  if (parts.length > 0) columns = parts[0].length;
+  ObjectMatrix2D empty = make(0,0);
+  
+  if (rows==0 || columns==0) return empty;
 
-	// determine maximum column width of each column
-	int[] maxWidths = new int[columns];
-	for (int column=columns; --column >= 0; ) {
-		int maxWidth = 0;
-		for (int row=rows; --row >= 0; ) {
-			ObjectMatrix2D part = parts[row][column];
-			if (part != null) {
-				int width = part.columns();
-				if (maxWidth>0 && width>0 && width!=maxWidth) throw new IllegalArgumentException("Different number of columns.");
-				maxWidth = Math.max(maxWidth,width);
-			}
-		}
-		maxWidths[column] = maxWidth;
-	}
+  // determine maximum column width of each column
+  int[] maxWidths = new int[columns];
+  for (int column=columns; --column >= 0; ) {
+    int maxWidth = 0;
+    for (int row=rows; --row >= 0; ) {
+      ObjectMatrix2D part = parts[row][column];
+      if (part != null) {
+        int width = part.columns();
+        if (maxWidth>0 && width>0 && width!=maxWidth) throw new IllegalArgumentException("Different number of columns.");
+        maxWidth = Math.max(maxWidth,width);
+      }
+    }
+    maxWidths[column] = maxWidth;
+  }
 
-	// determine row height of each row
-	int[] maxHeights = new int[rows];
-	for (int row=rows; --row >= 0; ) {
-		int maxHeight = 0;
-		for (int column=columns; --column >= 0; ) {
-			ObjectMatrix2D part = parts[row][column];
-			if (part != null) {
-				int height = part.rows();
-				if (maxHeight>0  && height>0 && height!=maxHeight) throw new IllegalArgumentException("Different number of rows.");
-				maxHeight = Math.max(maxHeight,height);
-			}
-		}
-		maxHeights[row] = maxHeight;
-	}
+  // determine row height of each row
+  int[] maxHeights = new int[rows];
+  for (int row=rows; --row >= 0; ) {
+    int maxHeight = 0;
+    for (int column=columns; --column >= 0; ) {
+      ObjectMatrix2D part = parts[row][column];
+      if (part != null) {
+        int height = part.rows();
+        if (maxHeight>0  && height>0 && height!=maxHeight) throw new IllegalArgumentException("Different number of rows.");
+        maxHeight = Math.max(maxHeight,height);
+      }
+    }
+    maxHeights[row] = maxHeight;
+  }
 
 
-	// shape of result 
-	int resultRows = 0;
-	for (int row=rows; --row >= 0; ) resultRows += maxHeights[row];
-	int resultCols = 0;
-	for (int column=columns; --column >= 0; ) resultCols += maxWidths[column];
-	
-	ObjectMatrix2D matrix = make(resultRows,resultCols);
+  // shape of result 
+  int resultRows = 0;
+  for (int row=rows; --row >= 0; ) resultRows += maxHeights[row];
+  int resultCols = 0;
+  for (int column=columns; --column >= 0; ) resultCols += maxWidths[column];
+  
+  ObjectMatrix2D matrix = make(resultRows,resultCols);
 
-	// copy
-	int r=0;
-	for (int row=0; row < rows; row++) {
-		int c=0;
-		for (int column=0; column < columns; column++) {
-			ObjectMatrix2D part = parts[row][column];
-			if (part != null) {
-				matrix.viewPart(r,c,part.rows(),part.columns()).assign(part);
-			}
-			c += maxWidths[column];
-		}
-		r += maxHeights[row];
-	}
-	
-	return matrix;
+  // copy
+  int r=0;
+  for (int row=0; row < rows; row++) {
+    int c=0;
+    for (int column=0; column < columns; column++) {
+      ObjectMatrix2D part = parts[row][column];
+      if (part != null) {
+        matrix.viewPart(r,c,part.rows(),part.columns()).assign(part);
+      }
+      c += maxWidths[column];
+    }
+    r += maxHeights[row];
+  }
+  
+  return matrix;
 }
 /**
 Constructs a diagonal block matrix from the given parts (the <i>direct sum</i> of two matrices).
@@ -338,12 +338,12 @@
 @return a new matrix which is the direct sum.
 */
 public ObjectMatrix2D composeDiagonal(ObjectMatrix2D A, ObjectMatrix2D B) {
-	int ar = A.rows(); int ac = A.columns();
-	int br = B.rows(); int bc = B.columns();
-	ObjectMatrix2D sum = make(ar+br, ac+bc);
-	sum.viewPart(0,0,ar,ac).assign(A);
-	sum.viewPart(ar,ac,br,bc).assign(B);
-	return sum;
+  int ar = A.rows(); int ac = A.columns();
+  int br = B.rows(); int bc = B.columns();
+  ObjectMatrix2D sum = make(ar+br, ac+bc);
+  sum.viewPart(0,0,ar,ac).assign(A);
+  sum.viewPart(ar,ac,br,bc).assign(B);
+  return sum;
 }
 /**
 Constructs a diagonal block matrix from the given parts.
@@ -357,11 +357,11 @@
 Cells are copied.
 */
 public ObjectMatrix2D composeDiagonal(ObjectMatrix2D A, ObjectMatrix2D B, ObjectMatrix2D C) {
-	ObjectMatrix2D diag = make(A.rows()+B.rows()+C.rows(), A.columns()+B.columns()+C.columns());
-	diag.viewPart(0,0,A.rows(),A.columns()).assign(A);
-	diag.viewPart(A.rows(),A.columns(),B.rows(),B.columns()).assign(B);
-	diag.viewPart(A.rows()+B.rows(),A.columns()+B.columns(),C.rows(),C.columns()).assign(C);
-	return diag;
+  ObjectMatrix2D diag = make(A.rows()+B.rows()+C.rows(), A.columns()+B.columns()+C.columns());
+  diag.viewPart(0,0,A.rows(),A.columns()).assign(A);
+  diag.viewPart(A.rows(),A.columns(),B.rows(),B.columns()).assign(B);
+  diag.viewPart(A.rows()+B.rows(),A.columns()+B.columns(),C.rows(),C.columns()).assign(C);
+  return diag;
 }
 /**
 Splits a block matrix into its constituent blocks; Copies blocks of a matrix into the given parts.
@@ -375,13 +375,13 @@
 Example:
 <table border="1" cellspacing="0">
   <tr align="left" valign="top"> 
-	<td><tt>Code</tt></td>
-	<td><tt>matrix</tt></td>
-	<td><tt>--&gt; parts </tt></td>
+  <td><tt>Code</tt></td>
+  <td><tt>matrix</tt></td>
+  <td><tt>--&gt; parts </tt></td>
   </tr>
   <tr align="left" valign="top"> 
-	<td> 
-	  <pre>
+  <td> 
+    <pre>
 ObjectMatrix2D matrix = ... ;
 ObjectMatrix2D _ = null;
 ObjectMatrix2D A,B,C,D;
@@ -399,98 +399,98 @@
 System.out.println(&quot;\nC = &quot;+C);
 System.out.println(&quot;\nD = &quot;+D);
 </pre>
-	</td>
-	<td><tt>8&nbsp;x&nbsp;9&nbsp;matrix<br>
-	  9&nbsp;9&nbsp;9&nbsp;9&nbsp;1&nbsp;1&nbsp;9&nbsp;9&nbsp;9<br>
-	  9&nbsp;9&nbsp;9&nbsp;9&nbsp;1&nbsp;1&nbsp;9&nbsp;9&nbsp;9<br>
-	  2&nbsp;2&nbsp;2&nbsp;2&nbsp;9&nbsp;9&nbsp;3&nbsp;3&nbsp;3<br>
-	  2&nbsp;2&nbsp;2&nbsp;2&nbsp;9&nbsp;9&nbsp;3&nbsp;3&nbsp;3<br>
-	  2&nbsp;2&nbsp;2&nbsp;2&nbsp;9&nbsp;9&nbsp;3&nbsp;3&nbsp;3<br>
-	  2&nbsp;2&nbsp;2&nbsp;2&nbsp;9&nbsp;9&nbsp;3&nbsp;3&nbsp;3<br>
-	  9&nbsp;9&nbsp;9&nbsp;9&nbsp;4&nbsp;4&nbsp;9&nbsp;9&nbsp;9<br>
-	  9&nbsp;9&nbsp;9&nbsp;9&nbsp;4&nbsp;4&nbsp;9&nbsp;9&nbsp;9</tt></td>
-	<td> 
-	  <p><tt>A = 2&nbsp;x&nbsp;2&nbsp;matrix<br>
-		1&nbsp;1<br>
-		1&nbsp;1</tt></p>
-	  <p><tt>B = 4&nbsp;x&nbsp;4&nbsp;matrix<br>
-		2&nbsp;2&nbsp;2&nbsp;2<br>
-		2&nbsp;2&nbsp;2&nbsp;2<br>
-		2&nbsp;2&nbsp;2&nbsp;2<br>
-		2&nbsp;2&nbsp;2&nbsp;2</tt></p>
-	  <p><tt>C = 4&nbsp;x&nbsp;3&nbsp;matrix<br>
-		3&nbsp;3&nbsp;3<br>
-		3&nbsp;3&nbsp;3<br>
-		</tt><tt>3&nbsp;3&nbsp;3<br>
-		</tt><tt>3&nbsp;3&nbsp;3</tt></p>
-	  <p><tt>D = 2&nbsp;x&nbsp;2&nbsp;matrix<br>
-		4&nbsp;4<br>
-		4&nbsp;4</tt></p>
-	  </td>
+  </td>
+  <td><tt>8&nbsp;x&nbsp;9&nbsp;matrix<br>
+    9&nbsp;9&nbsp;9&nbsp;9&nbsp;1&nbsp;1&nbsp;9&nbsp;9&nbsp;9<br>
+    9&nbsp;9&nbsp;9&nbsp;9&nbsp;1&nbsp;1&nbsp;9&nbsp;9&nbsp;9<br>
+    2&nbsp;2&nbsp;2&nbsp;2&nbsp;9&nbsp;9&nbsp;3&nbsp;3&nbsp;3<br>
+    2&nbsp;2&nbsp;2&nbsp;2&nbsp;9&nbsp;9&nbsp;3&nbsp;3&nbsp;3<br>
+    2&nbsp;2&nbsp;2&nbsp;2&nbsp;9&nbsp;9&nbsp;3&nbsp;3&nbsp;3<br>
+    2&nbsp;2&nbsp;2&nbsp;2&nbsp;9&nbsp;9&nbsp;3&nbsp;3&nbsp;3<br>
+    9&nbsp;9&nbsp;9&nbsp;9&nbsp;4&nbsp;4&nbsp;9&nbsp;9&nbsp;9<br>
+    9&nbsp;9&nbsp;9&nbsp;9&nbsp;4&nbsp;4&nbsp;9&nbsp;9&nbsp;9</tt></td>
+  <td> 
+    <p><tt>A = 2&nbsp;x&nbsp;2&nbsp;matrix<br>
+    1&nbsp;1<br>
+    1&nbsp;1</tt></p>
+    <p><tt>B = 4&nbsp;x&nbsp;4&nbsp;matrix<br>
+    2&nbsp;2&nbsp;2&nbsp;2<br>
+    2&nbsp;2&nbsp;2&nbsp;2<br>
+    2&nbsp;2&nbsp;2&nbsp;2<br>
+    2&nbsp;2&nbsp;2&nbsp;2</tt></p>
+    <p><tt>C = 4&nbsp;x&nbsp;3&nbsp;matrix<br>
+    3&nbsp;3&nbsp;3<br>
+    3&nbsp;3&nbsp;3<br>
+    </tt><tt>3&nbsp;3&nbsp;3<br>
+    </tt><tt>3&nbsp;3&nbsp;3</tt></p>
+    <p><tt>D = 2&nbsp;x&nbsp;2&nbsp;matrix<br>
+    4&nbsp;4<br>
+    4&nbsp;4</tt></p>
+    </td>
   </tr>
 </table>
 @throws IllegalArgumentException subject to the conditions outlined above.
 */
 public void decompose(ObjectMatrix2D[][] parts, ObjectMatrix2D matrix) {
-	checkRectangularShape(parts);
-	int rows = parts.length;
-	int columns = 0;
-	if (parts.length > 0) columns = parts[0].length;
-	if (rows==0 || columns==0) return;
+  checkRectangularShape(parts);
+  int rows = parts.length;
+  int columns = 0;
+  if (parts.length > 0) columns = parts[0].length;
+  if (rows==0 || columns==0) return;
 
-	// determine maximum column width of each column
-	int[] maxWidths = new int[columns];
-	for (int column=columns; --column >= 0; ) {
-		int maxWidth = 0;
-		for (int row=rows; --row >= 0; ) {
-			ObjectMatrix2D part = parts[row][column];		
-			if (part != null) {
-				int width = part.columns();
-				if (maxWidth>0 && width>0 && width!=maxWidth) throw new IllegalArgumentException("Different number of columns.");
-				maxWidth = Math.max(maxWidth,width);
-			}
-		}
-		maxWidths[column] = maxWidth;
-	}
+  // determine maximum column width of each column
+  int[] maxWidths = new int[columns];
+  for (int column=columns; --column >= 0; ) {
+    int maxWidth = 0;
+    for (int row=rows; --row >= 0; ) {
+      ObjectMatrix2D part = parts[row][column];    
+      if (part != null) {
+        int width = part.columns();
+        if (maxWidth>0 && width>0 && width!=maxWidth) throw new IllegalArgumentException("Different number of columns.");
+        maxWidth = Math.max(maxWidth,width);
+      }
+    }
+    maxWidths[column] = maxWidth;
+  }
 
-	// determine row height of each row
-	int[] maxHeights = new int[rows];
-	for (int row=rows; --row >= 0; ) {
-		int maxHeight = 0;
-		for (int column=columns; --column >= 0; ) {
-			ObjectMatrix2D part = parts[row][column];		
-			if (part != null) {
-				int height = part.rows();
-				if (maxHeight>0  && height>0 && height!=maxHeight) throw new IllegalArgumentException("Different number of rows.");
-				maxHeight = Math.max(maxHeight,height);
-			}
-		}
-		maxHeights[row] = maxHeight;
-	}
+  // determine row height of each row
+  int[] maxHeights = new int[rows];
+  for (int row=rows; --row >= 0; ) {
+    int maxHeight = 0;
+    for (int column=columns; --column >= 0; ) {
+      ObjectMatrix2D part = parts[row][column];    
+      if (part != null) {
+        int height = part.rows();
+        if (maxHeight>0  && height>0 && height!=maxHeight) throw new IllegalArgumentException("Different number of rows.");
+        maxHeight = Math.max(maxHeight,height);
+      }
+    }
+    maxHeights[row] = maxHeight;
+  }
 
 
-	// shape of result parts
-	int resultRows = 0;
-	for (int row=rows; --row >= 0; ) resultRows += maxHeights[row];
-	int resultCols = 0;
-	for (int column=columns; --column >= 0; ) resultCols += maxWidths[column];
+  // shape of result parts
+  int resultRows = 0;
+  for (int row=rows; --row >= 0; ) resultRows += maxHeights[row];
+  int resultCols = 0;
+  for (int column=columns; --column >= 0; ) resultCols += maxWidths[column];
 
-	if (matrix.rows() < resultRows || matrix.columns() < resultCols) throw new IllegalArgumentException("Parts larger than matrix.");
-	
-	// copy
-	int r=0;
-	for (int row=0; row < rows; row++) {
-		int c=0;
-		for (int column=0; column < columns; column++) {
-			ObjectMatrix2D part = parts[row][column];
-			if (part != null) {
-				part.assign(matrix.viewPart(r,c,part.rows(),part.columns()));
-			}
-			c += maxWidths[column];
-		}
-		r += maxHeights[row];
-	}
-	
+  if (matrix.rows() < resultRows || matrix.columns() < resultCols) throw new IllegalArgumentException("Parts larger than matrix.");
+  
+  // copy
+  int r=0;
+  for (int row=0; row < rows; row++) {
+    int c=0;
+    for (int column=0; column < columns; column++) {
+      ObjectMatrix2D part = parts[row][column];
+      if (part != null) {
+        part.assign(matrix.viewPart(r,c,part.rows(),part.columns()));
+      }
+      c += maxWidths[column];
+    }
+    r += maxHeights[row];
+  }
+  
 }
 /**
 Constructs a new diagonal matrix whose diagonal elements are the elements of <tt>vector</tt>.
@@ -505,12 +505,12 @@
 @return a new matrix.
 */
 public ObjectMatrix2D diagonal(ObjectMatrix1D vector) {
-	int size = vector.size();
-	ObjectMatrix2D diag = make(size,size);
-	for (int i=size; --i >= 0; ) {
-		diag.setQuick(i,i, vector.getQuick(i));
-	}
-	return diag;
+  int size = vector.size();
+  ObjectMatrix2D diag = make(size,size);
+  for (int i=size; --i >= 0; ) {
+    diag.setQuick(i,i, vector.getQuick(i));
+  }
+  return diag;
 }
 /**
 Constructs a new vector consisting of the diagonal elements of <tt>A</tt>.
@@ -526,12 +526,12 @@
 @return a new vector.
 */
 public ObjectMatrix1D diagonal(ObjectMatrix2D A) {
-	int min = Math.min(A.rows(),A.columns());
-	ObjectMatrix1D diag = make1D(min);
-	for (int i=min; --i >= 0; ) {
-		diag.setQuick(i, A.getQuick(i,i));
-	}
-	return diag;
+  int min = Math.min(A.rows(),A.columns());
+  ObjectMatrix1D diag = make1D(min);
+  for (int i=min; --i >= 0; ) {
+    diag.setQuick(i, A.getQuick(i,i));
+  }
+  return diag;
 }
 /**
  * Constructs a matrix with the given cell values.
@@ -544,8 +544,8 @@
  * @throws IllegalArgumentException if <tt>for any 1 &lt;= row &lt; values.length: values[row].length != values[row-1].length</tt>.
  */
 public ObjectMatrix2D make(Object[][] values) {
-	if (this==sparse) return new SparseObjectMatrix2D(values);
-	else return new DenseObjectMatrix2D(values);
+  if (this==sparse) return new SparseObjectMatrix2D(values);
+  else return new DenseObjectMatrix2D(values);
 }
 /** 
 Construct a matrix from a one-dimensional column-major packed array, ala Fortran.
@@ -557,37 +557,37 @@
 @exception  IllegalArgumentException <tt>values.length</tt> must be a multiple of <tt>rows</tt>.
 */
 public ObjectMatrix2D make(Object values[], int rows) {
-	int columns = (rows != 0 ? values.length/rows : 0);
-	if (rows*columns != values.length) 
-		throw new IllegalArgumentException("Array length must be a multiple of m.");
-		
-	ObjectMatrix2D matrix = make(rows,columns);
-	for (int row=0; row < rows; row++) {
-		for (int column=0; column < columns; column++) {
-			matrix.setQuick(row,column, values[row + column*rows]);
-		}
-	}
-	return matrix;
+  int columns = (rows != 0 ? values.length/rows : 0);
+  if (rows*columns != values.length) 
+    throw new IllegalArgumentException("Array length must be a multiple of m.");
+    
+  ObjectMatrix2D matrix = make(rows,columns);
+  for (int row=0; row < rows; row++) {
+    for (int column=0; column < columns; column++) {
+      matrix.setQuick(row,column, values[row + column*rows]);
+    }
+  }
+  return matrix;
 }
 /**
  * Constructs a matrix with the given shape, each cell initialized with zero.
  */
 public ObjectMatrix2D make(int rows, int columns) {
-	if (this==sparse) return new SparseObjectMatrix2D(rows,columns);
-	else return new DenseObjectMatrix2D(rows,columns);
+  if (this==sparse) return new SparseObjectMatrix2D(rows,columns);
+  else return new DenseObjectMatrix2D(rows,columns);
 }
 /**
  * Constructs a matrix with the given shape, each cell initialized with the given value.
  */
 public ObjectMatrix2D make(int rows, int columns, Object initialValue) {
-	if (initialValue == null) return make(rows,columns);
-	return make(rows,columns).assign(initialValue);
+  if (initialValue == null) return make(rows,columns);
+  return make(rows,columns).assign(initialValue);
 }
 /**
  * Constructs a 1d matrix of the right dynamic type.
  */
 protected ObjectMatrix1D make1D(int size) {
-	return make(0,0).like1D(size);
+  return make(0,0).like1D(size);
 }
 /**
 C = A||A||..||A; Constructs a new matrix which is duplicated both along the row and column dimension.
@@ -603,14 +603,14 @@
 </pre>
 */
 public ObjectMatrix2D repeat(ObjectMatrix2D A, int rowRepeat, int columnRepeat) {
-	int r = A.rows();
-	int c = A.columns();
-	ObjectMatrix2D matrix = make(r*rowRepeat, c*columnRepeat);
-	for (int i=rowRepeat; --i >= 0; ) {
-		for (int j=columnRepeat; --j >= 0; ) {
-			matrix.viewPart(r*i,c*j,r,c).assign(A);
-		}
-	}
-	return matrix;
+  int r = A.rows();
+  int c = A.columns();
+  ObjectMatrix2D matrix = make(r*rowRepeat, c*columnRepeat);
+  for (int i=rowRepeat; --i >= 0; ) {
+    for (int j=columnRepeat; --j >= 0; ) {
+      matrix.viewPart(r*i,c*j,r,c).assign(A);
+    }
+  }
+  return matrix;
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/DoubleMatrix2D.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/DoubleMatrix2D.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/DoubleMatrix2D.java	(working copy)
@@ -59,16 +59,16 @@
 @see org.apache.mahout.jet.math.Functions
 */
 public double aggregate(org.apache.mahout.matrix.function.DoubleDoubleFunction aggr, org.apache.mahout.matrix.function.DoubleFunction f) {
-	if (size()==0) return Double.NaN;
-	double a = f.apply(getQuick(rows-1,columns-1));
-	int d = 1; // last cell already done
-	for (int row=rows; --row >= 0; ) {
-		for (int column=columns-d; --column >= 0; ) {
-			a = aggr.apply(a, f.apply(getQuick(row,column)));
-		}
-		d = 0;
-	}
-	return a;
+  if (size()==0) return Double.NaN;
+  double a = f.apply(getQuick(rows-1,columns-1));
+  int d = 1; // last cell already done
+  for (int row=rows; --row >= 0; ) {
+    for (int column=columns-d; --column >= 0; ) {
+      a = aggr.apply(a, f.apply(getQuick(row,column)));
+    }
+    d = 0;
+  }
+  return a;
 }
 /**
 Applies a function to each corresponding cell of two matrices and aggregates the results.
@@ -98,21 +98,21 @@
 @param aggr an aggregation function taking as first argument the current aggregation and as second argument the transformed current cell values.
 @param f a function transforming the current cell values.
 @return the aggregated measure.
-@throws	IllegalArgumentException if <tt>columns() != other.columns() || rows() != other.rows()</tt>
+@throws  IllegalArgumentException if <tt>columns() != other.columns() || rows() != other.rows()</tt>
 @see org.apache.mahout.jet.math.Functions
 */
 public double aggregate(DoubleMatrix2D other, org.apache.mahout.matrix.function.DoubleDoubleFunction aggr, org.apache.mahout.matrix.function.DoubleDoubleFunction f) {
-	checkShape(other);
-	if (size()==0) return Double.NaN;
-	double a = f.apply(getQuick(rows-1,columns-1),other.getQuick(rows-1,columns-1));
-	int d = 1; // last cell already done
-	for (int row=rows; --row >= 0; ) {
-		for (int column=columns-d; --column >= 0; ) {
-			a = aggr.apply(a, f.apply(getQuick(row,column), other.getQuick(row,column)));
-		}
-		d = 0;
-	}
-	return a;
+  checkShape(other);
+  if (size()==0) return Double.NaN;
+  double a = f.apply(getQuick(rows-1,columns-1),other.getQuick(rows-1,columns-1));
+  int d = 1; // last cell already done
+  for (int row=rows; --row >= 0; ) {
+    for (int column=columns-d; --column >= 0; ) {
+      a = aggr.apply(a, f.apply(getQuick(row,column), other.getQuick(row,column)));
+    }
+    d = 0;
+  }
+  return a;
 }
 /**
  * Sets all cells to the state specified by <tt>values</tt>.
@@ -126,15 +126,15 @@
  * @throws IllegalArgumentException if <tt>values.length != rows() || for any 0 &lt;= row &lt; rows(): values[row].length != columns()</tt>.
  */
 public DoubleMatrix2D assign(double[][] values) {
-	if (values.length != rows) throw new IllegalArgumentException("Must have same number of rows: rows="+values.length+"rows()="+rows());
-	for (int row=rows; --row >= 0;) {
-		double[] currentRow = values[row];
-		if (currentRow.length != columns) throw new IllegalArgumentException("Must have same number of columns in every row: columns="+currentRow.length+"columns()="+columns());
-		for (int column=columns; --column >= 0;) {
-			setQuick(row,column,currentRow[column]);
-		}
-	}
-	return this;
+  if (values.length != rows) throw new IllegalArgumentException("Must have same number of rows: rows="+values.length+"rows()="+rows());
+  for (int row=rows; --row >= 0;) {
+    double[] currentRow = values[row];
+    if (currentRow.length != columns) throw new IllegalArgumentException("Must have same number of columns in every row: columns="+currentRow.length+"columns()="+columns());
+    for (int column=columns; --column >= 0;) {
+      setQuick(row,column,currentRow[column]);
+    }
+  }
+  return this;
 }
 /**
  * Sets all cells to the state specified by <tt>value</tt>.
@@ -142,16 +142,16 @@
  * @return <tt>this</tt> (for convenience only).
  */
 public DoubleMatrix2D assign(double value) {
-	int r = rows;
-	int c = columns;
-	//for (int row=rows; --row >= 0;) {
-	//	for (int column=columns; --column >= 0;) {
-	for (int row=0; row < r; row++) {
-		for (int column=0; column < c; column++) {
-			setQuick(row,column,value);
-		}
-	}
-	return this;
+  int r = rows;
+  int c = columns;
+  //for (int row=rows; --row >= 0;) {
+  //  for (int column=columns; --column >= 0;) {
+  for (int row=0; row < r; row++) {
+    for (int column=0; column < c; column++) {
+      setQuick(row,column,value);
+    }
+  }
+  return this;
 }
 /**
 Assigns the result of a function to each cell; <tt>x[row,col] = function(x[row,col])</tt>.
@@ -176,12 +176,12 @@
 @see org.apache.mahout.jet.math.Functions
 */
 public DoubleMatrix2D assign(org.apache.mahout.matrix.function.DoubleFunction function) {
-	for (int row=rows; --row >= 0; ) {
-		for (int column=columns; --column >= 0; ) {
-			setQuick(row,column, function.apply(getQuick(row,column)));
-		}
-	}
-	return this;
+  for (int row=rows; --row >= 0; ) {
+    for (int column=columns; --column >= 0; ) {
+      setQuick(row,column, function.apply(getQuick(row,column)));
+    }
+  }
+  return this;
 }
 /**
  * Replaces all cell values of the receiver with the values of another matrix.
@@ -190,21 +190,21 @@
  *
  * @param     other   the source matrix to copy from (may be identical to the receiver).
  * @return <tt>this</tt> (for convenience only).
- * @throws	IllegalArgumentException if <tt>columns() != other.columns() || rows() != other.rows()</tt>
+ * @throws  IllegalArgumentException if <tt>columns() != other.columns() || rows() != other.rows()</tt>
  */
 public DoubleMatrix2D assign(DoubleMatrix2D other) {
-	if (other==this) return this;
-	checkShape(other);
-	if (haveSharedCells(other)) other = other.copy();
-	
-	//for (int row=0; row<rows; row++) {
-		//for (int column=0; column<columns; column++) {
-	for (int row=rows; --row >= 0;) {
-		for (int column=columns; --column >= 0;) {
-			setQuick(row,column,other.getQuick(row,column));
-		}
-	}
-	return this;
+  if (other==this) return this;
+  checkShape(other);
+  if (haveSharedCells(other)) other = other.copy();
+  
+  //for (int row=0; row<rows; row++) {
+    //for (int column=0; column<columns; column++) {
+  for (int row=rows; --row >= 0;) {
+    for (int column=columns; --column >= 0;) {
+      setQuick(row,column,other.getQuick(row,column));
+    }
+  }
+  return this;
 }
 /**
 Assigns the result of a function to each cell; <tt>x[row,col] = function(x[row,col],y[row,col])</tt>.
@@ -232,29 +232,29 @@
 @param function a function object taking as first argument the current cell's value of <tt>this</tt>,
 and as second argument the current cell's value of <tt>y</tt>,
 @return <tt>this</tt> (for convenience only).
-@throws	IllegalArgumentException if <tt>columns() != other.columns() || rows() != other.rows()</tt>
+@throws  IllegalArgumentException if <tt>columns() != other.columns() || rows() != other.rows()</tt>
 @see org.apache.mahout.jet.math.Functions
 */
 public DoubleMatrix2D assign(DoubleMatrix2D y, org.apache.mahout.matrix.function.DoubleDoubleFunction function) {
-	checkShape(y);
-	for (int row=rows; --row >= 0; ) {
-		for (int column=columns; --column >= 0; ) {
-			setQuick(row,column, function.apply(getQuick(row,column), y.getQuick(row,column)));
-		}
-	}
-	return this;
+  checkShape(y);
+  for (int row=rows; --row >= 0; ) {
+    for (int column=columns; --column >= 0; ) {
+      setQuick(row,column, function.apply(getQuick(row,column), y.getQuick(row,column)));
+    }
+  }
+  return this;
 }
 /**
  * Returns the number of cells having non-zero values; ignores tolerance.
  */
 public int cardinality() {
-	int cardinality = 0;
-	for (int row=rows; --row >= 0;) {
-		for (int column=columns; --column >= 0;) {
-			if (getQuick(row,column) != 0) cardinality++;
-		}
-	}
-	return cardinality;
+  int cardinality = 0;
+  for (int row=rows; --row >= 0;) {
+    for (int column=columns; --column >= 0;) {
+      if (getQuick(row,column) != 0) cardinality++;
+    }
+  }
+  return cardinality;
 }
 /**
  * Constructs and returns a deep copy of the receiver.
@@ -265,7 +265,7 @@
  * @return  a deep copy of the receiver.
  */
 public DoubleMatrix2D copy() {
-	return like().assign(this);
+  return like().assign(this);
 }
 /**
  * Returns whether all cells are equal to the given value.
@@ -274,7 +274,7 @@
  * @return    <tt>true</tt> if all cells are equal to the given value, <tt>false</tt> otherwise.
  */
 public boolean equals(double value) {
-	return org.apache.mahout.matrix.matrix.linalg.Property.DEFAULT.equals(this,value);
+  return org.apache.mahout.matrix.matrix.linalg.Property.DEFAULT.equals(this,value);
 }
 /**
  * Compares this object against the specified object.
@@ -287,11 +287,11 @@
  *          <code>false</code> otherwise.
  */
 public boolean equals(Object obj) {
-	if (this == obj) return true;
-	if (obj == null) return false;
-	if (!(obj instanceof DoubleMatrix2D)) return false;
+  if (this == obj) return true;
+  if (obj == null) return false;
+  if (!(obj instanceof DoubleMatrix2D)) return false;
 
-	return org.apache.mahout.matrix.matrix.linalg.Property.DEFAULT.equals(this,(DoubleMatrix2D) obj);
+  return org.apache.mahout.matrix.matrix.linalg.Property.DEFAULT.equals(this,(DoubleMatrix2D) obj);
 }
 /**
  * Assigns the result of a function to each <i>non-zero</i> cell; <tt>x[row,col] = function(x[row,col])</tt>.
@@ -304,16 +304,16 @@
  * @return <tt>this</tt> (for convenience only).
  */
 public DoubleMatrix2D forEachNonZero(final org.apache.mahout.matrix.function.IntIntDoubleFunction function) {
-	for (int row=rows; --row >= 0;) {
-		for (int column=columns; --column >= 0;) {
-			double value = getQuick(row,column);
-			if (value!=0) {
-				double r = function.apply(row,column,value);
-				if (r!=value) setQuick(row,column,r);
-			}
-		}
-	}
-	return this;
+  for (int row=rows; --row >= 0;) {
+    for (int column=columns; --column >= 0;) {
+      double value = getQuick(row,column);
+      if (value!=0) {
+        double r = function.apply(row,column,value);
+        if (r!=value) setQuick(row,column,r);
+      }
+    }
+  }
+  return this;
 }
 /**
  * Returns the matrix cell value at coordinate <tt>[row,column]</tt>.
@@ -321,18 +321,18 @@
  * @param     row   the index of the row-coordinate.
  * @param     column   the index of the column-coordinate.
  * @return    the value of the specified cell.
- * @throws	IndexOutOfBoundsException if <tt>column&lt;0 || column&gt;=columns() || row&lt;0 || row&gt;=rows()</tt>
+ * @throws  IndexOutOfBoundsException if <tt>column&lt;0 || column&gt;=columns() || row&lt;0 || row&gt;=rows()</tt>
  */
 public double get(int row, int column) {
-	if (column<0 || column>=columns || row<0 || row>=rows) throw new IndexOutOfBoundsException("row:"+row+", column:"+column);
-	return getQuick(row,column);
+  if (column<0 || column>=columns || row<0 || row>=rows) throw new IndexOutOfBoundsException("row:"+row+", column:"+column);
+  return getQuick(row,column);
 }
 /**
  * Returns the content of this matrix if it is a wrapper; or <tt>this</tt> otherwise.
  * Override this method in wrappers.
  */
 protected DoubleMatrix2D getContent() {
-	return this;
+  return this;
 }
 /**
 Fills the coordinates and values of cells having non-zero values into the specified lists.
@@ -362,21 +362,21 @@
 @param valueList the list to be filled with values, can have any size.
 */
 public void getNonZeros(IntArrayList rowList, IntArrayList columnList, DoubleArrayList valueList) {
-	rowList.clear(); 
-	columnList.clear(); 
-	valueList.clear();
-	int r = rows;
-	int c = columns;
-	for (int row=0; row < r; row++) {
-		for (int column=0; column < c; column++) {
-			double value = getQuick(row,column);
-			if (value != 0) {
-				rowList.add(row);
-				columnList.add(column);
-				valueList.add(value);
-			}
-		}
-	}
+  rowList.clear(); 
+  columnList.clear(); 
+  valueList.clear();
+  int r = rows;
+  int c = columns;
+  for (int row=0; row < r; row++) {
+    for (int column=0; column < c; column++) {
+      double value = getQuick(row,column);
+      if (value != 0) {
+        rowList.add(row);
+        columnList.add(column);
+        valueList.add(value);
+      }
+    }
+  }
 }
 /**
  * Returns the matrix cell value at coordinate <tt>[row,column]</tt>.
@@ -394,16 +394,16 @@
  * Returns <tt>true</tt> if both matrices share at least one identical cell.
  */
 protected boolean haveSharedCells(DoubleMatrix2D other) {
-	if (other==null) return false;
-	if (this==other) return true;
-	return getContent().haveSharedCellsRaw(other.getContent());
-}	
+  if (other==null) return false;
+  if (this==other) return true;
+  return getContent().haveSharedCellsRaw(other.getContent());
+}  
 /**
  * Returns <tt>true</tt> if both matrices share at least one identical cell.
  */
 protected boolean haveSharedCellsRaw(DoubleMatrix2D other) {
-	return false;
-}	
+  return false;
+}  
 /**
  * Construct and returns a new empty matrix <i>of the same dynamic type</i> as the receiver, having the same number of rows and columns.
  * For example, if the receiver is an instance of type <tt>DenseDoubleMatrix2D</tt> the new matrix must also be of type <tt>DenseDoubleMatrix2D</tt>,
@@ -413,7 +413,7 @@
  * @return  a new empty matrix of the same dynamic type.
  */
 public DoubleMatrix2D like() {
-	return like(rows,columns);
+  return like(rows,columns);
 }
 /**
  * Construct and returns a new empty matrix <i>of the same dynamic type</i> as the receiver, having the specified number of rows and columns.
@@ -452,11 +452,11 @@
  * @param     row   the index of the row-coordinate.
  * @param     column   the index of the column-coordinate.
  * @param    value the value to be filled into the specified cell.
- * @throws	IndexOutOfBoundsException if <tt>column&lt;0 || column&gt;=columns() || row&lt;0 || row&gt;=rows()</tt>
+ * @throws  IndexOutOfBoundsException if <tt>column&lt;0 || column&gt;=columns() || row&lt;0 || row&gt;=rows()</tt>
  */
 public void set(int row, int column, double value) {
-	if (column<0 || column>=columns || row<0 || row>=rows) throw new IndexOutOfBoundsException("row:"+row+", column:"+column);
-	setQuick(row,column,value);
+  if (column<0 || column>=columns || row<0 || row>=rows) throw new IndexOutOfBoundsException("row:"+row+", column:"+column);
+  setQuick(row,column,value);
 }
 /**
  * Sets the matrix cell at coordinate <tt>[row,column]</tt> to the specified value.
@@ -480,21 +480,21 @@
  * @return an array filled with the values of the cells.
  */
 public double[][] toArray() {
-	double[][] values = new double[rows][columns];
-	for (int row=rows; --row >= 0;) {
-		double[] currentRow = values[row];
-		for (int column=columns; --column >= 0;) {
-			currentRow[column] = getQuick(row,column);
-		}
-	}
-	return values;
+  double[][] values = new double[rows][columns];
+  for (int row=rows; --row >= 0;) {
+    double[] currentRow = values[row];
+    for (int column=columns; --column >= 0;) {
+      currentRow[column] = getQuick(row,column);
+    }
+  }
+  return values;
 }
 /**
  * Returns a string representation using default formatting.
  * @see org.apache.mahout.matrix.matrix.doublealgo.Formatter
  */
 public String toString() {
-	return new org.apache.mahout.matrix.matrix.doublealgo.Formatter().toString(this);
+  return new org.apache.mahout.matrix.matrix.doublealgo.Formatter().toString(this);
 }
 /**
  * Constructs and returns a new view equal to the receiver.
@@ -508,7 +508,7 @@
  * @return  a new view of the receiver.
  */
 protected DoubleMatrix2D view() {
-	return (DoubleMatrix2D) clone();
+  return (DoubleMatrix2D) clone();
 }
 /**
 Constructs and returns a new <i>slice view</i> representing the rows of the given column.
@@ -518,12 +518,12 @@
 <b>Example:</b> 
 <table border="0">
   <tr nowrap> 
-	<td valign="top">2 x 3 matrix: <br>
-	  1, 2, 3<br>
-	  4, 5, 6 </td>
-	<td>viewColumn(0) ==></td>
-	<td valign="top">Matrix1D of size 2:<br>
-	  1, 4</td>
+  <td valign="top">2 x 3 matrix: <br>
+    1, 2, 3<br>
+    4, 5, 6 </td>
+  <td>viewColumn(0) ==></td>
+  <td valign="top">Matrix1D of size 2:<br>
+    1, 4</td>
    </tr>
 </table>
 
@@ -533,11 +533,11 @@
 @see #viewRow(int)
 */
 public DoubleMatrix1D viewColumn(int column) {
-	checkColumn(column);
-	int viewSize = this.rows;
-	int viewZero = index(0,column);
-	int viewStride = this.rowStride;
-	return like1D(viewSize,viewZero,viewStride);
+  checkColumn(column);
+  int viewSize = this.rows;
+  int viewZero = index(0,column);
+  int viewStride = this.rowStride;
+  return like1D(viewSize,viewZero,viewStride);
 }
 /**
 Constructs and returns a new <i>flip view</i> along the column axis.
@@ -547,17 +547,17 @@
 <b>Example:</b> 
 <table border="0">
   <tr nowrap> 
-	<td valign="top">2 x 3 matrix: <br>
-	  1, 2, 3<br>
-	  4, 5, 6 </td>
-	<td>columnFlip ==></td>
-	<td valign="top">2 x 3 matrix:<br>
-	  3, 2, 1 <br>
-	  6, 5, 4</td>
-	<td>columnFlip ==></td>
-	<td valign="top">2 x 3 matrix: <br>
-	  1, 2, 3<br>
-	  4, 5, 6 </td>
+  <td valign="top">2 x 3 matrix: <br>
+    1, 2, 3<br>
+    4, 5, 6 </td>
+  <td>columnFlip ==></td>
+  <td valign="top">2 x 3 matrix:<br>
+    3, 2, 1 <br>
+    6, 5, 4</td>
+  <td>columnFlip ==></td>
+  <td valign="top">2 x 3 matrix: <br>
+    1, 2, 3<br>
+    4, 5, 6 </td>
   </tr>
 </table>
 
@@ -565,7 +565,7 @@
 @see #viewRowFlip()
 */
 public DoubleMatrix2D viewColumnFlip() {
-	return (DoubleMatrix2D) (view().vColumnFlip());
+  return (DoubleMatrix2D) (view().vColumnFlip());
 }
 /**
 Constructs and returns a new <i>dice (transposition) view</i>; Swaps axes; example: 3 x 4 matrix --> 4 x 3 matrix.
@@ -578,25 +578,25 @@
 <b>Example:</b> 
 <table border="0">
   <tr nowrap> 
-	<td valign="top">2 x 3 matrix: <br>
-	  1, 2, 3<br>
-	  4, 5, 6 </td>
-	<td>transpose ==></td>
-	<td valign="top">3 x 2 matrix:<br>
-	  1, 4 <br>
-	  2, 5 <br>
-	  3, 6</td>
-	<td>transpose ==></td>
-	<td valign="top">2 x 3 matrix: <br>
-	  1, 2, 3<br>
-	  4, 5, 6 </td>
+  <td valign="top">2 x 3 matrix: <br>
+    1, 2, 3<br>
+    4, 5, 6 </td>
+  <td>transpose ==></td>
+  <td valign="top">3 x 2 matrix:<br>
+    1, 4 <br>
+    2, 5 <br>
+    3, 6</td>
+  <td>transpose ==></td>
+  <td valign="top">2 x 3 matrix: <br>
+    1, 2, 3<br>
+    4, 5, 6 </td>
   </tr>
 </table>
 
 @return a new dice view.
 */
 public DoubleMatrix2D viewDice() {
-	return (DoubleMatrix2D) (view().vDice());
+  return (DoubleMatrix2D) (view().vDice());
 }
 /**
 Constructs and returns a new <i>sub-range view</i> that is a <tt>height x width</tt> sub matrix starting at <tt>[row,column]</tt>.
@@ -617,12 +617,12 @@
 @param     column   The index of the column-coordinate.
 @param     height   The height of the box.
 @param     width   The width of the box.
-@throws	IndexOutOfBoundsException if <tt>column<0 || width<0 || column+width>columns() || row<0 || height<0 || row+height>rows()</tt>
+@throws  IndexOutOfBoundsException if <tt>column<0 || width<0 || column+width>columns() || row<0 || height<0 || row+height>rows()</tt>
 @return the new view.
-		
+    
 */
 public DoubleMatrix2D viewPart(int row, int column, int height, int width) {
-	return (DoubleMatrix2D) (view().vPart(row,column,height,width));
+  return (DoubleMatrix2D) (view().vPart(row,column,height,width));
 }
 /**
 Constructs and returns a new <i>slice view</i> representing the columns of the given row.
@@ -632,12 +632,12 @@
 <b>Example:</b> 
 <table border="0">
   <tr nowrap> 
-	<td valign="top">2 x 3 matrix: <br>
-	  1, 2, 3<br>
-	  4, 5, 6 </td>
-	<td>viewRow(0) ==></td>
-	<td valign="top">Matrix1D of size 3:<br>
-	  1, 2, 3</td>
+  <td valign="top">2 x 3 matrix: <br>
+    1, 2, 3<br>
+    4, 5, 6 </td>
+  <td>viewRow(0) ==></td>
+  <td valign="top">Matrix1D of size 3:<br>
+    1, 2, 3</td>
    </tr>
 </table>
 
@@ -647,11 +647,11 @@
 @see #viewColumn(int)
 */
 public DoubleMatrix1D viewRow(int row) {
-	checkRow(row);
-	int viewSize = this.columns;
-	int viewZero = index(row,0);
-	int viewStride = this.columnStride;
-	return like1D(viewSize,viewZero,viewStride);
+  checkRow(row);
+  int viewSize = this.columns;
+  int viewZero = index(row,0);
+  int viewStride = this.columnStride;
+  return like1D(viewSize,viewZero,viewStride);
 }
 /**
 Constructs and returns a new <i>flip view</i> along the row axis.
@@ -661,17 +661,17 @@
 <b>Example:</b> 
 <table border="0">
   <tr nowrap> 
-	<td valign="top">2 x 3 matrix: <br>
-	  1, 2, 3<br>
-	  4, 5, 6 </td>
-	<td>rowFlip ==></td>
-	<td valign="top">2 x 3 matrix:<br>
-	  4, 5, 6 <br>
-	  1, 2, 3</td>
-	<td>rowFlip ==></td>
-	<td valign="top">2 x 3 matrix: <br>
-	  1, 2, 3<br>
-	  4, 5, 6 </td>
+  <td valign="top">2 x 3 matrix: <br>
+    1, 2, 3<br>
+    4, 5, 6 </td>
+  <td>rowFlip ==></td>
+  <td valign="top">2 x 3 matrix:<br>
+    4, 5, 6 <br>
+    1, 2, 3</td>
+  <td>rowFlip ==></td>
+  <td valign="top">2 x 3 matrix: <br>
+    1, 2, 3<br>
+    4, 5, 6 </td>
   </tr>
 </table>
 
@@ -679,7 +679,7 @@
 @see #viewColumnFlip()
 */
 public DoubleMatrix2D viewRowFlip() {
-	return (DoubleMatrix2D) (view().vRowFlip());
+  return (DoubleMatrix2D) (view().vRowFlip());
 }
 /**
 Constructs and returns a new <i>selection view</i> that is a matrix holding the indicated cells.
@@ -709,27 +709,27 @@
 @throws IndexOutOfBoundsException if <tt>!(0 <= columnIndexes[i] < columns())</tt> for any <tt>i=0..columnIndexes.length()-1</tt>.
 */
 public DoubleMatrix2D viewSelection(int[] rowIndexes, int[] columnIndexes) {
-	// check for "all"
-	if (rowIndexes==null) {
-		rowIndexes = new int[rows];
-		for (int i=rows; --i >= 0; ) rowIndexes[i] = i;
-	}
-	if (columnIndexes==null) {
-		columnIndexes = new int[columns];
-		for (int i=columns; --i >= 0; ) columnIndexes[i] = i;
-	}
-	
-	checkRowIndexes(rowIndexes);
-	checkColumnIndexes(columnIndexes);
-	int[] rowOffsets = new int[rowIndexes.length];
-	int[] columnOffsets = new int[columnIndexes.length];
-	for (int i=rowIndexes.length; --i >= 0; ) {
-		rowOffsets[i] = _rowOffset(_rowRank(rowIndexes[i]));
-	}
-	for (int i=columnIndexes.length; --i >= 0; ) {
-		columnOffsets[i] = _columnOffset(_columnRank(columnIndexes[i]));
-	}
-	return viewSelectionLike(rowOffsets,columnOffsets);
+  // check for "all"
+  if (rowIndexes==null) {
+    rowIndexes = new int[rows];
+    for (int i=rows; --i >= 0; ) rowIndexes[i] = i;
+  }
+  if (columnIndexes==null) {
+    columnIndexes = new int[columns];
+    for (int i=columns; --i >= 0; ) columnIndexes[i] = i;
+  }
+  
+  checkRowIndexes(rowIndexes);
+  checkColumnIndexes(columnIndexes);
+  int[] rowOffsets = new int[rowIndexes.length];
+  int[] columnOffsets = new int[columnIndexes.length];
+  for (int i=rowIndexes.length; --i >= 0; ) {
+    rowOffsets[i] = _rowOffset(_rowRank(rowIndexes[i]));
+  }
+  for (int i=columnIndexes.length; --i >= 0; ) {
+    columnOffsets[i] = _columnOffset(_columnRank(columnIndexes[i]));
+  }
+  return viewSelectionLike(rowOffsets,columnOffsets);
 }
 /**
 Constructs and returns a new <i>selection view</i> that is a matrix holding all <b>rows</b> matching the given condition.
@@ -764,13 +764,13 @@
 @return the new view.
 */
 public DoubleMatrix2D viewSelection(DoubleMatrix1DProcedure condition) {
-	IntArrayList matches = new IntArrayList();
-	for (int i=0; i < rows; i++) {
-		if (condition.apply(viewRow(i))) matches.add(i);
-	}
-	
-	matches.trimToSize();
-	return viewSelection(matches.elements(), null); // take all columns
+  IntArrayList matches = new IntArrayList();
+  for (int i=0; i < rows; i++) {
+    if (condition.apply(viewRow(i))) matches.add(i);
+  }
+  
+  matches.trimToSize();
+  return viewSelection(matches.elements(), null); // take all columns
 }
 /**
  * Construct and returns a new selection view.
@@ -789,7 +789,7 @@
 @throws IndexOutOfBoundsException if <tt>column < 0 || column >= columns()</tt>.
 */
 public DoubleMatrix2D viewSorted(int column) {
-	return org.apache.mahout.matrix.matrix.doublealgo.Sorting.mergeSort.sort(this,column);
+  return org.apache.mahout.matrix.matrix.doublealgo.Sorting.mergeSort.sort(this,column);
 }
 /**
 Constructs and returns a new <i>stride view</i> which is a sub matrix consisting of every i-th cell.
@@ -799,10 +799,10 @@
 @param rowStride the row step factor.
 @param columnStride the column step factor.
 @return a new view.
-@throws	IndexOutOfBoundsException if <tt>rowStride<=0 || columnStride<=0</tt>.
+@throws  IndexOutOfBoundsException if <tt>rowStride<=0 || columnStride<=0</tt>.
 */
 public DoubleMatrix2D viewStrides(int rowStride, int columnStride) {
-	return (DoubleMatrix2D) (view().vStrides(rowStride, columnStride));
+  return (DoubleMatrix2D) (view().vStrides(rowStride, columnStride));
 }
 /**
  * Applies a procedure to each cell's value.
@@ -822,12 +822,12 @@
  * @return <tt>false</tt> if the procedure stopped before all elements where iterated over, <tt>true</tt> otherwise. 
  */
 private boolean xforEach(final org.apache.mahout.matrix.function.DoubleProcedure procedure) {
-	for (int row=rows; --row >= 0;) {
-		for (int column=columns; --column >= 0;) {
-			if (!procedure.apply(getQuick(row,column))) return false;
-		}
-	}
-	return true;
+  for (int row=rows; --row >= 0;) {
+    for (int column=columns; --column >= 0;) {
+      if (!procedure.apply(getQuick(row,column))) return false;
+    }
+  }
+  return true;
 }
 /**
 8 neighbor stencil transformation. For efficient finite difference operations.
@@ -877,54 +877,54 @@
 C.zAssign8Neighbors(B,g); // fast, even though it doesn't look like it
 };
 </pre>
-	
+  
 @param B the matrix to hold the results.
 @param function the function to be applied to the 9 cells.
 @throws NullPointerException if <tt>function==null</tt>.
 @throws IllegalArgumentException if <tt>rows() != B.rows() || columns() != B.columns()</tt>.
 */
 public void zAssign8Neighbors(DoubleMatrix2D B, org.apache.mahout.matrix.function.Double9Function function) {
-	if (function==null) throw new NullPointerException("function must not be null.");
-	checkShape(B);
-	if (rows<3 || columns<3) return; // nothing to do
-	int r = rows-1;
-	int c = columns-1;
-	double a00, a01, a02;
-	double a10, a11, a12;
-	double a20, a21, a22;
-	for (int i=1; i<r; i++) {
-		a00=getQuick(i-1,0); a01=getQuick(i-1,1); 
-		a10=getQuick(i,  0); a11=getQuick(i,  1); 
-		a20=getQuick(i+1,0); a21=getQuick(i+1,1); 
+  if (function==null) throw new NullPointerException("function must not be null.");
+  checkShape(B);
+  if (rows<3 || columns<3) return; // nothing to do
+  int r = rows-1;
+  int c = columns-1;
+  double a00, a01, a02;
+  double a10, a11, a12;
+  double a20, a21, a22;
+  for (int i=1; i<r; i++) {
+    a00=getQuick(i-1,0); a01=getQuick(i-1,1); 
+    a10=getQuick(i,  0); a11=getQuick(i,  1); 
+    a20=getQuick(i+1,0); a21=getQuick(i+1,1); 
 
-		for (int j=1; j<c; j++) {
-			// in each step six cells can be remembered in registers - they don't need to be reread from slow memory
-			// in each step 3 instead of 9 cells need to be read from memory.
-			a02=getQuick(i-1,j+1);
-			a12=getQuick(i,  j+1);
-			a22=getQuick(i+1,j+1);
-			
-			B.setQuick(i,j, function.apply(
-				a00, a01, a02,
-				a10, a11, a12,
-				a20, a21, a22));
-			
-			a00=a01;
-			a10=a11;
-			a20=a21;
+    for (int j=1; j<c; j++) {
+      // in each step six cells can be remembered in registers - they don't need to be reread from slow memory
+      // in each step 3 instead of 9 cells need to be read from memory.
+      a02=getQuick(i-1,j+1);
+      a12=getQuick(i,  j+1);
+      a22=getQuick(i+1,j+1);
+      
+      B.setQuick(i,j, function.apply(
+        a00, a01, a02,
+        a10, a11, a12,
+        a20, a21, a22));
+      
+      a00=a01;
+      a10=a11;
+      a20=a21;
 
-			a01=a02;
-			a11=a12;
-			a21=a22;
-		}
-	}
+      a01=a02;
+      a11=a12;
+      a21=a22;
+    }
+  }
 }
 /**
  * Linear algebraic matrix-vector multiplication; <tt>z = A * y</tt>; 
  * Equivalent to <tt>return A.zMult(y,z,1,0);</tt>
  */
 public DoubleMatrix1D zMult(DoubleMatrix1D y, DoubleMatrix1D z) {
-	return zMult(y,z,1,(z==null ? 1 : 0),false);
+  return zMult(y,z,1,(z==null ? 1 : 0),false);
 }
 /**
  * Linear algebraic matrix-vector multiplication; <tt>z = alpha * A * y + beta*z</tt>.
@@ -940,27 +940,27 @@
  * @throws IllegalArgumentException if <tt>A.columns() != y.size() || A.rows() > z.size())</tt>.
  */
 public DoubleMatrix1D zMult(DoubleMatrix1D y, DoubleMatrix1D z, double alpha, double beta, boolean transposeA) {
-	if (transposeA) return viewDice().zMult(y,z,alpha,beta,false);
-	//boolean ignore = (z==null);
-	if (z==null) z = new DenseDoubleMatrix1D(this.rows);
-	if (columns != y.size() || rows > z.size())	
-		throw new IllegalArgumentException("Incompatible args: "+toStringShort()+", "+y.toStringShort()+", "+z.toStringShort());
+  if (transposeA) return viewDice().zMult(y,z,alpha,beta,false);
+  //boolean ignore = (z==null);
+  if (z==null) z = new DenseDoubleMatrix1D(this.rows);
+  if (columns != y.size() || rows > z.size())  
+    throw new IllegalArgumentException("Incompatible args: "+toStringShort()+", "+y.toStringShort()+", "+z.toStringShort());
 
-	for (int i = rows; --i >= 0; ) {
-		double s = 0;
-		for (int j=columns; --j >= 0; ) {
-			s += getQuick(i,j) * y.getQuick(j);
-		}
-		z.setQuick(i,alpha*s + beta*z.getQuick(i));
-	}
-	return z;
+  for (int i = rows; --i >= 0; ) {
+    double s = 0;
+    for (int j=columns; --j >= 0; ) {
+      s += getQuick(i,j) * y.getQuick(j);
+    }
+    z.setQuick(i,alpha*s + beta*z.getQuick(i));
+  }
+  return z;
 }
 /**
  * Linear algebraic matrix-matrix multiplication; <tt>C = A x B</tt>;
  * Equivalent to <tt>A.zMult(B,C,1,0,false,false)</tt>.
  */
 public DoubleMatrix2D zMult(DoubleMatrix2D B, DoubleMatrix2D C) {
-	return zMult(B,C,1, (C==null ? 1 : 0), false,false);
+  return zMult(B,C,1, (C==null ? 1 : 0), false,false);
 }
 /**
  * Linear algebraic matrix-matrix multiplication; <tt>C = alpha * A x B + beta*C</tt>.
@@ -979,38 +979,38 @@
  * @throws IllegalArgumentException if <tt>A == C || B == C</tt>.
  */
 public DoubleMatrix2D zMult(DoubleMatrix2D B, DoubleMatrix2D C, double alpha, double beta, boolean transposeA, boolean transposeB) {
-	if (transposeA) return viewDice().zMult(B,C,alpha,beta,false,transposeB);
-	if (transposeB) return this.zMult(B.viewDice(),C,alpha,beta,transposeA,false);
-	
-	int m = rows;
-	int n = columns;
-	int p = B.columns;
+  if (transposeA) return viewDice().zMult(B,C,alpha,beta,false,transposeB);
+  if (transposeB) return this.zMult(B.viewDice(),C,alpha,beta,transposeA,false);
+  
+  int m = rows;
+  int n = columns;
+  int p = B.columns;
 
-	if (C==null) C = new DenseDoubleMatrix2D(m,p);
-	if (B.rows != n)
-		throw new IllegalArgumentException("Matrix2D inner dimensions must agree:"+toStringShort()+", "+B.toStringShort());
-	if (C.rows != m || C.columns != p)
-		throw new IllegalArgumentException("Incompatibel result matrix: "+toStringShort()+", "+B.toStringShort()+", "+C.toStringShort());
-	if (this == C || B == C)
-		throw new IllegalArgumentException("Matrices must not be identical");
-		
-	for (int j = p; --j >= 0; ) {
-		for (int i = m; --i >= 0; ) {
-			double s = 0;
-			for (int k = n; --k >= 0; ) {
-				s += getQuick(i,k) * B.getQuick(k,j);
-			}
-			C.setQuick(i,j,alpha*s + beta*C.getQuick(i,j));
-		}
-	}
-	return C;
+  if (C==null) C = new DenseDoubleMatrix2D(m,p);
+  if (B.rows != n)
+    throw new IllegalArgumentException("Matrix2D inner dimensions must agree:"+toStringShort()+", "+B.toStringShort());
+  if (C.rows != m || C.columns != p)
+    throw new IllegalArgumentException("Incompatibel result matrix: "+toStringShort()+", "+B.toStringShort()+", "+C.toStringShort());
+  if (this == C || B == C)
+    throw new IllegalArgumentException("Matrices must not be identical");
+    
+  for (int j = p; --j >= 0; ) {
+    for (int i = m; --i >= 0; ) {
+      double s = 0;
+      for (int k = n; --k >= 0; ) {
+        s += getQuick(i,k) * B.getQuick(k,j);
+      }
+      C.setQuick(i,j,alpha*s + beta*C.getQuick(i,j));
+    }
+  }
+  return C;
 }
 /**
  * Returns the sum of all cells; <tt>Sum( x[i,j] )</tt>.
  * @return the sum.
  */
 public double zSum() {
-	if (size()==0) return 0;
-	return aggregate(org.apache.mahout.jet.math.Functions.plus, org.apache.mahout.jet.math.Functions.identity);
+  if (size()==0) return 0;
+  return aggregate(org.apache.mahout.jet.math.Functions.plus, org.apache.mahout.jet.math.Functions.identity);
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/ObjectFactory3D.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/ObjectFactory3D.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/ObjectFactory3D.java	(working copy)
@@ -35,15 +35,15 @@
  */
 @Deprecated
 public class ObjectFactory3D extends org.apache.mahout.matrix.PersistentObject {
-	/**
-	 * A factory producing dense matrices.
-	 */
-	public static final ObjectFactory3D dense  = new ObjectFactory3D();
+  /**
+   * A factory producing dense matrices.
+   */
+  public static final ObjectFactory3D dense  = new ObjectFactory3D();
 
-	/**
-	 * A factory producing sparse matrices.
-	 */
-	public static final ObjectFactory3D sparse = new ObjectFactory3D();
+  /**
+   * A factory producing sparse matrices.
+   */
+  public static final ObjectFactory3D sparse = new ObjectFactory3D();
 /**
  * Makes this class non instantiable, but still let's others inherit from it.
  */
@@ -61,20 +61,20 @@
  * @throws IllegalArgumentException if <tt>for any 0 &lt;= column &lt; columns(): values[slice][row].length != columns()</tt>.
  */
 public ObjectMatrix3D make(Object[][][] values) {
-	if (this==sparse) return new SparseObjectMatrix3D(values);
-	return new DenseObjectMatrix3D(values);
+  if (this==sparse) return new SparseObjectMatrix3D(values);
+  return new DenseObjectMatrix3D(values);
 }
 /**
  * Constructs a matrix with the given shape, each cell initialized with zero.
  */
 public ObjectMatrix3D make(int slices, int rows, int columns) {
-	if (this==sparse) return new SparseObjectMatrix3D(slices,rows,columns);
-	return new DenseObjectMatrix3D(slices,rows,columns);
+  if (this==sparse) return new SparseObjectMatrix3D(slices,rows,columns);
+  return new DenseObjectMatrix3D(slices,rows,columns);
 }
 /**
  * Constructs a matrix with the given shape, each cell initialized with the given value.
  */
 public ObjectMatrix3D make(int slices, int rows, int columns, Object initialValue) {
-	return make(slices,rows,columns).assign(initialValue);
+  return make(slices,rows,columns).assign(initialValue);
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/Smp.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/Smp.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/Smp.java	(working copy)
@@ -14,182 +14,182 @@
 /*
 */
 class Smp {
-	protected FJTaskRunnerGroup taskGroup; // a very efficient and light weight thread pool
+  protected FJTaskRunnerGroup taskGroup; // a very efficient and light weight thread pool
 
-	protected int maxThreads;	
+  protected int maxThreads;  
 /**
 Constructs a new Smp using a maximum of <tt>maxThreads<tt> threads.
 */
 protected Smp(int maxThreads) {
-	maxThreads = Math.max(1,maxThreads);
-	this.maxThreads = maxThreads;
-	if (maxThreads>1) {
-		this.taskGroup = new FJTaskRunnerGroup(maxThreads);
-	}
-	else { // avoid parallel overhead
-		this.taskGroup = null;
-	}
+  maxThreads = Math.max(1,maxThreads);
+  this.maxThreads = maxThreads;
+  if (maxThreads>1) {
+    this.taskGroup = new FJTaskRunnerGroup(maxThreads);
+  }
+  else { // avoid parallel overhead
+    this.taskGroup = null;
+  }
 }
 /**
  * Clean up deamon threads, if necessary.
  */
 public void finalize() {
-	if (this.taskGroup!=null) this.taskGroup.interruptAll();
+  if (this.taskGroup!=null) this.taskGroup.interruptAll();
 }
 protected void run(final DoubleMatrix2D[] blocksA, final DoubleMatrix2D[] blocksB, final double[] results, final Matrix2DMatrix2DFunction function) {
-	final FJTask[] subTasks = new FJTask[blocksA.length];
-	for (int i=0; i<blocksA.length; i++) {
-		final int k = i;
-		subTasks[i] = new FJTask() { 
-			public void run() {
-				double result = function.apply(blocksA[k],blocksB != null ? blocksB[k] : null);
-				if (results!=null) results[k] = result; 
-				//System.out.print("."); 
-			}
-		};
-	}
+  final FJTask[] subTasks = new FJTask[blocksA.length];
+  for (int i=0; i<blocksA.length; i++) {
+    final int k = i;
+    subTasks[i] = new FJTask() { 
+      public void run() {
+        double result = function.apply(blocksA[k],blocksB != null ? blocksB[k] : null);
+        if (results!=null) results[k] = result; 
+        //System.out.print("."); 
+      }
+    };
+  }
 
-	// run tasks and wait for completion
-	try { 
-		this.taskGroup.invoke(
-			new FJTask() {
-				public void run() {	
-					coInvoke(subTasks);	
-				}
-			}
-		);
-	} catch (InterruptedException exc) {}
+  // run tasks and wait for completion
+  try { 
+    this.taskGroup.invoke(
+      new FJTask() {
+        public void run() {  
+          coInvoke(subTasks);  
+        }
+      }
+    );
+  } catch (InterruptedException exc) {}
 }
 protected DoubleMatrix2D[] splitBlockedNN(DoubleMatrix2D A, int threshold, long flops) {
-	/*
-	determine how to split and parallelize best into blocks
-	if more B.columns than tasks --> split B.columns, as follows:
-	
-			xx|xx|xxx B
-			xx|xx|xxx
-			xx|xx|xxx
-	A
-	xxx     xx|xx|xxx C 
-	xxx		xx|xx|xxx
-	xxx		xx|xx|xxx
-	xxx		xx|xx|xxx
-	xxx		xx|xx|xxx
+  /*
+  determine how to split and parallelize best into blocks
+  if more B.columns than tasks --> split B.columns, as follows:
+  
+      xx|xx|xxx B
+      xx|xx|xxx
+      xx|xx|xxx
+  A
+  xxx     xx|xx|xxx C 
+  xxx    xx|xx|xxx
+  xxx    xx|xx|xxx
+  xxx    xx|xx|xxx
+  xxx    xx|xx|xxx
 
-	if less B.columns than tasks --> split A.rows, as follows:
-	
-			xxxxxxx B
-			xxxxxxx
-			xxxxxxx
-	A
-	xxx     xxxxxxx C
-	xxx     xxxxxxx
-	---     -------
-	xxx     xxxxxxx
-	xxx     xxxxxxx
-	---     -------
-	xxx     xxxxxxx
+  if less B.columns than tasks --> split A.rows, as follows:
+  
+      xxxxxxx B
+      xxxxxxx
+      xxxxxxx
+  A
+  xxx     xxxxxxx C
+  xxx     xxxxxxx
+  ---     -------
+  xxx     xxxxxxx
+  xxx     xxxxxxx
+  ---     -------
+  xxx     xxxxxxx
 
-	*/
-	//long flops = 2L*A.rows()*A.columns()*A.columns();
-	int noOfTasks = (int) Math.min(flops / threshold, this.maxThreads); // each thread should process at least 30000 flops
-	boolean splitHoriz = (A.columns() < noOfTasks);
-	//boolean splitHoriz = (A.columns() >= noOfTasks);
-	int p = splitHoriz ? A.rows() : A.columns();
-	noOfTasks = Math.min(p,noOfTasks);
-	
-	if (noOfTasks < 2) { // parallelization doesn't pay off (too much start up overhead)
-		return null;
-	}
+  */
+  //long flops = 2L*A.rows()*A.columns()*A.columns();
+  int noOfTasks = (int) Math.min(flops / threshold, this.maxThreads); // each thread should process at least 30000 flops
+  boolean splitHoriz = (A.columns() < noOfTasks);
+  //boolean splitHoriz = (A.columns() >= noOfTasks);
+  int p = splitHoriz ? A.rows() : A.columns();
+  noOfTasks = Math.min(p,noOfTasks);
+  
+  if (noOfTasks < 2) { // parallelization doesn't pay off (too much start up overhead)
+    return null;
+  }
 
-	// set up concurrent tasks
-	int span = p/noOfTasks;
-	final DoubleMatrix2D[] blocks = new DoubleMatrix2D[noOfTasks];
-	for (int i=0; i<noOfTasks; i++) {
-		final int offset = i*span;
-		if (i==noOfTasks-1) span = p - span*i; // last span may be a bit larger
+  // set up concurrent tasks
+  int span = p/noOfTasks;
+  final DoubleMatrix2D[] blocks = new DoubleMatrix2D[noOfTasks];
+  for (int i=0; i<noOfTasks; i++) {
+    final int offset = i*span;
+    if (i==noOfTasks-1) span = p - span*i; // last span may be a bit larger
 
-		final DoubleMatrix2D AA,BB,CC; 
-		if (!splitHoriz) { 	// split B along columns into blocks
-			blocks[i] = A.viewPart(0,offset, A.rows(), span);
-		}
-		else { // split A along rows into blocks
-			blocks[i] = A.viewPart(offset,0,span,A.columns());
-		}
-	}
-	return blocks;
+    final DoubleMatrix2D AA,BB,CC; 
+    if (!splitHoriz) {   // split B along columns into blocks
+      blocks[i] = A.viewPart(0,offset, A.rows(), span);
+    }
+    else { // split A along rows into blocks
+      blocks[i] = A.viewPart(offset,0,span,A.columns());
+    }
+  }
+  return blocks;
 }
 protected DoubleMatrix2D[][] splitBlockedNN(DoubleMatrix2D A, DoubleMatrix2D B, int threshold, long flops) {
-	DoubleMatrix2D[] blocksA = splitBlockedNN(A,threshold, flops);
-	if (blocksA==null) return null;
-	DoubleMatrix2D[] blocksB = splitBlockedNN(B,threshold, flops);
-	if (blocksB==null) return null;
-	DoubleMatrix2D[][] blocks = {blocksA,blocksB};
-	return blocks;
+  DoubleMatrix2D[] blocksA = splitBlockedNN(A,threshold, flops);
+  if (blocksA==null) return null;
+  DoubleMatrix2D[] blocksB = splitBlockedNN(B,threshold, flops);
+  if (blocksB==null) return null;
+  DoubleMatrix2D[][] blocks = {blocksA,blocksB};
+  return blocks;
 }
 protected DoubleMatrix2D[] splitStridedNN(DoubleMatrix2D A, int threshold, long flops) {
-	/*
-	determine how to split and parallelize best into blocks
-	if more B.columns than tasks --> split B.columns, as follows:
-	
-			xx|xx|xxx B
-			xx|xx|xxx
-			xx|xx|xxx
-	A
-	xxx     xx|xx|xxx C 
-	xxx		xx|xx|xxx
-	xxx		xx|xx|xxx
-	xxx		xx|xx|xxx
-	xxx		xx|xx|xxx
+  /*
+  determine how to split and parallelize best into blocks
+  if more B.columns than tasks --> split B.columns, as follows:
+  
+      xx|xx|xxx B
+      xx|xx|xxx
+      xx|xx|xxx
+  A
+  xxx     xx|xx|xxx C 
+  xxx    xx|xx|xxx
+  xxx    xx|xx|xxx
+  xxx    xx|xx|xxx
+  xxx    xx|xx|xxx
 
-	if less B.columns than tasks --> split A.rows, as follows:
-	
-			xxxxxxx B
-			xxxxxxx
-			xxxxxxx
-	A
-	xxx     xxxxxxx C
-	xxx     xxxxxxx
-	---     -------
-	xxx     xxxxxxx
-	xxx     xxxxxxx
-	---     -------
-	xxx     xxxxxxx
+  if less B.columns than tasks --> split A.rows, as follows:
+  
+      xxxxxxx B
+      xxxxxxx
+      xxxxxxx
+  A
+  xxx     xxxxxxx C
+  xxx     xxxxxxx
+  ---     -------
+  xxx     xxxxxxx
+  xxx     xxxxxxx
+  ---     -------
+  xxx     xxxxxxx
 
-	*/
-	//long flops = 2L*A.rows()*A.columns()*A.columns();
-	int noOfTasks = (int) Math.min(flops / threshold, this.maxThreads); // each thread should process at least 30000 flops
-	boolean splitHoriz = (A.columns() < noOfTasks);
-	//boolean splitHoriz = (A.columns() >= noOfTasks);
-	int p = splitHoriz ? A.rows() : A.columns();
-	noOfTasks = Math.min(p,noOfTasks);
-	
-	if (noOfTasks < 2) { // parallelization doesn't pay off (too much start up overhead)
-		return null;
-	}
+  */
+  //long flops = 2L*A.rows()*A.columns()*A.columns();
+  int noOfTasks = (int) Math.min(flops / threshold, this.maxThreads); // each thread should process at least 30000 flops
+  boolean splitHoriz = (A.columns() < noOfTasks);
+  //boolean splitHoriz = (A.columns() >= noOfTasks);
+  int p = splitHoriz ? A.rows() : A.columns();
+  noOfTasks = Math.min(p,noOfTasks);
+  
+  if (noOfTasks < 2) { // parallelization doesn't pay off (too much start up overhead)
+    return null;
+  }
 
-	// set up concurrent tasks
-	int span = p/noOfTasks;
-	final DoubleMatrix2D[] blocks = new DoubleMatrix2D[noOfTasks];
-	for (int i=0; i<noOfTasks; i++) {
-		final int offset = i*span;
-		if (i==noOfTasks-1) span = p - span*i; // last span may be a bit larger
+  // set up concurrent tasks
+  int span = p/noOfTasks;
+  final DoubleMatrix2D[] blocks = new DoubleMatrix2D[noOfTasks];
+  for (int i=0; i<noOfTasks; i++) {
+    final int offset = i*span;
+    if (i==noOfTasks-1) span = p - span*i; // last span may be a bit larger
 
-		final DoubleMatrix2D AA,BB,CC; 
-		if (!splitHoriz) { 
-			// split B along columns into blocks
-			blocks[i] = A.viewPart(0,i,A.rows(),A.columns()-i).viewStrides(1,noOfTasks);
-		}
-		else { 
-			// split A along rows into blocks
-			blocks[i] = A.viewPart(i,0,A.rows()-i,A.columns()).viewStrides(noOfTasks,1);
-		}
-	}
-	return blocks;
+    final DoubleMatrix2D AA,BB,CC; 
+    if (!splitHoriz) { 
+      // split B along columns into blocks
+      blocks[i] = A.viewPart(0,i,A.rows(),A.columns()-i).viewStrides(1,noOfTasks);
+    }
+    else { 
+      // split A along rows into blocks
+      blocks[i] = A.viewPart(i,0,A.rows()-i,A.columns()).viewStrides(noOfTasks,1);
+    }
+  }
+  return blocks;
 }
 /**
  * Prints various snapshot statistics to System.out; Simply delegates to {@link EDU.oswego.cs.dl.util.concurrent.FJTaskRunnerGroup#stats}.
  */
 public void stats() {
-	if (this.taskGroup!=null) this.taskGroup.stats();
+  if (this.taskGroup!=null) this.taskGroup.stats();
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/SmpBlas.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/SmpBlas.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/SmpBlas.java	(working copy)
@@ -61,27 +61,27 @@
  */
 @Deprecated
 public class SmpBlas implements Blas {
-	/**
-	* The public global parallel blas; initialized via {@link #allocateBlas}.
-	* Do not modify this variable via other means (it is public).
-	*/
-	public static Blas smpBlas = SeqBlas.seqBlas;
-		
-	protected Blas seqBlas; // blocks are operated on in parallel; for each block this seq algo is used.
+  /**
+  * The public global parallel blas; initialized via {@link #allocateBlas}.
+  * Do not modify this variable via other means (it is public).
+  */
+  public static Blas smpBlas = SeqBlas.seqBlas;
+    
+  protected Blas seqBlas; // blocks are operated on in parallel; for each block this seq algo is used.
 
-	protected Smp smp;
-		
-	protected int maxThreads;
+  protected Smp smp;
+    
+  protected int maxThreads;
 
-	protected static int NN_THRESHOLD = 30000;
+  protected static int NN_THRESHOLD = 30000;
 /**
 Constructs a blas using a maximum of <tt>maxThreads<tt> threads; each executing the given sequential algos.
 */
 protected SmpBlas(int maxThreads, Blas seqBlas) {
-	this.seqBlas = seqBlas;
-	this.maxThreads = maxThreads;
-	this.smp = new Smp(maxThreads);
-	//Smp.smp = new Smp(maxThreads);
+  this.seqBlas = seqBlas;
+  this.maxThreads = maxThreads;
+  this.smp = new Smp(maxThreads);
+  //Smp.smp = new Smp(maxThreads);
 }
 /**
 Sets the public global variable <tt>SmpBlas.smpBlas</tt> to a blas using a maximum of <tt>maxThreads</tt> threads, each executing the given sequential algorithm; <tt>maxThreads</tt> is normally the number of CPUs.
@@ -91,302 +91,302 @@
 @param seqBlas the sequential blas algorithms to be used on concurrently processed matrix blocks.
 */
 public static void allocateBlas(int maxThreads, Blas seqBlas) {
-	if (smpBlas instanceof SmpBlas) { // no need to change anything?
-		SmpBlas s = (SmpBlas) smpBlas;
-		if (s.maxThreads == maxThreads && s.seqBlas == seqBlas) return;
-	}
+  if (smpBlas instanceof SmpBlas) { // no need to change anything?
+    SmpBlas s = (SmpBlas) smpBlas;
+    if (s.maxThreads == maxThreads && s.seqBlas == seqBlas) return;
+  }
 
-	if (maxThreads<=1) 
-		smpBlas = seqBlas;
-	else {
-		smpBlas = new SmpBlas(maxThreads, seqBlas);
-	}
+  if (maxThreads<=1) 
+    smpBlas = seqBlas;
+  else {
+    smpBlas = new SmpBlas(maxThreads, seqBlas);
+  }
 }
 public void assign(DoubleMatrix2D A, final org.apache.mahout.matrix.function.DoubleFunction function) {
-	run(A,false,
-		new Matrix2DMatrix2DFunction() {
-			public double apply(DoubleMatrix2D AA, DoubleMatrix2D BB) {
-				seqBlas.assign(AA,function);
-				return 0;
-			}
-		}
-	);
+  run(A,false,
+    new Matrix2DMatrix2DFunction() {
+      public double apply(DoubleMatrix2D AA, DoubleMatrix2D BB) {
+        seqBlas.assign(AA,function);
+        return 0;
+      }
+    }
+  );
 }
 public void assign(DoubleMatrix2D A, DoubleMatrix2D B, final org.apache.mahout.matrix.function.DoubleDoubleFunction function) {
-	run(A,B,false,
-		new Matrix2DMatrix2DFunction() {
-			public double apply(DoubleMatrix2D AA, DoubleMatrix2D BB) {
-				seqBlas.assign(AA,BB,function);
-				return 0;
-			}
-		}
-	);
+  run(A,B,false,
+    new Matrix2DMatrix2DFunction() {
+      public double apply(DoubleMatrix2D AA, DoubleMatrix2D BB) {
+        seqBlas.assign(AA,BB,function);
+        return 0;
+      }
+    }
+  );
 }
 public double dasum(DoubleMatrix1D x) {
-	return seqBlas.dasum(x);
+  return seqBlas.dasum(x);
 }
 public void daxpy(double alpha, DoubleMatrix1D x, DoubleMatrix1D y) {
-	seqBlas.daxpy(alpha,x,y);
+  seqBlas.daxpy(alpha,x,y);
 }
 public void daxpy(double alpha, DoubleMatrix2D A, DoubleMatrix2D B) {
-	seqBlas.daxpy(alpha,A,B);
+  seqBlas.daxpy(alpha,A,B);
 }
 public void dcopy(DoubleMatrix1D x, DoubleMatrix1D y) {
-	seqBlas.dcopy(x,y);
+  seqBlas.dcopy(x,y);
 }
 public void dcopy(DoubleMatrix2D A, DoubleMatrix2D B) {
-	seqBlas.dcopy(A, B);
+  seqBlas.dcopy(A, B);
 }
 public double ddot(DoubleMatrix1D x, DoubleMatrix1D y) {
-	return seqBlas.ddot(x,y);
+  return seqBlas.ddot(x,y);
 }
 public void dgemm(final boolean transposeA, final boolean transposeB, final double alpha, final DoubleMatrix2D A, final DoubleMatrix2D B, final double beta, final DoubleMatrix2D C) {
-	/*
-	determine how to split and parallelize best into blocks
-	if more B.columns than tasks --> split B.columns, as follows:
-	
-			xx|xx|xxx B
-			xx|xx|xxx
-			xx|xx|xxx
-	A
-	xxx     xx|xx|xxx C 
-	xxx		xx|xx|xxx
-	xxx		xx|xx|xxx
-	xxx		xx|xx|xxx
-	xxx		xx|xx|xxx
+  /*
+  determine how to split and parallelize best into blocks
+  if more B.columns than tasks --> split B.columns, as follows:
+  
+      xx|xx|xxx B
+      xx|xx|xxx
+      xx|xx|xxx
+  A
+  xxx     xx|xx|xxx C 
+  xxx    xx|xx|xxx
+  xxx    xx|xx|xxx
+  xxx    xx|xx|xxx
+  xxx    xx|xx|xxx
 
-	if less B.columns than tasks --> split A.rows, as follows:
-	
-			xxxxxxx B
-			xxxxxxx
-			xxxxxxx
-	A
-	xxx     xxxxxxx C
-	xxx     xxxxxxx
-	---     -------
-	xxx     xxxxxxx
-	xxx     xxxxxxx
-	---     -------
-	xxx     xxxxxxx
+  if less B.columns than tasks --> split A.rows, as follows:
+  
+      xxxxxxx B
+      xxxxxxx
+      xxxxxxx
+  A
+  xxx     xxxxxxx C
+  xxx     xxxxxxx
+  ---     -------
+  xxx     xxxxxxx
+  xxx     xxxxxxx
+  ---     -------
+  xxx     xxxxxxx
 
-	*/
-	if (transposeA) {
-		dgemm(false, transposeB, alpha, A.viewDice(), B, beta, C);
-		return;
-	}
-	if (transposeB) {
-		dgemm(transposeA, false, alpha, A, B.viewDice(), beta, C);
-		return;
-	}
-	int m = A.rows();
-	int n = A.columns();
-	int p = B.columns();
+  */
+  if (transposeA) {
+    dgemm(false, transposeB, alpha, A.viewDice(), B, beta, C);
+    return;
+  }
+  if (transposeB) {
+    dgemm(transposeA, false, alpha, A, B.viewDice(), beta, C);
+    return;
+  }
+  int m = A.rows();
+  int n = A.columns();
+  int p = B.columns();
 
-	if (B.rows() != n)
-		throw new IllegalArgumentException("Matrix2D inner dimensions must agree:"+A.toStringShort()+", "+B.toStringShort());
-	if (C.rows() != m || C.columns() != p)
-		throw new IllegalArgumentException("Incompatibel result matrix: "+A.toStringShort()+", "+B.toStringShort()+", "+C.toStringShort());
-	if (A == C || B == C)
-		throw new IllegalArgumentException("Matrices must not be identical");
+  if (B.rows() != n)
+    throw new IllegalArgumentException("Matrix2D inner dimensions must agree:"+A.toStringShort()+", "+B.toStringShort());
+  if (C.rows() != m || C.columns() != p)
+    throw new IllegalArgumentException("Incompatibel result matrix: "+A.toStringShort()+", "+B.toStringShort()+", "+C.toStringShort());
+  if (A == C || B == C)
+    throw new IllegalArgumentException("Matrices must not be identical");
 
-	long flops = 2L*m*n*p;
-	int noOfTasks = (int) Math.min(flops / 30000, this.maxThreads); // each thread should process at least 30000 flops
-	boolean splitB = (p >= noOfTasks);
-	int width = splitB ? p : m;
-	noOfTasks = Math.min(width,noOfTasks);
-	
-	if (noOfTasks < 2) { // parallelization doesn't pay off (too much start up overhead)
-		seqBlas.dgemm(transposeA, transposeB, alpha, A, B, beta, C);
-		return;
-	}
-	
-	// set up concurrent tasks
-	int span = width/noOfTasks;
-	final FJTask[] subTasks = new FJTask[noOfTasks];
-	for (int i=0; i<noOfTasks; i++) {
-		final int offset = i*span;
-		if (i==noOfTasks-1) span = width - span*i; // last span may be a bit larger
+  long flops = 2L*m*n*p;
+  int noOfTasks = (int) Math.min(flops / 30000, this.maxThreads); // each thread should process at least 30000 flops
+  boolean splitB = (p >= noOfTasks);
+  int width = splitB ? p : m;
+  noOfTasks = Math.min(width,noOfTasks);
+  
+  if (noOfTasks < 2) { // parallelization doesn't pay off (too much start up overhead)
+    seqBlas.dgemm(transposeA, transposeB, alpha, A, B, beta, C);
+    return;
+  }
+  
+  // set up concurrent tasks
+  int span = width/noOfTasks;
+  final FJTask[] subTasks = new FJTask[noOfTasks];
+  for (int i=0; i<noOfTasks; i++) {
+    final int offset = i*span;
+    if (i==noOfTasks-1) span = width - span*i; // last span may be a bit larger
 
-		final DoubleMatrix2D AA,BB,CC; 
-		if (splitB) { 
-			// split B along columns into blocks
-			AA = A;
-			BB = B.viewPart(0,offset,n,span);
-			CC = C.viewPart(0,offset,m,span);
-		}
-		else { 
-			// split A along rows into blocks
-			AA = A.viewPart(offset,0,span,n);
-			BB = B;
-			CC = C.viewPart(offset,0,span,p);
-		}
-				
-		subTasks[i] = new FJTask() { 
-			public void run() { 
-				seqBlas.dgemm(transposeA,transposeB,alpha,AA,BB,beta,CC); 
-				//System.out.println("Hello "+offset); 
-			}
-		};
-	}
-	
-	// run tasks and wait for completion
-	try { 
-		this.smp.taskGroup.invoke(
-			new FJTask() {
-				public void run() {	
-					coInvoke(subTasks);	
-				}
-			}
-		);
-	} catch (InterruptedException exc) {}
+    final DoubleMatrix2D AA,BB,CC; 
+    if (splitB) { 
+      // split B along columns into blocks
+      AA = A;
+      BB = B.viewPart(0,offset,n,span);
+      CC = C.viewPart(0,offset,m,span);
+    }
+    else { 
+      // split A along rows into blocks
+      AA = A.viewPart(offset,0,span,n);
+      BB = B;
+      CC = C.viewPart(offset,0,span,p);
+    }
+        
+    subTasks[i] = new FJTask() { 
+      public void run() { 
+        seqBlas.dgemm(transposeA,transposeB,alpha,AA,BB,beta,CC); 
+        //System.out.println("Hello "+offset); 
+      }
+    };
+  }
+  
+  // run tasks and wait for completion
+  try { 
+    this.smp.taskGroup.invoke(
+      new FJTask() {
+        public void run() {  
+          coInvoke(subTasks);  
+        }
+      }
+    );
+  } catch (InterruptedException exc) {}
 }
 public void dgemv(final boolean transposeA, final double alpha, DoubleMatrix2D A, final DoubleMatrix1D x, final double beta, DoubleMatrix1D y) {
-	/*
-	split A, as follows:
-	
-			x x
-			x
-			x
-	A
-	xxx     x y
-	xxx     x
-	---     -
-	xxx     x
-	xxx     x
-	---     -
-	xxx     x
+  /*
+  split A, as follows:
+  
+      x x
+      x
+      x
+  A
+  xxx     x y
+  xxx     x
+  ---     -
+  xxx     x
+  xxx     x
+  ---     -
+  xxx     x
 
-	*/
-	if (transposeA) {
-		dgemv(false, alpha, A.viewDice(), x, beta, y);
-		return;
-	}
-	int m = A.rows();
-	int n = A.columns();
-	long flops = 2L*m*n;
-	int noOfTasks = (int) Math.min(flops / 30000, this.maxThreads); // each thread should process at least 30000 flops
-	int width = A.rows();
-	noOfTasks = Math.min(width,noOfTasks);
-	
-	if (noOfTasks < 2) { // parallelization doesn't pay off (too much start up overhead)
-		seqBlas.dgemv(transposeA, alpha, A, x, beta, y);
-		return;
-	}
-	
-	// set up concurrent tasks
-	int span = width/noOfTasks;
-	final FJTask[] subTasks = new FJTask[noOfTasks];
-	for (int i=0; i<noOfTasks; i++) {
-		final int offset = i*span;
-		if (i==noOfTasks-1) span = width - span*i; // last span may be a bit larger
+  */
+  if (transposeA) {
+    dgemv(false, alpha, A.viewDice(), x, beta, y);
+    return;
+  }
+  int m = A.rows();
+  int n = A.columns();
+  long flops = 2L*m*n;
+  int noOfTasks = (int) Math.min(flops / 30000, this.maxThreads); // each thread should process at least 30000 flops
+  int width = A.rows();
+  noOfTasks = Math.min(width,noOfTasks);
+  
+  if (noOfTasks < 2) { // parallelization doesn't pay off (too much start up overhead)
+    seqBlas.dgemv(transposeA, alpha, A, x, beta, y);
+    return;
+  }
+  
+  // set up concurrent tasks
+  int span = width/noOfTasks;
+  final FJTask[] subTasks = new FJTask[noOfTasks];
+  for (int i=0; i<noOfTasks; i++) {
+    final int offset = i*span;
+    if (i==noOfTasks-1) span = width - span*i; // last span may be a bit larger
 
-		// split A along rows into blocks
-		final DoubleMatrix2D AA = A.viewPart(offset,0,span,n);
-		final DoubleMatrix1D yy = y.viewPart(offset,span);
-				
-		subTasks[i] = new FJTask() { 
-			public void run() { 
-				seqBlas.dgemv(transposeA,alpha,AA,x,beta,yy); 
-				//System.out.println("Hello "+offset); 
-			}
-		};
-	}
-	
-	// run tasks and wait for completion
-	try { 
-		this.smp.taskGroup.invoke(
-			new FJTask() {
-				public void run() {	
-					coInvoke(subTasks);	
-				}
-			}
-		);
-	} catch (InterruptedException exc) {}
+    // split A along rows into blocks
+    final DoubleMatrix2D AA = A.viewPart(offset,0,span,n);
+    final DoubleMatrix1D yy = y.viewPart(offset,span);
+        
+    subTasks[i] = new FJTask() { 
+      public void run() { 
+        seqBlas.dgemv(transposeA,alpha,AA,x,beta,yy); 
+        //System.out.println("Hello "+offset); 
+      }
+    };
+  }
+  
+  // run tasks and wait for completion
+  try { 
+    this.smp.taskGroup.invoke(
+      new FJTask() {
+        public void run() {  
+          coInvoke(subTasks);  
+        }
+      }
+    );
+  } catch (InterruptedException exc) {}
 }
 public void dger(double alpha, DoubleMatrix1D x, DoubleMatrix1D y, DoubleMatrix2D A) {
-	seqBlas.dger(alpha,x,y,A);
+  seqBlas.dger(alpha,x,y,A);
 }
 public double dnrm2(DoubleMatrix1D x) {
-	return seqBlas.dnrm2(x);
+  return seqBlas.dnrm2(x);
 }
 public void drot(DoubleMatrix1D x, DoubleMatrix1D y, double c, double s) {
-	seqBlas.drot(x,y,c,s);
+  seqBlas.drot(x,y,c,s);
 }
 public void drotg(double a, double b, double rotvec[]) {
-	seqBlas.drotg(a,b,rotvec);
+  seqBlas.drotg(a,b,rotvec);
 }
 public void dscal(double alpha, DoubleMatrix1D x) {
-	seqBlas.dscal(alpha,x);
+  seqBlas.dscal(alpha,x);
 }
 public void dscal(double alpha, DoubleMatrix2D A) {
-	seqBlas.dscal(alpha, A);
+  seqBlas.dscal(alpha, A);
 }
 public void dswap(DoubleMatrix1D x, DoubleMatrix1D y) {
-	seqBlas.dswap(x,y);
+  seqBlas.dswap(x,y);
 }
 public void dswap(DoubleMatrix2D A, DoubleMatrix2D B) {
-	seqBlas.dswap(A,B);
+  seqBlas.dswap(A,B);
 }
 public void dsymv(boolean isUpperTriangular, double alpha, DoubleMatrix2D A, DoubleMatrix1D x, double beta, DoubleMatrix1D y) {
-	seqBlas.dsymv(isUpperTriangular, alpha, A, x, beta, y);
+  seqBlas.dsymv(isUpperTriangular, alpha, A, x, beta, y);
 }
 public void dtrmv(boolean isUpperTriangular, boolean transposeA, boolean isUnitTriangular, DoubleMatrix2D A, DoubleMatrix1D x) {
-	seqBlas.dtrmv(isUpperTriangular, transposeA, isUnitTriangular, A, x);
+  seqBlas.dtrmv(isUpperTriangular, transposeA, isUnitTriangular, A, x);
 }
 public int idamax(DoubleMatrix1D x) {
-	return seqBlas.idamax(x);
+  return seqBlas.idamax(x);
 }
 protected double[] run(DoubleMatrix2D A, DoubleMatrix2D B, boolean collectResults, Matrix2DMatrix2DFunction fun) {
-	DoubleMatrix2D[][] blocks;
-	blocks = this.smp.splitBlockedNN(A, B, NN_THRESHOLD, A.rows()*A.columns());
-	//blocks = this.smp.splitStridedNN(A, B, NN_THRESHOLD, A.rows()*A.columns());
-	int b = blocks!=null ? blocks[0].length : 1;
-	double[] results = collectResults ? new double[b] : null;
-	
-	if (blocks==null) {  // too small --> sequential
-		double result = fun.apply(A,B);
-		if (collectResults) results[0] = result;
-		return results;
-	}
-	else {  // parallel
-		this.smp.run(blocks[0],blocks[1],results,fun);
-	}
-	return results;
+  DoubleMatrix2D[][] blocks;
+  blocks = this.smp.splitBlockedNN(A, B, NN_THRESHOLD, A.rows()*A.columns());
+  //blocks = this.smp.splitStridedNN(A, B, NN_THRESHOLD, A.rows()*A.columns());
+  int b = blocks!=null ? blocks[0].length : 1;
+  double[] results = collectResults ? new double[b] : null;
+  
+  if (blocks==null) {  // too small --> sequential
+    double result = fun.apply(A,B);
+    if (collectResults) results[0] = result;
+    return results;
+  }
+  else {  // parallel
+    this.smp.run(blocks[0],blocks[1],results,fun);
+  }
+  return results;
 }
 protected double[] run(DoubleMatrix2D A, boolean collectResults, Matrix2DMatrix2DFunction fun) {
-	DoubleMatrix2D[] blocks;
-	blocks = this.smp.splitBlockedNN(A, NN_THRESHOLD, A.rows()*A.columns());
-	//blocks = this.smp.splitStridedNN(A, NN_THRESHOLD, A.rows()*A.columns());
-	int b = blocks!=null ? blocks.length : 1;
-	double[] results = collectResults ? new double[b] : null;
-	
-	if (blocks==null) { // too small -> sequential
-		double result = fun.apply(A,null);
-		if (collectResults) results[0] = result;
-		return results;
-	}
-	else { // parallel
-		this.smp.run(blocks,null,results,fun);
-	}
-	return results;
+  DoubleMatrix2D[] blocks;
+  blocks = this.smp.splitBlockedNN(A, NN_THRESHOLD, A.rows()*A.columns());
+  //blocks = this.smp.splitStridedNN(A, NN_THRESHOLD, A.rows()*A.columns());
+  int b = blocks!=null ? blocks.length : 1;
+  double[] results = collectResults ? new double[b] : null;
+  
+  if (blocks==null) { // too small -> sequential
+    double result = fun.apply(A,null);
+    if (collectResults) results[0] = result;
+    return results;
+  }
+  else { // parallel
+    this.smp.run(blocks,null,results,fun);
+  }
+  return results;
 }
 /**
  * Prints various snapshot statistics to System.out; Simply delegates to {@link EDU.oswego.cs.dl.util.concurrent.FJTaskRunnerGroup#stats}.
  */
 public void stats() {
-	if (this.smp!=null) this.smp.stats();
+  if (this.smp!=null) this.smp.stats();
 }
 private double xsum(DoubleMatrix2D A) {
-	double[] sums = run(A,true,
-		new Matrix2DMatrix2DFunction() {
-			public double apply(DoubleMatrix2D AA, DoubleMatrix2D BB) {
-				return AA.zSum();
-			}
-		}
-	);
+  double[] sums = run(A,true,
+    new Matrix2DMatrix2DFunction() {
+      public double apply(DoubleMatrix2D AA, DoubleMatrix2D BB) {
+        return AA.zSum();
+      }
+    }
+  );
 
-	double sum = 0;
-	for (int i = sums.length; --i >= 0; ) sum += sums[i];
-	return sum;
+  double sum = 0;
+  for (int i = sums.length; --i >= 0; ) sum += sums[i];
+  return sum;
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/LUDecompositionQuick.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/LUDecompositionQuick.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/LUDecompositionQuick.java	(working copy)
@@ -45,137 +45,137 @@
  */
 @Deprecated
 public class LUDecompositionQuick implements java.io.Serializable {
-	static final long serialVersionUID = 1020;
-	/** Array for internal storage of decomposition.
-	@serial internal array storage.
-	*/
-	protected DoubleMatrix2D LU;
-	
-	/** pivot sign.
-	@serial pivot sign.
-	*/
-	protected int pivsign; 
-	
-	/** Internal storage of pivot vector.
-	@serial pivot vector.
-	*/
-	protected int[] piv;
+  static final long serialVersionUID = 1020;
+  /** Array for internal storage of decomposition.
+  @serial internal array storage.
+  */
+  protected DoubleMatrix2D LU;
+  
+  /** pivot sign.
+  @serial pivot sign.
+  */
+  protected int pivsign; 
+  
+  /** Internal storage of pivot vector.
+  @serial pivot vector.
+  */
+  protected int[] piv;
 
-	protected boolean isNonSingular;
+  protected boolean isNonSingular;
 
-	protected Algebra algebra;
-	
-	transient protected double[] workDouble;
-	transient protected int[] work1;
-	transient protected int[] work2;
+  protected Algebra algebra;
+  
+  transient protected double[] workDouble;
+  transient protected int[] work1;
+  transient protected int[] work2;
 
 /**
 Constructs and returns a new LU Decomposition object with default tolerance <tt>1.0E-9</tt> for singularity detection.
-*/	
+*/  
 public LUDecompositionQuick() {
-	this(Property.DEFAULT.tolerance());
+  this(Property.DEFAULT.tolerance());
 }
 /**
 Constructs and returns a new LU Decomposition object which uses the given tolerance for singularity detection; 
-*/	
+*/  
 public LUDecompositionQuick(double tolerance) {
-	this.algebra = new Algebra(tolerance);
+  this.algebra = new Algebra(tolerance);
 }
 /**
 Decomposes matrix <tt>A</tt> into <tt>L</tt> and <tt>U</tt> (in-place).
 Upon return <tt>A</tt> is overridden with the result <tt>LU</tt>, such that <tt>L*U = A</tt>.
 Uses a "left-looking", dot-product, Crout/Doolittle algorithm.
 @param  A   any matrix.
-*/	
+*/  
 public void decompose(DoubleMatrix2D A) {
-	final int CUT_OFF = 10;
-	// setup
-	LU = A;
-	int m = A.rows();
-	int n = A.columns();
+  final int CUT_OFF = 10;
+  // setup
+  LU = A;
+  int m = A.rows();
+  int n = A.columns();
 
-	// setup pivot vector
-	if (this.piv==null || this.piv.length != m) this.piv = new int[m];
-	for (int i = m; --i >= 0; ) piv[i] = i;
-	pivsign = 1;
+  // setup pivot vector
+  if (this.piv==null || this.piv.length != m) this.piv = new int[m];
+  for (int i = m; --i >= 0; ) piv[i] = i;
+  pivsign = 1;
 
-	if (m*n == 0) {
-		setLU(LU);
-		return; // nothing to do
-	}
-	
-	//precompute and cache some views to avoid regenerating them time and again
-	DoubleMatrix1D[] LUrows = new DoubleMatrix1D[m];
-	for (int i = 0; i < m; i++) LUrows[i] = LU.viewRow(i);
-	
-	org.apache.mahout.matrix.list.IntArrayList nonZeroIndexes = new org.apache.mahout.matrix.list.IntArrayList(); // sparsity
-	DoubleMatrix1D LUcolj = LU.viewColumn(0).like();  // blocked column j
-	org.apache.mahout.jet.math.Mult multFunction = org.apache.mahout.jet.math.Mult.mult(0);
+  if (m*n == 0) {
+    setLU(LU);
+    return; // nothing to do
+  }
+  
+  //precompute and cache some views to avoid regenerating them time and again
+  DoubleMatrix1D[] LUrows = new DoubleMatrix1D[m];
+  for (int i = 0; i < m; i++) LUrows[i] = LU.viewRow(i);
+  
+  org.apache.mahout.matrix.list.IntArrayList nonZeroIndexes = new org.apache.mahout.matrix.list.IntArrayList(); // sparsity
+  DoubleMatrix1D LUcolj = LU.viewColumn(0).like();  // blocked column j
+  org.apache.mahout.jet.math.Mult multFunction = org.apache.mahout.jet.math.Mult.mult(0);
 
-	// Outer loop.
-	for (int j = 0; j < n; j++) {
-		// blocking (make copy of j-th column to localize references)
-		LUcolj.assign(LU.viewColumn(j));
-		
-		// sparsity detection
-		int maxCardinality = m/CUT_OFF; // == heuristic depending on speedup
-		LUcolj.getNonZeros(nonZeroIndexes,null,maxCardinality);
-		int cardinality = nonZeroIndexes.size(); 
-		boolean sparse = (cardinality < maxCardinality);
+  // Outer loop.
+  for (int j = 0; j < n; j++) {
+    // blocking (make copy of j-th column to localize references)
+    LUcolj.assign(LU.viewColumn(j));
+    
+    // sparsity detection
+    int maxCardinality = m/CUT_OFF; // == heuristic depending on speedup
+    LUcolj.getNonZeros(nonZeroIndexes,null,maxCardinality);
+    int cardinality = nonZeroIndexes.size(); 
+    boolean sparse = (cardinality < maxCardinality);
 
-		// Apply previous transformations.
-		for (int i = 0; i < m; i++) {
-			int kmax = Math.min(i,j);
-			double s;
-			if (sparse) {
-				s = LUrows[i].zDotProduct(LUcolj,0,kmax,nonZeroIndexes);
-			}
-			else {
-				s = LUrows[i].zDotProduct(LUcolj,0,kmax);
-			}
-			double before = LUcolj.getQuick(i);
-			double after = before -s;
-			LUcolj.setQuick(i, after); // LUcolj is a copy
-			LU.setQuick(i,j, after);   // this is the original
-			if (sparse) {
-				if (before==0 && after!=0) { // nasty bug fixed!
-					int pos = nonZeroIndexes.binarySearch(i);
-					pos = -pos -1;
-					nonZeroIndexes.beforeInsert(pos,i);
-				}
-				if (before!=0 && after==0) {
-					nonZeroIndexes.remove(nonZeroIndexes.binarySearch(i));
-				}
-			}
-		}
-	
-		// Find pivot and exchange if necessary.
-		int p = j;
-		if (p < m) {
-			double max = Math.abs(LUcolj.getQuick(p));
-			for (int i = j+1; i < m; i++) {
-				double v = Math.abs(LUcolj.getQuick(i));
-				if (v > max) {
-					p = i;
-					max = v;
-				}
-			}
-		}
-		if (p != j) {
-			LUrows[p].swap(LUrows[j]);
-			int k = piv[p]; piv[p] = piv[j]; piv[j] = k;
-			pivsign = -pivsign;
-		}
-		
-		// Compute multipliers.
-		double jj;
-		if (j < m && (jj=LU.getQuick(j,j)) != 0.0) {
-			multFunction.multiplicator = 1 / jj;
-			LU.viewColumn(j).viewPart(j+1,m-(j+1)).assign(multFunction);
-		}
-		
-	}
-	setLU(LU);
+    // Apply previous transformations.
+    for (int i = 0; i < m; i++) {
+      int kmax = Math.min(i,j);
+      double s;
+      if (sparse) {
+        s = LUrows[i].zDotProduct(LUcolj,0,kmax,nonZeroIndexes);
+      }
+      else {
+        s = LUrows[i].zDotProduct(LUcolj,0,kmax);
+      }
+      double before = LUcolj.getQuick(i);
+      double after = before -s;
+      LUcolj.setQuick(i, after); // LUcolj is a copy
+      LU.setQuick(i,j, after);   // this is the original
+      if (sparse) {
+        if (before==0 && after!=0) { // nasty bug fixed!
+          int pos = nonZeroIndexes.binarySearch(i);
+          pos = -pos -1;
+          nonZeroIndexes.beforeInsert(pos,i);
+        }
+        if (before!=0 && after==0) {
+          nonZeroIndexes.remove(nonZeroIndexes.binarySearch(i));
+        }
+      }
+    }
+  
+    // Find pivot and exchange if necessary.
+    int p = j;
+    if (p < m) {
+      double max = Math.abs(LUcolj.getQuick(p));
+      for (int i = j+1; i < m; i++) {
+        double v = Math.abs(LUcolj.getQuick(i));
+        if (v > max) {
+          p = i;
+          max = v;
+        }
+      }
+    }
+    if (p != j) {
+      LUrows[p].swap(LUrows[j]);
+      int k = piv[p]; piv[p] = piv[j]; piv[j] = k;
+      pivsign = -pivsign;
+    }
+    
+    // Compute multipliers.
+    double jj;
+    if (j < m && (jj=LU.getQuick(j,j)) != 0.0) {
+      multFunction.multiplicator = 1 / jj;
+      LU.viewColumn(j).viewPart(j+1,m-(j+1)).assign(multFunction);
+    }
+    
+  }
+  setLU(LU);
 }
 /**
 Decomposes the banded and square matrix <tt>A</tt> into <tt>L</tt> and <tt>U</tt> (in-place).
@@ -183,117 +183,117 @@
 Currently supports diagonal and tridiagonal matrices, all other cases fall through to {@link #decompose(DoubleMatrix2D)}.
 @param semiBandwidth == 1 --> A is diagonal, == 2 --> A is tridiagonal.
 @param  A   any matrix.
-*/	
+*/  
 public void decompose(DoubleMatrix2D A, int semiBandwidth) {
-	if (! algebra.property().isSquare(A) || semiBandwidth<0 || semiBandwidth>2) {
-		decompose(A);
-		return;
-	}
-	// setup
-	LU = A;
-	int m = A.rows();
-	int n = A.columns();
+  if (! algebra.property().isSquare(A) || semiBandwidth<0 || semiBandwidth>2) {
+    decompose(A);
+    return;
+  }
+  // setup
+  LU = A;
+  int m = A.rows();
+  int n = A.columns();
 
-	// setup pivot vector
-	if (this.piv==null || this.piv.length != m) this.piv = new int[m];
-	for (int i = m; --i >= 0; ) piv[i] = i;
-	pivsign = 1;
+  // setup pivot vector
+  if (this.piv==null || this.piv.length != m) this.piv = new int[m];
+  for (int i = m; --i >= 0; ) piv[i] = i;
+  pivsign = 1;
 
-	if (m*n == 0) {
-		setLU(A);
-		return; // nothing to do
-	}
-	
-	//if (semiBandwidth == 1) { // A is diagonal; nothing to do
-	if (semiBandwidth == 2) { // A is tridiagonal
-		// currently no pivoting !
-		if (n>1) A.setQuick(1,0, A.getQuick(1,0) / A.getQuick(0,0));
+  if (m*n == 0) {
+    setLU(A);
+    return; // nothing to do
+  }
+  
+  //if (semiBandwidth == 1) { // A is diagonal; nothing to do
+  if (semiBandwidth == 2) { // A is tridiagonal
+    // currently no pivoting !
+    if (n>1) A.setQuick(1,0, A.getQuick(1,0) / A.getQuick(0,0));
 
-		for (int i=1; i<n; i++) {
-			double ei = A.getQuick(i,i) - A.getQuick(i,i-1) * A.getQuick(i-1,i);
-			A.setQuick(i,i, ei);
-			if (i<n-1) A.setQuick(i+1,i, A.getQuick(i+1,i) / ei);
-		}
-	}
-	setLU(A);
+    for (int i=1; i<n; i++) {
+      double ei = A.getQuick(i,i) - A.getQuick(i,i-1) * A.getQuick(i-1,i);
+      A.setQuick(i,i, ei);
+      if (i<n-1) A.setQuick(i+1,i, A.getQuick(i+1,i) / ei);
+    }
+  }
+  setLU(A);
 }
 /** 
 Returns the determinant, <tt>det(A)</tt>.
 @exception  IllegalArgumentException  if <tt>A.rows() != A.columns()</tt> (Matrix must be square).
 */
 public double det() {
-	int m = m();
-	int n = n();
-	if (m != n) throw new IllegalArgumentException("Matrix must be square.");
-	
-	if (!isNonsingular()) return 0; // avoid rounding errors
-	
-	double det = (double) pivsign;
-	for (int j = 0; j < n; j++) {
-		det *= LU.getQuick(j,j);
-	}
-	return det;
+  int m = m();
+  int n = n();
+  if (m != n) throw new IllegalArgumentException("Matrix must be square.");
+  
+  if (!isNonsingular()) return 0; // avoid rounding errors
+  
+  double det = (double) pivsign;
+  for (int j = 0; j < n; j++) {
+    det *= LU.getQuick(j,j);
+  }
+  return det;
 }
 /** 
 Returns pivot permutation vector as a one-dimensional double array
 @return     (double) piv
 */
 protected double[] getDoublePivot() {
-	int m = m();
-	double[] vals = new double[m];
-	for (int i = 0; i < m; i++) {
-		vals[i] = (double) piv[i];
-	}
-	return vals;
+  int m = m();
+  double[] vals = new double[m];
+  for (int i = 0; i < m; i++) {
+    vals[i] = (double) piv[i];
+  }
+  return vals;
 }
 /** 
 Returns the lower triangular factor, <tt>L</tt>.
 @return     <tt>L</tt>
 */
 public DoubleMatrix2D getL() {
-	return lowerTriangular(LU.copy());
+  return lowerTriangular(LU.copy());
 }
 /** 
 Returns a copy of the combined lower and upper triangular factor, <tt>LU</tt>.
 @return     <tt>LU</tt>
 */
 public DoubleMatrix2D getLU() {
-	return LU.copy();
+  return LU.copy();
 }
 /** 
 Returns the pivot permutation vector (not a copy of it).
 @return     piv
 */
 public int[] getPivot() {
-	return piv;
+  return piv;
 }
 /** 
 Returns the upper triangular factor, <tt>U</tt>.
 @return     <tt>U</tt>
 */
 public DoubleMatrix2D getU() {
-	return upperTriangular(LU.copy());
+  return upperTriangular(LU.copy());
 }
 /** 
 Returns whether the matrix is nonsingular (has an inverse).
 @return true if <tt>U</tt>, and hence <tt>A</tt>, is nonsingular; false otherwise.
 */
 public boolean isNonsingular() {
-	return isNonSingular;
+  return isNonSingular;
 }
 /** 
 Returns whether the matrix is nonsingular.
 @return true if <tt>matrix</tt> is nonsingular; false otherwise.
 */
 protected boolean isNonsingular(DoubleMatrix2D matrix) {
-	int m = matrix.rows();
-	int n = matrix.columns();
-	double epsilon = algebra.property().tolerance(); // consider numerical instability
-	for (int j = Math.min(n,m); --j >= 0;) {
-		//if (matrix.getQuick(j,j) == 0) return false;
-		if (Math.abs(matrix.getQuick(j,j)) <= epsilon) return false;
-	}
-	return true;
+  int m = matrix.rows();
+  int n = matrix.columns();
+  double epsilon = algebra.property().tolerance(); // consider numerical instability
+  for (int j = Math.min(n,m); --j >= 0;) {
+    //if (matrix.getQuick(j,j) == 0) return false;
+    if (Math.abs(matrix.getQuick(j,j)) <= epsilon) return false;
+  }
+  return true;
 }
 /**
 Modifies the matrix to be a lower triangular matrix.
@@ -301,60 +301,60 @@
 <b>Examples:</b> 
 <table border="0">
   <tr nowrap> 
-	<td valign="top">3 x 5 matrix:<br>
-	  9, 9, 9, 9, 9<br>
-	  9, 9, 9, 9, 9<br>
-	  9, 9, 9, 9, 9 </td>
-	<td align="center">triang.Upper<br>
-	  ==></td>
-	<td valign="top">3 x 5 matrix:<br>
-	  9, 9, 9, 9, 9<br>
-	  0, 9, 9, 9, 9<br>
-	  0, 0, 9, 9, 9</td>
+  <td valign="top">3 x 5 matrix:<br>
+    9, 9, 9, 9, 9<br>
+    9, 9, 9, 9, 9<br>
+    9, 9, 9, 9, 9 </td>
+  <td align="center">triang.Upper<br>
+    ==></td>
+  <td valign="top">3 x 5 matrix:<br>
+    9, 9, 9, 9, 9<br>
+    0, 9, 9, 9, 9<br>
+    0, 0, 9, 9, 9</td>
   </tr>
   <tr nowrap> 
-	<td valign="top">5 x 3 matrix:<br>
-	  9, 9, 9<br>
-	  9, 9, 9<br>
-	  9, 9, 9<br>
-	  9, 9, 9<br>
-	  9, 9, 9 </td>
-	<td align="center">triang.Upper<br>
-	  ==></td>
-	<td valign="top">5 x 3 matrix:<br>
-	  9, 9, 9<br>
-	  0, 9, 9<br>
-	  0, 0, 9<br>
-	  0, 0, 0<br>
-	  0, 0, 0</td>
+  <td valign="top">5 x 3 matrix:<br>
+    9, 9, 9<br>
+    9, 9, 9<br>
+    9, 9, 9<br>
+    9, 9, 9<br>
+    9, 9, 9 </td>
+  <td align="center">triang.Upper<br>
+    ==></td>
+  <td valign="top">5 x 3 matrix:<br>
+    9, 9, 9<br>
+    0, 9, 9<br>
+    0, 0, 9<br>
+    0, 0, 0<br>
+    0, 0, 0</td>
   </tr>
   <tr nowrap> 
-	<td valign="top">3 x 5 matrix:<br>
-	  9, 9, 9, 9, 9<br>
-	  9, 9, 9, 9, 9<br>
-	  9, 9, 9, 9, 9 </td>
-	<td align="center">triang.Lower<br>
-	  ==></td>
-	<td valign="top">3 x 5 matrix:<br>
-	  1, 0, 0, 0, 0<br>
-	  9, 1, 0, 0, 0<br>
-	  9, 9, 1, 0, 0</td>
+  <td valign="top">3 x 5 matrix:<br>
+    9, 9, 9, 9, 9<br>
+    9, 9, 9, 9, 9<br>
+    9, 9, 9, 9, 9 </td>
+  <td align="center">triang.Lower<br>
+    ==></td>
+  <td valign="top">3 x 5 matrix:<br>
+    1, 0, 0, 0, 0<br>
+    9, 1, 0, 0, 0<br>
+    9, 9, 1, 0, 0</td>
   </tr>
   <tr nowrap> 
-	<td valign="top">5 x 3 matrix:<br>
-	  9, 9, 9<br>
-	  9, 9, 9<br>
-	  9, 9, 9<br>
-	  9, 9, 9<br>
-	  9, 9, 9 </td>
-	<td align="center">triang.Lower<br>
-	  ==></td>
-	<td valign="top">5 x 3 matrix:<br>
-	  1, 0, 0<br>
-	  9, 1, 0<br>
-	  9, 9, 1<br>
-	  9, 9, 9<br>
-	  9, 9, 9</td>
+  <td valign="top">5 x 3 matrix:<br>
+    9, 9, 9<br>
+    9, 9, 9<br>
+    9, 9, 9<br>
+    9, 9, 9<br>
+    9, 9, 9 </td>
+  <td align="center">triang.Lower<br>
+    ==></td>
+  <td valign="top">5 x 3 matrix:<br>
+    1, 0, 0<br>
+    9, 1, 0<br>
+    9, 9, 1<br>
+    9, 9, 9<br>
+    9, 9, 9</td>
   </tr>
 </table>
 
@@ -362,38 +362,38 @@
 @see #triangulateUpper(DoubleMatrix2D)
 */
 protected DoubleMatrix2D lowerTriangular(DoubleMatrix2D A) {
-	int rows = A.rows();
-	int columns = A.columns();
-	int min = Math.min(rows,columns);
-	for (int r = min; --r >= 0; ) {
-		for (int c = min; --c >= 0; ) {
-			if (r < c) A.setQuick(r,c, 0);
-			else if (r == c) A.setQuick(r,c, 1);
-		}
-	}
-	if (columns>rows) A.viewPart(0,min,rows,columns-min).assign(0);
+  int rows = A.rows();
+  int columns = A.columns();
+  int min = Math.min(rows,columns);
+  for (int r = min; --r >= 0; ) {
+    for (int c = min; --c >= 0; ) {
+      if (r < c) A.setQuick(r,c, 0);
+      else if (r == c) A.setQuick(r,c, 1);
+    }
+  }
+  if (columns>rows) A.viewPart(0,min,rows,columns-min).assign(0);
 
-	return A;
+  return A;
 }
 /**
  *
  */
 protected int m() {
-	return LU.rows();
+  return LU.rows();
 }
 /**
  *
  */
 protected int n() {
-	return LU.columns();
+  return LU.columns();
 }
 /** 
 Sets the combined lower and upper triangular factor, <tt>LU</tt>.
 The parameter is not checked; make sure it is indeed a proper LU decomposition.
 */
 public void setLU(DoubleMatrix2D LU) {
-	this.LU = LU;
-	this.isNonSingular = isNonsingular(LU);
+  this.LU = LU;
+  this.isNonSingular = isNonsingular(LU);
 }
 /** 
 Solves the system of equations <tt>A*X = B</tt> (in-place).
@@ -404,45 +404,45 @@
 @exception  IllegalArgumentException  if <tt>A.rows() < A.columns()</tt>.
 */
 public void solve(DoubleMatrix1D B) {
-	algebra.property().checkRectangular(LU);
-	int m = m();
-	int n = n();
-	if (B.size() != m) throw new IllegalArgumentException("Matrix dimensions must agree.");
-	if (!this.isNonsingular()) throw new IllegalArgumentException("Matrix is singular.");
-	
+  algebra.property().checkRectangular(LU);
+  int m = m();
+  int n = n();
+  if (B.size() != m) throw new IllegalArgumentException("Matrix dimensions must agree.");
+  if (!this.isNonsingular()) throw new IllegalArgumentException("Matrix is singular.");
+  
 
-	// right hand side with pivoting
-	// Matrix Xmat = B.getMatrix(piv,0,nx-1);
-	if (this.workDouble == null || this.workDouble.length < m) this.workDouble = new double[m];
-	algebra.permute(B, this.piv, this.workDouble);
+  // right hand side with pivoting
+  // Matrix Xmat = B.getMatrix(piv,0,nx-1);
+  if (this.workDouble == null || this.workDouble.length < m) this.workDouble = new double[m];
+  algebra.permute(B, this.piv, this.workDouble);
 
-	if (m*n == 0) return; // nothing to do
-	
-	// Solve L*Y = B(piv,:)
-	for (int k = 0; k < n; k++) {
-		double f = B.getQuick(k);
-		if (f != 0) {
-			for (int i = k+1; i < n; i++) {
-				// B[i] -= B[k]*LU[i][k];
-				double v = LU.getQuick(i,k);
-				if (v != 0) B.setQuick(i, B.getQuick(i) - f*v);
-			}
-		}
-	}
-	
-	// Solve U*B = Y;
-	for (int k = n-1; k >= 0; k--) {
-		// B[k] /= LU[k,k] 
-		B.setQuick(k, B.getQuick(k) / LU.getQuick(k,k));
-		double f = B.getQuick(k);
-		if (f != 0) {
-			for (int i = 0; i < k; i++) {
-				// B[i] -= B[k]*LU[i][k];
-				double v = LU.getQuick(i,k);
-				if (v != 0) B.setQuick(i, B.getQuick(i) - f*v);
-			}
-		}
-	}
+  if (m*n == 0) return; // nothing to do
+  
+  // Solve L*Y = B(piv,:)
+  for (int k = 0; k < n; k++) {
+    double f = B.getQuick(k);
+    if (f != 0) {
+      for (int i = k+1; i < n; i++) {
+        // B[i] -= B[k]*LU[i][k];
+        double v = LU.getQuick(i,k);
+        if (v != 0) B.setQuick(i, B.getQuick(i) - f*v);
+      }
+    }
+  }
+  
+  // Solve U*B = Y;
+  for (int k = n-1; k >= 0; k--) {
+    // B[k] /= LU[k,k] 
+    B.setQuick(k, B.getQuick(k) / LU.getQuick(k,k));
+    double f = B.getQuick(k);
+    if (f != 0) {
+      for (int i = 0; i < k; i++) {
+        // B[i] -= B[k]*LU[i][k];
+        double v = LU.getQuick(i,k);
+        if (v != 0) B.setQuick(i, B.getQuick(i) - f*v);
+      }
+    }
+  }
 }
 /** 
 Solves the system of equations <tt>A*X = B</tt> (in-place).
@@ -453,96 +453,96 @@
 @exception  IllegalArgumentException  if <tt>A.rows() < A.columns()</tt>.
 */
 public void solve(DoubleMatrix2D B) {
-	final int CUT_OFF = 10;
-	algebra.property().checkRectangular(LU);
-	int m = m();
-	int n = n();
-	if (B.rows() != m) throw new IllegalArgumentException("Matrix row dimensions must agree.");
-	if (!this.isNonsingular()) throw new IllegalArgumentException("Matrix is singular.");
-	
+  final int CUT_OFF = 10;
+  algebra.property().checkRectangular(LU);
+  int m = m();
+  int n = n();
+  if (B.rows() != m) throw new IllegalArgumentException("Matrix row dimensions must agree.");
+  if (!this.isNonsingular()) throw new IllegalArgumentException("Matrix is singular.");
+  
 
-	// right hand side with pivoting
-	// Matrix Xmat = B.getMatrix(piv,0,nx-1);
-	if (this.work1 == null || this.work1.length < m) this.work1 = new int[m];
-	//if (this.work2 == null || this.work2.length < m) this.work2 = new int[m];
-	algebra.permuteRows(B, this.piv, this.work1);
+  // right hand side with pivoting
+  // Matrix Xmat = B.getMatrix(piv,0,nx-1);
+  if (this.work1 == null || this.work1.length < m) this.work1 = new int[m];
+  //if (this.work2 == null || this.work2.length < m) this.work2 = new int[m];
+  algebra.permuteRows(B, this.piv, this.work1);
 
-	if (m*n == 0) return; // nothing to do
-	int nx = B.columns();
-	
-	//precompute and cache some views to avoid regenerating them time and again
-	DoubleMatrix1D[] Brows = new DoubleMatrix1D[n];
-	for (int k = 0; k < n; k++) Brows[k] = B.viewRow(k);
+  if (m*n == 0) return; // nothing to do
+  int nx = B.columns();
+  
+  //precompute and cache some views to avoid regenerating them time and again
+  DoubleMatrix1D[] Brows = new DoubleMatrix1D[n];
+  for (int k = 0; k < n; k++) Brows[k] = B.viewRow(k);
 
-	// transformations
-	org.apache.mahout.jet.math.Mult     div       = org.apache.mahout.jet.math.Mult.div(0);
-	org.apache.mahout.jet.math.PlusMult minusMult = org.apache.mahout.jet.math.PlusMult.minusMult(0);
-	
-	org.apache.mahout.matrix.list.IntArrayList nonZeroIndexes = new org.apache.mahout.matrix.list.IntArrayList(); // sparsity
-	DoubleMatrix1D Browk = org.apache.mahout.matrix.matrix.DoubleFactory1D.dense.make(nx); // blocked row k
-	
-	// Solve L*Y = B(piv,:)
-	for (int k = 0; k < n; k++) {
-		// blocking (make copy of k-th row to localize references)		
-		Browk.assign(Brows[k]); 
-		
-		// sparsity detection
-		int maxCardinality = nx/CUT_OFF; // == heuristic depending on speedup
-		Browk.getNonZeros(nonZeroIndexes,null,maxCardinality);
-		int cardinality = nonZeroIndexes.size(); 
-		boolean sparse = (cardinality < maxCardinality);
+  // transformations
+  org.apache.mahout.jet.math.Mult     div       = org.apache.mahout.jet.math.Mult.div(0);
+  org.apache.mahout.jet.math.PlusMult minusMult = org.apache.mahout.jet.math.PlusMult.minusMult(0);
+  
+  org.apache.mahout.matrix.list.IntArrayList nonZeroIndexes = new org.apache.mahout.matrix.list.IntArrayList(); // sparsity
+  DoubleMatrix1D Browk = org.apache.mahout.matrix.matrix.DoubleFactory1D.dense.make(nx); // blocked row k
+  
+  // Solve L*Y = B(piv,:)
+  for (int k = 0; k < n; k++) {
+    // blocking (make copy of k-th row to localize references)    
+    Browk.assign(Brows[k]); 
+    
+    // sparsity detection
+    int maxCardinality = nx/CUT_OFF; // == heuristic depending on speedup
+    Browk.getNonZeros(nonZeroIndexes,null,maxCardinality);
+    int cardinality = nonZeroIndexes.size(); 
+    boolean sparse = (cardinality < maxCardinality);
 
-		for (int i = k+1; i < n; i++) {
-			//for (int j = 0; j < nx; j++) B[i][j] -= B[k][j]*LU[i][k];
-			//for (int j = 0; j < nx; j++) B.set(i,j, B.get(i,j) - B.get(k,j)*LU.get(i,k));
-			
-			minusMult.multiplicator = -LU.getQuick(i,k);
-			if (minusMult.multiplicator != 0) {
-				if (sparse) {
-					Brows[i].assign(Browk,minusMult,nonZeroIndexes);
-				}
-				else {
-					Brows[i].assign(Browk,minusMult);
-				}
-			}
-		}
-	}
-	
-	// Solve U*B = Y;
-	for (int k = n-1; k >= 0; k--) {
-		// for (int j = 0; j < nx; j++) B[k][j] /= LU[k][k];
-		// for (int j = 0; j < nx; j++) B.set(k,j, B.get(k,j) / LU.get(k,k));
-		div.multiplicator = 1 / LU.getQuick(k,k);
-		Brows[k].assign(div);
+    for (int i = k+1; i < n; i++) {
+      //for (int j = 0; j < nx; j++) B[i][j] -= B[k][j]*LU[i][k];
+      //for (int j = 0; j < nx; j++) B.set(i,j, B.get(i,j) - B.get(k,j)*LU.get(i,k));
+      
+      minusMult.multiplicator = -LU.getQuick(i,k);
+      if (minusMult.multiplicator != 0) {
+        if (sparse) {
+          Brows[i].assign(Browk,minusMult,nonZeroIndexes);
+        }
+        else {
+          Brows[i].assign(Browk,minusMult);
+        }
+      }
+    }
+  }
+  
+  // Solve U*B = Y;
+  for (int k = n-1; k >= 0; k--) {
+    // for (int j = 0; j < nx; j++) B[k][j] /= LU[k][k];
+    // for (int j = 0; j < nx; j++) B.set(k,j, B.get(k,j) / LU.get(k,k));
+    div.multiplicator = 1 / LU.getQuick(k,k);
+    Brows[k].assign(div);
 
-		// blocking
-		if (Browk==null) Browk = org.apache.mahout.matrix.matrix.DoubleFactory1D.dense.make(B.columns());
-		Browk.assign(Brows[k]);
+    // blocking
+    if (Browk==null) Browk = org.apache.mahout.matrix.matrix.DoubleFactory1D.dense.make(B.columns());
+    Browk.assign(Brows[k]);
 
-		// sparsity detection
-		int maxCardinality = nx/CUT_OFF; // == heuristic depending on speedup
-		Browk.getNonZeros(nonZeroIndexes,null,maxCardinality);
-		int cardinality = nonZeroIndexes.size();
-		boolean sparse = (cardinality < maxCardinality);
+    // sparsity detection
+    int maxCardinality = nx/CUT_OFF; // == heuristic depending on speedup
+    Browk.getNonZeros(nonZeroIndexes,null,maxCardinality);
+    int cardinality = nonZeroIndexes.size();
+    boolean sparse = (cardinality < maxCardinality);
 
-		//Browk.getNonZeros(nonZeroIndexes,null);
-		//boolean sparse = nonZeroIndexes.size() < nx/10;
-		
-		for (int i = 0; i < k; i++) {
-			// for (int j = 0; j < nx; j++) B[i][j] -= B[k][j]*LU[i][k];
-			// for (int j = 0; j < nx; j++) B.set(i,j, B.get(i,j) - B.get(k,j)*LU.get(i,k));
-			
-			minusMult.multiplicator = -LU.getQuick(i,k);
-			if (minusMult.multiplicator != 0) {
-				if (sparse) {
-					Brows[i].assign(Browk,minusMult,nonZeroIndexes);
-				}
-				else {
-					Brows[i].assign(Browk,minusMult);
-				}
-			}			
-		}
-	}
+    //Browk.getNonZeros(nonZeroIndexes,null);
+    //boolean sparse = nonZeroIndexes.size() < nx/10;
+    
+    for (int i = 0; i < k; i++) {
+      // for (int j = 0; j < nx; j++) B[i][j] -= B[k][j]*LU[i][k];
+      // for (int j = 0; j < nx; j++) B.set(i,j, B.get(i,j) - B.get(k,j)*LU.get(i,k));
+      
+      minusMult.multiplicator = -LU.getQuick(i,k);
+      if (minusMult.multiplicator != 0) {
+        if (sparse) {
+          Brows[i].assign(Browk,minusMult,nonZeroIndexes);
+        }
+        else {
+          Brows[i].assign(Browk,minusMult);
+        }
+      }      
+    }
+  }
 }
 /** 
 Solves <tt>A*X = B</tt>.
@@ -553,50 +553,50 @@
 @exception  IllegalArgumentException  if <tt>A.rows() < A.columns()</tt>.
 */
 private void solveOld(DoubleMatrix2D B) {
-	algebra.property().checkRectangular(LU);
-	int m = m();
-	int n = n();
-	if (B.rows() != m) throw new IllegalArgumentException("Matrix row dimensions must agree.");
-	if (!this.isNonsingular()) throw new IllegalArgumentException("Matrix is singular.");
+  algebra.property().checkRectangular(LU);
+  int m = m();
+  int n = n();
+  if (B.rows() != m) throw new IllegalArgumentException("Matrix row dimensions must agree.");
+  if (!this.isNonsingular()) throw new IllegalArgumentException("Matrix is singular.");
 
-	// Copy right hand side with pivoting
-	int nx = B.columns();
-	
-	if (this.work1 == null || this.work1.length < m) this.work1 = new int[m];
-	//if (this.work2 == null || this.work2.length < m) this.work2 = new int[m];
-	algebra.permuteRows(B, this.piv, this.work1);
+  // Copy right hand side with pivoting
+  int nx = B.columns();
+  
+  if (this.work1 == null || this.work1.length < m) this.work1 = new int[m];
+  //if (this.work2 == null || this.work2.length < m) this.work2 = new int[m];
+  algebra.permuteRows(B, this.piv, this.work1);
 
-	// Solve L*Y = B(piv,:) --> Y (Y is modified B)
-	for (int k = 0; k < n; k++) {
-		for (int i = k + 1; i < n; i++) {
-			double mult = LU.getQuick(i, k);
-			if (mult != 0) {
-				for (int j = 0; j < nx; j++) {
-					//B[i][j] -= B[k][j]*LU[i,k];
-					B.setQuick(i, j, B.getQuick(i, j) - B.getQuick(k, j) * mult);
-				}
-			}
-		}
-	}
-	// Solve U*X = Y; --> X (X is modified B)
-	for (int k = n - 1; k >= 0; k--) {
-		double mult = 1 / LU.getQuick(k, k);
-		if (mult != 1) {
-			for (int j = 0; j < nx; j++) {
-				//B[k][j] /= LU[k][k];
-				B.setQuick(k, j, B.getQuick(k, j) * mult);
-			}
-		}
-		for (int i = 0; i < k; i++) {
-			mult = LU.getQuick(i, k);
-			if (mult != 0) {
-				for (int j = 0; j < nx; j++) {
-					//B[i][j] -= B[k][j]*LU[i][k];
-					B.setQuick(i, j, B.getQuick(i, j) - B.getQuick(k, j) * mult);
-				}
-			}
-		}
-	}
+  // Solve L*Y = B(piv,:) --> Y (Y is modified B)
+  for (int k = 0; k < n; k++) {
+    for (int i = k + 1; i < n; i++) {
+      double mult = LU.getQuick(i, k);
+      if (mult != 0) {
+        for (int j = 0; j < nx; j++) {
+          //B[i][j] -= B[k][j]*LU[i,k];
+          B.setQuick(i, j, B.getQuick(i, j) - B.getQuick(k, j) * mult);
+        }
+      }
+    }
+  }
+  // Solve U*X = Y; --> X (X is modified B)
+  for (int k = n - 1; k >= 0; k--) {
+    double mult = 1 / LU.getQuick(k, k);
+    if (mult != 1) {
+      for (int j = 0; j < nx; j++) {
+        //B[k][j] /= LU[k][k];
+        B.setQuick(k, j, B.getQuick(k, j) * mult);
+      }
+    }
+    for (int i = 0; i < k; i++) {
+      mult = LU.getQuick(i, k);
+      if (mult != 0) {
+        for (int j = 0; j < nx; j++) {
+          //B[i][j] -= B[k][j]*LU[i][k];
+          B.setQuick(i, j, B.getQuick(i, j) - B.getQuick(k, j) * mult);
+        }
+      }
+    }
+  }
 }
 /**
 Returns a String with (propertyName, propertyValue) pairs.
@@ -608,39 +608,39 @@
 </pre>
 */
 public String toString() {
-	StringBuffer buf = new StringBuffer();
-	String unknown = "Illegal operation or error: ";
+  StringBuffer buf = new StringBuffer();
+  String unknown = "Illegal operation or error: ";
 
-	buf.append("-----------------------------------------------------------------------------\n");
-	buf.append("LUDecompositionQuick(A) --> isNonSingular(A), det(A), pivot, L, U, inverse(A)\n");
-	buf.append("-----------------------------------------------------------------------------\n");
+  buf.append("-----------------------------------------------------------------------------\n");
+  buf.append("LUDecompositionQuick(A) --> isNonSingular(A), det(A), pivot, L, U, inverse(A)\n");
+  buf.append("-----------------------------------------------------------------------------\n");
 
-	buf.append("isNonSingular = ");
-	try { buf.append(String.valueOf(this.isNonsingular()));} 
-	catch (IllegalArgumentException exc) { buf.append(unknown+exc.getMessage()); }
-	
-	buf.append("\ndet = ");
-	try { buf.append(String.valueOf(this.det()));} 
-	catch (IllegalArgumentException exc) { buf.append(unknown+exc.getMessage()); }
-	
-	buf.append("\npivot = ");
-	try { buf.append(String.valueOf(new org.apache.mahout.matrix.list.IntArrayList(this.getPivot())));}
-	catch (IllegalArgumentException exc) { buf.append(unknown+exc.getMessage()); }
-	
-	buf.append("\n\nL = ");
-	try { buf.append(String.valueOf(this.getL()));} 
-	catch (IllegalArgumentException exc) { buf.append(unknown+exc.getMessage()); }
-	
-	buf.append("\n\nU = ");
-	try { buf.append(String.valueOf(this.getU()));} 
-	catch (IllegalArgumentException exc) { buf.append(unknown+exc.getMessage()); }
-	
-	buf.append("\n\ninverse(A) = ");
-	DoubleMatrix2D identity = org.apache.mahout.matrix.matrix.DoubleFactory2D.dense.identity(LU.rows());
-	try { this.solve(identity); buf.append(String.valueOf(identity)); } 
-	catch (IllegalArgumentException exc) { buf.append(unknown+exc.getMessage()); }
-	
-	return buf.toString();
+  buf.append("isNonSingular = ");
+  try { buf.append(String.valueOf(this.isNonsingular()));} 
+  catch (IllegalArgumentException exc) { buf.append(unknown+exc.getMessage()); }
+  
+  buf.append("\ndet = ");
+  try { buf.append(String.valueOf(this.det()));} 
+  catch (IllegalArgumentException exc) { buf.append(unknown+exc.getMessage()); }
+  
+  buf.append("\npivot = ");
+  try { buf.append(String.valueOf(new org.apache.mahout.matrix.list.IntArrayList(this.getPivot())));}
+  catch (IllegalArgumentException exc) { buf.append(unknown+exc.getMessage()); }
+  
+  buf.append("\n\nL = ");
+  try { buf.append(String.valueOf(this.getL()));} 
+  catch (IllegalArgumentException exc) { buf.append(unknown+exc.getMessage()); }
+  
+  buf.append("\n\nU = ");
+  try { buf.append(String.valueOf(this.getU()));} 
+  catch (IllegalArgumentException exc) { buf.append(unknown+exc.getMessage()); }
+  
+  buf.append("\n\ninverse(A) = ");
+  DoubleMatrix2D identity = org.apache.mahout.matrix.matrix.DoubleFactory2D.dense.identity(LU.rows());
+  try { this.solve(identity); buf.append(String.valueOf(identity)); } 
+  catch (IllegalArgumentException exc) { buf.append(unknown+exc.getMessage()); }
+  
+  return buf.toString();
 }
 /**
 Modifies the matrix to be an upper triangular matrix.
@@ -648,28 +648,28 @@
 @see #triangulateLower(DoubleMatrix2D)
 */
 protected DoubleMatrix2D upperTriangular(DoubleMatrix2D A) {
-	int rows = A.rows();
-	int columns = A.columns();
-	int min = Math.min(rows,columns);
-	for (int r = min; --r >= 0; ) {
-		for (int c = min; --c >= 0; ) {
-			if (r > c) A.setQuick(r,c, 0);
-		}
-	}
-	if (columns<rows) A.viewPart(min,0,rows-min,columns).assign(0);
+  int rows = A.rows();
+  int columns = A.columns();
+  int min = Math.min(rows,columns);
+  for (int r = min; --r >= 0; ) {
+    for (int c = min; --c >= 0; ) {
+      if (r > c) A.setQuick(r,c, 0);
+    }
+  }
+  if (columns<rows) A.viewPart(min,0,rows-min,columns).assign(0);
 
-	return A;
+  return A;
 }
 /** 
 Returns pivot permutation vector as a one-dimensional double array
 @return     (double) piv
 */
 private double[] xgetDoublePivot() {
-	int m = m();
-	double[] vals = new double[m];
-	for (int i = 0; i < m; i++) {
-		vals[i] = (double) piv[i];
-	}
-	return vals;
+  int m = m();
+  double[] vals = new double[m];
+  for (int i = 0; i < m; i++) {
+    vals[i] = (double) piv[i];
+  }
+  return vals;
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/LUDecomposition.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/LUDecomposition.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/LUDecomposition.java	(working copy)
@@ -26,59 +26,59 @@
  */
 @Deprecated
 public class LUDecomposition implements java.io.Serializable {
-	static final long serialVersionUID = 1020;
-	protected LUDecompositionQuick quick;
+  static final long serialVersionUID = 1020;
+  protected LUDecompositionQuick quick;
 /**
 Constructs and returns a new LU Decomposition object; 
 The decomposed matrices can be retrieved via instance methods of the returned decomposition object.
 @param  A   Rectangular matrix
 @return     Structure to access L, U and piv.
-*/	
+*/  
 public LUDecomposition(DoubleMatrix2D A) {
-	quick = new LUDecompositionQuick(0); // zero tolerance for compatibility with Jama
-	quick.decompose(A.copy());
+  quick = new LUDecompositionQuick(0); // zero tolerance for compatibility with Jama
+  quick.decompose(A.copy());
 }
 /** 
 Returns the determinant, <tt>det(A)</tt>.
 @exception  IllegalArgumentException  Matrix must be square
 */
 public double det() {
-	return quick.det();
+  return quick.det();
 }
 /** 
 Returns pivot permutation vector as a one-dimensional double array
 @return     (double) piv
 */
 private double[] getDoublePivot() {
-	return quick.getDoublePivot();
+  return quick.getDoublePivot();
 }
 /** 
 Returns the lower triangular factor, <tt>L</tt>.
 @return     <tt>L</tt>
 */
 public DoubleMatrix2D getL() {
-	return quick.getL();
+  return quick.getL();
 }
 /** 
 Returns a copy of the pivot permutation vector.
 @return     piv
 */
 public int[] getPivot() {
-	return (int[]) quick.getPivot().clone();
+  return (int[]) quick.getPivot().clone();
 }
 /** 
 Returns the upper triangular factor, <tt>U</tt>.
 @return     <tt>U</tt>
 */
 public DoubleMatrix2D getU() {
-	return quick.getU();
+  return quick.getU();
 }
 /** 
 Returns whether the matrix is nonsingular (has an inverse).
 @return true if <tt>U</tt>, and hence <tt>A</tt>, is nonsingular; false otherwise.
 */
 public boolean isNonsingular() {
-	return quick.isNonsingular();
+  return quick.isNonsingular();
 }
 /** 
 Solves <tt>A*X = B</tt>.
@@ -90,9 +90,9 @@
 */
 
 public DoubleMatrix2D solve(DoubleMatrix2D B) {
-	DoubleMatrix2D X = B.copy();
-	quick.solve(X);
-	return X;
+  DoubleMatrix2D X = B.copy();
+  quick.solve(X);
+  return X;
 }
 /**
 Returns a String with (propertyName, propertyValue) pairs.
@@ -104,6 +104,6 @@
 </pre>
 */
 public String toString() {
-	return quick.toString();
+  return quick.toString();
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/CholeskyDecomposition.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/CholeskyDecomposition.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/CholeskyDecomposition.java	(working copy)
@@ -22,22 +22,22 @@
  */
 @Deprecated
 public class CholeskyDecomposition implements java.io.Serializable {
-	static final long serialVersionUID = 1020;
-	/** Array for internal storage of decomposition.
-	@serial internal array storage.
-	*/
-	//private double[][] L;
-	private DoubleMatrix2D L;
-	
-	/** Row and column dimension (square matrix).
-	@serial matrix dimension.
-	*/
-	private int n;
-	
-	/** Symmetric and positive definite flag.
-	@serial is symmetric and positive definite flag.
-	*/
-	private boolean isSymmetricPositiveDefinite;
+  static final long serialVersionUID = 1020;
+  /** Array for internal storage of decomposition.
+  @serial internal array storage.
+  */
+  //private double[][] L;
+  private DoubleMatrix2D L;
+  
+  /** Row and column dimension (square matrix).
+  @serial matrix dimension.
+  */
+  private int n;
+  
+  /** Symmetric and positive definite flag.
+  @serial is symmetric and positive definite flag.
+  */
+  private boolean isSymmetricPositiveDefinite;
 /** 
 Constructs and returns a new Cholesky decomposition object for a symmetric and positive definite matrix; 
 The decomposed matrices can be retrieved via instance methods of the returned decomposition object.
@@ -47,61 +47,61 @@
 @throws IllegalArgumentException if <tt>A</tt> is not square.
 */
 public CholeskyDecomposition(DoubleMatrix2D A) {
-	Property.DEFAULT.checkSquare(A); 
-	// Initialize.
-	//double[][] A = Arg.getArray();
-	
-	n = A.rows();
-	//L = new double[n][n];
-	L = A.like(n,n);
-	isSymmetricPositiveDefinite = (A.columns() == n);
-	
-	//precompute and cache some views to avoid regenerating them time and again
-	DoubleMatrix1D[] Lrows = new DoubleMatrix1D[n];
-	for (int j = 0; j < n; j++) Lrows[j] = L.viewRow(j);
-	
-	// Main loop.
-	for (int j = 0; j < n; j++) {
-		//double[] Lrowj = L[j];
-		//DoubleMatrix1D Lrowj = L.viewRow(j);
-		double d = 0.0;
-		for (int k = 0; k < j; k++) {
-			//double[] Lrowk = L[k];
-			double s = Lrows[k].zDotProduct(Lrows[j],0,k);
-			/*
-			DoubleMatrix1D Lrowk = L.viewRow(k);
-			double s = 0.0;
-			for (int i = 0; i < k; i++) {
-			   s += Lrowk.getQuick(i)*Lrowj.getQuick(i);
-			}
-			*/
-			s = (A.getQuick(j,k) - s) / L.getQuick(k,k);
-			Lrows[j].setQuick(k,s);
-			d = d + s*s;
-			isSymmetricPositiveDefinite = isSymmetricPositiveDefinite && (A.getQuick(k,j) == A.getQuick(j,k)); 
-		}
-		d = A.getQuick(j,j) - d;
-		isSymmetricPositiveDefinite = isSymmetricPositiveDefinite && (d > 0.0);
-		L.setQuick(j,j, Math.sqrt(Math.max(d,0.0)));
-		
-		for (int k = j+1; k < n; k++) {
-			L.setQuick(j,k, 0.0);
-		}
-	}
+  Property.DEFAULT.checkSquare(A); 
+  // Initialize.
+  //double[][] A = Arg.getArray();
+  
+  n = A.rows();
+  //L = new double[n][n];
+  L = A.like(n,n);
+  isSymmetricPositiveDefinite = (A.columns() == n);
+  
+  //precompute and cache some views to avoid regenerating them time and again
+  DoubleMatrix1D[] Lrows = new DoubleMatrix1D[n];
+  for (int j = 0; j < n; j++) Lrows[j] = L.viewRow(j);
+  
+  // Main loop.
+  for (int j = 0; j < n; j++) {
+    //double[] Lrowj = L[j];
+    //DoubleMatrix1D Lrowj = L.viewRow(j);
+    double d = 0.0;
+    for (int k = 0; k < j; k++) {
+      //double[] Lrowk = L[k];
+      double s = Lrows[k].zDotProduct(Lrows[j],0,k);
+      /*
+      DoubleMatrix1D Lrowk = L.viewRow(k);
+      double s = 0.0;
+      for (int i = 0; i < k; i++) {
+         s += Lrowk.getQuick(i)*Lrowj.getQuick(i);
+      }
+      */
+      s = (A.getQuick(j,k) - s) / L.getQuick(k,k);
+      Lrows[j].setQuick(k,s);
+      d = d + s*s;
+      isSymmetricPositiveDefinite = isSymmetricPositiveDefinite && (A.getQuick(k,j) == A.getQuick(j,k)); 
+    }
+    d = A.getQuick(j,j) - d;
+    isSymmetricPositiveDefinite = isSymmetricPositiveDefinite && (d > 0.0);
+    L.setQuick(j,j, Math.sqrt(Math.max(d,0.0)));
+    
+    for (int k = j+1; k < n; k++) {
+      L.setQuick(j,k, 0.0);
+    }
+  }
 }
 /** 
 Returns the triangular factor, <tt>L</tt>.
 @return     <tt>L</tt>
 */
 public DoubleMatrix2D getL() {
-	return L;
+  return L;
 }
 /** 
 Returns whether the matrix <tt>A</tt> is symmetric and positive definite.
 @return     true if <tt>A</tt> is symmetric and positive definite; false otherwise
 */
 public boolean isSymmetricPositiveDefinite() {
-	return isSymmetricPositiveDefinite;
+  return isSymmetricPositiveDefinite;
 }
 /** 
 Solves <tt>A*X = B</tt>; returns <tt>X</tt>.
@@ -111,33 +111,33 @@
 @exception  IllegalArgumentException  if <tt>!isSymmetricPositiveDefinite()</tt>.
 */
 public DoubleMatrix2D solve(DoubleMatrix2D B) {
-	// Copy right hand side.
-	DoubleMatrix2D X = B.copy();
-	int nx = B.columns();
+  // Copy right hand side.
+  DoubleMatrix2D X = B.copy();
+  int nx = B.columns();
 
-	// fix by MG Ferreira <mgf@webmail.co.za>
-	// old code is in method xxxSolveBuggy()
-	for (int c = 0; c < nx; c++ ) {
-		// Solve L*Y = B;
-		for (int i = 0; i < n; i++)	{
-			double sum = B.getQuick( i, c );
-			for (int k = i-1; k >= 0; k--) {
-				sum -= L.getQuick(i,k) * X.getQuick( k, c );
-			}
-			X.setQuick( i, c, sum / L.getQuick( i, i ) );
-		}
+  // fix by MG Ferreira <mgf@webmail.co.za>
+  // old code is in method xxxSolveBuggy()
+  for (int c = 0; c < nx; c++ ) {
+    // Solve L*Y = B;
+    for (int i = 0; i < n; i++)  {
+      double sum = B.getQuick( i, c );
+      for (int k = i-1; k >= 0; k--) {
+        sum -= L.getQuick(i,k) * X.getQuick( k, c );
+      }
+      X.setQuick( i, c, sum / L.getQuick( i, i ) );
+    }
 
-		// Solve L'*X = Y;
-		for (int i = n-1; i >= 0; i--) {
-			double sum = X.getQuick( i, c );
-			for (int k = i+1; k < n; k++) {
-				sum -= L.getQuick(k,i) * X.getQuick( k, c );
-			}
-			X.setQuick( i, c, sum / L.getQuick( i, i ) );
-		}
-	}
+    // Solve L'*X = Y;
+    for (int i = n-1; i >= 0; i--) {
+      double sum = X.getQuick( i, c );
+      for (int k = i+1; k < n; k++) {
+        sum -= L.getQuick(k,i) * X.getQuick( k, c );
+      }
+      X.setQuick( i, c, sum / L.getQuick( i, i ) );
+    }
+  }
 
-	return X;
+  return X;
 }
 /** 
 Solves <tt>A*X = B</tt>; returns <tt>X</tt>.
@@ -147,40 +147,40 @@
 @exception  IllegalArgumentException  if <tt>!isSymmetricPositiveDefinite()</tt>.
 */
 private DoubleMatrix2D XXXsolveBuggy(DoubleMatrix2D B) {
-	org.apache.mahout.jet.math.Functions F = org.apache.mahout.jet.math.Functions.functions;
-	if (B.rows() != n) {
-		throw new IllegalArgumentException("Matrix row dimensions must agree.");
-	}
-	if (!isSymmetricPositiveDefinite) {
-		throw new IllegalArgumentException("Matrix is not symmetric positive definite.");
-	}
-	
-	// Copy right hand side.
-	DoubleMatrix2D X = B.copy();
-	int nx = B.columns();
-	
-	// precompute and cache some views to avoid regenerating them time and again
-	DoubleMatrix1D[] Xrows = new DoubleMatrix1D[n];
-	for (int k = 0; k < n; k++) Xrows[k] = X.viewRow(k);
-	
-	// Solve L*Y = B;
-	for (int k = 0; k < n; k++) {
-		for (int i = k+1; i < n; i++) {
-			// X[i,j] -= X[k,j]*L[i,k]
-			Xrows[i].assign(Xrows[k], F.minusMult(L.getQuick(i,k)));
-		}
-		Xrows[k].assign(F.div(L.getQuick(k,k)));
-	}
-	
-	// Solve L'*X = Y;
-	for (int k = n-1; k >= 0; k--) {
-		Xrows[k].assign(F.div(L.getQuick(k,k)));
-		for (int i = 0; i < k; i++) {
-			// X[i,j] -= X[k,j]*L[k,i]
-			Xrows[i].assign(Xrows[k], F.minusMult(L.getQuick(k,i)));
-		}
-	}
-	return X;
+  org.apache.mahout.jet.math.Functions F = org.apache.mahout.jet.math.Functions.functions;
+  if (B.rows() != n) {
+    throw new IllegalArgumentException("Matrix row dimensions must agree.");
+  }
+  if (!isSymmetricPositiveDefinite) {
+    throw new IllegalArgumentException("Matrix is not symmetric positive definite.");
+  }
+  
+  // Copy right hand side.
+  DoubleMatrix2D X = B.copy();
+  int nx = B.columns();
+  
+  // precompute and cache some views to avoid regenerating them time and again
+  DoubleMatrix1D[] Xrows = new DoubleMatrix1D[n];
+  for (int k = 0; k < n; k++) Xrows[k] = X.viewRow(k);
+  
+  // Solve L*Y = B;
+  for (int k = 0; k < n; k++) {
+    for (int i = k+1; i < n; i++) {
+      // X[i,j] -= X[k,j]*L[i,k]
+      Xrows[i].assign(Xrows[k], F.minusMult(L.getQuick(i,k)));
+    }
+    Xrows[k].assign(F.div(L.getQuick(k,k)));
+  }
+  
+  // Solve L'*X = Y;
+  for (int k = n-1; k >= 0; k--) {
+    Xrows[k].assign(F.div(L.getQuick(k,k)));
+    for (int i = 0; i < k; i++) {
+      // X[i,j] -= X[k,j]*L[k,i]
+      Xrows[i].assign(Xrows[k], F.minusMult(L.getQuick(k,i)));
+    }
+  }
+  return X;
 }
 
 /**
@@ -193,25 +193,25 @@
 </pre>
 */
 public String toString() {
-	StringBuffer buf = new StringBuffer();
-	String unknown = "Illegal operation or error: ";
+  StringBuffer buf = new StringBuffer();
+  String unknown = "Illegal operation or error: ";
 
-	buf.append("--------------------------------------------------------------------------\n");
-	buf.append("CholeskyDecomposition(A) --> isSymmetricPositiveDefinite(A), L, inverse(A)\n");
-	buf.append("--------------------------------------------------------------------------\n");
+  buf.append("--------------------------------------------------------------------------\n");
+  buf.append("CholeskyDecomposition(A) --> isSymmetricPositiveDefinite(A), L, inverse(A)\n");
+  buf.append("--------------------------------------------------------------------------\n");
 
-	buf.append("isSymmetricPositiveDefinite = ");
-	try { buf.append(String.valueOf(this.isSymmetricPositiveDefinite()));} 
-	catch (IllegalArgumentException exc) { buf.append(unknown+exc.getMessage()); }
-		
-	buf.append("\n\nL = ");
-	try { buf.append(String.valueOf(this.getL()));} 
-	catch (IllegalArgumentException exc) { buf.append(unknown+exc.getMessage()); }
-	
-	buf.append("\n\ninverse(A) = ");
-	try { buf.append(String.valueOf(this.solve(org.apache.mahout.matrix.matrix.DoubleFactory2D.dense.identity(L.rows()))));}
-	catch (IllegalArgumentException exc) { buf.append(unknown+exc.getMessage()); }
-	
-	return buf.toString();
+  buf.append("isSymmetricPositiveDefinite = ");
+  try { buf.append(String.valueOf(this.isSymmetricPositiveDefinite()));} 
+  catch (IllegalArgumentException exc) { buf.append(unknown+exc.getMessage()); }
+    
+  buf.append("\n\nL = ");
+  try { buf.append(String.valueOf(this.getL()));} 
+  catch (IllegalArgumentException exc) { buf.append(unknown+exc.getMessage()); }
+  
+  buf.append("\n\ninverse(A) = ");
+  try { buf.append(String.valueOf(this.solve(org.apache.mahout.matrix.matrix.DoubleFactory2D.dense.identity(L.rows()))));}
+  catch (IllegalArgumentException exc) { buf.append(unknown+exc.getMessage()); }
+  
+  return buf.toString();
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/Diagonal.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/Diagonal.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/Diagonal.java	(working copy)
@@ -12,15 +12,13 @@
 /**
  * For diagonal matrices we can often do better.
  *
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 09/24/99
  */
 class Diagonal {
 /**
  * Makes this class non instantiable, but still let's others inherit from it.
  */
 protected Diagonal() {
-	throw new RuntimeException("Non instantiable");
+  throw new RuntimeException("Non instantiable");
 }
 /**
  * Modifies A to hold its inverse.
@@ -30,13 +28,13 @@
  * @throws IllegalArgumentException if <tt>x.size() != y.size()</tt>.
  */
 public static boolean inverse(DoubleMatrix2D A) {
-	Property.DEFAULT.checkSquare(A);
-	boolean isNonSingular = true;
-	for (int i=A.rows(); --i >= 0;) {
-		double v = A.getQuick(i,i);
-		isNonSingular &= (v!=0);
-		A.setQuick(i,i, 1/v);
-	}
-	return isNonSingular;
+  Property.DEFAULT.checkSquare(A);
+  boolean isNonSingular = true;
+  for (int i=A.rows(); --i >= 0;) {
+    double v = A.getQuick(i,i);
+    isNonSingular &= (v!=0);
+    A.setQuick(i,i, 1/v);
+  }
+  return isNonSingular;
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/SingularValueDecomposition.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/SingularValueDecomposition.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/SingularValueDecomposition.java	(working copy)
@@ -27,23 +27,23 @@
  */
 @Deprecated
 public class SingularValueDecomposition implements java.io.Serializable {
-	static final long serialVersionUID = 1020;
-	/** Arrays for internal storage of U and V.
-	@serial internal storage of U.
-	@serial internal storage of V.
-	*/
-	private double[][] U, V;
-	
-	/** Array for internal storage of singular values.
-	@serial internal storage of singular values.
-	*/
-	private double[] s;
-	
-	/** Row and column dimensions.
-	@serial row dimension.
-	@serial column dimension.
-	*/
-	private int m, n;
+  static final long serialVersionUID = 1020;
+  /** Arrays for internal storage of U and V.
+  @serial internal storage of U.
+  @serial internal storage of V.
+  */
+  private double[][] U, V;
+  
+  /** Array for internal storage of singular values.
+  @serial internal storage of singular values.
+  */
+  private double[] s;
+  
+  /** Row and column dimensions.
+  @serial row dimension.
+  @serial column dimension.
+  */
+  private int m, n;
 /** 
 Constructs and returns a new singular value decomposition object; 
 The decomposed matrices can be retrieved via instance methods of the returned decomposition object.
@@ -52,480 +52,480 @@
 @throws IllegalArgumentException if <tt>A.rows() < A.columns()</tt>.
 */
 public SingularValueDecomposition(DoubleMatrix2D Arg) {
-	Property.DEFAULT.checkRectangular(Arg);
+  Property.DEFAULT.checkRectangular(Arg);
 
-	  // Derived from LINPACK code.
-	  // Initialize.
-	  double[][] A = Arg.toArray();
-	  m = Arg.rows();
-	  n = Arg.columns();
-	  int nu = Math.min(m,n);
-	  s = new double [Math.min(m+1,n)];
-	  U = new double [m][nu];
-	  V = new double [n][n];
-	  double[] e = new double [n];
-	  double[] work = new double [m];
-	  boolean wantu = true;
-	  boolean wantv = true;
+    // Derived from LINPACK code.
+    // Initialize.
+    double[][] A = Arg.toArray();
+    m = Arg.rows();
+    n = Arg.columns();
+    int nu = Math.min(m,n);
+    s = new double [Math.min(m+1,n)];
+    U = new double [m][nu];
+    V = new double [n][n];
+    double[] e = new double [n];
+    double[] work = new double [m];
+    boolean wantu = true;
+    boolean wantv = true;
 
-	  // Reduce A to bidiagonal form, storing the diagonal elements
-	  // in s and the super-diagonal elements in e.
+    // Reduce A to bidiagonal form, storing the diagonal elements
+    // in s and the super-diagonal elements in e.
 
-	  int nct = Math.min(m-1,n);
-	  int nrt = Math.max(0,Math.min(n-2,m));
-	  for (int k = 0; k < Math.max(nct,nrt); k++) {
-		 if (k < nct) {
+    int nct = Math.min(m-1,n);
+    int nrt = Math.max(0,Math.min(n-2,m));
+    for (int k = 0; k < Math.max(nct,nrt); k++) {
+     if (k < nct) {
 
-			// Compute the transformation for the k-th column and
-			// place the k-th diagonal in s[k].
-			// Compute 2-norm of k-th column without under/overflow.
-			s[k] = 0;
-			for (int i = k; i < m; i++) {
-			   s[k] = Algebra.hypot(s[k],A[i][k]);
-			}
-			if (s[k] != 0.0) {
-			   if (A[k][k] < 0.0) {
-				  s[k] = -s[k];
-			   }
-			   for (int i = k; i < m; i++) {
-				  A[i][k] /= s[k];
-			   }
-			   A[k][k] += 1.0;
-			}
-			s[k] = -s[k];
-		 }
-		 for (int j = k+1; j < n; j++) {
-			if ((k < nct) & (s[k] != 0.0))  {
+      // Compute the transformation for the k-th column and
+      // place the k-th diagonal in s[k].
+      // Compute 2-norm of k-th column without under/overflow.
+      s[k] = 0;
+      for (int i = k; i < m; i++) {
+         s[k] = Algebra.hypot(s[k],A[i][k]);
+      }
+      if (s[k] != 0.0) {
+         if (A[k][k] < 0.0) {
+          s[k] = -s[k];
+         }
+         for (int i = k; i < m; i++) {
+          A[i][k] /= s[k];
+         }
+         A[k][k] += 1.0;
+      }
+      s[k] = -s[k];
+     }
+     for (int j = k+1; j < n; j++) {
+      if ((k < nct) & (s[k] != 0.0))  {
 
-			// Apply the transformation.
+      // Apply the transformation.
 
-			   double t = 0;
-			   for (int i = k; i < m; i++) {
-				  t += A[i][k]*A[i][j];
-			   }
-			   t = -t/A[k][k];
-			   for (int i = k; i < m; i++) {
-				  A[i][j] += t*A[i][k];
-			   }
-			}
+         double t = 0;
+         for (int i = k; i < m; i++) {
+          t += A[i][k]*A[i][j];
+         }
+         t = -t/A[k][k];
+         for (int i = k; i < m; i++) {
+          A[i][j] += t*A[i][k];
+         }
+      }
 
-			// Place the k-th row of A into e for the
-			// subsequent calculation of the row transformation.
+      // Place the k-th row of A into e for the
+      // subsequent calculation of the row transformation.
 
-			e[j] = A[k][j];
-		 }
-		 if (wantu & (k < nct)) {
+      e[j] = A[k][j];
+     }
+     if (wantu & (k < nct)) {
 
-			// Place the transformation in U for subsequent back
-			// multiplication.
+      // Place the transformation in U for subsequent back
+      // multiplication.
 
-			for (int i = k; i < m; i++) {
-			   U[i][k] = A[i][k];
-			}
-		 }
-		 if (k < nrt) {
+      for (int i = k; i < m; i++) {
+         U[i][k] = A[i][k];
+      }
+     }
+     if (k < nrt) {
 
-			// Compute the k-th row transformation and place the
-			// k-th super-diagonal in e[k].
-			// Compute 2-norm without under/overflow.
-			e[k] = 0;
-			for (int i = k+1; i < n; i++) {
-			   e[k] = Algebra.hypot(e[k],e[i]);
-			}
-			if (e[k] != 0.0) {
-			   if (e[k+1] < 0.0) {
-				  e[k] = -e[k];
-			   }
-			   for (int i = k+1; i < n; i++) {
-				  e[i] /= e[k];
-			   }
-			   e[k+1] += 1.0;
-			}
-			e[k] = -e[k];
-			if ((k+1 < m) & (e[k] != 0.0)) {
+      // Compute the k-th row transformation and place the
+      // k-th super-diagonal in e[k].
+      // Compute 2-norm without under/overflow.
+      e[k] = 0;
+      for (int i = k+1; i < n; i++) {
+         e[k] = Algebra.hypot(e[k],e[i]);
+      }
+      if (e[k] != 0.0) {
+         if (e[k+1] < 0.0) {
+          e[k] = -e[k];
+         }
+         for (int i = k+1; i < n; i++) {
+          e[i] /= e[k];
+         }
+         e[k+1] += 1.0;
+      }
+      e[k] = -e[k];
+      if ((k+1 < m) & (e[k] != 0.0)) {
 
-			// Apply the transformation.
+      // Apply the transformation.
 
-			   for (int i = k+1; i < m; i++) {
-				  work[i] = 0.0;
-			   }
-			   for (int j = k+1; j < n; j++) {
-				  for (int i = k+1; i < m; i++) {
-					 work[i] += e[j]*A[i][j];
-				  }
-			   }
-			   for (int j = k+1; j < n; j++) {
-				  double t = -e[j]/e[k+1];
-				  for (int i = k+1; i < m; i++) {
-					 A[i][j] += t*work[i];
-				  }
-			   }
-			}
-			if (wantv) {
+         for (int i = k+1; i < m; i++) {
+          work[i] = 0.0;
+         }
+         for (int j = k+1; j < n; j++) {
+          for (int i = k+1; i < m; i++) {
+           work[i] += e[j]*A[i][j];
+          }
+         }
+         for (int j = k+1; j < n; j++) {
+          double t = -e[j]/e[k+1];
+          for (int i = k+1; i < m; i++) {
+           A[i][j] += t*work[i];
+          }
+         }
+      }
+      if (wantv) {
 
-			// Place the transformation in V for subsequent
-			// back multiplication.
+      // Place the transformation in V for subsequent
+      // back multiplication.
 
-			   for (int i = k+1; i < n; i++) {
-				  V[i][k] = e[i];
-			   }
-			}
-		 }
-	  }
+         for (int i = k+1; i < n; i++) {
+          V[i][k] = e[i];
+         }
+      }
+     }
+    }
 
-	  // Set up the final bidiagonal matrix or order p.
+    // Set up the final bidiagonal matrix or order p.
 
-	  int p = Math.min(n,m+1);
-	  if (nct < n) {
-		 s[nct] = A[nct][nct];
-	  }
-	  if (m < p) {
-		 s[p-1] = 0.0;
-	  }
-	  if (nrt+1 < p) {
-		 e[nrt] = A[nrt][p-1];
-	  }
-	  e[p-1] = 0.0;
+    int p = Math.min(n,m+1);
+    if (nct < n) {
+     s[nct] = A[nct][nct];
+    }
+    if (m < p) {
+     s[p-1] = 0.0;
+    }
+    if (nrt+1 < p) {
+     e[nrt] = A[nrt][p-1];
+    }
+    e[p-1] = 0.0;
 
-	  // If required, generate U.
+    // If required, generate U.
 
-	  if (wantu) {
-		 for (int j = nct; j < nu; j++) {
-			for (int i = 0; i < m; i++) {
-			   U[i][j] = 0.0;
-			}
-			U[j][j] = 1.0;
-		 }
-		 for (int k = nct-1; k >= 0; k--) {
-			if (s[k] != 0.0) {
-			   for (int j = k+1; j < nu; j++) {
-				  double t = 0;
-				  for (int i = k; i < m; i++) {
-					 t += U[i][k]*U[i][j];
-				  }
-				  t = -t/U[k][k];
-				  for (int i = k; i < m; i++) {
-					 U[i][j] += t*U[i][k];
-				  }
-			   }
-			   for (int i = k; i < m; i++ ) {
-				  U[i][k] = -U[i][k];
-			   }
-			   U[k][k] = 1.0 + U[k][k];
-			   for (int i = 0; i < k-1; i++) {
-				  U[i][k] = 0.0;
-			   }
-			} else {
-			   for (int i = 0; i < m; i++) {
-				  U[i][k] = 0.0;
-			   }
-			   U[k][k] = 1.0;
-			}
-		 }
-	  }
+    if (wantu) {
+     for (int j = nct; j < nu; j++) {
+      for (int i = 0; i < m; i++) {
+         U[i][j] = 0.0;
+      }
+      U[j][j] = 1.0;
+     }
+     for (int k = nct-1; k >= 0; k--) {
+      if (s[k] != 0.0) {
+         for (int j = k+1; j < nu; j++) {
+          double t = 0;
+          for (int i = k; i < m; i++) {
+           t += U[i][k]*U[i][j];
+          }
+          t = -t/U[k][k];
+          for (int i = k; i < m; i++) {
+           U[i][j] += t*U[i][k];
+          }
+         }
+         for (int i = k; i < m; i++ ) {
+          U[i][k] = -U[i][k];
+         }
+         U[k][k] = 1.0 + U[k][k];
+         for (int i = 0; i < k-1; i++) {
+          U[i][k] = 0.0;
+         }
+      } else {
+         for (int i = 0; i < m; i++) {
+          U[i][k] = 0.0;
+         }
+         U[k][k] = 1.0;
+      }
+     }
+    }
 
-	  // If required, generate V.
+    // If required, generate V.
 
-	  if (wantv) {
-		 for (int k = n-1; k >= 0; k--) {
-			if ((k < nrt) & (e[k] != 0.0)) {
-			   for (int j = k+1; j < nu; j++) {
-				  double t = 0;
-				  for (int i = k+1; i < n; i++) {
-					 t += V[i][k]*V[i][j];
-				  }
-				  t = -t/V[k+1][k];
-				  for (int i = k+1; i < n; i++) {
-					 V[i][j] += t*V[i][k];
-				  }
-			   }
-			}
-			for (int i = 0; i < n; i++) {
-			   V[i][k] = 0.0;
-			}
-			V[k][k] = 1.0;
-		 }
-	  }
+    if (wantv) {
+     for (int k = n-1; k >= 0; k--) {
+      if ((k < nrt) & (e[k] != 0.0)) {
+         for (int j = k+1; j < nu; j++) {
+          double t = 0;
+          for (int i = k+1; i < n; i++) {
+           t += V[i][k]*V[i][j];
+          }
+          t = -t/V[k+1][k];
+          for (int i = k+1; i < n; i++) {
+           V[i][j] += t*V[i][k];
+          }
+         }
+      }
+      for (int i = 0; i < n; i++) {
+         V[i][k] = 0.0;
+      }
+      V[k][k] = 1.0;
+     }
+    }
 
-	  // Main iteration loop for the singular values.
+    // Main iteration loop for the singular values.
 
-	  int pp = p-1;
-	  int iter = 0;
-	  double eps = Math.pow(2.0,-52.0);
-	  while (p > 0) {
-		 int k,kase;
+    int pp = p-1;
+    int iter = 0;
+    double eps = Math.pow(2.0,-52.0);
+    while (p > 0) {
+     int k,kase;
 
-		 // Here is where a test for too many iterations would go.
+     // Here is where a test for too many iterations would go.
 
-		 // This section of the program inspects for
-		 // negligible elements in the s and e arrays.  On
-		 // completion the variables kase and k are set as follows.
+     // This section of the program inspects for
+     // negligible elements in the s and e arrays.  On
+     // completion the variables kase and k are set as follows.
 
-		 // kase = 1     if s(p) and e[k-1] are negligible and k<p
-		 // kase = 2     if s(k) is negligible and k<p
-		 // kase = 3     if e[k-1] is negligible, k<p, and
-		 //              s(k), ..., s(p) are not negligible (qr step).
-		 // kase = 4     if e(p-1) is negligible (convergence).
+     // kase = 1     if s(p) and e[k-1] are negligible and k<p
+     // kase = 2     if s(k) is negligible and k<p
+     // kase = 3     if e[k-1] is negligible, k<p, and
+     //              s(k), ..., s(p) are not negligible (qr step).
+     // kase = 4     if e(p-1) is negligible (convergence).
 
-		 for (k = p-2; k >= -1; k--) {
-			if (k == -1) {
-			   break;
-			}
-			if (Math.abs(e[k]) <= eps*(Math.abs(s[k]) + Math.abs(s[k+1]))) {
-			   e[k] = 0.0;
-			   break;
-			}
-		 }
-		 if (k == p-2) {
-			kase = 4;
-		 } else {
-			int ks;
-			for (ks = p-1; ks >= k; ks--) {
-			   if (ks == k) {
-				  break;
-			   }
-			   double t = (ks != p ? Math.abs(e[ks]) : 0.) + 
-						  (ks != k+1 ? Math.abs(e[ks-1]) : 0.);
-			   if (Math.abs(s[ks]) <= eps*t)  {
-				  s[ks] = 0.0;
-				  break;
-			   }
-			}
-			if (ks == k) {
-			   kase = 3;
-			} else if (ks == p-1) {
-			   kase = 1;
-			} else {
-			   kase = 2;
-			   k = ks;
-			}
-		 }
-		 k++;
+     for (k = p-2; k >= -1; k--) {
+      if (k == -1) {
+         break;
+      }
+      if (Math.abs(e[k]) <= eps*(Math.abs(s[k]) + Math.abs(s[k+1]))) {
+         e[k] = 0.0;
+         break;
+      }
+     }
+     if (k == p-2) {
+      kase = 4;
+     } else {
+      int ks;
+      for (ks = p-1; ks >= k; ks--) {
+         if (ks == k) {
+          break;
+         }
+         double t = (ks != p ? Math.abs(e[ks]) : 0.) + 
+              (ks != k+1 ? Math.abs(e[ks-1]) : 0.);
+         if (Math.abs(s[ks]) <= eps*t)  {
+          s[ks] = 0.0;
+          break;
+         }
+      }
+      if (ks == k) {
+         kase = 3;
+      } else if (ks == p-1) {
+         kase = 1;
+      } else {
+         kase = 2;
+         k = ks;
+      }
+     }
+     k++;
 
-		 // Perform the task indicated by kase.
+     // Perform the task indicated by kase.
 
-		 switch (kase) {
+     switch (kase) {
 
-			// Deflate negligible s(p).
+      // Deflate negligible s(p).
 
-			case 1: {
-			   double f = e[p-2];
-			   e[p-2] = 0.0;
-			   for (int j = p-2; j >= k; j--) {
-				  double t = Algebra.hypot(s[j],f);
-				  double cs = s[j]/t;
-				  double sn = f/t;
-				  s[j] = t;
-				  if (j != k) {
-					 f = -sn*e[j-1];
-					 e[j-1] = cs*e[j-1];
-				  }
-				  if (wantv) {
-					 for (int i = 0; i < n; i++) {
-						t = cs*V[i][j] + sn*V[i][p-1];
-						V[i][p-1] = -sn*V[i][j] + cs*V[i][p-1];
-						V[i][j] = t;
-					 }
-				  }
-			   }
-			}
-			break;
+      case 1: {
+         double f = e[p-2];
+         e[p-2] = 0.0;
+         for (int j = p-2; j >= k; j--) {
+          double t = Algebra.hypot(s[j],f);
+          double cs = s[j]/t;
+          double sn = f/t;
+          s[j] = t;
+          if (j != k) {
+           f = -sn*e[j-1];
+           e[j-1] = cs*e[j-1];
+          }
+          if (wantv) {
+           for (int i = 0; i < n; i++) {
+            t = cs*V[i][j] + sn*V[i][p-1];
+            V[i][p-1] = -sn*V[i][j] + cs*V[i][p-1];
+            V[i][j] = t;
+           }
+          }
+         }
+      }
+      break;
 
-			// Split at negligible s(k).
+      // Split at negligible s(k).
 
-			case 2: {
-			   double f = e[k-1];
-			   e[k-1] = 0.0;
-			   for (int j = k; j < p; j++) {
-				  double t = Algebra.hypot(s[j],f);
-				  double cs = s[j]/t;
-				  double sn = f/t;
-				  s[j] = t;
-				  f = -sn*e[j];
-				  e[j] = cs*e[j];
-				  if (wantu) {
-					 for (int i = 0; i < m; i++) {
-						t = cs*U[i][j] + sn*U[i][k-1];
-						U[i][k-1] = -sn*U[i][j] + cs*U[i][k-1];
-						U[i][j] = t;
-					 }
-				  }
-			   }
-			}
-			break;
+      case 2: {
+         double f = e[k-1];
+         e[k-1] = 0.0;
+         for (int j = k; j < p; j++) {
+          double t = Algebra.hypot(s[j],f);
+          double cs = s[j]/t;
+          double sn = f/t;
+          s[j] = t;
+          f = -sn*e[j];
+          e[j] = cs*e[j];
+          if (wantu) {
+           for (int i = 0; i < m; i++) {
+            t = cs*U[i][j] + sn*U[i][k-1];
+            U[i][k-1] = -sn*U[i][j] + cs*U[i][k-1];
+            U[i][j] = t;
+           }
+          }
+         }
+      }
+      break;
 
-			// Perform one qr step.
+      // Perform one qr step.
 
-			case 3: {
+      case 3: {
 
-			   // Calculate the shift.
+         // Calculate the shift.
    
-			   double scale = Math.max(Math.max(Math.max(Math.max(
-					   Math.abs(s[p-1]),Math.abs(s[p-2])),Math.abs(e[p-2])), 
-					   Math.abs(s[k])),Math.abs(e[k]));
-			   double sp = s[p-1]/scale;
-			   double spm1 = s[p-2]/scale;
-			   double epm1 = e[p-2]/scale;
-			   double sk = s[k]/scale;
-			   double ek = e[k]/scale;
-			   double b = ((spm1 + sp)*(spm1 - sp) + epm1*epm1)/2.0;
-			   double c = (sp*epm1)*(sp*epm1);
-			   double shift = 0.0;
-			   if ((b != 0.0) | (c != 0.0)) {
-				  shift = Math.sqrt(b*b + c);
-				  if (b < 0.0) {
-					 shift = -shift;
-				  }
-				  shift = c/(b + shift);
-			   }
-			   double f = (sk + sp)*(sk - sp) + shift;
-			   double g = sk*ek;
+         double scale = Math.max(Math.max(Math.max(Math.max(
+             Math.abs(s[p-1]),Math.abs(s[p-2])),Math.abs(e[p-2])), 
+             Math.abs(s[k])),Math.abs(e[k]));
+         double sp = s[p-1]/scale;
+         double spm1 = s[p-2]/scale;
+         double epm1 = e[p-2]/scale;
+         double sk = s[k]/scale;
+         double ek = e[k]/scale;
+         double b = ((spm1 + sp)*(spm1 - sp) + epm1*epm1)/2.0;
+         double c = (sp*epm1)*(sp*epm1);
+         double shift = 0.0;
+         if ((b != 0.0) | (c != 0.0)) {
+          shift = Math.sqrt(b*b + c);
+          if (b < 0.0) {
+           shift = -shift;
+          }
+          shift = c/(b + shift);
+         }
+         double f = (sk + sp)*(sk - sp) + shift;
+         double g = sk*ek;
    
-			   // Chase zeros.
+         // Chase zeros.
    
-			   for (int j = k; j < p-1; j++) {
-				  double t = Algebra.hypot(f,g);
-				  double cs = f/t;
-				  double sn = g/t;
-				  if (j != k) {
-					 e[j-1] = t;
-				  }
-				  f = cs*s[j] + sn*e[j];
-				  e[j] = cs*e[j] - sn*s[j];
-				  g = sn*s[j+1];
-				  s[j+1] = cs*s[j+1];
-				  if (wantv) {
-					 for (int i = 0; i < n; i++) {
-						t = cs*V[i][j] + sn*V[i][j+1];
-						V[i][j+1] = -sn*V[i][j] + cs*V[i][j+1];
-						V[i][j] = t;
-					 }
-				  }
-				  t = Algebra.hypot(f,g);
-				  cs = f/t;
-				  sn = g/t;
-				  s[j] = t;
-				  f = cs*e[j] + sn*s[j+1];
-				  s[j+1] = -sn*e[j] + cs*s[j+1];
-				  g = sn*e[j+1];
-				  e[j+1] = cs*e[j+1];
-				  if (wantu && (j < m-1)) {
-					 for (int i = 0; i < m; i++) {
-						t = cs*U[i][j] + sn*U[i][j+1];
-						U[i][j+1] = -sn*U[i][j] + cs*U[i][j+1];
-						U[i][j] = t;
-					 }
-				  }
-			   }
-			   e[p-2] = f;
-			   iter = iter + 1;
-			}
-			break;
+         for (int j = k; j < p-1; j++) {
+          double t = Algebra.hypot(f,g);
+          double cs = f/t;
+          double sn = g/t;
+          if (j != k) {
+           e[j-1] = t;
+          }
+          f = cs*s[j] + sn*e[j];
+          e[j] = cs*e[j] - sn*s[j];
+          g = sn*s[j+1];
+          s[j+1] = cs*s[j+1];
+          if (wantv) {
+           for (int i = 0; i < n; i++) {
+            t = cs*V[i][j] + sn*V[i][j+1];
+            V[i][j+1] = -sn*V[i][j] + cs*V[i][j+1];
+            V[i][j] = t;
+           }
+          }
+          t = Algebra.hypot(f,g);
+          cs = f/t;
+          sn = g/t;
+          s[j] = t;
+          f = cs*e[j] + sn*s[j+1];
+          s[j+1] = -sn*e[j] + cs*s[j+1];
+          g = sn*e[j+1];
+          e[j+1] = cs*e[j+1];
+          if (wantu && (j < m-1)) {
+           for (int i = 0; i < m; i++) {
+            t = cs*U[i][j] + sn*U[i][j+1];
+            U[i][j+1] = -sn*U[i][j] + cs*U[i][j+1];
+            U[i][j] = t;
+           }
+          }
+         }
+         e[p-2] = f;
+         iter = iter + 1;
+      }
+      break;
 
-			// Convergence.
+      // Convergence.
 
-			case 4: {
+      case 4: {
 
-			   // Make the singular values positive.
+         // Make the singular values positive.
    
-			   if (s[k] <= 0.0) {
-				  s[k] = (s[k] < 0.0 ? -s[k] : 0.0);
-				  if (wantv) {
-					 for (int i = 0; i <= pp; i++) {
-						V[i][k] = -V[i][k];
-					 }
-				  }
-			   }
+         if (s[k] <= 0.0) {
+          s[k] = (s[k] < 0.0 ? -s[k] : 0.0);
+          if (wantv) {
+           for (int i = 0; i <= pp; i++) {
+            V[i][k] = -V[i][k];
+           }
+          }
+         }
    
-			   // Order the singular values.
+         // Order the singular values.
    
-			   while (k < pp) {
-				  if (s[k] >= s[k+1]) {
-					 break;
-				  }
-				  double t = s[k];
-				  s[k] = s[k+1];
-				  s[k+1] = t;
-				  if (wantv && (k < n-1)) {
-					 for (int i = 0; i < n; i++) {
-						t = V[i][k+1]; V[i][k+1] = V[i][k]; V[i][k] = t;
-					 }
-				  }
-				  if (wantu && (k < m-1)) {
-					 for (int i = 0; i < m; i++) {
-						t = U[i][k+1]; U[i][k+1] = U[i][k]; U[i][k] = t;
-					 }
-				  }
-				  k++;
-			   }
-			   iter = 0;
-			   p--;
-			}
-			break;
-		 }
-	  }
+         while (k < pp) {
+          if (s[k] >= s[k+1]) {
+           break;
+          }
+          double t = s[k];
+          s[k] = s[k+1];
+          s[k+1] = t;
+          if (wantv && (k < n-1)) {
+           for (int i = 0; i < n; i++) {
+            t = V[i][k+1]; V[i][k+1] = V[i][k]; V[i][k] = t;
+           }
+          }
+          if (wantu && (k < m-1)) {
+           for (int i = 0; i < m; i++) {
+            t = U[i][k+1]; U[i][k+1] = U[i][k]; U[i][k] = t;
+           }
+          }
+          k++;
+         }
+         iter = 0;
+         p--;
+      }
+      break;
+     }
+    }
    }   
 /** 
 Returns the two norm condition number, which is <tt>max(S) / min(S)</tt>.
 */
 public double cond() {
-	return s[0]/s[Math.min(m,n)-1];
+  return s[0]/s[Math.min(m,n)-1];
 }
 /** 
 Returns the diagonal matrix of singular values.
 @return     S
 */
 public DoubleMatrix2D getS() {
-	double[][] S = new double[n][n];
-	for (int i = 0; i < n; i++) {
-		for (int j = 0; j < n; j++) {
-			S[i][j] = 0.0;
-		}
-		S[i][i] = this.s[i];
-	}
-	return DoubleFactory2D.dense.make(S);
+  double[][] S = new double[n][n];
+  for (int i = 0; i < n; i++) {
+    for (int j = 0; j < n; j++) {
+      S[i][j] = 0.0;
+    }
+    S[i][i] = this.s[i];
+  }
+  return DoubleFactory2D.dense.make(S);
 }
 /** 
 Returns the diagonal of <tt>S</tt>, which is a one-dimensional array of singular values
 @return     diagonal of <tt>S</tt>.
 */
 public double[] getSingularValues() {
-	return s;
+  return s;
 }
 /** 
 Returns the left singular vectors <tt>U</tt>.
 @return     <tt>U</tt>
 */
 public DoubleMatrix2D getU() {
-	//return new DoubleMatrix2D(U,m,Math.min(m+1,n));
-	return DoubleFactory2D.dense.make(U).viewPart(0,0,m,Math.min(m+1,n));
+  //return new DoubleMatrix2D(U,m,Math.min(m+1,n));
+  return DoubleFactory2D.dense.make(U).viewPart(0,0,m,Math.min(m+1,n));
 }
 /** 
 Returns the right singular vectors <tt>V</tt>.
 @return     <tt>V</tt>
 */
 public DoubleMatrix2D getV() {
-	return DoubleFactory2D.dense.make(V);
+  return DoubleFactory2D.dense.make(V);
 }
 /** 
 Returns the two norm, which is <tt>max(S)</tt>.
 */
 public double norm2() {
-	return s[0];
+  return s[0];
 }
 /** 
 Returns the effective numerical matrix rank, which is the number of nonnegligible singular values.
 */
 public int rank() {
-	double eps = Math.pow(2.0,-52.0);
-	double tol = Math.max(m,n)*s[0]*eps;
-	int r = 0;
-	for (int i = 0; i < s.length; i++) {
-		if (s[i] > tol) {
-			r++;
-		}
-	}
-	return r;
+  double eps = Math.pow(2.0,-52.0);
+  double tol = Math.max(m,n)*s[0]*eps;
+  int r = 0;
+  for (int i = 0; i < s.length; i++) {
+    if (s[i] > tol) {
+      r++;
+    }
+  }
+  return r;
 }
 /**
 Returns a String with (propertyName, propertyValue) pairs.
@@ -537,37 +537,37 @@
 </pre>
 */
 public String toString() {
-	StringBuffer buf = new StringBuffer();
-	String unknown = "Illegal operation or error: ";
+  StringBuffer buf = new StringBuffer();
+  String unknown = "Illegal operation or error: ";
 
-	buf.append("---------------------------------------------------------------------\n");
-	buf.append("SingularValueDecomposition(A) --> cond(A), rank(A), norm2(A), U, S, V\n");
-	buf.append("---------------------------------------------------------------------\n");
+  buf.append("---------------------------------------------------------------------\n");
+  buf.append("SingularValueDecomposition(A) --> cond(A), rank(A), norm2(A), U, S, V\n");
+  buf.append("---------------------------------------------------------------------\n");
 
-	buf.append("cond = ");
-	try { buf.append(String.valueOf(this.cond()));} 
-	catch (IllegalArgumentException exc) { buf.append(unknown+exc.getMessage()); }
-		
-	buf.append("\nrank = ");
-	try { buf.append(String.valueOf(this.rank()));} 
-	catch (IllegalArgumentException exc) { buf.append(unknown+exc.getMessage()); }
-		
-	buf.append("\nnorm2 = ");
-	try { buf.append(String.valueOf(this.norm2()));} 
-	catch (IllegalArgumentException exc) { buf.append(unknown+exc.getMessage()); }
-		
-	buf.append("\n\nU = ");
-	try { buf.append(String.valueOf(this.getU()));} 
-	catch (IllegalArgumentException exc) { buf.append(unknown+exc.getMessage()); }
-	
-	buf.append("\n\nS = ");
-	try { buf.append(String.valueOf(this.getS()));} 
-	catch (IllegalArgumentException exc) { buf.append(unknown+exc.getMessage()); }
-	
-	buf.append("\n\nV = ");
-	try { buf.append(String.valueOf(this.getV()));} 
-	catch (IllegalArgumentException exc) { buf.append(unknown+exc.getMessage()); }
-	
-	return buf.toString();
+  buf.append("cond = ");
+  try { buf.append(String.valueOf(this.cond()));} 
+  catch (IllegalArgumentException exc) { buf.append(unknown+exc.getMessage()); }
+    
+  buf.append("\nrank = ");
+  try { buf.append(String.valueOf(this.rank()));} 
+  catch (IllegalArgumentException exc) { buf.append(unknown+exc.getMessage()); }
+    
+  buf.append("\nnorm2 = ");
+  try { buf.append(String.valueOf(this.norm2()));} 
+  catch (IllegalArgumentException exc) { buf.append(unknown+exc.getMessage()); }
+    
+  buf.append("\n\nU = ");
+  try { buf.append(String.valueOf(this.getU()));} 
+  catch (IllegalArgumentException exc) { buf.append(unknown+exc.getMessage()); }
+  
+  buf.append("\n\nS = ");
+  try { buf.append(String.valueOf(this.getS()));} 
+  catch (IllegalArgumentException exc) { buf.append(unknown+exc.getMessage()); }
+  
+  buf.append("\n\nV = ");
+  try { buf.append(String.valueOf(this.getV()));} 
+  catch (IllegalArgumentException exc) { buf.append(unknown+exc.getMessage()); }
+  
+  return buf.toString();
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/package.html
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/package.html	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/package.html	(working copy)
@@ -1,12 +1,12 @@
 <HTML>
 <BODY>
-<p>Linear Algebraic matrix computations operating on {@link cern.colt.matrix.DoubleMatrix2D}
-  and {@link cern.colt.matrix.DoubleMatrix1D}. </p>
+<p>Linear Algebraic matrix computations operating on {@link org.apache.mahout.matrix.matrix.DoubleMatrix2D}
+  and {@link org.apache.mahout.matrix.matrix.DoubleMatrix1D}. </p>
 
 <h1><a name="Overview"></a>Overview</h1>
 
 <p>The linalg package provides easy and performant access to compute intensive
-  Linear Algebra. Much functionality is concentrated in class {@link cern.colt.matrix.linalg.Algebra}.
+  Linear Algebra. Much functionality is concentrated in class {@link org.apache.mahout.matrix.matrix.linalg.Algebra}.
   Five fundamental matrix decompositions, which consist of pairs or triples of
   matrices, permutation vectors, and the like, produce results in five decomposition
   classes.&nbsp; These decompositions are accessed by the <tt>Algebra</tt> class
@@ -31,8 +31,8 @@
 
 <h2>Design Issues</h2>
 
-<p> Jama matrices are of type <tt>Jama.Matrix</tt>, Colt matrices of type <tt>cern.colt.matrix.DoubleMatrix1D</tt>,
-  <tt>cern.colt.matrix.DoubleMatrix2D</tt> and <tt>cern.colt.matrix.DoubleMatrix3D</tt>.
+<p> Jama matrices are of type <tt>Jama.Matrix</tt>, Colt matrices of type <tt>org.apache.mahout.matrix.matrix.DoubleMatrix1D</tt>,
+  <tt>org.apache.mahout.matrix.matrix.DoubleMatrix2D</tt> and <tt>org.apache.mahout.matrix.matrix.DoubleMatrix3D</tt>.
 
 <p><tt>Jama.Matrix</tt> is not a general-purpose array class. It is designed for
   a single special purpose: Linear algebra. Because of its limited scope, Jama
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/QRDecomposition.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/QRDecomposition.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/QRDecomposition.java	(working copy)
@@ -27,23 +27,23 @@
  */
 @Deprecated
 public class QRDecomposition implements java.io.Serializable {
-	static final long serialVersionUID = 1020;
-	/** Array for internal storage of decomposition.
-	@serial internal array storage.
-	*/
-	private DoubleMatrix2D QR;
-	//private double[][] QR;
-	
-	/** Row and column dimensions.
-	@serial column dimension.
-	@serial row dimension.
-	*/
-	private int m, n;
-	
-	/** Array for internal storage of diagonal of R.
-	@serial diagonal of R.
-	*/
-	private DoubleMatrix1D Rdiag;
+  static final long serialVersionUID = 1020;
+  /** Array for internal storage of decomposition.
+  @serial internal array storage.
+  */
+  private DoubleMatrix2D QR;
+  //private double[][] QR;
+  
+  /** Row and column dimensions.
+  @serial column dimension.
+  @serial row dimension.
+  */
+  private int m, n;
+  
+  /** Array for internal storage of diagonal of R.
+  @serial diagonal of R.
+  */
+  private DoubleMatrix1D Rdiag;
 /** 
 Constructs and returns a new QR decomposition object;  computed by Householder reflections;
 The decomposed matrices can be retrieved via instance methods of the returned decomposition object.
@@ -53,130 +53,130 @@
 */
 
 public QRDecomposition (DoubleMatrix2D A) {
-	Property.DEFAULT.checkRectangular(A);
+  Property.DEFAULT.checkRectangular(A);
 
-	org.apache.mahout.jet.math.Functions F = org.apache.mahout.jet.math.Functions.functions;
-	// Initialize.
-	QR = A.copy();
-	m = A.rows();
-	n = A.columns();
-	Rdiag = A.like1D(n);
-	//Rdiag = new double[n];
-	org.apache.mahout.matrix.function.DoubleDoubleFunction hypot = Algebra.hypotFunction();
-	
-	// precompute and cache some views to avoid regenerating them time and again
-	DoubleMatrix1D[] QRcolumns = new DoubleMatrix1D[n];
-	DoubleMatrix1D[] QRcolumnsPart = new DoubleMatrix1D[n];
-	for (int k = 0; k < n; k++) {
-		QRcolumns[k] = QR.viewColumn(k);
-		QRcolumnsPart[k] = QR.viewColumn(k).viewPart(k,m-k);
-	}
-	
-	// Main loop.
-	for (int k = 0; k < n; k++) {
-		//DoubleMatrix1D QRcolk = QR.viewColumn(k).viewPart(k,m-k);
-		// Compute 2-norm of k-th column without under/overflow.
-		double nrm = 0;
-		//if (k<m) nrm = QRcolumnsPart[k].aggregate(hypot,F.identity);
-		
-		for (int i = k; i < m; i++) { // fixes bug reported by hong.44@osu.edu
-			nrm = Algebra.hypot(nrm,QR.getQuick(i,k));
-		}
-		
-		
-		if (nrm != 0.0) {
-			// Form k-th Householder vector.
-			if (QR.getQuick(k,k) < 0) nrm = -nrm;
-			QRcolumnsPart[k].assign(org.apache.mahout.jet.math.Functions.div(nrm));
-			/*
-			for (int i = k; i < m; i++) {
-			   QR[i][k] /= nrm;
-			}
-			*/
-			
-			QR.setQuick(k,k, QR.getQuick(k,k) + 1);
-			
-			// Apply transformation to remaining columns.
-			for (int j = k+1; j < n; j++) {
-				DoubleMatrix1D QRcolj = QR.viewColumn(j).viewPart(k,m-k);
-				double s = QRcolumnsPart[k].zDotProduct(QRcolj);
-				/*
-				// fixes bug reported by John Chambers
-				DoubleMatrix1D QRcolj = QR.viewColumn(j).viewPart(k,m-k);
-				double s = QRcolumnsPart[k].zDotProduct(QRcolumns[j]);
-				double s = 0.0; 
-				for (int i = k; i < m; i++) {
-				  s += QR[i][k]*QR[i][j];
-				}
-				*/
-				s = -s / QR.getQuick(k,k);
-				//QRcolumnsPart[j].assign(QRcolumns[k], F.plusMult(s));
-				
-				for (int i = k; i < m; i++) {
-				  QR.setQuick(i,j, QR.getQuick(i,j) + s*QR.getQuick(i,k));
-				}
-				
-			}
-		}
-		Rdiag.setQuick(k, -nrm);
-	}
+  org.apache.mahout.jet.math.Functions F = org.apache.mahout.jet.math.Functions.functions;
+  // Initialize.
+  QR = A.copy();
+  m = A.rows();
+  n = A.columns();
+  Rdiag = A.like1D(n);
+  //Rdiag = new double[n];
+  org.apache.mahout.matrix.function.DoubleDoubleFunction hypot = Algebra.hypotFunction();
+  
+  // precompute and cache some views to avoid regenerating them time and again
+  DoubleMatrix1D[] QRcolumns = new DoubleMatrix1D[n];
+  DoubleMatrix1D[] QRcolumnsPart = new DoubleMatrix1D[n];
+  for (int k = 0; k < n; k++) {
+    QRcolumns[k] = QR.viewColumn(k);
+    QRcolumnsPart[k] = QR.viewColumn(k).viewPart(k,m-k);
+  }
+  
+  // Main loop.
+  for (int k = 0; k < n; k++) {
+    //DoubleMatrix1D QRcolk = QR.viewColumn(k).viewPart(k,m-k);
+    // Compute 2-norm of k-th column without under/overflow.
+    double nrm = 0;
+    //if (k<m) nrm = QRcolumnsPart[k].aggregate(hypot,F.identity);
+    
+    for (int i = k; i < m; i++) { // fixes bug reported by hong.44@osu.edu
+      nrm = Algebra.hypot(nrm,QR.getQuick(i,k));
+    }
+    
+    
+    if (nrm != 0.0) {
+      // Form k-th Householder vector.
+      if (QR.getQuick(k,k) < 0) nrm = -nrm;
+      QRcolumnsPart[k].assign(org.apache.mahout.jet.math.Functions.div(nrm));
+      /*
+      for (int i = k; i < m; i++) {
+         QR[i][k] /= nrm;
+      }
+      */
+      
+      QR.setQuick(k,k, QR.getQuick(k,k) + 1);
+      
+      // Apply transformation to remaining columns.
+      for (int j = k+1; j < n; j++) {
+        DoubleMatrix1D QRcolj = QR.viewColumn(j).viewPart(k,m-k);
+        double s = QRcolumnsPart[k].zDotProduct(QRcolj);
+        /*
+        // fixes bug reported by John Chambers
+        DoubleMatrix1D QRcolj = QR.viewColumn(j).viewPart(k,m-k);
+        double s = QRcolumnsPart[k].zDotProduct(QRcolumns[j]);
+        double s = 0.0; 
+        for (int i = k; i < m; i++) {
+          s += QR[i][k]*QR[i][j];
+        }
+        */
+        s = -s / QR.getQuick(k,k);
+        //QRcolumnsPart[j].assign(QRcolumns[k], F.plusMult(s));
+        
+        for (int i = k; i < m; i++) {
+          QR.setQuick(i,j, QR.getQuick(i,j) + s*QR.getQuick(i,k));
+        }
+        
+      }
+    }
+    Rdiag.setQuick(k, -nrm);
+  }
 }
 /** 
 Returns the Householder vectors <tt>H</tt>.
 @return A lower trapezoidal matrix whose columns define the householder reflections.
 */
 public DoubleMatrix2D getH () {
-	return Algebra.DEFAULT.trapezoidalLower(QR.copy());
+  return Algebra.DEFAULT.trapezoidalLower(QR.copy());
 }
 /** 
 Generates and returns the (economy-sized) orthogonal factor <tt>Q</tt>.
 @return <tt>Q</tt>
 */
 public DoubleMatrix2D getQ () {
-	org.apache.mahout.jet.math.Functions F = org.apache.mahout.jet.math.Functions.functions;
-	DoubleMatrix2D Q = QR.like();
-	//double[][] Q = X.getArray();
-	for (int k = n-1; k >= 0; k--) {
-		DoubleMatrix1D QRcolk = QR.viewColumn(k).viewPart(k,m-k);
-		Q.setQuick(k,k, 1);
-		for (int j = k; j < n; j++) {
-			if (QR.getQuick(k,k) != 0) {
-				DoubleMatrix1D Qcolj = Q.viewColumn(j).viewPart(k,m-k);
-				double s = QRcolk.zDotProduct(Qcolj);
-				s = -s / QR.getQuick(k,k);
-				Qcolj.assign(QRcolk, F.plusMult(s));
-			}
-		}
-	}
-	return Q;
+  org.apache.mahout.jet.math.Functions F = org.apache.mahout.jet.math.Functions.functions;
+  DoubleMatrix2D Q = QR.like();
+  //double[][] Q = X.getArray();
+  for (int k = n-1; k >= 0; k--) {
+    DoubleMatrix1D QRcolk = QR.viewColumn(k).viewPart(k,m-k);
+    Q.setQuick(k,k, 1);
+    for (int j = k; j < n; j++) {
+      if (QR.getQuick(k,k) != 0) {
+        DoubleMatrix1D Qcolj = Q.viewColumn(j).viewPart(k,m-k);
+        double s = QRcolk.zDotProduct(Qcolj);
+        s = -s / QR.getQuick(k,k);
+        Qcolj.assign(QRcolk, F.plusMult(s));
+      }
+    }
+  }
+  return Q;
 }
 /** 
 Returns the upper triangular factor, <tt>R</tt>.
 @return <tt>R</tt>
 */
 public DoubleMatrix2D getR() {
-	DoubleMatrix2D R = QR.like(n,n);
-	for (int i = 0; i < n; i++) {
-		for (int j = 0; j < n; j++) {
-			if (i < j) 
-				R.setQuick(i,j, QR.getQuick(i,j));
-			else if (i == j) 
-				R.setQuick(i,j, Rdiag.getQuick(i));
-			else 
-				R.setQuick(i,j, 0);
-		}
-	}
-	return R;
+  DoubleMatrix2D R = QR.like(n,n);
+  for (int i = 0; i < n; i++) {
+    for (int j = 0; j < n; j++) {
+      if (i < j) 
+        R.setQuick(i,j, QR.getQuick(i,j));
+      else if (i == j) 
+        R.setQuick(i,j, Rdiag.getQuick(i));
+      else 
+        R.setQuick(i,j, 0);
+    }
+  }
+  return R;
 }
 /** 
 Returns whether the matrix <tt>A</tt> has full rank.
 @return true if <tt>R</tt>, and hence <tt>A</tt>, has full rank.
 */
 public boolean hasFullRank() {
-	for (int j = 0; j < n; j++) {
-		if (Rdiag.getQuick(j) == 0) return false;
-	}
-	return true;
+  for (int j = 0; j < n; j++) {
+    if (Rdiag.getQuick(j) == 0) return false;
+  }
+  return true;
 }
 /** 
 Least squares solution of <tt>A*X = B</tt>; <tt>returns X</tt>.
@@ -186,43 +186,43 @@
 @exception  IllegalArgumentException  if <tt>!this.hasFullRank()</tt> (<tt>A</tt> is rank deficient).
 */
 public DoubleMatrix2D solve(DoubleMatrix2D B) {
-	org.apache.mahout.jet.math.Functions F = org.apache.mahout.jet.math.Functions.functions;
-	if (B.rows() != m) {
-		throw new IllegalArgumentException("Matrix row dimensions must agree.");
-	}
-	if (!this.hasFullRank()) {
-		throw new IllegalArgumentException("Matrix is rank deficient.");
-	}
-	
-	// Copy right hand side
-	int nx = B.columns();
-	DoubleMatrix2D X = B.copy();
-	
-	// Compute Y = transpose(Q)*B
-	for (int k = 0; k < n; k++) {
-		for (int j = 0; j < nx; j++) {
-			double s = 0.0; 
-			for (int i = k; i < m; i++) {
-				s += QR.getQuick(i,k)*X.getQuick(i,j);
-			}
-			s = -s / QR.getQuick(k,k);
-			for (int i = k; i < m; i++) {
-				X.setQuick(i,j, X.getQuick(i,j) + s*QR.getQuick(i,k));
-			}
-		}
-	}
-	// Solve R*X = Y;
-	for (int k = n-1; k >= 0; k--) {
-		for (int j = 0; j < nx; j++) {
-			X.setQuick(k,j, X.getQuick(k,j) / Rdiag.getQuick(k));
-		}
-		for (int i = 0; i < k; i++) {
-			for (int j = 0; j < nx; j++) {
-				X.setQuick(i,j, X.getQuick(i,j) - X.getQuick(k,j)*QR.getQuick(i,k));
-			}
-		}
-	}
-	return X.viewPart(0,0,n,nx);
+  org.apache.mahout.jet.math.Functions F = org.apache.mahout.jet.math.Functions.functions;
+  if (B.rows() != m) {
+    throw new IllegalArgumentException("Matrix row dimensions must agree.");
+  }
+  if (!this.hasFullRank()) {
+    throw new IllegalArgumentException("Matrix is rank deficient.");
+  }
+  
+  // Copy right hand side
+  int nx = B.columns();
+  DoubleMatrix2D X = B.copy();
+  
+  // Compute Y = transpose(Q)*B
+  for (int k = 0; k < n; k++) {
+    for (int j = 0; j < nx; j++) {
+      double s = 0.0; 
+      for (int i = k; i < m; i++) {
+        s += QR.getQuick(i,k)*X.getQuick(i,j);
+      }
+      s = -s / QR.getQuick(k,k);
+      for (int i = k; i < m; i++) {
+        X.setQuick(i,j, X.getQuick(i,j) + s*QR.getQuick(i,k));
+      }
+    }
+  }
+  // Solve R*X = Y;
+  for (int k = n-1; k >= 0; k--) {
+    for (int j = 0; j < nx; j++) {
+      X.setQuick(k,j, X.getQuick(k,j) / Rdiag.getQuick(k));
+    }
+    for (int i = 0; i < k; i++) {
+      for (int j = 0; j < nx; j++) {
+        X.setQuick(i,j, X.getQuick(i,j) - X.getQuick(k,j)*QR.getQuick(i,k));
+      }
+    }
+  }
+  return X.viewPart(0,0,n,nx);
 }
 /**
 Returns a String with (propertyName, propertyValue) pairs.
@@ -234,33 +234,33 @@
 </pre>
 */
 public String toString() {
-	StringBuffer buf = new StringBuffer();
-	String unknown = "Illegal operation or error: ";
+  StringBuffer buf = new StringBuffer();
+  String unknown = "Illegal operation or error: ";
 
-	buf.append("-----------------------------------------------------------------\n");
-	buf.append("QRDecomposition(A) --> hasFullRank(A), H, Q, R, pseudo inverse(A)\n");
-	buf.append("-----------------------------------------------------------------\n");
+  buf.append("-----------------------------------------------------------------\n");
+  buf.append("QRDecomposition(A) --> hasFullRank(A), H, Q, R, pseudo inverse(A)\n");
+  buf.append("-----------------------------------------------------------------\n");
 
-	buf.append("hasFullRank = ");
-	try { buf.append(String.valueOf(this.hasFullRank()));} 
-	catch (IllegalArgumentException exc) { buf.append(unknown+exc.getMessage()); }
-	
-	buf.append("\n\nH = ");
-	try { buf.append(String.valueOf(this.getH()));} 
-	catch (IllegalArgumentException exc) { buf.append(unknown+exc.getMessage()); }
-	
-	buf.append("\n\nQ = ");
-	try { buf.append(String.valueOf(this.getQ()));} 
-	catch (IllegalArgumentException exc) { buf.append(unknown+exc.getMessage()); }
-	
-	buf.append("\n\nR = ");
-	try { buf.append(String.valueOf(this.getR()));} 
-	catch (IllegalArgumentException exc) { buf.append(unknown+exc.getMessage()); }
-	
-	buf.append("\n\npseudo inverse(A) = ");
-	try { buf.append(String.valueOf(this.solve(org.apache.mahout.matrix.matrix.DoubleFactory2D.dense.identity(QR.rows()))));}
-	catch (IllegalArgumentException exc) { buf.append(unknown+exc.getMessage()); }
-	
-	return buf.toString();
+  buf.append("hasFullRank = ");
+  try { buf.append(String.valueOf(this.hasFullRank()));} 
+  catch (IllegalArgumentException exc) { buf.append(unknown+exc.getMessage()); }
+  
+  buf.append("\n\nH = ");
+  try { buf.append(String.valueOf(this.getH()));} 
+  catch (IllegalArgumentException exc) { buf.append(unknown+exc.getMessage()); }
+  
+  buf.append("\n\nQ = ");
+  try { buf.append(String.valueOf(this.getQ()));} 
+  catch (IllegalArgumentException exc) { buf.append(unknown+exc.getMessage()); }
+  
+  buf.append("\n\nR = ");
+  try { buf.append(String.valueOf(this.getR()));} 
+  catch (IllegalArgumentException exc) { buf.append(unknown+exc.getMessage()); }
+  
+  buf.append("\n\npseudo inverse(A) = ");
+  try { buf.append(String.valueOf(this.solve(org.apache.mahout.matrix.matrix.DoubleFactory2D.dense.identity(QR.rows()))));}
+  catch (IllegalArgumentException exc) { buf.append(unknown+exc.getMessage()); }
+  
+  return buf.toString();
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/Blas.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/Blas.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/Blas.java	(working copy)
@@ -29,28 +29,28 @@
 <ol>
   <li>BLAS Level 1: Vector-Vector operations </li>
   <ul>
-	<li>ddot  : dot product of two vectors </li>
-	<li>daxpy : scalar times a vector plus a vector </li>
-	<li>drotg : construct a Givens plane rotation </li>
-	<li>drot  : apply a plane rotation </li>
-	<li>dcopy : copy vector X into vector Y </li>
-	<li>dswap : interchange vectors X and Y </li>
-	<li>dnrm2 : Euclidean norm of a vector </li>
-	<li>dasum : sum of absolute values of vector components </li>
-	<li>dscal : scale a vector by a scalar </li>
-	<li>idamax: index of element with maximum absolute value </li>
+  <li>ddot  : dot product of two vectors </li>
+  <li>daxpy : scalar times a vector plus a vector </li>
+  <li>drotg : construct a Givens plane rotation </li>
+  <li>drot  : apply a plane rotation </li>
+  <li>dcopy : copy vector X into vector Y </li>
+  <li>dswap : interchange vectors X and Y </li>
+  <li>dnrm2 : Euclidean norm of a vector </li>
+  <li>dasum : sum of absolute values of vector components </li>
+  <li>dscal : scale a vector by a scalar </li>
+  <li>idamax: index of element with maximum absolute value </li>
   </ul>
   <li>2.BLAS Level 2: Matrix-Vector operations </li>
   <ul>
-	<li>dgemv : matrix-vector multiply with general matrix </li>
-	<li>dger  : rank-1 update on general matrix </li>
-	<li>dsymv : matrix-vector multiply with symmetric matrix </li>
-	<li>dtrmv : matrix-vector multiply with triangular matrix </li>
+  <li>dgemv : matrix-vector multiply with general matrix </li>
+  <li>dger  : rank-1 update on general matrix </li>
+  <li>dsymv : matrix-vector multiply with symmetric matrix </li>
+  <li>dtrmv : matrix-vector multiply with triangular matrix </li>
   </ul>
   <li>3.BLAS Level 3: Matrix-Matrix operations 
-	<ul>
-	  <li>dgemm : matrix-matrix multiply with general matrices </li>
-	</ul>
+  <ul>
+    <li>dgemm : matrix-matrix multiply with general matrices </li>
+  </ul>
   </li>
 </ol>
 
@@ -78,7 +78,7 @@
 @param function a function object taking as first argument the current cell's value of <tt>this</tt>,
 and as second argument the current cell's value of <tt>y</tt>,
 @return <tt>this</tt> (for convenience only).
-@throws	IllegalArgumentException if <tt>x.columns() != y.columns() || x.rows() != y.rows()</tt>
+@throws  IllegalArgumentException if <tt>x.columns() != y.columns() || x.rows() != y.rows()</tt>
 @see org.apache.mahout.jet.math.Functions
 */
 public void assign(DoubleMatrix2D x,DoubleMatrix2D y, org.apache.mahout.matrix.function.DoubleDoubleFunction function) ;
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/EigenvalueDecomposition.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/EigenvalueDecomposition.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/EigenvalueDecomposition.java	(working copy)
@@ -34,40 +34,40 @@
  */
 @Deprecated
 public class EigenvalueDecomposition implements java.io.Serializable {
-	static final long serialVersionUID = 1020;
-	/** Row and column dimension (square matrix).
-	@serial matrix dimension.
-	*/
-	private int n;
-	
-	/** Symmetry flag.
-	@serial internal symmetry flag.
-	*/
-	private boolean issymmetric;
-	
-	/** Arrays for internal storage of eigenvalues.
-	@serial internal storage of eigenvalues.
-	*/
-	private double[] d, e;
-	
-	/** Array for internal storage of eigenvectors.
-	@serial internal storage of eigenvectors.
-	*/
-	private double[][] V;
-	
-	/** Array for internal storage of nonsymmetric Hessenberg form.
-	@serial internal storage of nonsymmetric Hessenberg form.
-	*/
-	private double[][] H;
-	
-	/** Working storage for nonsymmetric algorithm.
-	@serial working storage for nonsymmetric algorithm.
-	*/
-	private double[] ort;
-	
-	// Complex scalar division.
-	
-	private transient double cdivr, cdivi;
+  static final long serialVersionUID = 1020;
+  /** Row and column dimension (square matrix).
+  @serial matrix dimension.
+  */
+  private int n;
+  
+  /** Symmetry flag.
+  @serial internal symmetry flag.
+  */
+  private boolean issymmetric;
+  
+  /** Arrays for internal storage of eigenvalues.
+  @serial internal storage of eigenvalues.
+  */
+  private double[] d, e;
+  
+  /** Array for internal storage of eigenvectors.
+  @serial internal storage of eigenvectors.
+  */
+  private double[][] V;
+  
+  /** Array for internal storage of nonsymmetric Hessenberg form.
+  @serial internal storage of nonsymmetric Hessenberg form.
+  */
+  private double[][] H;
+  
+  /** Working storage for nonsymmetric algorithm.
+  @serial working storage for nonsymmetric algorithm.
+  */
+  private double[] ort;
+  
+  // Complex scalar division.
+  
+  private transient double cdivr, cdivi;
 /**
 Constructs and returns a new eigenvalue decomposition object; 
 The decomposed matrices can be retrieved via instance methods of the returned decomposition object.
@@ -77,634 +77,634 @@
 @throws IllegalArgumentException if <tt>A</tt> is not square.
 */
 public EigenvalueDecomposition(DoubleMatrix2D A) {
-	Property.DEFAULT.checkSquare(A);
-	
-	n = A.columns();
-	V = new double[n][n];
-	d = new double[n];
-	e = new double[n];
-	
-	issymmetric = Property.DEFAULT.isSymmetric(A);
-	
-	if (issymmetric) {
-		for (int i = 0; i < n; i++) {
-			for (int j = 0; j < n; j++) {
-				V[i][j] = A.getQuick(i,j);
-			}
-		}
-	
-		// Tridiagonalize.
-		tred2();
-		
-		// Diagonalize.
-		tql2();
-		
-	} 
-	else {
-		H = new double[n][n];
-		ort = new double[n];
-		 
-		for (int j = 0; j < n; j++) {
-			for (int i = 0; i < n; i++) {
-				H[i][j] = A.getQuick(i,j);
-			}
-		}
-		
-		// Reduce to Hessenberg form.
-		orthes();
-		
-		// Reduce Hessenberg to real Schur form.
-		hqr2();
-	}
+  Property.DEFAULT.checkSquare(A);
+  
+  n = A.columns();
+  V = new double[n][n];
+  d = new double[n];
+  e = new double[n];
+  
+  issymmetric = Property.DEFAULT.isSymmetric(A);
+  
+  if (issymmetric) {
+    for (int i = 0; i < n; i++) {
+      for (int j = 0; j < n; j++) {
+        V[i][j] = A.getQuick(i,j);
+      }
+    }
+  
+    // Tridiagonalize.
+    tred2();
+    
+    // Diagonalize.
+    tql2();
+    
+  } 
+  else {
+    H = new double[n][n];
+    ort = new double[n];
+     
+    for (int j = 0; j < n; j++) {
+      for (int i = 0; i < n; i++) {
+        H[i][j] = A.getQuick(i,j);
+      }
+    }
+    
+    // Reduce to Hessenberg form.
+    orthes();
+    
+    // Reduce Hessenberg to real Schur form.
+    hqr2();
+  }
 }
 private void cdiv(double xr, double xi, double yr, double yi) {
-	double r,d;
-	if (Math.abs(yr) > Math.abs(yi)) {
-		r = yi/yr;
-		d = yr + r*yi;
-		cdivr = (xr + r*xi)/d;
-		cdivi = (xi - r*xr)/d;
-	} 
-	else {
-		r = yr/yi;
-		d = yi + r*yr;
-		cdivr = (r*xr + xi)/d;
-		cdivi = (r*xi - xr)/d;
-	}
+  double r,d;
+  if (Math.abs(yr) > Math.abs(yi)) {
+    r = yi/yr;
+    d = yr + r*yi;
+    cdivr = (xr + r*xi)/d;
+    cdivi = (xi - r*xr)/d;
+  } 
+  else {
+    r = yr/yi;
+    d = yi + r*yr;
+    cdivr = (r*xr + xi)/d;
+    cdivi = (r*xi - xr)/d;
+  }
 }
 /** 
 Returns the block diagonal eigenvalue matrix, <tt>D</tt>.
 @return     <tt>D</tt>
 */
 public DoubleMatrix2D getD() {
-	double[][] D = new double[n][n];
-	for (int i = 0; i < n; i++) {
-		for (int j = 0; j < n; j++) {
-			D[i][j] = 0.0;
-		}
-		D[i][i] = d[i];
-		if (e[i] > 0) {
-			D[i][i+1] = e[i];
-		} 
-		else if (e[i] < 0) {
-			D[i][i-1] = e[i];
-		}
-	}
-	return DoubleFactory2D.dense.make(D);
+  double[][] D = new double[n][n];
+  for (int i = 0; i < n; i++) {
+    for (int j = 0; j < n; j++) {
+      D[i][j] = 0.0;
+    }
+    D[i][i] = d[i];
+    if (e[i] > 0) {
+      D[i][i+1] = e[i];
+    } 
+    else if (e[i] < 0) {
+      D[i][i-1] = e[i];
+    }
+  }
+  return DoubleFactory2D.dense.make(D);
 }
 /**
 Returns the imaginary parts of the eigenvalues.
 @return     imag(diag(D))
 */
 public DoubleMatrix1D getImagEigenvalues () {
-	return DoubleFactory1D.dense.make(e);
+  return DoubleFactory1D.dense.make(e);
 }
 /** 
 Returns the real parts of the eigenvalues.
 @return     real(diag(D))
 */
 public DoubleMatrix1D getRealEigenvalues () {
-	return DoubleFactory1D.dense.make(d);
+  return DoubleFactory1D.dense.make(d);
 }
 /** 
 Returns the eigenvector matrix, <tt>V</tt>
 @return     <tt>V</tt>
 */
 public DoubleMatrix2D getV () {
-	return DoubleFactory2D.dense.make(V);
+  return DoubleFactory2D.dense.make(V);
 }
 /**
 Nonsymmetric reduction from Hessenberg to real Schur form.
 */
 private void hqr2 () {
-	  //  This is derived from the Algol procedure hqr2,
-	  //  by Martin and Wilkinson, Handbook for Auto. Comp.,
-	  //  Vol.ii-Linear Algebra, and the corresponding
-	  //  Fortran subroutine in EISPACK.
+    //  This is derived from the Algol procedure hqr2,
+    //  by Martin and Wilkinson, Handbook for Auto. Comp.,
+    //  Vol.ii-Linear Algebra, and the corresponding
+    //  Fortran subroutine in EISPACK.
    
-	  // Initialize
+    // Initialize
    
-	  int nn = this.n;
-	  int n = nn-1;
-	  int low = 0;
-	  int high = nn-1;
-	  double eps = Math.pow(2.0,-52.0);
-	  double exshift = 0.0;
-	  double p=0,q=0,r=0,s=0,z=0,t,w,x,y;
+    int nn = this.n;
+    int n = nn-1;
+    int low = 0;
+    int high = nn-1;
+    double eps = Math.pow(2.0,-52.0);
+    double exshift = 0.0;
+    double p=0,q=0,r=0,s=0,z=0,t,w,x,y;
    
-	  // Store roots isolated by balanc and compute matrix norm
+    // Store roots isolated by balanc and compute matrix norm
    
-	  double norm = 0.0;
-	  for (int i = 0; i < nn; i++) {
-		 if (i < low | i > high) {
-			d[i] = H[i][i];
-			e[i] = 0.0;
-		 }
-		 for (int j = Math.max(i-1,0); j < nn; j++) {
-			norm = norm + Math.abs(H[i][j]);
-		 }
-	  }
+    double norm = 0.0;
+    for (int i = 0; i < nn; i++) {
+     if (i < low | i > high) {
+      d[i] = H[i][i];
+      e[i] = 0.0;
+     }
+     for (int j = Math.max(i-1,0); j < nn; j++) {
+      norm = norm + Math.abs(H[i][j]);
+     }
+    }
    
-	  // Outer loop over eigenvalue index
+    // Outer loop over eigenvalue index
    
-	  int iter = 0;
-	  while (n >= low) {
+    int iter = 0;
+    while (n >= low) {
    
-		 // Look for single small sub-diagonal element
+     // Look for single small sub-diagonal element
    
-		 int l = n;
-		 while (l > low) {
-			s = Math.abs(H[l-1][l-1]) + Math.abs(H[l][l]);
-			if (s == 0.0) {
-			   s = norm;
-			}
-			if (Math.abs(H[l][l-1]) < eps * s) {
-			   break;
-			}
-			l--;
-		 }
-	   
-		 // Check for convergence
-		 // One root found
+     int l = n;
+     while (l > low) {
+      s = Math.abs(H[l-1][l-1]) + Math.abs(H[l][l]);
+      if (s == 0.0) {
+         s = norm;
+      }
+      if (Math.abs(H[l][l-1]) < eps * s) {
+         break;
+      }
+      l--;
+     }
+     
+     // Check for convergence
+     // One root found
    
-		 if (l == n) {
-			H[n][n] = H[n][n] + exshift;
-			d[n] = H[n][n];
-			e[n] = 0.0;
-			n--;
-			iter = 0;
+     if (l == n) {
+      H[n][n] = H[n][n] + exshift;
+      d[n] = H[n][n];
+      e[n] = 0.0;
+      n--;
+      iter = 0;
    
-		 // Two roots found
+     // Two roots found
    
-		 } else if (l == n-1) {
-			w = H[n][n-1] * H[n-1][n];
-			p = (H[n-1][n-1] - H[n][n]) / 2.0;
-			q = p * p + w;
-			z = Math.sqrt(Math.abs(q));
-			H[n][n] = H[n][n] + exshift;
-			H[n-1][n-1] = H[n-1][n-1] + exshift;
-			x = H[n][n];
+     } else if (l == n-1) {
+      w = H[n][n-1] * H[n-1][n];
+      p = (H[n-1][n-1] - H[n][n]) / 2.0;
+      q = p * p + w;
+      z = Math.sqrt(Math.abs(q));
+      H[n][n] = H[n][n] + exshift;
+      H[n-1][n-1] = H[n-1][n-1] + exshift;
+      x = H[n][n];
    
-			// Real pair
+      // Real pair
    
-			if (q >= 0) {
-			   if (p >= 0) {
-				  z = p + z;
-			   } else {
-				  z = p - z;
-			   }
-			   d[n-1] = x + z;
-			   d[n] = d[n-1];
-			   if (z != 0.0) {
-				  d[n] = x - w / z;
-			   }
-			   e[n-1] = 0.0;
-			   e[n] = 0.0;
-			   x = H[n][n-1];
-			   s = Math.abs(x) + Math.abs(z);
-			   p = x / s;
-			   q = z / s;
-			   r = Math.sqrt(p * p+q * q);
-			   p = p / r;
-			   q = q / r;
+      if (q >= 0) {
+         if (p >= 0) {
+          z = p + z;
+         } else {
+          z = p - z;
+         }
+         d[n-1] = x + z;
+         d[n] = d[n-1];
+         if (z != 0.0) {
+          d[n] = x - w / z;
+         }
+         e[n-1] = 0.0;
+         e[n] = 0.0;
+         x = H[n][n-1];
+         s = Math.abs(x) + Math.abs(z);
+         p = x / s;
+         q = z / s;
+         r = Math.sqrt(p * p+q * q);
+         p = p / r;
+         q = q / r;
    
-			   // Row modification
+         // Row modification
    
-			   for (int j = n-1; j < nn; j++) {
-				  z = H[n-1][j];
-				  H[n-1][j] = q * z + p * H[n][j];
-				  H[n][j] = q * H[n][j] - p * z;
-			   }
+         for (int j = n-1; j < nn; j++) {
+          z = H[n-1][j];
+          H[n-1][j] = q * z + p * H[n][j];
+          H[n][j] = q * H[n][j] - p * z;
+         }
    
-			   // Column modification
+         // Column modification
    
-			   for (int i = 0; i <= n; i++) {
-				  z = H[i][n-1];
-				  H[i][n-1] = q * z + p * H[i][n];
-				  H[i][n] = q * H[i][n] - p * z;
-			   }
+         for (int i = 0; i <= n; i++) {
+          z = H[i][n-1];
+          H[i][n-1] = q * z + p * H[i][n];
+          H[i][n] = q * H[i][n] - p * z;
+         }
    
-			   // Accumulate transformations
+         // Accumulate transformations
    
-			   for (int i = low; i <= high; i++) {
-				  z = V[i][n-1];
-				  V[i][n-1] = q * z + p * V[i][n];
-				  V[i][n] = q * V[i][n] - p * z;
-			   }
+         for (int i = low; i <= high; i++) {
+          z = V[i][n-1];
+          V[i][n-1] = q * z + p * V[i][n];
+          V[i][n] = q * V[i][n] - p * z;
+         }
    
-			// Complex pair
+      // Complex pair
    
-			} else {
-			   d[n-1] = x + p;
-			   d[n] = x + p;
-			   e[n-1] = z;
-			   e[n] = -z;
-			}
-			n = n - 2;
-			iter = 0;
+      } else {
+         d[n-1] = x + p;
+         d[n] = x + p;
+         e[n-1] = z;
+         e[n] = -z;
+      }
+      n = n - 2;
+      iter = 0;
    
-		 // No convergence yet
+     // No convergence yet
    
-		 } else {
+     } else {
    
-			// Form shift
+      // Form shift
    
-			x = H[n][n];
-			y = 0.0;
-			w = 0.0;
-			if (l < n) {
-			   y = H[n-1][n-1];
-			   w = H[n][n-1] * H[n-1][n];
-			}
+      x = H[n][n];
+      y = 0.0;
+      w = 0.0;
+      if (l < n) {
+         y = H[n-1][n-1];
+         w = H[n][n-1] * H[n-1][n];
+      }
    
-			// Wilkinson's original ad hoc shift
+      // Wilkinson's original ad hoc shift
    
-			if (iter == 10) {
-			   exshift += x;
-			   for (int i = low; i <= n; i++) {
-				  H[i][i] -= x;
-			   }
-			   s = Math.abs(H[n][n-1]) + Math.abs(H[n-1][n-2]);
-			   x = y = 0.75 * s;
-			   w = -0.4375 * s * s;
-			}
+      if (iter == 10) {
+         exshift += x;
+         for (int i = low; i <= n; i++) {
+          H[i][i] -= x;
+         }
+         s = Math.abs(H[n][n-1]) + Math.abs(H[n-1][n-2]);
+         x = y = 0.75 * s;
+         w = -0.4375 * s * s;
+      }
 
-			// MATLAB's new ad hoc shift
+      // MATLAB's new ad hoc shift
 
-			if (iter == 30) {
-				s = (y - x) / 2.0;
-				s = s * s + w;
-				if (s > 0) {
-					s = Math.sqrt(s);
-					if (y < x) {
-					   s = -s;
-					}
-					s = x - w / ((y - x) / 2.0 + s);
-					for (int i = low; i <= n; i++) {
-					   H[i][i] -= s;
-					}
-					exshift += s;
-					x = y = w = 0.964;
-				}
-			}
+      if (iter == 30) {
+        s = (y - x) / 2.0;
+        s = s * s + w;
+        if (s > 0) {
+          s = Math.sqrt(s);
+          if (y < x) {
+             s = -s;
+          }
+          s = x - w / ((y - x) / 2.0 + s);
+          for (int i = low; i <= n; i++) {
+             H[i][i] -= s;
+          }
+          exshift += s;
+          x = y = w = 0.964;
+        }
+      }
    
-			iter = iter + 1;   // (Could check iteration count here.)
+      iter = iter + 1;   // (Could check iteration count here.)
    
-			// Look for two consecutive small sub-diagonal elements
+      // Look for two consecutive small sub-diagonal elements
    
-			int m = n-2;
-			while (m >= l) {
-			   z = H[m][m];
-			   r = x - z;
-			   s = y - z;
-			   p = (r * s - w) / H[m+1][m] + H[m][m+1];
-			   q = H[m+1][m+1] - z - r - s;
-			   r = H[m+2][m+1];
-			   s = Math.abs(p) + Math.abs(q) + Math.abs(r);
-			   p = p / s;
-			   q = q / s;
-			   r = r / s;
-			   if (m == l) {
-				  break;
-			   }
-			   if (Math.abs(H[m][m-1]) * (Math.abs(q) + Math.abs(r)) <
-				  eps * (Math.abs(p) * (Math.abs(H[m-1][m-1]) + Math.abs(z) +
-				  Math.abs(H[m+1][m+1])))) {
-					 break;
-			   }
-			   m--;
-			}
+      int m = n-2;
+      while (m >= l) {
+         z = H[m][m];
+         r = x - z;
+         s = y - z;
+         p = (r * s - w) / H[m+1][m] + H[m][m+1];
+         q = H[m+1][m+1] - z - r - s;
+         r = H[m+2][m+1];
+         s = Math.abs(p) + Math.abs(q) + Math.abs(r);
+         p = p / s;
+         q = q / s;
+         r = r / s;
+         if (m == l) {
+          break;
+         }
+         if (Math.abs(H[m][m-1]) * (Math.abs(q) + Math.abs(r)) <
+          eps * (Math.abs(p) * (Math.abs(H[m-1][m-1]) + Math.abs(z) +
+          Math.abs(H[m+1][m+1])))) {
+           break;
+         }
+         m--;
+      }
    
-			for (int i = m+2; i <= n; i++) {
-			   H[i][i-2] = 0.0;
-			   if (i > m+2) {
-				  H[i][i-3] = 0.0;
-			   }
-			}
+      for (int i = m+2; i <= n; i++) {
+         H[i][i-2] = 0.0;
+         if (i > m+2) {
+          H[i][i-3] = 0.0;
+         }
+      }
    
-			// Double QR step involving rows l:n and columns m:n
+      // Double QR step involving rows l:n and columns m:n
    
-			for (int k = m; k <= n-1; k++) {
-			   boolean notlast = (k != n-1);
-			   if (k != m) {
-				  p = H[k][k-1];
-				  q = H[k+1][k-1];
-				  r = (notlast ? H[k+2][k-1] : 0.0);
-				  x = Math.abs(p) + Math.abs(q) + Math.abs(r);
-				  if (x != 0.0) {
-					 p = p / x;
-					 q = q / x;
-					 r = r / x;
-				  }
-			   }
-			   if (x == 0.0) {
-				  break;
-			   }
-			   s = Math.sqrt(p * p + q * q + r * r);
-			   if (p < 0) {
-				  s = -s;
-			   }
-			   if (s != 0) {
-				  if (k != m) {
-					 H[k][k-1] = -s * x;
-				  } else if (l != m) {
-					 H[k][k-1] = -H[k][k-1];
-				  }
-				  p = p + s;
-				  x = p / s;
-				  y = q / s;
-				  z = r / s;
-				  q = q / p;
-				  r = r / p;
+      for (int k = m; k <= n-1; k++) {
+         boolean notlast = (k != n-1);
+         if (k != m) {
+          p = H[k][k-1];
+          q = H[k+1][k-1];
+          r = (notlast ? H[k+2][k-1] : 0.0);
+          x = Math.abs(p) + Math.abs(q) + Math.abs(r);
+          if (x != 0.0) {
+           p = p / x;
+           q = q / x;
+           r = r / x;
+          }
+         }
+         if (x == 0.0) {
+          break;
+         }
+         s = Math.sqrt(p * p + q * q + r * r);
+         if (p < 0) {
+          s = -s;
+         }
+         if (s != 0) {
+          if (k != m) {
+           H[k][k-1] = -s * x;
+          } else if (l != m) {
+           H[k][k-1] = -H[k][k-1];
+          }
+          p = p + s;
+          x = p / s;
+          y = q / s;
+          z = r / s;
+          q = q / p;
+          r = r / p;
    
-				  // Row modification
+          // Row modification
    
-				  for (int j = k; j < nn; j++) {
-					 p = H[k][j] + q * H[k+1][j];
-					 if (notlast) {
-						p = p + r * H[k+2][j];
-						H[k+2][j] = H[k+2][j] - p * z;
-					 }
-					 H[k][j] = H[k][j] - p * x;
-					 H[k+1][j] = H[k+1][j] - p * y;
-				  }
+          for (int j = k; j < nn; j++) {
+           p = H[k][j] + q * H[k+1][j];
+           if (notlast) {
+            p = p + r * H[k+2][j];
+            H[k+2][j] = H[k+2][j] - p * z;
+           }
+           H[k][j] = H[k][j] - p * x;
+           H[k+1][j] = H[k+1][j] - p * y;
+          }
    
-				  // Column modification
+          // Column modification
    
-				  for (int i = 0; i <= Math.min(n,k+3); i++) {
-					 p = x * H[i][k] + y * H[i][k+1];
-					 if (notlast) {
-						p = p + z * H[i][k+2];
-						H[i][k+2] = H[i][k+2] - p * r;
-					 }
-					 H[i][k] = H[i][k] - p;
-					 H[i][k+1] = H[i][k+1] - p * q;
-				  }
+          for (int i = 0; i <= Math.min(n,k+3); i++) {
+           p = x * H[i][k] + y * H[i][k+1];
+           if (notlast) {
+            p = p + z * H[i][k+2];
+            H[i][k+2] = H[i][k+2] - p * r;
+           }
+           H[i][k] = H[i][k] - p;
+           H[i][k+1] = H[i][k+1] - p * q;
+          }
    
-				  // Accumulate transformations
+          // Accumulate transformations
    
-				  for (int i = low; i <= high; i++) {
-					 p = x * V[i][k] + y * V[i][k+1];
-					 if (notlast) {
-						p = p + z * V[i][k+2];
-						V[i][k+2] = V[i][k+2] - p * r;
-					 }
-					 V[i][k] = V[i][k] - p;
-					 V[i][k+1] = V[i][k+1] - p * q;
-				  }
-			   }  // (s != 0)
-			}  // k loop
-		 }  // check convergence
-	  }  // while (n >= low)
-	  
-	  // Backsubstitute to find vectors of upper triangular form
+          for (int i = low; i <= high; i++) {
+           p = x * V[i][k] + y * V[i][k+1];
+           if (notlast) {
+            p = p + z * V[i][k+2];
+            V[i][k+2] = V[i][k+2] - p * r;
+           }
+           V[i][k] = V[i][k] - p;
+           V[i][k+1] = V[i][k+1] - p * q;
+          }
+         }  // (s != 0)
+      }  // k loop
+     }  // check convergence
+    }  // while (n >= low)
+    
+    // Backsubstitute to find vectors of upper triangular form
 
-	  if (norm == 0.0) {
-		 return;
-	  }
+    if (norm == 0.0) {
+     return;
+    }
    
-	  for (n = nn-1; n >= 0; n--) {
-		 p = d[n];
-		 q = e[n];
+    for (n = nn-1; n >= 0; n--) {
+     p = d[n];
+     q = e[n];
    
-		 // Real vector
+     // Real vector
    
-		 if (q == 0) {
-			int l = n;
-			H[n][n] = 1.0;
-			for (int i = n-1; i >= 0; i--) {
-			   w = H[i][i] - p;
-			   r = 0.0;
-			   for (int j = l; j <= n; j++) {
-				  r = r + H[i][j] * H[j][n];
-			   }
-			   if (e[i] < 0.0) {
-				  z = w;
-				  s = r;
-			   } else {
-				  l = i;
-				  if (e[i] == 0.0) {
-					 if (w != 0.0) {
-						H[i][n] = -r / w;
-					 } else {
-						H[i][n] = -r / (eps * norm);
-					 }
+     if (q == 0) {
+      int l = n;
+      H[n][n] = 1.0;
+      for (int i = n-1; i >= 0; i--) {
+         w = H[i][i] - p;
+         r = 0.0;
+         for (int j = l; j <= n; j++) {
+          r = r + H[i][j] * H[j][n];
+         }
+         if (e[i] < 0.0) {
+          z = w;
+          s = r;
+         } else {
+          l = i;
+          if (e[i] == 0.0) {
+           if (w != 0.0) {
+            H[i][n] = -r / w;
+           } else {
+            H[i][n] = -r / (eps * norm);
+           }
    
-				  // Solve real equations
+          // Solve real equations
    
-				  } else {
-					 x = H[i][i+1];
-					 y = H[i+1][i];
-					 q = (d[i] - p) * (d[i] - p) + e[i] * e[i];
-					 t = (x * s - z * r) / q;
-					 H[i][n] = t;
-					 if (Math.abs(x) > Math.abs(z)) {
-						H[i+1][n] = (-r - w * t) / x;
-					 } else {
-						H[i+1][n] = (-s - y * t) / z;
-					 }
-				  }
+          } else {
+           x = H[i][i+1];
+           y = H[i+1][i];
+           q = (d[i] - p) * (d[i] - p) + e[i] * e[i];
+           t = (x * s - z * r) / q;
+           H[i][n] = t;
+           if (Math.abs(x) > Math.abs(z)) {
+            H[i+1][n] = (-r - w * t) / x;
+           } else {
+            H[i+1][n] = (-s - y * t) / z;
+           }
+          }
    
-				  // Overflow control
+          // Overflow control
    
-				  t = Math.abs(H[i][n]);
-				  if ((eps * t) * t > 1) {
-					 for (int j = i; j <= n; j++) {
-						H[j][n] = H[j][n] / t;
-					 }
-				  }
-			   }
-			}
+          t = Math.abs(H[i][n]);
+          if ((eps * t) * t > 1) {
+           for (int j = i; j <= n; j++) {
+            H[j][n] = H[j][n] / t;
+           }
+          }
+         }
+      }
    
-		 // Complex vector
+     // Complex vector
    
-		 } else if (q < 0) {
-			int l = n-1;
+     } else if (q < 0) {
+      int l = n-1;
 
-			// Last vector component imaginary so matrix is triangular
+      // Last vector component imaginary so matrix is triangular
    
-			if (Math.abs(H[n][n-1]) > Math.abs(H[n-1][n])) {
-			   H[n-1][n-1] = q / H[n][n-1];
-			   H[n-1][n] = -(H[n][n] - p) / H[n][n-1];
-			} else {
-			   cdiv(0.0,-H[n-1][n],H[n-1][n-1]-p,q);
-			   H[n-1][n-1] = cdivr;
-			   H[n-1][n] = cdivi;
-			}
-			H[n][n-1] = 0.0;
-			H[n][n] = 1.0;
-			for (int i = n-2; i >= 0; i--) {
-			   double ra,sa,vr,vi;
-			   ra = 0.0;
-			   sa = 0.0;
-			   for (int j = l; j <= n; j++) {
-				  ra = ra + H[i][j] * H[j][n-1];
-				  sa = sa + H[i][j] * H[j][n];
-			   }
-			   w = H[i][i] - p;
+      if (Math.abs(H[n][n-1]) > Math.abs(H[n-1][n])) {
+         H[n-1][n-1] = q / H[n][n-1];
+         H[n-1][n] = -(H[n][n] - p) / H[n][n-1];
+      } else {
+         cdiv(0.0,-H[n-1][n],H[n-1][n-1]-p,q);
+         H[n-1][n-1] = cdivr;
+         H[n-1][n] = cdivi;
+      }
+      H[n][n-1] = 0.0;
+      H[n][n] = 1.0;
+      for (int i = n-2; i >= 0; i--) {
+         double ra,sa,vr,vi;
+         ra = 0.0;
+         sa = 0.0;
+         for (int j = l; j <= n; j++) {
+          ra = ra + H[i][j] * H[j][n-1];
+          sa = sa + H[i][j] * H[j][n];
+         }
+         w = H[i][i] - p;
    
-			   if (e[i] < 0.0) {
-				  z = w;
-				  r = ra;
-				  s = sa;
-			   } else {
-				  l = i;
-				  if (e[i] == 0) {
-					 cdiv(-ra,-sa,w,q);
-					 H[i][n-1] = cdivr;
-					 H[i][n] = cdivi;
-				  } else {
+         if (e[i] < 0.0) {
+          z = w;
+          r = ra;
+          s = sa;
+         } else {
+          l = i;
+          if (e[i] == 0) {
+           cdiv(-ra,-sa,w,q);
+           H[i][n-1] = cdivr;
+           H[i][n] = cdivi;
+          } else {
    
-					 // Solve complex equations
+           // Solve complex equations
    
-					 x = H[i][i+1];
-					 y = H[i+1][i];
-					 vr = (d[i] - p) * (d[i] - p) + e[i] * e[i] - q * q;
-					 vi = (d[i] - p) * 2.0 * q;
-					 if (vr == 0.0 & vi == 0.0) {
-						vr = eps * norm * (Math.abs(w) + Math.abs(q) +
-						Math.abs(x) + Math.abs(y) + Math.abs(z));
-					 }
-					 cdiv(x*r-z*ra+q*sa,x*s-z*sa-q*ra,vr,vi);
-					 H[i][n-1] = cdivr;
-					 H[i][n] = cdivi;
-					 if (Math.abs(x) > (Math.abs(z) + Math.abs(q))) {
-						H[i+1][n-1] = (-ra - w * H[i][n-1] + q * H[i][n]) / x;
-						H[i+1][n] = (-sa - w * H[i][n] - q * H[i][n-1]) / x;
-					 } else {
-						cdiv(-r-y*H[i][n-1],-s-y*H[i][n],z,q);
-						H[i+1][n-1] = cdivr;
-						H[i+1][n] = cdivi;
-					 }
-				  }
+           x = H[i][i+1];
+           y = H[i+1][i];
+           vr = (d[i] - p) * (d[i] - p) + e[i] * e[i] - q * q;
+           vi = (d[i] - p) * 2.0 * q;
+           if (vr == 0.0 & vi == 0.0) {
+            vr = eps * norm * (Math.abs(w) + Math.abs(q) +
+            Math.abs(x) + Math.abs(y) + Math.abs(z));
+           }
+           cdiv(x*r-z*ra+q*sa,x*s-z*sa-q*ra,vr,vi);
+           H[i][n-1] = cdivr;
+           H[i][n] = cdivi;
+           if (Math.abs(x) > (Math.abs(z) + Math.abs(q))) {
+            H[i+1][n-1] = (-ra - w * H[i][n-1] + q * H[i][n]) / x;
+            H[i+1][n] = (-sa - w * H[i][n] - q * H[i][n-1]) / x;
+           } else {
+            cdiv(-r-y*H[i][n-1],-s-y*H[i][n],z,q);
+            H[i+1][n-1] = cdivr;
+            H[i+1][n] = cdivi;
+           }
+          }
    
-				  // Overflow control
+          // Overflow control
 
-				  t = Math.max(Math.abs(H[i][n-1]),Math.abs(H[i][n]));
-				  if ((eps * t) * t > 1) {
-					 for (int j = i; j <= n; j++) {
-						H[j][n-1] = H[j][n-1] / t;
-						H[j][n] = H[j][n] / t;
-					 }
-				  }
-			   }
-			}
-		 }
-	  }
+          t = Math.max(Math.abs(H[i][n-1]),Math.abs(H[i][n]));
+          if ((eps * t) * t > 1) {
+           for (int j = i; j <= n; j++) {
+            H[j][n-1] = H[j][n-1] / t;
+            H[j][n] = H[j][n] / t;
+           }
+          }
+         }
+      }
+     }
+    }
    
-	  // Vectors of isolated roots
+    // Vectors of isolated roots
    
-	  for (int i = 0; i < nn; i++) {
-		 if (i < low | i > high) {
-			for (int j = i; j < nn; j++) {
-			   V[i][j] = H[i][j];
-			}
-		 }
-	  }
+    for (int i = 0; i < nn; i++) {
+     if (i < low | i > high) {
+      for (int j = i; j < nn; j++) {
+         V[i][j] = H[i][j];
+      }
+     }
+    }
    
-	  // Back transformation to get eigenvectors of original matrix
+    // Back transformation to get eigenvectors of original matrix
    
-	  for (int j = nn-1; j >= low; j--) {
-		 for (int i = low; i <= high; i++) {
-			z = 0.0;
-			for (int k = low; k <= Math.min(j,high); k++) {
-			   z = z + V[i][k] * H[k][j];
-			}
-			V[i][j] = z;
-		 }
-	  }
+    for (int j = nn-1; j >= low; j--) {
+     for (int i = low; i <= high; i++) {
+      z = 0.0;
+      for (int k = low; k <= Math.min(j,high); k++) {
+         z = z + V[i][k] * H[k][j];
+      }
+      V[i][j] = z;
+     }
+    }
    }   
 /**
 Nonsymmetric reduction to Hessenberg form.
 */
 private void orthes () {  
-	  //  This is derived from the Algol procedures orthes and ortran,
-	  //  by Martin and Wilkinson, Handbook for Auto. Comp.,
-	  //  Vol.ii-Linear Algebra, and the corresponding
-	  //  Fortran subroutines in EISPACK.
+    //  This is derived from the Algol procedures orthes and ortran,
+    //  by Martin and Wilkinson, Handbook for Auto. Comp.,
+    //  Vol.ii-Linear Algebra, and the corresponding
+    //  Fortran subroutines in EISPACK.
    
-	  int low = 0;
-	  int high = n-1;
+    int low = 0;
+    int high = n-1;
    
-	  for (int m = low+1; m <= high-1; m++) {
+    for (int m = low+1; m <= high-1; m++) {
    
-		 // Scale column.
+     // Scale column.
    
-		 double scale = 0.0;
-		 for (int i = m; i <= high; i++) {
-			scale = scale + Math.abs(H[i][m-1]);
-		 }
-		 if (scale != 0.0) {
+     double scale = 0.0;
+     for (int i = m; i <= high; i++) {
+      scale = scale + Math.abs(H[i][m-1]);
+     }
+     if (scale != 0.0) {
    
-			// Compute Householder transformation.
+      // Compute Householder transformation.
    
-			double h = 0.0;
-			for (int i = high; i >= m; i--) {
-			   ort[i] = H[i][m-1]/scale;
-			   h += ort[i] * ort[i];
-			}
-			double g = Math.sqrt(h);
-			if (ort[m] > 0) {
-			   g = -g;
-			}
-			h = h - ort[m] * g;
-			ort[m] = ort[m] - g;
+      double h = 0.0;
+      for (int i = high; i >= m; i--) {
+         ort[i] = H[i][m-1]/scale;
+         h += ort[i] * ort[i];
+      }
+      double g = Math.sqrt(h);
+      if (ort[m] > 0) {
+         g = -g;
+      }
+      h = h - ort[m] * g;
+      ort[m] = ort[m] - g;
    
-			// Apply Householder similarity transformation
-			// H = (I-u*u'/h)*H*(I-u*u')/h)
+      // Apply Householder similarity transformation
+      // H = (I-u*u'/h)*H*(I-u*u')/h)
    
-			for (int j = m; j < n; j++) {
-			   double f = 0.0;
-			   for (int i = high; i >= m; i--) {
-				  f += ort[i]*H[i][j];
-			   }
-			   f = f/h;
-			   for (int i = m; i <= high; i++) {
-				  H[i][j] -= f*ort[i];
-			   }
-		   }
+      for (int j = m; j < n; j++) {
+         double f = 0.0;
+         for (int i = high; i >= m; i--) {
+          f += ort[i]*H[i][j];
+         }
+         f = f/h;
+         for (int i = m; i <= high; i++) {
+          H[i][j] -= f*ort[i];
+         }
+       }
    
-		   for (int i = 0; i <= high; i++) {
-			   double f = 0.0;
-			   for (int j = high; j >= m; j--) {
-				  f += ort[j]*H[i][j];
-			   }
-			   f = f/h;
-			   for (int j = m; j <= high; j++) {
-				  H[i][j] -= f*ort[j];
-			   }
-			}
-			ort[m] = scale*ort[m];
-			H[m][m-1] = scale*g;
-		 }
-	  }
+       for (int i = 0; i <= high; i++) {
+         double f = 0.0;
+         for (int j = high; j >= m; j--) {
+          f += ort[j]*H[i][j];
+         }
+         f = f/h;
+         for (int j = m; j <= high; j++) {
+          H[i][j] -= f*ort[j];
+         }
+      }
+      ort[m] = scale*ort[m];
+      H[m][m-1] = scale*g;
+     }
+    }
    
-	  // Accumulate transformations (Algol's ortran).
+    // Accumulate transformations (Algol's ortran).
 
-	  for (int i = 0; i < n; i++) {
-		 for (int j = 0; j < n; j++) {
-			V[i][j] = (i == j ? 1.0 : 0.0);
-		 }
-	  }
+    for (int i = 0; i < n; i++) {
+     for (int j = 0; j < n; j++) {
+      V[i][j] = (i == j ? 1.0 : 0.0);
+     }
+    }
 
-	  for (int m = high-1; m >= low+1; m--) {
-		 if (H[m][m-1] != 0.0) {
-			for (int i = m+1; i <= high; i++) {
-			   ort[i] = H[i][m-1];
-			}
-			for (int j = m; j <= high; j++) {
-			   double g = 0.0;
-			   for (int i = m; i <= high; i++) {
-				  g += ort[i] * V[i][j];
-			   }
-			   // Double division avoids possible underflow
-			   g = (g / ort[m]) / H[m][m-1];
-			   for (int i = m; i <= high; i++) {
-				  V[i][j] += g * ort[i];
-			   }
-			}
-		 }
-	  }
+    for (int m = high-1; m >= low+1; m--) {
+     if (H[m][m-1] != 0.0) {
+      for (int i = m+1; i <= high; i++) {
+         ort[i] = H[i][m-1];
+      }
+      for (int j = m; j <= high; j++) {
+         double g = 0.0;
+         for (int i = m; i <= high; i++) {
+          g += ort[i] * V[i][j];
+         }
+         // Double division avoids possible underflow
+         g = (g / ort[m]) / H[m][m-1];
+         for (int i = m; i <= high; i++) {
+          V[i][j] += g * ort[i];
+         }
+      }
+     }
+    }
    }   
 /**
 Returns a String with (propertyName, propertyValue) pairs.
@@ -716,150 +716,150 @@
 </pre>
 */
 public String toString() {
-	StringBuffer buf = new StringBuffer();
-	String unknown = "Illegal operation or error: ";
+  StringBuffer buf = new StringBuffer();
+  String unknown = "Illegal operation or error: ";
 
-	buf.append("---------------------------------------------------------------------\n");
-	buf.append("EigenvalueDecomposition(A) --> D, V, realEigenvalues, imagEigenvalues\n");
-	buf.append("---------------------------------------------------------------------\n");
+  buf.append("---------------------------------------------------------------------\n");
+  buf.append("EigenvalueDecomposition(A) --> D, V, realEigenvalues, imagEigenvalues\n");
+  buf.append("---------------------------------------------------------------------\n");
 
-	buf.append("realEigenvalues = ");
-	try { buf.append(String.valueOf(this.getRealEigenvalues()));} 
-	catch (IllegalArgumentException exc) { buf.append(unknown+exc.getMessage()); }
-		
-	buf.append("\nimagEigenvalues = ");
-	try { buf.append(String.valueOf(this.getImagEigenvalues()));} 
-	catch (IllegalArgumentException exc) { buf.append(unknown+exc.getMessage()); }
-		
-	buf.append("\n\nD = ");
-	try { buf.append(String.valueOf(this.getD()));} 
-	catch (IllegalArgumentException exc) { buf.append(unknown+exc.getMessage()); }
-	
-	buf.append("\n\nV = ");
-	try { buf.append(String.valueOf(this.getV()));} 
-	catch (IllegalArgumentException exc) { buf.append(unknown+exc.getMessage()); }
-	
-	return buf.toString();
+  buf.append("realEigenvalues = ");
+  try { buf.append(String.valueOf(this.getRealEigenvalues()));} 
+  catch (IllegalArgumentException exc) { buf.append(unknown+exc.getMessage()); }
+    
+  buf.append("\nimagEigenvalues = ");
+  try { buf.append(String.valueOf(this.getImagEigenvalues()));} 
+  catch (IllegalArgumentException exc) { buf.append(unknown+exc.getMessage()); }
+    
+  buf.append("\n\nD = ");
+  try { buf.append(String.valueOf(this.getD()));} 
+  catch (IllegalArgumentException exc) { buf.append(unknown+exc.getMessage()); }
+  
+  buf.append("\n\nV = ");
+  try { buf.append(String.valueOf(this.getV()));} 
+  catch (IllegalArgumentException exc) { buf.append(unknown+exc.getMessage()); }
+  
+  return buf.toString();
 }
 /**
 Symmetric tridiagonal QL algorithm.
 */
 private void tql2 () {
 
-	//  This is derived from the Algol procedures tql2, by
-	//  Bowdler, Martin, Reinsch, and Wilkinson, Handbook for
-	//  Auto. Comp., Vol.ii-Linear Algebra, and the corresponding
-	//  Fortran subroutine in EISPACK.
+  //  This is derived from the Algol procedures tql2, by
+  //  Bowdler, Martin, Reinsch, and Wilkinson, Handbook for
+  //  Auto. Comp., Vol.ii-Linear Algebra, and the corresponding
+  //  Fortran subroutine in EISPACK.
    
-	  for (int i = 1; i < n; i++) {
-		 e[i-1] = e[i];
-	  }
-	  e[n-1] = 0.0;
+    for (int i = 1; i < n; i++) {
+     e[i-1] = e[i];
+    }
+    e[n-1] = 0.0;
    
-	  double f = 0.0;
-	  double tst1 = 0.0;
-	  double eps = Math.pow(2.0,-52.0);
-	  for (int l = 0; l < n; l++) {
+    double f = 0.0;
+    double tst1 = 0.0;
+    double eps = Math.pow(2.0,-52.0);
+    for (int l = 0; l < n; l++) {
 
-		 // Find small subdiagonal element
+     // Find small subdiagonal element
    
-		 tst1 = Math.max(tst1,Math.abs(d[l]) + Math.abs(e[l]));
-		 int m = l;
-		 while (m < n) {
-			if (Math.abs(e[m]) <= eps*tst1) {
-			   break;
-			}
-			m++;
-		 }
+     tst1 = Math.max(tst1,Math.abs(d[l]) + Math.abs(e[l]));
+     int m = l;
+     while (m < n) {
+      if (Math.abs(e[m]) <= eps*tst1) {
+         break;
+      }
+      m++;
+     }
    
-		 // If m == l, d[l] is an eigenvalue,
-		 // otherwise, iterate.
+     // If m == l, d[l] is an eigenvalue,
+     // otherwise, iterate.
    
-		 if (m > l) {
-			int iter = 0;
-			do {
-			   iter = iter + 1;  // (Could check iteration count here.)
+     if (m > l) {
+      int iter = 0;
+      do {
+         iter = iter + 1;  // (Could check iteration count here.)
    
-			   // Compute implicit shift
+         // Compute implicit shift
    
-			   double g = d[l];
-			   double p = (d[l+1] - g) / (2.0 * e[l]);
-			   double r = Algebra.hypot(p,1.0);
-			   if (p < 0) {
-				  r = -r;
-			   }
-			   d[l] = e[l] / (p + r);
-			   d[l+1] = e[l] * (p + r);
-			   double dl1 = d[l+1];
-			   double h = g - d[l];
-			   for (int i = l+2; i < n; i++) {
-				  d[i] -= h;
-			   }
-			   f = f + h;
+         double g = d[l];
+         double p = (d[l+1] - g) / (2.0 * e[l]);
+         double r = Algebra.hypot(p,1.0);
+         if (p < 0) {
+          r = -r;
+         }
+         d[l] = e[l] / (p + r);
+         d[l+1] = e[l] * (p + r);
+         double dl1 = d[l+1];
+         double h = g - d[l];
+         for (int i = l+2; i < n; i++) {
+          d[i] -= h;
+         }
+         f = f + h;
    
-			   // Implicit QL transformation.
+         // Implicit QL transformation.
    
-			   p = d[m];
-			   double c = 1.0;
-			   double c2 = c;
-			   double c3 = c;
-			   double el1 = e[l+1];
-			   double s = 0.0;
-			   double s2 = 0.0;
-			   for (int i = m-1; i >= l; i--) {
-				  c3 = c2;
-				  c2 = c;
-				  s2 = s;
-				  g = c * e[i];
-				  h = c * p;
-				  r = Algebra.hypot(p,e[i]);
-				  e[i+1] = s * r;
-				  s = e[i] / r;
-				  c = p / r;
-				  p = c * d[i] - s * g;
-				  d[i+1] = h + s * (c * g + s * d[i]);
+         p = d[m];
+         double c = 1.0;
+         double c2 = c;
+         double c3 = c;
+         double el1 = e[l+1];
+         double s = 0.0;
+         double s2 = 0.0;
+         for (int i = m-1; i >= l; i--) {
+          c3 = c2;
+          c2 = c;
+          s2 = s;
+          g = c * e[i];
+          h = c * p;
+          r = Algebra.hypot(p,e[i]);
+          e[i+1] = s * r;
+          s = e[i] / r;
+          c = p / r;
+          p = c * d[i] - s * g;
+          d[i+1] = h + s * (c * g + s * d[i]);
    
-				  // Accumulate transformation.
+          // Accumulate transformation.
    
-				  for (int k = 0; k < n; k++) {
-					 h = V[k][i+1];
-					 V[k][i+1] = s * V[k][i] + c * h;
-					 V[k][i] = c * V[k][i] - s * h;
-				  }
-			   }
-			   p = -s * s2 * c3 * el1 * e[l] / dl1;
-			   e[l] = s * p;
-			   d[l] = c * p;
+          for (int k = 0; k < n; k++) {
+           h = V[k][i+1];
+           V[k][i+1] = s * V[k][i] + c * h;
+           V[k][i] = c * V[k][i] - s * h;
+          }
+         }
+         p = -s * s2 * c3 * el1 * e[l] / dl1;
+         e[l] = s * p;
+         d[l] = c * p;
    
-			   // Check for convergence.
+         // Check for convergence.
    
-			} while (Math.abs(e[l]) > eps*tst1);
-		 }
-		 d[l] = d[l] + f;
-		 e[l] = 0.0;
-	  }
-	 
-	  // Sort eigenvalues and corresponding vectors.
+      } while (Math.abs(e[l]) > eps*tst1);
+     }
+     d[l] = d[l] + f;
+     e[l] = 0.0;
+    }
    
-	  for (int i = 0; i < n-1; i++) {
-		 int k = i;
-		 double p = d[i];
-		 for (int j = i+1; j < n; j++) {
-			if (d[j] < p) {
-			   k = j;
-			   p = d[j];
-			}
-		 }
-		 if (k != i) {
-			d[k] = d[i];
-			d[i] = p;
-			for (int j = 0; j < n; j++) {
-			   p = V[j][i];
-			   V[j][i] = V[j][k];
-			   V[j][k] = p;
-			}
-		 }
-	  }
+    // Sort eigenvalues and corresponding vectors.
+   
+    for (int i = 0; i < n-1; i++) {
+     int k = i;
+     double p = d[i];
+     for (int j = i+1; j < n; j++) {
+      if (d[j] < p) {
+         k = j;
+         p = d[j];
+      }
+     }
+     if (k != i) {
+      d[k] = d[i];
+      d[i] = p;
+      for (int j = 0; j < n; j++) {
+         p = V[j][i];
+         V[j][i] = V[j][k];
+         V[j][k] = p;
+      }
+     }
+    }
    }   
 /**
 Symmetric Householder reduction to tridiagonal form.
@@ -870,113 +870,113 @@
    //  Auto. Comp., Vol.ii-Linear Algebra, and the corresponding
    //  Fortran subroutine in EISPACK.
 
-	  
-	  for (int j = 0; j < n; j++) {
-		 d[j] = V[n-1][j];
-	  }
-	  
+    
+    for (int j = 0; j < n; j++) {
+     d[j] = V[n-1][j];
+    }
+    
 
-	  // Householder reduction to tridiagonal form.
+    // Householder reduction to tridiagonal form.
    
-	  for (int i = n-1; i > 0; i--) {
+    for (int i = n-1; i > 0; i--) {
    
-		 // Scale to avoid under/overflow.
+     // Scale to avoid under/overflow.
    
-		 double scale = 0.0;
-		 double h = 0.0;
-		 for (int k = 0; k < i; k++) {
-			scale = scale + Math.abs(d[k]);
-		 }
-		 if (scale == 0.0) {
-			e[i] = d[i-1];
-			for (int j = 0; j < i; j++) {
-			   d[j] = V[i-1][j];
-			   V[i][j] = 0.0;
-			   V[j][i] = 0.0;
-			}
-		 } else {
+     double scale = 0.0;
+     double h = 0.0;
+     for (int k = 0; k < i; k++) {
+      scale = scale + Math.abs(d[k]);
+     }
+     if (scale == 0.0) {
+      e[i] = d[i-1];
+      for (int j = 0; j < i; j++) {
+         d[j] = V[i-1][j];
+         V[i][j] = 0.0;
+         V[j][i] = 0.0;
+      }
+     } else {
    
-			// Generate Householder vector.
+      // Generate Householder vector.
    
-			for (int k = 0; k < i; k++) {
-			   d[k] /= scale;
-			   h += d[k] * d[k];
-			}
-			double f = d[i-1];
-			double g = Math.sqrt(h);
-			if (f > 0) {
-			   g = -g;
-			}
-			e[i] = scale * g;
-			h = h - f * g;
-			d[i-1] = f - g;
-			for (int j = 0; j < i; j++) {
-			   e[j] = 0.0;
-			}
+      for (int k = 0; k < i; k++) {
+         d[k] /= scale;
+         h += d[k] * d[k];
+      }
+      double f = d[i-1];
+      double g = Math.sqrt(h);
+      if (f > 0) {
+         g = -g;
+      }
+      e[i] = scale * g;
+      h = h - f * g;
+      d[i-1] = f - g;
+      for (int j = 0; j < i; j++) {
+         e[j] = 0.0;
+      }
    
-			// Apply similarity transformation to remaining columns.
+      // Apply similarity transformation to remaining columns.
    
-			for (int j = 0; j < i; j++) {
-			   f = d[j];
-			   V[j][i] = f;
-			   g = e[j] + V[j][j] * f;
-			   for (int k = j+1; k <= i-1; k++) {
-				  g += V[k][j] * d[k];
-				  e[k] += V[k][j] * f;
-			   }
-			   e[j] = g;
-			}
-			f = 0.0;
-			for (int j = 0; j < i; j++) {
-			   e[j] /= h;
-			   f += e[j] * d[j];
-			}
-			double hh = f / (h + h);
-			for (int j = 0; j < i; j++) {
-			   e[j] -= hh * d[j];
-			}
-			for (int j = 0; j < i; j++) {
-			   f = d[j];
-			   g = e[j];
-			   for (int k = j; k <= i-1; k++) {
-				  V[k][j] -= (f * e[k] + g * d[k]);
-			   }
-			   d[j] = V[i-1][j];
-			   V[i][j] = 0.0;
-			}
-		 }
-		 d[i] = h;
-	  }
+      for (int j = 0; j < i; j++) {
+         f = d[j];
+         V[j][i] = f;
+         g = e[j] + V[j][j] * f;
+         for (int k = j+1; k <= i-1; k++) {
+          g += V[k][j] * d[k];
+          e[k] += V[k][j] * f;
+         }
+         e[j] = g;
+      }
+      f = 0.0;
+      for (int j = 0; j < i; j++) {
+         e[j] /= h;
+         f += e[j] * d[j];
+      }
+      double hh = f / (h + h);
+      for (int j = 0; j < i; j++) {
+         e[j] -= hh * d[j];
+      }
+      for (int j = 0; j < i; j++) {
+         f = d[j];
+         g = e[j];
+         for (int k = j; k <= i-1; k++) {
+          V[k][j] -= (f * e[k] + g * d[k]);
+         }
+         d[j] = V[i-1][j];
+         V[i][j] = 0.0;
+      }
+     }
+     d[i] = h;
+    }
    
-	  // Accumulate transformations.
+    // Accumulate transformations.
    
-	  for (int i = 0; i < n-1; i++) {
-		 V[n-1][i] = V[i][i];
-		 V[i][i] = 1.0;
-		 double h = d[i+1];
-		 if (h != 0.0) {
-			for (int k = 0; k <= i; k++) {
-			   d[k] = V[k][i+1] / h;
-			}
-			for (int j = 0; j <= i; j++) {
-			   double g = 0.0;
-			   for (int k = 0; k <= i; k++) {
-				  g += V[k][i+1] * V[k][j];
-			   }
-			   for (int k = 0; k <= i; k++) {
-				  V[k][j] -= g * d[k];
-			   }
-			}
-		 }
-		 for (int k = 0; k <= i; k++) {
-			V[k][i+1] = 0.0;
-		 }
-	  }
-	  for (int j = 0; j < n; j++) {
-		 d[j] = V[n-1][j];
-		 V[n-1][j] = 0.0;
-	  }
-	  V[n-1][n-1] = 1.0;
-	  e[0] = 0.0;
+    for (int i = 0; i < n-1; i++) {
+     V[n-1][i] = V[i][i];
+     V[i][i] = 1.0;
+     double h = d[i+1];
+     if (h != 0.0) {
+      for (int k = 0; k <= i; k++) {
+         d[k] = V[k][i+1] / h;
+      }
+      for (int j = 0; j <= i; j++) {
+         double g = 0.0;
+         for (int k = 0; k <= i; k++) {
+          g += V[k][i+1] * V[k][j];
+         }
+         for (int k = 0; k <= i; k++) {
+          V[k][j] -= g * d[k];
+         }
+      }
+     }
+     for (int k = 0; k <= i; k++) {
+      V[k][i+1] = 0.0;
+     }
+    }
+    for (int j = 0; j < n; j++) {
+     d[j] = V[n-1][j];
+     V[n-1][j] = 0.0;
+    }
+    V[n-1][n-1] = 1.0;
+    e[0] = 0.0;
    }   
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/Property.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/Property.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/Property.java	(working copy)
@@ -46,122 +46,122 @@
 Here are some example properties
 <table border="1" cellspacing="0">
   <tr align="left" valign="top"> 
-	<td valign="middle" align="left"><tt>matrix</tt></td>
-	<td> <tt>4&nbsp;x&nbsp;4&nbsp;<br>
-	  0&nbsp;0&nbsp;0&nbsp;0<br>
-	  0&nbsp;0&nbsp;0&nbsp;0<br>
-	  0&nbsp;0&nbsp;0&nbsp;0<br>
-	  0&nbsp;0&nbsp;0&nbsp;0 </tt></td>
-	<td><tt>4&nbsp;x&nbsp;4<br>
-	  1&nbsp;0&nbsp;0&nbsp;0<br>
-	  0&nbsp;0&nbsp;0&nbsp;0<br>
-	  0&nbsp;0&nbsp;0&nbsp;0<br>
-	  0&nbsp;0&nbsp;0&nbsp;1 </tt></td>
-	<td><tt>4&nbsp;x&nbsp;4<br>
-	  1&nbsp;1&nbsp;0&nbsp;0<br>
-	  1&nbsp;1&nbsp;1&nbsp;0<br>
-	  0&nbsp;1&nbsp;1&nbsp;1<br>
-	  0&nbsp;0&nbsp;1&nbsp;1 </tt></td>
-	<td><tt> 4&nbsp;x&nbsp;4<br>
-	  0&nbsp;1&nbsp;1&nbsp;1<br>
-	  0&nbsp;1&nbsp;1&nbsp;1<br>
-	  0&nbsp;0&nbsp;0&nbsp;1<br>
-	  0&nbsp;0&nbsp;0&nbsp;1 </tt></td>
-	<td><tt> 4&nbsp;x&nbsp;4<br>
-	  0&nbsp;0&nbsp;0&nbsp;0<br>
-	  1&nbsp;1&nbsp;0&nbsp;0<br>
-	  1&nbsp;1&nbsp;0&nbsp;0<br>
-	  1&nbsp;1&nbsp;1&nbsp;1 </tt></td>
-	<td><tt>4&nbsp;x&nbsp;4<br>
-	  1&nbsp;1&nbsp;0&nbsp;0<br>
-	  0&nbsp;1&nbsp;1&nbsp;0<br>
-	  0&nbsp;1&nbsp;0&nbsp;1<br>
-	  1&nbsp;0&nbsp;1&nbsp;1 </tt><tt> </tt> </td>
-	<td><tt>4&nbsp;x&nbsp;4<br>
-	  1&nbsp;1&nbsp;1&nbsp;0<br>
-	  0&nbsp;1&nbsp;0&nbsp;0<br>
-	  1&nbsp;1&nbsp;0&nbsp;1<br>
-	  0&nbsp;0&nbsp;1&nbsp;1 </tt> </td>
+  <td valign="middle" align="left"><tt>matrix</tt></td>
+  <td> <tt>4&nbsp;x&nbsp;4&nbsp;<br>
+    0&nbsp;0&nbsp;0&nbsp;0<br>
+    0&nbsp;0&nbsp;0&nbsp;0<br>
+    0&nbsp;0&nbsp;0&nbsp;0<br>
+    0&nbsp;0&nbsp;0&nbsp;0 </tt></td>
+  <td><tt>4&nbsp;x&nbsp;4<br>
+    1&nbsp;0&nbsp;0&nbsp;0<br>
+    0&nbsp;0&nbsp;0&nbsp;0<br>
+    0&nbsp;0&nbsp;0&nbsp;0<br>
+    0&nbsp;0&nbsp;0&nbsp;1 </tt></td>
+  <td><tt>4&nbsp;x&nbsp;4<br>
+    1&nbsp;1&nbsp;0&nbsp;0<br>
+    1&nbsp;1&nbsp;1&nbsp;0<br>
+    0&nbsp;1&nbsp;1&nbsp;1<br>
+    0&nbsp;0&nbsp;1&nbsp;1 </tt></td>
+  <td><tt> 4&nbsp;x&nbsp;4<br>
+    0&nbsp;1&nbsp;1&nbsp;1<br>
+    0&nbsp;1&nbsp;1&nbsp;1<br>
+    0&nbsp;0&nbsp;0&nbsp;1<br>
+    0&nbsp;0&nbsp;0&nbsp;1 </tt></td>
+  <td><tt> 4&nbsp;x&nbsp;4<br>
+    0&nbsp;0&nbsp;0&nbsp;0<br>
+    1&nbsp;1&nbsp;0&nbsp;0<br>
+    1&nbsp;1&nbsp;0&nbsp;0<br>
+    1&nbsp;1&nbsp;1&nbsp;1 </tt></td>
+  <td><tt>4&nbsp;x&nbsp;4<br>
+    1&nbsp;1&nbsp;0&nbsp;0<br>
+    0&nbsp;1&nbsp;1&nbsp;0<br>
+    0&nbsp;1&nbsp;0&nbsp;1<br>
+    1&nbsp;0&nbsp;1&nbsp;1 </tt><tt> </tt> </td>
+  <td><tt>4&nbsp;x&nbsp;4<br>
+    1&nbsp;1&nbsp;1&nbsp;0<br>
+    0&nbsp;1&nbsp;0&nbsp;0<br>
+    1&nbsp;1&nbsp;0&nbsp;1<br>
+    0&nbsp;0&nbsp;1&nbsp;1 </tt> </td>
   </tr>
   <tr align="center" valign="middle"> 
-	<td><tt>upperBandwidth</tt></td>
-	<td> 
-	  <div align="center"><tt>0</tt></div>
-	</td>
-	<td> 
-	  <div align="center"><tt>0</tt></div>
-	</td>
-	<td> 
-	  <div align="center"><tt>1</tt></div>
-	</td>
-	<td><tt>3</tt></td>
-	<td align="center" valign="middle"><tt>0</tt></td>
-	<td align="center" valign="middle"> 
-	  <div align="center"><tt>1</tt></div>
-	</td>
-	<td align="center" valign="middle"> 
-	  <div align="center"><tt>2</tt></div>
-	</td>
+  <td><tt>upperBandwidth</tt></td>
+  <td> 
+    <div align="center"><tt>0</tt></div>
+  </td>
+  <td> 
+    <div align="center"><tt>0</tt></div>
+  </td>
+  <td> 
+    <div align="center"><tt>1</tt></div>
+  </td>
+  <td><tt>3</tt></td>
+  <td align="center" valign="middle"><tt>0</tt></td>
+  <td align="center" valign="middle"> 
+    <div align="center"><tt>1</tt></div>
+  </td>
+  <td align="center" valign="middle"> 
+    <div align="center"><tt>2</tt></div>
+  </td>
   </tr>
   <tr align="center" valign="middle"> 
-	<td><tt>lowerBandwidth</tt></td>
-	<td> 
-	  <div align="center"><tt>0</tt></div>
-	</td>
-	<td> 
-	  <div align="center"><tt>0</tt></div>
-	</td>
-	<td> 
-	  <div align="center"><tt>1</tt></div>
-	</td>
-	<td><tt>0</tt></td>
-	<td align="center" valign="middle"><tt>3</tt></td>
-	<td align="center" valign="middle"> 
-	  <div align="center"><tt>3</tt></div>
-	</td>
-	<td align="center" valign="middle"> 
-	  <div align="center"><tt>2</tt></div>
-	</td>
+  <td><tt>lowerBandwidth</tt></td>
+  <td> 
+    <div align="center"><tt>0</tt></div>
+  </td>
+  <td> 
+    <div align="center"><tt>0</tt></div>
+  </td>
+  <td> 
+    <div align="center"><tt>1</tt></div>
+  </td>
+  <td><tt>0</tt></td>
+  <td align="center" valign="middle"><tt>3</tt></td>
+  <td align="center" valign="middle"> 
+    <div align="center"><tt>3</tt></div>
+  </td>
+  <td align="center" valign="middle"> 
+    <div align="center"><tt>2</tt></div>
+  </td>
   </tr>
   <tr align="center" valign="middle"> 
-	<td><tt>semiBandwidth</tt></td>
-	<td> 
-	  <div align="center"><tt>1</tt></div>
-	</td>
-	<td> 
-	  <div align="center"><tt>1</tt></div>
-	</td>
-	<td> 
-	  <div align="center"><tt>2</tt></div>
-	</td>
-	<td><tt>4</tt></td>
-	<td align="center" valign="middle"><tt>4</tt></td>
-	<td align="center" valign="middle"> 
-	  <div align="center"><tt>4</tt></div>
-	</td>
-	<td align="center" valign="middle"> 
-	  <div align="center"><tt>3</tt></div>
-	</td>
+  <td><tt>semiBandwidth</tt></td>
+  <td> 
+    <div align="center"><tt>1</tt></div>
+  </td>
+  <td> 
+    <div align="center"><tt>1</tt></div>
+  </td>
+  <td> 
+    <div align="center"><tt>2</tt></div>
+  </td>
+  <td><tt>4</tt></td>
+  <td align="center" valign="middle"><tt>4</tt></td>
+  <td align="center" valign="middle"> 
+    <div align="center"><tt>4</tt></div>
+  </td>
+  <td align="center" valign="middle"> 
+    <div align="center"><tt>3</tt></div>
+  </td>
   </tr>
   <tr align="center" valign="middle"> 
-	<td><tt>description</tt></td>
-	<td> 
-	  <div align="center"><tt>zero</tt></div>
-	</td>
-	<td> 
-	  <div align="center"><tt>diagonal</tt></div>
-	</td>
-	<td> 
-	  <div align="center"><tt>tridiagonal</tt></div>
-	</td>
-	<td><tt>upper triangular</tt></td>
-	<td align="center" valign="middle"><tt>lower triangular</tt></td>
-	<td align="center" valign="middle"> 
-	  <div align="center"><tt>unstructured</tt></div>
-	</td>
-	<td align="center" valign="middle"> 
-	  <div align="center"><tt>unstructured</tt></div>
-	</td>
+  <td><tt>description</tt></td>
+  <td> 
+    <div align="center"><tt>zero</tt></div>
+  </td>
+  <td> 
+    <div align="center"><tt>diagonal</tt></div>
+  </td>
+  <td> 
+    <div align="center"><tt>tridiagonal</tt></div>
+  </td>
+  <td><tt>upper triangular</tt></td>
+  <td align="center" valign="middle"><tt>lower triangular</tt></td>
+  <td align="center" valign="middle"> 
+    <div align="center"><tt>unstructured</tt></div>
+  </td>
+  <td align="center" valign="middle"> 
+    <div align="center"><tt>unstructured</tt></div>
+  </td>
   </tr>
 </table>
 
@@ -173,66 +173,66 @@
  */
 @Deprecated
 public class Property extends org.apache.mahout.matrix.PersistentObject {
-	/**
-	 * The default Property object; currently has <tt>tolerance()==1.0E-9</tt>.
-	 */
-	public static final Property DEFAULT = new Property(1.0E-9);
-	
-	/**
-	 * A Property object with <tt>tolerance()==0.0</tt>.
-	 */
-	public static final Property ZERO = new Property(0.0);
-	
-	/**
-	 * A Property object with <tt>tolerance()==1.0E-12</tt>.
-	 */
-	public static final Property TWELVE = new Property(1.0E-12);
-	
-	protected double tolerance;
+  /**
+   * The default Property object; currently has <tt>tolerance()==1.0E-9</tt>.
+   */
+  public static final Property DEFAULT = new Property(1.0E-9);
+  
+  /**
+   * A Property object with <tt>tolerance()==0.0</tt>.
+   */
+  public static final Property ZERO = new Property(0.0);
+  
+  /**
+   * A Property object with <tt>tolerance()==1.0E-12</tt>.
+   */
+  public static final Property TWELVE = new Property(1.0E-12);
+  
+  protected double tolerance;
 /**
  * Not instantiable by no-arg constructor.
  */
 private Property() {
-	this(1.0E-9); // just to be on the safe side
+  this(1.0E-9); // just to be on the safe side
 }
 /**
  * Constructs an instance with a tolerance of <tt>Math.abs(newTolerance)</tt>.
  */
 public Property(double newTolerance) {
-	tolerance = Math.abs(newTolerance);
+  tolerance = Math.abs(newTolerance);
 }
 /**
  * Returns a String with <tt>length</tt> blanks.
  */
 protected static String blanks(int length) {
-	if (length <0 ) length = 0;
-	StringBuffer buf = new StringBuffer(length);
-	for (int k = 0; k < length; k++) {
-		buf.append(' ');
-	}
-	return buf.toString();
+  if (length <0 ) length = 0;
+  StringBuffer buf = new StringBuffer(length);
+  for (int k = 0; k < length; k++) {
+    buf.append(' ');
+  }
+  return buf.toString();
 }
 /**
  * Checks whether the given matrix <tt>A</tt> is <i>rectangular</i>.
  * @throws IllegalArgumentException if <tt>A.rows() < A.columns()</tt>.
  */
 public void checkRectangular(DoubleMatrix2D A) {
-	if (A.rows() < A.columns()) {
-		throw new IllegalArgumentException("Matrix must be rectangular: "+ org.apache.mahout.matrix.matrix.doublealgo.Formatter.shape(A));
-	}
+  if (A.rows() < A.columns()) {
+    throw new IllegalArgumentException("Matrix must be rectangular: "+ org.apache.mahout.matrix.matrix.doublealgo.Formatter.shape(A));
+  }
 }
 /**
  * Checks whether the given matrix <tt>A</tt> is <i>square</i>.
  * @throws IllegalArgumentException if <tt>A.rows() != A.columns()</tt>.
  */
 public void checkSquare(DoubleMatrix2D A) {
-	if (A.rows() != A.columns()) throw new IllegalArgumentException("Matrix must be square: "+ org.apache.mahout.matrix.matrix.doublealgo.Formatter.shape(A));
+  if (A.rows() != A.columns()) throw new IllegalArgumentException("Matrix must be square: "+ org.apache.mahout.matrix.matrix.doublealgo.Formatter.shape(A));
 }
 /**
  * Returns the matrix's fraction of non-zero cells; <tt>A.cardinality() / A.size()</tt>.
  */
 public double density(DoubleMatrix2D A) {
-	return A.cardinality() / (double) A.size();
+  return A.cardinality() / (double) A.size();
 }
 /**
  * Returns whether all cells of the given matrix <tt>A</tt> are equal to the given value.
@@ -244,17 +244,17 @@
  *          <tt>false</tt> otherwise.
  */
 public boolean equals(DoubleMatrix1D A, double value) {
-	if (A==null) return false;
-	double epsilon = tolerance();
-	for (int i = A.size(); --i >= 0;) {
-		//if (!(A.getQuick(i) == value)) return false;
-		//if (Math.abs(value - A.getQuick(i)) > epsilon) return false;
-		double x = A.getQuick(i);
-		double diff = Math.abs(value - x);
-		if ((diff!=diff) && ((value!=value && x!=x) || value==x)) diff = 0;
-		if (!(diff <= epsilon)) return false;
-	}
-	return true;
+  if (A==null) return false;
+  double epsilon = tolerance();
+  for (int i = A.size(); --i >= 0;) {
+    //if (!(A.getQuick(i) == value)) return false;
+    //if (Math.abs(value - A.getQuick(i)) > epsilon) return false;
+    double x = A.getQuick(i);
+    double diff = Math.abs(value - x);
+    if ((diff!=diff) && ((value!=value && x!=x) || value==x)) diff = 0;
+    if (!(diff <= epsilon)) return false;
+  }
+  return true;
 }
 /**
  * Returns whether both given matrices <tt>A</tt> and <tt>B</tt> are equal.
@@ -268,22 +268,22 @@
  *          <tt>false</tt> otherwise.
  */
 public boolean equals(DoubleMatrix1D A, DoubleMatrix1D B) {
-	if (A==B) return true;
-	if (! (A != null && B != null)) return false;
-	int size = A.size();
-	if (size != B.size()) return false;
+  if (A==B) return true;
+  if (! (A != null && B != null)) return false;
+  int size = A.size();
+  if (size != B.size()) return false;
 
-	double epsilon = tolerance();
-	for (int i=size; --i >= 0;) {
-		//if (!(getQuick(i) == B.getQuick(i))) return false;
-		//if (Math.abs(A.getQuick(i) - B.getQuick(i)) > epsilon) return false;
-		double x = A.getQuick(i);
-		double value = B.getQuick(i);
-		double diff = Math.abs(value - x);
-		if ((diff!=diff) && ((value!=value && x!=x) || value==x)) diff = 0;
-		if (!(diff <= epsilon)) return false;
-	}
-	return true;
+  double epsilon = tolerance();
+  for (int i=size; --i >= 0;) {
+    //if (!(getQuick(i) == B.getQuick(i))) return false;
+    //if (Math.abs(A.getQuick(i) - B.getQuick(i)) > epsilon) return false;
+    double x = A.getQuick(i);
+    double value = B.getQuick(i);
+    double diff = Math.abs(value - x);
+    if ((diff!=diff) && ((value!=value && x!=x) || value==x)) diff = 0;
+    if (!(diff <= epsilon)) return false;
+  }
+  return true;
 }
 /**
  * Returns whether all cells of the given matrix <tt>A</tt> are equal to the given value.
@@ -295,22 +295,22 @@
  *          <tt>false</tt> otherwise.
  */
 public boolean equals(DoubleMatrix2D A, double value) {
-	if (A==null) return false;
-	int rows = A.rows();
-	int columns = A.columns();
+  if (A==null) return false;
+  int rows = A.rows();
+  int columns = A.columns();
 
-	double epsilon = tolerance();
-	for (int row=rows; --row >= 0;) {
-		for (int column=columns; --column >= 0;) {
-			//if (!(A.getQuick(row,column) == value)) return false;
-			//if (Math.abs(value - A.getQuick(row,column)) > epsilon) return false;
-			double x = A.getQuick(row,column);
-			double diff = Math.abs(value - x);
-			if ((diff!=diff) && ((value!=value && x!=x) || value==x)) diff = 0;
-			if (!(diff <= epsilon)) return false;
-		}
-	}
-	return true;
+  double epsilon = tolerance();
+  for (int row=rows; --row >= 0;) {
+    for (int column=columns; --column >= 0;) {
+      //if (!(A.getQuick(row,column) == value)) return false;
+      //if (Math.abs(value - A.getQuick(row,column)) > epsilon) return false;
+      double x = A.getQuick(row,column);
+      double diff = Math.abs(value - x);
+      if ((diff!=diff) && ((value!=value && x!=x) || value==x)) diff = 0;
+      if (!(diff <= epsilon)) return false;
+    }
+  }
+  return true;
 }
 /**
  * Returns whether both given matrices <tt>A</tt> and <tt>B</tt> are equal.
@@ -324,25 +324,25 @@
  *          <tt>false</tt> otherwise.
  */
 public boolean equals(DoubleMatrix2D A, DoubleMatrix2D B) {
-	if (A==B) return true;
-	if (! (A != null && B != null)) return false;
-	int rows = A.rows();
-	int columns = A.columns();
-	if (columns != B.columns() || rows != B.rows()) return false;
+  if (A==B) return true;
+  if (! (A != null && B != null)) return false;
+  int rows = A.rows();
+  int columns = A.columns();
+  if (columns != B.columns() || rows != B.rows()) return false;
 
-	double epsilon = tolerance();
-	for (int row=rows; --row >= 0;) {
-		for (int column=columns; --column >= 0;) {
-			//if (!(A.getQuick(row,column) == B.getQuick(row,column))) return false;
-			//if (Math.abs((A.getQuick(row,column) - B.getQuick(row,column)) > epsilon) return false;
-			double x = A.getQuick(row,column);
-			double value = B.getQuick(row,column);
-			double diff = Math.abs(value - x);
-			if ((diff!=diff) && ((value!=value && x!=x) || value==x)) diff = 0;
-			if (!(diff <= epsilon)) return false;
-		}
-	}
-	return true;
+  double epsilon = tolerance();
+  for (int row=rows; --row >= 0;) {
+    for (int column=columns; --column >= 0;) {
+      //if (!(A.getQuick(row,column) == B.getQuick(row,column))) return false;
+      //if (Math.abs((A.getQuick(row,column) - B.getQuick(row,column)) > epsilon) return false;
+      double x = A.getQuick(row,column);
+      double value = B.getQuick(row,column);
+      double diff = Math.abs(value - x);
+      if ((diff!=diff) && ((value!=value && x!=x) || value==x)) diff = 0;
+      if (!(diff <= epsilon)) return false;
+    }
+  }
+  return true;
 }
 /**
  * Returns whether all cells of the given matrix <tt>A</tt> are equal to the given value.
@@ -354,24 +354,24 @@
  *          <tt>false</tt> otherwise.
  */
 public boolean equals(DoubleMatrix3D A, double value) {
-	if (A==null) return false;
-	int rows = A.rows();
-	int columns = A.columns();
+  if (A==null) return false;
+  int rows = A.rows();
+  int columns = A.columns();
 
-	double epsilon = tolerance();
-	for (int slice=A.slices(); --slice >= 0;) {
-		for (int row=rows; --row >= 0;) {
-			for (int column=columns; --column >= 0;) {
-				//if (!(A.getQuick(slice,row,column) == value)) return false;
-				//if (Math.abs(value - A.getQuick(slice,row,column)) > epsilon) return false;
-				double x = A.getQuick(slice,row,column);
-				double diff = Math.abs(value - x);
-				if ((diff!=diff) && ((value!=value && x!=x) || value==x)) diff = 0;
-				if (!(diff <= epsilon)) return false;
-			}
-		}
-	}
-	return true;
+  double epsilon = tolerance();
+  for (int slice=A.slices(); --slice >= 0;) {
+    for (int row=rows; --row >= 0;) {
+      for (int column=columns; --column >= 0;) {
+        //if (!(A.getQuick(slice,row,column) == value)) return false;
+        //if (Math.abs(value - A.getQuick(slice,row,column)) > epsilon) return false;
+        double x = A.getQuick(slice,row,column);
+        double diff = Math.abs(value - x);
+        if ((diff!=diff) && ((value!=value && x!=x) || value==x)) diff = 0;
+        if (!(diff <= epsilon)) return false;
+      }
+    }
+  }
+  return true;
 }
 /**
  * Returns whether both given matrices <tt>A</tt> and <tt>B</tt> are equal.
@@ -385,28 +385,28 @@
  *          <tt>false</tt> otherwise.
  */
 public boolean equals(DoubleMatrix3D A, DoubleMatrix3D B) {
-	if (A==B) return true;
-	if (! (A != null && B != null)) return false;
-	int slices = A.slices();
-	int rows = A.rows();
-	int columns = A.columns();
-	if (columns != B.columns() || rows != B.rows() || slices != B.slices()) return false;
+  if (A==B) return true;
+  if (! (A != null && B != null)) return false;
+  int slices = A.slices();
+  int rows = A.rows();
+  int columns = A.columns();
+  if (columns != B.columns() || rows != B.rows() || slices != B.slices()) return false;
 
-	double epsilon = tolerance();
-	for (int slice=slices; --slice >= 0;) {
-		for (int row=rows; --row >= 0;) {
-			for (int column=columns; --column >= 0;) {
-				//if (!(A.getQuick(slice,row,column) == B.getQuick(slice,row,column))) return false;
-				//if (Math.abs(A.getQuick(slice,row,column) - B.getQuick(slice,row,column)) > epsilon) return false;
-				double x = A.getQuick(slice,row,column);
-				double value = B.getQuick(slice,row,column);
-				double diff = Math.abs(value - x);
-				if ((diff!=diff) && ((value!=value && x!=x) || value==x)) diff = 0;
-				if (!(diff <= epsilon)) return false;
-			}
-		}
-	}
-	return true;
+  double epsilon = tolerance();
+  for (int slice=slices; --slice >= 0;) {
+    for (int row=rows; --row >= 0;) {
+      for (int column=columns; --column >= 0;) {
+        //if (!(A.getQuick(slice,row,column) == B.getQuick(slice,row,column))) return false;
+        //if (Math.abs(A.getQuick(slice,row,column) - B.getQuick(slice,row,column)) > epsilon) return false;
+        double x = A.getQuick(slice,row,column);
+        double value = B.getQuick(slice,row,column);
+        double diff = Math.abs(value - x);
+        if ((diff!=diff) && ((value!=value && x!=x) || value==x)) diff = 0;
+        if (!(diff <= epsilon)) return false;
+      }
+    }
+  }
+  return true;
 }
 /**
 Modifies the given matrix square matrix <tt>A</tt> such that it is diagonally dominant by row and column, hence non-singular, hence invertible.
@@ -415,38 +415,38 @@
 @throws IllegalArgumentException if <tt>!isSquare(A)</tt>.
 */
 public void generateNonSingular(DoubleMatrix2D A) {
-	checkSquare(A);
-	org.apache.mahout.jet.math.Functions F = org.apache.mahout.jet.math.Functions.functions;
-	int min = Math.min(A.rows(), A.columns());
-	for (int i = min; --i >= 0; ) {
-		A.setQuick(i,i, 0);
-	}
-	for (int i = min; --i >= 0; ) {
-		double rowSum = A.viewRow(i).aggregate(F.plus,F.abs);
-		double colSum = A.viewColumn(i).aggregate(F.plus,F.abs);
-		A.setQuick(i,i, Math.max(rowSum,colSum) + i+1);
-	}
+  checkSquare(A);
+  org.apache.mahout.jet.math.Functions F = org.apache.mahout.jet.math.Functions.functions;
+  int min = Math.min(A.rows(), A.columns());
+  for (int i = min; --i >= 0; ) {
+    A.setQuick(i,i, 0);
+  }
+  for (int i = min; --i >= 0; ) {
+    double rowSum = A.viewRow(i).aggregate(F.plus,F.abs);
+    double colSum = A.viewColumn(i).aggregate(F.plus,F.abs);
+    A.setQuick(i,i, Math.max(rowSum,colSum) + i+1);
+  }
 }
 /**
  */
 protected static String get(org.apache.mahout.matrix.list.ObjectArrayList list, int index) {
-	return ((String) list.get(index));
+  return ((String) list.get(index));
 }
 /**
  * A matrix <tt>A</tt> is <i>diagonal</i> if <tt>A[i,j] == 0</tt> whenever <tt>i != j</tt>.
  * Matrix may but need not be square.
  */
 public boolean isDiagonal(DoubleMatrix2D A) {
-	double epsilon = tolerance();
-	int rows = A.rows();
-	int columns = A.columns();
-	for (int row = rows; --row >=0; ) {
-		for (int column = columns; --column >= 0; ) {
-			//if (row!=column && A.getQuick(row,column) != 0) return false;
-			if (row!=column && !(Math.abs(A.getQuick(row,column)) <= epsilon)) return false;
-		}
-	}
-	return true;
+  double epsilon = tolerance();
+  int rows = A.rows();
+  int columns = A.columns();
+  for (int row = rows; --row >=0; ) {
+    for (int column = columns; --column >= 0; ) {
+      //if (row!=column && A.getQuick(row,column) != 0) return false;
+      if (row!=column && !(Math.abs(A.getQuick(row,column)) <= epsilon)) return false;
+    }
+  }
+  return true;
 }
 /**
  * A matrix <tt>A</tt> is <i>diagonally dominant by column</i> if the absolute value of each diagonal element is larger than the sum of the absolute values of the off-diagonal elements in the corresponding column.
@@ -456,15 +456,15 @@
  * Note: Ignores tolerance.
  */
 public boolean isDiagonallyDominantByColumn(DoubleMatrix2D A) {
-	org.apache.mahout.jet.math.Functions F = org.apache.mahout.jet.math.Functions.functions;
-	double epsilon = tolerance();
-	int min = Math.min(A.rows(), A.columns());
-	for (int i = min; --i >= 0; ) {
-		double diag = Math.abs(A.getQuick(i,i));
-		diag += diag;
-		if (diag <= A.viewColumn(i).aggregate(F.plus,F.abs)) return false;
-	}
-	return true;
+  org.apache.mahout.jet.math.Functions F = org.apache.mahout.jet.math.Functions.functions;
+  double epsilon = tolerance();
+  int min = Math.min(A.rows(), A.columns());
+  for (int i = min; --i >= 0; ) {
+    double diag = Math.abs(A.getQuick(i,i));
+    diag += diag;
+    if (diag <= A.viewColumn(i).aggregate(F.plus,F.abs)) return false;
+  }
+  return true;
 }
 /**
  * A matrix <tt>A</tt> is <i>diagonally dominant by row</i> if the absolute value of each diagonal element is larger than the sum of the absolute values of the off-diagonal elements in the corresponding row.
@@ -474,68 +474,68 @@
  * Note: Ignores tolerance.
  */
 public boolean isDiagonallyDominantByRow(DoubleMatrix2D A) {
-	org.apache.mahout.jet.math.Functions F = org.apache.mahout.jet.math.Functions.functions;
-	double epsilon = tolerance();
-	int min = Math.min(A.rows(), A.columns());
-	for (int i = min; --i >= 0; ) {
-		double diag = Math.abs(A.getQuick(i,i));
-		diag += diag;
-		if (diag <= A.viewRow(i).aggregate(F.plus,F.abs)) return false;
-	}
-	return true;
+  org.apache.mahout.jet.math.Functions F = org.apache.mahout.jet.math.Functions.functions;
+  double epsilon = tolerance();
+  int min = Math.min(A.rows(), A.columns());
+  for (int i = min; --i >= 0; ) {
+    double diag = Math.abs(A.getQuick(i,i));
+    diag += diag;
+    if (diag <= A.viewRow(i).aggregate(F.plus,F.abs)) return false;
+  }
+  return true;
 }
 /**
  * A matrix <tt>A</tt> is an <i>identity</i> matrix if <tt>A[i,i] == 1</tt> and all other cells are zero.
  * Matrix may but need not be square.
  */
 public boolean isIdentity(DoubleMatrix2D A) {
-	double epsilon = tolerance();
-	int rows = A.rows();
-	int columns = A.columns();
-	for (int row = rows; --row >=0; ) {
-		for (int column = columns; --column >= 0; ) {
-			double v = A.getQuick(row,column);
-			if (row==column) {
-				if (!(Math.abs(1-v) < epsilon)) return false;
-			}
-			else if (!(Math.abs(v) <= epsilon)) return false;
-		}
-	}
-	return true;
+  double epsilon = tolerance();
+  int rows = A.rows();
+  int columns = A.columns();
+  for (int row = rows; --row >=0; ) {
+    for (int column = columns; --column >= 0; ) {
+      double v = A.getQuick(row,column);
+      if (row==column) {
+        if (!(Math.abs(1-v) < epsilon)) return false;
+      }
+      else if (!(Math.abs(v) <= epsilon)) return false;
+    }
+  }
+  return true;
 }
 /**
  * A matrix <tt>A</tt> is <i>lower bidiagonal</i> if <tt>A[i,j]==0</tt> unless <tt>i==j || i==j+1</tt>.
  * Matrix may but need not be square.
  */
 public boolean isLowerBidiagonal(DoubleMatrix2D A) {
-	double epsilon = tolerance();
-	int rows = A.rows();
-	int columns = A.columns();
-	for (int row = rows; --row >=0; ) {
-		for (int column = columns; --column >= 0; ) {
-			if (!(row==column || row==column+1)) {
-				//if (A.getQuick(row,column) != 0) return false;
-				if (!(Math.abs(A.getQuick(row,column)) <= epsilon)) return false;
-			}
-		}
-	}
-	return true;
+  double epsilon = tolerance();
+  int rows = A.rows();
+  int columns = A.columns();
+  for (int row = rows; --row >=0; ) {
+    for (int column = columns; --column >= 0; ) {
+      if (!(row==column || row==column+1)) {
+        //if (A.getQuick(row,column) != 0) return false;
+        if (!(Math.abs(A.getQuick(row,column)) <= epsilon)) return false;
+      }
+    }
+  }
+  return true;
 }
 /**
  * A matrix <tt>A</tt> is <i>lower triangular</i> if <tt>A[i,j]==0</tt> whenever <tt>i &lt; j</tt>.
  * Matrix may but need not be square.
  */
 public boolean isLowerTriangular(DoubleMatrix2D A) {
-	double epsilon = tolerance();
-	int rows = A.rows();
-	int columns = A.columns();
-	for (int column = columns; --column >= 0; ) {
-		for (int row = Math.min(column,rows); --row >= 0; ) {
-			//if (A.getQuick(row,column) != 0) return false;
-			if (!(Math.abs(A.getQuick(row,column)) <= epsilon)) return false;
-		}
-	}
-	return true;
+  double epsilon = tolerance();
+  int rows = A.rows();
+  int columns = A.columns();
+  for (int column = columns; --column >= 0; ) {
+    for (int row = Math.min(column,rows); --row >= 0; ) {
+      //if (A.getQuick(row,column) != 0) return false;
+      if (!(Math.abs(A.getQuick(row,column)) <= epsilon)) return false;
+    }
+  }
+  return true;
 }
 /**
  * A matrix <tt>A</tt> is <i>non-negative</i> if <tt>A[i,j] &gt;= 0</tt> holds for all cells.
@@ -543,22 +543,22 @@
  * Note: Ignores tolerance.
  */
 public boolean isNonNegative(DoubleMatrix2D A) {
-	int rows = A.rows();
-	int columns = A.columns();
-	for (int row = rows; --row >=0; ) {
-		for (int column = columns; --column >= 0; ) {
-			if (! (A.getQuick(row,column) >= 0)) return false;
-		}
-	}
-	return true;
+  int rows = A.rows();
+  int columns = A.columns();
+  for (int row = rows; --row >=0; ) {
+    for (int column = columns; --column >= 0; ) {
+      if (! (A.getQuick(row,column) >= 0)) return false;
+    }
+  }
+  return true;
 }
 /**
  * A square matrix <tt>A</tt> is <i>orthogonal</i> if <tt>A*transpose(A) = I</tt>.
  * @throws IllegalArgumentException if <tt>!isSquare(A)</tt>.
  */
 public boolean isOrthogonal(DoubleMatrix2D A) {
-	checkSquare(A);
-	return equals(A.zMult(A,null,1,0,false,true), org.apache.mahout.matrix.matrix.DoubleFactory2D.dense.identity(A.rows()));
+  checkSquare(A);
+  return equals(A.zMult(A,null,1,0,false,true), org.apache.mahout.matrix.matrix.DoubleFactory2D.dense.identity(A.rows()));
 }
 /**
  * A matrix <tt>A</tt> is <i>positive</i> if <tt>A[i,j] &gt; 0</tt> holds for all cells.
@@ -566,176 +566,176 @@
  * Note: Ignores tolerance.
  */
 public boolean isPositive(DoubleMatrix2D A) {
-	int rows = A.rows();
-	int columns = A.columns();
-	for (int row = rows; --row >=0; ) {
-		for (int column = columns; --column >= 0; ) {
-			if (!(A.getQuick(row,column) > 0)) return false;
-		}
-	}
-	return true;
+  int rows = A.rows();
+  int columns = A.columns();
+  for (int row = rows; --row >=0; ) {
+    for (int column = columns; --column >= 0; ) {
+      if (!(A.getQuick(row,column) > 0)) return false;
+    }
+  }
+  return true;
 }
 /**
  * A matrix <tt>A</tt> is <i>singular</i> if it has no inverse, that is, iff <tt>det(A)==0</tt>.
  */
 public boolean isSingular(DoubleMatrix2D A) {
-	return !(Math.abs(Algebra.DEFAULT.det(A)) >= tolerance());
+  return !(Math.abs(Algebra.DEFAULT.det(A)) >= tolerance());
 }
 /**
  * A square matrix <tt>A</tt> is <i>skew-symmetric</i> if <tt>A = -transpose(A)</tt>, that is <tt>A[i,j] == -A[j,i]</tt>.
  * @throws IllegalArgumentException if <tt>!isSquare(A)</tt>.
  */
 public boolean isSkewSymmetric(DoubleMatrix2D A) {
-	checkSquare(A);
-	double epsilon = tolerance();
-	int rows = A.rows();
-	int columns = A.columns();
-	for (int row = rows; --row >=0; ) {
-		for (int column = rows; --column >= 0; ) {
-			//if (A.getQuick(row,column) != -A.getQuick(column,row)) return false;
-			if (!(Math.abs(A.getQuick(row,column) + A.getQuick(column,row)) <= epsilon)) return false;
-		}
-	}
-	return true;
+  checkSquare(A);
+  double epsilon = tolerance();
+  int rows = A.rows();
+  int columns = A.columns();
+  for (int row = rows; --row >=0; ) {
+    for (int column = rows; --column >= 0; ) {
+      //if (A.getQuick(row,column) != -A.getQuick(column,row)) return false;
+      if (!(Math.abs(A.getQuick(row,column) + A.getQuick(column,row)) <= epsilon)) return false;
+    }
+  }
+  return true;
 }
 /**
  * A matrix <tt>A</tt> is <i>square</i> if it has the same number of rows and columns.
  */
 public boolean isSquare(DoubleMatrix2D A) {
-	return A.rows() == A.columns();
+  return A.rows() == A.columns();
 }
 /**
  * A matrix <tt>A</tt> is <i>strictly lower triangular</i> if <tt>A[i,j]==0</tt> whenever <tt>i &lt;= j</tt>.
  * Matrix may but need not be square.
  */
 public boolean isStrictlyLowerTriangular(DoubleMatrix2D A) {
-	double epsilon = tolerance();
-	int rows = A.rows();
-	int columns = A.columns();
-	for (int column = columns; --column >= 0; ) {
-		for (int row = Math.min(rows,column+1); --row >= 0; ) {
-			//if (A.getQuick(row,column) != 0) return false;
-			if (!(Math.abs(A.getQuick(row,column)) <= epsilon)) return false;
-		}
-	}
-	return true;
+  double epsilon = tolerance();
+  int rows = A.rows();
+  int columns = A.columns();
+  for (int column = columns; --column >= 0; ) {
+    for (int row = Math.min(rows,column+1); --row >= 0; ) {
+      //if (A.getQuick(row,column) != 0) return false;
+      if (!(Math.abs(A.getQuick(row,column)) <= epsilon)) return false;
+    }
+  }
+  return true;
 }
 /**
  * A matrix <tt>A</tt> is <i>strictly triangular</i> if it is triangular and its diagonal elements all equal 0.
  * Matrix may but need not be square.
  */
 public boolean isStrictlyTriangular(DoubleMatrix2D A) {
-	if (!isTriangular(A)) return false;
+  if (!isTriangular(A)) return false;
 
-	double epsilon = tolerance();
-	for (int i = Math.min(A.rows(), A.columns()); --i >= 0; ) {
-		//if (A.getQuick(i,i) != 0) return false;
-		if (!(Math.abs(A.getQuick(i,i)) <= epsilon)) return false;
-	}
-	return true;
+  double epsilon = tolerance();
+  for (int i = Math.min(A.rows(), A.columns()); --i >= 0; ) {
+    //if (A.getQuick(i,i) != 0) return false;
+    if (!(Math.abs(A.getQuick(i,i)) <= epsilon)) return false;
+  }
+  return true;
 }
 /**
  * A matrix <tt>A</tt> is <i>strictly upper triangular</i> if <tt>A[i,j]==0</tt> whenever <tt>i &gt;= j</tt>.
  * Matrix may but need not be square.
  */
 public boolean isStrictlyUpperTriangular(DoubleMatrix2D A) {
-	double epsilon = tolerance();
-	int rows = A.rows();
-	int columns = A.columns();
-	for (int column = columns; --column >= 0; ) {
-		for (int row = rows; --row >= column; ) {
-			//if (A.getQuick(row,column) != 0) return false;
-			if (!(Math.abs(A.getQuick(row,column)) <= epsilon)) return false;
-		}
-	}
-	return true;
+  double epsilon = tolerance();
+  int rows = A.rows();
+  int columns = A.columns();
+  for (int column = columns; --column >= 0; ) {
+    for (int row = rows; --row >= column; ) {
+      //if (A.getQuick(row,column) != 0) return false;
+      if (!(Math.abs(A.getQuick(row,column)) <= epsilon)) return false;
+    }
+  }
+  return true;
 }
 /**
  * A matrix <tt>A</tt> is <i>symmetric</i> if <tt>A = tranpose(A)</tt>, that is <tt>A[i,j] == A[j,i]</tt>.
  * @throws IllegalArgumentException if <tt>!isSquare(A)</tt>.
  */
 public boolean isSymmetric(DoubleMatrix2D A) {
-	checkSquare(A);
-	return equals(A,A.viewDice());
+  checkSquare(A);
+  return equals(A,A.viewDice());
 }
 /**
  * A matrix <tt>A</tt> is <i>triangular</i> iff it is either upper or lower triangular.
  * Matrix may but need not be square.
  */
 public boolean isTriangular(DoubleMatrix2D A) {
-	return isLowerTriangular(A) || isUpperTriangular(A);
+  return isLowerTriangular(A) || isUpperTriangular(A);
 }
 /**
  * A matrix <tt>A</tt> is <i>tridiagonal</i> if <tt>A[i,j]==0</tt> whenever <tt>Math.abs(i-j) > 1</tt>.
  * Matrix may but need not be square.
  */
 public boolean isTridiagonal(DoubleMatrix2D A) {
-	double epsilon = tolerance();
-	int rows = A.rows();
-	int columns = A.columns();
-	for (int row = rows; --row >=0; ) {
-		for (int column = columns; --column >= 0; ) {
-			if (Math.abs(row-column) > 1) {
-				//if (A.getQuick(row,column) != 0) return false;
-				if (!(Math.abs(A.getQuick(row,column)) <= epsilon)) return false;
-			}
-		}
-	}
-	return true;
+  double epsilon = tolerance();
+  int rows = A.rows();
+  int columns = A.columns();
+  for (int row = rows; --row >=0; ) {
+    for (int column = columns; --column >= 0; ) {
+      if (Math.abs(row-column) > 1) {
+        //if (A.getQuick(row,column) != 0) return false;
+        if (!(Math.abs(A.getQuick(row,column)) <= epsilon)) return false;
+      }
+    }
+  }
+  return true;
 }
 /**
  * A matrix <tt>A</tt> is <i>unit triangular</i> if it is triangular and its diagonal elements all equal 1.
  * Matrix may but need not be square.
  */
 public boolean isUnitTriangular(DoubleMatrix2D A) {
-	if (!isTriangular(A)) return false;
-	
-	double epsilon = tolerance();
-	for (int i = Math.min(A.rows(), A.columns()); --i >= 0; ) {
-		//if (A.getQuick(i,i) != 1) return false;
-		if (!(Math.abs(1 - A.getQuick(i,i)) <= epsilon)) return false;
-	}
-	return true;
+  if (!isTriangular(A)) return false;
+  
+  double epsilon = tolerance();
+  for (int i = Math.min(A.rows(), A.columns()); --i >= 0; ) {
+    //if (A.getQuick(i,i) != 1) return false;
+    if (!(Math.abs(1 - A.getQuick(i,i)) <= epsilon)) return false;
+  }
+  return true;
 }
 /**
  * A matrix <tt>A</tt> is <i>upper bidiagonal</i> if <tt>A[i,j]==0</tt> unless <tt>i==j || i==j-1</tt>.
  * Matrix may but need not be square.
  */
 public boolean isUpperBidiagonal(DoubleMatrix2D A) {
-	double epsilon = tolerance();
-	int rows = A.rows();
-	int columns = A.columns();
-	for (int row = rows; --row >=0; ) {
-		for (int column = columns; --column >= 0; ) {
-			if (!(row==column || row==column-1)) {
-				//if (A.getQuick(row,column) != 0) return false;
-				if (!(Math.abs(A.getQuick(row,column)) <= epsilon)) return false;
-			}
-		}
-	}
-	return true;
+  double epsilon = tolerance();
+  int rows = A.rows();
+  int columns = A.columns();
+  for (int row = rows; --row >=0; ) {
+    for (int column = columns; --column >= 0; ) {
+      if (!(row==column || row==column-1)) {
+        //if (A.getQuick(row,column) != 0) return false;
+        if (!(Math.abs(A.getQuick(row,column)) <= epsilon)) return false;
+      }
+    }
+  }
+  return true;
 }
 /**
  * A matrix <tt>A</tt> is <i>upper triangular</i> if <tt>A[i,j]==0</tt> whenever <tt>i &gt; j</tt>.
  * Matrix may but need not be square.
  */
 public boolean isUpperTriangular(DoubleMatrix2D A) {
-	double epsilon = tolerance();
-	int rows = A.rows();
-	int columns = A.columns();
-	for (int column = columns; --column >= 0; ) {
-		for (int row = rows; --row > column; ) {
-			//if (A.getQuick(row,column) != 0) return false;
-			if (!(Math.abs(A.getQuick(row,column)) <= epsilon)) return false;
-		}
-	}
-	return true;
+  double epsilon = tolerance();
+  int rows = A.rows();
+  int columns = A.columns();
+  for (int column = columns; --column >= 0; ) {
+    for (int row = rows; --row > column; ) {
+      //if (A.getQuick(row,column) != 0) return false;
+      if (!(Math.abs(A.getQuick(row,column)) <= epsilon)) return false;
+    }
+  }
+  return true;
 }
 /**
  * A matrix <tt>A</tt> is <i>zero</i> if all its cells are zero.
  */
 public boolean isZero(DoubleMatrix2D A) {
-	return equals(A,0);
+  return equals(A,0);
 }
 /**
 The <i>lower bandwidth</i> of a square matrix <tt>A</tt> is the maximum <tt>i-j</tt> for which <tt>A[i,j]</tt> is nonzero and <tt>i &gt; j</tt>.
@@ -749,18 +749,18 @@
 @see #upperBandwidth(DoubleMatrix2D)
 */
 public int lowerBandwidth(DoubleMatrix2D A) {
-	checkSquare(A);
-	double epsilon = tolerance();
-	int rows = A.rows();
+  checkSquare(A);
+  double epsilon = tolerance();
+  int rows = A.rows();
 
-	for (int k=rows; --k >= 0; ) {
-		for (int i = rows-k; --i >= 0; ) {
-			int j = i+k;
-			//if (A.getQuick(j,i) != 0) return k;
-			if (!(Math.abs(A.getQuick(j,i)) <= epsilon)) return k;
-		}
-	}
-	return 0;
+  for (int k=rows; --k >= 0; ) {
+    for (int i = rows-k; --i >= 0; ) {
+      int j = i+k;
+      //if (A.getQuick(j,i) != 0) return k;
+      if (!(Math.abs(A.getQuick(j,i)) <= epsilon)) return k;
+    }
+  }
+  return 0;
 }
 /**
 Returns the <i>semi-bandwidth</i> of the given square matrix <tt>A</tt>.
@@ -780,122 +780,122 @@
 Examples:
 <table border="1" cellspacing="0">
   <tr align="left" valign="top"> 
-	<td valign="middle" align="left"><tt>matrix</tt></td>
-	<td> <tt>4&nbsp;x&nbsp;4&nbsp;<br>
-	  0&nbsp;0&nbsp;0&nbsp;0<br>
-	  0&nbsp;0&nbsp;0&nbsp;0<br>
-	  0&nbsp;0&nbsp;0&nbsp;0<br>
-	  0&nbsp;0&nbsp;0&nbsp;0 </tt></td>
-	<td><tt>4&nbsp;x&nbsp;4<br>
-	  1&nbsp;0&nbsp;0&nbsp;0<br>
-	  0&nbsp;0&nbsp;0&nbsp;0<br>
-	  0&nbsp;0&nbsp;0&nbsp;0<br>
-	  0&nbsp;0&nbsp;0&nbsp;1 </tt></td>
-	<td><tt>4&nbsp;x&nbsp;4<br>
-	  1&nbsp;1&nbsp;0&nbsp;0<br>
-	  1&nbsp;1&nbsp;1&nbsp;0<br>
-	  0&nbsp;1&nbsp;1&nbsp;1<br>
-	  0&nbsp;0&nbsp;1&nbsp;1 </tt></td>
-	<td><tt> 4&nbsp;x&nbsp;4<br>
-	  0&nbsp;1&nbsp;1&nbsp;1<br>
-	  0&nbsp;1&nbsp;1&nbsp;1<br>
-	  0&nbsp;0&nbsp;0&nbsp;1<br>
-	  0&nbsp;0&nbsp;0&nbsp;1 </tt></td>
-	<td><tt> 4&nbsp;x&nbsp;4<br>
-	  0&nbsp;0&nbsp;0&nbsp;0<br>
-	  1&nbsp;1&nbsp;0&nbsp;0<br>
-	  1&nbsp;1&nbsp;0&nbsp;0<br>
-	  1&nbsp;1&nbsp;1&nbsp;1 </tt></td>
-	<td><tt>4&nbsp;x&nbsp;4<br>
-	  1&nbsp;1&nbsp;0&nbsp;0<br>
-	  0&nbsp;1&nbsp;1&nbsp;0<br>
-	  0&nbsp;1&nbsp;0&nbsp;1<br>
-	  1&nbsp;0&nbsp;1&nbsp;1 </tt><tt> </tt> </td>
-	<td><tt>4&nbsp;x&nbsp;4<br>
-	  1&nbsp;1&nbsp;1&nbsp;0<br>
-	  0&nbsp;1&nbsp;0&nbsp;0<br>
-	  1&nbsp;1&nbsp;0&nbsp;1<br>
-	  0&nbsp;0&nbsp;1&nbsp;1 </tt> </td>
+  <td valign="middle" align="left"><tt>matrix</tt></td>
+  <td> <tt>4&nbsp;x&nbsp;4&nbsp;<br>
+    0&nbsp;0&nbsp;0&nbsp;0<br>
+    0&nbsp;0&nbsp;0&nbsp;0<br>
+    0&nbsp;0&nbsp;0&nbsp;0<br>
+    0&nbsp;0&nbsp;0&nbsp;0 </tt></td>
+  <td><tt>4&nbsp;x&nbsp;4<br>
+    1&nbsp;0&nbsp;0&nbsp;0<br>
+    0&nbsp;0&nbsp;0&nbsp;0<br>
+    0&nbsp;0&nbsp;0&nbsp;0<br>
+    0&nbsp;0&nbsp;0&nbsp;1 </tt></td>
+  <td><tt>4&nbsp;x&nbsp;4<br>
+    1&nbsp;1&nbsp;0&nbsp;0<br>
+    1&nbsp;1&nbsp;1&nbsp;0<br>
+    0&nbsp;1&nbsp;1&nbsp;1<br>
+    0&nbsp;0&nbsp;1&nbsp;1 </tt></td>
+  <td><tt> 4&nbsp;x&nbsp;4<br>
+    0&nbsp;1&nbsp;1&nbsp;1<br>
+    0&nbsp;1&nbsp;1&nbsp;1<br>
+    0&nbsp;0&nbsp;0&nbsp;1<br>
+    0&nbsp;0&nbsp;0&nbsp;1 </tt></td>
+  <td><tt> 4&nbsp;x&nbsp;4<br>
+    0&nbsp;0&nbsp;0&nbsp;0<br>
+    1&nbsp;1&nbsp;0&nbsp;0<br>
+    1&nbsp;1&nbsp;0&nbsp;0<br>
+    1&nbsp;1&nbsp;1&nbsp;1 </tt></td>
+  <td><tt>4&nbsp;x&nbsp;4<br>
+    1&nbsp;1&nbsp;0&nbsp;0<br>
+    0&nbsp;1&nbsp;1&nbsp;0<br>
+    0&nbsp;1&nbsp;0&nbsp;1<br>
+    1&nbsp;0&nbsp;1&nbsp;1 </tt><tt> </tt> </td>
+  <td><tt>4&nbsp;x&nbsp;4<br>
+    1&nbsp;1&nbsp;1&nbsp;0<br>
+    0&nbsp;1&nbsp;0&nbsp;0<br>
+    1&nbsp;1&nbsp;0&nbsp;1<br>
+    0&nbsp;0&nbsp;1&nbsp;1 </tt> </td>
   </tr>
   <tr align="center" valign="middle"> 
-	<td><tt>upperBandwidth</tt></td>
-	<td> 
-	  <div align="center"><tt>0</tt></div>
-	</td>
-	<td> 
-	  <div align="center"><tt>0</tt></div>
-	</td>
-	<td> 
-	  <div align="center"><tt>1</tt></div>
-	</td>
-	<td><tt>3</tt></td>
-	<td align="center" valign="middle"><tt>0</tt></td>
-	<td align="center" valign="middle"> 
-	  <div align="center"><tt>1</tt></div>
-	</td>
-	<td align="center" valign="middle"> 
-	  <div align="center"><tt>2</tt></div>
-	</td>
+  <td><tt>upperBandwidth</tt></td>
+  <td> 
+    <div align="center"><tt>0</tt></div>
+  </td>
+  <td> 
+    <div align="center"><tt>0</tt></div>
+  </td>
+  <td> 
+    <div align="center"><tt>1</tt></div>
+  </td>
+  <td><tt>3</tt></td>
+  <td align="center" valign="middle"><tt>0</tt></td>
+  <td align="center" valign="middle"> 
+    <div align="center"><tt>1</tt></div>
+  </td>
+  <td align="center" valign="middle"> 
+    <div align="center"><tt>2</tt></div>
+  </td>
   </tr>
   <tr align="center" valign="middle"> 
-	<td><tt>lowerBandwidth</tt></td>
-	<td> 
-	  <div align="center"><tt>0</tt></div>
-	</td>
-	<td> 
-	  <div align="center"><tt>0</tt></div>
-	</td>
-	<td> 
-	  <div align="center"><tt>1</tt></div>
-	</td>
-	<td><tt>0</tt></td>
-	<td align="center" valign="middle"><tt>3</tt></td>
-	<td align="center" valign="middle"> 
-	  <div align="center"><tt>3</tt></div>
-	</td>
-	<td align="center" valign="middle"> 
-	  <div align="center"><tt>2</tt></div>
-	</td>
+  <td><tt>lowerBandwidth</tt></td>
+  <td> 
+    <div align="center"><tt>0</tt></div>
+  </td>
+  <td> 
+    <div align="center"><tt>0</tt></div>
+  </td>
+  <td> 
+    <div align="center"><tt>1</tt></div>
+  </td>
+  <td><tt>0</tt></td>
+  <td align="center" valign="middle"><tt>3</tt></td>
+  <td align="center" valign="middle"> 
+    <div align="center"><tt>3</tt></div>
+  </td>
+  <td align="center" valign="middle"> 
+    <div align="center"><tt>2</tt></div>
+  </td>
   </tr>
   <tr align="center" valign="middle"> 
-	<td><tt>semiBandwidth</tt></td>
-	<td> 
-	  <div align="center"><tt>1</tt></div>
-	</td>
-	<td> 
-	  <div align="center"><tt>1</tt></div>
-	</td>
-	<td> 
-	  <div align="center"><tt>2</tt></div>
-	</td>
-	<td><tt>4</tt></td>
-	<td align="center" valign="middle"><tt>4</tt></td>
-	<td align="center" valign="middle"> 
-	  <div align="center"><tt>4</tt></div>
-	</td>
-	<td align="center" valign="middle"> 
-	  <div align="center"><tt>3</tt></div>
-	</td>
+  <td><tt>semiBandwidth</tt></td>
+  <td> 
+    <div align="center"><tt>1</tt></div>
+  </td>
+  <td> 
+    <div align="center"><tt>1</tt></div>
+  </td>
+  <td> 
+    <div align="center"><tt>2</tt></div>
+  </td>
+  <td><tt>4</tt></td>
+  <td align="center" valign="middle"><tt>4</tt></td>
+  <td align="center" valign="middle"> 
+    <div align="center"><tt>4</tt></div>
+  </td>
+  <td align="center" valign="middle"> 
+    <div align="center"><tt>3</tt></div>
+  </td>
   </tr>
   <tr align="center" valign="middle"> 
-	<td><tt>description</tt></td>
-	<td> 
-	  <div align="center"><tt>zero</tt></div>
-	</td>
-	<td> 
-	  <div align="center"><tt>diagonal</tt></div>
-	</td>
-	<td> 
-	  <div align="center"><tt>tridiagonal</tt></div>
-	</td>
-	<td><tt>upper triangular</tt></td>
-	<td align="center" valign="middle"><tt>lower triangular</tt></td>
-	<td align="center" valign="middle"> 
-	  <div align="center"><tt>unstructured</tt></div>
-	</td>
-	<td align="center" valign="middle"> 
-	  <div align="center"><tt>unstructured</tt></div>
-	</td>
+  <td><tt>description</tt></td>
+  <td> 
+    <div align="center"><tt>zero</tt></div>
+  </td>
+  <td> 
+    <div align="center"><tt>diagonal</tt></div>
+  </td>
+  <td> 
+    <div align="center"><tt>tridiagonal</tt></div>
+  </td>
+  <td><tt>upper triangular</tt></td>
+  <td align="center" valign="middle"><tt>lower triangular</tt></td>
+  <td align="center" valign="middle"> 
+    <div align="center"><tt>unstructured</tt></div>
+  </td>
+  <td align="center" valign="middle"> 
+    <div align="center"><tt>unstructured</tt></div>
+  </td>
   </tr>
 </table>
 
@@ -906,37 +906,37 @@
 @see #upperBandwidth(DoubleMatrix2D)
 */
 public int semiBandwidth(DoubleMatrix2D A) {
-	checkSquare(A);
-	double epsilon = tolerance();
-	int rows = A.rows();
+  checkSquare(A);
+  double epsilon = tolerance();
+  int rows = A.rows();
 
-	for (int k=rows; --k >= 0; ) {
-		for (int i = rows-k; --i >= 0; ) {
-			int j = i+k;
-			//if (A.getQuick(j,i) != 0) return k+1;
-			//if (A.getQuick(i,j) != 0) return k+1;
-			if (!(Math.abs(A.getQuick(j,i)) <= epsilon)) return k+1;
-			if (!(Math.abs(A.getQuick(i,j)) <= epsilon)) return k+1;
-		}
-	}
-	return 1;
+  for (int k=rows; --k >= 0; ) {
+    for (int i = rows-k; --i >= 0; ) {
+      int j = i+k;
+      //if (A.getQuick(j,i) != 0) return k+1;
+      //if (A.getQuick(i,j) != 0) return k+1;
+      if (!(Math.abs(A.getQuick(j,i)) <= epsilon)) return k+1;
+      if (!(Math.abs(A.getQuick(i,j)) <= epsilon)) return k+1;
+    }
+  }
+  return 1;
 }
 /**
  * Sets the tolerance to <tt>Math.abs(newTolerance)</tt>.
  * @throws UnsupportedOperationException if <tt>this==DEFAULT || this==ZERO || this==TWELVE</tt>.
  */
 public void setTolerance(double newTolerance) {
-	if (this==DEFAULT || this==ZERO || this==TWELVE) {
-		throw new IllegalArgumentException("Attempted to modify immutable object."); 
-		//throw new UnsupportedOperationException("Attempted to modify object."); // since JDK1.2
-	}
-	tolerance = Math.abs(newTolerance);
+  if (this==DEFAULT || this==ZERO || this==TWELVE) {
+    throw new IllegalArgumentException("Attempted to modify immutable object."); 
+    //throw new UnsupportedOperationException("Attempted to modify object."); // since JDK1.2
+  }
+  tolerance = Math.abs(newTolerance);
 }
 /**
  * Returns the current tolerance.
  */
 public double tolerance() {
-	return tolerance;
+  return tolerance;
 }
 /**
 Returns summary information about the given matrix <tt>A</tt>.
@@ -973,154 +973,154 @@
 </pre>
 */
 public String toString(DoubleMatrix2D A) {
-	final org.apache.mahout.matrix.list.ObjectArrayList names = new org.apache.mahout.matrix.list.ObjectArrayList();
-	final org.apache.mahout.matrix.list.ObjectArrayList values = new org.apache.mahout.matrix.list.ObjectArrayList();
-	String unknown = "Illegal operation or error: ";
+  final org.apache.mahout.matrix.list.ObjectArrayList names = new org.apache.mahout.matrix.list.ObjectArrayList();
+  final org.apache.mahout.matrix.list.ObjectArrayList values = new org.apache.mahout.matrix.list.ObjectArrayList();
+  String unknown = "Illegal operation or error: ";
 
-	// determine properties
-	names.add("density");
-	try { values.add(String.valueOf(density(A)));} 
-	catch (IllegalArgumentException exc) { values.add(unknown+exc.getMessage()); }
-	
-	// determine properties
-	names.add("isDiagonal");
-	try { values.add(String.valueOf(isDiagonal(A)));} 
-	catch (IllegalArgumentException exc) { values.add(unknown+exc.getMessage()); }
-	
-	// determine properties
-	names.add("isDiagonallyDominantByRow");
-	try { values.add(String.valueOf(isDiagonallyDominantByRow(A)));} 
-	catch (IllegalArgumentException exc) { values.add(unknown+exc.getMessage()); }
-	
-	// determine properties
-	names.add("isDiagonallyDominantByColumn");
-	try { values.add(String.valueOf(isDiagonallyDominantByColumn(A)));} 
-	catch (IllegalArgumentException exc) { values.add(unknown+exc.getMessage()); }
-	
-	names.add("isIdentity");
-	try { values.add(String.valueOf(isIdentity(A)));} 
-	catch (IllegalArgumentException exc) { values.add(unknown+exc.getMessage()); }
-	
-	names.add("isLowerBidiagonal");
-	try { values.add(String.valueOf(isLowerBidiagonal(A)));} 
-	catch (IllegalArgumentException exc) { values.add(unknown+exc.getMessage()); }
-	
-	names.add("isLowerTriangular");
-	try { values.add(String.valueOf(isLowerTriangular(A)));} 
-	catch (IllegalArgumentException exc) { values.add(unknown+exc.getMessage()); }
-	
-	names.add("isNonNegative");
-	try { values.add(String.valueOf(isNonNegative(A)));} 
-	catch (IllegalArgumentException exc) { values.add(unknown+exc.getMessage()); }
-	
-	names.add("isOrthogonal");
-	try { values.add(String.valueOf(isOrthogonal(A)));} 
-	catch (IllegalArgumentException exc) { values.add(unknown+exc.getMessage()); }
-	
-	names.add("isPositive");
-	try { values.add(String.valueOf(isPositive(A)));} 
-	catch (IllegalArgumentException exc) { values.add(unknown+exc.getMessage()); }
-	
-	names.add("isSingular");
-	try { values.add(String.valueOf(isSingular(A)));} 
-	catch (IllegalArgumentException exc) { values.add(unknown+exc.getMessage()); }
-	
-	names.add("isSkewSymmetric");
-	try { values.add(String.valueOf(isSkewSymmetric(A)));} 
-	catch (IllegalArgumentException exc) { values.add(unknown+exc.getMessage()); }
-	
-	names.add("isSquare");
-	try { values.add(String.valueOf(isSquare(A)));} 
-	catch (IllegalArgumentException exc) { values.add(unknown+exc.getMessage()); }
-	
-	names.add("isStrictlyLowerTriangular");
-	try { values.add(String.valueOf(isStrictlyLowerTriangular(A)));} 
-	catch (IllegalArgumentException exc) { values.add(unknown+exc.getMessage()); }
-	
-	names.add("isStrictlyTriangular");
-	try { values.add(String.valueOf(isStrictlyTriangular(A)));} 
-	catch (IllegalArgumentException exc) { values.add(unknown+exc.getMessage()); }
-	
-	names.add("isStrictlyUpperTriangular");
-	try { values.add(String.valueOf(isStrictlyUpperTriangular(A)));} 
-	catch (IllegalArgumentException exc) { values.add(unknown+exc.getMessage()); }
-	
-	names.add("isSymmetric");
-	try { values.add(String.valueOf(isSymmetric(A)));} 
-	catch (IllegalArgumentException exc) { values.add(unknown+exc.getMessage()); }
-	
-	names.add("isTriangular");
-	try { values.add(String.valueOf(isTriangular(A)));} 
-	catch (IllegalArgumentException exc) { values.add(unknown+exc.getMessage()); }
-	
-	names.add("isTridiagonal");
-	try { values.add(String.valueOf(isTridiagonal(A)));} 
-	catch (IllegalArgumentException exc) { values.add(unknown+exc.getMessage()); }
-	
-	names.add("isUnitTriangular");
-	try { values.add(String.valueOf(isUnitTriangular(A)));} 
-	catch (IllegalArgumentException exc) { values.add(unknown+exc.getMessage()); }
-	
-	names.add("isUpperBidiagonal");
-	try { values.add(String.valueOf(isUpperBidiagonal(A)));} 
-	catch (IllegalArgumentException exc) { values.add(unknown+exc.getMessage()); }
-	
-	names.add("isUpperTriangular");
-	try { values.add(String.valueOf(isUpperTriangular(A)));} 
-	catch (IllegalArgumentException exc) { values.add(unknown+exc.getMessage()); }
-		
-	names.add("isZero");
-	try { values.add(String.valueOf(isZero(A))); }
-	catch (IllegalArgumentException exc) { values.add(unknown+exc.getMessage()); }
+  // determine properties
+  names.add("density");
+  try { values.add(String.valueOf(density(A)));} 
+  catch (IllegalArgumentException exc) { values.add(unknown+exc.getMessage()); }
+  
+  // determine properties
+  names.add("isDiagonal");
+  try { values.add(String.valueOf(isDiagonal(A)));} 
+  catch (IllegalArgumentException exc) { values.add(unknown+exc.getMessage()); }
+  
+  // determine properties
+  names.add("isDiagonallyDominantByRow");
+  try { values.add(String.valueOf(isDiagonallyDominantByRow(A)));} 
+  catch (IllegalArgumentException exc) { values.add(unknown+exc.getMessage()); }
+  
+  // determine properties
+  names.add("isDiagonallyDominantByColumn");
+  try { values.add(String.valueOf(isDiagonallyDominantByColumn(A)));} 
+  catch (IllegalArgumentException exc) { values.add(unknown+exc.getMessage()); }
+  
+  names.add("isIdentity");
+  try { values.add(String.valueOf(isIdentity(A)));} 
+  catch (IllegalArgumentException exc) { values.add(unknown+exc.getMessage()); }
+  
+  names.add("isLowerBidiagonal");
+  try { values.add(String.valueOf(isLowerBidiagonal(A)));} 
+  catch (IllegalArgumentException exc) { values.add(unknown+exc.getMessage()); }
+  
+  names.add("isLowerTriangular");
+  try { values.add(String.valueOf(isLowerTriangular(A)));} 
+  catch (IllegalArgumentException exc) { values.add(unknown+exc.getMessage()); }
+  
+  names.add("isNonNegative");
+  try { values.add(String.valueOf(isNonNegative(A)));} 
+  catch (IllegalArgumentException exc) { values.add(unknown+exc.getMessage()); }
+  
+  names.add("isOrthogonal");
+  try { values.add(String.valueOf(isOrthogonal(A)));} 
+  catch (IllegalArgumentException exc) { values.add(unknown+exc.getMessage()); }
+  
+  names.add("isPositive");
+  try { values.add(String.valueOf(isPositive(A)));} 
+  catch (IllegalArgumentException exc) { values.add(unknown+exc.getMessage()); }
+  
+  names.add("isSingular");
+  try { values.add(String.valueOf(isSingular(A)));} 
+  catch (IllegalArgumentException exc) { values.add(unknown+exc.getMessage()); }
+  
+  names.add("isSkewSymmetric");
+  try { values.add(String.valueOf(isSkewSymmetric(A)));} 
+  catch (IllegalArgumentException exc) { values.add(unknown+exc.getMessage()); }
+  
+  names.add("isSquare");
+  try { values.add(String.valueOf(isSquare(A)));} 
+  catch (IllegalArgumentException exc) { values.add(unknown+exc.getMessage()); }
+  
+  names.add("isStrictlyLowerTriangular");
+  try { values.add(String.valueOf(isStrictlyLowerTriangular(A)));} 
+  catch (IllegalArgumentException exc) { values.add(unknown+exc.getMessage()); }
+  
+  names.add("isStrictlyTriangular");
+  try { values.add(String.valueOf(isStrictlyTriangular(A)));} 
+  catch (IllegalArgumentException exc) { values.add(unknown+exc.getMessage()); }
+  
+  names.add("isStrictlyUpperTriangular");
+  try { values.add(String.valueOf(isStrictlyUpperTriangular(A)));} 
+  catch (IllegalArgumentException exc) { values.add(unknown+exc.getMessage()); }
+  
+  names.add("isSymmetric");
+  try { values.add(String.valueOf(isSymmetric(A)));} 
+  catch (IllegalArgumentException exc) { values.add(unknown+exc.getMessage()); }
+  
+  names.add("isTriangular");
+  try { values.add(String.valueOf(isTriangular(A)));} 
+  catch (IllegalArgumentException exc) { values.add(unknown+exc.getMessage()); }
+  
+  names.add("isTridiagonal");
+  try { values.add(String.valueOf(isTridiagonal(A)));} 
+  catch (IllegalArgumentException exc) { values.add(unknown+exc.getMessage()); }
+  
+  names.add("isUnitTriangular");
+  try { values.add(String.valueOf(isUnitTriangular(A)));} 
+  catch (IllegalArgumentException exc) { values.add(unknown+exc.getMessage()); }
+  
+  names.add("isUpperBidiagonal");
+  try { values.add(String.valueOf(isUpperBidiagonal(A)));} 
+  catch (IllegalArgumentException exc) { values.add(unknown+exc.getMessage()); }
+  
+  names.add("isUpperTriangular");
+  try { values.add(String.valueOf(isUpperTriangular(A)));} 
+  catch (IllegalArgumentException exc) { values.add(unknown+exc.getMessage()); }
+    
+  names.add("isZero");
+  try { values.add(String.valueOf(isZero(A))); }
+  catch (IllegalArgumentException exc) { values.add(unknown+exc.getMessage()); }
 
-	names.add("lowerBandwidth");
-	try { values.add(String.valueOf(lowerBandwidth(A))); }
-	catch (IllegalArgumentException exc) { values.add(unknown+exc.getMessage()); }
+  names.add("lowerBandwidth");
+  try { values.add(String.valueOf(lowerBandwidth(A))); }
+  catch (IllegalArgumentException exc) { values.add(unknown+exc.getMessage()); }
 
-	names.add("semiBandwidth");
-	try { values.add(String.valueOf(semiBandwidth(A))); }
-	catch (IllegalArgumentException exc) { values.add(unknown+exc.getMessage()); }
+  names.add("semiBandwidth");
+  try { values.add(String.valueOf(semiBandwidth(A))); }
+  catch (IllegalArgumentException exc) { values.add(unknown+exc.getMessage()); }
 
-	names.add("upperBandwidth");
-	try { values.add(String.valueOf(upperBandwidth(A))); }
-	catch (IllegalArgumentException exc) { values.add(unknown+exc.getMessage()); }
+  names.add("upperBandwidth");
+  try { values.add(String.valueOf(upperBandwidth(A))); }
+  catch (IllegalArgumentException exc) { values.add(unknown+exc.getMessage()); }
 
-	
-	// sort ascending by property name
-	org.apache.mahout.matrix.function.IntComparator comp = new org.apache.mahout.matrix.function.IntComparator() {
-		public int compare(int a, int b) {
-			return get(names,a).compareTo(get(names,b));
-		}
-	};
-	org.apache.mahout.matrix.Swapper swapper = new org.apache.mahout.matrix.Swapper() {
-		public void swap(int a, int b) {
-			Object tmp;
-			tmp = names.get(a); names.set(a,names.get(b)); names.set(b,tmp);
-			tmp = values.get(a); values.set(a,values.get(b)); values.set(b,tmp);
-		}
-	};	
-	org.apache.mahout.matrix.GenericSorting.quickSort(0,names.size(),comp,swapper);
-	
-	// determine padding for nice formatting
-	int maxLength = 0;
-	for (int i = 0; i < names.size(); i++) {
-		int length = ((String) names.get(i)).length();
-		maxLength = Math.max(length, maxLength);
-	}
+  
+  // sort ascending by property name
+  org.apache.mahout.matrix.function.IntComparator comp = new org.apache.mahout.matrix.function.IntComparator() {
+    public int compare(int a, int b) {
+      return get(names,a).compareTo(get(names,b));
+    }
+  };
+  org.apache.mahout.matrix.Swapper swapper = new org.apache.mahout.matrix.Swapper() {
+    public void swap(int a, int b) {
+      Object tmp;
+      tmp = names.get(a); names.set(a,names.get(b)); names.set(b,tmp);
+      tmp = values.get(a); values.set(a,values.get(b)); values.set(b,tmp);
+    }
+  };  
+  org.apache.mahout.matrix.GenericSorting.quickSort(0,names.size(),comp,swapper);
+  
+  // determine padding for nice formatting
+  int maxLength = 0;
+  for (int i = 0; i < names.size(); i++) {
+    int length = ((String) names.get(i)).length();
+    maxLength = Math.max(length, maxLength);
+  }
 
-	// finally, format properties
-	StringBuffer buf = new StringBuffer();
-	for (int i = 0; i < names.size(); i++) {
-		String name = ((String) names.get(i));
-		buf.append(name);
-		buf.append(blanks(maxLength - name.length()));
-		buf.append(" : ");
-		buf.append(values.get(i));
-		if (i < names.size() - 1)
-			buf.append('\n');
-	}
-	
-	return buf.toString();
+  // finally, format properties
+  StringBuffer buf = new StringBuffer();
+  for (int i = 0; i < names.size(); i++) {
+    String name = ((String) names.get(i));
+    buf.append(name);
+    buf.append(blanks(maxLength - name.length()));
+    buf.append(" : ");
+    buf.append(values.get(i));
+    if (i < names.size() - 1)
+      buf.append('\n');
+  }
+  
+  return buf.toString();
 }
 /**
 The <i>upper bandwidth</i> of a square matrix <tt>A</tt> is the 
@@ -1135,17 +1135,17 @@
 @see #lowerBandwidth(DoubleMatrix2D)
 */
 public int upperBandwidth(DoubleMatrix2D A) {
-	checkSquare(A);
-	double epsilon = tolerance();
-	int rows = A.rows();
+  checkSquare(A);
+  double epsilon = tolerance();
+  int rows = A.rows();
 
-	for (int k=rows; --k >= 0; ) {
-		for (int i = rows-k; --i >= 0; ) {
-			int j = i+k;
-			//if (A.getQuick(i,j) != 0) return k;
-			if (!(Math.abs(A.getQuick(i,j)) <= epsilon)) return k;
-		}
-	}
-	return 0;
+  for (int k=rows; --k >= 0; ) {
+    for (int i = rows-k; --i >= 0; ) {
+      int j = i+k;
+      //if (A.getQuick(i,j) != 0) return k;
+      if (!(Math.abs(A.getQuick(i,j)) <= epsilon)) return k;
+    }
+  }
+  return 0;
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/SeqBlas.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/SeqBlas.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/SeqBlas.java	(working copy)
@@ -21,201 +21,201 @@
  */
 @Deprecated
 public class SeqBlas implements Blas {
-	/**
-	Little trick to allow for "aliasing", that is, renaming this class.
-	Time and again writing code like
-	<p>
-	<tt>SeqBlas.blas.dgemm(...);</tt>
-	<p>
-	is a bit awkward. Using the aliasing you can instead write
-	<p>
-	<tt>Blas B = SeqBlas.blas; <br>
-	B.dgemm(...);</tt>
-	*/
-	public static final Blas seqBlas = new SeqBlas();
-	
-	private static final org.apache.mahout.jet.math.Functions F = org.apache.mahout.jet.math.Functions.functions;
+  /**
+  Little trick to allow for "aliasing", that is, renaming this class.
+  Time and again writing code like
+  <p>
+  <tt>SeqBlas.blas.dgemm(...);</tt>
+  <p>
+  is a bit awkward. Using the aliasing you can instead write
+  <p>
+  <tt>Blas B = SeqBlas.blas; <br>
+  B.dgemm(...);</tt>
+  */
+  public static final Blas seqBlas = new SeqBlas();
+  
+  private static final org.apache.mahout.jet.math.Functions F = org.apache.mahout.jet.math.Functions.functions;
 /**
 Makes this class non instantiable, but still let's others inherit from it.
 */
 protected SeqBlas() {}
 public void assign(DoubleMatrix2D A, org.apache.mahout.matrix.function.DoubleFunction function) {
-	A.assign(function);
+  A.assign(function);
 }
 public void assign(DoubleMatrix2D A, DoubleMatrix2D B, org.apache.mahout.matrix.function.DoubleDoubleFunction function) {
-	A.assign(B,function);
+  A.assign(B,function);
 }
 public double dasum(DoubleMatrix1D x) {
-	return x.aggregate(F.plus, F.abs);
+  return x.aggregate(F.plus, F.abs);
 }
 public void daxpy(double alpha, DoubleMatrix1D x, DoubleMatrix1D y) {
-	y.assign(x,F.plusMult(alpha));
+  y.assign(x,F.plusMult(alpha));
 }
 public void daxpy(double alpha, DoubleMatrix2D A, DoubleMatrix2D B) {
-	B.assign(A, F.plusMult(alpha));
+  B.assign(A, F.plusMult(alpha));
 }
 public void dcopy(DoubleMatrix1D x, DoubleMatrix1D y) {
-	y.assign(x);
+  y.assign(x);
 }
 public void dcopy(DoubleMatrix2D A, DoubleMatrix2D B) {
-	B.assign(A);
+  B.assign(A);
 }
 public double ddot(DoubleMatrix1D x, DoubleMatrix1D y) {
-	return x.zDotProduct(y);
+  return x.zDotProduct(y);
 }
 public void dgemm(boolean transposeA, boolean transposeB, double alpha, DoubleMatrix2D A, DoubleMatrix2D B, double beta, DoubleMatrix2D C) {
-	A.zMult(B,C,alpha,beta,transposeA,transposeB);
+  A.zMult(B,C,alpha,beta,transposeA,transposeB);
 }
 public void dgemv(boolean transposeA, double alpha, DoubleMatrix2D A, DoubleMatrix1D x, double beta, DoubleMatrix1D y) {
-	A.zMult(x,y,alpha,beta,transposeA);
+  A.zMult(x,y,alpha,beta,transposeA);
 }
 public void dger(double alpha, DoubleMatrix1D x, DoubleMatrix1D y, DoubleMatrix2D A) {
-	org.apache.mahout.jet.math.PlusMult fun = org.apache.mahout.jet.math.PlusMult.plusMult(0);
-	for (int i=A.rows(); --i >= 0; ) {
-		fun.multiplicator = alpha * x.getQuick(i);
- 		A.viewRow(i).assign(y,fun);
-		
-	}
+  org.apache.mahout.jet.math.PlusMult fun = org.apache.mahout.jet.math.PlusMult.plusMult(0);
+  for (int i=A.rows(); --i >= 0; ) {
+    fun.multiplicator = alpha * x.getQuick(i);
+     A.viewRow(i).assign(y,fun);
+    
+  }
 }
 public double dnrm2(DoubleMatrix1D x) {
-	return Math.sqrt(Algebra.DEFAULT.norm2(x));
+  return Math.sqrt(Algebra.DEFAULT.norm2(x));
 }
 public void drot(DoubleMatrix1D x, DoubleMatrix1D y, double c, double s) {
-	x.checkSize(y);
-	DoubleMatrix1D tmp = x.copy();
-	
-	x.assign(F.mult(c));
-	x.assign(y,F.plusMult(s));
+  x.checkSize(y);
+  DoubleMatrix1D tmp = x.copy();
+  
+  x.assign(F.mult(c));
+  x.assign(y,F.plusMult(s));
 
-	y.assign(F.mult(c));
-	y.assign(tmp,F.minusMult(s));
+  y.assign(F.mult(c));
+  y.assign(tmp,F.minusMult(s));
 }
 public void drotg(double a, double b, double rotvec[]) {
-	double c,s,roe,scale,r,z,ra,rb;
+  double c,s,roe,scale,r,z,ra,rb;
 
-	roe = b;
+  roe = b;
 
-	if (Math.abs(a) > Math.abs(b)) roe = a;
+  if (Math.abs(a) > Math.abs(b)) roe = a;
 
-	scale = Math.abs(a) + Math.abs(b);
+  scale = Math.abs(a) + Math.abs(b);
 
-	if (scale != 0.0) {
+  if (scale != 0.0) {
 
-		ra = a/scale;
-		rb = b/scale;
-		r = scale*Math.sqrt(ra*ra + rb*rb);
-		r = sign(1.0,roe)*r;
-		c = a/r;
-		s = b/r;
-		z = 1.0;
-		if (Math.abs(a) > Math.abs(b)) z = s;
-		if ((Math.abs(b) >= Math.abs(a)) && (c != 0.0)) z = 1.0/c;
+    ra = a/scale;
+    rb = b/scale;
+    r = scale*Math.sqrt(ra*ra + rb*rb);
+    r = sign(1.0,roe)*r;
+    c = a/r;
+    s = b/r;
+    z = 1.0;
+    if (Math.abs(a) > Math.abs(b)) z = s;
+    if ((Math.abs(b) >= Math.abs(a)) && (c != 0.0)) z = 1.0/c;
 
-	} else {
+  } else {
 
-		c = 1.0;
-		s = 0.0;
-		r = 0.0;
-		z = 0.0;
+    c = 1.0;
+    s = 0.0;
+    r = 0.0;
+    z = 0.0;
 
-	}
+  }
 
-	a = r;
-	b = z;
+  a = r;
+  b = z;
 
-	rotvec[0] = a;
-	rotvec[1] = b;
-	rotvec[2] = c;
-	rotvec[3] = s;
+  rotvec[0] = a;
+  rotvec[1] = b;
+  rotvec[2] = c;
+  rotvec[3] = s;
 
 }
 public void dscal(double alpha, DoubleMatrix1D x) {
-	x.assign(F.mult(alpha));
+  x.assign(F.mult(alpha));
 }
 
 public void dscal(double alpha, DoubleMatrix2D A) {
-	A.assign(F.mult(alpha));
+  A.assign(F.mult(alpha));
 }
 
 public void dswap(DoubleMatrix1D x, DoubleMatrix1D y) {
-	y.swap(x);
+  y.swap(x);
 }
 public void dswap(DoubleMatrix2D A, DoubleMatrix2D B) {
-	//B.swap(A); not yet implemented
-	A.checkShape(B);
-	for(int i = A.rows(); --i >= 0;) A.viewRow(i).swap(B.viewRow(i));
+  //B.swap(A); not yet implemented
+  A.checkShape(B);
+  for(int i = A.rows(); --i >= 0;) A.viewRow(i).swap(B.viewRow(i));
 }
 public void dsymv(boolean isUpperTriangular, double alpha, DoubleMatrix2D A, DoubleMatrix1D x, double beta, DoubleMatrix1D y) {
-	if (isUpperTriangular) A = A.viewDice();
-	Property.DEFAULT.checkSquare(A);
-	int size = A.rows();
-	if (size != x.size() || size!=y.size()) {
-		throw new IllegalArgumentException(A.toStringShort() + ", " + x.toStringShort() + ", " + y.toStringShort());
-	}
-	DoubleMatrix1D tmp = x.like();
-	for (int i = 0; i < size; i++) {
-		double sum = 0;
-		for (int j = 0; j <= i; j++) {
-			sum += A.getQuick(i,j) * x.getQuick(j);
-		}
-		for (int j = i + 1; j < size; j++) {
-			sum += A.getQuick(j,i) * x.getQuick(j);
-		}
-		tmp.setQuick(i, alpha * sum + beta * y.getQuick(i));
-	}
-	y.assign(tmp);
+  if (isUpperTriangular) A = A.viewDice();
+  Property.DEFAULT.checkSquare(A);
+  int size = A.rows();
+  if (size != x.size() || size!=y.size()) {
+    throw new IllegalArgumentException(A.toStringShort() + ", " + x.toStringShort() + ", " + y.toStringShort());
+  }
+  DoubleMatrix1D tmp = x.like();
+  for (int i = 0; i < size; i++) {
+    double sum = 0;
+    for (int j = 0; j <= i; j++) {
+      sum += A.getQuick(i,j) * x.getQuick(j);
+    }
+    for (int j = i + 1; j < size; j++) {
+      sum += A.getQuick(j,i) * x.getQuick(j);
+    }
+    tmp.setQuick(i, alpha * sum + beta * y.getQuick(i));
+  }
+  y.assign(tmp);
 }
 public void dtrmv(boolean isUpperTriangular, boolean transposeA, boolean isUnitTriangular, DoubleMatrix2D A, DoubleMatrix1D x) {
-	if (transposeA) {
-		A = A.viewDice();
-		isUpperTriangular = !isUpperTriangular;
-	}
-	
-	Property.DEFAULT.checkSquare(A);
-	int size = A.rows();
-	if (size != x.size()) {
-		throw new IllegalArgumentException(A.toStringShort() + ", " + x.toStringShort());
-	}
-	    
-	DoubleMatrix1D b = x.like();
-	DoubleMatrix1D y = x.like();
-	if (isUnitTriangular) {
-		y.assign(1);
-	}
-	else {
-		for (int i = 0; i < size; i++) {
-			y.setQuick(i, A.getQuick(i,i));
-		}
-	}
-	
-	for (int i = 0; i < size; i++) {
-		double sum = 0;
-		if (!isUpperTriangular) {
-			for (int j = 0; j < i; j++) {
-				sum += A.getQuick(i,j) * x.getQuick(j);
-			}
-			sum += y.getQuick(i) * x.getQuick(i);
-		}
-		else {
-			sum += y.getQuick(i) * x.getQuick(i);
-			for (int j = i + 1; j < size; j++) {
-				sum += A.getQuick(i,j) * x.getQuick(j);			}
-		}
-		b.setQuick(i,sum);
-	}
-	x.assign(b);
+  if (transposeA) {
+    A = A.viewDice();
+    isUpperTriangular = !isUpperTriangular;
+  }
+  
+  Property.DEFAULT.checkSquare(A);
+  int size = A.rows();
+  if (size != x.size()) {
+    throw new IllegalArgumentException(A.toStringShort() + ", " + x.toStringShort());
+  }
+      
+  DoubleMatrix1D b = x.like();
+  DoubleMatrix1D y = x.like();
+  if (isUnitTriangular) {
+    y.assign(1);
+  }
+  else {
+    for (int i = 0; i < size; i++) {
+      y.setQuick(i, A.getQuick(i,i));
+    }
+  }
+  
+  for (int i = 0; i < size; i++) {
+    double sum = 0;
+    if (!isUpperTriangular) {
+      for (int j = 0; j < i; j++) {
+        sum += A.getQuick(i,j) * x.getQuick(j);
+      }
+      sum += y.getQuick(i) * x.getQuick(i);
+    }
+    else {
+      sum += y.getQuick(i) * x.getQuick(i);
+      for (int j = i + 1; j < size; j++) {
+        sum += A.getQuick(i,j) * x.getQuick(j);      }
+    }
+    b.setQuick(i,sum);
+  }
+  x.assign(b);
 }
 public int idamax(DoubleMatrix1D x) {
-	int maxIndex = -1;
-	double maxValue = Double.MIN_VALUE;
-	for (int i=x.size(); --i >= 0; ) {
-		double v = Math.abs(x.getQuick(i));
-		if (v > maxValue) {
-			maxValue = v;
-			maxIndex = i;
-		}
-	}
-	return maxIndex;
+  int maxIndex = -1;
+  double maxValue = Double.MIN_VALUE;
+  for (int i=x.size(); --i >= 0; ) {
+    double v = Math.abs(x.getQuick(i));
+    if (v > maxValue) {
+      maxValue = v;
+      maxIndex = i;
+    }
+  }
+  return maxIndex;
 }
 /**
 Implements the FORTRAN sign (not sin) function.
@@ -224,10 +224,10 @@
 @param  b   b
 */
 private double sign(double a, double b) {
-	if (b < 0.0) {
-		return -Math.abs(a);
-	} else {
-		return Math.abs(a);      
-	}
+  if (b < 0.0) {
+    return -Math.abs(a);
+  } else {
+    return Math.abs(a);      
+  }
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/Algebra.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/Algebra.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/linalg/Algebra.java	(working copy)
@@ -14,63 +14,61 @@
 /**
  * Linear algebraic matrix operations operating on {@link DoubleMatrix2D}; concentrates most functionality of this package.
  *
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 09/24/99
  */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
  */
 @Deprecated
 public class Algebra extends org.apache.mahout.matrix.PersistentObject {
-	/**
-	 * A default Algebra object; has {@link Property#DEFAULT} attached for tolerance. 
-	 * Allows ommiting to construct an Algebra object time and again.
-	 * 
-	 * Note that this Algebra object is immutable.
-	 * Any attempt to assign a new Property object to it (via method <tt>setProperty</tt>), or to alter the tolerance of its property object (via <tt>property().setTolerance(...)</tt>) will throw an exception.
-	 */
-	public static final Algebra DEFAULT;
+  /**
+   * A default Algebra object; has {@link Property#DEFAULT} attached for tolerance. 
+   * Allows ommiting to construct an Algebra object time and again.
+   * 
+   * Note that this Algebra object is immutable.
+   * Any attempt to assign a new Property object to it (via method <tt>setProperty</tt>), or to alter the tolerance of its property object (via <tt>property().setTolerance(...)</tt>) will throw an exception.
+   */
+  public static final Algebra DEFAULT;
 
-	/**
-	 * A default Algebra object; has {@link Property#ZERO} attached for tolerance. 
-	 * Allows ommiting to construct an Algebra object time and again.
-	 * 
-	 * Note that this Algebra object is immutable.
-	 * Any attempt to assign a new Property object to it (via method <tt>setProperty</tt>), or to alter the tolerance of its property object (via <tt>property().setTolerance(...)</tt>) will throw an exception.
-	 */
-	public static final Algebra ZERO;
+  /**
+   * A default Algebra object; has {@link Property#ZERO} attached for tolerance. 
+   * Allows ommiting to construct an Algebra object time and again.
+   * 
+   * Note that this Algebra object is immutable.
+   * Any attempt to assign a new Property object to it (via method <tt>setProperty</tt>), or to alter the tolerance of its property object (via <tt>property().setTolerance(...)</tt>) will throw an exception.
+   */
+  public static final Algebra ZERO;
 
-	/**
-	 * The property object attached to this instance.
-	 */	
-	protected Property property;
+  /**
+   * The property object attached to this instance.
+   */  
+  protected Property property;
 
-	static {
-		 // don't use new Algebra(Property.DEFAULT.tolerance()), because then property object would be mutable.
-		 DEFAULT = new Algebra();
-		 DEFAULT.property = Property.DEFAULT; // immutable property object
-		 
-		 ZERO = new Algebra();
-		 ZERO.property = Property.ZERO; // immutable property object
-	}
+  static {
+     // don't use new Algebra(Property.DEFAULT.tolerance()), because then property object would be mutable.
+     DEFAULT = new Algebra();
+     DEFAULT.property = Property.DEFAULT; // immutable property object
+     
+     ZERO = new Algebra();
+     ZERO.property = Property.ZERO; // immutable property object
+  }
 /**
  * Constructs a new instance with an equality tolerance given by <tt>Property.DEFAULT.tolerance()</tt>.
  */
 public Algebra() {
-	this(Property.DEFAULT.tolerance());
+  this(Property.DEFAULT.tolerance());
 }
 /**
  * Constructs a new instance with the given equality tolerance.
  * @param tolerance the tolerance to be used for equality operations.
  */
 public Algebra(double tolerance) {
-	setProperty(new Property(tolerance));
+  setProperty(new Property(tolerance));
 }
 /**
  * Constructs and returns the cholesky-decomposition of the given matrix.
  */
 private CholeskyDecomposition chol(DoubleMatrix2D matrix) {
-	return new CholeskyDecomposition(matrix);
+  return new CholeskyDecomposition(matrix);
 }
 /**
  * Returns a copy of the receiver.
@@ -79,71 +77,71 @@
  * @return a copy of the receiver.
  */
 public Object clone() {
-	return new Algebra(property.tolerance());
+  return new Algebra(property.tolerance());
 }
 /**
  * Returns the condition of matrix <tt>A</tt>, which is the ratio of largest to smallest singular value.
  */
 public double cond(DoubleMatrix2D A) {
-	return svd(A).cond();
+  return svd(A).cond();
 }
 /**
  * Returns the determinant of matrix <tt>A</tt>.
  * @return the determinant.
  */
 public double det(DoubleMatrix2D A) {
-	return lu(A).det();
+  return lu(A).det();
 }
 /**
  * Constructs and returns the Eigenvalue-decomposition of the given matrix.
  */
 private EigenvalueDecomposition eig(DoubleMatrix2D matrix) {
-	return new EigenvalueDecomposition(matrix);
+  return new EigenvalueDecomposition(matrix);
 }
 /**
  * Returns sqrt(a^2 + b^2) without under/overflow.
  */
 protected static double hypot(double a, double b) {
-	double r;
-	if (Math.abs(a) > Math.abs(b)) {
-		r = b/a;
-		r = Math.abs(a)*Math.sqrt(1+r*r);
-	} else if (b != 0) {
-		r = a/b;
-		r = Math.abs(b)*Math.sqrt(1+r*r);
-	} else {
-		r = 0.0;
-	}
-	return r;
+  double r;
+  if (Math.abs(a) > Math.abs(b)) {
+    r = b/a;
+    r = Math.abs(a)*Math.sqrt(1+r*r);
+  } else if (b != 0) {
+    r = a/b;
+    r = Math.abs(b)*Math.sqrt(1+r*r);
+  } else {
+    r = 0.0;
+  }
+  return r;
 }
 /**
  * Returns sqrt(a^2 + b^2) without under/overflow.
  */
 protected static org.apache.mahout.matrix.function.DoubleDoubleFunction hypotFunction() {
-	return new org.apache.mahout.matrix.function.DoubleDoubleFunction() {
-		public final double apply(double a, double b) {
-			return hypot(a,b);
-		}
-	};
+  return new org.apache.mahout.matrix.function.DoubleDoubleFunction() {
+    public final double apply(double a, double b) {
+      return hypot(a,b);
+    }
+  };
 }
 /**
  * Returns the inverse or pseudo-inverse of matrix <tt>A</tt>.
  * @return a new independent matrix; inverse(matrix) if the matrix is square, pseudoinverse otherwise.
  */
 public DoubleMatrix2D inverse(DoubleMatrix2D A) {
-	if (property.isSquare(A) && property.isDiagonal(A)) {
-		DoubleMatrix2D inv = A.copy();
-		boolean isNonSingular = Diagonal.inverse(inv);
-		if (!isNonSingular) throw new IllegalArgumentException("A is singular.");
-		return inv;
-	}
-	return solve(A, DoubleFactory2D.dense.identity(A.rows()));
+  if (property.isSquare(A) && property.isDiagonal(A)) {
+    DoubleMatrix2D inv = A.copy();
+    boolean isNonSingular = Diagonal.inverse(inv);
+    if (!isNonSingular) throw new IllegalArgumentException("A is singular.");
+    return inv;
+  }
+  return solve(A, DoubleFactory2D.dense.identity(A.rows()));
 }
 /**
  * Constructs and returns the LU-decomposition of the given matrix.
  */
 private LUDecomposition lu(DoubleMatrix2D matrix) {
-	return new LUDecomposition(matrix);
+  return new LUDecomposition(matrix);
 }
 /**
  * Inner product of two vectors; <tt>Sum(x[i] * y[i])</tt>.
@@ -158,7 +156,7 @@
  * @throws IllegalArgumentException if <tt>x.size() != y.size()</tt>.
  */
 public double mult(DoubleMatrix1D x, DoubleMatrix1D y) {
-	return x.zDotProduct(y);
+  return x.zDotProduct(y);
 }
 /**
  * Linear algebraic matrix-vector multiplication; <tt>z = A * y</tt>.
@@ -170,7 +168,7 @@
  * @throws IllegalArgumentException if <tt>A.columns() != y.size()</tt>.
  */
 public DoubleMatrix1D mult(DoubleMatrix2D A, DoubleMatrix1D y) {
-	return A.zMult(y,null);
+  return A.zMult(y,null);
 }
 /**
  * Linear algebraic matrix-matrix multiplication; <tt>C = A x B</tt>.
@@ -185,7 +183,7 @@
  * @throws IllegalArgumentException if <tt>B.rows() != A.columns()</tt>.
  */
 public DoubleMatrix2D mult(DoubleMatrix2D A, DoubleMatrix2D B) {
-	return A.zMult(B,null);
+  return A.zMult(B,null);
 }
 /**
  * Outer product of two vectors; Sets <tt>A[i,j] = x[i] * y[j]</tt>.
@@ -194,80 +192,80 @@
  * @param y the second source vector.
  * @param A the matrix to hold the results. Set this parameter to <tt>null</tt> to indicate that a new result matrix shall be constructed.
  * @return A (for convenience only).
- * @throws IllegalArgumentException	if <tt>A.rows() != x.size() || A.columns() != y.size()</tt>.
+ * @throws IllegalArgumentException  if <tt>A.rows() != x.size() || A.columns() != y.size()</tt>.
  */
 public DoubleMatrix2D multOuter(DoubleMatrix1D x, DoubleMatrix1D y, DoubleMatrix2D A) {
-	int rows = x.size();
-	int columns = y.size();
-	if (A==null) A = x.like2D(rows,columns);
-	if (A.rows() != rows || A.columns() != columns) throw new IllegalArgumentException();
-	
-	for (int row = rows; --row >= 0; ) A.viewRow(row).assign(y);
-	
-	for (int column = columns; --column >= 0; ) A.viewColumn(column).assign(x, org.apache.mahout.jet.math.Functions.mult);
-	return A;
+  int rows = x.size();
+  int columns = y.size();
+  if (A==null) A = x.like2D(rows,columns);
+  if (A.rows() != rows || A.columns() != columns) throw new IllegalArgumentException();
+  
+  for (int row = rows; --row >= 0; ) A.viewRow(row).assign(y);
+  
+  for (int column = columns; --column >= 0; ) A.viewColumn(column).assign(x, org.apache.mahout.jet.math.Functions.mult);
+  return A;
 }
 /**
  * Returns the one-norm of vector <tt>x</tt>, which is <tt>Sum(abs(x[i]))</tt>.
  */
 public double norm1(DoubleMatrix1D x) {
-	if (x.size()==0) return 0;
-	return x.aggregate(org.apache.mahout.jet.math.Functions.plus, org.apache.mahout.jet.math.Functions.abs);
+  if (x.size()==0) return 0;
+  return x.aggregate(org.apache.mahout.jet.math.Functions.plus, org.apache.mahout.jet.math.Functions.abs);
 }
 /**
  * Returns the one-norm of matrix <tt>A</tt>, which is the maximum absolute column sum.
  */
 public double norm1(DoubleMatrix2D A) {
-	double max = 0;
-	for (int column = A.columns(); --column >=0; ) {
-		max = Math.max(max, norm1(A.viewColumn(column)));
-	}
-	return max;
+  double max = 0;
+  for (int column = A.columns(); --column >=0; ) {
+    max = Math.max(max, norm1(A.viewColumn(column)));
+  }
+  return max;
 }
 /**
  * Returns the two-norm (aka <i>euclidean norm</i>) of vector <tt>x</tt>; equivalent to <tt>mult(x,x)</tt>.
  */
 public double norm2(DoubleMatrix1D x) {
-	return mult(x,x);
+  return mult(x,x);
 }
 /**
  * Returns the two-norm of matrix <tt>A</tt>, which is the maximum singular value; obtained from SVD.
  */
 public double norm2(DoubleMatrix2D A) {
-	return svd(A).norm2();
+  return svd(A).norm2();
 }
 /**
  * Returns the Frobenius norm of matrix <tt>A</tt>, which is <tt>Sqrt(Sum(A[i,j]<sup>2</sup>))</tt>.
  */
 public double normF(DoubleMatrix2D A) {
-	if (A.size()==0) return 0;
-	return A.aggregate(hypotFunction(), org.apache.mahout.jet.math.Functions.identity);
+  if (A.size()==0) return 0;
+  return A.aggregate(hypotFunction(), org.apache.mahout.jet.math.Functions.identity);
 }
 /**
  * Returns the infinity norm of vector <tt>x</tt>, which is <tt>Max(abs(x[i]))</tt>.
  */
 public double normInfinity(DoubleMatrix1D x) {
-	// fix for bug reported by T.J.Hunt@open.ac.uk
-	if (x.size()==0) return 0;
-	return x.aggregate(org.apache.mahout.jet.math.Functions.max , org.apache.mahout.jet.math.Functions.abs);
-//	if (x.size()==0) return 0;
-//	return x.aggregate(org.apache.mahout.jet.math.Functions.plus,org.apache.mahout.jet.math.Functions.abs);
-//	double max = 0;
-//	for (int i = x.size(); --i >= 0; ) {
-//		max = Math.max(max, x.getQuick(i));
-//	}
-//	return max;
+  // fix for bug reported by T.J.Hunt@open.ac.uk
+  if (x.size()==0) return 0;
+  return x.aggregate(org.apache.mahout.jet.math.Functions.max , org.apache.mahout.jet.math.Functions.abs);
+//  if (x.size()==0) return 0;
+//  return x.aggregate(org.apache.mahout.jet.math.Functions.plus,org.apache.mahout.jet.math.Functions.abs);
+//  double max = 0;
+//  for (int i = x.size(); --i >= 0; ) {
+//    max = Math.max(max, x.getQuick(i));
+//  }
+//  return max;
 }
 /**
  * Returns the infinity norm of matrix <tt>A</tt>, which is the maximum absolute row sum.
  */
 public double normInfinity(DoubleMatrix2D A) {
-	double max = 0;
-	for (int row = A.rows(); --row >=0; ) {
-		//max = Math.max(max, normInfinity(A.viewRow(row)));
-		max = Math.max(max, norm1(A.viewRow(row)));
-	}
-	return max;
+  double max = 0;
+  for (int row = A.rows(); --row >=0; ) {
+    //max = Math.max(max, normInfinity(A.viewRow(row)));
+    max = Math.max(max, norm1(A.viewRow(row)));
+  }
+  return max;
 }
 /**
 Modifies the given vector <tt>A</tt> such that it is permuted as specified; Useful for pivoting.
@@ -290,28 +288,28 @@
 @param   indexes the permutation indexes, must satisfy <tt>indexes.length==A.size() && indexes[i] >= 0 && indexes[i] < A.size()</tt>;
 @param   work the working storage, must satisfy <tt>work.length >= A.size()</tt>; set <tt>work==null</tt> if you don't care about performance.
 @return the modified <tt>A</tt> (for convenience only).
-@throws	IndexOutOfBoundsException if <tt>indexes.length != A.size()</tt>.
+@throws  IndexOutOfBoundsException if <tt>indexes.length != A.size()</tt>.
 */
 public DoubleMatrix1D permute(DoubleMatrix1D A, int[] indexes, double[] work) {
-	// check validity
-	int size = A.size();
-	if (indexes.length != size) throw new IndexOutOfBoundsException("invalid permutation");
+  // check validity
+  int size = A.size();
+  if (indexes.length != size) throw new IndexOutOfBoundsException("invalid permutation");
 
-	/*
-	int i=size;
-	int a;
-	while (--i >= 0 && (a=indexes[i])==i) if (a < 0 || a >= size) throw new IndexOutOfBoundsException("invalid permutation");
-	if (i<0) return; // nothing to permute
-	*/
+  /*
+  int i=size;
+  int a;
+  while (--i >= 0 && (a=indexes[i])==i) if (a < 0 || a >= size) throw new IndexOutOfBoundsException("invalid permutation");
+  if (i<0) return; // nothing to permute
+  */
 
-	if (work==null || size > work.length) {
-		work = A.toArray();
-	}
-	else {
-		A.toArray(work);
-	}
-	for (int i=size; --i >= 0; ) A.setQuick(i, work[indexes[i]]);
-	return A;
+  if (work==null || size > work.length) {
+    work = A.toArray();
+  }
+  else {
+    A.toArray(work);
+  }
+  for (int i=size; --i >= 0; ) A.setQuick(i, work[indexes[i]]);
+  return A;
 }
 /**
 Constructs and returns a new row and column permuted <i>selection view</i> of matrix <tt>A</tt>; equivalent to {@link DoubleMatrix2D#viewSelection(int[],int[])}.
@@ -320,7 +318,7 @@
 @return the new permuted selection view.
 */
 public DoubleMatrix2D permute(DoubleMatrix2D A, int[] rowIndexes, int[] columnIndexes) {
-	return A.viewSelection(rowIndexes,columnIndexes);
+  return A.viewSelection(rowIndexes,columnIndexes);
 }
 /**
 Modifies the given matrix <tt>A</tt> such that it's columns are permuted as specified; Useful for pivoting.
@@ -330,10 +328,10 @@
 @param   indexes the permutation indexes, must satisfy <tt>indexes.length==A.columns() && indexes[i] >= 0 && indexes[i] < A.columns()</tt>;
 @param   work the working storage, must satisfy <tt>work.length >= A.columns()</tt>; set <tt>work==null</tt> if you don't care about performance.
 @return the modified <tt>A</tt> (for convenience only).
-@throws	IndexOutOfBoundsException if <tt>indexes.length != A.columns()</tt>.
+@throws  IndexOutOfBoundsException if <tt>indexes.length != A.columns()</tt>.
 */
 public DoubleMatrix2D permuteColumns(DoubleMatrix2D A, int[] indexes, int[] work) {
-	return permuteRows(A.viewDice(), indexes, work);
+  return permuteRows(A.viewDice(), indexes, work);
 }
 /**
 Modifies the given matrix <tt>A</tt> such that it's rows are permuted as specified; Useful for pivoting.
@@ -356,35 +354,35 @@
 @param   indexes the permutation indexes, must satisfy <tt>indexes.length==A.rows() && indexes[i] >= 0 && indexes[i] < A.rows()</tt>;
 @param   work the working storage, must satisfy <tt>work.length >= A.rows()</tt>; set <tt>work==null</tt> if you don't care about performance.
 @return the modified <tt>A</tt> (for convenience only).
-@throws	IndexOutOfBoundsException if <tt>indexes.length != A.rows()</tt>.
+@throws  IndexOutOfBoundsException if <tt>indexes.length != A.rows()</tt>.
 */
 public DoubleMatrix2D permuteRows(final DoubleMatrix2D A, int[] indexes, int[] work) {
-	// check validity
-	int size = A.rows();
-	if (indexes.length != size) throw new IndexOutOfBoundsException("invalid permutation");
+  // check validity
+  int size = A.rows();
+  if (indexes.length != size) throw new IndexOutOfBoundsException("invalid permutation");
 
-	/*
-	int i=size;
-	int a;
-	while (--i >= 0 && (a=indexes[i])==i) if (a < 0 || a >= size) throw new IndexOutOfBoundsException("invalid permutation");
-	if (i<0) return; // nothing to permute
-	*/
+  /*
+  int i=size;
+  int a;
+  while (--i >= 0 && (a=indexes[i])==i) if (a < 0 || a >= size) throw new IndexOutOfBoundsException("invalid permutation");
+  if (i<0) return; // nothing to permute
+  */
 
-	int columns = A.columns();
-	if (columns < size/10) { // quicker
-		double[] doubleWork = new double[size];
-		for (int j=A.columns(); --j >= 0; ) permute(A.viewColumn(j), indexes, doubleWork);
-		return A;
-	}
+  int columns = A.columns();
+  if (columns < size/10) { // quicker
+    double[] doubleWork = new double[size];
+    for (int j=A.columns(); --j >= 0; ) permute(A.viewColumn(j), indexes, doubleWork);
+    return A;
+  }
 
-	org.apache.mahout.matrix.Swapper swapper = new org.apache.mahout.matrix.Swapper() {
-		public void swap(int a, int b) {
-			A.viewRow(a).swap(A.viewRow(b));
-		}
-	};
+  org.apache.mahout.matrix.Swapper swapper = new org.apache.mahout.matrix.Swapper() {
+    public void swap(int a, int b) {
+      A.viewRow(a).swap(A.viewRow(b));
+    }
+  };
 
-	org.apache.mahout.matrix.GenericPermuting.permute(indexes, swapper, work, null);
-	return A;
+  org.apache.mahout.matrix.GenericPermuting.permute(indexes, swapper, work, null);
+  return A;
 }
 /**
  * Linear algebraic matrix power; <tt>B = A<sup>k</sup> <==> B = A*A*...*A</tt>.
@@ -401,60 +399,60 @@
  * @throws IllegalArgumentException if <tt>!property().isSquare(A)</tt>.
  */
 public DoubleMatrix2D pow(DoubleMatrix2D A, int p) {
-	// matrix multiplication based on log2 method: A*A*....*A is slow, ((A * A)^2)^2 * ... is faster
-	// allocates two auxiliary matrices as work space
+  // matrix multiplication based on log2 method: A*A*....*A is slow, ((A * A)^2)^2 * ... is faster
+  // allocates two auxiliary matrices as work space
 
-	Blas blas = SmpBlas.smpBlas; // for parallel matrix mult; if not initialized defaults to sequential blas
-	Property.DEFAULT.checkSquare(A);
-	if (p<0) {
-		A = inverse(A);
-		p = -p;
-	}
-	if (p==0) return DoubleFactory2D.dense.identity(A.rows());
-	DoubleMatrix2D T = A.like(); // temporary
-	if (p==1) return T.assign(A);  // safes one auxiliary matrix allocation
-	if (p==2) {
-		blas.dgemm(false,false,1,A,A,0,T); // mult(A,A); // safes one auxiliary matrix allocation
-		return T;
-	}
+  Blas blas = SmpBlas.smpBlas; // for parallel matrix mult; if not initialized defaults to sequential blas
+  Property.DEFAULT.checkSquare(A);
+  if (p<0) {
+    A = inverse(A);
+    p = -p;
+  }
+  if (p==0) return DoubleFactory2D.dense.identity(A.rows());
+  DoubleMatrix2D T = A.like(); // temporary
+  if (p==1) return T.assign(A);  // safes one auxiliary matrix allocation
+  if (p==2) {
+    blas.dgemm(false,false,1,A,A,0,T); // mult(A,A); // safes one auxiliary matrix allocation
+    return T;
+  }
 
-	int k = org.apache.mahout.matrix.bitvector.QuickBitVector.mostSignificantBit(p); // index of highest bit in state "true"
-	
-	/*
-	this is the naive version:
-	DoubleMatrix2D B = A.copy();
-	for (int i=0; i<p-1; i++) {
-		B = mult(B,A);
-	}
-	return B;
-	*/
+  int k = org.apache.mahout.matrix.bitvector.QuickBitVector.mostSignificantBit(p); // index of highest bit in state "true"
+  
+  /*
+  this is the naive version:
+  DoubleMatrix2D B = A.copy();
+  for (int i=0; i<p-1; i++) {
+    B = mult(B,A);
+  }
+  return B;
+  */
 
-	// here comes the optimized version:
-	//org.apache.mahout.matrix.Timer timer = new org.apache.mahout.matrix.Timer().start();
+  // here comes the optimized version:
+  //org.apache.mahout.matrix.Timer timer = new org.apache.mahout.matrix.Timer().start();
 
-	int i=0;
-	while (i<=k && (p & (1<<i)) == 0) { // while (bit i of p == false)
-		// A = mult(A,A); would allocate a lot of temporary memory
-		blas.dgemm(false,false,1,A,A,0,T); // A.zMult(A,T);
-		DoubleMatrix2D swap = A; A = T; T = swap; // swap A with T
-		i++;
-	}
+  int i=0;
+  while (i<=k && (p & (1<<i)) == 0) { // while (bit i of p == false)
+    // A = mult(A,A); would allocate a lot of temporary memory
+    blas.dgemm(false,false,1,A,A,0,T); // A.zMult(A,T);
+    DoubleMatrix2D swap = A; A = T; T = swap; // swap A with T
+    i++;
+  }
 
-	DoubleMatrix2D B = A.copy();
-	i++;
-	for (; i<=k; i++) {
-		// A = mult(A,A); would allocate a lot of temporary memory
-		blas.dgemm(false,false,1,A,A,0,T); // A.zMult(A,T);	
-		DoubleMatrix2D swap = A; A = T; T = swap; // swap A with T
+  DoubleMatrix2D B = A.copy();
+  i++;
+  for (; i<=k; i++) {
+    // A = mult(A,A); would allocate a lot of temporary memory
+    blas.dgemm(false,false,1,A,A,0,T); // A.zMult(A,T);  
+    DoubleMatrix2D swap = A; A = T; T = swap; // swap A with T
 
-		if ((p & (1<<i)) != 0) { // if (bit i of p == true)
-			// B = mult(B,A); would allocate a lot of temporary memory
-			blas.dgemm(false,false,1,B,A,0,T); // B.zMult(A,T);		
-			swap = B; B = T; T = swap; // swap B with T
-		}
-	}
-	//timer.stop().display();
-	return B;
+    if ((p & (1<<i)) != 0) { // if (bit i of p == true)
+      // B = mult(B,A); would allocate a lot of temporary memory
+      blas.dgemm(false,false,1,B,A,0,T); // B.zMult(A,T);    
+      swap = B; B = T; T = swap; // swap B with T
+    }
+  }
+  //timer.stop().display();
+  return B;
 }
 /**
  * Returns the property object attached to this Algebra, defining tolerance.
@@ -462,45 +460,45 @@
  * @see #setProperty(Property)
  */
 public Property property() {
-	return property;
+  return property;
 }
 /**
  * Constructs and returns the QR-decomposition of the given matrix.
  */
 private QRDecomposition qr(DoubleMatrix2D matrix) {
-	return new QRDecomposition(matrix);
+  return new QRDecomposition(matrix);
 }
 /**
  * Returns the effective numerical rank of matrix <tt>A</tt>, obtained from Singular Value Decomposition.
  */
 public int rank(DoubleMatrix2D A) {
-	return svd(A).rank();
+  return svd(A).rank();
 }
 /**
  * Attaches the given property object to this Algebra, defining tolerance.
  * @param the Property object to be attached.
- * @throws	UnsupportedOperationException if <tt>this==DEFAULT && property!=this.property()</tt> - The DEFAULT Algebra object is immutable.
- * @throws	UnsupportedOperationException if <tt>this==ZERO && property!=this.property()</tt> - The ZERO Algebra object is immutable.
+ * @throws  UnsupportedOperationException if <tt>this==DEFAULT && property!=this.property()</tt> - The DEFAULT Algebra object is immutable.
+ * @throws  UnsupportedOperationException if <tt>this==ZERO && property!=this.property()</tt> - The ZERO Algebra object is immutable.
  * @see #property
  */
 public void setProperty(Property property) { 
-	if (this==DEFAULT && property!=this.property) throw new IllegalArgumentException("Attempted to modify immutable object.");
-	if (this==ZERO && property!=this.property) throw new IllegalArgumentException("Attempted to modify immutable object.");
-	this.property = property;
+  if (this==DEFAULT && property!=this.property) throw new IllegalArgumentException("Attempted to modify immutable object.");
+  if (this==ZERO && property!=this.property) throw new IllegalArgumentException("Attempted to modify immutable object.");
+  this.property = property;
 }
 /**
  * Solves A*X = B.
  * @return X; a new independent matrix; solution if A is square, least squares solution otherwise.
  */
 public DoubleMatrix2D solve(DoubleMatrix2D A, DoubleMatrix2D B) {
-	return (A.rows() == A.columns() ? (lu(A).solve(B)) : (qr(A).solve(B)));
+  return (A.rows() == A.columns() ? (lu(A).solve(B)) : (qr(A).solve(B)));
 }
 /**
  * Solves X*A = B, which is also A'*X' = B'.
  * @return X; a new independent matrix; solution if A is square, least squares solution otherwise.
  */
 public DoubleMatrix2D solveTranspose(DoubleMatrix2D A, DoubleMatrix2D B) {
-	return solve(transpose(A), transpose(B));
+  return solve(transpose(A), transpose(B));
 }
 /**
  * Copies the columns of the indicated rows into a new sub matrix.
@@ -512,21 +510,21 @@
  * @param   columnFrom the index of the first column to copy (inclusive).
  * @param   columnTo the index of the last column to copy (inclusive).
  * @return  a new sub matrix; with <tt>sub.rows()==rowIndexes.length; sub.columns()==columnTo-columnFrom+1</tt>.
- * @throws	IndexOutOfBoundsException if <tt>columnFrom<0 || columnTo-columnFrom+1<0 || columnTo+1>matrix.columns() || for any row=rowIndexes[i]: row < 0 || row >= matrix.rows()</tt>.
+ * @throws  IndexOutOfBoundsException if <tt>columnFrom<0 || columnTo-columnFrom+1<0 || columnTo+1>matrix.columns() || for any row=rowIndexes[i]: row < 0 || row >= matrix.rows()</tt>.
  */
 private DoubleMatrix2D subMatrix(DoubleMatrix2D A, int[] rowIndexes, int columnFrom, int columnTo) {
-	int width = columnTo-columnFrom+1;
-	int rows = A.rows();
-	A = A.viewPart(0,columnFrom,rows,width);
-	DoubleMatrix2D sub = A.like(rowIndexes.length, width);
-	
-	for (int r = rowIndexes.length; --r >= 0; ) {
-		int row = rowIndexes[r];
-		if (row < 0 || row >= rows) 
-			throw new IndexOutOfBoundsException("Illegal Index");
-		sub.viewRow(r).assign(A.viewRow(row));
-	}
-	return sub;
+  int width = columnTo-columnFrom+1;
+  int rows = A.rows();
+  A = A.viewPart(0,columnFrom,rows,width);
+  DoubleMatrix2D sub = A.like(rowIndexes.length, width);
+  
+  for (int r = rowIndexes.length; --r >= 0; ) {
+    int row = rowIndexes[r];
+    if (row < 0 || row >= rows) 
+      throw new IndexOutOfBoundsException("Illegal Index");
+    sub.viewRow(r).assign(A.viewRow(row));
+  }
+  return sub;
 }
 /**
  * Copies the rows of the indicated columns into a new sub matrix.
@@ -538,22 +536,22 @@
  * @param   rowTo the index of the last row to copy (inclusive).
  * @param   columnIndexes the indexes of the columns to copy. May be unsorted.
  * @return  a new sub matrix; with <tt>sub.rows()==rowTo-rowFrom+1; sub.columns()==columnIndexes.length</tt>.
- * @throws	IndexOutOfBoundsException if <tt>rowFrom<0 || rowTo-rowFrom+1<0 || rowTo+1>matrix.rows() || for any col=columnIndexes[i]: col < 0 || col >= matrix.columns()</tt>.
+ * @throws  IndexOutOfBoundsException if <tt>rowFrom<0 || rowTo-rowFrom+1<0 || rowTo+1>matrix.rows() || for any col=columnIndexes[i]: col < 0 || col >= matrix.columns()</tt>.
  */
 private DoubleMatrix2D subMatrix(DoubleMatrix2D A, int rowFrom, int rowTo, int[] columnIndexes) {
-	if (rowTo-rowFrom >= A.rows()) throw new IndexOutOfBoundsException("Too many rows");
-	int height = rowTo-rowFrom+1;
-	int columns = A.columns();
-	A = A.viewPart(rowFrom,0,height,columns);
-	DoubleMatrix2D sub = A.like(height, columnIndexes.length);
-	
-	for (int c = columnIndexes.length; --c >= 0; ) {
-		int column = columnIndexes[c];
-		if (column < 0 || column >= columns)
-			throw new IndexOutOfBoundsException("Illegal Index");
-		sub.viewColumn(c).assign(A.viewColumn(column));
-	}
-	return sub;
+  if (rowTo-rowFrom >= A.rows()) throw new IndexOutOfBoundsException("Too many rows");
+  int height = rowTo-rowFrom+1;
+  int columns = A.columns();
+  A = A.viewPart(rowFrom,0,height,columns);
+  DoubleMatrix2D sub = A.like(height, columnIndexes.length);
+  
+  for (int c = columnIndexes.length; --c >= 0; ) {
+    int column = columnIndexes[c];
+    if (column < 0 || column >= columns)
+      throw new IndexOutOfBoundsException("Illegal Index");
+    sub.viewColumn(c).assign(A.viewColumn(column));
+  }
+  return sub;
 }
 /**
 Constructs and returns a new <i>sub-range view</i> which is the sub matrix <tt>A[fromRow..toRow,fromColumn..toColumn]</tt>.
@@ -566,16 +564,16 @@
 @param fromColumn   The index of the first column (inclusive).
 @param toColumn   The index of the last column (inclusive).
 @return a new sub-range view.
-@throws	IndexOutOfBoundsException if <tt>fromColumn<0 || toColumn-fromColumn+1<0 || toColumn>=A.columns() || fromRow<0 || toRow-fromRow+1<0 || toRow>=A.rows()</tt>
+@throws  IndexOutOfBoundsException if <tt>fromColumn<0 || toColumn-fromColumn+1<0 || toColumn>=A.columns() || fromRow<0 || toRow-fromRow+1<0 || toRow>=A.rows()</tt>
 */
 public DoubleMatrix2D subMatrix(DoubleMatrix2D A, int fromRow, int toRow, int fromColumn, int toColumn) {
-	return A.viewPart(fromRow, fromColumn, toRow-fromRow+1, toColumn-fromColumn+1);
+  return A.viewPart(fromRow, fromColumn, toRow-fromRow+1, toColumn-fromColumn+1);
 }
 /**
  * Constructs and returns the SingularValue-decomposition of the given matrix.
  */
 private SingularValueDecomposition svd(DoubleMatrix2D matrix) {
-	return new SingularValueDecomposition(matrix);
+  return new SingularValueDecomposition(matrix);
 }
 /**
 Returns a String with (propertyName, propertyValue) pairs.
@@ -593,79 +591,79 @@
 </pre>
 */
 public String toString(DoubleMatrix2D matrix) {
-	final org.apache.mahout.matrix.list.ObjectArrayList names = new org.apache.mahout.matrix.list.ObjectArrayList();
-	final org.apache.mahout.matrix.list.ObjectArrayList values = new org.apache.mahout.matrix.list.ObjectArrayList();
-	String unknown = "Illegal operation or error: ";
+  final org.apache.mahout.matrix.list.ObjectArrayList names = new org.apache.mahout.matrix.list.ObjectArrayList();
+  final org.apache.mahout.matrix.list.ObjectArrayList values = new org.apache.mahout.matrix.list.ObjectArrayList();
+  String unknown = "Illegal operation or error: ";
 
-	// determine properties
-	names.add("cond");
-	try { values.add(String.valueOf(cond(matrix)));} 
-	catch (IllegalArgumentException exc) { values.add(unknown+exc.getMessage()); }
-	
-	names.add("det");
-	try { values.add(String.valueOf(det(matrix)));} 
-	catch (IllegalArgumentException exc) { values.add(unknown+exc.getMessage()); }
-	
-	names.add("norm1");
-	try { values.add(String.valueOf(norm1(matrix)));} 
-	catch (IllegalArgumentException exc) { values.add(unknown+exc.getMessage()); }
-	
-	names.add("norm2");
-	try { values.add(String.valueOf(norm2(matrix)));} 
-	catch (IllegalArgumentException exc) { values.add(unknown+exc.getMessage()); }
-	
-	names.add("normF");
-	try { values.add(String.valueOf(normF(matrix)));} 
-	catch (IllegalArgumentException exc) { values.add(unknown+exc.getMessage()); }
-	
-	names.add("normInfinity");
-	try { values.add(String.valueOf(normInfinity(matrix)));} 
-	catch (IllegalArgumentException exc) { values.add(unknown+exc.getMessage()); }
-	
-	names.add("rank");
-	try { values.add(String.valueOf(rank(matrix)));} 
-	catch (IllegalArgumentException exc) { values.add(unknown+exc.getMessage()); }
-	
-	names.add("trace");
-	try { values.add(String.valueOf(trace(matrix)));} 
-	catch (IllegalArgumentException exc) { values.add(unknown+exc.getMessage()); }
-	
-	
-	// sort ascending by property name
-	org.apache.mahout.matrix.function.IntComparator comp = new org.apache.mahout.matrix.function.IntComparator() {
-		public int compare(int a, int b) {
-			return Property.get(names,a).compareTo(Property.get(names,b));
-		}
-	};
-	org.apache.mahout.matrix.Swapper swapper = new org.apache.mahout.matrix.Swapper() {
-		public void swap(int a, int b) {
-			Object tmp;
-			tmp = names.get(a); names.set(a,names.get(b)); names.set(b,tmp);
-			tmp = values.get(a); values.set(a,values.get(b)); values.set(b,tmp);
-		}
-	};	
-	org.apache.mahout.matrix.GenericSorting.quickSort(0,names.size(),comp,swapper);
-	
-	// determine padding for nice formatting
-	int maxLength = 0;
-	for (int i = 0; i < names.size(); i++) {
-		int length = ((String) names.get(i)).length();
-		maxLength = Math.max(length, maxLength);
-	}
+  // determine properties
+  names.add("cond");
+  try { values.add(String.valueOf(cond(matrix)));} 
+  catch (IllegalArgumentException exc) { values.add(unknown+exc.getMessage()); }
+  
+  names.add("det");
+  try { values.add(String.valueOf(det(matrix)));} 
+  catch (IllegalArgumentException exc) { values.add(unknown+exc.getMessage()); }
+  
+  names.add("norm1");
+  try { values.add(String.valueOf(norm1(matrix)));} 
+  catch (IllegalArgumentException exc) { values.add(unknown+exc.getMessage()); }
+  
+  names.add("norm2");
+  try { values.add(String.valueOf(norm2(matrix)));} 
+  catch (IllegalArgumentException exc) { values.add(unknown+exc.getMessage()); }
+  
+  names.add("normF");
+  try { values.add(String.valueOf(normF(matrix)));} 
+  catch (IllegalArgumentException exc) { values.add(unknown+exc.getMessage()); }
+  
+  names.add("normInfinity");
+  try { values.add(String.valueOf(normInfinity(matrix)));} 
+  catch (IllegalArgumentException exc) { values.add(unknown+exc.getMessage()); }
+  
+  names.add("rank");
+  try { values.add(String.valueOf(rank(matrix)));} 
+  catch (IllegalArgumentException exc) { values.add(unknown+exc.getMessage()); }
+  
+  names.add("trace");
+  try { values.add(String.valueOf(trace(matrix)));} 
+  catch (IllegalArgumentException exc) { values.add(unknown+exc.getMessage()); }
+  
+  
+  // sort ascending by property name
+  org.apache.mahout.matrix.function.IntComparator comp = new org.apache.mahout.matrix.function.IntComparator() {
+    public int compare(int a, int b) {
+      return Property.get(names,a).compareTo(Property.get(names,b));
+    }
+  };
+  org.apache.mahout.matrix.Swapper swapper = new org.apache.mahout.matrix.Swapper() {
+    public void swap(int a, int b) {
+      Object tmp;
+      tmp = names.get(a); names.set(a,names.get(b)); names.set(b,tmp);
+      tmp = values.get(a); values.set(a,values.get(b)); values.set(b,tmp);
+    }
+  };  
+  org.apache.mahout.matrix.GenericSorting.quickSort(0,names.size(),comp,swapper);
+  
+  // determine padding for nice formatting
+  int maxLength = 0;
+  for (int i = 0; i < names.size(); i++) {
+    int length = ((String) names.get(i)).length();
+    maxLength = Math.max(length, maxLength);
+  }
 
-	// finally, format properties
-	StringBuffer buf = new StringBuffer();
-	for (int i = 0; i < names.size(); i++) {
-		String name = ((String) names.get(i));
-		buf.append(name);
-		buf.append(Property.blanks(maxLength - name.length()));
-		buf.append(" : ");
-		buf.append(values.get(i));
-		if (i < names.size() - 1)
-			buf.append('\n');
-	}
-	
-	return buf.toString();
+  // finally, format properties
+  StringBuffer buf = new StringBuffer();
+  for (int i = 0; i < names.size(); i++) {
+    String name = ((String) names.get(i));
+    buf.append(name);
+    buf.append(Property.blanks(maxLength - name.length()));
+    buf.append(" : ");
+    buf.append(values.get(i));
+    if (i < names.size() - 1)
+      buf.append('\n');
+  }
+  
+  return buf.toString();
 }
 /**
 Returns the results of <tt>toString(A)</tt> and additionally the results of all sorts of decompositions applied to the given matrix.
@@ -815,70 +813,70 @@
 */
 public String toVerboseString(DoubleMatrix2D matrix) {
 /*
-	StringBuffer buf = new StringBuffer();
-	String unknown = "Illegal operation or error: ";
-	String constructionException = "Illegal operation or error upon construction: ";
+  StringBuffer buf = new StringBuffer();
+  String unknown = "Illegal operation or error: ";
+  String constructionException = "Illegal operation or error upon construction: ";
 
-	buf.append("------------------------------------------------------------------\n");
-	buf.append("LUDecomposition(A) --> isNonSingular, det, pivot, L, U, inverse(A)\n");
-	buf.append("------------------------------------------------------------------\n");
+  buf.append("------------------------------------------------------------------\n");
+  buf.append("LUDecomposition(A) --> isNonSingular, det, pivot, L, U, inverse(A)\n");
+  buf.append("------------------------------------------------------------------\n");
 */
 
-	String constructionException = "Illegal operation or error upon construction of ";
-	StringBuffer buf = new StringBuffer();
+  String constructionException = "Illegal operation or error upon construction of ";
+  StringBuffer buf = new StringBuffer();
 
-	buf.append("A = ");
-	buf.append(matrix);
+  buf.append("A = ");
+  buf.append(matrix);
 
-	buf.append("\n\n" + toString(matrix));
-	buf.append("\n\n" + Property.DEFAULT.toString(matrix));
-	
-	LUDecomposition lu = null;
-	try { lu = new LUDecomposition(matrix); }
-	catch (IllegalArgumentException exc) { 
-		buf.append("\n\n"+constructionException+" LUDecomposition: "+exc.getMessage()); 
-	}
-	if (lu!=null) buf.append("\n\n"+lu.toString());
+  buf.append("\n\n" + toString(matrix));
+  buf.append("\n\n" + Property.DEFAULT.toString(matrix));
+  
+  LUDecomposition lu = null;
+  try { lu = new LUDecomposition(matrix); }
+  catch (IllegalArgumentException exc) { 
+    buf.append("\n\n"+constructionException+" LUDecomposition: "+exc.getMessage()); 
+  }
+  if (lu!=null) buf.append("\n\n"+lu.toString());
 
-	QRDecomposition qr = null;
-	try { qr = new QRDecomposition(matrix); }
-	catch (IllegalArgumentException exc) { 
-		buf.append("\n\n"+constructionException+" QRDecomposition: "+exc.getMessage()); 
-	}
-	if (qr!=null) buf.append("\n\n"+qr.toString());
+  QRDecomposition qr = null;
+  try { qr = new QRDecomposition(matrix); }
+  catch (IllegalArgumentException exc) { 
+    buf.append("\n\n"+constructionException+" QRDecomposition: "+exc.getMessage()); 
+  }
+  if (qr!=null) buf.append("\n\n"+qr.toString());
 
-	CholeskyDecomposition chol = null;
-	try { chol = new CholeskyDecomposition(matrix); }
-	catch (IllegalArgumentException exc) { 
-		buf.append("\n\n"+constructionException+" CholeskyDecomposition: "+exc.getMessage()); 
-	}
-	if (chol!=null) buf.append("\n\n"+chol.toString());
+  CholeskyDecomposition chol = null;
+  try { chol = new CholeskyDecomposition(matrix); }
+  catch (IllegalArgumentException exc) { 
+    buf.append("\n\n"+constructionException+" CholeskyDecomposition: "+exc.getMessage()); 
+  }
+  if (chol!=null) buf.append("\n\n"+chol.toString());
 
-	EigenvalueDecomposition eig = null;
-	try { eig = new EigenvalueDecomposition(matrix); }
-	catch (IllegalArgumentException exc) { 
-		buf.append("\n\n"+constructionException+" EigenvalueDecomposition: "+exc.getMessage()); 
-	}
-	if (eig!=null) buf.append("\n\n"+eig.toString());
+  EigenvalueDecomposition eig = null;
+  try { eig = new EigenvalueDecomposition(matrix); }
+  catch (IllegalArgumentException exc) { 
+    buf.append("\n\n"+constructionException+" EigenvalueDecomposition: "+exc.getMessage()); 
+  }
+  if (eig!=null) buf.append("\n\n"+eig.toString());
 
-	SingularValueDecomposition svd = null;
-	try { svd = new SingularValueDecomposition(matrix); }
-	catch (IllegalArgumentException exc) { 
-		buf.append("\n\n"+constructionException+" SingularValueDecomposition: "+exc.getMessage()); 
-	}
-	if (svd!=null) buf.append("\n\n"+svd.toString());
+  SingularValueDecomposition svd = null;
+  try { svd = new SingularValueDecomposition(matrix); }
+  catch (IllegalArgumentException exc) { 
+    buf.append("\n\n"+constructionException+" SingularValueDecomposition: "+exc.getMessage()); 
+  }
+  if (svd!=null) buf.append("\n\n"+svd.toString());
 
-	return buf.toString();
+  return buf.toString();
 }
 /**
  * Returns the sum of the diagonal elements of matrix <tt>A</tt>; <tt>Sum(A[i,i])</tt>.
  */
 public double trace(DoubleMatrix2D A) {
-	double sum = 0;
-	for (int i=Math.min(A.rows(),A.columns()); --i >= 0;) {
-		sum += A.getQuick(i,i);
-	}
-	return sum;
+  double sum = 0;
+  for (int i=Math.min(A.rows(),A.columns()); --i >= 0;) {
+    sum += A.getQuick(i,i);
+  }
+  return sum;
 }
 /**
 Constructs and returns a new view which is the transposition of the given matrix <tt>A</tt>.
@@ -890,24 +888,24 @@
 <b>Example:</b> 
 <table border="0">
   <tr nowrap> 
-	<td valign="top">2 x 3 matrix: <br>
-	  1, 2, 3<br>
-	  4, 5, 6 </td>
-	<td>transpose ==></td>
-	<td valign="top">3 x 2 matrix:<br>
-	  1, 4 <br>
-	  2, 5 <br>
-	  3, 6</td>
-	<td>transpose ==></td>
-	<td valign="top">2 x 3 matrix: <br>
-	  1, 2, 3<br>
-	  4, 5, 6 </td>
+  <td valign="top">2 x 3 matrix: <br>
+    1, 2, 3<br>
+    4, 5, 6 </td>
+  <td>transpose ==></td>
+  <td valign="top">3 x 2 matrix:<br>
+    1, 4 <br>
+    2, 5 <br>
+    3, 6</td>
+  <td>transpose ==></td>
+  <td valign="top">2 x 3 matrix: <br>
+    1, 2, 3<br>
+    4, 5, 6 </td>
   </tr>
 </table>
 @return a new transposed view. 
 */
 public DoubleMatrix2D transpose(DoubleMatrix2D A) {
-	return A.viewDice();
+  return A.viewDice();
 }
 /**
 Modifies the matrix to be a lower trapezoidal matrix.
@@ -915,14 +913,14 @@
 @see #triangulateLower(DoubleMatrix2D)
 */
 protected DoubleMatrix2D trapezoidalLower(DoubleMatrix2D A) {
-	int rows = A.rows();
-	int columns = A.columns();
-	for (int r = rows; --r >= 0; ) {
-		for (int c = columns; --c >= 0; ) {
-			if (r < c) A.setQuick(r,c, 0);
-		}
-	}
-	return A;
+  int rows = A.rows();
+  int columns = A.columns();
+  for (int r = rows; --r >= 0; ) {
+    for (int c = columns; --c >= 0; ) {
+      if (r < c) A.setQuick(r,c, 0);
+    }
+  }
+  return A;
 }
 /**
  * Outer product of two vectors; Returns a matrix with <tt>A[i,j] = x[i] * y[j]</tt>.
@@ -932,9 +930,9 @@
  * @return the outer product </tt>A</tt>.
  */
 private DoubleMatrix2D xmultOuter(DoubleMatrix1D x, DoubleMatrix1D y) {
-	DoubleMatrix2D A = x.like2D(x.size(),y.size());
-	multOuter(x,y,A);
-	return A;
+  DoubleMatrix2D A = x.like2D(x.size(),y.size());
+  multOuter(x,y,A);
+  return A;
 }
 /**
  * Linear algebraic matrix power; <tt>B = A<sup>k</sup> <==> B = A*A*...*A</tt>.
@@ -945,12 +943,12 @@
  * @throws IllegalArgumentException if <tt>!Testing.isSquare(A)</tt>.
  */
 private DoubleMatrix2D xpowSlow(DoubleMatrix2D A, int k) {
-	//org.apache.mahout.matrix.Timer timer = new org.apache.mahout.matrix.Timer().start();
-	DoubleMatrix2D result = A.copy();
-	for (int i=0; i<k-1; i++) {
-		result = mult(result,A);
-	}
-	//timer.stop().display();
-	return result;
+  //org.apache.mahout.matrix.Timer timer = new org.apache.mahout.matrix.Timer().start();
+  DoubleMatrix2D result = A.copy();
+  for (int i=0; i<k-1; i++) {
+    result = mult(result,A);
+  }
+  //timer.stop().display();
+  return result;
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/DoubleMatrix3D.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/DoubleMatrix3D.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/DoubleMatrix3D.java	(working copy)
@@ -60,18 +60,18 @@
 @see org.apache.mahout.jet.math.Functions
 */
 public double aggregate(org.apache.mahout.matrix.function.DoubleDoubleFunction aggr, org.apache.mahout.matrix.function.DoubleFunction f) {
-	if (size()==0) return Double.NaN;
-	double a = f.apply(getQuick(slices-1,rows-1,columns-1));
-	int d = 1; // last cell already done
-	for (int slice=slices; --slice >= 0; ) {
-		for (int row=rows; --row >= 0; ) {
-			for (int column=columns-d; --column >= 0; ) {
-				a = aggr.apply(a, f.apply(getQuick(slice,row,column)));
-			}
-			d = 0;
-		}
-	}
-	return a;
+  if (size()==0) return Double.NaN;
+  double a = f.apply(getQuick(slices-1,rows-1,columns-1));
+  int d = 1; // last cell already done
+  for (int slice=slices; --slice >= 0; ) {
+    for (int row=rows; --row >= 0; ) {
+      for (int column=columns-d; --column >= 0; ) {
+        a = aggr.apply(a, f.apply(getQuick(slice,row,column)));
+      }
+      d = 0;
+    }
+  }
+  return a;
 }
 /**
 Applies a function to each corresponding cell of two matrices and aggregates the results.
@@ -107,23 +107,23 @@
 @param aggr an aggregation function taking as first argument the current aggregation and as second argument the transformed current cell values.
 @param f a function transforming the current cell values.
 @return the aggregated measure.
-@throws	IllegalArgumentException if <tt>slices() != other.slices() || rows() != other.rows() || columns() != other.columns()</tt>
+@throws  IllegalArgumentException if <tt>slices() != other.slices() || rows() != other.rows() || columns() != other.columns()</tt>
 @see org.apache.mahout.jet.math.Functions
 */
 public double aggregate(DoubleMatrix3D other, org.apache.mahout.matrix.function.DoubleDoubleFunction aggr, org.apache.mahout.matrix.function.DoubleDoubleFunction f) {
-	checkShape(other);
-	if (size()==0) return Double.NaN;
-	double a = f.apply(getQuick(slices-1,rows-1,columns-1),other.getQuick(slices-1,rows-1,columns-1));
-	int d = 1; // last cell already done
-	for (int slice=slices; --slice >= 0; ) {
-		for (int row=rows; --row >= 0; ) {
-			for (int column=columns-d; --column >= 0; ) {
-				a = aggr.apply(a, f.apply(getQuick(slice,row,column), other.getQuick(slice,row,column)));
-			}
-			d = 0;
-		}
-	}
-	return a;
+  checkShape(other);
+  if (size()==0) return Double.NaN;
+  double a = f.apply(getQuick(slices-1,rows-1,columns-1),other.getQuick(slices-1,rows-1,columns-1));
+  int d = 1; // last cell already done
+  for (int slice=slices; --slice >= 0; ) {
+    for (int row=rows; --row >= 0; ) {
+      for (int column=columns-d; --column >= 0; ) {
+        a = aggr.apply(a, f.apply(getQuick(slice,row,column), other.getQuick(slice,row,column)));
+      }
+      d = 0;
+    }
+  }
+  return a;
 }
 /**
  * Sets all cells to the state specified by <tt>values</tt>.
@@ -138,19 +138,19 @@
  * @throws IllegalArgumentException if <tt>for any 0 &lt;= column &lt; columns(): values[slice][row].length != columns()</tt>.
  */
 public DoubleMatrix3D assign(double[][][] values) {
-	if (values.length != slices) throw new IllegalArgumentException("Must have same number of slices: slices="+values.length+"slices()="+slices());
-	for (int slice=slices; --slice >= 0;) {
-		double[][] currentSlice = values[slice];
-		if (currentSlice.length != rows) throw new IllegalArgumentException("Must have same number of rows in every slice: rows="+currentSlice.length+"rows()="+rows());
-		for (int row=rows; --row >= 0;) {
-			double[] currentRow = currentSlice[row];
-			if (currentRow.length != columns) throw new IllegalArgumentException("Must have same number of columns in every row: columns="+currentRow.length+"columns()="+columns());
-			for (int column=columns; --column >= 0;) {
-				setQuick(slice,row,column,currentRow[column]);
-			}
-		}
-	}
-	return this;
+  if (values.length != slices) throw new IllegalArgumentException("Must have same number of slices: slices="+values.length+"slices()="+slices());
+  for (int slice=slices; --slice >= 0;) {
+    double[][] currentSlice = values[slice];
+    if (currentSlice.length != rows) throw new IllegalArgumentException("Must have same number of rows in every slice: rows="+currentSlice.length+"rows()="+rows());
+    for (int row=rows; --row >= 0;) {
+      double[] currentRow = currentSlice[row];
+      if (currentRow.length != columns) throw new IllegalArgumentException("Must have same number of columns in every row: columns="+currentRow.length+"columns()="+columns());
+      for (int column=columns; --column >= 0;) {
+        setQuick(slice,row,column,currentRow[column]);
+      }
+    }
+  }
+  return this;
 }
 /**
  * Sets all cells to the state specified by <tt>value</tt>.
@@ -158,14 +158,14 @@
  * @return <tt>this</tt> (for convenience only).
  */
 public DoubleMatrix3D assign(double value) {
-	for (int slice=slices; --slice >= 0;) {
-		for (int row=rows; --row >= 0;) {
-			for (int column=columns; --column >= 0;) {
-				setQuick(slice,row,column,value);
-			}
-		}
-	}
-	return this;
+  for (int slice=slices; --slice >= 0;) {
+    for (int row=rows; --row >= 0;) {
+      for (int column=columns; --column >= 0;) {
+        setQuick(slice,row,column,value);
+      }
+    }
+  }
+  return this;
 }
 /**
 Assigns the result of a function to each cell; <tt>x[slice,row,col] = function(x[slice,row,col])</tt>.
@@ -190,14 +190,14 @@
 @see org.apache.mahout.jet.math.Functions
 */
 public DoubleMatrix3D assign(org.apache.mahout.matrix.function.DoubleFunction function) {
-	for (int slice=slices; --slice >= 0; ) {
-		for (int row=rows; --row >= 0; ) {
-			for (int column=columns; --column >= 0; ) {
-				setQuick(slice,row,column, function.apply(getQuick(slice,row,column)));
-			}
-		}
-	}
-	return this;
+  for (int slice=slices; --slice >= 0; ) {
+    for (int row=rows; --row >= 0; ) {
+      for (int column=columns; --column >= 0; ) {
+        setQuick(slice,row,column, function.apply(getQuick(slice,row,column)));
+      }
+    }
+  }
+  return this;
 }
 /**
  * Replaces all cell values of the receiver with the values of another matrix.
@@ -206,21 +206,21 @@
  *
  * @param     other   the source matrix to copy from (may be identical to the receiver).
  * @return <tt>this</tt> (for convenience only).
- * @throws	IllegalArgumentException if <tt>slices() != other.slices() || rows() != other.rows() || columns() != other.columns()</tt>
+ * @throws  IllegalArgumentException if <tt>slices() != other.slices() || rows() != other.rows() || columns() != other.columns()</tt>
  */
 public DoubleMatrix3D assign(DoubleMatrix3D other) {
-	if (other==this) return this;
-	checkShape(other);
-	if (haveSharedCells(other)) other = other.copy();
-	
-	for (int slice=slices; --slice >= 0;) {
-		for (int row=rows; --row >= 0;) {
-			for (int column=columns; --column >= 0;) {
-				setQuick(slice,row,column,other.getQuick(slice,row,column));
-			}
-		}
-	}
-	return this;
+  if (other==this) return this;
+  checkShape(other);
+  if (haveSharedCells(other)) other = other.copy();
+  
+  for (int slice=slices; --slice >= 0;) {
+    for (int row=rows; --row >= 0;) {
+      for (int column=columns; --column >= 0;) {
+        setQuick(slice,row,column,other.getQuick(slice,row,column));
+      }
+    }
+  }
+  return this;
 }
 /**
 Assigns the result of a function to each cell; <tt>x[row,col] = function(x[row,col],y[row,col])</tt>.
@@ -248,33 +248,33 @@
 @param function a function object taking as first argument the current cell's value of <tt>this</tt>,
 and as second argument the current cell's value of <tt>y</tt>,
 @return <tt>this</tt> (for convenience only).
-@throws	IllegalArgumentException if <tt>slices() != other.slices() || rows() != other.rows() || columns() != other.columns()</tt>
+@throws  IllegalArgumentException if <tt>slices() != other.slices() || rows() != other.rows() || columns() != other.columns()</tt>
 @see org.apache.mahout.jet.math.Functions
 */
 public DoubleMatrix3D assign(DoubleMatrix3D y, org.apache.mahout.matrix.function.DoubleDoubleFunction function) {
-	checkShape(y);
-	for (int slice=slices; --slice >= 0; ) {
-		for (int row=rows; --row >= 0; ) {
-			for (int column=columns; --column >= 0; ) {
-				setQuick(slice,row,column, function.apply(getQuick(slice,row,column), y.getQuick(slice,row,column)));
-			}
-		}
-	}
-	return this;
+  checkShape(y);
+  for (int slice=slices; --slice >= 0; ) {
+    for (int row=rows; --row >= 0; ) {
+      for (int column=columns; --column >= 0; ) {
+        setQuick(slice,row,column, function.apply(getQuick(slice,row,column), y.getQuick(slice,row,column)));
+      }
+    }
+  }
+  return this;
 }
 /**
  * Returns the number of cells having non-zero values; ignores tolerance.
  */
 public int cardinality() {
-	int cardinality = 0;
-	for (int slice=slices; --slice >= 0;) {
-		for (int row=rows; --row >= 0;) {
-			for (int column=columns; --column >= 0;) {
-				if (getQuick(slice,row,column) != 0) cardinality++;
-			}
-		}
-	}
-	return cardinality;
+  int cardinality = 0;
+  for (int slice=slices; --slice >= 0;) {
+    for (int row=rows; --row >= 0;) {
+      for (int column=columns; --column >= 0;) {
+        if (getQuick(slice,row,column) != 0) cardinality++;
+      }
+    }
+  }
+  return cardinality;
 }
 /**
  * Constructs and returns a deep copy of the receiver.
@@ -285,7 +285,7 @@
  * @return  a deep copy of the receiver.
  */
 public DoubleMatrix3D copy() {
-	return like().assign(this);
+  return like().assign(this);
 }
 /**
  * Returns whether all cells are equal to the given value.
@@ -294,7 +294,7 @@
  * @return    <tt>true</tt> if all cells are equal to the given value, <tt>false</tt> otherwise.
  */
 public boolean equals(double value) {
-	return org.apache.mahout.matrix.matrix.linalg.Property.DEFAULT.equals(this,value);
+  return org.apache.mahout.matrix.matrix.linalg.Property.DEFAULT.equals(this,value);
 }
 /**
  * Compares this object against the specified object.
@@ -307,11 +307,11 @@
  *          <code>false</code> otherwise.
  */
 public boolean equals(Object obj) {
-	if (this == obj) return true;
-	if (obj == null) return false;
-	if (!(obj instanceof DoubleMatrix3D)) return false;
+  if (this == obj) return true;
+  if (obj == null) return false;
+  if (!(obj instanceof DoubleMatrix3D)) return false;
 
-	return org.apache.mahout.matrix.matrix.linalg.Property.DEFAULT.equals(this,(DoubleMatrix3D) obj);
+  return org.apache.mahout.matrix.matrix.linalg.Property.DEFAULT.equals(this,(DoubleMatrix3D) obj);
 }
 /**
  * Returns the matrix cell value at coordinate <tt>[slice,row,column]</tt>.
@@ -320,18 +320,18 @@
  * @param     row   the index of the row-coordinate.
  * @param     column   the index of the column-coordinate.
  * @return    the value of the specified cell.
- * @throws	IndexOutOfBoundsException if <tt>slice&lt;0 || slice&gt;=slices() || row&lt;0 || row&gt;=rows() || column&lt;0 || column&gt;=column()</tt>.
+ * @throws  IndexOutOfBoundsException if <tt>slice&lt;0 || slice&gt;=slices() || row&lt;0 || row&gt;=rows() || column&lt;0 || column&gt;=column()</tt>.
  */
 public double get(int slice, int row, int column) {
-	if (slice<0 || slice>=slices || row<0 || row>=rows || column<0 || column>=columns) throw new IndexOutOfBoundsException("slice:"+slice+", row:"+row+", column:"+column);
-	return getQuick(slice,row,column);
+  if (slice<0 || slice>=slices || row<0 || row>=rows || column<0 || column>=columns) throw new IndexOutOfBoundsException("slice:"+slice+", row:"+row+", column:"+column);
+  return getQuick(slice,row,column);
 }
 /**
  * Returns the content of this matrix if it is a wrapper; or <tt>this</tt> otherwise.
  * Override this method in wrappers.
  */
 protected DoubleMatrix3D getContent() {
-	return this;
+  return this;
 }
 /**
 Fills the coordinates and values of cells having non-zero values into the specified lists.
@@ -350,26 +350,26 @@
 @param valueList the list to be filled with values, can have any size.
 */
 public void getNonZeros(IntArrayList sliceList, IntArrayList rowList, IntArrayList columnList, DoubleArrayList valueList) {
-	sliceList.clear(); 
-	rowList.clear(); 
-	columnList.clear(); 
-	valueList.clear();
-	int s = slices;
-	int r = rows;
-	int c = columns;
-	for (int slice=0; slice < s; slice++) {
-		for (int row=0; row < r; row++) {
-			for (int column=0; column < c; column++) {
-				double value = getQuick(slice,row,column);
-				if (value != 0) {
-					sliceList.add(slice);
-					rowList.add(row);
-					columnList.add(column);
-					valueList.add(value);
-				}
-			}
-		}
-	}
+  sliceList.clear(); 
+  rowList.clear(); 
+  columnList.clear(); 
+  valueList.clear();
+  int s = slices;
+  int r = rows;
+  int c = columns;
+  for (int slice=0; slice < s; slice++) {
+    for (int row=0; row < r; row++) {
+      for (int column=0; column < c; column++) {
+        double value = getQuick(slice,row,column);
+        if (value != 0) {
+          sliceList.add(slice);
+          rowList.add(row);
+          columnList.add(column);
+          valueList.add(value);
+        }
+      }
+    }
+  }
 }
 /**
  * Returns the matrix cell value at coordinate <tt>[slice,row,column]</tt>.
@@ -388,16 +388,16 @@
  * Returns <tt>true</tt> if both matrices share at least one identical cell.
  */
 protected boolean haveSharedCells(DoubleMatrix3D other) {
-	if (other==null) return false;
-	if (this==other) return true;
-	return getContent().haveSharedCellsRaw(other.getContent());
-}	
+  if (other==null) return false;
+  if (this==other) return true;
+  return getContent().haveSharedCellsRaw(other.getContent());
+}  
 /**
  * Returns <tt>true</tt> if both matrices share at least one identical cell.
  */
 protected boolean haveSharedCellsRaw(DoubleMatrix3D other) {
-	return false;
-}	
+  return false;
+}  
 /**
  * Construct and returns a new empty matrix <i>of the same dynamic type</i> as the receiver, having the same number of slices, rows and columns.
  * For example, if the receiver is an instance of type <tt>DenseDoubleMatrix3D</tt> the new matrix must also be of type <tt>DenseDoubleMatrix3D</tt>,
@@ -407,7 +407,7 @@
  * @return  a new empty matrix of the same dynamic type.
  */
 public DoubleMatrix3D like() {
-	return like(slices,rows,columns);
+  return like(slices,rows,columns);
 }
 /**
  * Construct and returns a new empty matrix <i>of the same dynamic type</i> as the receiver, having the specified number of slices, rows and columns.
@@ -442,11 +442,11 @@
  * @param     row   the index of the row-coordinate.
  * @param     column   the index of the column-coordinate.
  * @param    value the value to be filled into the specified cell.
- * @throws	IndexOutOfBoundsException if <tt>row&lt;0 || row&gt;=rows() || slice&lt;0 || slice&gt;=slices() || column&lt;0 || column&gt;=column()</tt>.
+ * @throws  IndexOutOfBoundsException if <tt>row&lt;0 || row&gt;=rows() || slice&lt;0 || slice&gt;=slices() || column&lt;0 || column&gt;=column()</tt>.
  */
 public void set(int slice, int row, int column, double value) {
-	if (slice<0 || slice>=slices || row<0 || row>=rows || column<0 || column>=columns) throw new IndexOutOfBoundsException("slice:"+slice+", row:"+row+", column:"+column);
-	setQuick(slice,row,column,value);
+  if (slice<0 || slice>=slices || row<0 || row>=rows || column<0 || column>=columns) throw new IndexOutOfBoundsException("slice:"+slice+", row:"+row+", column:"+column);
+  setQuick(slice,row,column,value);
 }
 /**
  * Sets the matrix cell at coordinate <tt>[slice,row,column]</tt> to the specified value.
@@ -471,24 +471,24 @@
  * @return an array filled with the values of the cells.
  */
 public double[][][] toArray() {
-	double[][][] values = new double[slices][rows][columns];
-	for (int slice=slices; --slice >= 0;) {
-		double[][] currentSlice = values[slice];
-		for (int row=rows; --row >= 0;) {
-			double[] currentRow = currentSlice[row];
-			for (int column=columns; --column >= 0;) {
-				currentRow[column] = getQuick(slice,row,column);
-			}
-		}
-	}
-	return values;
+  double[][][] values = new double[slices][rows][columns];
+  for (int slice=slices; --slice >= 0;) {
+    double[][] currentSlice = values[slice];
+    for (int row=rows; --row >= 0;) {
+      double[] currentRow = currentSlice[row];
+      for (int column=columns; --column >= 0;) {
+        currentRow[column] = getQuick(slice,row,column);
+      }
+    }
+  }
+  return values;
 }
 /**
  * Returns a string representation using default formatting.
  * @see org.apache.mahout.matrix.matrix.doublealgo.Formatter
  */
 public String toString() {
-	return new org.apache.mahout.matrix.matrix.doublealgo.Formatter().toString(this);
+  return new org.apache.mahout.matrix.matrix.doublealgo.Formatter().toString(this);
 }
 /**
  * Constructs and returns a new view equal to the receiver.
@@ -502,7 +502,7 @@
  * @return  a new view of the receiver.
  */
 protected DoubleMatrix3D view() {
-	return (DoubleMatrix3D) clone();
+  return (DoubleMatrix3D) clone();
 }
 /**
 Constructs and returns a new 2-dimensional <i>slice view</i> representing the slices and rows of the given column.
@@ -519,17 +519,17 @@
 @see #viewRow(int)
 */
 public DoubleMatrix2D viewColumn(int column) {
-	checkColumn(column);
-	int sliceRows = this.slices;
-	int sliceColumns = this.rows;
+  checkColumn(column);
+  int sliceRows = this.slices;
+  int sliceColumns = this.rows;
 
-	//int sliceOffset = index(0,0,column);
-	int sliceRowZero = sliceZero;
-	int sliceColumnZero = rowZero + _columnOffset(_columnRank(column));
-	
-	int sliceRowStride = this.sliceStride;
-	int sliceColumnStride = this.rowStride;
-	return like2D(sliceRows,sliceColumns,sliceRowZero,sliceColumnZero,sliceRowStride,sliceColumnStride);
+  //int sliceOffset = index(0,0,column);
+  int sliceRowZero = sliceZero;
+  int sliceColumnZero = rowZero + _columnOffset(_columnRank(column));
+  
+  int sliceRowStride = this.sliceStride;
+  int sliceColumnStride = this.rowStride;
+  return like2D(sliceRows,sliceColumns,sliceRowZero,sliceColumnZero,sliceRowStride,sliceColumnStride);
 }
 /**
 Constructs and returns a new <i>flip view</i> along the column axis.
@@ -541,7 +541,7 @@
 @see #viewRowFlip()
 */
 public DoubleMatrix3D viewColumnFlip() {
-	return (DoubleMatrix3D) (view().vColumnFlip());
+  return (DoubleMatrix3D) (view().vColumnFlip());
 }
 /**
 Constructs and returns a new <i>dice view</i>; Swaps dimensions (axes); Example: 3 x 4 x 5 matrix --> 4 x 3 x 5 matrix.
@@ -555,7 +555,7 @@
 @throws IllegalArgumentException if some of the parameters are equal or not in range 0..2.
 */
 public DoubleMatrix3D viewDice(int axis0, int axis1, int axis2) {
-	return (DoubleMatrix3D) (view().vDice(axis0,axis1,axis2));
+  return (DoubleMatrix3D) (view().vDice(axis0,axis1,axis2));
 }
 /**
 Constructs and returns a new <i>sub-range view</i> that is a <tt>depth x height x width</tt> sub matrix starting at <tt>[slice,row,column]</tt>;
@@ -568,12 +568,12 @@
 @param     depth   The depth of the box.
 @param     height   The height of the box.
 @param     width   The width of the box.
-@throws	IndexOutOfBoundsException if <tt>slice<0 || depth<0 || slice+depth>slices() || row<0 || height<0 || row+height>rows() || column<0 || width<0 || column+width>columns()</tt>
+@throws  IndexOutOfBoundsException if <tt>slice<0 || depth<0 || slice+depth>slices() || row<0 || height<0 || row+height>rows() || column<0 || width<0 || column+width>columns()</tt>
 @return the new view.
-		
+    
 */
 public DoubleMatrix3D viewPart(int slice, int row, int column, int depth, int height, int width) {
-	return (DoubleMatrix3D) (view().vPart(slice,row,column,depth,height,width));
+  return (DoubleMatrix3D) (view().vPart(slice,row,column,depth,height,width));
 }
 /**
 Constructs and returns a new 2-dimensional <i>slice view</i> representing the slices and columns of the given row.
@@ -590,17 +590,17 @@
 @see #viewColumn(int)
 */
 public DoubleMatrix2D viewRow(int row) {
-	checkRow(row);
-	int sliceRows = this.slices;
-	int sliceColumns = this.columns;
-	
-	//int sliceOffset = index(0,row,0);
-	int sliceRowZero = sliceZero ;
-	int sliceColumnZero = columnZero + _rowOffset(_rowRank(row));
-	
-	int sliceRowStride = this.sliceStride;
-	int sliceColumnStride = this.columnStride;
-	return like2D(sliceRows,sliceColumns,sliceRowZero,sliceColumnZero,sliceRowStride,sliceColumnStride);
+  checkRow(row);
+  int sliceRows = this.slices;
+  int sliceColumns = this.columns;
+  
+  //int sliceOffset = index(0,row,0);
+  int sliceRowZero = sliceZero ;
+  int sliceColumnZero = columnZero + _rowOffset(_rowRank(row));
+  
+  int sliceRowStride = this.sliceStride;
+  int sliceColumnStride = this.columnStride;
+  return like2D(sliceRows,sliceColumns,sliceRowZero,sliceColumnZero,sliceRowStride,sliceColumnStride);
 }
 /**
 Constructs and returns a new <i>flip view</i> along the row axis.
@@ -612,7 +612,7 @@
 @see #viewColumnFlip()
 */
 public DoubleMatrix3D viewRowFlip() {
-	return (DoubleMatrix3D) (view().vRowFlip());
+  return (DoubleMatrix3D) (view().vRowFlip());
 }
 /**
 Constructs and returns a new <i>selection view</i> that is a matrix holding the indicated cells.
@@ -633,39 +633,39 @@
 @throws IndexOutOfBoundsException if <tt>!(0 <= columnIndexes[i] < columns())</tt> for any <tt>i=0..columnIndexes.length()-1</tt>.
 */
 public DoubleMatrix3D viewSelection(int[] sliceIndexes, int[] rowIndexes, int[] columnIndexes) {
-	// check for "all"
-	if (sliceIndexes==null) {
-		sliceIndexes = new int[slices];
-		for (int i=slices; --i >= 0; ) sliceIndexes[i] = i;
-	}
-	if (rowIndexes==null) {
-		rowIndexes = new int[rows];
-		for (int i=rows; --i >= 0; ) rowIndexes[i] = i;
-	}
-	if (columnIndexes==null) {
-		columnIndexes = new int[columns];
-		for (int i=columns; --i >= 0; ) columnIndexes[i] = i;
-	}
-	
-	checkSliceIndexes(sliceIndexes);
-	checkRowIndexes(rowIndexes);
-	checkColumnIndexes(columnIndexes);
-	
-	int[] sliceOffsets = new int[sliceIndexes.length];
-	int[] rowOffsets = new int[rowIndexes.length];
-	int[] columnOffsets = new int[columnIndexes.length];
-	
-	for (int i=sliceIndexes.length; --i >= 0; ) {
-		sliceOffsets[i] = _sliceOffset(_sliceRank(sliceIndexes[i]));
-	}
-	for (int i=rowIndexes.length; --i >= 0; ) {
-		rowOffsets[i] = _rowOffset(_rowRank(rowIndexes[i]));
-	}
-	for (int i=columnIndexes.length; --i >= 0; ) {
-		columnOffsets[i] = _columnOffset(_columnRank(columnIndexes[i]));
-	}
-	
-	return viewSelectionLike(sliceOffsets,rowOffsets,columnOffsets);
+  // check for "all"
+  if (sliceIndexes==null) {
+    sliceIndexes = new int[slices];
+    for (int i=slices; --i >= 0; ) sliceIndexes[i] = i;
+  }
+  if (rowIndexes==null) {
+    rowIndexes = new int[rows];
+    for (int i=rows; --i >= 0; ) rowIndexes[i] = i;
+  }
+  if (columnIndexes==null) {
+    columnIndexes = new int[columns];
+    for (int i=columns; --i >= 0; ) columnIndexes[i] = i;
+  }
+  
+  checkSliceIndexes(sliceIndexes);
+  checkRowIndexes(rowIndexes);
+  checkColumnIndexes(columnIndexes);
+  
+  int[] sliceOffsets = new int[sliceIndexes.length];
+  int[] rowOffsets = new int[rowIndexes.length];
+  int[] columnOffsets = new int[columnIndexes.length];
+  
+  for (int i=sliceIndexes.length; --i >= 0; ) {
+    sliceOffsets[i] = _sliceOffset(_sliceRank(sliceIndexes[i]));
+  }
+  for (int i=rowIndexes.length; --i >= 0; ) {
+    rowOffsets[i] = _rowOffset(_rowRank(rowIndexes[i]));
+  }
+  for (int i=columnIndexes.length; --i >= 0; ) {
+    columnOffsets[i] = _columnOffset(_columnRank(columnIndexes[i]));
+  }
+  
+  return viewSelectionLike(sliceOffsets,rowOffsets,columnOffsets);
 }
 /**
 Constructs and returns a new <i>selection view</i> that is a matrix holding all <b>slices</b> matching the given condition.
@@ -689,13 +689,13 @@
 @return the new view.
 */
 public DoubleMatrix3D viewSelection(DoubleMatrix2DProcedure condition) {
-	IntArrayList matches = new IntArrayList();
-	for (int i=0; i < slices; i++) {
-		if (condition.apply(viewSlice(i))) matches.add(i);
-	}
-	
-	matches.trimToSize();
-	return viewSelection(matches.elements(), null, null); // take all rows and columns
+  IntArrayList matches = new IntArrayList();
+  for (int i=0; i < slices; i++) {
+    if (condition.apply(viewSlice(i))) matches.add(i);
+  }
+  
+  matches.trimToSize();
+  return viewSelection(matches.elements(), null, null); // take all rows and columns
 }
 /**
  * Construct and returns a new selection view.
@@ -721,17 +721,17 @@
 @see #viewColumn(int)
 */
 public DoubleMatrix2D viewSlice(int slice) {
-	checkSlice(slice);
-	int sliceRows = this.rows;
-	int sliceColumns = this.columns;
-	
-	//int sliceOffset = index(slice,0,0);
-	int sliceRowZero = rowZero;
-	int sliceColumnZero = columnZero + _sliceOffset(_sliceRank(slice));
+  checkSlice(slice);
+  int sliceRows = this.rows;
+  int sliceColumns = this.columns;
+  
+  //int sliceOffset = index(slice,0,0);
+  int sliceRowZero = rowZero;
+  int sliceColumnZero = columnZero + _sliceOffset(_sliceRank(slice));
 
-	int sliceRowStride = this.rowStride;
-	int sliceColumnStride = this.columnStride;
-	return like2D(sliceRows,sliceColumns,sliceRowZero,sliceColumnZero,sliceRowStride,sliceColumnStride);
+  int sliceRowStride = this.rowStride;
+  int sliceColumnStride = this.columnStride;
+  return like2D(sliceRows,sliceColumns,sliceRowZero,sliceColumnZero,sliceRowStride,sliceColumnStride);
 }
 /**
 Constructs and returns a new <i>flip view</i> along the slice axis.
@@ -743,7 +743,7 @@
 @see #viewColumnFlip()
 */
 public DoubleMatrix3D viewSliceFlip() {
-	return (DoubleMatrix3D) (view().vSliceFlip());
+  return (DoubleMatrix3D) (view().vSliceFlip());
 }
 /**
 Sorts the matrix slices into ascending order, according to the <i>natural ordering</i> of the matrix values in the given <tt>[row,column]</tt> position.
@@ -754,7 +754,7 @@
 @throws IndexOutOfBoundsException if <tt>row < 0 || row >= rows() || column < 0 || column >= columns()</tt>.
 */
 public DoubleMatrix3D viewSorted(int row, int column) {
-	return org.apache.mahout.matrix.matrix.doublealgo.Sorting.mergeSort.sort(this,row,column);
+  return org.apache.mahout.matrix.matrix.doublealgo.Sorting.mergeSort.sort(this,row,column);
 }
 /**
 Constructs and returns a new <i>stride view</i> which is a sub matrix consisting of every i-th cell.
@@ -766,10 +766,10 @@
 @param rowStride the row step factor.
 @param columnStride the column step factor.
 @return a new view.
-@throws	IndexOutOfBoundsException if <tt>sliceStride<=0 || rowStride<=0 || columnStride<=0</tt>.
+@throws  IndexOutOfBoundsException if <tt>sliceStride<=0 || rowStride<=0 || columnStride<=0</tt>.
 */
 public DoubleMatrix3D viewStrides(int sliceStride, int rowStride, int columnStride) {
-	return (DoubleMatrix3D) (view().vStrides(sliceStride, rowStride, columnStride));
+  return (DoubleMatrix3D) (view().vStrides(sliceStride, rowStride, columnStride));
 }
 /**
  * Applies a procedure to each cell's value.
@@ -791,14 +791,14 @@
  * @return <tt>false</tt> if the procedure stopped before all elements where iterated over, <tt>true</tt> otherwise. 
  */
 private boolean xforEach(final org.apache.mahout.matrix.function.DoubleProcedure procedure) {
-	for (int slice=slices; --slice >= 0;) {
-		for (int row=rows; --row >= 0;) {
-			for (int column=columns; --column >= 0;) {
-				if (!procedure.apply(getQuick(slice,row,column))) return false;
-			}
-		}
-	}
-	return true;
+  for (int slice=slices; --slice >= 0;) {
+    for (int row=rows; --row >= 0;) {
+      for (int column=columns; --column >= 0;) {
+        if (!procedure.apply(getQuick(slice,row,column))) return false;
+      }
+    }
+  }
+  return true;
 }
 /**
  * Applies a procedure to each cell's coordinate.
@@ -820,14 +820,14 @@
  * @return <tt>false</tt> if the procedure stopped before all elements where iterated over, <tt>true</tt> otherwise. 
  */
 private boolean xforEachCoordinate(final org.apache.mahout.matrix.function.IntIntIntProcedure procedure) {
-	for (int column=columns; --column >= 0;) {
-		for (int slice=slices; --slice >=0;) {
-			for (int row=rows; --row >= 0;) {
-				if (!procedure.apply(slice,row,column)) return false;
-			}
-		}
-	}
-	return true;
+  for (int column=columns; --column >= 0;) {
+    for (int slice=slices; --slice >=0;) {
+      for (int row=rows; --row >= 0;) {
+        if (!procedure.apply(slice,row,column)) return false;
+      }
+    }
+  }
+  return true;
 }
 /**
 27 neighbor stencil transformation. For efficient finite difference operations.
@@ -881,93 +881,93 @@
 };
 A.zAssign27Neighbors(B,f);
 </pre>
-	
+  
 @param B the matrix to hold the results.
 @param function the function to be applied to the 27 cells.
 @throws NullPointerException if <tt>function==null</tt>.
 @throws IllegalArgumentException if <tt>rows() != B.rows() || columns() != B.columns() || slices() != B.slices() </tt>.
 */
 public void zAssign27Neighbors(DoubleMatrix3D B, org.apache.mahout.matrix.function.Double27Function function) {
-	if (function==null) throw new NullPointerException("function must not be null.");
-	checkShape(B);
-	if (rows<3 || columns<3 || slices<3) return; // nothing to do
-	int r = rows-1;
-	int c = columns-1;
-	double a000, a001, a002;
-	double a010, a011, a012;
-	double a020, a021, a022;
+  if (function==null) throw new NullPointerException("function must not be null.");
+  checkShape(B);
+  if (rows<3 || columns<3 || slices<3) return; // nothing to do
+  int r = rows-1;
+  int c = columns-1;
+  double a000, a001, a002;
+  double a010, a011, a012;
+  double a020, a021, a022;
 
-	double a100, a101, a102;
-	double a110, a111, a112;
-	double a120, a121, a122;
+  double a100, a101, a102;
+  double a110, a111, a112;
+  double a120, a121, a122;
 
-	double a200, a201, a202;
-	double a210, a211, a212;
-	double a220, a221, a222;
-	
-	for (int k=1; k<slices-1; k++) {
-		for (int i=1; i<r; i++) {
-			a000=getQuick(k-1,i-1,0); a001=getQuick(k-1,i-1,1); 
-			a010=getQuick(k-1,i,  0); a011=getQuick(k-1,i,  1); 
-			a020=getQuick(k-1,i+1,0); a021=getQuick(k-1,i+1,1); 
+  double a200, a201, a202;
+  double a210, a211, a212;
+  double a220, a221, a222;
+  
+  for (int k=1; k<slices-1; k++) {
+    for (int i=1; i<r; i++) {
+      a000=getQuick(k-1,i-1,0); a001=getQuick(k-1,i-1,1); 
+      a010=getQuick(k-1,i,  0); a011=getQuick(k-1,i,  1); 
+      a020=getQuick(k-1,i+1,0); a021=getQuick(k-1,i+1,1); 
 
-			a100=getQuick(k-1,i-1,0); a101=getQuick(k  ,i-1,1); 
-			a110=getQuick(k  ,i,  0); a111=getQuick(k  ,i,  1); 
-			a120=getQuick(k  ,i+1,0); a121=getQuick(k  ,i+1,1); 
+      a100=getQuick(k-1,i-1,0); a101=getQuick(k  ,i-1,1); 
+      a110=getQuick(k  ,i,  0); a111=getQuick(k  ,i,  1); 
+      a120=getQuick(k  ,i+1,0); a121=getQuick(k  ,i+1,1); 
 
-			a200=getQuick(k+1,i-1,0); a201=getQuick(k+1,i-1,1); 
-			a210=getQuick(k+1,i,  0); a211=getQuick(k+1,i,  1); 
-			a220=getQuick(k+1,i+1,0); a221=getQuick(k+1,i+1,1); 
+      a200=getQuick(k+1,i-1,0); a201=getQuick(k+1,i-1,1); 
+      a210=getQuick(k+1,i,  0); a211=getQuick(k+1,i,  1); 
+      a220=getQuick(k+1,i+1,0); a221=getQuick(k+1,i+1,1); 
 
-			for (int j=1; j<c; j++) {
-				// in each step 18 cells can be remembered in registers - they don't need to be reread from slow memory
-				// in each step 9 instead of 27 cells need to be read from memory.
-				a002=getQuick(k-1,i-1,j+1);
-				a012=getQuick(k-1,i,  j+1);
-				a022=getQuick(k-1,i+1,j+1);
-				
-				a102=getQuick(k  ,i-1,j+1);
-				a112=getQuick(k  ,i,  j+1);
-				a122=getQuick(k  ,i+1,j+1);
-				
-				a202=getQuick(k+1,i-1,j+1);
-				a212=getQuick(k+1,i,  j+1);
-				a222=getQuick(k+1,i+1,j+1);
-				
-				B.setQuick(k,i,j, function.apply(
-					a000, a001, a002,
-					a010, a011, a012,
-					a020, a021, a022,
-					
-					a100, a101, a102,
-					a110, a111, a112,
-					a120, a121, a122,
-					
-					a200, a201, a202,
-					a210, a211, a212,
-					a220, a221, a222));
-				
-				a000=a001; a001=a002;
-				a010=a011; a011=a012;
-				a020=a021; a021=a022;
+      for (int j=1; j<c; j++) {
+        // in each step 18 cells can be remembered in registers - they don't need to be reread from slow memory
+        // in each step 9 instead of 27 cells need to be read from memory.
+        a002=getQuick(k-1,i-1,j+1);
+        a012=getQuick(k-1,i,  j+1);
+        a022=getQuick(k-1,i+1,j+1);
+        
+        a102=getQuick(k  ,i-1,j+1);
+        a112=getQuick(k  ,i,  j+1);
+        a122=getQuick(k  ,i+1,j+1);
+        
+        a202=getQuick(k+1,i-1,j+1);
+        a212=getQuick(k+1,i,  j+1);
+        a222=getQuick(k+1,i+1,j+1);
+        
+        B.setQuick(k,i,j, function.apply(
+          a000, a001, a002,
+          a010, a011, a012,
+          a020, a021, a022,
+          
+          a100, a101, a102,
+          a110, a111, a112,
+          a120, a121, a122,
+          
+          a200, a201, a202,
+          a210, a211, a212,
+          a220, a221, a222));
+        
+        a000=a001; a001=a002;
+        a010=a011; a011=a012;
+        a020=a021; a021=a022;
 
-				a100=a101; a101=a102;
-				a110=a111; a111=a112;
-				a120=a121; a121=a122;
+        a100=a101; a101=a102;
+        a110=a111; a111=a112;
+        a120=a121; a121=a122;
 
-				a200=a201; a201=a202;
-				a210=a211; a211=a212;
-				a220=a221; a221=a222;			
-			}
-		}
-	}
+        a200=a201; a201=a202;
+        a210=a211; a211=a212;
+        a220=a221; a221=a222;      
+      }
+    }
+  }
 }
 /**
  * Returns the sum of all cells; <tt>Sum( x[i,j,k] )</tt>.
  * @return the sum.
  */
 public double zSum() {
-	if (size()==0) return 0;
-	return aggregate(org.apache.mahout.jet.math.Functions.plus, org.apache.mahout.jet.math.Functions.identity);
+  if (size()==0) return 0;
+  return aggregate(org.apache.mahout.jet.math.Functions.plus, org.apache.mahout.jet.math.Functions.identity);
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/DoubleFactory1D.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/DoubleFactory1D.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/DoubleFactory1D.java	(working copy)
@@ -37,15 +37,15 @@
  */
 @Deprecated
 public class DoubleFactory1D extends org.apache.mahout.matrix.PersistentObject {
-	/**
-	 * A factory producing dense matrices.
-	 */
-	public static final DoubleFactory1D dense  = new DoubleFactory1D();
+  /**
+   * A factory producing dense matrices.
+   */
+  public static final DoubleFactory1D dense  = new DoubleFactory1D();
 
-	/**
-	 * A factory producing sparse matrices.
-	 */
-	public static final DoubleFactory1D sparse = new DoubleFactory1D();
+  /**
+   * A factory producing sparse matrices.
+   */
+  public static final DoubleFactory1D sparse = new DoubleFactory1D();
 /**
  * Makes this class non instantiable, but still let's others inherit from it.
  */
@@ -55,11 +55,11 @@
 Example: <tt>0 1</tt> append <tt>3 4</tt> --> <tt>0 1 3 4</tt>.
 */
 public DoubleMatrix1D append(DoubleMatrix1D A, DoubleMatrix1D B) {
-	// concatenate
-	DoubleMatrix1D matrix = make(A.size()+B.size());
-	matrix.viewPart(0,A.size()).assign(A);
-	matrix.viewPart(A.size(),B.size()).assign(B);
-	return matrix;
+  // concatenate
+  DoubleMatrix1D matrix = make(A.size()+B.size());
+  matrix.viewPart(0,A.size()).assign(A);
+  matrix.viewPart(A.size(),B.size()).assign(B);
+  return matrix;
 }
 /**
 Constructs a matrix with cells having ascending values.
@@ -67,8 +67,8 @@
 Example: <tt>0 1 2</tt>
 */
 public DoubleMatrix1D ascending(int size) {
-	org.apache.mahout.jet.math.Functions F = org.apache.mahout.jet.math.Functions.functions;
-	return descending(size).assign(F.chain(F.neg,F.minus(size)));
+  org.apache.mahout.jet.math.Functions F = org.apache.mahout.jet.math.Functions.functions;
+  return descending(size).assign(F.chain(F.neg,F.minus(size)));
 }
 /**
 Constructs a matrix with cells having descending values.
@@ -76,12 +76,12 @@
 Example: <tt>2 1 0</tt> 
 */
 public DoubleMatrix1D descending(int size) {
-	DoubleMatrix1D matrix = make(size);
-	int v = 0;
-	for (int i=size; --i >= 0;) {
-		matrix.setQuick(i, v++);
-	}
-	return matrix;
+  DoubleMatrix1D matrix = make(size);
+  int v = 0;
+  for (int i=size; --i >= 0;) {
+    matrix.setQuick(i, v++);
+  }
+  return matrix;
 }
 /**
  * Constructs a matrix with the given cell values.
@@ -90,40 +90,40 @@
  * @param values The values to be filled into the new matrix.
  */
 public DoubleMatrix1D make(double[] values) {
-	if (this==sparse) return new SparseDoubleMatrix1D(values);
-	else return new DenseDoubleMatrix1D(values);
+  if (this==sparse) return new SparseDoubleMatrix1D(values);
+  else return new DenseDoubleMatrix1D(values);
 }
 /**
 Constructs a matrix which is the concatenation of all given parts.
 Cells are copied.
 */
 public DoubleMatrix1D make(DoubleMatrix1D[] parts) {
-	if (parts.length==0) return make(0);
-	
-	int size = 0;
-	for (int i=0; i < parts.length; i++) size += parts[i].size();
+  if (parts.length==0) return make(0);
+  
+  int size = 0;
+  for (int i=0; i < parts.length; i++) size += parts[i].size();
 
-	DoubleMatrix1D vector = make(size);
-	size = 0;
-	for (int i=0; i < parts.length; i++) {
-		vector.viewPart(size,parts[i].size()).assign(parts[i]);
-		size += parts[i].size();
-	}
+  DoubleMatrix1D vector = make(size);
+  size = 0;
+  for (int i=0; i < parts.length; i++) {
+    vector.viewPart(size,parts[i].size()).assign(parts[i]);
+    size += parts[i].size();
+  }
 
-	return vector;
+  return vector;
 }
 /**
  * Constructs a matrix with the given shape, each cell initialized with zero.
  */
 public DoubleMatrix1D make(int size) {
-	if (this==sparse) return new SparseDoubleMatrix1D(size);
-	return new DenseDoubleMatrix1D(size);
+  if (this==sparse) return new SparseDoubleMatrix1D(size);
+  return new DenseDoubleMatrix1D(size);
 }
 /**
  * Constructs a matrix with the given shape, each cell initialized with the given value.
  */
 public DoubleMatrix1D make(int size, double initialValue) {
-	return make(size).assign(initialValue);
+  return make(size).assign(initialValue);
 }
 /**
  * Constructs a matrix from the values of the given list.
@@ -133,16 +133,16 @@
  * @return a new matrix.
  */
 public DoubleMatrix1D make(org.apache.mahout.matrix.list.AbstractDoubleList values) {
-	int size = values.size();
-	DoubleMatrix1D vector = make(size);
-	for (int i=size; --i >= 0; ) vector.set(i, values.get(i));
-	return vector;
+  int size = values.size();
+  DoubleMatrix1D vector = make(size);
+  for (int i=size; --i >= 0; ) vector.set(i, values.get(i));
+  return vector;
 }
 /**
  * Constructs a matrix with uniformly distributed values in <tt>(0,1)</tt> (exclusive).
  */
 public DoubleMatrix1D random(int size) {
-	return make(size).assign(org.apache.mahout.jet.math.Functions.random());
+  return make(size).assign(org.apache.mahout.jet.math.Functions.random());
 }
 /**
 C = A||A||..||A; Constructs a new matrix which is concatenated <tt>repeat</tt> times.
@@ -154,12 +154,12 @@
 </pre>
 */
 public DoubleMatrix1D repeat(DoubleMatrix1D A, int repeat) {
-	int size = A.size();
-	DoubleMatrix1D matrix = make(repeat * size);
-	for (int i=repeat; --i >= 0; ) {
-		matrix.viewPart(size*i,size).assign(A);
-	}
-	return matrix;
+  int size = A.size();
+  DoubleMatrix1D matrix = make(repeat * size);
+  for (int i=repeat; --i >= 0; ) {
+    matrix.viewPart(size*i,size).assign(A);
+  }
+  return matrix;
 }
 /**
  * Constructs a randomly sampled matrix with the given shape.
@@ -169,24 +169,24 @@
  * @see org.apache.mahout.jet.random.sampling.RandomSampler
  */
 public DoubleMatrix1D sample(int size, double value, double nonZeroFraction)  {
-	double epsilon = 1e-09;
-	if (nonZeroFraction < 0 - epsilon || nonZeroFraction > 1 + epsilon) throw new IllegalArgumentException();
-	if (nonZeroFraction < 0) nonZeroFraction = 0;
-	if (nonZeroFraction > 1) nonZeroFraction = 1;
-	
-	DoubleMatrix1D matrix = make(size);
+  double epsilon = 1e-09;
+  if (nonZeroFraction < 0 - epsilon || nonZeroFraction > 1 + epsilon) throw new IllegalArgumentException();
+  if (nonZeroFraction < 0) nonZeroFraction = 0;
+  if (nonZeroFraction > 1) nonZeroFraction = 1;
+  
+  DoubleMatrix1D matrix = make(size);
 
-	int n = (int) Math.round(size*nonZeroFraction);
-	if (n==0) return matrix;
+  int n = (int) Math.round(size*nonZeroFraction);
+  if (n==0) return matrix;
 
-	org.apache.mahout.jet.random.sampling.RandomSamplingAssistant sampler = new org.apache.mahout.jet.random.sampling.RandomSamplingAssistant(n,size,new org.apache.mahout.jet.random.engine.MersenneTwister());
-	for (int i=size; --i >=0; ) {
-		if (sampler.sampleNextElement()) {
-			matrix.set(i, value);
-		}
-	}
-	
-	return matrix;
+  org.apache.mahout.jet.random.sampling.RandomSamplingAssistant sampler = new org.apache.mahout.jet.random.sampling.RandomSamplingAssistant(n,size,new org.apache.mahout.jet.random.engine.MersenneTwister());
+  for (int i=size; --i >=0; ) {
+    if (sampler.sampleNextElement()) {
+      matrix.set(i, value);
+    }
+  }
+  
+  return matrix;
 }
 /**
  * Constructs a list from the given matrix.
@@ -196,10 +196,10 @@
  * @return a new list.
  */
 public org.apache.mahout.matrix.list.DoubleArrayList toList(DoubleMatrix1D values) {
-	int size = values.size();
-	org.apache.mahout.matrix.list.DoubleArrayList list = new org.apache.mahout.matrix.list.DoubleArrayList(size);
-	list.setSize(size);
-	for (int i=size; --i >= 0; ) list.set(i, values.get(i));
-	return list;
+  int size = values.size();
+  org.apache.mahout.matrix.list.DoubleArrayList list = new org.apache.mahout.matrix.list.DoubleArrayList(size);
+  list.setSize(size);
+  for (int i=size; --i >= 0; ) list.set(i, values.get(i));
+  return list;
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/DoubleFactory2D.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/DoubleFactory2D.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/DoubleFactory2D.java	(working copy)
@@ -18,42 +18,42 @@
 <p>&nbsp; </p>
 <table border="0" cellspacing="0">
   <tr align="left" valign="top"> 
-	<td><i>Construction</i></td>
-	<td>Use idioms like <tt>DoubleFactory2D.dense.make(4,4)</tt> to construct 
-	  dense matrices, <tt>DoubleFactory2D.sparse.make(4,4)</tt> to construct sparse 
-	  matrices.</td>
+  <td><i>Construction</i></td>
+  <td>Use idioms like <tt>DoubleFactory2D.dense.make(4,4)</tt> to construct 
+    dense matrices, <tt>DoubleFactory2D.sparse.make(4,4)</tt> to construct sparse 
+    matrices.</td>
   </tr>
   <tr align="left" valign="top"> 
-	<td><i> Construction with initial values </i></td>
-	<td>Use other <tt>make</tt> methods to construct matrices with given initial 
-	  values. </td>
+  <td><i> Construction with initial values </i></td>
+  <td>Use other <tt>make</tt> methods to construct matrices with given initial 
+    values. </td>
   </tr>
   <tr align="left" valign="top"> 
-	<td><i> Appending rows and columns </i></td>
-	<td>Use methods {@link #appendColumns(DoubleMatrix2D,DoubleMatrix2D) appendColumns}, 
-	  {@link #appendColumns(DoubleMatrix2D,DoubleMatrix2D) appendRows} and {@link 
-	  #repeat(DoubleMatrix2D,int,int) repeat} to append rows and columns. </td>
+  <td><i> Appending rows and columns </i></td>
+  <td>Use methods {@link #appendColumns(DoubleMatrix2D,DoubleMatrix2D) appendColumns}, 
+    {@link #appendColumns(DoubleMatrix2D,DoubleMatrix2D) appendRows} and {@link 
+    #repeat(DoubleMatrix2D,int,int) repeat} to append rows and columns. </td>
   </tr>
   <tr align="left" valign="top"> 
-	<td><i> General block matrices </i></td>
-	<td>Use methods {@link #compose(DoubleMatrix2D[][]) compose} and {@link #decompose(DoubleMatrix2D[][],DoubleMatrix2D) 
-	  decompose} to work with general block matrices. </td>
+  <td><i> General block matrices </i></td>
+  <td>Use methods {@link #compose(DoubleMatrix2D[][]) compose} and {@link #decompose(DoubleMatrix2D[][],DoubleMatrix2D) 
+    decompose} to work with general block matrices. </td>
   </tr>
   <tr align="left" valign="top"> 
-	<td><i> Diagonal matrices </i></td>
-	<td>Use methods {@link #diagonal(DoubleMatrix1D) diagonal(vector)}, {@link 
-	  #diagonal(DoubleMatrix2D) diagonal(matrix)} and {@link #identity(int) identity} 
-	  to work with diagonal matrices. </td>
+  <td><i> Diagonal matrices </i></td>
+  <td>Use methods {@link #diagonal(DoubleMatrix1D) diagonal(vector)}, {@link 
+    #diagonal(DoubleMatrix2D) diagonal(matrix)} and {@link #identity(int) identity} 
+    to work with diagonal matrices. </td>
   </tr>
   <tr align="left" valign="top"> 
-	<td><i> Diagonal block matrices </i></td>
-	<td>Use method {@link #composeDiagonal(DoubleMatrix2D,DoubleMatrix2D,DoubleMatrix2D) 
-	  composeDiagonal} to work with diagonal block matrices. </td>
+  <td><i> Diagonal block matrices </i></td>
+  <td>Use method {@link #composeDiagonal(DoubleMatrix2D,DoubleMatrix2D,DoubleMatrix2D) 
+    composeDiagonal} to work with diagonal block matrices. </td>
   </tr>
   <tr align="left" valign="top"> 
-	<td><i>Random</i></td>
-	<td>Use methods {@link #random(int,int) random} and {@link #sample(int,int,double,double) 
-	  sample} to construct random matrices. </td>
+  <td><i>Random</i></td>
+  <td>Use methods {@link #random(int,int) random} and {@link #sample(int,int,double,double) 
+    sample} to construct random matrices. </td>
   </tr>
 </table>
 <p>&nbsp;</p>
@@ -61,7 +61,7 @@
   For example by aliasing: </p>
 <table>
   <td class="PRE"> 
-	<pre>
+  <pre>
 DoubleFactory2D F = DoubleFactory2D.dense;
 F.make(4,4);
 F.descending(10,20);
@@ -79,25 +79,25 @@
  */
 @Deprecated
 public class DoubleFactory2D extends org.apache.mahout.matrix.PersistentObject {
-	/**
-	 * A factory producing dense matrices.
-	 */
-	public static final DoubleFactory2D dense  = new DoubleFactory2D();
+  /**
+   * A factory producing dense matrices.
+   */
+  public static final DoubleFactory2D dense  = new DoubleFactory2D();
 
-	/**
-	 * A factory producing sparse hash matrices.
-	 */
-	public static final DoubleFactory2D sparse = new DoubleFactory2D();
+  /**
+   * A factory producing sparse hash matrices.
+   */
+  public static final DoubleFactory2D sparse = new DoubleFactory2D();
 
-	/**
-	 * A factory producing sparse row compressed matrices.
-	 */
-	public static final DoubleFactory2D rowCompressed = new DoubleFactory2D();
-	
-	/*
-	 * A factory producing sparse row compressed modified matrices.
-	 */
-	//public static final DoubleFactory2D rowCompressedModified = new DoubleFactory2D();
+  /**
+   * A factory producing sparse row compressed matrices.
+   */
+  public static final DoubleFactory2D rowCompressed = new DoubleFactory2D();
+  
+  /*
+   * A factory producing sparse row compressed modified matrices.
+   */
+  //public static final DoubleFactory2D rowCompressedModified = new DoubleFactory2D();
 /**
  * Makes this class non instantiable, but still let's others inherit from it.
  */
@@ -116,18 +116,18 @@
 </pre>
 */
 public DoubleMatrix2D appendColumns(DoubleMatrix2D A, DoubleMatrix2D B) {
-	// force both to have maximal shared number of rows.
-	if (B.rows() > A.rows()) B = B.viewPart(0,0,A.rows(),B.columns());
-	else if (B.rows() < A.rows()) A = A.viewPart(0,0,B.rows(),A.columns());
+  // force both to have maximal shared number of rows.
+  if (B.rows() > A.rows()) B = B.viewPart(0,0,A.rows(),B.columns());
+  else if (B.rows() < A.rows()) A = A.viewPart(0,0,B.rows(),A.columns());
 
-	// concatenate
-	int ac = A.columns();
-	int bc = B.columns();
-	int r = A.rows();
-	DoubleMatrix2D matrix = make(r,ac+bc);
-	matrix.viewPart(0,0,r,ac).assign(A);
-	matrix.viewPart(0,ac,r,bc).assign(B);
-	return matrix;
+  // concatenate
+  int ac = A.columns();
+  int bc = B.columns();
+  int r = A.rows();
+  DoubleMatrix2D matrix = make(r,ac+bc);
+  matrix.viewPart(0,0,r,ac).assign(A);
+  matrix.viewPart(0,ac,r,bc).assign(B);
+  return matrix;
 }
 /**
 C = A||B; Constructs a new matrix which is the row-wise concatenation of two other matrices.
@@ -147,18 +147,18 @@
 </pre>
 */
 public DoubleMatrix2D appendRows(DoubleMatrix2D A, DoubleMatrix2D B) {
-	// force both to have maximal shared number of columns.
-	if (B.columns() > A.columns()) B = B.viewPart(0,0,B.rows(),A.columns());
-	else if (B.columns() < A.columns()) A = A.viewPart(0,0,A.rows(),B.columns());
+  // force both to have maximal shared number of columns.
+  if (B.columns() > A.columns()) B = B.viewPart(0,0,B.rows(),A.columns());
+  else if (B.columns() < A.columns()) A = A.viewPart(0,0,A.rows(),B.columns());
 
-	// concatenate
-	int ar = A.rows();
-	int br = B.rows();
-	int c = A.columns();
-	DoubleMatrix2D matrix = make(ar+br, c);
-	matrix.viewPart(0,0,ar,c).assign(A);
-	matrix.viewPart(ar,0,br,c).assign(B);
-	return matrix;
+  // concatenate
+  int ar = A.rows();
+  int br = B.rows();
+  int c = A.columns();
+  DoubleMatrix2D matrix = make(ar+br, c);
+  matrix.viewPart(0,0,ar,c).assign(A);
+  matrix.viewPart(ar,0,br,c).assign(B);
+  return matrix;
 }
 /**
 Constructs a matrix with cells having ascending values.
@@ -170,34 +170,34 @@
 </pre>
 */
 public DoubleMatrix2D ascending(int rows, int columns) {
-	org.apache.mahout.jet.math.Functions F = org.apache.mahout.jet.math.Functions.functions;
-	return descending(rows,columns).assign(F.chain(F.neg,F.minus(columns*rows)));
+  org.apache.mahout.jet.math.Functions F = org.apache.mahout.jet.math.Functions.functions;
+  return descending(rows,columns).assign(F.chain(F.neg,F.minus(columns*rows)));
 }
 /**
 Checks whether the given array is rectangular, that is, whether all rows have the same number of columns.
 @throws IllegalArgumentException if the array is not rectangular.
 */
 protected static void checkRectangularShape(double[][] array) {
-	int columns = -1;
-	for (int row=array.length; --row >= 0; ) {
-		if (array[row] != null) {
-			if (columns == -1) columns = array[row].length;
-			if (array[row].length != columns) throw new IllegalArgumentException("All rows of array must have same number of columns.");
-		}
-	}
+  int columns = -1;
+  for (int row=array.length; --row >= 0; ) {
+    if (array[row] != null) {
+      if (columns == -1) columns = array[row].length;
+      if (array[row].length != columns) throw new IllegalArgumentException("All rows of array must have same number of columns.");
+    }
+  }
 }
 /**
 Checks whether the given array is rectangular, that is, whether all rows have the same number of columns.
 @throws IllegalArgumentException if the array is not rectangular.
 */
 protected static void checkRectangularShape(DoubleMatrix2D[][] array) {
-	int columns = -1;
-	for (int row=array.length; --row >= 0; ) {
-		if (array[row] != null) {
-			if (columns == -1) columns = array[row].length;
-			if (array[row].length != columns) throw new IllegalArgumentException("All rows of array must have same number of columns.");
-		}
-	}
+  int columns = -1;
+  for (int row=array.length; --row >= 0; ) {
+    if (array[row] != null) {
+      if (columns == -1) columns = array[row].length;
+      if (array[row].length != columns) throw new IllegalArgumentException("All rows of array must have same number of columns.");
+    }
+  }
 }
 /**
 Constructs a block matrix made from the given parts.
@@ -211,12 +211,12 @@
 Example:
 <table border="1" cellspacing="0">
   <tr align="left" valign="top"> 
-	<td><tt>Code</tt></td>
-	<td><tt>Result</tt></td>
+  <td><tt>Code</tt></td>
+  <td><tt>Result</tt></td>
   </tr>
   <tr align="left" valign="top"> 
-	<td> 
-	  <pre>
+  <td> 
+    <pre>
 DoubleMatrix2D[][] parts1 = 
 {
 &nbsp;&nbsp;&nbsp;{ null,        make(2,2,1), null        },
@@ -225,20 +225,20 @@
 };
 System.out.println(compose(parts1));
 </pre>
-	</td>
-	<td><tt>8&nbsp;x&nbsp;9&nbsp;matrix<br>
-	  0&nbsp;0&nbsp;0&nbsp;0&nbsp;1&nbsp;1&nbsp;0&nbsp;0&nbsp;0<br>
-	  0&nbsp;0&nbsp;0&nbsp;0&nbsp;1&nbsp;1&nbsp;0&nbsp;0&nbsp;0<br>
-	  2&nbsp;2&nbsp;2&nbsp;2&nbsp;0&nbsp;0&nbsp;3&nbsp;3&nbsp;3<br>
-	  2&nbsp;2&nbsp;2&nbsp;2&nbsp;0&nbsp;0&nbsp;3&nbsp;3&nbsp;3<br>
-	  2&nbsp;2&nbsp;2&nbsp;2&nbsp;0&nbsp;0&nbsp;3&nbsp;3&nbsp;3<br>
-	  2&nbsp;2&nbsp;2&nbsp;2&nbsp;0&nbsp;0&nbsp;3&nbsp;3&nbsp;3<br>
-	  0&nbsp;0&nbsp;0&nbsp;0&nbsp;4&nbsp;4&nbsp;0&nbsp;0&nbsp;0<br>
-	  0&nbsp;0&nbsp;0&nbsp;0&nbsp;4&nbsp;4&nbsp;0&nbsp;0&nbsp;0</tt></td>
+  </td>
+  <td><tt>8&nbsp;x&nbsp;9&nbsp;matrix<br>
+    0&nbsp;0&nbsp;0&nbsp;0&nbsp;1&nbsp;1&nbsp;0&nbsp;0&nbsp;0<br>
+    0&nbsp;0&nbsp;0&nbsp;0&nbsp;1&nbsp;1&nbsp;0&nbsp;0&nbsp;0<br>
+    2&nbsp;2&nbsp;2&nbsp;2&nbsp;0&nbsp;0&nbsp;3&nbsp;3&nbsp;3<br>
+    2&nbsp;2&nbsp;2&nbsp;2&nbsp;0&nbsp;0&nbsp;3&nbsp;3&nbsp;3<br>
+    2&nbsp;2&nbsp;2&nbsp;2&nbsp;0&nbsp;0&nbsp;3&nbsp;3&nbsp;3<br>
+    2&nbsp;2&nbsp;2&nbsp;2&nbsp;0&nbsp;0&nbsp;3&nbsp;3&nbsp;3<br>
+    0&nbsp;0&nbsp;0&nbsp;0&nbsp;4&nbsp;4&nbsp;0&nbsp;0&nbsp;0<br>
+    0&nbsp;0&nbsp;0&nbsp;0&nbsp;4&nbsp;4&nbsp;0&nbsp;0&nbsp;0</tt></td>
   </tr>
   <tr align="left" valign="top"> 
-	<td> 
-	  <pre>
+  <td> 
+    <pre>
 DoubleMatrix2D[][] parts3 = 
 {
 &nbsp;&nbsp;&nbsp;{ identity(3),               null,                        },
@@ -247,21 +247,21 @@
 };
 System.out.println("\n"+make(parts3));
 </pre>
-	</td>
-	<td><tt>9&nbsp;x&nbsp;6&nbsp;matrix<br>
-	  1&nbsp;0&nbsp;0&nbsp;0&nbsp;0&nbsp;0<br>
-	  0&nbsp;1&nbsp;0&nbsp;0&nbsp;0&nbsp;0<br>
-	  0&nbsp;0&nbsp;1&nbsp;0&nbsp;0&nbsp;0<br>
-	  0&nbsp;0&nbsp;0&nbsp;0&nbsp;0&nbsp;1<br>
-	  0&nbsp;0&nbsp;0&nbsp;0&nbsp;1&nbsp;0<br>
-	  0&nbsp;0&nbsp;0&nbsp;1&nbsp;0&nbsp;0<br>
-	  0&nbsp;0&nbsp;1&nbsp;0&nbsp;0&nbsp;0<br>
-	  0&nbsp;1&nbsp;0&nbsp;0&nbsp;0&nbsp;0<br>
-	  1&nbsp;0&nbsp;0&nbsp;0&nbsp;0&nbsp;0 </tt></td>
+  </td>
+  <td><tt>9&nbsp;x&nbsp;6&nbsp;matrix<br>
+    1&nbsp;0&nbsp;0&nbsp;0&nbsp;0&nbsp;0<br>
+    0&nbsp;1&nbsp;0&nbsp;0&nbsp;0&nbsp;0<br>
+    0&nbsp;0&nbsp;1&nbsp;0&nbsp;0&nbsp;0<br>
+    0&nbsp;0&nbsp;0&nbsp;0&nbsp;0&nbsp;1<br>
+    0&nbsp;0&nbsp;0&nbsp;0&nbsp;1&nbsp;0<br>
+    0&nbsp;0&nbsp;0&nbsp;1&nbsp;0&nbsp;0<br>
+    0&nbsp;0&nbsp;1&nbsp;0&nbsp;0&nbsp;0<br>
+    0&nbsp;1&nbsp;0&nbsp;0&nbsp;0&nbsp;0<br>
+    1&nbsp;0&nbsp;0&nbsp;0&nbsp;0&nbsp;0 </tt></td>
   </tr>
   <tr align="left" valign="top"> 
-	<td> 
-	  <pre>
+  <td> 
+    <pre>
 DoubleMatrix2D A = ascending(2,2);
 DoubleMatrix2D B = descending(2,2);
 DoubleMatrix2D _ = null;
@@ -273,16 +273,16 @@
 };
 System.out.println("\n"+make(parts4));
 </pre>
-	</td>
-	<td><tt>4&nbsp;x&nbsp;8&nbsp;matrix<br>
-	  1&nbsp;2&nbsp;0&nbsp;0&nbsp;1&nbsp;2&nbsp;0&nbsp;0<br>
-	  3&nbsp;4&nbsp;0&nbsp;0&nbsp;3&nbsp;4&nbsp;0&nbsp;0<br>
-	  0&nbsp;0&nbsp;1&nbsp;2&nbsp;0&nbsp;0&nbsp;3&nbsp;2<br>
-	  0&nbsp;0&nbsp;3&nbsp;4&nbsp;0&nbsp;0&nbsp;1&nbsp;0 </tt></td>
+  </td>
+  <td><tt>4&nbsp;x&nbsp;8&nbsp;matrix<br>
+    1&nbsp;2&nbsp;0&nbsp;0&nbsp;1&nbsp;2&nbsp;0&nbsp;0<br>
+    3&nbsp;4&nbsp;0&nbsp;0&nbsp;3&nbsp;4&nbsp;0&nbsp;0<br>
+    0&nbsp;0&nbsp;1&nbsp;2&nbsp;0&nbsp;0&nbsp;3&nbsp;2<br>
+    0&nbsp;0&nbsp;3&nbsp;4&nbsp;0&nbsp;0&nbsp;1&nbsp;0 </tt></td>
   </tr>
   <tr align="left" valign="top"> 
-	<td> 
-	  <pre>
+  <td> 
+    <pre>
 DoubleMatrix2D[][] parts2 = 
 {
 &nbsp;&nbsp;&nbsp;{ null,        make(2,2,1), null        },
@@ -291,77 +291,77 @@
 };
 System.out.println("\n"+Factory2D.make(parts2));
 </pre>
-	</td>
-	<td><tt>IllegalArgumentException<br>
-	  A[0,1].cols != A[2,1].cols<br>
-	  (2 != 3)</tt></td>
+  </td>
+  <td><tt>IllegalArgumentException<br>
+    A[0,1].cols != A[2,1].cols<br>
+    (2 != 3)</tt></td>
   </tr>
 </table>
 @throws IllegalArgumentException subject to the conditions outlined above.
 */
 public DoubleMatrix2D compose(DoubleMatrix2D[][] parts) {
-	checkRectangularShape(parts);
-	int rows = parts.length;
-	int columns = 0;
-	if (parts.length > 0) columns = parts[0].length;
-	DoubleMatrix2D empty = make(0,0);
-	
-	if (rows==0 || columns==0) return empty;
+  checkRectangularShape(parts);
+  int rows = parts.length;
+  int columns = 0;
+  if (parts.length > 0) columns = parts[0].length;
+  DoubleMatrix2D empty = make(0,0);
+  
+  if (rows==0 || columns==0) return empty;
 
-	// determine maximum column width of each column
-	int[] maxWidths = new int[columns];
-	for (int column=columns; --column >= 0; ) {
-		int maxWidth = 0;
-		for (int row=rows; --row >= 0; ) {
-			DoubleMatrix2D part = parts[row][column];
-			if (part != null) {
-				int width = part.columns();
-				if (maxWidth>0 && width>0 && width!=maxWidth) throw new IllegalArgumentException("Different number of columns.");
-				maxWidth = Math.max(maxWidth,width);
-			}
-		}
-		maxWidths[column] = maxWidth;
-	}
+  // determine maximum column width of each column
+  int[] maxWidths = new int[columns];
+  for (int column=columns; --column >= 0; ) {
+    int maxWidth = 0;
+    for (int row=rows; --row >= 0; ) {
+      DoubleMatrix2D part = parts[row][column];
+      if (part != null) {
+        int width = part.columns();
+        if (maxWidth>0 && width>0 && width!=maxWidth) throw new IllegalArgumentException("Different number of columns.");
+        maxWidth = Math.max(maxWidth,width);
+      }
+    }
+    maxWidths[column] = maxWidth;
+  }
 
-	// determine row height of each row
-	int[] maxHeights = new int[rows];
-	for (int row=rows; --row >= 0; ) {
-		int maxHeight = 0;
-		for (int column=columns; --column >= 0; ) {
-			DoubleMatrix2D part = parts[row][column];
-			if (part != null) {
-				int height = part.rows();
-				if (maxHeight>0  && height>0 && height!=maxHeight) throw new IllegalArgumentException("Different number of rows.");
-				maxHeight = Math.max(maxHeight,height);
-			}
-		}
-		maxHeights[row] = maxHeight;
-	}
+  // determine row height of each row
+  int[] maxHeights = new int[rows];
+  for (int row=rows; --row >= 0; ) {
+    int maxHeight = 0;
+    for (int column=columns; --column >= 0; ) {
+      DoubleMatrix2D part = parts[row][column];
+      if (part != null) {
+        int height = part.rows();
+        if (maxHeight>0  && height>0 && height!=maxHeight) throw new IllegalArgumentException("Different number of rows.");
+        maxHeight = Math.max(maxHeight,height);
+      }
+    }
+    maxHeights[row] = maxHeight;
+  }
 
 
-	// shape of result 
-	int resultRows = 0;
-	for (int row=rows; --row >= 0; ) resultRows += maxHeights[row];
-	int resultCols = 0;
-	for (int column=columns; --column >= 0; ) resultCols += maxWidths[column];
-	
-	DoubleMatrix2D matrix = make(resultRows,resultCols);
+  // shape of result 
+  int resultRows = 0;
+  for (int row=rows; --row >= 0; ) resultRows += maxHeights[row];
+  int resultCols = 0;
+  for (int column=columns; --column >= 0; ) resultCols += maxWidths[column];
+  
+  DoubleMatrix2D matrix = make(resultRows,resultCols);
 
-	// copy
-	int r=0;
-	for (int row=0; row < rows; row++) {
-		int c=0;
-		for (int column=0; column < columns; column++) {
-			DoubleMatrix2D part = parts[row][column];
-			if (part != null) {
-				matrix.viewPart(r,c,part.rows(),part.columns()).assign(part);
-			}
-			c += maxWidths[column];
-		}
-		r += maxHeights[row];
-	}
-	
-	return matrix;
+  // copy
+  int r=0;
+  for (int row=0; row < rows; row++) {
+    int c=0;
+    for (int column=0; column < columns; column++) {
+      DoubleMatrix2D part = parts[row][column];
+      if (part != null) {
+        matrix.viewPart(r,c,part.rows(),part.columns()).assign(part);
+      }
+      c += maxWidths[column];
+    }
+    r += maxHeights[row];
+  }
+  
+  return matrix;
 }
 /**
 Constructs a diagonal block matrix from the given parts (the <i>direct sum</i> of two matrices).
@@ -375,12 +375,12 @@
 @return a new matrix which is the direct sum.
 */
 public DoubleMatrix2D composeDiagonal(DoubleMatrix2D A, DoubleMatrix2D B) {
-	int ar = A.rows(); int ac = A.columns();
-	int br = B.rows(); int bc = B.columns();
-	DoubleMatrix2D sum = make(ar+br, ac+bc);
-	sum.viewPart(0,0,ar,ac).assign(A);
-	sum.viewPart(ar,ac,br,bc).assign(B);
-	return sum;
+  int ar = A.rows(); int ac = A.columns();
+  int br = B.rows(); int bc = B.columns();
+  DoubleMatrix2D sum = make(ar+br, ac+bc);
+  sum.viewPart(0,0,ar,ac).assign(A);
+  sum.viewPart(ar,ac,br,bc).assign(B);
+  return sum;
 }
 /**
 Constructs a diagonal block matrix from the given parts.
@@ -394,11 +394,11 @@
 Cells are copied.
 */
 public DoubleMatrix2D composeDiagonal(DoubleMatrix2D A, DoubleMatrix2D B, DoubleMatrix2D C) {
-	DoubleMatrix2D diag = make(A.rows()+B.rows()+C.rows(), A.columns()+B.columns()+C.columns());
-	diag.viewPart(0,0,A.rows(),A.columns()).assign(A);
-	diag.viewPart(A.rows(),A.columns(),B.rows(),B.columns()).assign(B);
-	diag.viewPart(A.rows()+B.rows(),A.columns()+B.columns(),C.rows(),C.columns()).assign(C);
-	return diag;
+  DoubleMatrix2D diag = make(A.rows()+B.rows()+C.rows(), A.columns()+B.columns()+C.columns());
+  diag.viewPart(0,0,A.rows(),A.columns()).assign(A);
+  diag.viewPart(A.rows(),A.columns(),B.rows(),B.columns()).assign(B);
+  diag.viewPart(A.rows()+B.rows(),A.columns()+B.columns(),C.rows(),C.columns()).assign(C);
+  return diag;
 }
 /**
 Splits a block matrix into its constituent blocks; Copies blocks of a matrix into the given parts.
@@ -412,13 +412,13 @@
 Example:
 <table border="1" cellspacing="0">
   <tr align="left" valign="top"> 
-	<td><tt>Code</tt></td>
-	<td><tt>matrix</tt></td>
-	<td><tt>--&gt; parts </tt></td>
+  <td><tt>Code</tt></td>
+  <td><tt>matrix</tt></td>
+  <td><tt>--&gt; parts </tt></td>
   </tr>
   <tr align="left" valign="top"> 
-	<td> 
-	  <pre>
+  <td> 
+    <pre>
 DoubleMatrix2D matrix = ... ;
 DoubleMatrix2D _ = null;
 DoubleMatrix2D A,B,C,D;
@@ -436,98 +436,98 @@
 System.out.println(&quot;\nC = &quot;+C);
 System.out.println(&quot;\nD = &quot;+D);
 </pre>
-	</td>
-	<td><tt>8&nbsp;x&nbsp;9&nbsp;matrix<br>
-	  9&nbsp;9&nbsp;9&nbsp;9&nbsp;1&nbsp;1&nbsp;9&nbsp;9&nbsp;9<br>
-	  9&nbsp;9&nbsp;9&nbsp;9&nbsp;1&nbsp;1&nbsp;9&nbsp;9&nbsp;9<br>
-	  2&nbsp;2&nbsp;2&nbsp;2&nbsp;9&nbsp;9&nbsp;3&nbsp;3&nbsp;3<br>
-	  2&nbsp;2&nbsp;2&nbsp;2&nbsp;9&nbsp;9&nbsp;3&nbsp;3&nbsp;3<br>
-	  2&nbsp;2&nbsp;2&nbsp;2&nbsp;9&nbsp;9&nbsp;3&nbsp;3&nbsp;3<br>
-	  2&nbsp;2&nbsp;2&nbsp;2&nbsp;9&nbsp;9&nbsp;3&nbsp;3&nbsp;3<br>
-	  9&nbsp;9&nbsp;9&nbsp;9&nbsp;4&nbsp;4&nbsp;9&nbsp;9&nbsp;9<br>
-	  9&nbsp;9&nbsp;9&nbsp;9&nbsp;4&nbsp;4&nbsp;9&nbsp;9&nbsp;9</tt></td>
-	<td> 
-	  <p><tt>A = 2&nbsp;x&nbsp;2&nbsp;matrix<br>
-		1&nbsp;1<br>
-		1&nbsp;1</tt></p>
-	  <p><tt>B = 4&nbsp;x&nbsp;4&nbsp;matrix<br>
-		2&nbsp;2&nbsp;2&nbsp;2<br>
-		2&nbsp;2&nbsp;2&nbsp;2<br>
-		2&nbsp;2&nbsp;2&nbsp;2<br>
-		2&nbsp;2&nbsp;2&nbsp;2</tt></p>
-	  <p><tt>C = 4&nbsp;x&nbsp;3&nbsp;matrix<br>
-		3&nbsp;3&nbsp;3<br>
-		3&nbsp;3&nbsp;3<br>
-		</tt><tt>3&nbsp;3&nbsp;3<br>
-		</tt><tt>3&nbsp;3&nbsp;3</tt></p>
-	  <p><tt>D = 2&nbsp;x&nbsp;2&nbsp;matrix<br>
-		4&nbsp;4<br>
-		4&nbsp;4</tt></p>
-	  </td>
+  </td>
+  <td><tt>8&nbsp;x&nbsp;9&nbsp;matrix<br>
+    9&nbsp;9&nbsp;9&nbsp;9&nbsp;1&nbsp;1&nbsp;9&nbsp;9&nbsp;9<br>
+    9&nbsp;9&nbsp;9&nbsp;9&nbsp;1&nbsp;1&nbsp;9&nbsp;9&nbsp;9<br>
+    2&nbsp;2&nbsp;2&nbsp;2&nbsp;9&nbsp;9&nbsp;3&nbsp;3&nbsp;3<br>
+    2&nbsp;2&nbsp;2&nbsp;2&nbsp;9&nbsp;9&nbsp;3&nbsp;3&nbsp;3<br>
+    2&nbsp;2&nbsp;2&nbsp;2&nbsp;9&nbsp;9&nbsp;3&nbsp;3&nbsp;3<br>
+    2&nbsp;2&nbsp;2&nbsp;2&nbsp;9&nbsp;9&nbsp;3&nbsp;3&nbsp;3<br>
+    9&nbsp;9&nbsp;9&nbsp;9&nbsp;4&nbsp;4&nbsp;9&nbsp;9&nbsp;9<br>
+    9&nbsp;9&nbsp;9&nbsp;9&nbsp;4&nbsp;4&nbsp;9&nbsp;9&nbsp;9</tt></td>
+  <td> 
+    <p><tt>A = 2&nbsp;x&nbsp;2&nbsp;matrix<br>
+    1&nbsp;1<br>
+    1&nbsp;1</tt></p>
+    <p><tt>B = 4&nbsp;x&nbsp;4&nbsp;matrix<br>
+    2&nbsp;2&nbsp;2&nbsp;2<br>
+    2&nbsp;2&nbsp;2&nbsp;2<br>
+    2&nbsp;2&nbsp;2&nbsp;2<br>
+    2&nbsp;2&nbsp;2&nbsp;2</tt></p>
+    <p><tt>C = 4&nbsp;x&nbsp;3&nbsp;matrix<br>
+    3&nbsp;3&nbsp;3<br>
+    3&nbsp;3&nbsp;3<br>
+    </tt><tt>3&nbsp;3&nbsp;3<br>
+    </tt><tt>3&nbsp;3&nbsp;3</tt></p>
+    <p><tt>D = 2&nbsp;x&nbsp;2&nbsp;matrix<br>
+    4&nbsp;4<br>
+    4&nbsp;4</tt></p>
+    </td>
   </tr>
 </table>
 @throws IllegalArgumentException subject to the conditions outlined above.
 */
 public void decompose(DoubleMatrix2D[][] parts, DoubleMatrix2D matrix) {
-	checkRectangularShape(parts);
-	int rows = parts.length;
-	int columns = 0;
-	if (parts.length > 0) columns = parts[0].length;
-	if (rows==0 || columns==0) return;
+  checkRectangularShape(parts);
+  int rows = parts.length;
+  int columns = 0;
+  if (parts.length > 0) columns = parts[0].length;
+  if (rows==0 || columns==0) return;
 
-	// determine maximum column width of each column
-	int[] maxWidths = new int[columns];
-	for (int column=columns; --column >= 0; ) {
-		int maxWidth = 0;
-		for (int row=rows; --row >= 0; ) {
-			DoubleMatrix2D part = parts[row][column];		
-			if (part != null) {
-				int width = part.columns();
-				if (maxWidth>0 && width>0 && width!=maxWidth) throw new IllegalArgumentException("Different number of columns.");
-				maxWidth = Math.max(maxWidth,width);
-			}
-		}
-		maxWidths[column] = maxWidth;
-	}
+  // determine maximum column width of each column
+  int[] maxWidths = new int[columns];
+  for (int column=columns; --column >= 0; ) {
+    int maxWidth = 0;
+    for (int row=rows; --row >= 0; ) {
+      DoubleMatrix2D part = parts[row][column];    
+      if (part != null) {
+        int width = part.columns();
+        if (maxWidth>0 && width>0 && width!=maxWidth) throw new IllegalArgumentException("Different number of columns.");
+        maxWidth = Math.max(maxWidth,width);
+      }
+    }
+    maxWidths[column] = maxWidth;
+  }
 
-	// determine row height of each row
-	int[] maxHeights = new int[rows];
-	for (int row=rows; --row >= 0; ) {
-		int maxHeight = 0;
-		for (int column=columns; --column >= 0; ) {
-			DoubleMatrix2D part = parts[row][column];		
-			if (part != null) {
-				int height = part.rows();
-				if (maxHeight>0  && height>0 && height!=maxHeight) throw new IllegalArgumentException("Different number of rows.");
-				maxHeight = Math.max(maxHeight,height);
-			}
-		}
-		maxHeights[row] = maxHeight;
-	}
+  // determine row height of each row
+  int[] maxHeights = new int[rows];
+  for (int row=rows; --row >= 0; ) {
+    int maxHeight = 0;
+    for (int column=columns; --column >= 0; ) {
+      DoubleMatrix2D part = parts[row][column];    
+      if (part != null) {
+        int height = part.rows();
+        if (maxHeight>0  && height>0 && height!=maxHeight) throw new IllegalArgumentException("Different number of rows.");
+        maxHeight = Math.max(maxHeight,height);
+      }
+    }
+    maxHeights[row] = maxHeight;
+  }
 
 
-	// shape of result parts
-	int resultRows = 0;
-	for (int row=rows; --row >= 0; ) resultRows += maxHeights[row];
-	int resultCols = 0;
-	for (int column=columns; --column >= 0; ) resultCols += maxWidths[column];
+  // shape of result parts
+  int resultRows = 0;
+  for (int row=rows; --row >= 0; ) resultRows += maxHeights[row];
+  int resultCols = 0;
+  for (int column=columns; --column >= 0; ) resultCols += maxWidths[column];
 
-	if (matrix.rows() < resultRows || matrix.columns() < resultCols) throw new IllegalArgumentException("Parts larger than matrix.");
-	
-	// copy
-	int r=0;
-	for (int row=0; row < rows; row++) {
-		int c=0;
-		for (int column=0; column < columns; column++) {
-			DoubleMatrix2D part = parts[row][column];
-			if (part != null) {
-				part.assign(matrix.viewPart(r,c,part.rows(),part.columns()));
-			}
-			c += maxWidths[column];
-		}
-		r += maxHeights[row];
-	}
-	
+  if (matrix.rows() < resultRows || matrix.columns() < resultCols) throw new IllegalArgumentException("Parts larger than matrix.");
+  
+  // copy
+  int r=0;
+  for (int row=0; row < rows; row++) {
+    int c=0;
+    for (int column=0; column < columns; column++) {
+      DoubleMatrix2D part = parts[row][column];
+      if (part != null) {
+        part.assign(matrix.viewPart(r,c,part.rows(),part.columns()));
+      }
+      c += maxWidths[column];
+    }
+    r += maxHeights[row];
+  }
+  
 }
 /**
  * Demonstrates usage of this class.
@@ -536,9 +536,9 @@
 System.out.println("\n\n");
 DoubleMatrix2D[][] parts1 = 
 {
-	{ null,        make(2,2,1), null        },
-	{ make(4,4,2), null,        make(4,3,3) },
-	{ null,        make(2,2,4), null        }
+  { null,        make(2,2,1), null        },
+  { make(4,4,2), null,        make(4,3,3) },
+  { null,        make(2,2,4), null        }
 };
 System.out.println("\n"+compose(parts1));
 //System.out.println("\n"+org.apache.mahout.matrix.matrixpattern.Converting.toHTML(make(parts1).toString()));
@@ -548,18 +548,18 @@
 illegal 2 != 3
 DoubleMatrix2D[][] parts2 = 
 {
-	{ null,        make(2,2,1), null        },
-	{ make(4,4,2), null,        make(4,3,3) },
-	{ null,        make(2,3,4), null        }
+  { null,        make(2,2,1), null        },
+  { make(4,4,2), null,        make(4,3,3) },
+  { null,        make(2,3,4), null        }
 };
 System.out.println("\n"+make(parts2));
 */
 
 DoubleMatrix2D[][] parts3 = 
 {
-	{ identity(3),               null,                        },
-	{ null,                      identity(3).viewColumnFlip() },
-	{ identity(3).viewRowFlip(), null                         }
+  { identity(3),               null,                        },
+  { null,                      identity(3).viewColumnFlip() },
+  { identity(3).viewRowFlip(), null                         }
 };
 System.out.println("\n"+compose(parts3));
 //System.out.println("\n"+org.apache.mahout.matrix.matrixpattern.Converting.toHTML(make(parts3).toString()));
@@ -570,8 +570,8 @@
 
 DoubleMatrix2D[][] parts4 = 
 {
-	{ A, _, A, _ },
-	{ _, A, _, B }
+  { A, _, A, _ },
+  { _, A, _, B }
 };
 System.out.println("\n"+compose(parts4));
 //System.out.println("\n"+org.apache.mahout.matrix.matrixpattern.Converting.toHTML(make(parts4).toString()));
@@ -588,9 +588,9 @@
 A = make(2,2,1); B = make (4,4,2); C = make(4,3,3); D = make (2,2,4);
 DoubleMatrix2D[][] parts1 = 
 {
-	{ _, A, _ },
-	{ B, _, C },
-	{ _, D, _ }
+  { _, A, _ },
+  { B, _, C },
+  { _, D, _ }
 };
 matrix = compose(parts1);
 System.out.println("\n"+matrix);
@@ -608,9 +608,9 @@
 illegal 2 != 3
 DoubleMatrix2D[][] parts2 = 
 {
-	{ null,        make(2,2,1), null        },
-	{ make(4,4,2), null,        make(4,3,3) },
-	{ null,        make(2,3,4), null        }
+  { null,        make(2,2,1), null        },
+  { make(4,4,2), null,        make(4,3,3) },
+  { null,        make(2,3,4), null        }
 };
 System.out.println("\n"+Factory2D.make(parts2));
 */
@@ -618,9 +618,9 @@
 /*
 DoubleMatrix2D[][] parts3 = 
 {
-	{ identity(3),               null,                        },
-	{ null,                      identity(3).viewColumnFlip() },
-	{ identity(3).viewRowFlip(), null                         }
+  { identity(3),               null,                        },
+  { null,                      identity(3).viewColumnFlip() },
+  { identity(3).viewRowFlip(), null                         }
 };
 System.out.println("\n"+make(parts3));
 //System.out.println("\n"+org.apache.mahout.matrix.matrixpattern.Converting.toHTML(make(parts3).toString()));
@@ -631,8 +631,8 @@
 
 DoubleMatrix2D[][] parts4 = 
 {
-	{ A, _, A, _ },
-	{ _, A, _, B }
+  { A, _, A, _ },
+  { _, A, _, B }
 };
 System.out.println("\n"+make(parts4));
 //System.out.println("\n"+org.apache.mahout.matrix.matrixpattern.Converting.toHTML(make(parts4).toString()));
@@ -648,14 +648,14 @@
 </pre>
 */
 public DoubleMatrix2D descending(int rows, int columns) {
-	DoubleMatrix2D matrix = make(rows,columns);
-	int v = 0;
-	for (int row=rows; --row >= 0;) {
-		for (int column=columns; --column >= 0;) {
-			matrix.setQuick(row, column, v++);
-		}
-	}
-	return matrix;
+  DoubleMatrix2D matrix = make(rows,columns);
+  int v = 0;
+  for (int row=rows; --row >= 0;) {
+    for (int column=columns; --column >= 0;) {
+      matrix.setQuick(row, column, v++);
+    }
+  }
+  return matrix;
 }
 /**
 Constructs a new diagonal matrix whose diagonal elements are the elements of <tt>vector</tt>.
@@ -670,12 +670,12 @@
 @return a new matrix.
 */
 public DoubleMatrix2D diagonal(DoubleMatrix1D vector) {
-	int size = vector.size();
-	DoubleMatrix2D diag = make(size,size);
-	for (int i=size; --i >= 0; ) {
-		diag.setQuick(i,i, vector.getQuick(i));
-	}
-	return diag;
+  int size = vector.size();
+  DoubleMatrix2D diag = make(size,size);
+  for (int i=size; --i >= 0; ) {
+    diag.setQuick(i,i, vector.getQuick(i));
+  }
+  return diag;
 }
 /**
 Constructs a new vector consisting of the diagonal elements of <tt>A</tt>.
@@ -691,22 +691,22 @@
 @return a new vector.
 */
 public DoubleMatrix1D diagonal(DoubleMatrix2D A) {
-	int min = Math.min(A.rows(),A.columns());
-	DoubleMatrix1D diag = make1D(min);
-	for (int i=min; --i >= 0; ) {
-		diag.setQuick(i, A.getQuick(i,i));
-	}
-	return diag;
+  int min = Math.min(A.rows(),A.columns());
+  DoubleMatrix1D diag = make1D(min);
+  for (int i=min; --i >= 0; ) {
+    diag.setQuick(i, A.getQuick(i,i));
+  }
+  return diag;
 }
 /**
  * Constructs an identity matrix (having ones on the diagonal and zeros elsewhere).
  */
 public DoubleMatrix2D identity(int rowsAndColumns) {
-	DoubleMatrix2D matrix = make(rowsAndColumns,rowsAndColumns);
-	for (int i=rowsAndColumns; --i >= 0; ) {
-		matrix.setQuick(i,i, 1);
-	}
-	return matrix;
+  DoubleMatrix2D matrix = make(rowsAndColumns,rowsAndColumns);
+  for (int i=rowsAndColumns; --i >= 0; ) {
+    matrix.setQuick(i,i, 1);
+  }
+  return matrix;
 }
 /**
  * Constructs a matrix with the given cell values.
@@ -719,8 +719,8 @@
  * @throws IllegalArgumentException if <tt>for any 1 &lt;= row &lt; values.length: values[row].length != values[row-1].length</tt>.
  */
 public DoubleMatrix2D make(double[][] values) {
-	if (this==sparse) return new SparseDoubleMatrix2D(values);
-	else return new DenseDoubleMatrix2D(values);
+  if (this==sparse) return new SparseDoubleMatrix2D(values);
+  else return new DenseDoubleMatrix2D(values);
 }
 /** 
 Construct a matrix from a one-dimensional column-major packed array, ala Fortran.
@@ -732,45 +732,45 @@
 @exception  IllegalArgumentException <tt>values.length</tt> must be a multiple of <tt>rows</tt>.
 */
 public DoubleMatrix2D make(double values[], int rows) {
-	int columns = (rows != 0 ? values.length/rows : 0);
-	if (rows*columns != values.length) 
-		throw new IllegalArgumentException("Array length must be a multiple of m.");
-		
-	DoubleMatrix2D matrix = make(rows,columns);
-	for (int row=0; row < rows; row++) {
-		for (int column=0; column < columns; column++) {
-			matrix.setQuick(row,column, values[row + column*rows]);
-		}
-	}
-	return matrix;
+  int columns = (rows != 0 ? values.length/rows : 0);
+  if (rows*columns != values.length) 
+    throw new IllegalArgumentException("Array length must be a multiple of m.");
+    
+  DoubleMatrix2D matrix = make(rows,columns);
+  for (int row=0; row < rows; row++) {
+    for (int column=0; column < columns; column++) {
+      matrix.setQuick(row,column, values[row + column*rows]);
+    }
+  }
+  return matrix;
 }
 /**
  * Constructs a matrix with the given shape, each cell initialized with zero.
  */
 public DoubleMatrix2D make(int rows, int columns) {
-	if (this==sparse) return new SparseDoubleMatrix2D(rows,columns);
-	if (this==rowCompressed) return new RCDoubleMatrix2D(rows,columns);
-	//if (this==rowCompressedModified) return new RCMDoubleMatrix2D(rows,columns);
-	else return new DenseDoubleMatrix2D(rows,columns);
+  if (this==sparse) return new SparseDoubleMatrix2D(rows,columns);
+  if (this==rowCompressed) return new RCDoubleMatrix2D(rows,columns);
+  //if (this==rowCompressedModified) return new RCMDoubleMatrix2D(rows,columns);
+  else return new DenseDoubleMatrix2D(rows,columns);
 }
 /**
  * Constructs a matrix with the given shape, each cell initialized with the given value.
  */
 public DoubleMatrix2D make(int rows, int columns, double initialValue) {
-	if (initialValue == 0) return make(rows,columns);
-	return make(rows,columns).assign(initialValue);
+  if (initialValue == 0) return make(rows,columns);
+  return make(rows,columns).assign(initialValue);
 }
 /**
  * Constructs a 1d matrix of the right dynamic type.
  */
 protected DoubleMatrix1D make1D(int size) {
-	return make(0,0).like1D(size);
+  return make(0,0).like1D(size);
 }
 /**
  * Constructs a matrix with uniformly distributed values in <tt>(0,1)</tt> (exclusive).
  */
 public DoubleMatrix2D random(int rows, int columns) {
-	return make(rows,columns).assign(org.apache.mahout.jet.math.Functions.random());
+  return make(rows,columns).assign(org.apache.mahout.jet.math.Functions.random());
 }
 /**
 C = A||A||..||A; Constructs a new matrix which is duplicated both along the row and column dimension.
@@ -786,15 +786,15 @@
 </pre>
 */
 public DoubleMatrix2D repeat(DoubleMatrix2D A, int rowRepeat, int columnRepeat) {
-	int r = A.rows();
-	int c = A.columns();
-	DoubleMatrix2D matrix = make(r*rowRepeat, c*columnRepeat);
-	for (int i=rowRepeat; --i >= 0; ) {
-		for (int j=columnRepeat; --j >= 0; ) {
-			matrix.viewPart(r*i,c*j,r,c).assign(A);
-		}
-	}
-	return matrix;
+  int r = A.rows();
+  int c = A.columns();
+  DoubleMatrix2D matrix = make(r*rowRepeat, c*columnRepeat);
+  for (int i=rowRepeat; --i >= 0; ) {
+    for (int j=columnRepeat; --j >= 0; ) {
+      matrix.viewPart(r*i,c*j,r,c).assign(A);
+    }
+  }
+  return matrix;
 }
 /**
  * Constructs a randomly sampled matrix with the given shape.
@@ -805,9 +805,9 @@
  * @see org.apache.mahout.jet.random.sampling.RandomSampler
  */
 public DoubleMatrix2D sample(int rows, int columns, double value, double nonZeroFraction)  {
-	DoubleMatrix2D matrix = make(rows,columns);
-	sample(matrix,value,nonZeroFraction);
-	return matrix;
+  DoubleMatrix2D matrix = make(rows,columns);
+  sample(matrix,value,nonZeroFraction);
+  return matrix;
 }
 /**
  * Modifies the given matrix to be a randomly sampled matrix.
@@ -818,28 +818,28 @@
  * @see org.apache.mahout.jet.random.sampling.RandomSampler
  */
 public DoubleMatrix2D sample(DoubleMatrix2D matrix, double value, double nonZeroFraction)  {
-	int rows = matrix.rows();
-	int columns = matrix.columns();
-	double epsilon = 1e-09;
-	if (nonZeroFraction < 0 - epsilon || nonZeroFraction > 1 + epsilon) throw new IllegalArgumentException();
-	if (nonZeroFraction < 0) nonZeroFraction = 0;
-	if (nonZeroFraction > 1) nonZeroFraction = 1;
-	
-	matrix.assign(0);
+  int rows = matrix.rows();
+  int columns = matrix.columns();
+  double epsilon = 1e-09;
+  if (nonZeroFraction < 0 - epsilon || nonZeroFraction > 1 + epsilon) throw new IllegalArgumentException();
+  if (nonZeroFraction < 0) nonZeroFraction = 0;
+  if (nonZeroFraction > 1) nonZeroFraction = 1;
+  
+  matrix.assign(0);
 
-	int size = rows*columns;
-	int n = (int) Math.round(size*nonZeroFraction);
-	if (n==0) return matrix;
+  int size = rows*columns;
+  int n = (int) Math.round(size*nonZeroFraction);
+  if (n==0) return matrix;
 
-	org.apache.mahout.jet.random.sampling.RandomSamplingAssistant sampler = new org.apache.mahout.jet.random.sampling.RandomSamplingAssistant(n,size,new org.apache.mahout.jet.random.engine.MersenneTwister());
-	for (int i=0; i < size; i++) {
-		if (sampler.sampleNextElement()) {
-			int row = (int) (i/columns);
-			int column = (int) (i%columns);
-			matrix.set(row,column, value);
-		}
-	}
-	
-	return matrix;
+  org.apache.mahout.jet.random.sampling.RandomSamplingAssistant sampler = new org.apache.mahout.jet.random.sampling.RandomSamplingAssistant(n,size,new org.apache.mahout.jet.random.engine.MersenneTwister());
+  for (int i=0; i < size; i++) {
+    if (sampler.sampleNextElement()) {
+      int row = (int) (i/columns);
+      int column = (int) (i%columns);
+      matrix.set(row,column, value);
+    }
+  }
+  
+  return matrix;
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/DoubleFactory3D.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/DoubleFactory3D.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/DoubleFactory3D.java	(working copy)
@@ -37,15 +37,15 @@
  */
 @Deprecated
 public class DoubleFactory3D extends org.apache.mahout.matrix.PersistentObject {
-	/**
-	 * A factory producing dense matrices.
-	 */
-	public static final DoubleFactory3D dense  = new DoubleFactory3D();
+  /**
+   * A factory producing dense matrices.
+   */
+  public static final DoubleFactory3D dense  = new DoubleFactory3D();
 
-	/**
-	 * A factory producing sparse matrices.
-	 */
-	public static final DoubleFactory3D sparse = new DoubleFactory3D();
+  /**
+   * A factory producing sparse matrices.
+   */
+  public static final DoubleFactory3D sparse = new DoubleFactory3D();
 /**
  * Makes this class non instantiable, but still let's others inherit from it.
  */
@@ -55,24 +55,24 @@
  * For debugging purposes.
  */
 public DoubleMatrix3D ascending(int slices, int rows, int columns) {
-	org.apache.mahout.jet.math.Functions F = org.apache.mahout.jet.math.Functions.functions;
-	return descending(slices,rows,columns).assign(F.chain(F.neg,F.minus(slices*rows*columns)));
+  org.apache.mahout.jet.math.Functions F = org.apache.mahout.jet.math.Functions.functions;
+  return descending(slices,rows,columns).assign(F.chain(F.neg,F.minus(slices*rows*columns)));
 }
 /**
  * Constructs a matrix with cells having descending values.
  * For debugging purposes.
  */
 public DoubleMatrix3D descending(int slices, int rows, int columns) {
-	DoubleMatrix3D matrix = make(slices,rows,columns);
-	int v = 0;
-	for (int slice=slices; --slice >= 0;) {
-		for (int row=rows; --row >= 0;) {
-			for (int column=columns; --column >= 0;) {
-				matrix.setQuick(slice, row, column, v++);
-			}
-		}
-	}
-	return matrix;
+  DoubleMatrix3D matrix = make(slices,rows,columns);
+  int v = 0;
+  for (int slice=slices; --slice >= 0;) {
+    for (int row=rows; --row >= 0;) {
+      for (int column=columns; --column >= 0;) {
+        matrix.setQuick(slice, row, column, v++);
+      }
+    }
+  }
+  return matrix;
 }
 /**
  * Constructs a matrix with the given cell values.
@@ -87,26 +87,26 @@
  * @throws IllegalArgumentException if <tt>for any 0 &lt;= column &lt; columns(): values[slice][row].length != columns()</tt>.
  */
 public DoubleMatrix3D make(double[][][] values) {
-	if (this==sparse) return new SparseDoubleMatrix3D(values);
-	return new DenseDoubleMatrix3D(values);
+  if (this==sparse) return new SparseDoubleMatrix3D(values);
+  return new DenseDoubleMatrix3D(values);
 }
 /**
  * Constructs a matrix with the given shape, each cell initialized with zero.
  */
 public DoubleMatrix3D make(int slices, int rows, int columns) {
-	if (this==sparse) return new SparseDoubleMatrix3D(slices,rows,columns);
-	return new DenseDoubleMatrix3D(slices,rows,columns);
+  if (this==sparse) return new SparseDoubleMatrix3D(slices,rows,columns);
+  return new DenseDoubleMatrix3D(slices,rows,columns);
 }
 /**
  * Constructs a matrix with the given shape, each cell initialized with the given value.
  */
 public DoubleMatrix3D make(int slices, int rows, int columns, double initialValue) {
-	return make(slices,rows,columns).assign(initialValue);
+  return make(slices,rows,columns).assign(initialValue);
 }
 /**
  * Constructs a matrix with uniformly distributed values in <tt>(0,1)</tt> (exclusive).
  */
 public DoubleMatrix3D random(int slices, int rows, int columns) {
-	return make(slices,rows,columns).assign(org.apache.mahout.jet.math.Functions.random());
+  return make(slices,rows,columns).assign(org.apache.mahout.jet.math.Functions.random());
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/objectalgo/Formatter.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/objectalgo/Formatter.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/objectalgo/Formatter.java	(working copy)
@@ -32,123 +32,123 @@
  * Constructs and returns a matrix formatter with alignment <tt>LEFT</tt>.
  */
 public Formatter() {
-	this(LEFT);
+  this(LEFT);
 }
 /**
  * Constructs and returns a matrix formatter.
  * @param alignment the given alignment used to align a column.
  */
 public Formatter(String alignment) {
-	setAlignment(alignment);
+  setAlignment(alignment);
 }
 /**
  * Converts a given cell to a String; no alignment considered.
  */
 protected String form(AbstractMatrix1D matrix, int index, Former formatter) {
-	return this.form((ObjectMatrix1D) matrix, index, formatter);
+  return this.form((ObjectMatrix1D) matrix, index, formatter);
 }
 /**
  * Converts a given cell to a String; no alignment considered.
  */
 protected String form(ObjectMatrix1D matrix, int index, Former formatter) {
-	Object value = matrix.get(index);
-	if (value==null) return "";
-	return String.valueOf(value);
+  Object value = matrix.get(index);
+  if (value==null) return "";
+  return String.valueOf(value);
 }
 /**
  * Returns a string representations of all cells; no alignment considered.
  */
 protected String[][] format(AbstractMatrix2D matrix) {
-	return this.format((ObjectMatrix2D) matrix);
+  return this.format((ObjectMatrix2D) matrix);
 }
 /**
  * Returns a string representations of all cells; no alignment considered.
  */
 protected String[][] format(ObjectMatrix2D matrix) {
-	String[][] strings = new String[matrix.rows()][matrix.columns()];
-	for (int row=matrix.rows(); --row >= 0; ) strings[row] = formatRow(matrix.viewRow(row));
-	return strings;
+  String[][] strings = new String[matrix.rows()][matrix.columns()];
+  for (int row=matrix.rows(); --row >= 0; ) strings[row] = formatRow(matrix.viewRow(row));
+  return strings;
 }
 /**
  * Returns a string <tt>s</tt> such that <tt>Object[] m = s</tt> is a legal Java statement.
  * @param matrix the matrix to format.
  */
 public String toSourceCode(ObjectMatrix1D matrix) {
-	Formatter copy = (Formatter) this.clone();
-	copy.setPrintShape(false);
-	copy.setColumnSeparator(", ");
-	String lead  = "{";
-	String trail = "};";
-	return lead + copy.toString(matrix) + trail;
+  Formatter copy = (Formatter) this.clone();
+  copy.setPrintShape(false);
+  copy.setColumnSeparator(", ");
+  String lead  = "{";
+  String trail = "};";
+  return lead + copy.toString(matrix) + trail;
 }
 /**
  * Returns a string <tt>s</tt> such that <tt>Object[] m = s</tt> is a legal Java statement.
  * @param matrix the matrix to format.
  */
 public String toSourceCode(ObjectMatrix2D matrix) {
-	Formatter copy = (Formatter) this.clone();
-	String b3 = blanks(3);
-	copy.setPrintShape(false);
-	copy.setColumnSeparator(", ");
-	copy.setRowSeparator("},\n"+b3+"{");
-	String lead  = "{\n"+b3+"{";
-	String trail = "}\n};";
-	return lead + copy.toString(matrix) + trail;
+  Formatter copy = (Formatter) this.clone();
+  String b3 = blanks(3);
+  copy.setPrintShape(false);
+  copy.setColumnSeparator(", ");
+  copy.setRowSeparator("},\n"+b3+"{");
+  String lead  = "{\n"+b3+"{";
+  String trail = "}\n};";
+  return lead + copy.toString(matrix) + trail;
 }
 /**
  * Returns a string <tt>s</tt> such that <tt>Object[] m = s</tt> is a legal Java statement.
  * @param matrix the matrix to format.
  */
 public String toSourceCode(ObjectMatrix3D matrix) {
-	Formatter copy = (Formatter) this.clone();
-	String b3 = blanks(3);
-	String b6 = blanks(6);
-	copy.setPrintShape(false);
-	copy.setColumnSeparator(", ");
-	copy.setRowSeparator("},\n"+b6+"{");
-	copy.setSliceSeparator("}\n"+b3+"},\n"+b3+"{\n"+b6+"{");
-	String lead  = "{\n"+b3+"{\n"+b6+"{";
-	String trail = "}\n"+b3+"}\n}";
-	return lead + copy.toString(matrix) + trail;
+  Formatter copy = (Formatter) this.clone();
+  String b3 = blanks(3);
+  String b6 = blanks(6);
+  copy.setPrintShape(false);
+  copy.setColumnSeparator(", ");
+  copy.setRowSeparator("},\n"+b6+"{");
+  copy.setSliceSeparator("}\n"+b3+"},\n"+b3+"{\n"+b6+"{");
+  String lead  = "{\n"+b3+"{\n"+b6+"{";
+  String trail = "}\n"+b3+"}\n}";
+  return lead + copy.toString(matrix) + trail;
 }
 /**
  * Returns a string representation of the given matrix.
  * @param matrix the matrix to convert.
  */
 protected String toString(AbstractMatrix2D matrix) {
-	return this.toString((ObjectMatrix2D) matrix);
+  return this.toString((ObjectMatrix2D) matrix);
 }
 /**
  * Returns a string representation of the given matrix.
  * @param matrix the matrix to convert.
  */
 public String toString(ObjectMatrix1D matrix) {
-	ObjectMatrix2D easy = matrix.like2D(1,matrix.size());
-	easy.viewRow(0).assign(matrix);
-	return toString(easy);
+  ObjectMatrix2D easy = matrix.like2D(1,matrix.size());
+  easy.viewRow(0).assign(matrix);
+  return toString(easy);
 }
 /**
  * Returns a string representation of the given matrix.
  * @param matrix the matrix to convert.
  */
 public String toString(ObjectMatrix2D matrix) {
-	return super.toString(matrix);
+  return super.toString(matrix);
 }
 /**
  * Returns a string representation of the given matrix.
  * @param matrix the matrix to convert.
  */
 public String toString(ObjectMatrix3D matrix) {
-	StringBuffer buf = new StringBuffer();
-	boolean oldPrintShape = this.printShape;
-	this.printShape = false;
-	for (int slice=0; slice < matrix.slices(); slice++) {
-		if (slice!=0) buf.append(sliceSeparator);
-		buf.append(toString(matrix.viewSlice(slice)));
-	}
-	this.printShape = oldPrintShape;	
-	if (printShape) buf.insert(0,shape(matrix) + "\n");
-	return buf.toString();
+  StringBuffer buf = new StringBuffer();
+  boolean oldPrintShape = this.printShape;
+  this.printShape = false;
+  for (int slice=0; slice < matrix.slices(); slice++) {
+    if (slice!=0) buf.append(sliceSeparator);
+    buf.append(toString(matrix.viewSlice(slice)));
+  }
+  this.printShape = oldPrintShape;  
+  if (printShape) buf.insert(0,shape(matrix) + "\n");
+  return buf.toString();
 }
 /**
 Returns a string representation of the given matrix with axis as well as rows and columns labeled.
@@ -163,78 +163,78 @@
 @return the matrix converted to a string.
 */
 public String toTitleString(ObjectMatrix2D matrix, String[] rowNames, String[] columnNames, String rowAxisName, String columnAxisName, String title) {
-	if (matrix.size()==0) return "Empty matrix";
-	String oldFormat = this.format;
-	this.format = LEFT;
-		
-	int rows = matrix.rows();
-	int columns = matrix.columns();
+  if (matrix.size()==0) return "Empty matrix";
+  String oldFormat = this.format;
+  this.format = LEFT;
+    
+  int rows = matrix.rows();
+  int columns = matrix.columns();
 
-	// determine how many rows and columns are needed
-	int r=0;
-	int c=0;
-	r += (columnNames==null ? 0 : 1);
-	c += (rowNames==null ? 0 : 1);
-	c += (rowAxisName==null ? 0 : 1);
-	c += (rowNames!=null || rowAxisName!=null ? 1 : 0);
+  // determine how many rows and columns are needed
+  int r=0;
+  int c=0;
+  r += (columnNames==null ? 0 : 1);
+  c += (rowNames==null ? 0 : 1);
+  c += (rowAxisName==null ? 0 : 1);
+  c += (rowNames!=null || rowAxisName!=null ? 1 : 0);
 
-	int height = r + Math.max(rows, rowAxisName==null ? 0: rowAxisName.length());
-	int width = c + columns;
-	
-	// make larger matrix holding original matrix and naming strings
-	org.apache.mahout.matrix.matrix.ObjectMatrix2D titleMatrix = matrix.like(height, width);
-	
-	// insert original matrix into larger matrix
-	titleMatrix.viewPart(r,c,rows,columns).assign(matrix);
+  int height = r + Math.max(rows, rowAxisName==null ? 0: rowAxisName.length());
+  int width = c + columns;
+  
+  // make larger matrix holding original matrix and naming strings
+  org.apache.mahout.matrix.matrix.ObjectMatrix2D titleMatrix = matrix.like(height, width);
+  
+  // insert original matrix into larger matrix
+  titleMatrix.viewPart(r,c,rows,columns).assign(matrix);
 
-	// insert column axis name in leading row
-	if (r>0) titleMatrix.viewRow(0).viewPart(c,columns).assign(columnNames);
+  // insert column axis name in leading row
+  if (r>0) titleMatrix.viewRow(0).viewPart(c,columns).assign(columnNames);
 
-	// insert row axis name in leading column
-	if (rowAxisName!=null) {
-		String[] rowAxisStrings = new String[rowAxisName.length()];
-		for (int i=rowAxisName.length(); --i >= 0; ) rowAxisStrings[i] = rowAxisName.substring(i,i+1);
-		titleMatrix.viewColumn(0).viewPart(r,rowAxisName.length()).assign(rowAxisStrings);
-	}
-	// insert row names in next leading columns
-	if (rowNames!=null) titleMatrix.viewColumn(c-2).viewPart(r,rows).assign(rowNames);
+  // insert row axis name in leading column
+  if (rowAxisName!=null) {
+    String[] rowAxisStrings = new String[rowAxisName.length()];
+    for (int i=rowAxisName.length(); --i >= 0; ) rowAxisStrings[i] = rowAxisName.substring(i,i+1);
+    titleMatrix.viewColumn(0).viewPart(r,rowAxisName.length()).assign(rowAxisStrings);
+  }
+  // insert row names in next leading columns
+  if (rowNames!=null) titleMatrix.viewColumn(c-2).viewPart(r,rows).assign(rowNames);
 
-	// insert vertical "---------" separator line in next leading column
-	if (c>0) titleMatrix.viewColumn(c-2+1).viewPart(0,rows+r).assign("|");
+  // insert vertical "---------" separator line in next leading column
+  if (c>0) titleMatrix.viewColumn(c-2+1).viewPart(0,rows+r).assign("|");
 
-	// convert the large matrix to a string
-	boolean oldPrintShape = this.printShape;
-	this.printShape = false;
-	String str = toString(titleMatrix);
-	this.printShape = oldPrintShape;
+  // convert the large matrix to a string
+  boolean oldPrintShape = this.printShape;
+  this.printShape = false;
+  String str = toString(titleMatrix);
+  this.printShape = oldPrintShape;
 
-	// insert horizontal "--------------" separator line
-	StringBuffer total = new StringBuffer(str);
-	if (columnNames != null) {
-	int i = str.indexOf(rowSeparator);
-		total.insert(i+1,repeat('-',i)+rowSeparator);
-	}
-	else if (columnAxisName != null) {
-		int i = str.indexOf(rowSeparator);
-		total.insert(0,repeat('-',i)+rowSeparator);		
-	}
+  // insert horizontal "--------------" separator line
+  StringBuffer total = new StringBuffer(str);
+  if (columnNames != null) {
+  int i = str.indexOf(rowSeparator);
+    total.insert(i+1,repeat('-',i)+rowSeparator);
+  }
+  else if (columnAxisName != null) {
+    int i = str.indexOf(rowSeparator);
+    total.insert(0,repeat('-',i)+rowSeparator);    
+  }
 
-	// insert line for column axis name
-	if (columnAxisName != null) {
-		int j=0;
-		if (c>0) j = str.indexOf('|');
-		String s = blanks(j);
-		if (c>0) s = s + "| ";
-		s = s+columnAxisName+"\n";
-		total.insert(0,s);
-	}
+  // insert line for column axis name
+  if (columnAxisName != null) {
+    int j=0;
+    if (c>0) j = str.indexOf('|');
+    String s = blanks(j);
+    if (c>0) s = s + "| ";
+    s = s+columnAxisName+"\n";
+    total.insert(0,s);
+  }
 
-	// insert title
-	if (title!=null) total.insert(0,title+"\n");
-	
-	this.format = oldFormat;
-	
-	return total.toString();
+  // insert title
+  if (title!=null) total.insert(0,title+"\n");
+  
+  this.format = oldFormat;
+  
+  return total.toString();
 }
 /**
 Returns a string representation of the given matrix with axis as well as rows and columns labeled.
@@ -251,12 +251,12 @@
 @return the matrix converted to a string.
 */
 public String toTitleString(ObjectMatrix3D matrix, String[] sliceNames, String[] rowNames, String[] columnNames, String sliceAxisName, String rowAxisName, String columnAxisName, String title) {
-	if (matrix.size()==0) return "Empty matrix";
-	StringBuffer buf = new StringBuffer();
-	for (int i=0; i<matrix.slices(); i++) {
-		if (i!=0) buf.append(sliceSeparator);
-		buf.append(toTitleString(matrix.viewSlice(i),rowNames,columnNames,rowAxisName,columnAxisName,title+"\n"+sliceAxisName+"="+sliceNames[i]));
-	}
-	return buf.toString();
+  if (matrix.size()==0) return "Empty matrix";
+  StringBuffer buf = new StringBuffer();
+  for (int i=0; i<matrix.slices(); i++) {
+    if (i!=0) buf.append(sliceSeparator);
+    buf.append(toTitleString(matrix.viewSlice(i),rowNames,columnNames,rowAxisName,columnAxisName,title+"\n"+sliceAxisName+"="+sliceNames[i]));
+  }
+  return buf.toString();
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/objectalgo/Sorting.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/objectalgo/Sorting.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/objectalgo/Sorting.java	(working copy)
@@ -41,31 +41,31 @@
  */
 @Deprecated
 public class Sorting extends org.apache.mahout.matrix.PersistentObject {
-	/**
-	 * A prefabricated quicksort.
-	 */
-	public static final Sorting quickSort = new Sorting(); // already has quicksort implemented
+  /**
+   * A prefabricated quicksort.
+   */
+  public static final Sorting quickSort = new Sorting(); // already has quicksort implemented
 
-	/**
-	 * A prefabricated mergesort.
-	 */
-	public static final Sorting mergeSort = new Sorting() { // override quicksort with mergesort
-		protected void runSort(int[] a, int fromIndex, int toIndex, IntComparator c) {
-			org.apache.mahout.matrix.Sorting.mergeSort(a,fromIndex,toIndex,c);
-		}
-		protected void runSort(int fromIndex, int toIndex, IntComparator c, org.apache.mahout.matrix.Swapper swapper) {
-			org.apache.mahout.matrix.GenericSorting.mergeSort(fromIndex, toIndex, c, swapper);
-		}
-	};
+  /**
+   * A prefabricated mergesort.
+   */
+  public static final Sorting mergeSort = new Sorting() { // override quicksort with mergesort
+    protected void runSort(int[] a, int fromIndex, int toIndex, IntComparator c) {
+      org.apache.mahout.matrix.Sorting.mergeSort(a,fromIndex,toIndex,c);
+    }
+    protected void runSort(int fromIndex, int toIndex, IntComparator c, org.apache.mahout.matrix.Swapper swapper) {
+      org.apache.mahout.matrix.GenericSorting.mergeSort(fromIndex, toIndex, c, swapper);
+    }
+  };
 /**
  * Makes this class non instantiable, but still let's others inherit from it.
  */
 protected Sorting() {}
 protected void runSort(int[] a, int fromIndex, int toIndex, IntComparator c) {
-	org.apache.mahout.matrix.Sorting.quickSort(a,fromIndex,toIndex,c);
+  org.apache.mahout.matrix.Sorting.quickSort(a,fromIndex,toIndex,c);
 }
 protected void runSort(int fromIndex, int toIndex, IntComparator c, org.apache.mahout.matrix.Swapper swapper) {
-	org.apache.mahout.matrix.GenericSorting.quickSort(fromIndex, toIndex, c, swapper);
+  org.apache.mahout.matrix.GenericSorting.quickSort(fromIndex, toIndex, c, swapper);
 }
 /**
 Sorts the vector into ascending order, according to the <i>natural ordering</i>.
@@ -75,36 +75,36 @@
 <b>Example:</b> 
 <table border="1" cellspacing="0">
   <tr nowrap> 
-	<td valign="top"><tt> 7, 1, 3, 1<br>
-	  </tt></td>
-	<td valign="top"> 
-	  <p><tt> ==&gt; 1, 1, 3, 7<br>
-		The vector IS NOT SORTED.<br>
-		The new VIEW IS SORTED.</tt></p>
-	</td>
+  <td valign="top"><tt> 7, 1, 3, 1<br>
+    </tt></td>
+  <td valign="top"> 
+    <p><tt> ==&gt; 1, 1, 3, 7<br>
+    The vector IS NOT SORTED.<br>
+    The new VIEW IS SORTED.</tt></p>
+  </td>
   </tr>
 </table>
 
 @param vector the vector to be sorted.
 @return a new sorted vector (matrix) view. 
-		<b>Note that the original matrix is left unaffected.</b>
+    <b>Note that the original matrix is left unaffected.</b>
 */
 public ObjectMatrix1D sort(final ObjectMatrix1D vector) {
-	int[] indexes = new int[vector.size()]; // row indexes to reorder instead of matrix itself
-	for (int i=indexes.length; --i >= 0; ) indexes[i] = i;
+  int[] indexes = new int[vector.size()]; // row indexes to reorder instead of matrix itself
+  for (int i=indexes.length; --i >= 0; ) indexes[i] = i;
 
-	IntComparator comp = new IntComparator() {  
-		public int compare(int a, int b) {
-			Comparable av = (Comparable) (vector.getQuick(a));
-			Comparable bv = (Comparable) (vector.getQuick(b));
-			int r = av.compareTo(bv);
-			return r<0 ? -1 : (r>0 ? 1 : 0);
-		}
-	};
+  IntComparator comp = new IntComparator() {  
+    public int compare(int a, int b) {
+      Comparable av = (Comparable) (vector.getQuick(a));
+      Comparable bv = (Comparable) (vector.getQuick(b));
+      int r = av.compareTo(bv);
+      return r<0 ? -1 : (r>0 ? 1 : 0);
+    }
+  };
 
-	runSort(indexes,0,indexes.length,comp);
+  runSort(indexes,0,indexes.length,comp);
 
-	return vector.viewSelection(indexes);
+  return vector.viewSelection(indexes);
 }
 /**
 Sorts the vector into ascending order, according to the order induced by the specified comparator.
@@ -127,21 +127,21 @@
 @param vector the vector to be sorted.
 @param c the comparator to determine the order.
 @return a new matrix view sorted as specified.
-		<b>Note that the original vector (matrix) is left unaffected.</b>
+    <b>Note that the original vector (matrix) is left unaffected.</b>
 */
 public ObjectMatrix1D sort(final ObjectMatrix1D vector, final java.util.Comparator c) {
-	int[] indexes = new int[vector.size()]; // row indexes to reorder instead of matrix itself
-	for (int i=indexes.length; --i >= 0; ) indexes[i] = i;
+  int[] indexes = new int[vector.size()]; // row indexes to reorder instead of matrix itself
+  for (int i=indexes.length; --i >= 0; ) indexes[i] = i;
 
-	IntComparator comp = new IntComparator() {  
-		public int compare(int a, int b) {
-			return c.compare(vector.getQuick(a), vector.getQuick(b));
-		}
-	};
+  IntComparator comp = new IntComparator() {  
+    public int compare(int a, int b) {
+      return c.compare(vector.getQuick(a), vector.getQuick(b));
+    }
+  };
 
-	runSort(indexes,0,indexes.length,comp);
+  runSort(indexes,0,indexes.length,comp);
 
-	return vector.viewSelection(indexes);
+  return vector.viewSelection(indexes);
 }
 /**
 Sorts the matrix rows into ascending order, according to the <i>natural ordering</i> of the matrix values in the given column.
@@ -151,57 +151,57 @@
 <b>Example:</b> 
 <table border="1" cellspacing="0">
   <tr nowrap> 
-	<td valign="top"><tt>4 x 2 matrix: <br>
-	  7, 6<br>
-	  5, 4<br>
-	  3, 2<br>
-	  1, 0 <br>
-	  </tt></td>
-	<td align="left" valign="top"> 
-	  <p><tt>column = 0;<br>
-		view = quickSort(matrix,column);<br>
-		System.out.println(view); </tt><tt><br>
-		==> </tt></p>
-	  </td>
-	<td valign="top"> 
-	  <p><tt>4 x 2 matrix:<br>
-		1, 0<br>
-		3, 2<br>
-		5, 4<br>
-		7, 6</tt><br>
-		The matrix IS NOT SORTED.<br>
-		The new VIEW IS SORTED.</p>
-	  </td>
+  <td valign="top"><tt>4 x 2 matrix: <br>
+    7, 6<br>
+    5, 4<br>
+    3, 2<br>
+    1, 0 <br>
+    </tt></td>
+  <td align="left" valign="top"> 
+    <p><tt>column = 0;<br>
+    view = quickSort(matrix,column);<br>
+    System.out.println(view); </tt><tt><br>
+    ==> </tt></p>
+    </td>
+  <td valign="top"> 
+    <p><tt>4 x 2 matrix:<br>
+    1, 0<br>
+    3, 2<br>
+    5, 4<br>
+    7, 6</tt><br>
+    The matrix IS NOT SORTED.<br>
+    The new VIEW IS SORTED.</p>
+    </td>
   </tr>
 </table>
 
 @param matrix the matrix to be sorted.
 @param column the index of the column inducing the order.
 @return a new matrix view having rows sorted by the given column.
-		<b>Note that the original matrix is left unaffected.</b>
+    <b>Note that the original matrix is left unaffected.</b>
 @throws IndexOutOfBoundsException if <tt>column < 0 || column >= matrix.columns()</tt>.
 */
 public ObjectMatrix2D sort(ObjectMatrix2D matrix, int column) {
-	if (column < 0 || column >= matrix.columns()) throw new IndexOutOfBoundsException("column="+column+", matrix="+Formatter.shape(matrix));
+  if (column < 0 || column >= matrix.columns()) throw new IndexOutOfBoundsException("column="+column+", matrix="+Formatter.shape(matrix));
 
-	int[] rowIndexes = new int[matrix.rows()]; // row indexes to reorder instead of matrix itself
-	for (int i=rowIndexes.length; --i >= 0; ) rowIndexes[i] = i;
+  int[] rowIndexes = new int[matrix.rows()]; // row indexes to reorder instead of matrix itself
+  for (int i=rowIndexes.length; --i >= 0; ) rowIndexes[i] = i;
 
-	final ObjectMatrix1D col = matrix.viewColumn(column);
-	IntComparator comp = new IntComparator() {  
-		public int compare(int a, int b) {
-			Comparable av = (Comparable) (col.getQuick(a));
-			Comparable bv = (Comparable) (col.getQuick(b));
-			int r = av.compareTo(bv);
-			return r<0 ? -1 : (r>0 ? 1 : 0);
-		}
-	};
+  final ObjectMatrix1D col = matrix.viewColumn(column);
+  IntComparator comp = new IntComparator() {  
+    public int compare(int a, int b) {
+      Comparable av = (Comparable) (col.getQuick(a));
+      Comparable bv = (Comparable) (col.getQuick(b));
+      int r = av.compareTo(bv);
+      return r<0 ? -1 : (r>0 ? 1 : 0);
+    }
+  };
 
-	runSort(rowIndexes,0,rowIndexes.length,comp);
+  runSort(rowIndexes,0,rowIndexes.length,comp);
 
-	// view the matrix according to the reordered row indexes
-	// take all columns in the original order
-	return matrix.viewSelection(rowIndexes,null);
+  // view the matrix according to the reordered row indexes
+  // take all columns in the original order
+  return matrix.viewSelection(rowIndexes,null);
 }
 /**
 Sorts the matrix rows according to the order induced by the specified comparator.
@@ -224,27 +224,27 @@
 @param matrix the matrix to be sorted.
 @param c the comparator to determine the order.
 @return a new matrix view having rows sorted as specified.
-		<b>Note that the original matrix is left unaffected.</b>
+    <b>Note that the original matrix is left unaffected.</b>
 */
 public ObjectMatrix2D sort(final ObjectMatrix2D matrix, final ObjectMatrix1DComparator c) {
-	int[] rowIndexes = new int[matrix.rows()]; // row indexes to reorder instead of matrix itself
-	for (int i=rowIndexes.length; --i >= 0; ) rowIndexes[i] = i;
+  int[] rowIndexes = new int[matrix.rows()]; // row indexes to reorder instead of matrix itself
+  for (int i=rowIndexes.length; --i >= 0; ) rowIndexes[i] = i;
 
-	final ObjectMatrix1D[] views = new ObjectMatrix1D[matrix.rows()]; // precompute views for speed
-	for (int i=views.length; --i >= 0; ) views[i] = matrix.viewRow(i);
+  final ObjectMatrix1D[] views = new ObjectMatrix1D[matrix.rows()]; // precompute views for speed
+  for (int i=views.length; --i >= 0; ) views[i] = matrix.viewRow(i);
 
-	IntComparator comp = new IntComparator() {  
-		public int compare(int a, int b) {
-			//return c.compare(matrix.viewRow(a), matrix.viewRow(b));
-			return c.compare(views[a], views[b]);
-		}
-	};
+  IntComparator comp = new IntComparator() {  
+    public int compare(int a, int b) {
+      //return c.compare(matrix.viewRow(a), matrix.viewRow(b));
+      return c.compare(views[a], views[b]);
+    }
+  };
 
-	runSort(rowIndexes,0,rowIndexes.length,comp);
+  runSort(rowIndexes,0,rowIndexes.length,comp);
 
-	// view the matrix according to the reordered row indexes
-	// take all columns in the original order
-	return matrix.viewSelection(rowIndexes,null);
+  // view the matrix according to the reordered row indexes
+  // take all columns in the original order
+  return matrix.viewSelection(rowIndexes,null);
 }
 /**
 Sorts the matrix slices into ascending order, according to the <i>natural ordering</i> of the matrix values in the given <tt>[row,column]</tt> position.
@@ -264,31 +264,31 @@
 @param row the index of the row inducing the order.
 @param column the index of the column inducing the order.
 @return a new matrix view having slices sorted by the values of the slice view <tt>matrix.viewRow(row).viewColumn(column)</tt>.
-		<b>Note that the original matrix is left unaffected.</b>
+    <b>Note that the original matrix is left unaffected.</b>
 @throws IndexOutOfBoundsException if <tt>row < 0 || row >= matrix.rows() || column < 0 || column >= matrix.columns()</tt>.
 */
 public ObjectMatrix3D sort(ObjectMatrix3D matrix, int row, int column) {
-	if (row < 0 || row >= matrix.rows()) throw new IndexOutOfBoundsException("row="+row+", matrix="+Formatter.shape(matrix));
-	if (column < 0 || column >= matrix.columns()) throw new IndexOutOfBoundsException("column="+column+", matrix="+Formatter.shape(matrix));
+  if (row < 0 || row >= matrix.rows()) throw new IndexOutOfBoundsException("row="+row+", matrix="+Formatter.shape(matrix));
+  if (column < 0 || column >= matrix.columns()) throw new IndexOutOfBoundsException("column="+column+", matrix="+Formatter.shape(matrix));
 
-	int[] sliceIndexes = new int[matrix.slices()]; // indexes to reorder instead of matrix itself
-	for (int i=sliceIndexes.length; --i >= 0; ) sliceIndexes[i] = i;
+  int[] sliceIndexes = new int[matrix.slices()]; // indexes to reorder instead of matrix itself
+  for (int i=sliceIndexes.length; --i >= 0; ) sliceIndexes[i] = i;
 
-	final ObjectMatrix1D sliceView = matrix.viewRow(row).viewColumn(column);
-	IntComparator comp = new IntComparator() {  
-		public int compare(int a, int b) {
-			Comparable av = (Comparable) (sliceView.getQuick(a));
-			Comparable bv = (Comparable) (sliceView.getQuick(b));
-			int r = av.compareTo(bv);
-			return r<0 ? -1 : (r>0 ? 1 : 0);
-		}
-	};
+  final ObjectMatrix1D sliceView = matrix.viewRow(row).viewColumn(column);
+  IntComparator comp = new IntComparator() {  
+    public int compare(int a, int b) {
+      Comparable av = (Comparable) (sliceView.getQuick(a));
+      Comparable bv = (Comparable) (sliceView.getQuick(b));
+      int r = av.compareTo(bv);
+      return r<0 ? -1 : (r>0 ? 1 : 0);
+    }
+  };
 
-	runSort(sliceIndexes,0,sliceIndexes.length,comp);
+  runSort(sliceIndexes,0,sliceIndexes.length,comp);
 
-	// view the matrix according to the reordered slice indexes
-	// take all rows and columns in the original order
-	return matrix.viewSelection(sliceIndexes,null,null);
+  // view the matrix according to the reordered slice indexes
+  // take all rows and columns in the original order
+  return matrix.viewSelection(sliceIndexes,null,null);
 }
 /**
 Sorts the matrix slices according to the order induced by the specified comparator.
@@ -311,26 +311,26 @@
 @param matrix the matrix to be sorted.
 @param c the comparator to determine the order.
 @return a new matrix view having slices sorted as specified.
-		<b>Note that the original matrix is left unaffected.</b>
+    <b>Note that the original matrix is left unaffected.</b>
 */
 public ObjectMatrix3D sort(final ObjectMatrix3D matrix, final ObjectMatrix2DComparator c) {
-	int[] sliceIndexes = new int[matrix.slices()]; // indexes to reorder instead of matrix itself
-	for (int i=sliceIndexes.length; --i >= 0; ) sliceIndexes[i] = i;
+  int[] sliceIndexes = new int[matrix.slices()]; // indexes to reorder instead of matrix itself
+  for (int i=sliceIndexes.length; --i >= 0; ) sliceIndexes[i] = i;
 
-	final ObjectMatrix2D[] views = new ObjectMatrix2D[matrix.slices()]; // precompute views for speed
-	for (int i=views.length; --i >= 0; ) views[i] = matrix.viewSlice(i);
+  final ObjectMatrix2D[] views = new ObjectMatrix2D[matrix.slices()]; // precompute views for speed
+  for (int i=views.length; --i >= 0; ) views[i] = matrix.viewSlice(i);
 
-	IntComparator comp = new IntComparator() {  
-		public int compare(int a, int b) {
-			//return c.compare(matrix.viewSlice(a), matrix.viewSlice(b));
-			return c.compare(views[a], views[b]);
-		}
-	};
+  IntComparator comp = new IntComparator() {  
+    public int compare(int a, int b) {
+      //return c.compare(matrix.viewSlice(a), matrix.viewSlice(b));
+      return c.compare(views[a], views[b]);
+    }
+  };
 
-	runSort(sliceIndexes,0,sliceIndexes.length,comp);
+  runSort(sliceIndexes,0,sliceIndexes.length,comp);
 
-	// view the matrix according to the reordered slice indexes
-	// take all rows and columns in the original order
-	return matrix.viewSelection(sliceIndexes,null,null);
+  // view the matrix according to the reordered slice indexes
+  // take all rows and columns in the original order
+  return matrix.viewSelection(sliceIndexes,null,null);
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/objectalgo/Partitioning.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/objectalgo/Partitioning.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/objectalgo/Partitioning.java	(working copy)
@@ -23,8 +23,6 @@
  *
  * @see org.apache.mahout.matrix.Partitioning "Partitioning arrays (provides more documentation)"
  *
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 09/24/99
  */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
@@ -53,42 +51,42 @@
 <b>Example:</b> 
 <table border="1" cellspacing="0">
   <tr nowrap> 
-	<td valign="top"><tt>8 x 3 matrix:<br>
-	  23, 22, 21<br>
-	  20, 19, 18<br>
-	  17, 16, 15<br>
-	  14, 13, 12<br>
-	  11, 10, 9<br>
-	  8,  7,  6<br>
-	  5,  4,  3<br>
-	  2,  1,  0 </tt></td>
-	<td align="left" valign="top"> 
-	  <p><tt>column = 0;<br>
-	    rowIndexes = {0,1,2,..,matrix.rows()-1};
-		rowFrom = 0;<br>
-		rowTo = matrix.rows()-1;<br>
-		splitters = {5,10,12}<br>
-		c = 0; <br>
-		d = splitters.length-1;<br>
-		partition(matrix,rowIndexes,rowFrom,rowTo,column,splitters,c,d,splitIndexes);<br>
-		==><br>
-		splitIndexes == {0, 2, 3}<br>
-		rowIndexes == {7, 6, 5, 4, 0, 1, 2, 3}</tt></p>
-	  </td>
-	<td valign="top">
-	  The matrix IS NOT REORDERED.<br>
-	  Here is how it would look<br>
-	  like, if it would be reordered<br>
-	  accoring to <tt>rowIndexes</tt>.<br>
-	  <tt>8 x 3 matrix:<br>
-	  2,  1,  0<br>
-	  5,  4,  3<br>
-	  8,  7,  6<br>
-	  11, 10, 9<br>
-	  23, 22, 21<br>
-	  20, 19, 18<br>
-	  17, 16, 15<br>
-	  14, 13, 12 </tt></td>
+  <td valign="top"><tt>8 x 3 matrix:<br>
+    23, 22, 21<br>
+    20, 19, 18<br>
+    17, 16, 15<br>
+    14, 13, 12<br>
+    11, 10, 9<br>
+    8,  7,  6<br>
+    5,  4,  3<br>
+    2,  1,  0 </tt></td>
+  <td align="left" valign="top"> 
+    <p><tt>column = 0;<br>
+      rowIndexes = {0,1,2,..,matrix.rows()-1};
+    rowFrom = 0;<br>
+    rowTo = matrix.rows()-1;<br>
+    splitters = {5,10,12}<br>
+    c = 0; <br>
+    d = splitters.length-1;<br>
+    partition(matrix,rowIndexes,rowFrom,rowTo,column,splitters,c,d,splitIndexes);<br>
+    ==><br>
+    splitIndexes == {0, 2, 3}<br>
+    rowIndexes == {7, 6, 5, 4, 0, 1, 2, 3}</tt></p>
+    </td>
+  <td valign="top">
+    The matrix IS NOT REORDERED.<br>
+    Here is how it would look<br>
+    like, if it would be reordered<br>
+    accoring to <tt>rowIndexes</tt>.<br>
+    <tt>8 x 3 matrix:<br>
+    2,  1,  0<br>
+    5,  4,  3<br>
+    8,  7,  6<br>
+    11, 10, 9<br>
+    23, 22, 21<br>
+    20, 19, 18<br>
+    17, 16, 15<br>
+    14, 13, 12 </tt></td>
   </tr>
 </table>
 @param matrix the matrix to be partitioned.
@@ -97,64 +95,64 @@
 @param rowTo the index of the last row (inclusive).
 @param column the index of the column to partition on.
 @param splitters the values at which the rows shall be split into intervals.
-	Must be sorted ascending and must not contain multiple identical values.
-	These preconditions are not checked; be sure that they are met.
+  Must be sorted ascending and must not contain multiple identical values.
+  These preconditions are not checked; be sure that they are met.
  
 @param splitFrom the index of the first splitter element to be considered.
 @param splitTo the index of the last splitter element to be considered.
-	The method considers the splitter elements <tt>splitters[splitFrom] .. splitters[splitTo]</tt>.
+  The method considers the splitter elements <tt>splitters[splitFrom] .. splitters[splitTo]</tt>.
  
 @param splitIndexes a list into which this method fills the indexes of rows delimiting intervals.
 Upon return <tt>splitIndexes[splitFrom..splitTo]</tt> will be set accordingly.
 Therefore, must satisfy <tt>splitIndexes.length >= splitters.length</tt>.
 */
 public static void partition(ObjectMatrix2D matrix, int[] rowIndexes, int rowFrom, int rowTo, int column, final Object[] splitters, int splitFrom, int splitTo, int[] splitIndexes) {
-	if (rowFrom < 0 || rowTo >= matrix.rows() || rowTo >= rowIndexes.length) throw new IllegalArgumentException();
-	if (column < 0 || column >= matrix.columns()) throw new IllegalArgumentException();
-	if (splitFrom < 0 || splitTo >= splitters.length) throw new IllegalArgumentException();
-	if (splitIndexes.length < splitters.length) throw new IllegalArgumentException();
+  if (rowFrom < 0 || rowTo >= matrix.rows() || rowTo >= rowIndexes.length) throw new IllegalArgumentException();
+  if (column < 0 || column >= matrix.columns()) throw new IllegalArgumentException();
+  if (splitFrom < 0 || splitTo >= splitters.length) throw new IllegalArgumentException();
+  if (splitIndexes.length < splitters.length) throw new IllegalArgumentException();
 
-	// this one knows how to swap two row indexes (a,b)
-	final int[] g = rowIndexes;
-	Swapper swapper = new Swapper() {
-		public void swap(int b, int c) {
-			int tmp = g[b]; g[b] = g[c]; g[c] = tmp;
-		}
-	};
-	
-	// compare splitter[a] with columnView[rowIndexes[b]]
-	final ObjectMatrix1D columnView = matrix.viewColumn(column);	
-	IntComparator comp = new IntComparator() {
-		public int compare(int a, int b) {
-			Comparable av = (Comparable) (splitters[a]);
-			Comparable bv = (Comparable) (columnView.getQuick(g[b]));
-			int r = av.compareTo(bv);
-			return r<0 ? -1 : (r==0 ? 0 : 1);
-		}
-	};
+  // this one knows how to swap two row indexes (a,b)
+  final int[] g = rowIndexes;
+  Swapper swapper = new Swapper() {
+    public void swap(int b, int c) {
+      int tmp = g[b]; g[b] = g[c]; g[c] = tmp;
+    }
+  };
+  
+  // compare splitter[a] with columnView[rowIndexes[b]]
+  final ObjectMatrix1D columnView = matrix.viewColumn(column);  
+  IntComparator comp = new IntComparator() {
+    public int compare(int a, int b) {
+      Comparable av = (Comparable) (splitters[a]);
+      Comparable bv = (Comparable) (columnView.getQuick(g[b]));
+      int r = av.compareTo(bv);
+      return r<0 ? -1 : (r==0 ? 0 : 1);
+    }
+  };
 
-	// compare columnView[rowIndexes[a]] with columnView[rowIndexes[b]]
-	IntComparator comp2 = new IntComparator() {
-		public int compare(int a, int b) {
-			Comparable av = (Comparable) (columnView.getQuick(g[a]));
-			Comparable bv = (Comparable) (columnView.getQuick(g[b]));
-			int r = av.compareTo(bv);
-			return r<0 ? -1 : (r==0 ? 0 : 1);
-		}
-	};
+  // compare columnView[rowIndexes[a]] with columnView[rowIndexes[b]]
+  IntComparator comp2 = new IntComparator() {
+    public int compare(int a, int b) {
+      Comparable av = (Comparable) (columnView.getQuick(g[a]));
+      Comparable bv = (Comparable) (columnView.getQuick(g[b]));
+      int r = av.compareTo(bv);
+      return r<0 ? -1 : (r==0 ? 0 : 1);
+    }
+  };
 
-	// compare splitter[a] with splitter[b]
-	IntComparator comp3 = new IntComparator() {
-		public int compare(int a, int b) {
-			Comparable av = (Comparable) (splitters[a]);
-			Comparable bv = (Comparable) (splitters[b]);
-			int r = av.compareTo(bv);
-			return r<0 ? -1 : (r==0 ? 0 : 1);
-		}
-	};
+  // compare splitter[a] with splitter[b]
+  IntComparator comp3 = new IntComparator() {
+    public int compare(int a, int b) {
+      Comparable av = (Comparable) (splitters[a]);
+      Comparable bv = (Comparable) (splitters[b]);
+      int r = av.compareTo(bv);
+      return r<0 ? -1 : (r==0 ? 0 : 1);
+    }
+  };
 
-	// generic partitioning does the main work of reordering row indexes
-	org.apache.mahout.matrix.Partitioning.genericPartition(rowFrom,rowTo,splitFrom,splitTo,splitIndexes,comp,comp2,comp3,swapper);
+  // generic partitioning does the main work of reordering row indexes
+  org.apache.mahout.matrix.Partitioning.genericPartition(rowFrom,rowTo,splitFrom,splitTo,splitIndexes,comp,comp2,comp3,swapper);
 }
 /**
 Same as {@link org.apache.mahout.matrix.Partitioning#partition(int[],int,int,int[],int,int,int[])}
@@ -174,41 +172,41 @@
 <b>Example:</b> 
 <table border="1" cellspacing="0">
   <tr nowrap> 
-	<td valign="top"><tt>8 x 3 matrix:<br>
-	  23, 22, 21<br>
-	  20, 19, 18<br>
-	  17, 16, 15<br>
-	  14, 13, 12<br>
-	  11, 10, 9<br>
-	  8,  7,  6<br>
-	  5,  4,  3<br>
-	  2,  1,  0 </tt></td>
-	<td align="left" valign="top"> 
-	    <tt>column = 0;<br>
-		splitters = {5,10,12}<br>
-		partition(matrix,column,splitters,splitIndexes);<br>
-		==><br>
-		splitIndexes == {0, 2, 3}</tt></p>
-	  </td>
-	<td valign="top">
-	  The matrix IS NOT REORDERED.<br>
-	  The new VIEW IS REORDERED:<br>
-	  <tt>8 x 3 matrix:<br>
-	  2,  1,  0<br>
-	  5,  4,  3<br>
-	  8,  7,  6<br>
-	  11, 10, 9<br>
-	  23, 22, 21<br>
-	  20, 19, 18<br>
-	  17, 16, 15<br>
-	  14, 13, 12 </tt></td>
+  <td valign="top"><tt>8 x 3 matrix:<br>
+    23, 22, 21<br>
+    20, 19, 18<br>
+    17, 16, 15<br>
+    14, 13, 12<br>
+    11, 10, 9<br>
+    8,  7,  6<br>
+    5,  4,  3<br>
+    2,  1,  0 </tt></td>
+  <td align="left" valign="top"> 
+      <tt>column = 0;<br>
+    splitters = {5,10,12}<br>
+    partition(matrix,column,splitters,splitIndexes);<br>
+    ==><br>
+    splitIndexes == {0, 2, 3}</tt></p>
+    </td>
+  <td valign="top">
+    The matrix IS NOT REORDERED.<br>
+    The new VIEW IS REORDERED:<br>
+    <tt>8 x 3 matrix:<br>
+    2,  1,  0<br>
+    5,  4,  3<br>
+    8,  7,  6<br>
+    11, 10, 9<br>
+    23, 22, 21<br>
+    20, 19, 18<br>
+    17, 16, 15<br>
+    14, 13, 12 </tt></td>
   </tr>
 </table>
 @param matrix the matrix to be partitioned.
 @param column the index of the column to partition on.
 @param splitters the values at which the rows shall be split into intervals.
-	Must be sorted ascending and must not contain multiple identical values.
-	These preconditions are not checked; be sure that they are met.
+  Must be sorted ascending and must not contain multiple identical values.
+  These preconditions are not checked; be sure that they are met.
  
 @param splitIndexes a list into which this method fills the indexes of rows delimiting intervals.
 Therefore, must satisfy <tt>splitIndexes.length >= splitters.length</tt>.
@@ -216,21 +214,21 @@
 @return a new matrix view having rows partitioned by the given column and splitters.
 */
 public static ObjectMatrix2D partition(ObjectMatrix2D matrix, int column, final Object[] splitters, int[] splitIndexes) {
-	int rowFrom = 0;
-	int rowTo = matrix.rows()-1;
-	int splitFrom = 0;
-	int splitTo = splitters.length-1;
-	int[] rowIndexes = new int[matrix.rows()]; // row indexes to reorder instead of matrix itself
-	for (int i=rowIndexes.length; --i >= 0; ) rowIndexes[i] = i;
+  int rowFrom = 0;
+  int rowTo = matrix.rows()-1;
+  int splitFrom = 0;
+  int splitTo = splitters.length-1;
+  int[] rowIndexes = new int[matrix.rows()]; // row indexes to reorder instead of matrix itself
+  for (int i=rowIndexes.length; --i >= 0; ) rowIndexes[i] = i;
 
-	partition(matrix,rowIndexes,rowFrom,rowTo,column,splitters,splitFrom,splitTo,splitIndexes);
+  partition(matrix,rowIndexes,rowFrom,rowTo,column,splitters,splitFrom,splitTo,splitIndexes);
 
-	// take all columns in the original order
-	int[] columnIndexes = new int[matrix.columns()];
-	for (int i=columnIndexes.length; --i >= 0; ) columnIndexes[i] = i;
+  // take all columns in the original order
+  int[] columnIndexes = new int[matrix.columns()];
+  for (int i=columnIndexes.length; --i >= 0; ) columnIndexes[i] = i;
 
-	// view the matrix according to the reordered row indexes
-	return matrix.viewSelection(rowIndexes,columnIndexes);
+  // view the matrix according to the reordered row indexes
+  return matrix.viewSelection(rowIndexes,columnIndexes);
 }
 /**
 Same as {@link #partition(int[],int,int,int[],int,int,int[])}
@@ -254,108 +252,108 @@
 <b>Example:</b> 
 <table border="1" cellspacing="0">
   <tr nowrap> 
-	<td valign="top"><tt>8 x 3 matrix:<br>
-	  23, 22, 21<br>
-	  20, 19, 18<br>
-	  17, 16, 15<br>
-	  14, 13, 12<br>
-	  11, 10, 9<br>
-	  8,  7,  6<br>
-	  5,  4,  3<br>
-	  2,  1,  0 </tt></td>
-	<td align="left"> 
-	  <p><tt>column = matrix.viewColumn(0);<br>
-		a = 0;<br>
-		b = column.size()-1;</tt><tt><br>
-		splitters={5,10,12}<br>
-		c=0; <br>
-		d=splitters.length-1;</tt><tt><br>
-		partition(matrix,column,a,b,splitters,c,d,splitIndexes);<br>
-		==><br>
-		splitIndexes == {0, 2, 3}</tt></p>
-	  </td>
-	<td valign="top"><tt>8 x 3 matrix:<br>
-	  2,  1,  0<br>
-	  5,  4,  3<br>
-	  8,  7,  6<br>
-	  11, 10, 9<br>
-	  23, 22, 21<br>
-	  20, 19, 18<br>
-	  17, 16, 15<br>
-	  14, 13, 12 </tt></td>
+  <td valign="top"><tt>8 x 3 matrix:<br>
+    23, 22, 21<br>
+    20, 19, 18<br>
+    17, 16, 15<br>
+    14, 13, 12<br>
+    11, 10, 9<br>
+    8,  7,  6<br>
+    5,  4,  3<br>
+    2,  1,  0 </tt></td>
+  <td align="left"> 
+    <p><tt>column = matrix.viewColumn(0);<br>
+    a = 0;<br>
+    b = column.size()-1;</tt><tt><br>
+    splitters={5,10,12}<br>
+    c=0; <br>
+    d=splitters.length-1;</tt><tt><br>
+    partition(matrix,column,a,b,splitters,c,d,splitIndexes);<br>
+    ==><br>
+    splitIndexes == {0, 2, 3}</tt></p>
+    </td>
+  <td valign="top"><tt>8 x 3 matrix:<br>
+    2,  1,  0<br>
+    5,  4,  3<br>
+    8,  7,  6<br>
+    11, 10, 9<br>
+    23, 22, 21<br>
+    20, 19, 18<br>
+    17, 16, 15<br>
+    14, 13, 12 </tt></td>
   </tr>
 </table>
 */
 private static void xPartitionOld(ObjectMatrix2D matrix, ObjectMatrix1D column, int from, int to, Object[] splitters, int splitFrom, int splitTo, int[] splitIndexes) {
-	/*
-	Object splitter; // int, Object --> template type dependent
-	
-	if (splitFrom>splitTo) return; // nothing to do
-	if (from>to) { // all bins are empty
-		from--;
-		for (int i = splitFrom; i<=splitTo; ) splitIndexes[i++] = from;
-		return;
-	}
-	
-	// Choose a partition (pivot) index, m
-	// Ideally, the pivot should be the median, because a median splits a list into two equal sized sublists.
-	// However, computing the median is expensive, so we use an approximation.
-	int medianIndex;
-	if (splitFrom==splitTo) { // we don't really have a choice
-		medianIndex = splitFrom;
-	}
-	else { // we do have a choice
-		int m = (from+to) / 2;       // Small arrays, middle element
-		int len = to-from+1;
-		if (len > SMALL) {
-		    int l = from;
-		    int n = to;
-		    if (len > MEDIUM) {        // Big arrays, pseudomedian of 9
-				int s = len/8;
-				l = med3(column, l,     l+s, l+2*s);
-				m = med3(column, m-s,   m,   m+s);
-				n = med3(column, n-2*s, n-s, n);
-		    }
-		    m = med3(column, l, m, n); // Mid-size, pseudomedian of 3
-		}
-		
-		// Find the splitter closest to the pivot, i.e. the splitter that best splits the list into two equal sized sublists.
-		medianIndex = org.apache.mahout.matrix.Sorting.binarySearchFromTo(splitters,column.getQuick(m),splitFrom,splitTo);
-		if (medianIndex < 0) medianIndex = -medianIndex - 1; // not found
-		if (medianIndex > splitTo) medianIndex = splitTo; // not found, one past the end
-		
-	}
-	splitter = splitters[medianIndex];
+  /*
+  Object splitter; // int, Object --> template type dependent
+  
+  if (splitFrom>splitTo) return; // nothing to do
+  if (from>to) { // all bins are empty
+    from--;
+    for (int i = splitFrom; i<=splitTo; ) splitIndexes[i++] = from;
+    return;
+  }
+  
+  // Choose a partition (pivot) index, m
+  // Ideally, the pivot should be the median, because a median splits a list into two equal sized sublists.
+  // However, computing the median is expensive, so we use an approximation.
+  int medianIndex;
+  if (splitFrom==splitTo) { // we don't really have a choice
+    medianIndex = splitFrom;
+  }
+  else { // we do have a choice
+    int m = (from+to) / 2;       // Small arrays, middle element
+    int len = to-from+1;
+    if (len > SMALL) {
+        int l = from;
+        int n = to;
+        if (len > MEDIUM) {        // Big arrays, pseudomedian of 9
+        int s = len/8;
+        l = med3(column, l,     l+s, l+2*s);
+        m = med3(column, m-s,   m,   m+s);
+        n = med3(column, n-2*s, n-s, n);
+        }
+        m = med3(column, l, m, n); // Mid-size, pseudomedian of 3
+    }
+    
+    // Find the splitter closest to the pivot, i.e. the splitter that best splits the list into two equal sized sublists.
+    medianIndex = org.apache.mahout.matrix.Sorting.binarySearchFromTo(splitters,column.getQuick(m),splitFrom,splitTo);
+    if (medianIndex < 0) medianIndex = -medianIndex - 1; // not found
+    if (medianIndex > splitTo) medianIndex = splitTo; // not found, one past the end
+    
+  }
+  splitter = splitters[medianIndex];
 
-	// Partition the list according to the splitter, i.e.
-	// Establish invariant: list[i] < splitter <= list[j] for i=from..medianIndex and j=medianIndex+1 .. to
-	int	splitIndex = xPartitionOld(matrix,column,from,to,splitter);
-	splitIndexes[medianIndex] = splitIndex;
+  // Partition the list according to the splitter, i.e.
+  // Establish invariant: list[i] < splitter <= list[j] for i=from..medianIndex and j=medianIndex+1 .. to
+  int  splitIndex = xPartitionOld(matrix,column,from,to,splitter);
+  splitIndexes[medianIndex] = splitIndex;
 
-	// Optimization: Handle special cases to cut down recursions.
-	if (splitIndex < from) { // no element falls into this bin
-		// all bins with splitters[i] <= splitter are empty
-		int i = medianIndex-1;
-		while (i>=splitFrom && (!(splitter < splitters[i]))) splitIndexes[i--] = splitIndex;
-		splitFrom = medianIndex+1;
-	}
-	else if (splitIndex >= to) { // all elements fall into this bin
-		// all bins with splitters[i] >= splitter are empty
-		int i = medianIndex+1;
-		while (i<=splitTo && (!(splitter > splitters[i]))) splitIndexes[i++] = splitIndex;
-		splitTo = medianIndex-1;
-	}
+  // Optimization: Handle special cases to cut down recursions.
+  if (splitIndex < from) { // no element falls into this bin
+    // all bins with splitters[i] <= splitter are empty
+    int i = medianIndex-1;
+    while (i>=splitFrom && (!(splitter < splitters[i]))) splitIndexes[i--] = splitIndex;
+    splitFrom = medianIndex+1;
+  }
+  else if (splitIndex >= to) { // all elements fall into this bin
+    // all bins with splitters[i] >= splitter are empty
+    int i = medianIndex+1;
+    while (i<=splitTo && (!(splitter > splitters[i]))) splitIndexes[i++] = splitIndex;
+    splitTo = medianIndex-1;
+  }
 
-	// recursively partition left half
-	if (splitFrom <= medianIndex-1) {
-		xPartitionOld(matrix, column, from,         splitIndex, splitters, splitFrom, medianIndex-1,  splitIndexes);
-	}
-	
-	// recursively partition right half
-	if (medianIndex+1 <= splitTo) {
-		xPartitionOld(matrix, column, splitIndex+1, to,         splitters, medianIndex+1,  splitTo,   splitIndexes);
-	}
-	*/
+  // recursively partition left half
+  if (splitFrom <= medianIndex-1) {
+    xPartitionOld(matrix, column, from,         splitIndex, splitters, splitFrom, medianIndex-1,  splitIndexes);
+  }
+  
+  // recursively partition right half
+  if (medianIndex+1 <= splitTo) {
+    xPartitionOld(matrix, column, splitIndex+1, to,         splitters, medianIndex+1,  splitTo,   splitIndexes);
+  }
+  */
 }
 /**
  * Same as {@link #partition(int[],int,int,int)} 
@@ -377,18 +375,18 @@
  * Note that arguments are not checked for validity.
  */
 private static int xPartitionOld(ObjectMatrix2D matrix, ObjectMatrix1D column, int from, int to, Object splitter) {
-	/*
-	Object element;  // int, Object --> template type dependent
-	for (int i=from-1; ++i<=to; ) {
-		element = column.getQuick(i);
-		if (element < splitter) {
-			// swap x[i] with x[from]
-			matrix.swapRows(i,from);
-			from++;
-		}
-	}
-	return from-1;
-	*/
-	return 0;
+  /*
+  Object element;  // int, Object --> template type dependent
+  for (int i=from-1; ++i<=to; ) {
+    element = column.getQuick(i);
+    if (element < splitter) {
+      // swap x[i] with x[from]
+      matrix.swapRows(i,from);
+      from++;
+    }
+  }
+  return from-1;
+  */
+  return 0;
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/objectalgo/ObjectMatrix1DComparator.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/objectalgo/ObjectMatrix1DComparator.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/objectalgo/ObjectMatrix1DComparator.java	(working copy)
@@ -20,8 +20,6 @@
  * order for the data structure to serialize successfully, the comparator (if
  * provided) must implement <tt>Serializable</tt>.<p>
  *
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 09/24/99
  * @see java.util.Comparator
  * @see org.apache.mahout.colt
  * @see org.apache.mahout.matrix.Sorting
@@ -51,8 +49,8 @@
  *
  * 
  * @return a negative integer, zero, or a positive integer as the
- * 	       first argument is less than, equal to, or greater than the
- *	       second. 
+ *          first argument is less than, equal to, or greater than the
+ *         second. 
  */
 int compare(ObjectMatrix1D o1, ObjectMatrix1D o2);
 /**
@@ -73,8 +71,8 @@
  *
  * @param   obj   the reference object with which to compare.
  * @return  <code>true</code> only if the specified object is also
- *		a comparator and it imposes the same ordering as this
- *		comparator.
+ *    a comparator and it imposes the same ordering as this
+ *    comparator.
  * @see     java.lang.Object#equals(java.lang.Object)
  * @see java.lang.Object#hashCode()
  */
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/objectalgo/ObjectMatrix2DComparator.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/objectalgo/ObjectMatrix2DComparator.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/objectalgo/ObjectMatrix2DComparator.java	(working copy)
@@ -20,8 +20,6 @@
  * order for the data structure to serialize successfully, the comparator (if
  * provided) must implement <tt>Serializable</tt>.<p>
  *
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 09/24/99
  * @see java.util.Comparator
  * @see org.apache.mahout.colt
  * @see org.apache.mahout.matrix.Sorting
@@ -51,8 +49,8 @@
  *
  * 
  * @return a negative integer, zero, or a positive integer as the
- * 	       first argument is less than, equal to, or greater than the
- *	       second. 
+ *          first argument is less than, equal to, or greater than the
+ *         second. 
  */
 int compare(ObjectMatrix2D o1, ObjectMatrix2D o2);
 /**
@@ -73,8 +71,8 @@
  *
  * @param   obj   the reference object with which to compare.
  * @return  <code>true</code> only if the specified object is also
- *		a comparator and it imposes the same ordering as this
- *		comparator.
+ *    a comparator and it imposes the same ordering as this
+ *    comparator.
  * @see     java.lang.Object#equals(java.lang.Object)
  * @see java.lang.Object#hashCode()
  */
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/doublealgo/Stencil.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/doublealgo/Stencil.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/doublealgo/Stencil.java	(working copy)
@@ -38,28 +38,28 @@
 @param A the matrix to operate on.
 @param function the function to be applied to each window.
 @param maxIterations the maximum number of times the stencil shall be applied to the matrix. 
-	Should be a multiple of 2 because two iterations are always done in one atomic step.
+  Should be a multiple of 2 because two iterations are always done in one atomic step.
 @param hasConverged Convergence condition; will return before maxIterations are done when <tt>hasConverged.apply(A)==true</tt>.
-	Set this parameter to <tt>null</tt> to indicate that no convergence checks shall be made.
+  Set this parameter to <tt>null</tt> to indicate that no convergence checks shall be made.
 @param convergenceIterations the number of iterations to pass between each convergence check.
-	(Since a convergence may be expensive, you may want to do it only every 2,4 or 8 iterations.)
+  (Since a convergence may be expensive, you may want to do it only every 2,4 or 8 iterations.)
 @return the number of iterations actually executed. 
 */
 public static int stencil27(DoubleMatrix3D A, org.apache.mahout.matrix.function.Double27Function function, int maxIterations, DoubleMatrix3DProcedure hasConverged, int convergenceIterations) {
-	DoubleMatrix3D B = A.copy();
-	if (convergenceIterations <= 1) convergenceIterations=2;
-	if (convergenceIterations%2 != 0) convergenceIterations++; // odd -> make it even
+  DoubleMatrix3D B = A.copy();
+  if (convergenceIterations <= 1) convergenceIterations=2;
+  if (convergenceIterations%2 != 0) convergenceIterations++; // odd -> make it even
 
-	int i=0;
-	while (i<maxIterations) { // do two steps at a time for efficiency
-		A.zAssign27Neighbors(B,function);
-		B.zAssign27Neighbors(A,function);
-		i=i+2;
-		if (i%convergenceIterations == 0 && hasConverged!=null) {
-			if (hasConverged.apply(A)) return i;
-		}
-	}
-	return i;
+  int i=0;
+  while (i<maxIterations) { // do two steps at a time for efficiency
+    A.zAssign27Neighbors(B,function);
+    B.zAssign27Neighbors(A,function);
+    i=i+2;
+    if (i%convergenceIterations == 0 && hasConverged!=null) {
+      if (hasConverged.apply(A)) return i;
+    }
+  }
+  return i;
 }
 /**
 9 point stencil operation.
@@ -67,27 +67,27 @@
 @param A the matrix to operate on.
 @param function the function to be applied to each window.
 @param maxIterations the maximum number of times the stencil shall be applied to the matrix. 
-	Should be a multiple of 2 because two iterations are always done in one atomic step.
+  Should be a multiple of 2 because two iterations are always done in one atomic step.
 @param hasConverged Convergence condition; will return before maxIterations are done when <tt>hasConverged.apply(A)==true</tt>.
-	Set this parameter to <tt>null</tt> to indicate that no convergence checks shall be made.
+  Set this parameter to <tt>null</tt> to indicate that no convergence checks shall be made.
 @param convergenceIterations the number of iterations to pass between each convergence check.
-	(Since a convergence may be expensive, you may want to do it only every 2,4 or 8 iterations.)
+  (Since a convergence may be expensive, you may want to do it only every 2,4 or 8 iterations.)
 @return the number of iterations actually executed. 
 */
 public static int stencil9(DoubleMatrix2D A, org.apache.mahout.matrix.function.Double9Function function, int maxIterations, DoubleMatrix2DProcedure hasConverged, int convergenceIterations) {
-	DoubleMatrix2D B = A.copy();
-	if (convergenceIterations <= 1) convergenceIterations=2;
-	if (convergenceIterations%2 != 0) convergenceIterations++; // odd -> make it even
+  DoubleMatrix2D B = A.copy();
+  if (convergenceIterations <= 1) convergenceIterations=2;
+  if (convergenceIterations%2 != 0) convergenceIterations++; // odd -> make it even
 
-	int i=0;
-	while (i<maxIterations) { // do two steps at a time for efficiency
-		A.zAssign8Neighbors(B,function);
-		B.zAssign8Neighbors(A,function);
-		i=i+2;
-		if (i%convergenceIterations == 0 && hasConverged!=null) {
-			if (hasConverged.apply(A)) return i;
-		}
-	}
-	return i;
+  int i=0;
+  while (i<maxIterations) { // do two steps at a time for efficiency
+    A.zAssign8Neighbors(B,function);
+    B.zAssign8Neighbors(A,function);
+    i=i+2;
+    if (i%convergenceIterations == 0 && hasConverged!=null) {
+      if (hasConverged.apply(A)) return i;
+    }
+  }
+  return i;
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/doublealgo/Formatter.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/doublealgo/Formatter.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/doublealgo/Formatter.java	(working copy)
@@ -32,128 +32,128 @@
 Examples demonstrate usage on 2-d matrices. 1-d and 3-d matrices formatting works very similar.
 <table border="1" cellspacing="0">
   <tr align="center"> 
-	<td>Original matrix</td>
+  <td>Original matrix</td>
   </tr>
   <tr> 
-	<td> 
-	  
-	  <p><tt>double[][] values = {<br>
-		{3, 0, -3.4, 0},<br>
-		{5.1 ,0, +3.0123456789, 0}, <br>
-		{16.37, 0.0, 2.5, 0}, <br>
-		{-16.3, 0, -3.012345678E-4, -1},<br>
-		{1236.3456789, 0, 7, -1.2}<br>
-		};<br>
-		matrix = new DenseDoubleMatrix2D(values);</tt></p>
-	</td>
+  <td> 
+    
+    <p><tt>double[][] values = {<br>
+    {3, 0, -3.4, 0},<br>
+    {5.1 ,0, +3.0123456789, 0}, <br>
+    {16.37, 0.0, 2.5, 0}, <br>
+    {-16.3, 0, -3.012345678E-4, -1},<br>
+    {1236.3456789, 0, 7, -1.2}<br>
+    };<br>
+    matrix = new DenseDoubleMatrix2D(values);</tt></p>
+  </td>
   </tr>
 </table>
 <p>&nbsp;</p>
 <table border="1" cellspacing="0">
   <tr align="center"> 
-	<td><tt>format</tt></td>
-	<td valign="top"><tt>Formatter.toString(matrix);</tt></td>
-	<td valign="top"><tt>Formatter.toSourceCode(matrix);</tt></td>
+  <td><tt>format</tt></td>
+  <td valign="top"><tt>Formatter.toString(matrix);</tt></td>
+  <td valign="top"><tt>Formatter.toSourceCode(matrix);</tt></td>
   </tr>
   <tr> 
-	<td><tt>%G </tt><br>
-	  (default)</td>
-	<td align="left" valign="top"><tt>5&nbsp;x&nbsp;4&nbsp;matrix<br>
-	  &nbsp;&nbsp;&nbsp;3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;-3.4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;<br>
-	  &nbsp;&nbsp;&nbsp;5.1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;3.012346&nbsp;&nbsp;0&nbsp;&nbsp;<br>
-	  &nbsp;&nbsp;16.37&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;2.5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;<br>
-	  &nbsp;-16.3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;-0.000301&nbsp;-1&nbsp;&nbsp;<br>
-	  1236.345679&nbsp;0&nbsp;&nbsp;7&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-1.2 
-	  </tt></td>
-	<td align="left" valign="top"><tt>{<br>
-	  &nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;,&nbsp;0,&nbsp;-3.4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;,&nbsp;&nbsp;0&nbsp;&nbsp;},<br>
-	  &nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;5.1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;,&nbsp;0,&nbsp;&nbsp;3.012346,&nbsp;&nbsp;0&nbsp;&nbsp;},<br>
-	  &nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;16.37&nbsp;&nbsp;&nbsp;&nbsp;,&nbsp;0,&nbsp;&nbsp;2.5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;,&nbsp;&nbsp;0&nbsp;&nbsp;},<br>
-	  &nbsp;&nbsp;&nbsp;{&nbsp;-16.3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;,&nbsp;0,&nbsp;-0.000301,&nbsp;-1&nbsp;&nbsp;},<br>
-	  &nbsp;&nbsp;&nbsp;{1236.345679,&nbsp;0,&nbsp;&nbsp;7&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;,&nbsp;-1.2}<br>
-	  }; </tt></td>
+  <td><tt>%G </tt><br>
+    (default)</td>
+  <td align="left" valign="top"><tt>5&nbsp;x&nbsp;4&nbsp;matrix<br>
+    &nbsp;&nbsp;&nbsp;3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;-3.4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;<br>
+    &nbsp;&nbsp;&nbsp;5.1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;3.012346&nbsp;&nbsp;0&nbsp;&nbsp;<br>
+    &nbsp;&nbsp;16.37&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;2.5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;<br>
+    &nbsp;-16.3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;-0.000301&nbsp;-1&nbsp;&nbsp;<br>
+    1236.345679&nbsp;0&nbsp;&nbsp;7&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-1.2 
+    </tt></td>
+  <td align="left" valign="top"><tt>{<br>
+    &nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;,&nbsp;0,&nbsp;-3.4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;,&nbsp;&nbsp;0&nbsp;&nbsp;},<br>
+    &nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;5.1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;,&nbsp;0,&nbsp;&nbsp;3.012346,&nbsp;&nbsp;0&nbsp;&nbsp;},<br>
+    &nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;16.37&nbsp;&nbsp;&nbsp;&nbsp;,&nbsp;0,&nbsp;&nbsp;2.5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;,&nbsp;&nbsp;0&nbsp;&nbsp;},<br>
+    &nbsp;&nbsp;&nbsp;{&nbsp;-16.3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;,&nbsp;0,&nbsp;-0.000301,&nbsp;-1&nbsp;&nbsp;},<br>
+    &nbsp;&nbsp;&nbsp;{1236.345679,&nbsp;0,&nbsp;&nbsp;7&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;,&nbsp;-1.2}<br>
+    }; </tt></td>
   </tr>
   <tr> 
-	<td><tt>%1.10G</tt></td>
-	<td align="left" valign="top"><tt>5&nbsp;x&nbsp;4&nbsp;matrix<br>
-	  &nbsp;&nbsp;&nbsp;3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;-3.4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;<br>
-	  &nbsp;&nbsp;&nbsp;5.1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;3.0123456789&nbsp;&nbsp;0&nbsp;&nbsp;<br>
-	  &nbsp;&nbsp;16.37&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;2.5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;<br>
-	  &nbsp;-16.3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;-0.0003012346&nbsp;-1&nbsp;&nbsp;<br>
-	  1236.3456789&nbsp;0&nbsp;&nbsp;7&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-1.2 
-	  </tt></td>
-	<td align="left" valign="top"><tt>{<br>
-	  &nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;,&nbsp;0,&nbsp;-3.4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;,&nbsp;&nbsp;0&nbsp;&nbsp;},<br>
-	  &nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;5.1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;,&nbsp;0,&nbsp;&nbsp;3.0123456789,&nbsp;&nbsp;0&nbsp;&nbsp;},<br>
-	  &nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;16.37&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;,&nbsp;0,&nbsp;&nbsp;2.5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;,&nbsp;&nbsp;0&nbsp;&nbsp;},<br>
-	  &nbsp;&nbsp;&nbsp;{&nbsp;-16.3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;,&nbsp;0,&nbsp;-0.0003012346,&nbsp;-1&nbsp;&nbsp;},<br>
-	  &nbsp;&nbsp;&nbsp;{1236.3456789,&nbsp;0,&nbsp;&nbsp;7&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;,&nbsp;-1.2}<br>
-	  }; </tt></td>
+  <td><tt>%1.10G</tt></td>
+  <td align="left" valign="top"><tt>5&nbsp;x&nbsp;4&nbsp;matrix<br>
+    &nbsp;&nbsp;&nbsp;3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;-3.4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;<br>
+    &nbsp;&nbsp;&nbsp;5.1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;3.0123456789&nbsp;&nbsp;0&nbsp;&nbsp;<br>
+    &nbsp;&nbsp;16.37&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;2.5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;<br>
+    &nbsp;-16.3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;-0.0003012346&nbsp;-1&nbsp;&nbsp;<br>
+    1236.3456789&nbsp;0&nbsp;&nbsp;7&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-1.2 
+    </tt></td>
+  <td align="left" valign="top"><tt>{<br>
+    &nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;,&nbsp;0,&nbsp;-3.4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;,&nbsp;&nbsp;0&nbsp;&nbsp;},<br>
+    &nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;5.1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;,&nbsp;0,&nbsp;&nbsp;3.0123456789,&nbsp;&nbsp;0&nbsp;&nbsp;},<br>
+    &nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;16.37&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;,&nbsp;0,&nbsp;&nbsp;2.5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;,&nbsp;&nbsp;0&nbsp;&nbsp;},<br>
+    &nbsp;&nbsp;&nbsp;{&nbsp;-16.3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;,&nbsp;0,&nbsp;-0.0003012346,&nbsp;-1&nbsp;&nbsp;},<br>
+    &nbsp;&nbsp;&nbsp;{1236.3456789,&nbsp;0,&nbsp;&nbsp;7&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;,&nbsp;-1.2}<br>
+    }; </tt></td>
   </tr>
   <tr> 
-	<td><tt>%f</tt></td>
-	<td align="left" valign="top"> <tt> 5&nbsp;x&nbsp;4&nbsp;matrix<br>
-	  &nbsp;&nbsp;&nbsp;3.000000&nbsp;0.000000&nbsp;-3.400000&nbsp;&nbsp;0.000000<br>
-	  &nbsp;&nbsp;&nbsp;5.100000&nbsp;0.000000&nbsp;&nbsp;3.012346&nbsp;&nbsp;0.000000<br>
-	  &nbsp;&nbsp;16.370000&nbsp;0.000000&nbsp;&nbsp;2.500000&nbsp;&nbsp;0.000000<br>
-	  &nbsp;-16.300000&nbsp;0.000000&nbsp;-0.000301&nbsp;-1.000000<br>
-	  1236.345679&nbsp;0.000000&nbsp;&nbsp;7.000000&nbsp;-1.200000 </tt> </td>
-	<td align="left" valign="top"><tt> {<br>
-	  &nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;3.000000,&nbsp;0.000000,&nbsp;-3.400000,&nbsp;&nbsp;0.000000},<br>
-	  &nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;5.100000,&nbsp;0.000000,&nbsp;&nbsp;3.012346,&nbsp;&nbsp;0.000000},<br>
-	  &nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;16.370000,&nbsp;0.000000,&nbsp;&nbsp;2.500000,&nbsp;&nbsp;0.000000},<br>
-	  &nbsp;&nbsp;&nbsp;{&nbsp;-16.300000,&nbsp;0.000000,&nbsp;-0.000301,&nbsp;-1.000000},<br>
-	  &nbsp;&nbsp;&nbsp;{1236.345679,&nbsp;0.000000,&nbsp;&nbsp;7.000000,&nbsp;-1.200000}<br>
-	  }; </tt> </td>
+  <td><tt>%f</tt></td>
+  <td align="left" valign="top"> <tt> 5&nbsp;x&nbsp;4&nbsp;matrix<br>
+    &nbsp;&nbsp;&nbsp;3.000000&nbsp;0.000000&nbsp;-3.400000&nbsp;&nbsp;0.000000<br>
+    &nbsp;&nbsp;&nbsp;5.100000&nbsp;0.000000&nbsp;&nbsp;3.012346&nbsp;&nbsp;0.000000<br>
+    &nbsp;&nbsp;16.370000&nbsp;0.000000&nbsp;&nbsp;2.500000&nbsp;&nbsp;0.000000<br>
+    &nbsp;-16.300000&nbsp;0.000000&nbsp;-0.000301&nbsp;-1.000000<br>
+    1236.345679&nbsp;0.000000&nbsp;&nbsp;7.000000&nbsp;-1.200000 </tt> </td>
+  <td align="left" valign="top"><tt> {<br>
+    &nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;3.000000,&nbsp;0.000000,&nbsp;-3.400000,&nbsp;&nbsp;0.000000},<br>
+    &nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;5.100000,&nbsp;0.000000,&nbsp;&nbsp;3.012346,&nbsp;&nbsp;0.000000},<br>
+    &nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;16.370000,&nbsp;0.000000,&nbsp;&nbsp;2.500000,&nbsp;&nbsp;0.000000},<br>
+    &nbsp;&nbsp;&nbsp;{&nbsp;-16.300000,&nbsp;0.000000,&nbsp;-0.000301,&nbsp;-1.000000},<br>
+    &nbsp;&nbsp;&nbsp;{1236.345679,&nbsp;0.000000,&nbsp;&nbsp;7.000000,&nbsp;-1.200000}<br>
+    }; </tt> </td>
   </tr>
   <tr> 
-	<td><tt>%1.2f</tt></td>
-	<td align="left" valign="top"><tt>5&nbsp;x&nbsp;4&nbsp;matrix<br>
-	  &nbsp;&nbsp;&nbsp;3.00&nbsp;0.00&nbsp;-3.40&nbsp;&nbsp;0.00<br>
-	  &nbsp;&nbsp;&nbsp;5.10&nbsp;0.00&nbsp;&nbsp;3.01&nbsp;&nbsp;0.00<br>
-	  &nbsp;&nbsp;16.37&nbsp;0.00&nbsp;&nbsp;2.50&nbsp;&nbsp;0.00<br>
-	  &nbsp;-16.30&nbsp;0.00&nbsp;-0.00&nbsp;-1.00<br>
-	  1236.35&nbsp;0.00&nbsp;&nbsp;7.00&nbsp;-1.20 </tt></td>
-	<td align="left" valign="top"><tt>{<br>
-	  &nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;3.00,&nbsp;0.00,&nbsp;-3.40,&nbsp;&nbsp;0.00},<br>
-	  &nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;5.10,&nbsp;0.00,&nbsp;&nbsp;3.01,&nbsp;&nbsp;0.00},<br>
-	  &nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;16.37,&nbsp;0.00,&nbsp;&nbsp;2.50,&nbsp;&nbsp;0.00},<br>
-	  &nbsp;&nbsp;&nbsp;{&nbsp;-16.30,&nbsp;0.00,&nbsp;-0.00,&nbsp;-1.00},<br>
-	  &nbsp;&nbsp;&nbsp;{1236.35,&nbsp;0.00,&nbsp;&nbsp;7.00,&nbsp;-1.20}<br>
-	  }; </tt></td>
+  <td><tt>%1.2f</tt></td>
+  <td align="left" valign="top"><tt>5&nbsp;x&nbsp;4&nbsp;matrix<br>
+    &nbsp;&nbsp;&nbsp;3.00&nbsp;0.00&nbsp;-3.40&nbsp;&nbsp;0.00<br>
+    &nbsp;&nbsp;&nbsp;5.10&nbsp;0.00&nbsp;&nbsp;3.01&nbsp;&nbsp;0.00<br>
+    &nbsp;&nbsp;16.37&nbsp;0.00&nbsp;&nbsp;2.50&nbsp;&nbsp;0.00<br>
+    &nbsp;-16.30&nbsp;0.00&nbsp;-0.00&nbsp;-1.00<br>
+    1236.35&nbsp;0.00&nbsp;&nbsp;7.00&nbsp;-1.20 </tt></td>
+  <td align="left" valign="top"><tt>{<br>
+    &nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;3.00,&nbsp;0.00,&nbsp;-3.40,&nbsp;&nbsp;0.00},<br>
+    &nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;5.10,&nbsp;0.00,&nbsp;&nbsp;3.01,&nbsp;&nbsp;0.00},<br>
+    &nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;16.37,&nbsp;0.00,&nbsp;&nbsp;2.50,&nbsp;&nbsp;0.00},<br>
+    &nbsp;&nbsp;&nbsp;{&nbsp;-16.30,&nbsp;0.00,&nbsp;-0.00,&nbsp;-1.00},<br>
+    &nbsp;&nbsp;&nbsp;{1236.35,&nbsp;0.00,&nbsp;&nbsp;7.00,&nbsp;-1.20}<br>
+    }; </tt></td>
   </tr>
   <tr> 
-	<td><tt>%0.2e</tt></td>
-	<td align="left" valign="top"><tt>5&nbsp;x&nbsp;4&nbsp;matrix<br>
-	  &nbsp;3.00e+000&nbsp;0.00e+000&nbsp;-3.40e+000&nbsp;&nbsp;0.00e+000<br>
-	  &nbsp;5.10e+000&nbsp;0.00e+000&nbsp;&nbsp;3.01e+000&nbsp;&nbsp;0.00e+000<br>
-	  &nbsp;1.64e+001&nbsp;0.00e+000&nbsp;&nbsp;2.50e+000&nbsp;&nbsp;0.00e+000<br>
-	  -1.63e+001&nbsp;0.00e+000&nbsp;-3.01e-004&nbsp;-1.00e+000<br>
-	  &nbsp;1.24e+003&nbsp;0.00e+000&nbsp;&nbsp;7.00e+000&nbsp;-1.20e+000 </tt></td>
-	<td align="left" valign="top"><tt>{<br>
-	  &nbsp;&nbsp;&nbsp;{&nbsp;3.00e+000,&nbsp;0.00e+000,&nbsp;-3.40e+000,&nbsp;&nbsp;0.00e+000},<br>
-	  &nbsp;&nbsp;&nbsp;{&nbsp;5.10e+000,&nbsp;0.00e+000,&nbsp;&nbsp;3.01e+000,&nbsp;&nbsp;0.00e+000},<br>
-	  &nbsp;&nbsp;&nbsp;{&nbsp;1.64e+001,&nbsp;0.00e+000,&nbsp;&nbsp;2.50e+000,&nbsp;&nbsp;0.00e+000},<br>
-	  &nbsp;&nbsp;&nbsp;{-1.63e+001,&nbsp;0.00e+000,&nbsp;-3.01e-004,&nbsp;-1.00e+000},<br>
-	  &nbsp;&nbsp;&nbsp;{&nbsp;1.24e+003,&nbsp;0.00e+000,&nbsp;&nbsp;7.00e+000,&nbsp;-1.20e+000}<br>
-	  }; </tt></td>
+  <td><tt>%0.2e</tt></td>
+  <td align="left" valign="top"><tt>5&nbsp;x&nbsp;4&nbsp;matrix<br>
+    &nbsp;3.00e+000&nbsp;0.00e+000&nbsp;-3.40e+000&nbsp;&nbsp;0.00e+000<br>
+    &nbsp;5.10e+000&nbsp;0.00e+000&nbsp;&nbsp;3.01e+000&nbsp;&nbsp;0.00e+000<br>
+    &nbsp;1.64e+001&nbsp;0.00e+000&nbsp;&nbsp;2.50e+000&nbsp;&nbsp;0.00e+000<br>
+    -1.63e+001&nbsp;0.00e+000&nbsp;-3.01e-004&nbsp;-1.00e+000<br>
+    &nbsp;1.24e+003&nbsp;0.00e+000&nbsp;&nbsp;7.00e+000&nbsp;-1.20e+000 </tt></td>
+  <td align="left" valign="top"><tt>{<br>
+    &nbsp;&nbsp;&nbsp;{&nbsp;3.00e+000,&nbsp;0.00e+000,&nbsp;-3.40e+000,&nbsp;&nbsp;0.00e+000},<br>
+    &nbsp;&nbsp;&nbsp;{&nbsp;5.10e+000,&nbsp;0.00e+000,&nbsp;&nbsp;3.01e+000,&nbsp;&nbsp;0.00e+000},<br>
+    &nbsp;&nbsp;&nbsp;{&nbsp;1.64e+001,&nbsp;0.00e+000,&nbsp;&nbsp;2.50e+000,&nbsp;&nbsp;0.00e+000},<br>
+    &nbsp;&nbsp;&nbsp;{-1.63e+001,&nbsp;0.00e+000,&nbsp;-3.01e-004,&nbsp;-1.00e+000},<br>
+    &nbsp;&nbsp;&nbsp;{&nbsp;1.24e+003,&nbsp;0.00e+000,&nbsp;&nbsp;7.00e+000,&nbsp;-1.20e+000}<br>
+    }; </tt></td>
   </tr>
   <tr> 
-	<td><tt>null</tt></td>
-	<td align="left" valign="top"><tt>5&nbsp;x&nbsp;4&nbsp;matrix <br>
-	  &nbsp;&nbsp;&nbsp;3.0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0.0&nbsp;-3.4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0.0<br>
-	  &nbsp;&nbsp;&nbsp;5.1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0.0&nbsp;&nbsp;3.0123456789&nbsp;&nbsp;&nbsp;&nbsp;0.0<br>
-	  &nbsp;&nbsp;16.37&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0.0&nbsp;&nbsp;2.5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0.0<br>
-	  &nbsp;-16.3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0.0&nbsp;-3.012345678E-4&nbsp;-1.0<br>
-	  1236.3456789&nbsp;0.0&nbsp;&nbsp;7.0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-1.2 
-	  </tt> <tt> </tt></td>
-	<td align="left" valign="top"><tt> {<br>
-	  &nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;3.0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;,&nbsp;0.0,&nbsp;-3.4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;,&nbsp;&nbsp;0.0},<br>
-	  &nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;5.1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;,&nbsp;0.0,&nbsp;&nbsp;3.0123456789&nbsp;&nbsp;,&nbsp;&nbsp;0.0},<br>
-	  &nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;16.37&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;,&nbsp;0.0,&nbsp;&nbsp;2.5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;,&nbsp;&nbsp;0.0},<br>
-	  &nbsp;&nbsp;&nbsp;{&nbsp;-16.3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;,&nbsp;0.0,&nbsp;-3.012345678E-4,&nbsp;-1.0},<br>
-	  &nbsp;&nbsp;&nbsp;{1236.3456789,&nbsp;0.0,&nbsp;&nbsp;7.0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;,&nbsp;-1.2}<br>
-	  }; </tt> </td>
+  <td><tt>null</tt></td>
+  <td align="left" valign="top"><tt>5&nbsp;x&nbsp;4&nbsp;matrix <br>
+    &nbsp;&nbsp;&nbsp;3.0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0.0&nbsp;-3.4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0.0<br>
+    &nbsp;&nbsp;&nbsp;5.1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0.0&nbsp;&nbsp;3.0123456789&nbsp;&nbsp;&nbsp;&nbsp;0.0<br>
+    &nbsp;&nbsp;16.37&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0.0&nbsp;&nbsp;2.5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0.0<br>
+    &nbsp;-16.3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0.0&nbsp;-3.012345678E-4&nbsp;-1.0<br>
+    1236.3456789&nbsp;0.0&nbsp;&nbsp;7.0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-1.2 
+    </tt> <tt> </tt></td>
+  <td align="left" valign="top"><tt> {<br>
+    &nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;3.0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;,&nbsp;0.0,&nbsp;-3.4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;,&nbsp;&nbsp;0.0},<br>
+    &nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;5.1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;,&nbsp;0.0,&nbsp;&nbsp;3.0123456789&nbsp;&nbsp;,&nbsp;&nbsp;0.0},<br>
+    &nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;16.37&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;,&nbsp;0.0,&nbsp;&nbsp;2.5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;,&nbsp;&nbsp;0.0},<br>
+    &nbsp;&nbsp;&nbsp;{&nbsp;-16.3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;,&nbsp;0.0,&nbsp;-3.012345678E-4,&nbsp;-1.0},<br>
+    &nbsp;&nbsp;&nbsp;{1236.3456789,&nbsp;0.0,&nbsp;&nbsp;7.0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;,&nbsp;-1.2}<br>
+    }; </tt> </td>
   </tr>
 </table>
 
@@ -161,29 +161,29 @@
   title and some statistical aggregations.</p>
 <table border="1" cellspacing="0">
   <tr> 
-	<td nowrap> 
-	  <p><tt> double[][] values = {<br>
-		{5 ,10, 20, 40 },<br>
-		{ 7, 8 , 6 , 7 },<br>
-		{12 ,10, 20, 19 },<br>
-		{ 3, 1 , 5 , 6 }<br>
-		}; <br>
-		</tt><tt>String title = "CPU performance over time [nops/sec]";<br>
-		String columnAxisName = "Year";<br>
-		String rowAxisName = "CPU"; <br>
-		String[] columnNames = {"1996", "1997", "1998", "1999"};<br>
-		String[] rowNames = { "PowerBar", "Benzol", "Mercedes", "Sparcling"};<br>
-		hep.aida.bin.BinFunctions1D F = hep.aida.bin.BinFunctions1D.functions; // alias<br>
-		hep.aida.bin.BinFunction1D[] aggr = {F.mean, F.rms, F.quantile(0.25), F.median, F.quantile(0.75), F.stdDev, F.min, F.max};<br>
-		String format = "%1.2G";<br>
-		DoubleMatrix2D matrix = new DenseDoubleMatrix2D(values); <br>
-		new Formatter(format).toTitleString(<br>
-		&nbsp;&nbsp;&nbsp;matrix,rowNames,columnNames,rowAxisName,columnAxisName,title,aggr); </tt> 
-	  </p>
-	  </td>
+  <td nowrap> 
+    <p><tt> double[][] values = {<br>
+    {5 ,10, 20, 40 },<br>
+    { 7, 8 , 6 , 7 },<br>
+    {12 ,10, 20, 19 },<br>
+    { 3, 1 , 5 , 6 }<br>
+    }; <br>
+    </tt><tt>String title = "CPU performance over time [nops/sec]";<br>
+    String columnAxisName = "Year";<br>
+    String rowAxisName = "CPU"; <br>
+    String[] columnNames = {"1996", "1997", "1998", "1999"};<br>
+    String[] rowNames = { "PowerBar", "Benzol", "Mercedes", "Sparcling"};<br>
+    hep.aida.bin.BinFunctions1D F = hep.aida.bin.BinFunctions1D.functions; // alias<br>
+    hep.aida.bin.BinFunction1D[] aggr = {F.mean, F.rms, F.quantile(0.25), F.median, F.quantile(0.75), F.stdDev, F.min, F.max};<br>
+    String format = "%1.2G";<br>
+    DoubleMatrix2D matrix = new DenseDoubleMatrix2D(values); <br>
+    new Formatter(format).toTitleString(<br>
+    &nbsp;&nbsp;&nbsp;matrix,rowNames,columnNames,rowAxisName,columnAxisName,title,aggr); </tt> 
+    </p>
+    </td>
   </tr>
   <tr> 
-	<td><tt>
+  <td><tt>
 CPU&nbsp;performance&nbsp;over&nbsp;time&nbsp;[nops/sec]<br>
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;Year<br>
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;1996&nbsp;&nbsp;1997&nbsp;&nbsp;1998&nbsp;&nbsp;1999&nbsp;&nbsp;|&nbsp;Mean&nbsp;&nbsp;RMS&nbsp;&nbsp;&nbsp;25%&nbsp;Q.&nbsp;Median&nbsp;75%&nbsp;Q.&nbsp;StdDev&nbsp;Min&nbsp;Max<br>
@@ -205,30 +205,30 @@
 </td>
   </tr>
   <tr> 
-	<td nowrap><tt> same as above, but now without aggregations<br>
-	  aggr=null; </tt> </td>
+  <td nowrap><tt> same as above, but now without aggregations<br>
+    aggr=null; </tt> </td>
   </tr>
   <tr> 
-	<td><tt> CPU&nbsp;performance&nbsp;over&nbsp;time&nbsp;[nops/sec]<br>
-	  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;Year<br>
-	  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;1996&nbsp;1997&nbsp;1998&nbsp;1999<br>
-	  ---------------------------------<br>
-	  C&nbsp;PowerBar&nbsp;&nbsp;|&nbsp;&nbsp;5&nbsp;&nbsp;&nbsp;10&nbsp;&nbsp;&nbsp;20&nbsp;&nbsp;&nbsp;40&nbsp;&nbsp;<br>
-	  P&nbsp;Benzol&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;7&nbsp;&nbsp;&nbsp;&nbsp;8&nbsp;&nbsp;&nbsp;&nbsp;6&nbsp;&nbsp;&nbsp;&nbsp;7&nbsp;&nbsp;<br>
-	  U&nbsp;Mercedes&nbsp;&nbsp;|&nbsp;12&nbsp;&nbsp;&nbsp;10&nbsp;&nbsp;&nbsp;20&nbsp;&nbsp;&nbsp;19&nbsp;&nbsp;<br>
-	  &nbsp;&nbsp;Sparcling&nbsp;|&nbsp;&nbsp;3&nbsp;&nbsp;&nbsp;&nbsp;1&nbsp;&nbsp;&nbsp;&nbsp;5&nbsp;&nbsp;&nbsp;&nbsp;6&nbsp;&nbsp; 
-	  </tt> </td>
+  <td><tt> CPU&nbsp;performance&nbsp;over&nbsp;time&nbsp;[nops/sec]<br>
+    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;Year<br>
+    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;1996&nbsp;1997&nbsp;1998&nbsp;1999<br>
+    ---------------------------------<br>
+    C&nbsp;PowerBar&nbsp;&nbsp;|&nbsp;&nbsp;5&nbsp;&nbsp;&nbsp;10&nbsp;&nbsp;&nbsp;20&nbsp;&nbsp;&nbsp;40&nbsp;&nbsp;<br>
+    P&nbsp;Benzol&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;7&nbsp;&nbsp;&nbsp;&nbsp;8&nbsp;&nbsp;&nbsp;&nbsp;6&nbsp;&nbsp;&nbsp;&nbsp;7&nbsp;&nbsp;<br>
+    U&nbsp;Mercedes&nbsp;&nbsp;|&nbsp;12&nbsp;&nbsp;&nbsp;10&nbsp;&nbsp;&nbsp;20&nbsp;&nbsp;&nbsp;19&nbsp;&nbsp;<br>
+    &nbsp;&nbsp;Sparcling&nbsp;|&nbsp;&nbsp;3&nbsp;&nbsp;&nbsp;&nbsp;1&nbsp;&nbsp;&nbsp;&nbsp;5&nbsp;&nbsp;&nbsp;&nbsp;6&nbsp;&nbsp; 
+    </tt> </td>
   </tr>
   <tr> 
-	<td nowrap>
-	  <p><tt> same as above, but now without rows labeled<br>
-		aggr=null;<br>
-		rowNames=null;<br>
-		rowAxisName=null; </tt> </p>
-	  </td>
+  <td nowrap>
+    <p><tt> same as above, but now without rows labeled<br>
+    aggr=null;<br>
+    rowNames=null;<br>
+    rowAxisName=null; </tt> </p>
+    </td>
   </tr>
   <tr> 
-	<td><tt>
+  <td><tt>
 CPU&nbsp;performance&nbsp;over&nbsp;time&nbsp;[nops/sec]<br>
 Year<br>
 1996&nbsp;1997&nbsp;1998&nbsp;1999<br>
@@ -275,15 +275,15 @@
  * Constructs and returns a matrix formatter with format <tt>"%G"</tt>.
  */
 public Formatter() {
-	this("%G");
+  this("%G");
 }
 /**
  * Constructs and returns a matrix formatter.
  * @param format the given format used to convert a single cell value.
  */
 public Formatter(String format) {
-	setFormat(format);
-	setAlignment(DECIMAL);
+  setFormat(format);
+  setAlignment(DECIMAL);
 }
 /**
  * Demonstrates how to use this class.
@@ -291,11 +291,11 @@
 public static void demo1() {
 // parameters
 double[][] values = {
-	{3,     0,        -3.4, 0},
-	{5.1   ,0,        +3.0123456789, 0},
-	{16.37, 0.0,       2.5, 0},
-	{-16.3, 0,        -3.012345678E-4, -1},
-	{1236.3456789, 0,  7, -1.2}
+  {3,     0,        -3.4, 0},
+  {5.1   ,0,        +3.0123456789, 0},
+  {16.37, 0.0,       2.5, 0},
+  {-16.3, 0,        -3.012345678E-4, -1},
+  {1236.3456789, 0,  7, -1.2}
 };
 String[] formats =         {"%G", "%1.10G", "%f", "%1.2f", "%0.2e", null};
 
@@ -309,26 +309,26 @@
 String[] htmlSourceCodes = new String[size];
 
 for (int i=0; i<size; i++) {
-	String format = formats[i];
-	strings[i] = new Formatter(format).toString(matrix);
-	sourceCodes[i] = new Formatter(format).toSourceCode(matrix);
+  String format = formats[i];
+  strings[i] = new Formatter(format).toString(matrix);
+  sourceCodes[i] = new Formatter(format).toSourceCode(matrix);
 
-	// may not compile because of packages not included in the distribution
-	//htmlStrings[i] = org.apache.mahout.matrix.matrixpattern.Converting.toHTML(strings[i]);
-	//htmlSourceCodes[i] = org.apache.mahout.matrix.matrixpattern.Converting.toHTML(sourceCodes[i]);
+  // may not compile because of packages not included in the distribution
+  //htmlStrings[i] = org.apache.mahout.matrix.matrixpattern.Converting.toHTML(strings[i]);
+  //htmlSourceCodes[i] = org.apache.mahout.matrix.matrixpattern.Converting.toHTML(sourceCodes[i]);
 }
 
 System.out.println("original:\n"+new Formatter().toString(matrix));
 
 // may not compile because of packages not included in the distribution
 for (int i=0; i<size; i++) {
-	//System.out.println("\nhtmlString("+formats[i]+"):\n"+htmlStrings[i]);
-	//System.out.println("\nhtmlSourceCode("+formats[i]+"):\n"+htmlSourceCodes[i]);
+  //System.out.println("\nhtmlString("+formats[i]+"):\n"+htmlStrings[i]);
+  //System.out.println("\nhtmlSourceCode("+formats[i]+"):\n"+htmlSourceCodes[i]);
 }
 
 for (int i=0; i<size; i++) {
-	System.out.println("\nstring("+formats[i]+"):\n"+strings[i]);
-	System.out.println("\nsourceCode("+formats[i]+"):\n"+sourceCodes[i]);
+  System.out.println("\nstring("+formats[i]+"):\n"+strings[i]);
+  System.out.println("\nsourceCode("+formats[i]+"):\n"+sourceCodes[i]);
 }
 
 }
@@ -338,9 +338,9 @@
 public static void demo2() {
 // parameters
 double[] values = {
-	//5, 0.0, -0.0, -Double.NaN, Double.NaN, 0.0/0.0, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, Double.MIN_VALUE, Double.MAX_VALUE
-	5, 0.0, -0.0, -Double.NaN, Double.NaN, 0.0/0.0, Double.MIN_VALUE, Double.MAX_VALUE , Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY
-	//Double.MIN_VALUE, Double.MAX_VALUE //, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY
+  //5, 0.0, -0.0, -Double.NaN, Double.NaN, 0.0/0.0, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, Double.MIN_VALUE, Double.MAX_VALUE
+  5, 0.0, -0.0, -Double.NaN, Double.NaN, 0.0/0.0, Double.MIN_VALUE, Double.MAX_VALUE , Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY
+  //Double.MIN_VALUE, Double.MAX_VALUE //, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY
 };
 //String[] formats =         {"%G", "%1.10G", "%f", "%1.2f", "%0.2e"};
 String[] formats =         {"%G", "%1.19G"};
@@ -354,17 +354,17 @@
 //String[] javaStrings = new String[size];
 
 for (int i=0; i<size; i++) {
-	String format = formats[i];
-	strings[i] = new Formatter(format).toString(matrix);
-	for (int j=0; j<matrix.size(); j++) {
-		System.out.println(String.valueOf(matrix.get(j)));
-	}
+  String format = formats[i];
+  strings[i] = new Formatter(format).toString(matrix);
+  for (int j=0; j<matrix.size(); j++) {
+    System.out.println(String.valueOf(matrix.get(j)));
+  }
 }
 
 System.out.println("original:\n"+new Formatter().toString(matrix));
 
 for (int i=0; i<size; i++) {
-	System.out.println("\nstring("+formats[i]+"):\n"+strings[i]);
+  System.out.println("\nstring("+formats[i]+"):\n"+strings[i]);
 }
 
 }
@@ -372,43 +372,43 @@
  * Demonstrates how to use this class.
  */
 public static void demo3(int size, double value) {
-	org.apache.mahout.matrix.Timer timer = new org.apache.mahout.matrix.Timer();
-	String s;
-	StringBuffer buf;
-	DoubleMatrix2D matrix = org.apache.mahout.matrix.matrix.DoubleFactory2D.dense.make(size,size, value);
+  org.apache.mahout.matrix.Timer timer = new org.apache.mahout.matrix.Timer();
+  String s;
+  StringBuffer buf;
+  DoubleMatrix2D matrix = org.apache.mahout.matrix.matrix.DoubleFactory2D.dense.make(size,size, value);
 
-	timer.reset().start();
-	buf = new StringBuffer();
-	for (int i=size; --i >= 0; ) {
-		for (int j=size; --j >= 0; ) {
-			buf.append(matrix.getQuick(i,j));
-		}
-	}
-	buf = null;
-	timer.stop().display();
+  timer.reset().start();
+  buf = new StringBuffer();
+  for (int i=size; --i >= 0; ) {
+    for (int j=size; --j >= 0; ) {
+      buf.append(matrix.getQuick(i,j));
+    }
+  }
+  buf = null;
+  timer.stop().display();
 
-	timer.reset().start();
-	org.apache.mahout.matrix.matrix.impl.Former format = new org.apache.mahout.matrix.matrix.impl.FormerFactory().create("%G");
-	buf = new StringBuffer();
-	for (int i=size; --i >= 0; ) {
-		for (int j=size; --j >= 0; ) {
-			buf.append(format.form(matrix.getQuick(i,j)));
-		}
-	}
-	buf = null;
-	timer.stop().display();
+  timer.reset().start();
+  org.apache.mahout.matrix.matrix.impl.Former format = new org.apache.mahout.matrix.matrix.impl.FormerFactory().create("%G");
+  buf = new StringBuffer();
+  for (int i=size; --i >= 0; ) {
+    for (int j=size; --j >= 0; ) {
+      buf.append(format.form(matrix.getQuick(i,j)));
+    }
+  }
+  buf = null;
+  timer.stop().display();
 
-	timer.reset().start();
-	s = new Formatter(null).toString(matrix);
-	//System.out.println(s);
-	s = null;
-	timer.stop().display();
+  timer.reset().start();
+  s = new Formatter(null).toString(matrix);
+  //System.out.println(s);
+  s = null;
+  timer.stop().display();
 
-	timer.reset().start();
-	s = new Formatter("%G").toString(matrix);
-	//System.out.println(s);
-	s = null;
-	timer.stop().display();
+  timer.reset().start();
+  s = new Formatter("%G").toString(matrix);
+  //System.out.println(s);
+  s = null;
+  timer.stop().display();
 }
 /**
  * Demonstrates how to use this class.
@@ -416,16 +416,16 @@
 public static void demo4() {
 // parameters
 double[][] values = {
-	{3,     0,        -3.4, 0},
-	{5.1   ,0,        +3.0123456789, 0},
-	{16.37, 0.0,       2.5, 0},
-	{-16.3, 0,        -3.012345678E-4, -1},
-	{1236.3456789, 0,  7, -1.2}
+  {3,     0,        -3.4, 0},
+  {5.1   ,0,        +3.0123456789, 0},
+  {16.37, 0.0,       2.5, 0},
+  {-16.3, 0,        -3.012345678E-4, -1},
+  {1236.3456789, 0,  7, -1.2}
 };
 /*
 double[][] values = {
-	{3,     1,      },
-	{5.1   ,16.37,  }
+  {3,     1,      },
+  {5.1   ,16.37,  }
 };
 */
 //String[] columnNames = { "he",   "",  "he", "four" };
@@ -444,16 +444,16 @@
 public static void demo5() {
 // parameters
 double[][] values = {
-	{3,     0,        -3.4, 0},
-	{5.1   ,0,        +3.0123456789, 0},
-	{16.37, 0.0,       2.5, 0},
-	{-16.3, 0,        -3.012345678E-4, -1},
-	{1236.3456789, 0,  7, -1.2}
+  {3,     0,        -3.4, 0},
+  {5.1   ,0,        +3.0123456789, 0},
+  {16.37, 0.0,       2.5, 0},
+  {-16.3, 0,        -3.012345678E-4, -1},
+  {1236.3456789, 0,  7, -1.2}
 };
 /*
 double[][] values = {
-	{3,     1,      },
-	{5.1   ,16.37,  }
+  {3,     1,      },
+  {5.1   ,16.37,  }
 };
 */
 //String[] columnNames = { "he",   "",  "he", "four" };
@@ -472,16 +472,16 @@
 public static void demo6() {
 // parameters
 double[][] values = {
-	{3,     0,        -3.4, 0},
-	{5.1   ,0,        +3.0123456789, 0},
-	{16.37, 0.0,       2.5, 0},
-	{-16.3, 0,        -3.012345678E-4, -1},
-	{1236.3456789, 0,  7, -1.2}
+  {3,     0,        -3.4, 0},
+  {5.1   ,0,        +3.0123456789, 0},
+  {16.37, 0.0,       2.5, 0},
+  {-16.3, 0,        -3.012345678E-4, -1},
+  {1236.3456789, 0,  7, -1.2}
 };
 /*
 double[][] values = {
-	{3,     1,      },
-	{5.1   ,16.37,  }
+  {3,     1,      },
+  {5.1   ,16.37,  }
 };
 */
 //String[] columnNames = { "he",   "",  "he", "four" };
@@ -504,18 +504,18 @@
 // parameters
 /*
 double[][] values = {
-	{3,     0,        -3.4, 0},
-	{5.1   ,0,        +3.0123456789, 0},
-	{16.37, 0.0,       2.5, 0},
-	{-16.3, 0,        -3.012345678E-4, -1},
-	{1236.3456789, 0,  7, -1.2}
+  {3,     0,        -3.4, 0},
+  {5.1   ,0,        +3.0123456789, 0},
+  {16.37, 0.0,       2.5, 0},
+  {-16.3, 0,        -3.012345678E-4, -1},
+  {1236.3456789, 0,  7, -1.2}
 };
 */
 double[][] values = {
-	{5  ,10, 20, 40 },
-	{ 7,  8 , 6 , 7 },
-	{12 ,10, 20, 19 },
-	{ 3,  1 , 5 , 6 }
+  {5  ,10, 20, 40 },
+  { 7,  8 , 6 , 7 },
+  {12 ,10, 20, 19 },
+  { 3,  1 , 5 , 6 }
 };
 String[] columnNames = {"1996", "1997", "1998", "1999"};
 String[] rowNames = { "PowerBar", "Benzol", "Mercedes", "Sparcling"};
@@ -541,125 +541,125 @@
  * Converts a given cell to a String; no alignment considered.
  */
 protected String form(DoubleMatrix1D matrix, int index, Former formatter) {
-	return formatter.form(matrix.get(index));
+  return formatter.form(matrix.get(index));
 }
 /**
  * Converts a given cell to a String; no alignment considered.
  */
 protected String form(AbstractMatrix1D matrix, int index, Former formatter) {
-	return this.form((DoubleMatrix1D) matrix, index, formatter);
+  return this.form((DoubleMatrix1D) matrix, index, formatter);
 }
 /**
  * Returns a string representations of all cells; no alignment considered.
  */
 public String[][] format(DoubleMatrix2D matrix) {
-	String[][] strings = new String[matrix.rows()][matrix.columns()];
-	for (int row=matrix.rows(); --row >= 0; ) strings[row] = formatRow(matrix.viewRow(row));
-	return strings;
+  String[][] strings = new String[matrix.rows()][matrix.columns()];
+  for (int row=matrix.rows(); --row >= 0; ) strings[row] = formatRow(matrix.viewRow(row));
+  return strings;
 }
 /**
  * Returns a string representations of all cells; no alignment considered.
  */
 protected String[][] format(AbstractMatrix2D matrix) {
-	return this.format((DoubleMatrix2D) matrix);
+  return this.format((DoubleMatrix2D) matrix);
 }
 /**
  * Returns the index of the decimal point.
  */
 protected int indexOfDecimalPoint(String s) {
-	int i = s.lastIndexOf('.');
-	if (i<0) i = s.lastIndexOf('e');
-	if (i<0) i = s.lastIndexOf('E');
-	if (i<0) i = s.length();
-	return i;
+  int i = s.lastIndexOf('.');
+  if (i<0) i = s.lastIndexOf('e');
+  if (i<0) i = s.lastIndexOf('E');
+  if (i<0) i = s.length();
+  return i;
 }
 /**
  * Returns the number of characters before the decimal point.
  */
 protected int lead(String s) {
-	if (alignment.equals(DECIMAL)) return indexOfDecimalPoint(s);
-	return super.lead(s);
+  if (alignment.equals(DECIMAL)) return indexOfDecimalPoint(s);
+  return super.lead(s);
 }
 /**
  * Returns a string <tt>s</tt> such that <tt>Object[] m = s</tt> is a legal Java statement.
  * @param matrix the matrix to format.
  */
 public String toSourceCode(DoubleMatrix1D matrix) {
-	Formatter copy = (Formatter) this.clone();
-	copy.setPrintShape(false);
-	copy.setColumnSeparator(", ");
-	String lead  = "{";
-	String trail = "};";
-	return lead + copy.toString(matrix) + trail;
+  Formatter copy = (Formatter) this.clone();
+  copy.setPrintShape(false);
+  copy.setColumnSeparator(", ");
+  String lead  = "{";
+  String trail = "};";
+  return lead + copy.toString(matrix) + trail;
 }
 /**
  * Returns a string <tt>s</tt> such that <tt>Object[] m = s</tt> is a legal Java statement.
  * @param matrix the matrix to format.
  */
 public String toSourceCode(DoubleMatrix2D matrix) {
-	Formatter copy = (Formatter) this.clone();
-	String b3 = blanks(3);
-	copy.setPrintShape(false);
-	copy.setColumnSeparator(", ");
-	copy.setRowSeparator("},\n"+b3+"{");
-	String lead  = "{\n"+b3+"{";
-	String trail = "}\n};";
-	return lead + copy.toString(matrix) + trail;
+  Formatter copy = (Formatter) this.clone();
+  String b3 = blanks(3);
+  copy.setPrintShape(false);
+  copy.setColumnSeparator(", ");
+  copy.setRowSeparator("},\n"+b3+"{");
+  String lead  = "{\n"+b3+"{";
+  String trail = "}\n};";
+  return lead + copy.toString(matrix) + trail;
 }
 /**
  * Returns a string <tt>s</tt> such that <tt>Object[] m = s</tt> is a legal Java statement.
  * @param matrix the matrix to format.
  */
 public String toSourceCode(DoubleMatrix3D matrix) {
-	Formatter copy = (Formatter) this.clone();
-	String b3 = blanks(3);
-	String b6 = blanks(6);
-	copy.setPrintShape(false);
-	copy.setColumnSeparator(", ");
-	copy.setRowSeparator("},\n"+b6+"{");
-	copy.setSliceSeparator("}\n"+b3+"},\n"+b3+"{\n"+b6+"{");
-	String lead  = "{\n"+b3+"{\n"+b6+"{";
-	String trail = "}\n"+b3+"}\n}";
-	return lead + copy.toString(matrix) + trail;
+  Formatter copy = (Formatter) this.clone();
+  String b3 = blanks(3);
+  String b6 = blanks(6);
+  copy.setPrintShape(false);
+  copy.setColumnSeparator(", ");
+  copy.setRowSeparator("},\n"+b6+"{");
+  copy.setSliceSeparator("}\n"+b3+"},\n"+b3+"{\n"+b6+"{");
+  String lead  = "{\n"+b3+"{\n"+b6+"{";
+  String trail = "}\n"+b3+"}\n}";
+  return lead + copy.toString(matrix) + trail;
 }
 /**
  * Returns a string representation of the given matrix.
  * @param matrix the matrix to convert.
  */
 public String toString(DoubleMatrix1D matrix) {
-	DoubleMatrix2D easy = matrix.like2D(1,matrix.size());
-	easy.viewRow(0).assign(matrix);
-	return toString(easy);
+  DoubleMatrix2D easy = matrix.like2D(1,matrix.size());
+  easy.viewRow(0).assign(matrix);
+  return toString(easy);
 }
 /**
  * Returns a string representation of the given matrix.
  * @param matrix the matrix to convert.
  */
 public String toString(DoubleMatrix2D matrix) {
-	return super.toString(matrix);
+  return super.toString(matrix);
 }
 /**
  * Returns a string representation of the given matrix.
  * @param matrix the matrix to convert.
  */
 public String toString(DoubleMatrix3D matrix) {
-	StringBuffer buf = new StringBuffer();
-	boolean oldPrintShape = this.printShape;
-	this.printShape = false;
-	for (int slice=0; slice < matrix.slices(); slice++) {
-		if (slice!=0) buf.append(sliceSeparator);
-		buf.append(toString(matrix.viewSlice(slice)));
-	}
-	this.printShape = oldPrintShape;	
-	if (printShape) buf.insert(0,shape(matrix) + "\n");
-	return buf.toString();
+  StringBuffer buf = new StringBuffer();
+  boolean oldPrintShape = this.printShape;
+  this.printShape = false;
+  for (int slice=0; slice < matrix.slices(); slice++) {
+    if (slice!=0) buf.append(sliceSeparator);
+    buf.append(toString(matrix.viewSlice(slice)));
+  }
+  this.printShape = oldPrintShape;  
+  if (printShape) buf.insert(0,shape(matrix) + "\n");
+  return buf.toString();
 }
 /**
  * Returns a string representation of the given matrix.
  * @param matrix the matrix to convert.
  */
 protected String toString(AbstractMatrix2D matrix) {
-	return this.toString((DoubleMatrix2D) matrix);
+  return this.toString((DoubleMatrix2D) matrix);
 }
 /**
 Returns a string representation of the given matrix with axis as well as rows and columns labeled.
@@ -674,13 +674,13 @@
 @return the matrix converted to a string.
 */
 protected String toTitleString(DoubleMatrix2D matrix, String[] rowNames, String[] columnNames, String rowAxisName, String columnAxisName, String title) {
-	if (matrix.size()==0) return "Empty matrix";
-	String[][] s = format(matrix);
-	//String oldAlignment = this.alignment;
-	//this.alignment = DECIMAL;
-	align(s);
-	//this.alignment = oldAlignment;
-	return new org.apache.mahout.matrix.matrix.objectalgo.Formatter().toTitleString(org.apache.mahout.matrix.matrix.ObjectFactory2D.dense.make(s), rowNames,columnNames,rowAxisName,columnAxisName,title);
+  if (matrix.size()==0) return "Empty matrix";
+  String[][] s = format(matrix);
+  //String oldAlignment = this.alignment;
+  //this.alignment = DECIMAL;
+  align(s);
+  //this.alignment = oldAlignment;
+  return new org.apache.mahout.matrix.matrix.objectalgo.Formatter().toTitleString(org.apache.mahout.matrix.matrix.ObjectFactory2D.dense.make(s), rowNames,columnNames,rowAxisName,columnAxisName,title);
 }
 /**
 Same as <tt>toTitleString</tt> except that additionally statistical aggregates (mean, median, sum, etc.) of rows and columns are printed.
@@ -698,65 +698,65 @@
 @see hep.aida.bin.BinFunctions1D
 
 public String toTitleString(DoubleMatrix2D matrix, String[] rowNames, String[] columnNames, String rowAxisName, String columnAxisName, String title, hep.aida.bin.BinFunction1D[] aggr) {
-	if (matrix.size()==0) return "Empty matrix";
-	if (aggr==null || aggr.length==0) return toTitleString(matrix,rowNames,columnNames,rowAxisName,columnAxisName,title);
-	
-	DoubleMatrix2D rowStats = matrix.like(matrix.rows(), aggr.length); // hold row aggregations
-	DoubleMatrix2D colStats = matrix.like(aggr.length, matrix.columns()); // hold column aggregations
+  if (matrix.size()==0) return "Empty matrix";
+  if (aggr==null || aggr.length==0) return toTitleString(matrix,rowNames,columnNames,rowAxisName,columnAxisName,title);
+  
+  DoubleMatrix2D rowStats = matrix.like(matrix.rows(), aggr.length); // hold row aggregations
+  DoubleMatrix2D colStats = matrix.like(aggr.length, matrix.columns()); // hold column aggregations
 
-	org.apache.mahout.matrix.matrix.doublealgo.Statistic.aggregate(matrix, aggr, colStats); // aggregate an entire column at a time
-	org.apache.mahout.matrix.matrix.doublealgo.Statistic.aggregate(matrix.viewDice(), aggr, rowStats.viewDice()); // aggregate an entire row at a time
+  org.apache.mahout.matrix.matrix.doublealgo.Statistic.aggregate(matrix, aggr, colStats); // aggregate an entire column at a time
+  org.apache.mahout.matrix.matrix.doublealgo.Statistic.aggregate(matrix.viewDice(), aggr, rowStats.viewDice()); // aggregate an entire row at a time
 
-	// turn into strings
-	// tmp holds "matrix" plus "colStats" below (needed so that numbers in a columns can be decimal point aligned)
-	DoubleMatrix2D tmp = matrix.like(matrix.rows()+aggr.length, matrix.columns());
-	tmp.viewPart(0,0,matrix.rows(),matrix.columns()).assign(matrix);
-	tmp.viewPart(matrix.rows(),0,aggr.length,matrix.columns()).assign(colStats);
-	colStats = null;
+  // turn into strings
+  // tmp holds "matrix" plus "colStats" below (needed so that numbers in a columns can be decimal point aligned)
+  DoubleMatrix2D tmp = matrix.like(matrix.rows()+aggr.length, matrix.columns());
+  tmp.viewPart(0,0,matrix.rows(),matrix.columns()).assign(matrix);
+  tmp.viewPart(matrix.rows(),0,aggr.length,matrix.columns()).assign(colStats);
+  colStats = null;
 
-	String[][] s1 = format(tmp); align(s1); tmp = null;
-	String[][] s2 = format(rowStats); align(s2); rowStats = null;
+  String[][] s1 = format(tmp); align(s1); tmp = null;
+  String[][] s2 = format(rowStats); align(s2); rowStats = null;
 
-	// copy strings into a large matrix holding the source matrix and all aggregations
-	org.apache.mahout.matrix.matrix.ObjectMatrix2D allStats = org.apache.mahout.matrix.matrix.ObjectFactory2D.dense.make(matrix.rows()+aggr.length, matrix.columns()+aggr.length+1);
-	allStats.viewPart(0,0,matrix.rows()+aggr.length,matrix.columns()).assign(s1);
-	allStats.viewColumn(matrix.columns()).assign("|");
-	allStats.viewPart(0,matrix.columns()+1,matrix.rows(),aggr.length).assign(s2);
-	s1 = null; s2 = null;
+  // copy strings into a large matrix holding the source matrix and all aggregations
+  org.apache.mahout.matrix.matrix.ObjectMatrix2D allStats = org.apache.mahout.matrix.matrix.ObjectFactory2D.dense.make(matrix.rows()+aggr.length, matrix.columns()+aggr.length+1);
+  allStats.viewPart(0,0,matrix.rows()+aggr.length,matrix.columns()).assign(s1);
+  allStats.viewColumn(matrix.columns()).assign("|");
+  allStats.viewPart(0,matrix.columns()+1,matrix.rows(),aggr.length).assign(s2);
+  s1 = null; s2 = null;
 
-	// append a vertical "|" separator plus names of aggregation functions to line holding columnNames
-	if (columnNames!=null) {
-		org.apache.mahout.matrix.list.ObjectArrayList list = new org.apache.mahout.matrix.list.ObjectArrayList(columnNames);
-		list.add("|");
-		for (int i=0; i<aggr.length; i++) list.add(aggr[i].name()); // add names of aggregation functions
-		columnNames = new String[list.size()];
-		list.toArray(columnNames);
-	}
+  // append a vertical "|" separator plus names of aggregation functions to line holding columnNames
+  if (columnNames!=null) {
+    org.apache.mahout.matrix.list.ObjectArrayList list = new org.apache.mahout.matrix.list.ObjectArrayList(columnNames);
+    list.add("|");
+    for (int i=0; i<aggr.length; i++) list.add(aggr[i].name()); // add names of aggregation functions
+    columnNames = new String[list.size()];
+    list.toArray(columnNames);
+  }
 
-	// append names of aggregation functions to line holding rowNames
-	if (rowNames!=null) {
-		org.apache.mahout.matrix.list.ObjectArrayList list = new org.apache.mahout.matrix.list.ObjectArrayList(rowNames);
-		for (int i=0; i<aggr.length; i++) list.add(aggr[i].name()); // add names of aggregation functions
-		rowNames = new String[list.size()];
-		list.toArray(rowNames);
-	}	
-	
-	// turn large matrix into string
-	String s = new org.apache.mahout.matrix.matrix.objectalgo.Formatter().toTitleString(allStats, rowNames,columnNames,rowAxisName,columnAxisName,title);
-	
-	// insert a horizontal "----------------------" separation line above the column stats
-	// determine insertion position and line width
-	int last = s.length()+1;
-	int secondLast = last;
-	int v = Math.max(0, rowAxisName==null ? 0 : rowAxisName.length()-matrix.rows()-aggr.length);
-	for (int k=0; k<aggr.length+1+v; k++) { // scan "aggr.length+1+v" lines backwards
-		secondLast = last;
-		last = s.lastIndexOf(rowSeparator, last-1);
-	}
-	StringBuffer buf = new StringBuffer(s);
-	buf.insert(secondLast,rowSeparator+repeat('-',secondLast-last-1));
-	
-	return buf.toString();
+  // append names of aggregation functions to line holding rowNames
+  if (rowNames!=null) {
+    org.apache.mahout.matrix.list.ObjectArrayList list = new org.apache.mahout.matrix.list.ObjectArrayList(rowNames);
+    for (int i=0; i<aggr.length; i++) list.add(aggr[i].name()); // add names of aggregation functions
+    rowNames = new String[list.size()];
+    list.toArray(rowNames);
+  }  
+  
+  // turn large matrix into string
+  String s = new org.apache.mahout.matrix.matrix.objectalgo.Formatter().toTitleString(allStats, rowNames,columnNames,rowAxisName,columnAxisName,title);
+  
+  // insert a horizontal "----------------------" separation line above the column stats
+  // determine insertion position and line width
+  int last = s.length()+1;
+  int secondLast = last;
+  int v = Math.max(0, rowAxisName==null ? 0 : rowAxisName.length()-matrix.rows()-aggr.length);
+  for (int k=0; k<aggr.length+1+v; k++) { // scan "aggr.length+1+v" lines backwards
+    secondLast = last;
+    last = s.lastIndexOf(rowSeparator, last-1);
+  }
+  StringBuffer buf = new StringBuffer(s);
+  buf.insert(secondLast,rowSeparator+repeat('-',secondLast-last-1));
+  
+  return buf.toString();
 }
 */
 /**
@@ -777,13 +777,13 @@
 @see hep.aida.bin.BinFunctions1D
 
 public String toTitleString(DoubleMatrix3D matrix, String[] sliceNames, String[] rowNames, String[] columnNames, String sliceAxisName, String rowAxisName, String columnAxisName, String title, hep.aida.bin.BinFunction1D[] aggr) {
-	if (matrix.size()==0) return "Empty matrix";
-	StringBuffer buf = new StringBuffer();
-	for (int i=0; i<matrix.slices(); i++) {
-		if (i!=0) buf.append(sliceSeparator);
-		buf.append(toTitleString(matrix.viewSlice(i),rowNames,columnNames,rowAxisName,columnAxisName,title+"\n"+sliceAxisName+"="+sliceNames[i],aggr));
-	}
-	return buf.toString();
+  if (matrix.size()==0) return "Empty matrix";
+  StringBuffer buf = new StringBuffer();
+  for (int i=0; i<matrix.slices(); i++) {
+    if (i!=0) buf.append(sliceSeparator);
+    buf.append(toTitleString(matrix.viewSlice(i),rowNames,columnNames,rowAxisName,columnAxisName,title+"\n"+sliceAxisName+"="+sliceNames[i],aggr));
+  }
+  return buf.toString();
 }
 */
 /**
@@ -801,12 +801,12 @@
 @return the matrix converted to a string.
 */
 private String xtoTitleString(DoubleMatrix3D matrix, String[] sliceNames, String[] rowNames, String[] columnNames, String sliceAxisName, String rowAxisName, String columnAxisName, String title) {
-	if (matrix.size()==0) return "Empty matrix";
-	StringBuffer buf = new StringBuffer();
-	for (int i=0; i<matrix.slices(); i++) {
-		if (i!=0) buf.append(sliceSeparator);
-		buf.append(toTitleString(matrix.viewSlice(i),rowNames,columnNames,rowAxisName,columnAxisName,title+"\n"+sliceAxisName+"="+sliceNames[i]));
-	}
-	return buf.toString();
+  if (matrix.size()==0) return "Empty matrix";
+  StringBuffer buf = new StringBuffer();
+  for (int i=0; i<matrix.slices(); i++) {
+    if (i!=0) buf.append(sliceSeparator);
+    buf.append(toTitleString(matrix.viewSlice(i),rowNames,columnNames,rowAxisName,columnAxisName,title+"\n"+sliceAxisName+"="+sliceNames[i]));
+  }
+  return buf.toString();
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/doublealgo/Sorting.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/doublealgo/Sorting.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/doublealgo/Sorting.java	(working copy)
@@ -44,22 +44,22 @@
  */
 @Deprecated
 public class Sorting extends org.apache.mahout.matrix.PersistentObject {
-	/**
-	 * A prefabricated quicksort.
-	 */
-	public static final Sorting quickSort = new Sorting(); // already has quicksort implemented
+  /**
+   * A prefabricated quicksort.
+   */
+  public static final Sorting quickSort = new Sorting(); // already has quicksort implemented
 
-	/**
-	 * A prefabricated mergesort.
-	 */
-	public static final Sorting mergeSort = new Sorting() { // override quicksort with mergesort
-		protected void runSort(int[] a, int fromIndex, int toIndex, IntComparator c) {
-			org.apache.mahout.matrix.Sorting.mergeSort(a,fromIndex,toIndex,c);
-		}
-		protected void runSort(int fromIndex, int toIndex, IntComparator c, org.apache.mahout.matrix.Swapper swapper) {
-			org.apache.mahout.matrix.GenericSorting.mergeSort(fromIndex, toIndex, c, swapper);
-		}
-	};
+  /**
+   * A prefabricated mergesort.
+   */
+  public static final Sorting mergeSort = new Sorting() { // override quicksort with mergesort
+    protected void runSort(int[] a, int fromIndex, int toIndex, IntComparator c) {
+      org.apache.mahout.matrix.Sorting.mergeSort(a,fromIndex,toIndex,c);
+    }
+    protected void runSort(int fromIndex, int toIndex, IntComparator c, org.apache.mahout.matrix.Swapper swapper) {
+      org.apache.mahout.matrix.GenericSorting.mergeSort(fromIndex, toIndex, c, swapper);
+    }
+  };
 /**
  * Makes this class non instantiable, but still let's others inherit from it.
  */
@@ -68,17 +68,17 @@
  * Compare two values, one of which is assumed to be Double.NaN
  */
 private static final int compareNaN(double a, double b) {
-	if (a!=a) {
-		if (b!=b) return 0; // NaN equals NaN
-		else return 1; // e.g. NaN > 5
-	}
-	return -1; // e.g. 5 < NaN
+  if (a!=a) {
+    if (b!=b) return 0; // NaN equals NaN
+    else return 1; // e.g. NaN > 5
+  }
+  return -1; // e.g. 5 < NaN
 }
 protected void runSort(int[] a, int fromIndex, int toIndex, IntComparator c) {
-	org.apache.mahout.matrix.Sorting.quickSort(a,fromIndex,toIndex,c);
+  org.apache.mahout.matrix.Sorting.quickSort(a,fromIndex,toIndex,c);
 }
 protected void runSort(int fromIndex, int toIndex, IntComparator c, org.apache.mahout.matrix.Swapper swapper) {
-	org.apache.mahout.matrix.GenericSorting.quickSort(fromIndex, toIndex, c, swapper);
+  org.apache.mahout.matrix.GenericSorting.quickSort(fromIndex, toIndex, c, swapper);
 }
 /**
 Sorts the vector into ascending order, according to the <i>natural ordering</i>.
@@ -88,36 +88,36 @@
 <b>Example:</b> 
 <table border="1" cellspacing="0">
   <tr nowrap> 
-	<td valign="top"><tt> 7, 1, 3, 1<br>
-	  </tt></td>
-	<td valign="top"> 
-	  <p><tt> ==&gt; 1, 1, 3, 7<br>
-		The vector IS NOT SORTED.<br>
-		The new VIEW IS SORTED.</tt></p>
-	</td>
+  <td valign="top"><tt> 7, 1, 3, 1<br>
+    </tt></td>
+  <td valign="top"> 
+    <p><tt> ==&gt; 1, 1, 3, 7<br>
+    The vector IS NOT SORTED.<br>
+    The new VIEW IS SORTED.</tt></p>
+  </td>
   </tr>
 </table>
 
 @param vector the vector to be sorted.
 @return a new sorted vector (matrix) view. 
-		<b>Note that the original matrix is left unaffected.</b>
+    <b>Note that the original matrix is left unaffected.</b>
 */
 public DoubleMatrix1D sort(final DoubleMatrix1D vector) {
-	int[] indexes = new int[vector.size()]; // row indexes to reorder instead of matrix itself
-	for (int i=indexes.length; --i >= 0; ) indexes[i] = i;
+  int[] indexes = new int[vector.size()]; // row indexes to reorder instead of matrix itself
+  for (int i=indexes.length; --i >= 0; ) indexes[i] = i;
 
-	IntComparator comp = new IntComparator() {  
-		public int compare(int a, int b) {
-			double av = vector.getQuick(a);
-			double bv = vector.getQuick(b);
-			if (av!=av || bv!=bv) return compareNaN(av,bv); // swap NaNs to the end
-			return av<bv ? -1 : (av==bv ? 0 : 1);
-		}
-	};
+  IntComparator comp = new IntComparator() {  
+    public int compare(int a, int b) {
+      double av = vector.getQuick(a);
+      double bv = vector.getQuick(b);
+      if (av!=av || bv!=bv) return compareNaN(av,bv); // swap NaNs to the end
+      return av<bv ? -1 : (av==bv ? 0 : 1);
+    }
+  };
 
-	runSort(indexes,0,indexes.length,comp);
+  runSort(indexes,0,indexes.length,comp);
 
-	return vector.viewSelection(indexes);
+  return vector.viewSelection(indexes);
 }
 /**
 Sorts the vector into ascending order, according to the order induced by the specified comparator.
@@ -140,21 +140,21 @@
 @param vector the vector to be sorted.
 @param c the comparator to determine the order.
 @return a new matrix view sorted as specified.
-		<b>Note that the original vector (matrix) is left unaffected.</b>
+    <b>Note that the original vector (matrix) is left unaffected.</b>
 */
 public DoubleMatrix1D sort(final DoubleMatrix1D vector, final org.apache.mahout.matrix.function.DoubleComparator c) {
-	int[] indexes = new int[vector.size()]; // row indexes to reorder instead of matrix itself
-	for (int i=indexes.length; --i >= 0; ) indexes[i] = i;
+  int[] indexes = new int[vector.size()]; // row indexes to reorder instead of matrix itself
+  for (int i=indexes.length; --i >= 0; ) indexes[i] = i;
 
-	IntComparator comp = new IntComparator() {  
-		public int compare(int a, int b) {
-			return c.compare(vector.getQuick(a), vector.getQuick(b));
-		}
-	};
+  IntComparator comp = new IntComparator() {  
+    public int compare(int a, int b) {
+      return c.compare(vector.getQuick(a), vector.getQuick(b));
+    }
+  };
 
-	runSort(indexes,0,indexes.length,comp);
+  runSort(indexes,0,indexes.length,comp);
 
-	return vector.viewSelection(indexes);
+  return vector.viewSelection(indexes);
 }
 /**
 Sorts the matrix rows into ascending order, according to the <i>natural ordering</i> of the matrix values in the virtual column <tt>aggregates</tt>;
@@ -171,28 +171,28 @@
 Each aggregate is the sum of a row
 <table border="1" cellspacing="0">
   <tr nowrap> 
-	<td valign="top"><tt>4 x 2 matrix: <br>
-	  1, 1<br>
-	  5, 4<br>
-	  3, 0<br>
-	  4, 4 <br>
-	  </tt></td>
-	<td align="left" valign="top"> 
-	  <tt>aggregates=<br>
-	  2<br>
-	  9<br>
-	  3<br>
-	  8<br>
-	  ==></tt></td>
-	<td valign="top"> 
-	  <p><tt>4 x 2 matrix:<br>
-		1, 1<br>
-		3, 0<br>
-		4, 4<br>
-		5, 4</tt><br>
-		The matrix IS NOT SORTED.<br>
-		The new VIEW IS SORTED.</p>
-	  </td>
+  <td valign="top"><tt>4 x 2 matrix: <br>
+    1, 1<br>
+    5, 4<br>
+    3, 0<br>
+    4, 4 <br>
+    </tt></td>
+  <td align="left" valign="top"> 
+    <tt>aggregates=<br>
+    2<br>
+    9<br>
+    3<br>
+    8<br>
+    ==></tt></td>
+  <td valign="top"> 
+    <p><tt>4 x 2 matrix:<br>
+    1, 1<br>
+    3, 0<br>
+    4, 4<br>
+    5, 4</tt><br>
+    The matrix IS NOT SORTED.<br>
+    The new VIEW IS SORTED.</p>
+    </td>
   </tr>
 </table>
 
@@ -226,41 +226,41 @@
 @param matrix the matrix to be sorted.
 @param aggregates the values to sort on. (As a side effect, this array will also get sorted).
 @return a new matrix view having rows sorted.
-		<b>Note that the original matrix is left unaffected.</b>
+    <b>Note that the original matrix is left unaffected.</b>
 @throws IndexOutOfBoundsException if <tt>aggregates.length != matrix.rows()</tt>.
 */
 public DoubleMatrix2D sort(DoubleMatrix2D matrix, final double[] aggregates) {
-	int rows = matrix.rows();
-	if (aggregates.length != rows) throw new IndexOutOfBoundsException("aggregates.length != matrix.rows()");
-	
-	// set up index reordering
-	final int[] indexes = new int[rows];
-	for (int i=rows; --i >= 0; ) indexes[i] = i;
+  int rows = matrix.rows();
+  if (aggregates.length != rows) throw new IndexOutOfBoundsException("aggregates.length != matrix.rows()");
+  
+  // set up index reordering
+  final int[] indexes = new int[rows];
+  for (int i=rows; --i >= 0; ) indexes[i] = i;
 
-	// compares two aggregates at a time
-	org.apache.mahout.matrix.function.IntComparator comp = new org.apache.mahout.matrix.function.IntComparator() {
-		public int compare(int x, int y) {
-			double a = aggregates[x];
-			double b = aggregates[y];
-			if (a!=a || b!=b) return compareNaN(a,b); // swap NaNs to the end
-			return a < b ? -1 : (a==b) ? 0 : 1;
-		}
-	};
-	// swaps aggregates and reorders indexes
-	org.apache.mahout.matrix.Swapper swapper = new org.apache.mahout.matrix.Swapper() {
-		public void swap(int x, int y) {
-			int t1;	double t2;
-			t1 = indexes[x]; indexes[x] = indexes[y]; indexes[y] = t1;		
-			t2 = aggregates[x]; aggregates[x] = aggregates[y]; aggregates[y] = t2;
-		}
-	};
+  // compares two aggregates at a time
+  org.apache.mahout.matrix.function.IntComparator comp = new org.apache.mahout.matrix.function.IntComparator() {
+    public int compare(int x, int y) {
+      double a = aggregates[x];
+      double b = aggregates[y];
+      if (a!=a || b!=b) return compareNaN(a,b); // swap NaNs to the end
+      return a < b ? -1 : (a==b) ? 0 : 1;
+    }
+  };
+  // swaps aggregates and reorders indexes
+  org.apache.mahout.matrix.Swapper swapper = new org.apache.mahout.matrix.Swapper() {
+    public void swap(int x, int y) {
+      int t1;  double t2;
+      t1 = indexes[x]; indexes[x] = indexes[y]; indexes[y] = t1;    
+      t2 = aggregates[x]; aggregates[x] = aggregates[y]; aggregates[y] = t2;
+    }
+  };
 
-	// sort indexes and aggregates
-	runSort(0,rows,comp,swapper);
+  // sort indexes and aggregates
+  runSort(0,rows,comp,swapper);
 
-	// view the matrix according to the reordered row indexes
-	// take all columns in the original order
-	return matrix.viewSelection(indexes,null);
+  // view the matrix according to the reordered row indexes
+  // take all columns in the original order
+  return matrix.viewSelection(indexes,null);
 }
 /**
 Sorts the matrix rows into ascending order, according to the <i>natural ordering</i> of the matrix values in the given column.
@@ -270,57 +270,57 @@
 <b>Example:</b> 
 <table border="1" cellspacing="0">
   <tr nowrap> 
-	<td valign="top"><tt>4 x 2 matrix: <br>
-	  7, 6<br>
-	  5, 4<br>
-	  3, 2<br>
-	  1, 0 <br>
-	  </tt></td>
-	<td align="left" valign="top"> 
-	  <p><tt>column = 0;<br>
-		view = quickSort(matrix,column);<br>
-		System.out.println(view); </tt><tt><br>
-		==> </tt></p>
-	  </td>
-	<td valign="top"> 
-	  <p><tt>4 x 2 matrix:<br>
-		1, 0<br>
-		3, 2<br>
-		5, 4<br>
-		7, 6</tt><br>
-		The matrix IS NOT SORTED.<br>
-		The new VIEW IS SORTED.</p>
-	  </td>
+  <td valign="top"><tt>4 x 2 matrix: <br>
+    7, 6<br>
+    5, 4<br>
+    3, 2<br>
+    1, 0 <br>
+    </tt></td>
+  <td align="left" valign="top"> 
+    <p><tt>column = 0;<br>
+    view = quickSort(matrix,column);<br>
+    System.out.println(view); </tt><tt><br>
+    ==> </tt></p>
+    </td>
+  <td valign="top"> 
+    <p><tt>4 x 2 matrix:<br>
+    1, 0<br>
+    3, 2<br>
+    5, 4<br>
+    7, 6</tt><br>
+    The matrix IS NOT SORTED.<br>
+    The new VIEW IS SORTED.</p>
+    </td>
   </tr>
 </table>
 
 @param matrix the matrix to be sorted.
 @param column the index of the column inducing the order.
 @return a new matrix view having rows sorted by the given column.
-		<b>Note that the original matrix is left unaffected.</b>
+    <b>Note that the original matrix is left unaffected.</b>
 @throws IndexOutOfBoundsException if <tt>column < 0 || column >= matrix.columns()</tt>.
 */
 public DoubleMatrix2D sort(DoubleMatrix2D matrix, int column) {
-	if (column < 0 || column >= matrix.columns()) throw new IndexOutOfBoundsException("column="+column+", matrix="+Formatter.shape(matrix));
+  if (column < 0 || column >= matrix.columns()) throw new IndexOutOfBoundsException("column="+column+", matrix="+Formatter.shape(matrix));
 
-	int[] rowIndexes = new int[matrix.rows()]; // row indexes to reorder instead of matrix itself
-	for (int i=rowIndexes.length; --i >= 0; ) rowIndexes[i] = i;
+  int[] rowIndexes = new int[matrix.rows()]; // row indexes to reorder instead of matrix itself
+  for (int i=rowIndexes.length; --i >= 0; ) rowIndexes[i] = i;
 
-	final DoubleMatrix1D col = matrix.viewColumn(column);
-	IntComparator comp = new IntComparator() {  
-		public int compare(int a, int b) {
-			double av = col.getQuick(a);
-			double bv = col.getQuick(b);
-			if (av!=av || bv!=bv) return compareNaN(av,bv); // swap NaNs to the end
-			return av<bv ? -1 : (av==bv ? 0 : 1);
-		}
-	};
+  final DoubleMatrix1D col = matrix.viewColumn(column);
+  IntComparator comp = new IntComparator() {  
+    public int compare(int a, int b) {
+      double av = col.getQuick(a);
+      double bv = col.getQuick(b);
+      if (av!=av || bv!=bv) return compareNaN(av,bv); // swap NaNs to the end
+      return av<bv ? -1 : (av==bv ? 0 : 1);
+    }
+  };
 
-	runSort(rowIndexes,0,rowIndexes.length,comp);
+  runSort(rowIndexes,0,rowIndexes.length,comp);
 
-	// view the matrix according to the reordered row indexes
-	// take all columns in the original order
-	return matrix.viewSelection(rowIndexes,null);
+  // view the matrix according to the reordered row indexes
+  // take all columns in the original order
+  return matrix.viewSelection(rowIndexes,null);
 }
 /**
 Sorts the matrix rows according to the order induced by the specified comparator.
@@ -343,27 +343,27 @@
 @param matrix the matrix to be sorted.
 @param c the comparator to determine the order.
 @return a new matrix view having rows sorted as specified.
-		<b>Note that the original matrix is left unaffected.</b>
+    <b>Note that the original matrix is left unaffected.</b>
 */
 public DoubleMatrix2D sort(final DoubleMatrix2D matrix, final DoubleMatrix1DComparator c) {
-	int[] rowIndexes = new int[matrix.rows()]; // row indexes to reorder instead of matrix itself
-	for (int i=rowIndexes.length; --i >= 0; ) rowIndexes[i] = i;
+  int[] rowIndexes = new int[matrix.rows()]; // row indexes to reorder instead of matrix itself
+  for (int i=rowIndexes.length; --i >= 0; ) rowIndexes[i] = i;
 
-	final DoubleMatrix1D[] views = new DoubleMatrix1D[matrix.rows()]; // precompute views for speed
-	for (int i=views.length; --i >= 0; ) views[i] = matrix.viewRow(i);
+  final DoubleMatrix1D[] views = new DoubleMatrix1D[matrix.rows()]; // precompute views for speed
+  for (int i=views.length; --i >= 0; ) views[i] = matrix.viewRow(i);
 
-	IntComparator comp = new IntComparator() {  
-		public int compare(int a, int b) {
-			//return c.compare(matrix.viewRow(a), matrix.viewRow(b));
-			return c.compare(views[a], views[b]);
-		}
-	};
+  IntComparator comp = new IntComparator() {  
+    public int compare(int a, int b) {
+      //return c.compare(matrix.viewRow(a), matrix.viewRow(b));
+      return c.compare(views[a], views[b]);
+    }
+  };
 
-	runSort(rowIndexes,0,rowIndexes.length,comp);
+  runSort(rowIndexes,0,rowIndexes.length,comp);
 
-	// view the matrix according to the reordered row indexes
-	// take all columns in the original order
-	return matrix.viewSelection(rowIndexes,null);
+  // view the matrix according to the reordered row indexes
+  // take all columns in the original order
+  return matrix.viewSelection(rowIndexes,null);
 }
 /**
 Sorts the matrix rows into ascending order, according to the <i>natural ordering</i> of the values computed by applying the given aggregation function to each row;
@@ -379,25 +379,25 @@
 Each aggregate is the sum of a row
 <table border="1" cellspacing="0">
   <tr nowrap> 
-	<td valign="top"><tt>4 x 2 matrix: <br>
-	  1, 1<br>
-	  5, 4<br>
-	  3, 0<br>
-	  4, 4 <br>
-	  </tt></td>
-	<td align="left" valign="top"> 
-	  <tt>aggregates=<br>
-	  hep.aida.bin.BinFunctions1D.sum<br>
-	  ==></tt></td>
-	<td valign="top"> 
-	  <p><tt>4 x 2 matrix:<br>
-		1, 1<br>
-		3, 0<br>
-		4, 4<br>
-		5, 4</tt><br>
-		The matrix IS NOT SORTED.<br>
-		The new VIEW IS SORTED.</p>
-	  </td>
+  <td valign="top"><tt>4 x 2 matrix: <br>
+    1, 1<br>
+    5, 4<br>
+    3, 0<br>
+    4, 4 <br>
+    </tt></td>
+  <td align="left" valign="top"> 
+    <tt>aggregates=<br>
+    hep.aida.bin.BinFunctions1D.sum<br>
+    ==></tt></td>
+  <td valign="top"> 
+    <p><tt>4 x 2 matrix:<br>
+    1, 1<br>
+    3, 0<br>
+    4, 4<br>
+    5, 4</tt><br>
+    The matrix IS NOT SORTED.<br>
+    The new VIEW IS SORTED.</p>
+    </td>
   </tr>
 </table>
 
@@ -431,17 +431,17 @@
 @param matrix the matrix to be sorted.
 @param aggregate the function to sort on; aggregates values in a row.
 @return a new matrix view having rows sorted.
-		<b>Note that the original matrix is left unaffected.</b>
+    <b>Note that the original matrix is left unaffected.</b>
 
 public DoubleMatrix2D sort(DoubleMatrix2D matrix, hep.aida.bin.BinFunction1D aggregate) {
-	// precompute aggregates over rows, as defined by "aggregate"
+  // precompute aggregates over rows, as defined by "aggregate"
 
-	// a bit clumsy, because Statistic.aggregate(...) is defined on columns, so we need to transpose views
-	DoubleMatrix2D tmp = matrix.like(1,matrix.rows());
-	hep.aida.bin.BinFunction1D[] func = {aggregate};
-	Statistic.aggregate(matrix.viewDice(), func, tmp);
-	double[] aggr = tmp.viewRow(0).toArray();
-	return sort(matrix,aggr);
+  // a bit clumsy, because Statistic.aggregate(...) is defined on columns, so we need to transpose views
+  DoubleMatrix2D tmp = matrix.like(1,matrix.rows());
+  hep.aida.bin.BinFunction1D[] func = {aggregate};
+  Statistic.aggregate(matrix.viewDice(), func, tmp);
+  double[] aggr = tmp.viewRow(0).toArray();
+  return sort(matrix,aggr);
 }
 */
 /**
@@ -462,31 +462,31 @@
 @param row the index of the row inducing the order.
 @param column the index of the column inducing the order.
 @return a new matrix view having slices sorted by the values of the slice view <tt>matrix.viewRow(row).viewColumn(column)</tt>.
-		<b>Note that the original matrix is left unaffected.</b>
+    <b>Note that the original matrix is left unaffected.</b>
 @throws IndexOutOfBoundsException if <tt>row < 0 || row >= matrix.rows() || column < 0 || column >= matrix.columns()</tt>.
 */
 public DoubleMatrix3D sort(DoubleMatrix3D matrix, int row, int column) {
-	if (row < 0 || row >= matrix.rows()) throw new IndexOutOfBoundsException("row="+row+", matrix="+Formatter.shape(matrix));
-	if (column < 0 || column >= matrix.columns()) throw new IndexOutOfBoundsException("column="+column+", matrix="+Formatter.shape(matrix));
+  if (row < 0 || row >= matrix.rows()) throw new IndexOutOfBoundsException("row="+row+", matrix="+Formatter.shape(matrix));
+  if (column < 0 || column >= matrix.columns()) throw new IndexOutOfBoundsException("column="+column+", matrix="+Formatter.shape(matrix));
 
-	int[] sliceIndexes = new int[matrix.slices()]; // indexes to reorder instead of matrix itself
-	for (int i=sliceIndexes.length; --i >= 0; ) sliceIndexes[i] = i;
+  int[] sliceIndexes = new int[matrix.slices()]; // indexes to reorder instead of matrix itself
+  for (int i=sliceIndexes.length; --i >= 0; ) sliceIndexes[i] = i;
 
-	final DoubleMatrix1D sliceView = matrix.viewRow(row).viewColumn(column);
-	IntComparator comp = new IntComparator() {  
-		public int compare(int a, int b) {
-			double av = sliceView.getQuick(a);
-			double bv = sliceView.getQuick(b);
-			if (av!=av || bv!=bv) return compareNaN(av,bv); // swap NaNs to the end
-			return av<bv ? -1 : (av==bv ? 0 : 1);
-		}
-	};
+  final DoubleMatrix1D sliceView = matrix.viewRow(row).viewColumn(column);
+  IntComparator comp = new IntComparator() {  
+    public int compare(int a, int b) {
+      double av = sliceView.getQuick(a);
+      double bv = sliceView.getQuick(b);
+      if (av!=av || bv!=bv) return compareNaN(av,bv); // swap NaNs to the end
+      return av<bv ? -1 : (av==bv ? 0 : 1);
+    }
+  };
 
-	runSort(sliceIndexes,0,sliceIndexes.length,comp);
+  runSort(sliceIndexes,0,sliceIndexes.length,comp);
 
-	// view the matrix according to the reordered slice indexes
-	// take all rows and columns in the original order
-	return matrix.viewSelection(sliceIndexes,null,null);
+  // view the matrix according to the reordered slice indexes
+  // take all rows and columns in the original order
+  return matrix.viewSelection(sliceIndexes,null,null);
 }
 /**
 Sorts the matrix slices according to the order induced by the specified comparator.
@@ -509,185 +509,185 @@
 @param matrix the matrix to be sorted.
 @param c the comparator to determine the order.
 @return a new matrix view having slices sorted as specified.
-		<b>Note that the original matrix is left unaffected.</b>
+    <b>Note that the original matrix is left unaffected.</b>
 */
 public DoubleMatrix3D sort(final DoubleMatrix3D matrix, final DoubleMatrix2DComparator c) {
-	int[] sliceIndexes = new int[matrix.slices()]; // indexes to reorder instead of matrix itself
-	for (int i=sliceIndexes.length; --i >= 0; ) sliceIndexes[i] = i;
+  int[] sliceIndexes = new int[matrix.slices()]; // indexes to reorder instead of matrix itself
+  for (int i=sliceIndexes.length; --i >= 0; ) sliceIndexes[i] = i;
 
-	final DoubleMatrix2D[] views = new DoubleMatrix2D[matrix.slices()]; // precompute views for speed
-	for (int i=views.length; --i >= 0; ) views[i] = matrix.viewSlice(i);
+  final DoubleMatrix2D[] views = new DoubleMatrix2D[matrix.slices()]; // precompute views for speed
+  for (int i=views.length; --i >= 0; ) views[i] = matrix.viewSlice(i);
 
-	IntComparator comp = new IntComparator() {  
-		public int compare(int a, int b) {
-			//return c.compare(matrix.viewSlice(a), matrix.viewSlice(b));
-			return c.compare(views[a], views[b]);
-		}
-	};
+  IntComparator comp = new IntComparator() {  
+    public int compare(int a, int b) {
+      //return c.compare(matrix.viewSlice(a), matrix.viewSlice(b));
+      return c.compare(views[a], views[b]);
+    }
+  };
 
-	runSort(sliceIndexes,0,sliceIndexes.length,comp);
+  runSort(sliceIndexes,0,sliceIndexes.length,comp);
 
-	// view the matrix according to the reordered slice indexes
-	// take all rows and columns in the original order
-	return matrix.viewSelection(sliceIndexes,null,null);
+  // view the matrix according to the reordered slice indexes
+  // take all rows and columns in the original order
+  return matrix.viewSelection(sliceIndexes,null,null);
 }
 /**
  * Demonstrates advanced sorting.
  * Sorts by sum of row.
  */
 public static void zdemo1() {
-	Sorting sort = quickSort;
-	DoubleMatrix2D matrix = DoubleFactory2D.dense.descending(4,3);
-	DoubleMatrix1DComparator comp = new DoubleMatrix1DComparator() {
-		public int compare(DoubleMatrix1D a, DoubleMatrix1D b) {
-			double as = a.zSum(); double bs = b.zSum();
-			return as < bs ? -1 : as == bs ? 0 : 1;
-		}
-	};
-	System.out.println("unsorted:"+matrix);
-	System.out.println("sorted  :"+sort.sort(matrix,comp));
+  Sorting sort = quickSort;
+  DoubleMatrix2D matrix = DoubleFactory2D.dense.descending(4,3);
+  DoubleMatrix1DComparator comp = new DoubleMatrix1DComparator() {
+    public int compare(DoubleMatrix1D a, DoubleMatrix1D b) {
+      double as = a.zSum(); double bs = b.zSum();
+      return as < bs ? -1 : as == bs ? 0 : 1;
+    }
+  };
+  System.out.println("unsorted:"+matrix);
+  System.out.println("sorted  :"+sort.sort(matrix,comp));
 }
 /**
  * Demonstrates advanced sorting.
  * Sorts by sum of slice.
  */
 public static void zdemo2() {
-	Sorting sort = quickSort;
-	DoubleMatrix3D matrix = DoubleFactory3D.dense.descending(4,3,2);
-	DoubleMatrix2DComparator comp = new DoubleMatrix2DComparator() {
-		public int compare(DoubleMatrix2D a, DoubleMatrix2D b) {
-			double as = a.zSum();
-			double bs = b.zSum();
-			return as < bs ? -1 : as == bs ? 0 : 1;
-		}
-	};
-	System.out.println("unsorted:"+matrix);
-	System.out.println("sorted  :"+sort.sort(matrix,comp));
+  Sorting sort = quickSort;
+  DoubleMatrix3D matrix = DoubleFactory3D.dense.descending(4,3,2);
+  DoubleMatrix2DComparator comp = new DoubleMatrix2DComparator() {
+    public int compare(DoubleMatrix2D a, DoubleMatrix2D b) {
+      double as = a.zSum();
+      double bs = b.zSum();
+      return as < bs ? -1 : as == bs ? 0 : 1;
+    }
+  };
+  System.out.println("unsorted:"+matrix);
+  System.out.println("sorted  :"+sort.sort(matrix,comp));
 }
 /**
  * Demonstrates advanced sorting.
  * Sorts by sinus of cell values.
  */
 public static void zdemo3() {
-	Sorting sort = quickSort;
-	double[] values = {0.5, 1.5, 2.5, 3.5};
-	DoubleMatrix1D matrix = new DenseDoubleMatrix1D(values);
-	org.apache.mahout.matrix.function.DoubleComparator comp = new org.apache.mahout.matrix.function.DoubleComparator() {
-		public int compare(double a, double b) {
-			double as = Math.sin(a); double bs = Math.sin(b);
-			return as < bs ? -1 : as == bs ? 0 : 1;
-		}
-	};
-	System.out.println("unsorted:"+matrix);
-	
-	DoubleMatrix1D sorted = sort.sort(matrix,comp);
-	System.out.println("sorted  :"+sorted);
+  Sorting sort = quickSort;
+  double[] values = {0.5, 1.5, 2.5, 3.5};
+  DoubleMatrix1D matrix = new DenseDoubleMatrix1D(values);
+  org.apache.mahout.matrix.function.DoubleComparator comp = new org.apache.mahout.matrix.function.DoubleComparator() {
+    public int compare(double a, double b) {
+      double as = Math.sin(a); double bs = Math.sin(b);
+      return as < bs ? -1 : as == bs ? 0 : 1;
+    }
+  };
+  System.out.println("unsorted:"+matrix);
+  
+  DoubleMatrix1D sorted = sort.sort(matrix,comp);
+  System.out.println("sorted  :"+sorted);
 
-	// check whether it is really sorted
-	sorted.assign(org.apache.mahout.jet.math.Functions.sin);
-	/*
-	sorted.assign(
-		new org.apache.mahout.matrix.function.DoubleFunction() {
-			public double apply(double arg) { return Math.sin(arg); }
-		}
-	);
-	*/
-	System.out.println("sined  :"+sorted);
+  // check whether it is really sorted
+  sorted.assign(org.apache.mahout.jet.math.Functions.sin);
+  /*
+  sorted.assign(
+    new org.apache.mahout.matrix.function.DoubleFunction() {
+      public double apply(double arg) { return Math.sin(arg); }
+    }
+  );
+  */
+  System.out.println("sined  :"+sorted);
 }
 /**
  * Demonstrates applying functions.
  */
 protected static void zdemo4() {
-	double[] values1 = {0, 1, 2, 3};
-	double[] values2 = {0, 2, 4, 6};
-	DoubleMatrix1D matrix1 = new DenseDoubleMatrix1D(values1);
-	DoubleMatrix1D matrix2 = new DenseDoubleMatrix1D(values2);
-	System.out.println("m1:"+matrix1);
-	System.out.println("m2:"+matrix2);
-	
-	matrix1.assign(matrix2, org.apache.mahout.jet.math.Functions.pow);
-	
-	/*
-	matrix1.assign(matrix2,
-		new org.apache.mahout.matrix.function.DoubleDoubleFunction() {
-			public double apply(double x, double y) { return Math.pow(x,y); }
-		}
-	);
-	*/
-	
-	System.out.println("applied:"+matrix1);
+  double[] values1 = {0, 1, 2, 3};
+  double[] values2 = {0, 2, 4, 6};
+  DoubleMatrix1D matrix1 = new DenseDoubleMatrix1D(values1);
+  DoubleMatrix1D matrix2 = new DenseDoubleMatrix1D(values2);
+  System.out.println("m1:"+matrix1);
+  System.out.println("m2:"+matrix2);
+  
+  matrix1.assign(matrix2, org.apache.mahout.jet.math.Functions.pow);
+  
+  /*
+  matrix1.assign(matrix2,
+    new org.apache.mahout.matrix.function.DoubleDoubleFunction() {
+      public double apply(double x, double y) { return Math.pow(x,y); }
+    }
+  );
+  */
+  
+  System.out.println("applied:"+matrix1);
 }
 /**
  * Demonstrates sorting with precomputation of aggregates (median and sum of logarithms).
  *
 public static void zdemo5(int rows, int columns, boolean print) {
-	Sorting sort = quickSort;
-	// for reliable benchmarks, call this method twice: once with small dummy parameters to "warm up" the jitter, then with your real work-load
-		
-	System.out.println("\n\n");
-	System.out.print("now initializing... ");
-	org.apache.mahout.matrix.Timer timer = new org.apache.mahout.matrix.Timer().start();
-		
-	final org.apache.mahout.jet.math.Functions F = org.apache.mahout.jet.math.Functions.functions;
-	DoubleMatrix2D A = org.apache.mahout.matrix.matrix.DoubleFactory2D.dense.make(rows,columns);
-	A.assign(new org.apache.mahout.jet.random.engine.DRand()); // initialize randomly
-	timer.stop().display();
+  Sorting sort = quickSort;
+  // for reliable benchmarks, call this method twice: once with small dummy parameters to "warm up" the jitter, then with your real work-load
+    
+  System.out.println("\n\n");
+  System.out.print("now initializing... ");
+  org.apache.mahout.matrix.Timer timer = new org.apache.mahout.matrix.Timer().start();
+    
+  final org.apache.mahout.jet.math.Functions F = org.apache.mahout.jet.math.Functions.functions;
+  DoubleMatrix2D A = org.apache.mahout.matrix.matrix.DoubleFactory2D.dense.make(rows,columns);
+  A.assign(new org.apache.mahout.jet.random.engine.DRand()); // initialize randomly
+  timer.stop().display();
 
-	// also benchmark copying in its several implementation flavours
-	DoubleMatrix2D B = A.like();
-	timer.reset().start();
-	System.out.print("now copying... ");
-	B.assign(A);
-	timer.stop().display();
+  // also benchmark copying in its several implementation flavours
+  DoubleMatrix2D B = A.like();
+  timer.reset().start();
+  System.out.print("now copying... ");
+  B.assign(A);
+  timer.stop().display();
 
-	timer.reset().start();
-	System.out.print("now copying subrange... ");
-	B.viewPart(0,0,rows,columns).assign(A.viewPart(0,0,rows,columns));
-	timer.stop().display();
-	//System.out.println(A);
+  timer.reset().start();
+  System.out.print("now copying subrange... ");
+  B.viewPart(0,0,rows,columns).assign(A.viewPart(0,0,rows,columns));
+  timer.stop().display();
+  //System.out.println(A);
 
-	timer.reset().start();
-	System.out.print("now copying selected... ");
-	B.viewSelection(null,null).assign(A.viewSelection(null,null));
-	timer.stop().display();
+  timer.reset().start();
+  System.out.print("now copying selected... ");
+  B.viewSelection(null,null).assign(A.viewSelection(null,null));
+  timer.stop().display();
 
-	System.out.print("now sorting - quick version with precomputation... ");
-	timer.reset().start();
-	// THE QUICK VERSION (takes some 10 secs)
-	A = sort.sort(A,hep.aida.bin.BinFunctions1D.median);
-	//A = sort.sort(A,hep.aida.bin.BinFunctions1D.sumLog);
-	timer.stop().display();
+  System.out.print("now sorting - quick version with precomputation... ");
+  timer.reset().start();
+  // THE QUICK VERSION (takes some 10 secs)
+  A = sort.sort(A,hep.aida.bin.BinFunctions1D.median);
+  //A = sort.sort(A,hep.aida.bin.BinFunctions1D.sumLog);
+  timer.stop().display();
 
-	// check results for correctness
-	// WARNING: be sure NOT TO PRINT huge matrices unless you have tons of main memory and time!!
-	// so we just show the first 5 rows
-	if (print) {
-		int r = Math.min(rows,5);
-		hep.aida.bin.BinFunction1D[] funs = {hep.aida.bin.BinFunctions1D.median, hep.aida.bin.BinFunctions1D.sumLog, hep.aida.bin.BinFunctions1D.geometricMean};
-		String[] rowNames = new String[r];
-		String[] columnNames = new String[columns];
-		for (int i=columns; --i >= 0; ) columnNames[i] = Integer.toString(i);
-		for (int i=r; --i >= 0; ) rowNames[i] = Integer.toString(i);
-		System.out.println("first part of sorted result = \n"+new org.apache.mahout.matrix.matrix.doublealgo.Formatter("%G").toTitleString(
-			A.viewPart(0,0,r,columns), rowNames, columnNames, null, null, null, funs
-		));
-	}
+  // check results for correctness
+  // WARNING: be sure NOT TO PRINT huge matrices unless you have tons of main memory and time!!
+  // so we just show the first 5 rows
+  if (print) {
+    int r = Math.min(rows,5);
+    hep.aida.bin.BinFunction1D[] funs = {hep.aida.bin.BinFunctions1D.median, hep.aida.bin.BinFunctions1D.sumLog, hep.aida.bin.BinFunctions1D.geometricMean};
+    String[] rowNames = new String[r];
+    String[] columnNames = new String[columns];
+    for (int i=columns; --i >= 0; ) columnNames[i] = Integer.toString(i);
+    for (int i=r; --i >= 0; ) rowNames[i] = Integer.toString(i);
+    System.out.println("first part of sorted result = \n"+new org.apache.mahout.matrix.matrix.doublealgo.Formatter("%G").toTitleString(
+      A.viewPart(0,0,r,columns), rowNames, columnNames, null, null, null, funs
+    ));
+  }
 
 
-	System.out.print("now sorting - slow version... ");
-	A = B;	
-	org.apache.mahout.matrix.matrix.doublealgo.DoubleMatrix1DComparator fun = new org.apache.mahout.matrix.matrix.doublealgo.DoubleMatrix1DComparator() {
-		public int compare(DoubleMatrix1D x, DoubleMatrix1D y) {
-			double a = org.apache.mahout.matrix.matrix.doublealgo.Statistic.bin(x).median();
-			double b = org.apache.mahout.matrix.matrix.doublealgo.Statistic.bin(y).median();
-			//double a = x.aggregate(F.plus,F.log);
-			//double b = y.aggregate(F.plus,F.log);
-			return a < b ? -1 : (a==b) ? 0 : 1;
-		}
-	};
-	timer.reset().start();
-	A = sort.sort(A,fun);
-	timer.stop().display();
+  System.out.print("now sorting - slow version... ");
+  A = B;  
+  org.apache.mahout.matrix.matrix.doublealgo.DoubleMatrix1DComparator fun = new org.apache.mahout.matrix.matrix.doublealgo.DoubleMatrix1DComparator() {
+    public int compare(DoubleMatrix1D x, DoubleMatrix1D y) {
+      double a = org.apache.mahout.matrix.matrix.doublealgo.Statistic.bin(x).median();
+      double b = org.apache.mahout.matrix.matrix.doublealgo.Statistic.bin(y).median();
+      //double a = x.aggregate(F.plus,F.log);
+      //double b = y.aggregate(F.plus,F.log);
+      return a < b ? -1 : (a==b) ? 0 : 1;
+    }
+  };
+  timer.reset().start();
+  A = sort.sort(A,fun);
+  timer.stop().display();
 }
 */
 /**
@@ -695,73 +695,73 @@
  * Sorts by sum of row.
  */
 public static void zdemo6() {
-	Sorting sort = quickSort;
-	double[][] values = {
-		{ 3,7,0 },
-		{ 2,1,0 },
-		{ 2,2,0 },
-		{ 1,8,0 },
-		{ 2,5,0 },
-		{ 7,0,0 },
-		{ 2,3,0 },
-		{ 1,0,0 },
-		{ 4,0,0 },
-		{ 2,0,0 }
-	};
-	DoubleMatrix2D A = DoubleFactory2D.dense.make(values);
-	DoubleMatrix2D B,C;
-	/*
-	DoubleMatrix1DComparator comp = new DoubleMatrix1DComparator() {
-		public int compare(DoubleMatrix1D a, DoubleMatrix1D b) {
-			double as = a.zSum(); double bs = b.zSum();
-			return as < bs ? -1 : as == bs ? 0 : 1;
-		}
-	};
-	*/
-	System.out.println("\n\nunsorted:"+A);
-	B = quickSort.sort(A,1);
-	C = quickSort.sort(B,0);	
-	System.out.println("quick sorted  :"+C);
-	
-	B = mergeSort.sort(A,1);
-	C = mergeSort.sort(B,0);	
-	System.out.println("merge sorted  :"+C);
-	
+  Sorting sort = quickSort;
+  double[][] values = {
+    { 3,7,0 },
+    { 2,1,0 },
+    { 2,2,0 },
+    { 1,8,0 },
+    { 2,5,0 },
+    { 7,0,0 },
+    { 2,3,0 },
+    { 1,0,0 },
+    { 4,0,0 },
+    { 2,0,0 }
+  };
+  DoubleMatrix2D A = DoubleFactory2D.dense.make(values);
+  DoubleMatrix2D B,C;
+  /*
+  DoubleMatrix1DComparator comp = new DoubleMatrix1DComparator() {
+    public int compare(DoubleMatrix1D a, DoubleMatrix1D b) {
+      double as = a.zSum(); double bs = b.zSum();
+      return as < bs ? -1 : as == bs ? 0 : 1;
+    }
+  };
+  */
+  System.out.println("\n\nunsorted:"+A);
+  B = quickSort.sort(A,1);
+  C = quickSort.sort(B,0);  
+  System.out.println("quick sorted  :"+C);
+  
+  B = mergeSort.sort(A,1);
+  C = mergeSort.sort(B,0);  
+  System.out.println("merge sorted  :"+C);
+  
 }
 /**
  * Demonstrates sorting with precomputation of aggregates, comparing mergesort with quicksort.
  */
 public static void zdemo7(int rows, int columns, boolean print) {
-	// for reliable benchmarks, call this method twice: once with small dummy parameters to "warm up" the jitter, then with your real work-load
-		
-	System.out.println("\n\n");
-	System.out.println("now initializing... ");
-		
-	final org.apache.mahout.jet.math.Functions F = org.apache.mahout.jet.math.Functions.functions;
-	DoubleMatrix2D A = org.apache.mahout.matrix.matrix.DoubleFactory2D.dense.make(rows,columns);
-	A.assign(new org.apache.mahout.jet.random.engine.DRand()); // initialize randomly
-	DoubleMatrix2D B = A.copy();
+  // for reliable benchmarks, call this method twice: once with small dummy parameters to "warm up" the jitter, then with your real work-load
+    
+  System.out.println("\n\n");
+  System.out.println("now initializing... ");
+    
+  final org.apache.mahout.jet.math.Functions F = org.apache.mahout.jet.math.Functions.functions;
+  DoubleMatrix2D A = org.apache.mahout.matrix.matrix.DoubleFactory2D.dense.make(rows,columns);
+  A.assign(new org.apache.mahout.jet.random.engine.DRand()); // initialize randomly
+  DoubleMatrix2D B = A.copy();
 
-	double[] v1 = A.viewColumn(0).toArray();
-	double[] v2 = A.viewColumn(0).toArray();
-	System.out.print("now quick sorting... ");
-	org.apache.mahout.matrix.Timer timer = new org.apache.mahout.matrix.Timer().start();
-	quickSort.sort(A,0);
-	timer.stop().display();
+  double[] v1 = A.viewColumn(0).toArray();
+  double[] v2 = A.viewColumn(0).toArray();
+  System.out.print("now quick sorting... ");
+  org.apache.mahout.matrix.Timer timer = new org.apache.mahout.matrix.Timer().start();
+  quickSort.sort(A,0);
+  timer.stop().display();
 
-	System.out.print("now merge sorting... ");
-	timer.reset().start();
-	mergeSort.sort(A,0);
-	timer.stop().display();
+  System.out.print("now merge sorting... ");
+  timer.reset().start();
+  mergeSort.sort(A,0);
+  timer.stop().display();
 
-	System.out.print("now quick sorting with simple aggregation... ");
-	timer.reset().start();
-	quickSort.sort(A,v1);
-	timer.stop().display();
+  System.out.print("now quick sorting with simple aggregation... ");
+  timer.reset().start();
+  quickSort.sort(A,v1);
+  timer.stop().display();
 
-	System.out.print("now merge sorting with simple aggregation... ");
-	timer.reset().start();
-	mergeSort.sort(A,v2);
-	timer.stop().display();
+  System.out.print("now merge sorting with simple aggregation... ");
+  timer.reset().start();
+  mergeSort.sort(A,v2);
+  timer.stop().display();
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/doublealgo/Partitioning.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/doublealgo/Partitioning.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/doublealgo/Partitioning.java	(working copy)
@@ -23,8 +23,6 @@
  *
  * @see org.apache.mahout.matrix.Partitioning "Partitioning arrays (provides more documentation)"
  *
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 09/24/99
  */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
@@ -53,42 +51,42 @@
 <b>Example:</b> 
 <table border="1" cellspacing="0">
   <tr nowrap> 
-	<td valign="top"><tt>8 x 3 matrix:<br>
-	  23, 22, 21<br>
-	  20, 19, 18<br>
-	  17, 16, 15<br>
-	  14, 13, 12<br>
-	  11, 10, 9<br>
-	  8,  7,  6<br>
-	  5,  4,  3<br>
-	  2,  1,  0 </tt></td>
-	<td align="left" valign="top"> 
-	  <p><tt>column = 0;<br>
-	    rowIndexes = {0,1,2,..,matrix.rows()-1};
-		rowFrom = 0;<br>
-		rowTo = matrix.rows()-1;<br>
-		splitters = {5,10,12}<br>
-		c = 0; <br>
-		d = splitters.length-1;<br>
-		partition(matrix,rowIndexes,rowFrom,rowTo,column,splitters,c,d,splitIndexes);<br>
-		==><br>
-		splitIndexes == {0, 2, 3}<br>
-		rowIndexes == {7, 6, 5, 4, 0, 1, 2, 3}</tt></p>
-	  </td>
-	<td valign="top">
-	  The matrix IS NOT REORDERED.<br>
-	  Here is how it would look<br>
-	  like, if it would be reordered<br>
-	  accoring to <tt>rowIndexes</tt>.<br>
-	  <tt>8 x 3 matrix:<br>
-	  2,  1,  0<br>
-	  5,  4,  3<br>
-	  8,  7,  6<br>
-	  11, 10, 9<br>
-	  23, 22, 21<br>
-	  20, 19, 18<br>
-	  17, 16, 15<br>
-	  14, 13, 12 </tt></td>
+  <td valign="top"><tt>8 x 3 matrix:<br>
+    23, 22, 21<br>
+    20, 19, 18<br>
+    17, 16, 15<br>
+    14, 13, 12<br>
+    11, 10, 9<br>
+    8,  7,  6<br>
+    5,  4,  3<br>
+    2,  1,  0 </tt></td>
+  <td align="left" valign="top"> 
+    <p><tt>column = 0;<br>
+      rowIndexes = {0,1,2,..,matrix.rows()-1};
+    rowFrom = 0;<br>
+    rowTo = matrix.rows()-1;<br>
+    splitters = {5,10,12}<br>
+    c = 0; <br>
+    d = splitters.length-1;<br>
+    partition(matrix,rowIndexes,rowFrom,rowTo,column,splitters,c,d,splitIndexes);<br>
+    ==><br>
+    splitIndexes == {0, 2, 3}<br>
+    rowIndexes == {7, 6, 5, 4, 0, 1, 2, 3}</tt></p>
+    </td>
+  <td valign="top">
+    The matrix IS NOT REORDERED.<br>
+    Here is how it would look<br>
+    like, if it would be reordered<br>
+    accoring to <tt>rowIndexes</tt>.<br>
+    <tt>8 x 3 matrix:<br>
+    2,  1,  0<br>
+    5,  4,  3<br>
+    8,  7,  6<br>
+    11, 10, 9<br>
+    23, 22, 21<br>
+    20, 19, 18<br>
+    17, 16, 15<br>
+    14, 13, 12 </tt></td>
   </tr>
 </table>
 @param matrix the matrix to be partitioned.
@@ -97,61 +95,61 @@
 @param rowTo the index of the last row (inclusive).
 @param column the index of the column to partition on.
 @param splitters the values at which the rows shall be split into intervals.
-	Must be sorted ascending and must not contain multiple identical values.
-	These preconditions are not checked; be sure that they are met.
+  Must be sorted ascending and must not contain multiple identical values.
+  These preconditions are not checked; be sure that they are met.
  
 @param splitFrom the index of the first splitter element to be considered.
 @param splitTo the index of the last splitter element to be considered.
-	The method considers the splitter elements <tt>splitters[splitFrom] .. splitters[splitTo]</tt>.
+  The method considers the splitter elements <tt>splitters[splitFrom] .. splitters[splitTo]</tt>.
  
 @param splitIndexes a list into which this method fills the indexes of rows delimiting intervals.
 Upon return <tt>splitIndexes[splitFrom..splitTo]</tt> will be set accordingly.
 Therefore, must satisfy <tt>splitIndexes.length >= splitters.length</tt>.
 */
 public static void partition(DoubleMatrix2D matrix, int[] rowIndexes, int rowFrom, int rowTo, int column, final double[] splitters, int splitFrom, int splitTo, int[] splitIndexes) {
-	if (rowFrom < 0 || rowTo >= matrix.rows() || rowTo >= rowIndexes.length) throw new IllegalArgumentException();
-	if (column < 0 || column >= matrix.columns()) throw new IllegalArgumentException();
-	if (splitFrom < 0 || splitTo >= splitters.length) throw new IllegalArgumentException();
-	if (splitIndexes.length < splitters.length) throw new IllegalArgumentException();
+  if (rowFrom < 0 || rowTo >= matrix.rows() || rowTo >= rowIndexes.length) throw new IllegalArgumentException();
+  if (column < 0 || column >= matrix.columns()) throw new IllegalArgumentException();
+  if (splitFrom < 0 || splitTo >= splitters.length) throw new IllegalArgumentException();
+  if (splitIndexes.length < splitters.length) throw new IllegalArgumentException();
 
-	// this one knows how to swap two row indexes (a,b)
-	final int[] g = rowIndexes;
-	Swapper swapper = new Swapper() {
-		public void swap(int b, int c) {
-			int tmp = g[b]; g[b] = g[c]; g[c] = tmp;
-		}
-	};
-	
-	// compare splitter[a] with columnView[rowIndexes[b]]
-	final DoubleMatrix1D columnView = matrix.viewColumn(column);	
-	IntComparator comp = new IntComparator() {
-		public int compare(int a, int b) {
-			double av = splitters[a];
-			double bv = columnView.getQuick(g[b]);
-			return av<bv ? -1 : (av==bv ? 0 : 1);
-		}
-	};
+  // this one knows how to swap two row indexes (a,b)
+  final int[] g = rowIndexes;
+  Swapper swapper = new Swapper() {
+    public void swap(int b, int c) {
+      int tmp = g[b]; g[b] = g[c]; g[c] = tmp;
+    }
+  };
+  
+  // compare splitter[a] with columnView[rowIndexes[b]]
+  final DoubleMatrix1D columnView = matrix.viewColumn(column);  
+  IntComparator comp = new IntComparator() {
+    public int compare(int a, int b) {
+      double av = splitters[a];
+      double bv = columnView.getQuick(g[b]);
+      return av<bv ? -1 : (av==bv ? 0 : 1);
+    }
+  };
 
-	// compare columnView[rowIndexes[a]] with columnView[rowIndexes[b]]
-	IntComparator comp2 = new IntComparator() {
-		public int compare(int a, int b) {
-			double av = columnView.getQuick(g[a]);
-			double bv = columnView.getQuick(g[b]);
-			return av<bv ? -1 : (av==bv ? 0 : 1);
-		}
-	};
+  // compare columnView[rowIndexes[a]] with columnView[rowIndexes[b]]
+  IntComparator comp2 = new IntComparator() {
+    public int compare(int a, int b) {
+      double av = columnView.getQuick(g[a]);
+      double bv = columnView.getQuick(g[b]);
+      return av<bv ? -1 : (av==bv ? 0 : 1);
+    }
+  };
 
-	// compare splitter[a] with splitter[b]
-	IntComparator comp3 = new IntComparator() {
-		public int compare(int a, int b) {
-			double av = splitters[a];
-			double bv = splitters[b];
-			return av<bv ? -1 : (av==bv ? 0 : 1);
-		}
-	};
+  // compare splitter[a] with splitter[b]
+  IntComparator comp3 = new IntComparator() {
+    public int compare(int a, int b) {
+      double av = splitters[a];
+      double bv = splitters[b];
+      return av<bv ? -1 : (av==bv ? 0 : 1);
+    }
+  };
 
-	// generic partitioning does the main work of reordering row indexes
-	org.apache.mahout.matrix.Partitioning.genericPartition(rowFrom,rowTo,splitFrom,splitTo,splitIndexes,comp,comp2,comp3,swapper);
+  // generic partitioning does the main work of reordering row indexes
+  org.apache.mahout.matrix.Partitioning.genericPartition(rowFrom,rowTo,splitFrom,splitTo,splitIndexes,comp,comp2,comp3,swapper);
 }
 /**
 Same as {@link org.apache.mahout.matrix.Partitioning#partition(int[],int,int,int[],int,int,int[])}
@@ -171,41 +169,41 @@
 <b>Example:</b> 
 <table border="1" cellspacing="0">
   <tr nowrap> 
-	<td valign="top"><tt>8 x 3 matrix:<br>
-	  23, 22, 21<br>
-	  20, 19, 18<br>
-	  17, 16, 15<br>
-	  14, 13, 12<br>
-	  11, 10, 9<br>
-	  8,  7,  6<br>
-	  5,  4,  3<br>
-	  2,  1,  0 </tt></td>
-	<td align="left" valign="top"> 
-	    <tt>column = 0;<br>
-		splitters = {5,10,12}<br>
-		partition(matrix,column,splitters,splitIndexes);<br>
-		==><br>
-		splitIndexes == {0, 2, 3}</tt></p>
-	  </td>
-	<td valign="top">
-	  The matrix IS NOT REORDERED.<br>
-	  The new VIEW IS REORDERED:<br>
-	  <tt>8 x 3 matrix:<br>
-	  2,  1,  0<br>
-	  5,  4,  3<br>
-	  8,  7,  6<br>
-	  11, 10, 9<br>
-	  23, 22, 21<br>
-	  20, 19, 18<br>
-	  17, 16, 15<br>
-	  14, 13, 12 </tt></td>
+  <td valign="top"><tt>8 x 3 matrix:<br>
+    23, 22, 21<br>
+    20, 19, 18<br>
+    17, 16, 15<br>
+    14, 13, 12<br>
+    11, 10, 9<br>
+    8,  7,  6<br>
+    5,  4,  3<br>
+    2,  1,  0 </tt></td>
+  <td align="left" valign="top"> 
+      <tt>column = 0;<br>
+    splitters = {5,10,12}<br>
+    partition(matrix,column,splitters,splitIndexes);<br>
+    ==><br>
+    splitIndexes == {0, 2, 3}</tt></p>
+    </td>
+  <td valign="top">
+    The matrix IS NOT REORDERED.<br>
+    The new VIEW IS REORDERED:<br>
+    <tt>8 x 3 matrix:<br>
+    2,  1,  0<br>
+    5,  4,  3<br>
+    8,  7,  6<br>
+    11, 10, 9<br>
+    23, 22, 21<br>
+    20, 19, 18<br>
+    17, 16, 15<br>
+    14, 13, 12 </tt></td>
   </tr>
 </table>
 @param matrix the matrix to be partitioned.
 @param column the index of the column to partition on.
 @param splitters the values at which the rows shall be split into intervals.
-	Must be sorted ascending and must not contain multiple identical values.
-	These preconditions are not checked; be sure that they are met.
+  Must be sorted ascending and must not contain multiple identical values.
+  These preconditions are not checked; be sure that they are met.
  
 @param splitIndexes a list into which this method fills the indexes of rows delimiting intervals.
 Therefore, must satisfy <tt>splitIndexes.length >= splitters.length</tt>.
@@ -213,21 +211,21 @@
 @return a new matrix view having rows partitioned by the given column and splitters.
 */
 public static DoubleMatrix2D partition(DoubleMatrix2D matrix, int column, final double[] splitters, int[] splitIndexes) {
-	int rowFrom = 0;
-	int rowTo = matrix.rows()-1;
-	int splitFrom = 0;
-	int splitTo = splitters.length-1;
-	int[] rowIndexes = new int[matrix.rows()]; // row indexes to reorder instead of matrix itself
-	for (int i=rowIndexes.length; --i >= 0; ) rowIndexes[i] = i;
+  int rowFrom = 0;
+  int rowTo = matrix.rows()-1;
+  int splitFrom = 0;
+  int splitTo = splitters.length-1;
+  int[] rowIndexes = new int[matrix.rows()]; // row indexes to reorder instead of matrix itself
+  for (int i=rowIndexes.length; --i >= 0; ) rowIndexes[i] = i;
 
-	partition(matrix,rowIndexes,rowFrom,rowTo,column,splitters,splitFrom,splitTo,splitIndexes);
+  partition(matrix,rowIndexes,rowFrom,rowTo,column,splitters,splitFrom,splitTo,splitIndexes);
 
-	// take all columns in the original order
-	int[] columnIndexes = new int[matrix.columns()];
-	for (int i=columnIndexes.length; --i >= 0; ) columnIndexes[i] = i;
+  // take all columns in the original order
+  int[] columnIndexes = new int[matrix.columns()];
+  for (int i=columnIndexes.length; --i >= 0; ) columnIndexes[i] = i;
 
-	// view the matrix according to the reordered row indexes
-	return matrix.viewSelection(rowIndexes,columnIndexes);
+  // view the matrix according to the reordered row indexes
+  return matrix.viewSelection(rowIndexes,columnIndexes);
 }
 /**
 Same as {@link #partition(int[],int,int,int[],int,int,int[])}
@@ -251,108 +249,108 @@
 <b>Example:</b> 
 <table border="1" cellspacing="0">
   <tr nowrap> 
-	<td valign="top"><tt>8 x 3 matrix:<br>
-	  23, 22, 21<br>
-	  20, 19, 18<br>
-	  17, 16, 15<br>
-	  14, 13, 12<br>
-	  11, 10, 9<br>
-	  8,  7,  6<br>
-	  5,  4,  3<br>
-	  2,  1,  0 </tt></td>
-	<td align="left"> 
-	  <p><tt>column = matrix.viewColumn(0);<br>
-		a = 0;<br>
-		b = column.size()-1;</tt><tt><br>
-		splitters={5,10,12}<br>
-		c=0; <br>
-		d=splitters.length-1;</tt><tt><br>
-		partition(matrix,column,a,b,splitters,c,d,splitIndexes);<br>
-		==><br>
-		splitIndexes == {0, 2, 3}</tt></p>
-	  </td>
-	<td valign="top"><tt>8 x 3 matrix:<br>
-	  2,  1,  0<br>
-	  5,  4,  3<br>
-	  8,  7,  6<br>
-	  11, 10, 9<br>
-	  23, 22, 21<br>
-	  20, 19, 18<br>
-	  17, 16, 15<br>
-	  14, 13, 12 </tt></td>
+  <td valign="top"><tt>8 x 3 matrix:<br>
+    23, 22, 21<br>
+    20, 19, 18<br>
+    17, 16, 15<br>
+    14, 13, 12<br>
+    11, 10, 9<br>
+    8,  7,  6<br>
+    5,  4,  3<br>
+    2,  1,  0 </tt></td>
+  <td align="left"> 
+    <p><tt>column = matrix.viewColumn(0);<br>
+    a = 0;<br>
+    b = column.size()-1;</tt><tt><br>
+    splitters={5,10,12}<br>
+    c=0; <br>
+    d=splitters.length-1;</tt><tt><br>
+    partition(matrix,column,a,b,splitters,c,d,splitIndexes);<br>
+    ==><br>
+    splitIndexes == {0, 2, 3}</tt></p>
+    </td>
+  <td valign="top"><tt>8 x 3 matrix:<br>
+    2,  1,  0<br>
+    5,  4,  3<br>
+    8,  7,  6<br>
+    11, 10, 9<br>
+    23, 22, 21<br>
+    20, 19, 18<br>
+    17, 16, 15<br>
+    14, 13, 12 </tt></td>
   </tr>
 </table>
 */
 private static void xPartitionOld(DoubleMatrix2D matrix, DoubleMatrix1D column, int from, int to, double[] splitters, int splitFrom, int splitTo, int[] splitIndexes) {
-	/*
-	double splitter; // int, double --> template type dependent
-	
-	if (splitFrom>splitTo) return; // nothing to do
-	if (from>to) { // all bins are empty
-		from--;
-		for (int i = splitFrom; i<=splitTo; ) splitIndexes[i++] = from;
-		return;
-	}
-	
-	// Choose a partition (pivot) index, m
-	// Ideally, the pivot should be the median, because a median splits a list into two equal sized sublists.
-	// However, computing the median is expensive, so we use an approximation.
-	int medianIndex;
-	if (splitFrom==splitTo) { // we don't really have a choice
-		medianIndex = splitFrom;
-	}
-	else { // we do have a choice
-		int m = (from+to) / 2;       // Small arrays, middle element
-		int len = to-from+1;
-		if (len > SMALL) {
-		    int l = from;
-		    int n = to;
-		    if (len > MEDIUM) {        // Big arrays, pseudomedian of 9
-				int s = len/8;
-				l = med3(column, l,     l+s, l+2*s);
-				m = med3(column, m-s,   m,   m+s);
-				n = med3(column, n-2*s, n-s, n);
-		    }
-		    m = med3(column, l, m, n); // Mid-size, pseudomedian of 3
-		}
-		
-		// Find the splitter closest to the pivot, i.e. the splitter that best splits the list into two equal sized sublists.
-		medianIndex = org.apache.mahout.matrix.Sorting.binarySearchFromTo(splitters,column.getQuick(m),splitFrom,splitTo);
-		if (medianIndex < 0) medianIndex = -medianIndex - 1; // not found
-		if (medianIndex > splitTo) medianIndex = splitTo; // not found, one past the end
-		
-	}
-	splitter = splitters[medianIndex];
+  /*
+  double splitter; // int, double --> template type dependent
+  
+  if (splitFrom>splitTo) return; // nothing to do
+  if (from>to) { // all bins are empty
+    from--;
+    for (int i = splitFrom; i<=splitTo; ) splitIndexes[i++] = from;
+    return;
+  }
+  
+  // Choose a partition (pivot) index, m
+  // Ideally, the pivot should be the median, because a median splits a list into two equal sized sublists.
+  // However, computing the median is expensive, so we use an approximation.
+  int medianIndex;
+  if (splitFrom==splitTo) { // we don't really have a choice
+    medianIndex = splitFrom;
+  }
+  else { // we do have a choice
+    int m = (from+to) / 2;       // Small arrays, middle element
+    int len = to-from+1;
+    if (len > SMALL) {
+        int l = from;
+        int n = to;
+        if (len > MEDIUM) {        // Big arrays, pseudomedian of 9
+        int s = len/8;
+        l = med3(column, l,     l+s, l+2*s);
+        m = med3(column, m-s,   m,   m+s);
+        n = med3(column, n-2*s, n-s, n);
+        }
+        m = med3(column, l, m, n); // Mid-size, pseudomedian of 3
+    }
+    
+    // Find the splitter closest to the pivot, i.e. the splitter that best splits the list into two equal sized sublists.
+    medianIndex = org.apache.mahout.matrix.Sorting.binarySearchFromTo(splitters,column.getQuick(m),splitFrom,splitTo);
+    if (medianIndex < 0) medianIndex = -medianIndex - 1; // not found
+    if (medianIndex > splitTo) medianIndex = splitTo; // not found, one past the end
+    
+  }
+  splitter = splitters[medianIndex];
 
-	// Partition the list according to the splitter, i.e.
-	// Establish invariant: list[i] < splitter <= list[j] for i=from..medianIndex and j=medianIndex+1 .. to
-	int	splitIndex = xPartitionOld(matrix,column,from,to,splitter);
-	splitIndexes[medianIndex] = splitIndex;
+  // Partition the list according to the splitter, i.e.
+  // Establish invariant: list[i] < splitter <= list[j] for i=from..medianIndex and j=medianIndex+1 .. to
+  int  splitIndex = xPartitionOld(matrix,column,from,to,splitter);
+  splitIndexes[medianIndex] = splitIndex;
 
-	// Optimization: Handle special cases to cut down recursions.
-	if (splitIndex < from) { // no element falls into this bin
-		// all bins with splitters[i] <= splitter are empty
-		int i = medianIndex-1;
-		while (i>=splitFrom && (!(splitter < splitters[i]))) splitIndexes[i--] = splitIndex;
-		splitFrom = medianIndex+1;
-	}
-	else if (splitIndex >= to) { // all elements fall into this bin
-		// all bins with splitters[i] >= splitter are empty
-		int i = medianIndex+1;
-		while (i<=splitTo && (!(splitter > splitters[i]))) splitIndexes[i++] = splitIndex;
-		splitTo = medianIndex-1;
-	}
+  // Optimization: Handle special cases to cut down recursions.
+  if (splitIndex < from) { // no element falls into this bin
+    // all bins with splitters[i] <= splitter are empty
+    int i = medianIndex-1;
+    while (i>=splitFrom && (!(splitter < splitters[i]))) splitIndexes[i--] = splitIndex;
+    splitFrom = medianIndex+1;
+  }
+  else if (splitIndex >= to) { // all elements fall into this bin
+    // all bins with splitters[i] >= splitter are empty
+    int i = medianIndex+1;
+    while (i<=splitTo && (!(splitter > splitters[i]))) splitIndexes[i++] = splitIndex;
+    splitTo = medianIndex-1;
+  }
 
-	// recursively partition left half
-	if (splitFrom <= medianIndex-1) {
-		xPartitionOld(matrix, column, from,         splitIndex, splitters, splitFrom, medianIndex-1,  splitIndexes);
-	}
-	
-	// recursively partition right half
-	if (medianIndex+1 <= splitTo) {
-		xPartitionOld(matrix, column, splitIndex+1, to,         splitters, medianIndex+1,  splitTo,   splitIndexes);
-	}
-	*/
+  // recursively partition left half
+  if (splitFrom <= medianIndex-1) {
+    xPartitionOld(matrix, column, from,         splitIndex, splitters, splitFrom, medianIndex-1,  splitIndexes);
+  }
+  
+  // recursively partition right half
+  if (medianIndex+1 <= splitTo) {
+    xPartitionOld(matrix, column, splitIndex+1, to,         splitters, medianIndex+1,  splitTo,   splitIndexes);
+  }
+  */
 }
 /**
  * Same as {@link #partition(int[],int,int,int)} 
@@ -374,18 +372,18 @@
  * Note that arguments are not checked for validity.
  */
 private static int xPartitionOld(DoubleMatrix2D matrix, DoubleMatrix1D column, int from, int to, double splitter) {
-	/*
-	double element;  // int, double --> template type dependent
-	for (int i=from-1; ++i<=to; ) {
-		element = column.getQuick(i);
-		if (element < splitter) {
-			// swap x[i] with x[from]
-			matrix.swapRows(i,from);
-			from++;
-		}
-	}
-	return from-1;
-	*/
-	return 0;
+  /*
+  double element;  // int, double --> template type dependent
+  for (int i=from-1; ++i<=to; ) {
+    element = column.getQuick(i);
+    if (element < splitter) {
+      // swap x[i] with x[from]
+      matrix.swapRows(i,from);
+      from++;
+    }
+  }
+  return from-1;
+  */
+  return 0;
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/doublealgo/Statistic.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/doublealgo/Statistic.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/doublealgo/Statistic.java	(working copy)
@@ -25,31 +25,31 @@
 Examples:
 <table border="1" cellspacing="0" dwcopytype="CopyTableRow">
   <tr valign="top" align="center"> 
-	<td><tt>A</tt></td>
-	<td><tt>covariance(A)</tt></td>
-	<td><tt>correlation(covariance(A))</tt></td>
-	<td><tt>distance(A,EUCLID)</tt></td>
+  <td><tt>A</tt></td>
+  <td><tt>covariance(A)</tt></td>
+  <td><tt>correlation(covariance(A))</tt></td>
+  <td><tt>distance(A,EUCLID)</tt></td>
   </tr>
   <tr valign="top"> 
-	<td><tt> 4&nbsp;x&nbsp;3&nbsp;matrix<br>
-	  1&nbsp;&nbsp;2&nbsp;&nbsp;&nbsp;3<br>
-	  2&nbsp;&nbsp;4&nbsp;&nbsp;&nbsp;6<br>
-	  3&nbsp;&nbsp;6&nbsp;&nbsp;&nbsp;9<br>
-	  4&nbsp;-8&nbsp;-10 </tt> </td>
-	<td><tt> 3&nbsp;x&nbsp;3&nbsp;matrix<br>
-	  &nbsp;1.25&nbsp;-3.5&nbsp;-4.5<br>
-	  -3.5&nbsp;&nbsp;29&nbsp;&nbsp;&nbsp;39&nbsp;&nbsp;<br>
-	  -4.5&nbsp;&nbsp;39&nbsp;&nbsp;&nbsp;52.5 </tt></td>
-	<td><tt> 3&nbsp;x&nbsp;3&nbsp;matrix<br>
-	  &nbsp;1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-0.581318&nbsp;-0.555492<br>
-	  -0.581318&nbsp;&nbsp;1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0.999507<br>
-	  -0.555492&nbsp;&nbsp;0.999507&nbsp;&nbsp;1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
-	  </tt></td>
-	<td><tt> 3&nbsp;x&nbsp;3&nbsp;matrix<br>
-	  &nbsp;0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;12.569805&nbsp;15.874508<br>
-	  12.569805&nbsp;&nbsp;0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4.242641<br>
-	  15.874508&nbsp;&nbsp;4.242641&nbsp;&nbsp;0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
-	  </tt> <tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </tt></td>
+  <td><tt> 4&nbsp;x&nbsp;3&nbsp;matrix<br>
+    1&nbsp;&nbsp;2&nbsp;&nbsp;&nbsp;3<br>
+    2&nbsp;&nbsp;4&nbsp;&nbsp;&nbsp;6<br>
+    3&nbsp;&nbsp;6&nbsp;&nbsp;&nbsp;9<br>
+    4&nbsp;-8&nbsp;-10 </tt> </td>
+  <td><tt> 3&nbsp;x&nbsp;3&nbsp;matrix<br>
+    &nbsp;1.25&nbsp;-3.5&nbsp;-4.5<br>
+    -3.5&nbsp;&nbsp;29&nbsp;&nbsp;&nbsp;39&nbsp;&nbsp;<br>
+    -4.5&nbsp;&nbsp;39&nbsp;&nbsp;&nbsp;52.5 </tt></td>
+  <td><tt> 3&nbsp;x&nbsp;3&nbsp;matrix<br>
+    &nbsp;1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-0.581318&nbsp;-0.555492<br>
+    -0.581318&nbsp;&nbsp;1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0.999507<br>
+    -0.555492&nbsp;&nbsp;0.999507&nbsp;&nbsp;1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
+    </tt></td>
+  <td><tt> 3&nbsp;x&nbsp;3&nbsp;matrix<br>
+    &nbsp;0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;12.569805&nbsp;15.874508<br>
+    12.569805&nbsp;&nbsp;0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4.242641<br>
+    15.874508&nbsp;&nbsp;4.242641&nbsp;&nbsp;0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
+    </tt> <tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </tt></td>
   </tr>
 </table>
 
@@ -61,56 +61,56 @@
  */
 @Deprecated
 public class Statistic extends Object {
-	private static final org.apache.mahout.jet.math.Functions F = org.apache.mahout.jet.math.Functions.functions;
-	/**
-	 * Euclidean distance function; <tt>Sqrt(Sum( (x[i]-y[i])^2 ))</tt>.
-	 */ 
-	public static final VectorVectorFunction EUCLID = new VectorVectorFunction() {
-		public final double apply(DoubleMatrix1D a, DoubleMatrix1D b) {
-			return Math.sqrt(a.aggregate(b, F.plus, F.chain(F.square,F.minus)));
-		}
-	};
+  private static final org.apache.mahout.jet.math.Functions F = org.apache.mahout.jet.math.Functions.functions;
+  /**
+   * Euclidean distance function; <tt>Sqrt(Sum( (x[i]-y[i])^2 ))</tt>.
+   */ 
+  public static final VectorVectorFunction EUCLID = new VectorVectorFunction() {
+    public final double apply(DoubleMatrix1D a, DoubleMatrix1D b) {
+      return Math.sqrt(a.aggregate(b, F.plus, F.chain(F.square,F.minus)));
+    }
+  };
 
-	/**
-	 * Bray-Curtis distance function; <tt>Sum( abs(x[i]-y[i]) )  /  Sum( x[i]+y[i] )</tt>.
-	 */ 
-	public static final VectorVectorFunction BRAY_CURTIS = new VectorVectorFunction() {
-		public final double apply(DoubleMatrix1D a, DoubleMatrix1D b) {	
-			return a.aggregate(b, F.plus, F.chain(F.abs,F.minus)) / a.aggregate(b, F.plus, F.plus);
-		}
-	};
+  /**
+   * Bray-Curtis distance function; <tt>Sum( abs(x[i]-y[i]) )  /  Sum( x[i]+y[i] )</tt>.
+   */ 
+  public static final VectorVectorFunction BRAY_CURTIS = new VectorVectorFunction() {
+    public final double apply(DoubleMatrix1D a, DoubleMatrix1D b) {  
+      return a.aggregate(b, F.plus, F.chain(F.abs,F.minus)) / a.aggregate(b, F.plus, F.plus);
+    }
+  };
 
-	/**
-	 * Canberra distance function; <tt>Sum( abs(x[i]-y[i]) / abs(x[i]+y[i]) )</tt>.
-	 */ 
-	public static final VectorVectorFunction CANBERRA = new VectorVectorFunction() {
-		DoubleDoubleFunction fun = new DoubleDoubleFunction() {
-			public final double apply(double a, double b) {
-				return Math.abs(a-b) / Math.abs(a+b);
-			}
-		};
-		public final double apply(DoubleMatrix1D a, DoubleMatrix1D b) {	
-			return a.aggregate(b, F.plus, fun);
-		}
-	};
+  /**
+   * Canberra distance function; <tt>Sum( abs(x[i]-y[i]) / abs(x[i]+y[i]) )</tt>.
+   */ 
+  public static final VectorVectorFunction CANBERRA = new VectorVectorFunction() {
+    DoubleDoubleFunction fun = new DoubleDoubleFunction() {
+      public final double apply(double a, double b) {
+        return Math.abs(a-b) / Math.abs(a+b);
+      }
+    };
+    public final double apply(DoubleMatrix1D a, DoubleMatrix1D b) {  
+      return a.aggregate(b, F.plus, fun);
+    }
+  };
 
-	/**
-	 * Maximum distance function; <tt>Max( abs(x[i]-y[i]) )</tt>.
-	 */ 
-	public static final VectorVectorFunction MAXIMUM = new VectorVectorFunction() {
-		public final double apply(DoubleMatrix1D a, DoubleMatrix1D b) {	
-			return a.aggregate(b, F.max, F.chain(F.abs,F.minus));
-		}
-	};
+  /**
+   * Maximum distance function; <tt>Max( abs(x[i]-y[i]) )</tt>.
+   */ 
+  public static final VectorVectorFunction MAXIMUM = new VectorVectorFunction() {
+    public final double apply(DoubleMatrix1D a, DoubleMatrix1D b) {  
+      return a.aggregate(b, F.max, F.chain(F.abs,F.minus));
+    }
+  };
 
-	/**
-	 * Manhattan distance function; <tt>Sum( abs(x[i]-y[i]) )</tt>.
-	 */ 
-	public static final VectorVectorFunction MANHATTAN = new VectorVectorFunction() {
-		public final double apply(DoubleMatrix1D a, DoubleMatrix1D b) {	
-			return a.aggregate(b, F.plus, F.chain(F.abs,F.minus));
-		}
-	};
+  /**
+   * Manhattan distance function; <tt>Sum( abs(x[i]-y[i]) )</tt>.
+   */ 
+  public static final VectorVectorFunction MANHATTAN = new VectorVectorFunction() {
+    public final double apply(DoubleMatrix1D a, DoubleMatrix1D b) {  
+      return a.aggregate(b, F.plus, F.chain(F.abs,F.minus));
+    }
+  };
 
 
 
@@ -152,18 +152,18 @@
  * @see hep.aida.bin.BinFunctions1D
  *
 public static DoubleMatrix2D aggregate(DoubleMatrix2D matrix, hep.aida.bin.BinFunction1D[] aggr, DoubleMatrix2D result) {
-	DynamicBin1D bin = new DynamicBin1D();
-	double[] elements = new double[matrix.rows()];
-	org.apache.mahout.matrix.list.DoubleArrayList values = new org.apache.mahout.matrix.list.DoubleArrayList(elements);
-	for (int column=matrix.columns(); --column >= 0; ) {
-		matrix.viewColumn(column).toArray(elements); // copy column into values
-		bin.clear();
-		bin.addAllOf(values);
-		for (int i=aggr.length; --i >= 0; ) {
-			result.set(i, column, aggr[i].apply(bin));
-		}
-	}
-	return result;
+  DynamicBin1D bin = new DynamicBin1D();
+  double[] elements = new double[matrix.rows()];
+  org.apache.mahout.matrix.list.DoubleArrayList values = new org.apache.mahout.matrix.list.DoubleArrayList(elements);
+  for (int column=matrix.columns(); --column >= 0; ) {
+    matrix.viewColumn(column).toArray(elements); // copy column into values
+    bin.clear();
+    bin.addAllOf(values);
+    for (int i=aggr.length; --i >= 0; ) {
+      result.set(i, column, aggr[i].apply(bin));
+    }
+  }
+  return result;
 }
 */
 /**
@@ -220,9 +220,9 @@
 @return a bin holding the statistics measures of the vector.
 *
 public static DynamicBin1D bin(DoubleMatrix1D vector) {
-	DynamicBin1D bin = new DynamicBin1D();
-	bin.addAllOf(DoubleFactory1D.dense.toList(vector));
-	return bin;
+  DynamicBin1D bin = new DynamicBin1D();
+  bin.addAllOf(DoubleFactory1D.dense.toList(vector));
+  return bin;
 }
 */
 /**
@@ -240,20 +240,20 @@
  * @return the modified covariance, now correlation matrix (for convenience only).
  */
 public static DoubleMatrix2D correlation(DoubleMatrix2D covariance) {
-	for (int i=covariance.columns(); --i >= 0; ) {
-		for (int j=i; --j >= 0; ) {
-			double stdDev1 = Math.sqrt(covariance.getQuick(i,i));
-			double stdDev2 = Math.sqrt(covariance.getQuick(j,j));
-			double cov = covariance.getQuick(i,j);
-			double corr = cov / (stdDev1*stdDev2);
-			
-			covariance.setQuick(i,j,corr);
-			covariance.setQuick(j,i,corr); // symmetric
-		}
-	}
-	for (int i=covariance.columns(); --i >= 0; ) covariance.setQuick(i,i,1);
+  for (int i=covariance.columns(); --i >= 0; ) {
+    for (int j=i; --j >= 0; ) {
+      double stdDev1 = Math.sqrt(covariance.getQuick(i,i));
+      double stdDev2 = Math.sqrt(covariance.getQuick(j,j));
+      double cov = covariance.getQuick(i,j);
+      double corr = cov / (stdDev1*stdDev2);
+      
+      covariance.setQuick(i,j,corr);
+      covariance.setQuick(j,i,corr); // symmetric
+    }
+  }
+  for (int i=covariance.columns(); --i >= 0; ) covariance.setQuick(i,i,1);
 
-	return covariance;	
+  return covariance;  
 }
 /**
  * Constructs and returns the covariance matrix of the given matrix.
@@ -268,26 +268,26 @@
  * @return the covariance matrix (<tt>n x n, n=matrix.columns</tt>).
  */
 public static DoubleMatrix2D covariance(DoubleMatrix2D matrix) {
-	int rows = matrix.rows();
-	int columns = matrix.columns();
-	DoubleMatrix2D covariance = new org.apache.mahout.matrix.matrix.impl.DenseDoubleMatrix2D(columns,columns);
-	
-	double[] sums = new double[columns];
-	DoubleMatrix1D[] cols = new DoubleMatrix1D[columns];
-	for (int i=columns; --i >= 0; ) {
-		cols[i] = matrix.viewColumn(i);
-		sums[i] = cols[i].zSum();
-	}
+  int rows = matrix.rows();
+  int columns = matrix.columns();
+  DoubleMatrix2D covariance = new org.apache.mahout.matrix.matrix.impl.DenseDoubleMatrix2D(columns,columns);
+  
+  double[] sums = new double[columns];
+  DoubleMatrix1D[] cols = new DoubleMatrix1D[columns];
+  for (int i=columns; --i >= 0; ) {
+    cols[i] = matrix.viewColumn(i);
+    sums[i] = cols[i].zSum();
+  }
 
-	for (int i=columns; --i >= 0; ) {
-		for (int j=i+1; --j >= 0; ) {
-			double sumOfProducts = cols[i].zDotProduct(cols[j]);
-			double cov = (sumOfProducts - sums[i]*sums[j]/rows) / rows;
-			covariance.setQuick(i,j,cov);
-			covariance.setQuick(j,i,cov); // symmetric
-		}
-	}
-	return covariance;	
+  for (int i=columns; --i >= 0; ) {
+    for (int j=i+1; --j >= 0; ) {
+      double sumOfProducts = cols[i].zDotProduct(cols[j]);
+      double cov = (sumOfProducts - sums[i]*sums[j]/rows) / rows;
+      covariance.setQuick(i,j,cov);
+      covariance.setQuick(j,i,cov); // symmetric
+    }
+  }
+  return covariance;  
 }
 /**
 2-d OLAP cube operator; Fills all cells of the given vectors into the given histogram.
@@ -326,33 +326,33 @@
 @throws IllegalArgumentException if <tt>x.size() != y.size() || y.size() != weights.size()</tt>.
 *
 public static hep.aida.IHistogram2D cube(DoubleMatrix1D x, DoubleMatrix1D y, DoubleMatrix1D weights) {
-	if (x.size() != y.size() || y.size() != weights.size()) throw new IllegalArgumentException("vectors must have same size");
-	
-	double epsilon = 1.0E-9;
-	org.apache.mahout.matrix.list.DoubleArrayList distinct = new org.apache.mahout.matrix.list.DoubleArrayList();
-	double[] vals = new double[x.size()];
-	org.apache.mahout.matrix.list.DoubleArrayList sorted = new org.apache.mahout.matrix.list.DoubleArrayList(vals);
+  if (x.size() != y.size() || y.size() != weights.size()) throw new IllegalArgumentException("vectors must have same size");
+  
+  double epsilon = 1.0E-9;
+  org.apache.mahout.matrix.list.DoubleArrayList distinct = new org.apache.mahout.matrix.list.DoubleArrayList();
+  double[] vals = new double[x.size()];
+  org.apache.mahout.matrix.list.DoubleArrayList sorted = new org.apache.mahout.matrix.list.DoubleArrayList(vals);
 
-	// compute distinct values of x
-	x.toArray(vals); // copy x into vals
-	sorted.sort();
-	org.apache.mahout.jet.stat.Descriptive.frequencies(sorted, distinct, null);
-	// since bins are right-open [from,to) we need an additional dummy bin so that the last distinct value does not fall into the overflow bin
-	if (distinct.size()>0) distinct.add(distinct.get(distinct.size()-1) + epsilon);
-	distinct.trimToSize();
-	hep.aida.IAxis xaxis = new hep.aida.ref.VariableAxis(distinct.elements());
+  // compute distinct values of x
+  x.toArray(vals); // copy x into vals
+  sorted.sort();
+  org.apache.mahout.jet.stat.Descriptive.frequencies(sorted, distinct, null);
+  // since bins are right-open [from,to) we need an additional dummy bin so that the last distinct value does not fall into the overflow bin
+  if (distinct.size()>0) distinct.add(distinct.get(distinct.size()-1) + epsilon);
+  distinct.trimToSize();
+  hep.aida.IAxis xaxis = new hep.aida.ref.VariableAxis(distinct.elements());
 
-	// compute distinct values of y
-	y.toArray(vals);
-	sorted.sort();
-	org.apache.mahout.jet.stat.Descriptive.frequencies(sorted, distinct, null);
-	// since bins are right-open [from,to) we need an additional dummy bin so that the last distinct value does not fall into the overflow bin
-	if (distinct.size()>0) distinct.add(distinct.get(distinct.size()-1) + epsilon);
-	distinct.trimToSize();
-	hep.aida.IAxis yaxis = new hep.aida.ref.VariableAxis(distinct.elements());
+  // compute distinct values of y
+  y.toArray(vals);
+  sorted.sort();
+  org.apache.mahout.jet.stat.Descriptive.frequencies(sorted, distinct, null);
+  // since bins are right-open [from,to) we need an additional dummy bin so that the last distinct value does not fall into the overflow bin
+  if (distinct.size()>0) distinct.add(distinct.get(distinct.size()-1) + epsilon);
+  distinct.trimToSize();
+  hep.aida.IAxis yaxis = new hep.aida.ref.VariableAxis(distinct.elements());
 
-	hep.aida.IHistogram2D histo = new hep.aida.ref.Histogram2D("Cube",xaxis,yaxis);
-	return histogram(histo,x,y,weights);
+  hep.aida.IHistogram2D histo = new hep.aida.ref.Histogram2D("Cube",xaxis,yaxis);
+  return histogram(histo,x,y,weights);
 }
 */
 /**
@@ -366,42 +366,42 @@
 @throws IllegalArgumentException if <tt>x.size() != y.size() || x.size() != z.size() || x.size() != weights.size()</tt>.
 *
 public static hep.aida.IHistogram3D cube(DoubleMatrix1D x, DoubleMatrix1D y, DoubleMatrix1D z, DoubleMatrix1D weights) {
-	if (x.size() != y.size() || x.size() != z.size() || x.size() != weights.size()) throw new IllegalArgumentException("vectors must have same size");
-	
-	double epsilon = 1.0E-9;
-	org.apache.mahout.matrix.list.DoubleArrayList distinct = new org.apache.mahout.matrix.list.DoubleArrayList();
-	double[] vals = new double[x.size()];
-	org.apache.mahout.matrix.list.DoubleArrayList sorted = new org.apache.mahout.matrix.list.DoubleArrayList(vals);
+  if (x.size() != y.size() || x.size() != z.size() || x.size() != weights.size()) throw new IllegalArgumentException("vectors must have same size");
+  
+  double epsilon = 1.0E-9;
+  org.apache.mahout.matrix.list.DoubleArrayList distinct = new org.apache.mahout.matrix.list.DoubleArrayList();
+  double[] vals = new double[x.size()];
+  org.apache.mahout.matrix.list.DoubleArrayList sorted = new org.apache.mahout.matrix.list.DoubleArrayList(vals);
 
-	// compute distinct values of x
-	x.toArray(vals); // copy x into vals
-	sorted.sort();
-	org.apache.mahout.jet.stat.Descriptive.frequencies(sorted, distinct, null);
-	// since bins are right-open [from,to) we need an additional dummy bin so that the last distinct value does not fall into the overflow bin
-	if (distinct.size()>0) distinct.add(distinct.get(distinct.size()-1) + epsilon);
-	distinct.trimToSize();
-	hep.aida.IAxis xaxis = new hep.aida.ref.VariableAxis(distinct.elements());
+  // compute distinct values of x
+  x.toArray(vals); // copy x into vals
+  sorted.sort();
+  org.apache.mahout.jet.stat.Descriptive.frequencies(sorted, distinct, null);
+  // since bins are right-open [from,to) we need an additional dummy bin so that the last distinct value does not fall into the overflow bin
+  if (distinct.size()>0) distinct.add(distinct.get(distinct.size()-1) + epsilon);
+  distinct.trimToSize();
+  hep.aida.IAxis xaxis = new hep.aida.ref.VariableAxis(distinct.elements());
 
-	// compute distinct values of y
-	y.toArray(vals);
-	sorted.sort();
-	org.apache.mahout.jet.stat.Descriptive.frequencies(sorted, distinct, null);
-	// since bins are right-open [from,to) we need an additional dummy bin so that the last distinct value does not fall into the overflow bin
-	if (distinct.size()>0) distinct.add(distinct.get(distinct.size()-1) + epsilon);
-	distinct.trimToSize();
-	hep.aida.IAxis yaxis = new hep.aida.ref.VariableAxis(distinct.elements());
+  // compute distinct values of y
+  y.toArray(vals);
+  sorted.sort();
+  org.apache.mahout.jet.stat.Descriptive.frequencies(sorted, distinct, null);
+  // since bins are right-open [from,to) we need an additional dummy bin so that the last distinct value does not fall into the overflow bin
+  if (distinct.size()>0) distinct.add(distinct.get(distinct.size()-1) + epsilon);
+  distinct.trimToSize();
+  hep.aida.IAxis yaxis = new hep.aida.ref.VariableAxis(distinct.elements());
 
-	// compute distinct values of z
-	z.toArray(vals);
-	sorted.sort();
-	org.apache.mahout.jet.stat.Descriptive.frequencies(sorted, distinct, null);
-	// since bins are right-open [from,to) we need an additional dummy bin so that the last distinct value does not fall into the overflow bin
-	if (distinct.size()>0) distinct.add(distinct.get(distinct.size()-1) + epsilon);
-	distinct.trimToSize();
-	hep.aida.IAxis zaxis = new hep.aida.ref.VariableAxis(distinct.elements());
+  // compute distinct values of z
+  z.toArray(vals);
+  sorted.sort();
+  org.apache.mahout.jet.stat.Descriptive.frequencies(sorted, distinct, null);
+  // since bins are right-open [from,to) we need an additional dummy bin so that the last distinct value does not fall into the overflow bin
+  if (distinct.size()>0) distinct.add(distinct.get(distinct.size()-1) + epsilon);
+  distinct.trimToSize();
+  hep.aida.IAxis zaxis = new hep.aida.ref.VariableAxis(distinct.elements());
 
-	hep.aida.IHistogram3D histo = new hep.aida.ref.Histogram3D("Cube",xaxis,yaxis,zaxis);
-	return histogram(histo,x,y,z,weights);
+  hep.aida.IHistogram3D histo = new hep.aida.ref.Histogram3D("Cube",xaxis,yaxis,zaxis);
+  return histogram(histo,x,y,z,weights);
 }
 */
 /**
@@ -409,10 +409,10 @@
  */
 public static void demo1() {
 double[][] values = {
-	{ 1, 2, 3 },
-	{ 2, 4, 6 },
-	{ 3, 6, 9 },
-	{ 4, -8, -10 }
+  { 1, 2, 3 },
+  { 2, 4, 6 },
+  { 3, 6, 9 },
+  { 4, -8, -10 }
 };
 DoubleFactory2D factory = DoubleFactory2D.dense;
 DoubleMatrix2D A = factory.make(values);
@@ -445,8 +445,8 @@
 timer.stop().display();
 
 if (print) {
-	System.out.println("printing result...");
-	System.out.println(corr);
+  System.out.println("printing result...");
+  System.out.println(corr);
 }
 System.out.println("done.");
 }
@@ -455,11 +455,11 @@
  */
 public static void demo3(VectorVectorFunction norm) {
 double[][] values = {
-	{ -0.9611052, -0.25421095 },
-	{ 0.4308269, -0.69932648 },
-	{ -1.2071029,  0.62030596 },
-	{ 1.5345166,  0.02135884},
-	{-1.1341542,  0.20388430}
+  { -0.9611052, -0.25421095 },
+  { 0.4308269, -0.69932648 },
+  { -1.2071029,  0.62030596 },
+  { 1.5345166,  0.02135884},
+  {-1.1341542,  0.20388430}
 };
 
 System.out.println("\n\ninitializing...");
@@ -481,34 +481,34 @@
  * @return the distance matrix (<tt>n x n, n=matrix.columns</tt>).
  */
 public static DoubleMatrix2D distance(DoubleMatrix2D matrix, VectorVectorFunction distanceFunction) {
-	int columns = matrix.columns();
-	DoubleMatrix2D distance = new org.apache.mahout.matrix.matrix.impl.DenseDoubleMatrix2D(columns,columns);
+  int columns = matrix.columns();
+  DoubleMatrix2D distance = new org.apache.mahout.matrix.matrix.impl.DenseDoubleMatrix2D(columns,columns);
 
-	// cache views
-	DoubleMatrix1D[] cols = new DoubleMatrix1D[columns];
-	for (int i=columns; --i >= 0; ) {
-		cols[i] = matrix.viewColumn(i);
-	}
+  // cache views
+  DoubleMatrix1D[] cols = new DoubleMatrix1D[columns];
+  for (int i=columns; --i >= 0; ) {
+    cols[i] = matrix.viewColumn(i);
+  }
 
-	// work out all permutations
-	for (int i=columns; --i >= 0; ) {
-		for (int j=i; --j >= 0; ) {
-			double d = distanceFunction.apply(cols[i], cols[j]);
-			distance.setQuick(i,j,d);
-			distance.setQuick(j,i,d); // symmetric
-		}
-	}
-	return distance;
+  // work out all permutations
+  for (int i=columns; --i >= 0; ) {
+    for (int j=i; --j >= 0; ) {
+      double d = distanceFunction.apply(cols[i], cols[j]);
+      distance.setQuick(i,j,d);
+      distance.setQuick(j,i,d); // symmetric
+    }
+  }
+  return distance;
 }
 /**
  * Fills all cells of the given vector into the given histogram.
  * @return <tt>histo</tt> (for convenience only).
  *
 public static hep.aida.IHistogram1D histogram(hep.aida.IHistogram1D histo, DoubleMatrix1D vector) {
-	for (int i=vector.size(); --i >= 0; ) {
-		histo.fill(vector.getQuick(i));
-	}
-	return histo;
+  for (int i=vector.size(); --i >= 0; ) {
+    histo.fill(vector.getQuick(i));
+  }
+  return histo;
 }
 **
  * Fills all cells of the given vectors into the given histogram.
@@ -516,11 +516,11 @@
  * @throws IllegalArgumentException if <tt>x.size() != y.size()</tt>.
  *
 public static hep.aida.IHistogram2D histogram(hep.aida.IHistogram2D histo, DoubleMatrix1D x, DoubleMatrix1D y) {
-	if (x.size() != y.size()) throw new IllegalArgumentException("vectors must have same size");
-	for (int i=x.size(); --i >= 0; ) {
-		histo.fill(x.getQuick(i), y.getQuick(i));
-	}
-	return histo;
+  if (x.size() != y.size()) throw new IllegalArgumentException("vectors must have same size");
+  for (int i=x.size(); --i >= 0; ) {
+    histo.fill(x.getQuick(i), y.getQuick(i));
+  }
+  return histo;
 }
 **
  * Fills all cells of the given vectors into the given histogram.
@@ -528,11 +528,11 @@
  * @throws IllegalArgumentException if <tt>x.size() != y.size() || y.size() != weights.size()</tt>.
  *
 public static hep.aida.IHistogram2D histogram(hep.aida.IHistogram2D histo, DoubleMatrix1D x, DoubleMatrix1D y, DoubleMatrix1D weights) {
-	if (x.size() != y.size() || y.size() != weights.size()) throw new IllegalArgumentException("vectors must have same size");
-	for (int i=x.size(); --i >= 0; ) {
-		histo.fill(x.getQuick(i), y.getQuick(i), weights.getQuick(i));
-	}
-	return histo;
+  if (x.size() != y.size() || y.size() != weights.size()) throw new IllegalArgumentException("vectors must have same size");
+  for (int i=x.size(); --i >= 0; ) {
+    histo.fill(x.getQuick(i), y.getQuick(i), weights.getQuick(i));
+  }
+  return histo;
 }
  *
  * Fills all cells of the given vectors into the given histogram.
@@ -540,20 +540,20 @@
  * @throws IllegalArgumentException if <tt>x.size() != y.size() || x.size() != z.size() || x.size() != weights.size()</tt>.
  *
 public static hep.aida.IHistogram3D histogram(hep.aida.IHistogram3D histo, DoubleMatrix1D x, DoubleMatrix1D y, DoubleMatrix1D z, DoubleMatrix1D weights) {
-	if (x.size() != y.size() || x.size() != z.size() || x.size() != weights.size()) throw new IllegalArgumentException("vectors must have same size");
-	for (int i=x.size(); --i >= 0; ) {
-		histo.fill(x.getQuick(i), y.getQuick(i), z.getQuick(i), weights.getQuick(i));
-	}
-	return histo;
+  if (x.size() != y.size() || x.size() != z.size() || x.size() != weights.size()) throw new IllegalArgumentException("vectors must have same size");
+  for (int i=x.size(); --i >= 0; ) {
+    histo.fill(x.getQuick(i), y.getQuick(i), z.getQuick(i), weights.getQuick(i));
+  }
+  return histo;
 }
 **
  * Benchmarks covariance computation.
  */
 public static void main(String[] args) {
-	int rows = Integer.parseInt(args[0]);
-	int columns = Integer.parseInt(args[1]);
-	boolean print = args[2].equals("print");
-	demo2(rows,columns,print);
+  int rows = Integer.parseInt(args[0]);
+  int columns = Integer.parseInt(args[1]);
+  boolean print = args[2].equals("print");
+  demo2(rows,columns,print);
 }
 /**
 Constructs and returns a sampling view with a size of <tt>round(matrix.size() * fraction)</tt>.
@@ -567,27 +567,27 @@
 @see org.apache.mahout.jet.random.sampling.RandomSampler
 */
 public static DoubleMatrix1D viewSample(DoubleMatrix1D matrix, double fraction, RandomEngine randomGenerator) {
-	// check preconditions and allow for a little tolerance
-	double epsilon = 1e-09;
-	if (fraction < 0 - epsilon || fraction > 1 + epsilon) throw new IllegalArgumentException();
-	if (fraction < 0) fraction = 0;
-	if (fraction > 1) fraction = 1;
+  // check preconditions and allow for a little tolerance
+  double epsilon = 1e-09;
+  if (fraction < 0 - epsilon || fraction > 1 + epsilon) throw new IllegalArgumentException();
+  if (fraction < 0) fraction = 0;
+  if (fraction > 1) fraction = 1;
 
-	// random generator seeded with current time
-	if (randomGenerator==null) randomGenerator = new org.apache.mahout.jet.random.engine.MersenneTwister((int) System.currentTimeMillis());
+  // random generator seeded with current time
+  if (randomGenerator==null) randomGenerator = new org.apache.mahout.jet.random.engine.MersenneTwister((int) System.currentTimeMillis());
 
-	int ncols = (int) Math.round(matrix.size() * fraction);
-	int max = ncols;
-	long[] selected = new long[max]; // sampler works on long's, not int's
+  int ncols = (int) Math.round(matrix.size() * fraction);
+  int max = ncols;
+  long[] selected = new long[max]; // sampler works on long's, not int's
 
-	// sample 
-	int n = ncols;
-	int N = matrix.size();
-	org.apache.mahout.jet.random.sampling.RandomSampler.sample(n,N,n,0,selected,0,randomGenerator);
-	int[] selectedCols = new int[n];
-	for (int i=0; i<n; i++) selectedCols[i] = (int) selected[i];
+  // sample 
+  int n = ncols;
+  int N = matrix.size();
+  org.apache.mahout.jet.random.sampling.RandomSampler.sample(n,N,n,0,selected,0,randomGenerator);
+  int[] selectedCols = new int[n];
+  for (int i=0; i<n; i++) selectedCols[i] = (int) selected[i];
 
-	return matrix.viewSelection(selectedCols);
+  return matrix.viewSelection(selectedCols);
 }
 /**
 Constructs and returns a sampling view with <tt>round(matrix.rows() * rowFraction)</tt> rows and <tt>round(matrix.columns() * columnFraction)</tt> columns.
@@ -596,53 +596,53 @@
 Examples: 
 <table border="1" cellspacing="0">
   <tr valign="top" align="center"> 
-	<td> 
-	  <div align="left"><tt>matrix</tt></div>
-	</td>
-	<td> 
-	  <div align="left"><tt>rowFraction=0.2<br>
-		columnFraction=0.2</tt></div>
-	</td>
-	<td> 
-	  <div align="left"><tt>rowFraction=0.2<br>
-		columnFraction=1.0 </tt></div>
-	</td>
-	<td> 
-	  <div align="left"><tt>rowFraction=1.0<br>
-		columnFraction=0.2 </tt></div>
-	</td>
+  <td> 
+    <div align="left"><tt>matrix</tt></div>
+  </td>
+  <td> 
+    <div align="left"><tt>rowFraction=0.2<br>
+    columnFraction=0.2</tt></div>
+  </td>
+  <td> 
+    <div align="left"><tt>rowFraction=0.2<br>
+    columnFraction=1.0 </tt></div>
+  </td>
+  <td> 
+    <div align="left"><tt>rowFraction=1.0<br>
+    columnFraction=0.2 </tt></div>
+  </td>
   </tr>
   <tr valign="top"> 
-	<td><tt> 10&nbsp;x&nbsp;10&nbsp;matrix<br>
-	  &nbsp;1&nbsp;&nbsp;2&nbsp;&nbsp;3&nbsp;&nbsp;4&nbsp;&nbsp;5&nbsp;&nbsp;6&nbsp;&nbsp;7&nbsp;&nbsp;8&nbsp;&nbsp;9&nbsp;&nbsp;10<br>
-	  11&nbsp;12&nbsp;13&nbsp;14&nbsp;15&nbsp;16&nbsp;17&nbsp;18&nbsp;19&nbsp;&nbsp;20<br>
-	  21&nbsp;22&nbsp;23&nbsp;24&nbsp;25&nbsp;26&nbsp;27&nbsp;28&nbsp;29&nbsp;&nbsp;30<br>
-	  31&nbsp;32&nbsp;33&nbsp;34&nbsp;35&nbsp;36&nbsp;37&nbsp;38&nbsp;39&nbsp;&nbsp;40<br>
-	  41&nbsp;42&nbsp;43&nbsp;44&nbsp;45&nbsp;46&nbsp;47&nbsp;48&nbsp;49&nbsp;&nbsp;50<br>
-	  51&nbsp;52&nbsp;53&nbsp;54&nbsp;55&nbsp;56&nbsp;57&nbsp;58&nbsp;59&nbsp;&nbsp;60<br>
-	  61&nbsp;62&nbsp;63&nbsp;64&nbsp;65&nbsp;66&nbsp;67&nbsp;68&nbsp;69&nbsp;&nbsp;70<br>
-	  71&nbsp;72&nbsp;73&nbsp;74&nbsp;75&nbsp;76&nbsp;77&nbsp;78&nbsp;79&nbsp;&nbsp;80<br>
-	  81&nbsp;82&nbsp;83&nbsp;84&nbsp;85&nbsp;86&nbsp;87&nbsp;88&nbsp;89&nbsp;&nbsp;90<br>
-	  91&nbsp;92&nbsp;93&nbsp;94&nbsp;95&nbsp;96&nbsp;97&nbsp;98&nbsp;99&nbsp;100 
-	  </tt> </td>
-	<td><tt> 2&nbsp;x&nbsp;2&nbsp;matrix<br>
-	  43&nbsp;50<br>
-	  53&nbsp;60 </tt></td>
-	<td><tt> 2&nbsp;x&nbsp;10&nbsp;matrix<br>
-	  41&nbsp;42&nbsp;43&nbsp;44&nbsp;45&nbsp;46&nbsp;47&nbsp;48&nbsp;49&nbsp;&nbsp;50<br>
-	  91&nbsp;92&nbsp;93&nbsp;94&nbsp;95&nbsp;96&nbsp;97&nbsp;98&nbsp;99&nbsp;100 
-	  </tt> </td>
-	<td><tt> 10&nbsp;x&nbsp;2&nbsp;matrix<br>
-	  &nbsp;4&nbsp;&nbsp;8<br>
-	  14&nbsp;18<br>
-	  24&nbsp;28<br>
-	  34&nbsp;38<br>
-	  44&nbsp;48<br>
-	  54&nbsp;58<br>
-	  64&nbsp;68<br>
-	  74&nbsp;78<br>
-	  84&nbsp;88<br>
-	  94&nbsp;98 </tt> </td>
+  <td><tt> 10&nbsp;x&nbsp;10&nbsp;matrix<br>
+    &nbsp;1&nbsp;&nbsp;2&nbsp;&nbsp;3&nbsp;&nbsp;4&nbsp;&nbsp;5&nbsp;&nbsp;6&nbsp;&nbsp;7&nbsp;&nbsp;8&nbsp;&nbsp;9&nbsp;&nbsp;10<br>
+    11&nbsp;12&nbsp;13&nbsp;14&nbsp;15&nbsp;16&nbsp;17&nbsp;18&nbsp;19&nbsp;&nbsp;20<br>
+    21&nbsp;22&nbsp;23&nbsp;24&nbsp;25&nbsp;26&nbsp;27&nbsp;28&nbsp;29&nbsp;&nbsp;30<br>
+    31&nbsp;32&nbsp;33&nbsp;34&nbsp;35&nbsp;36&nbsp;37&nbsp;38&nbsp;39&nbsp;&nbsp;40<br>
+    41&nbsp;42&nbsp;43&nbsp;44&nbsp;45&nbsp;46&nbsp;47&nbsp;48&nbsp;49&nbsp;&nbsp;50<br>
+    51&nbsp;52&nbsp;53&nbsp;54&nbsp;55&nbsp;56&nbsp;57&nbsp;58&nbsp;59&nbsp;&nbsp;60<br>
+    61&nbsp;62&nbsp;63&nbsp;64&nbsp;65&nbsp;66&nbsp;67&nbsp;68&nbsp;69&nbsp;&nbsp;70<br>
+    71&nbsp;72&nbsp;73&nbsp;74&nbsp;75&nbsp;76&nbsp;77&nbsp;78&nbsp;79&nbsp;&nbsp;80<br>
+    81&nbsp;82&nbsp;83&nbsp;84&nbsp;85&nbsp;86&nbsp;87&nbsp;88&nbsp;89&nbsp;&nbsp;90<br>
+    91&nbsp;92&nbsp;93&nbsp;94&nbsp;95&nbsp;96&nbsp;97&nbsp;98&nbsp;99&nbsp;100 
+    </tt> </td>
+  <td><tt> 2&nbsp;x&nbsp;2&nbsp;matrix<br>
+    43&nbsp;50<br>
+    53&nbsp;60 </tt></td>
+  <td><tt> 2&nbsp;x&nbsp;10&nbsp;matrix<br>
+    41&nbsp;42&nbsp;43&nbsp;44&nbsp;45&nbsp;46&nbsp;47&nbsp;48&nbsp;49&nbsp;&nbsp;50<br>
+    91&nbsp;92&nbsp;93&nbsp;94&nbsp;95&nbsp;96&nbsp;97&nbsp;98&nbsp;99&nbsp;100 
+    </tt> </td>
+  <td><tt> 10&nbsp;x&nbsp;2&nbsp;matrix<br>
+    &nbsp;4&nbsp;&nbsp;8<br>
+    14&nbsp;18<br>
+    24&nbsp;28<br>
+    34&nbsp;38<br>
+    44&nbsp;48<br>
+    54&nbsp;58<br>
+    64&nbsp;68<br>
+    74&nbsp;78<br>
+    84&nbsp;88<br>
+    94&nbsp;98 </tt> </td>
   </tr>
 </table> 
 @param matrix any matrix.
@@ -654,39 +654,39 @@
 @see org.apache.mahout.jet.random.sampling.RandomSampler
 */
 public static DoubleMatrix2D viewSample(DoubleMatrix2D matrix, double rowFraction, double columnFraction, RandomEngine randomGenerator) {
-	// check preconditions and allow for a little tolerance
-	double epsilon = 1e-09;
-	if (rowFraction < 0 - epsilon || rowFraction > 1 + epsilon) throw new IllegalArgumentException();
-	if (rowFraction < 0) rowFraction = 0;
-	if (rowFraction > 1) rowFraction = 1;
+  // check preconditions and allow for a little tolerance
+  double epsilon = 1e-09;
+  if (rowFraction < 0 - epsilon || rowFraction > 1 + epsilon) throw new IllegalArgumentException();
+  if (rowFraction < 0) rowFraction = 0;
+  if (rowFraction > 1) rowFraction = 1;
 
-	if (columnFraction < 0 - epsilon || columnFraction > 1 + epsilon) throw new IllegalArgumentException();
-	if (columnFraction < 0) columnFraction = 0;
-	if (columnFraction > 1) columnFraction = 1;
+  if (columnFraction < 0 - epsilon || columnFraction > 1 + epsilon) throw new IllegalArgumentException();
+  if (columnFraction < 0) columnFraction = 0;
+  if (columnFraction > 1) columnFraction = 1;
 
-	// random generator seeded with current time
-	if (randomGenerator==null) randomGenerator = new org.apache.mahout.jet.random.engine.MersenneTwister((int) System.currentTimeMillis());
+  // random generator seeded with current time
+  if (randomGenerator==null) randomGenerator = new org.apache.mahout.jet.random.engine.MersenneTwister((int) System.currentTimeMillis());
 
-	int nrows = (int) Math.round(matrix.rows() * rowFraction);
-	int ncols = (int) Math.round(matrix.columns() * columnFraction);
-	int max = Math.max(nrows,ncols);
-	long[] selected = new long[max]; // sampler works on long's, not int's
+  int nrows = (int) Math.round(matrix.rows() * rowFraction);
+  int ncols = (int) Math.round(matrix.columns() * columnFraction);
+  int max = Math.max(nrows,ncols);
+  long[] selected = new long[max]; // sampler works on long's, not int's
 
-	// sample rows
-	int n = nrows;
-	int N = matrix.rows();
-	org.apache.mahout.jet.random.sampling.RandomSampler.sample(n,N,n,0,selected,0,randomGenerator);
-	int[] selectedRows = new int[n];
-	for (int i=0; i<n; i++) selectedRows[i] = (int) selected[i];
+  // sample rows
+  int n = nrows;
+  int N = matrix.rows();
+  org.apache.mahout.jet.random.sampling.RandomSampler.sample(n,N,n,0,selected,0,randomGenerator);
+  int[] selectedRows = new int[n];
+  for (int i=0; i<n; i++) selectedRows[i] = (int) selected[i];
 
-	// sample columns
-	n = ncols;
-	N = matrix.columns();
-	org.apache.mahout.jet.random.sampling.RandomSampler.sample(n,N,n,0,selected,0,randomGenerator);
-	int[] selectedCols = new int[n];
-	for (int i=0; i<n; i++) selectedCols[i] = (int) selected[i];
+  // sample columns
+  n = ncols;
+  N = matrix.columns();
+  org.apache.mahout.jet.random.sampling.RandomSampler.sample(n,N,n,0,selected,0,randomGenerator);
+  int[] selectedCols = new int[n];
+  for (int i=0; i<n; i++) selectedCols[i] = (int) selected[i];
 
-	return matrix.viewSelection(selectedRows, selectedCols);
+  return matrix.viewSelection(selectedRows, selectedCols);
 }
 /**
 Constructs and returns a sampling view with <tt>round(matrix.slices() * sliceFraction)</tt> slices and <tt>round(matrix.rows() * rowFraction)</tt> rows and <tt>round(matrix.columns() * columnFraction)</tt> columns.
@@ -702,51 +702,51 @@
 @see org.apache.mahout.jet.random.sampling.RandomSampler
 */
 public static DoubleMatrix3D viewSample(DoubleMatrix3D matrix, double sliceFraction, double rowFraction, double columnFraction, RandomEngine randomGenerator) {
-	// check preconditions and allow for a little tolerance
-	double epsilon = 1e-09;
-	if (sliceFraction < 0 - epsilon || sliceFraction > 1 + epsilon) throw new IllegalArgumentException();
-	if (sliceFraction < 0) sliceFraction = 0;
-	if (sliceFraction > 1) sliceFraction = 1;
+  // check preconditions and allow for a little tolerance
+  double epsilon = 1e-09;
+  if (sliceFraction < 0 - epsilon || sliceFraction > 1 + epsilon) throw new IllegalArgumentException();
+  if (sliceFraction < 0) sliceFraction = 0;
+  if (sliceFraction > 1) sliceFraction = 1;
 
-	if (rowFraction < 0 - epsilon || rowFraction > 1 + epsilon) throw new IllegalArgumentException();
-	if (rowFraction < 0) rowFraction = 0;
-	if (rowFraction > 1) rowFraction = 1;
+  if (rowFraction < 0 - epsilon || rowFraction > 1 + epsilon) throw new IllegalArgumentException();
+  if (rowFraction < 0) rowFraction = 0;
+  if (rowFraction > 1) rowFraction = 1;
 
-	if (columnFraction < 0 - epsilon || columnFraction > 1 + epsilon) throw new IllegalArgumentException();
-	if (columnFraction < 0) columnFraction = 0;
-	if (columnFraction > 1) columnFraction = 1;
+  if (columnFraction < 0 - epsilon || columnFraction > 1 + epsilon) throw new IllegalArgumentException();
+  if (columnFraction < 0) columnFraction = 0;
+  if (columnFraction > 1) columnFraction = 1;
 
-	// random generator seeded with current time
-	if (randomGenerator==null) randomGenerator = new org.apache.mahout.jet.random.engine.MersenneTwister((int) System.currentTimeMillis());
+  // random generator seeded with current time
+  if (randomGenerator==null) randomGenerator = new org.apache.mahout.jet.random.engine.MersenneTwister((int) System.currentTimeMillis());
 
-	int nslices = (int) Math.round(matrix.slices() * sliceFraction);
-	int nrows = (int) Math.round(matrix.rows() * rowFraction);
-	int ncols = (int) Math.round(matrix.columns() * columnFraction);
-	int max = Math.max(nslices,Math.max(nrows,ncols));
-	long[] selected = new long[max]; // sampler works on long's, not int's
+  int nslices = (int) Math.round(matrix.slices() * sliceFraction);
+  int nrows = (int) Math.round(matrix.rows() * rowFraction);
+  int ncols = (int) Math.round(matrix.columns() * columnFraction);
+  int max = Math.max(nslices,Math.max(nrows,ncols));
+  long[] selected = new long[max]; // sampler works on long's, not int's
 
-	// sample slices
-	int n = nslices;
-	int N = matrix.slices();
-	org.apache.mahout.jet.random.sampling.RandomSampler.sample(n,N,n,0,selected,0,randomGenerator);
-	int[] selectedSlices = new int[n];
-	for (int i=0; i<n; i++) selectedSlices[i] = (int) selected[i];
+  // sample slices
+  int n = nslices;
+  int N = matrix.slices();
+  org.apache.mahout.jet.random.sampling.RandomSampler.sample(n,N,n,0,selected,0,randomGenerator);
+  int[] selectedSlices = new int[n];
+  for (int i=0; i<n; i++) selectedSlices[i] = (int) selected[i];
 
-	// sample rows
-	n = nrows;
-	N = matrix.rows();
-	org.apache.mahout.jet.random.sampling.RandomSampler.sample(n,N,n,0,selected,0,randomGenerator);
-	int[] selectedRows = new int[n];
-	for (int i=0; i<n; i++) selectedRows[i] = (int) selected[i];
+  // sample rows
+  n = nrows;
+  N = matrix.rows();
+  org.apache.mahout.jet.random.sampling.RandomSampler.sample(n,N,n,0,selected,0,randomGenerator);
+  int[] selectedRows = new int[n];
+  for (int i=0; i<n; i++) selectedRows[i] = (int) selected[i];
 
-	// sample columns
-	n = ncols;
-	N = matrix.columns();
-	org.apache.mahout.jet.random.sampling.RandomSampler.sample(n,N,n,0,selected,0,randomGenerator);
-	int[] selectedCols = new int[n];
-	for (int i=0; i<n; i++) selectedCols[i] = (int) selected[i];
+  // sample columns
+  n = ncols;
+  N = matrix.columns();
+  org.apache.mahout.jet.random.sampling.RandomSampler.sample(n,N,n,0,selected,0,randomGenerator);
+  int[] selectedCols = new int[n];
+  for (int i=0; i<n; i++) selectedCols[i] = (int) selected[i];
 
-	return matrix.viewSelection(selectedSlices,selectedRows, selectedCols);
+  return matrix.viewSelection(selectedSlices,selectedRows, selectedCols);
 }
 /**
  * Constructs and returns the distance matrix of the given matrix.
@@ -760,46 +760,46 @@
  * @return the distance matrix (<tt>n x n, n=matrix.columns</tt>).
  */
 private static DoubleMatrix2D xdistanceOld(DoubleMatrix2D matrix, int norm) {
-	/*
-	int rows = matrix.rows();
-	int columns = matrix.columns();
-	DoubleMatrix2D distance = new org.apache.mahout.matrix.matrix.impl.DenseDoubleMatrix2D(columns,columns);
+  /*
+  int rows = matrix.rows();
+  int columns = matrix.columns();
+  DoubleMatrix2D distance = new org.apache.mahout.matrix.matrix.impl.DenseDoubleMatrix2D(columns,columns);
 
-	// cache views
-	DoubleMatrix1D[] cols = new DoubleMatrix1D[columns];
-	for (int i=columns; --i >= 0; ) {
-		cols[i] = matrix.viewColumn(i);
-	}
+  // cache views
+  DoubleMatrix1D[] cols = new DoubleMatrix1D[columns];
+  for (int i=columns; --i >= 0; ) {
+    cols[i] = matrix.viewColumn(i);
+  }
 
-	// setup distance function
-	org.apache.mahout.jet.math.Functions F = org.apache.mahout.jet.math.Functions.functions;
-	DoubleDoubleFunction function = null;
-	//DoubleDoubleFunction function2 = null;
-	if (norm==EUCLID) function = F.chain(F.square,F.minus);
-	else if (norm==BRAY_CURTIS) function = F.chain(F.abs,F.minus);
-	else if (norm==CANBERRA) function = new DoubleDoubleFunction() {
-		public final double apply(double a, double b) {	return Math.abs(a-b) / Math.abs(a+b);}
-	};
-	else if (norm==MAXIMUM) function = F.chain(F.abs,F.minus);
-	else if (norm==MANHATTAN) function = F.chain(F.abs,F.minus);
-	else throw new IllegalArgumentException("Unknown norm");
+  // setup distance function
+  org.apache.mahout.jet.math.Functions F = org.apache.mahout.jet.math.Functions.functions;
+  DoubleDoubleFunction function = null;
+  //DoubleDoubleFunction function2 = null;
+  if (norm==EUCLID) function = F.chain(F.square,F.minus);
+  else if (norm==BRAY_CURTIS) function = F.chain(F.abs,F.minus);
+  else if (norm==CANBERRA) function = new DoubleDoubleFunction() {
+    public final double apply(double a, double b) {  return Math.abs(a-b) / Math.abs(a+b);}
+  };
+  else if (norm==MAXIMUM) function = F.chain(F.abs,F.minus);
+  else if (norm==MANHATTAN) function = F.chain(F.abs,F.minus);
+  else throw new IllegalArgumentException("Unknown norm");
 
-	// work out all permutations
-	for (int i=columns; --i >= 0; ) {
-		for (int j=i; --j >= 0; ) {
-			double d = 0;
-			if (norm==EUCLID) d = Math.sqrt(cols[i].aggregate(cols[j], F.plus, function));
-			else if (norm==BRAY_CURTIS) d = cols[i].aggregate(cols[j], F.plus, function) / cols[i].aggregate(cols[j], F.plus, F.plus);
-			else if (norm==CANBERRA) d = cols[i].aggregate(cols[j], F.plus, function);
-			else if (norm==MAXIMUM) d = cols[i].aggregate(cols[j], F.max, function);
-			else if (norm==MANHATTAN) d = cols[i].aggregate(cols[j], F.plus, function);
-			distance.setQuick(i,j,d);
-			distance.setQuick(j,i,d); // symmetric
-		}
-	}
-	return distance;
-	*/
-	return null;
+  // work out all permutations
+  for (int i=columns; --i >= 0; ) {
+    for (int j=i; --j >= 0; ) {
+      double d = 0;
+      if (norm==EUCLID) d = Math.sqrt(cols[i].aggregate(cols[j], F.plus, function));
+      else if (norm==BRAY_CURTIS) d = cols[i].aggregate(cols[j], F.plus, function) / cols[i].aggregate(cols[j], F.plus, F.plus);
+      else if (norm==CANBERRA) d = cols[i].aggregate(cols[j], F.plus, function);
+      else if (norm==MAXIMUM) d = cols[i].aggregate(cols[j], F.max, function);
+      else if (norm==MANHATTAN) d = cols[i].aggregate(cols[j], F.plus, function);
+      distance.setQuick(i,j,d);
+      distance.setQuick(j,i,d); // symmetric
+    }
+  }
+  return distance;
+  */
+  return null;
 }
 /**
  * Constructs and returns the distance matrix of the given matrix.
@@ -813,44 +813,44 @@
  * @return the distance matrix (<tt>n x n, n=matrix.columns</tt>).
  */
 private static DoubleMatrix2D xdistanceOld2(DoubleMatrix2D matrix, int norm) {
-	/*
-	// setup distance function
-	final org.apache.mahout.jet.math.Functions F = org.apache.mahout.jet.math.Functions.functions;
-	VectorVectorFunction function;
-	if (norm==EUCLID) function = new VectorVectorFunction() {
-		public final double apply(DoubleMatrix1D a, DoubleMatrix1D b) {
-			return Math.sqrt(a.aggregate(b, F.plus, F.chain(F.square,F.minus)));
-		}
-	};
-	else if (norm==BRAY_CURTIS) function = new VectorVectorFunction() {
-		public final double apply(DoubleMatrix1D a, DoubleMatrix1D b) {	
-			return a.aggregate(b, F.plus, F.chain(F.abs,F.minus)) / a.aggregate(b, F.plus, F.plus);
-		}
-	};
-	else if (norm==CANBERRA) function = new VectorVectorFunction() {
-		DoubleDoubleFunction fun = new DoubleDoubleFunction() {
-			public final double apply(double a, double b) {
-				return Math.abs(a-b) / Math.abs(a+b);
-			}
-		};
-		public final double apply(DoubleMatrix1D a, DoubleMatrix1D b) {	
-			return a.aggregate(b, F.plus, fun);
-		}
-	};
-	else if (norm==MAXIMUM) function = new VectorVectorFunction() {
-		public final double apply(DoubleMatrix1D a, DoubleMatrix1D b) {	
-			return a.aggregate(b, F.max, F.chain(F.abs,F.minus));
-		}
-	};
-	else if (norm==MANHATTAN) function = new VectorVectorFunction() {
-		public final double apply(DoubleMatrix1D a, DoubleMatrix1D b) {	
-			return a.aggregate(b, F.plus, F.chain(F.abs,F.minus));
-		}
-	};
-	else throw new IllegalArgumentException("Unknown norm");
+  /*
+  // setup distance function
+  final org.apache.mahout.jet.math.Functions F = org.apache.mahout.jet.math.Functions.functions;
+  VectorVectorFunction function;
+  if (norm==EUCLID) function = new VectorVectorFunction() {
+    public final double apply(DoubleMatrix1D a, DoubleMatrix1D b) {
+      return Math.sqrt(a.aggregate(b, F.plus, F.chain(F.square,F.minus)));
+    }
+  };
+  else if (norm==BRAY_CURTIS) function = new VectorVectorFunction() {
+    public final double apply(DoubleMatrix1D a, DoubleMatrix1D b) {  
+      return a.aggregate(b, F.plus, F.chain(F.abs,F.minus)) / a.aggregate(b, F.plus, F.plus);
+    }
+  };
+  else if (norm==CANBERRA) function = new VectorVectorFunction() {
+    DoubleDoubleFunction fun = new DoubleDoubleFunction() {
+      public final double apply(double a, double b) {
+        return Math.abs(a-b) / Math.abs(a+b);
+      }
+    };
+    public final double apply(DoubleMatrix1D a, DoubleMatrix1D b) {  
+      return a.aggregate(b, F.plus, fun);
+    }
+  };
+  else if (norm==MAXIMUM) function = new VectorVectorFunction() {
+    public final double apply(DoubleMatrix1D a, DoubleMatrix1D b) {  
+      return a.aggregate(b, F.max, F.chain(F.abs,F.minus));
+    }
+  };
+  else if (norm==MANHATTAN) function = new VectorVectorFunction() {
+    public final double apply(DoubleMatrix1D a, DoubleMatrix1D b) {  
+      return a.aggregate(b, F.plus, F.chain(F.abs,F.minus));
+    }
+  };
+  else throw new IllegalArgumentException("Unknown norm");
 
-	return distance(matrix,function);
-	*/
-	return null;
+  return distance(matrix,function);
+  */
+  return null;
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/doublealgo/Transform.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/doublealgo/Transform.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/doublealgo/Transform.java	(working copy)
@@ -46,24 +46,24 @@
  */
 @Deprecated
 public class Transform extends org.apache.mahout.matrix.PersistentObject {
-	/**
-	 * Little trick to allow for "aliasing", that is, renaming this class.
-	 * Normally you would write
-	 * <pre>
-	 * Transform.mult(myMatrix,2);
-	 * Transform.plus(myMatrix,5);
-	 * </pre>
-	 * Since this class has only static methods, but no instance methods
-	 * you can also shorten the name "DoubleTransform" to a name that better suits you, for example "Trans".
-	 * <pre>
-	 * Transform T = Transform.transform; // kind of "alias"
-	 * T.mult(myMatrix,2);
-	 * T.plus(myMatrix,5);
-	 * </pre>
-	 */
-	public static final Transform transform = new Transform();
+  /**
+   * Little trick to allow for "aliasing", that is, renaming this class.
+   * Normally you would write
+   * <pre>
+   * Transform.mult(myMatrix,2);
+   * Transform.plus(myMatrix,5);
+   * </pre>
+   * Since this class has only static methods, but no instance methods
+   * you can also shorten the name "DoubleTransform" to a name that better suits you, for example "Trans".
+   * <pre>
+   * Transform T = Transform.transform; // kind of "alias"
+   * T.mult(myMatrix,2);
+   * T.plus(myMatrix,5);
+   * </pre>
+   */
+  public static final Transform transform = new Transform();
 
-	private static final org.apache.mahout.jet.math.Functions F = org.apache.mahout.jet.math.Functions.functions; // alias
+  private static final org.apache.mahout.jet.math.Functions F = org.apache.mahout.jet.math.Functions.functions; // alias
 
 /**
  * Makes this class non instantiable, but still let's others inherit from it.
@@ -75,7 +75,7 @@
  * @return <tt>A</tt> (for convenience only).
  */
 public static DoubleMatrix1D abs(DoubleMatrix1D A) {
-	return A.assign(F.abs);
+  return A.assign(F.abs);
 }
 /**
  * <tt>A[row,col] = Math.abs(A[row,col])</tt>.
@@ -83,7 +83,7 @@
  * @return <tt>A</tt> (for convenience only).
  */
 public static DoubleMatrix2D abs(DoubleMatrix2D A) {
-	return A.assign(F.abs);
+  return A.assign(F.abs);
 }
 /**
  * <tt>A = A / s <=> A[i] = A[i] / s</tt>.
@@ -92,7 +92,7 @@
  * @return <tt>A</tt> (for convenience only).
  */
 public static DoubleMatrix1D div(DoubleMatrix1D A, double s) {
-	return A.assign(F.div(s));
+  return A.assign(F.div(s));
 }
 /**
  * <tt>A = A / B <=> A[i] = A[i] / B[i]</tt>.
@@ -101,7 +101,7 @@
  * @return <tt>A</tt> (for convenience only).
  */
 public static DoubleMatrix1D div(DoubleMatrix1D A, DoubleMatrix1D B) {
-	return A.assign(B,F.div);
+  return A.assign(B,F.div);
 }
 /**
  * <tt>A = A / s <=> A[row,col] = A[row,col] / s</tt>.
@@ -110,7 +110,7 @@
  * @return <tt>A</tt> (for convenience only).
  */
 public static DoubleMatrix2D div(DoubleMatrix2D A, double s) {
-	return A.assign(F.div(s));
+  return A.assign(F.div(s));
 }
 /**
  * <tt>A = A / B <=> A[row,col] = A[row,col] / B[row,col]</tt>.
@@ -119,7 +119,7 @@
  * @return <tt>A</tt> (for convenience only).
  */
 public static DoubleMatrix2D div(DoubleMatrix2D A, DoubleMatrix2D B) {
-	return A.assign(B,F.div);
+  return A.assign(B,F.div);
 }
 /**
  * <tt>A[row,col] = A[row,col] == s ? 1 : 0</tt>; ignores tolerance.
@@ -128,7 +128,7 @@
  * @return <tt>A</tt> (for convenience only).
  */
 public static DoubleMatrix2D equals(DoubleMatrix2D A, double s) {
-	return A.assign(F.equals(s));
+  return A.assign(F.equals(s));
 }
 /**
  * <tt>A[row,col] = A[row,col] == B[row,col] ? 1 : 0</tt>; ignores tolerance.
@@ -137,7 +137,7 @@
  * @return <tt>A</tt> (for convenience only).
  */
 public static DoubleMatrix2D equals(DoubleMatrix2D A, DoubleMatrix2D B) {
-	return A.assign(B,F.equals);
+  return A.assign(B,F.equals);
 }
 /**
  * <tt>A[row,col] = A[row,col] > s ? 1 : 0</tt>.
@@ -146,7 +146,7 @@
  * @return <tt>A</tt> (for convenience only).
  */
 public static DoubleMatrix2D greater(DoubleMatrix2D A, double s) {
-	return A.assign(F.greater(s));
+  return A.assign(F.greater(s));
 }
 /**
  * <tt>A[row,col] = A[row,col] > B[row,col] ? 1 : 0</tt>.
@@ -155,7 +155,7 @@
  * @return <tt>A</tt> (for convenience only).
  */
 public static DoubleMatrix2D greater(DoubleMatrix2D A, DoubleMatrix2D B) {
-	return A.assign(B,F.greater);
+  return A.assign(B,F.greater);
 }
 /**
  * <tt>A[row,col] = A[row,col] < s ? 1 : 0</tt>.
@@ -164,7 +164,7 @@
  * @return <tt>A</tt> (for convenience only).
  */
 public static DoubleMatrix2D less(DoubleMatrix2D A, double s) {
-	return A.assign(F.less(s));
+  return A.assign(F.less(s));
 }
 /**
  * <tt>A[row,col] = A[row,col] < B[row,col] ? 1 : 0</tt>.
@@ -173,7 +173,7 @@
  * @return <tt>A</tt> (for convenience only).
  */
 public static DoubleMatrix2D less(DoubleMatrix2D A, DoubleMatrix2D B) {
-	return A.assign(B,F.less);
+  return A.assign(B,F.less);
 }
 /**
  * <tt>A = A - s <=> A[i] = A[i] - s</tt>.
@@ -182,7 +182,7 @@
  * @return <tt>A</tt> (for convenience only).
  */
 public static DoubleMatrix1D minus(DoubleMatrix1D A, double s) {
-	return A.assign(F.minus(s));
+  return A.assign(F.minus(s));
 }
 /**
  * <tt>A = A - B <=> A[i] = A[i] - B[i]</tt>.
@@ -191,7 +191,7 @@
  * @return <tt>A</tt> (for convenience only).
  */
 public static DoubleMatrix1D minus(DoubleMatrix1D A, DoubleMatrix1D B) {
-	return A.assign(B,F.minus);
+  return A.assign(B,F.minus);
 }
 /**
  * <tt>A = A - s <=> A[row,col] = A[row,col] - s</tt>.
@@ -200,7 +200,7 @@
  * @return <tt>A</tt> (for convenience only).
  */
 public static DoubleMatrix2D minus(DoubleMatrix2D A, double s) {
-	return A.assign(F.minus(s));
+  return A.assign(F.minus(s));
 }
 /**
  * <tt>A = A - B <=> A[row,col] = A[row,col] - B[row,col]</tt>.
@@ -209,7 +209,7 @@
  * @return <tt>A</tt> (for convenience only).
  */
 public static DoubleMatrix2D minus(DoubleMatrix2D A, DoubleMatrix2D B) {
-	return A.assign(B,F.minus);
+  return A.assign(B,F.minus);
 }
 /**
  * <tt>A = A - B*s <=> A[i] = A[i] - B[i]*s</tt>.
@@ -219,7 +219,7 @@
  * @return <tt>A</tt> (for convenience only).
  */
 public static DoubleMatrix1D minusMult(DoubleMatrix1D A, DoubleMatrix1D B, double s) {
-	return A.assign(B,F.minusMult(s));
+  return A.assign(B,F.minusMult(s));
 }
 /**
  * <tt>A = A - B*s <=> A[row,col] = A[row,col] - B[row,col]*s</tt>.
@@ -229,7 +229,7 @@
  * @return <tt>A</tt> (for convenience only).
  */
 public static DoubleMatrix2D minusMult(DoubleMatrix2D A, DoubleMatrix2D B, double s) {
-	return A.assign(B,F.minusMult(s));
+  return A.assign(B,F.minusMult(s));
 }
 /**
  * <tt>A = A * s <=> A[i] = A[i] * s</tt>.
@@ -238,7 +238,7 @@
  * @return <tt>A</tt> (for convenience only).
  */
 public static DoubleMatrix1D mult(DoubleMatrix1D A, double s) {
-	return A.assign(F.mult(s));
+  return A.assign(F.mult(s));
 }
 /**
  * <tt>A = A * B <=> A[i] = A[i] * B[i]</tt>.
@@ -247,7 +247,7 @@
  * @return <tt>A</tt> (for convenience only).
  */
 public static DoubleMatrix1D mult(DoubleMatrix1D A, DoubleMatrix1D B) {
-	return A.assign(B,F.mult);
+  return A.assign(B,F.mult);
 }
 /**
  * <tt>A = A * s <=> A[row,col] = A[row,col] * s</tt>.
@@ -256,7 +256,7 @@
  * @return <tt>A</tt> (for convenience only).
  */
 public static DoubleMatrix2D mult(DoubleMatrix2D A, double s) {
-	return A.assign(F.mult(s));
+  return A.assign(F.mult(s));
 }
 /**
  * <tt>A = A * B <=> A[row,col] = A[row,col] * B[row,col]</tt>.
@@ -265,21 +265,21 @@
  * @return <tt>A</tt> (for convenience only).
  */
 public static DoubleMatrix2D mult(DoubleMatrix2D A, DoubleMatrix2D B) {
-	return A.assign(B,F.mult);
+  return A.assign(B,F.mult);
 }
 /**
  * <tt>A = -A <=> A[i] = -A[i]</tt> for all cells.
  * @return <tt>A</tt> (for convenience only).
  */
 public static DoubleMatrix1D negate(DoubleMatrix1D A) {
-	return A.assign(F.mult(-1));
+  return A.assign(F.mult(-1));
 }
 /**
  * <tt>A = -A <=> A[row,col] = -A[row,col]</tt>.
  * @return <tt>A</tt> (for convenience only).
  */
 public static DoubleMatrix2D negate(DoubleMatrix2D A) {
-	return A.assign(F.mult(-1));
+  return A.assign(F.mult(-1));
 }
 /**
  * <tt>A = A + s <=> A[i] = A[i] + s</tt>.
@@ -288,7 +288,7 @@
  * @return <tt>A</tt> (for convenience only).
  */
 public static DoubleMatrix1D plus(DoubleMatrix1D A, double s) {
-	return A.assign(F.plus(s));
+  return A.assign(F.plus(s));
 }
 /**
  * <tt>A = A + B <=> A[i] = A[i] + B[i]</tt>.
@@ -297,7 +297,7 @@
  * @return <tt>A</tt> (for convenience only).
  */
 public static DoubleMatrix1D plus(DoubleMatrix1D A, DoubleMatrix1D B) {
-	return A.assign(B,F.plus);
+  return A.assign(B,F.plus);
 }
 /**
  * <tt>A = A + s <=> A[row,col] = A[row,col] + s</tt>.
@@ -306,7 +306,7 @@
  * @return <tt>A</tt> (for convenience only).
  */
 public static DoubleMatrix2D plus(DoubleMatrix2D A, double s) {
-	return A.assign(F.plus(s));
+  return A.assign(F.plus(s));
 }
 /**
  * <tt>A = A + B <=> A[row,col] = A[row,col] + B[row,col]</tt>.
@@ -315,7 +315,7 @@
  * @return <tt>A</tt> (for convenience only).
  */
 public static DoubleMatrix2D plus(DoubleMatrix2D A, DoubleMatrix2D B) {
-	return A.assign(B,F.plus);
+  return A.assign(B,F.plus);
 }
 /**
  * <tt>A = A + B*s<=> A[i] = A[i] + B[i]*s</tt>.
@@ -325,7 +325,7 @@
  * @return <tt>A</tt> (for convenience only).
  */
 public static DoubleMatrix1D plusMult(DoubleMatrix1D A, DoubleMatrix1D B, double s) {
-	return A.assign(B,F.plusMult(s));
+  return A.assign(B,F.plusMult(s));
 }
 /**
  * <tt>A = A + B*s <=> A[row,col] = A[row,col] + B[row,col]*s</tt>.
@@ -335,7 +335,7 @@
  * @return <tt>A</tt> (for convenience only).
  */
 public static DoubleMatrix2D plusMult(DoubleMatrix2D A, DoubleMatrix2D B, double s) {
-	return A.assign(B,F.plusMult(s));
+  return A.assign(B,F.plusMult(s));
 }
 /**
  * <tt>A = A<sup>s</sup> <=> A[i] = Math.pow(A[i], s)</tt>.
@@ -344,7 +344,7 @@
  * @return <tt>A</tt> (for convenience only).
  */
 public static DoubleMatrix1D pow(DoubleMatrix1D A, double s) {
-	return A.assign(F.pow(s));
+  return A.assign(F.pow(s));
 }
 /**
  * <tt>A = A<sup>B</sup> <=> A[i] = Math.pow(A[i], B[i])</tt>.
@@ -353,7 +353,7 @@
  * @return <tt>A</tt> (for convenience only).
  */
 public static DoubleMatrix1D pow(DoubleMatrix1D A, DoubleMatrix1D B) {
-	return A.assign(B,F.pow);
+  return A.assign(B,F.pow);
 }
 /**
  * <tt>A = A<sup>s</sup> <=> A[row,col] = Math.pow(A[row,col], s)</tt>.
@@ -362,7 +362,7 @@
  * @return <tt>A</tt> (for convenience only).
  */
 public static DoubleMatrix2D pow(DoubleMatrix2D A, double s) {
-	return A.assign(F.pow(s));
+  return A.assign(F.pow(s));
 }
 /**
  * <tt>A = A<sup>B</sup> <=> A[row,col] = Math.pow(A[row,col], B[row,col])</tt>.
@@ -371,6 +371,6 @@
  * @return <tt>A</tt> (for convenience only).
  */
 public static DoubleMatrix2D pow(DoubleMatrix2D A, DoubleMatrix2D B) {
-	return A.assign(B,F.pow);
+  return A.assign(B,F.pow);
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/doublealgo/DoubleMatrix1DComparator.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/doublealgo/DoubleMatrix1DComparator.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/doublealgo/DoubleMatrix1DComparator.java	(working copy)
@@ -20,8 +20,6 @@
  * order for the data structure to serialize successfully, the comparator (if
  * provided) must implement <tt>Serializable</tt>.<p>
  *
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 09/24/99
  * @see java.util.Comparator
  * @see org.apache.mahout.colt
  * @see org.apache.mahout.matrix.Sorting
@@ -51,8 +49,8 @@
  *
  * 
  * @return a negative integer, zero, or a positive integer as the
- * 	       first argument is less than, equal to, or greater than the
- *	       second. 
+ *          first argument is less than, equal to, or greater than the
+ *         second. 
  */
 int compare(DoubleMatrix1D o1, DoubleMatrix1D o2);
 /**
@@ -73,8 +71,8 @@
  *
  * @param   obj   the reference object with which to compare.
  * @return  <code>true</code> only if the specified object is also
- *		a comparator and it imposes the same ordering as this
- *		comparator.
+ *    a comparator and it imposes the same ordering as this
+ *    comparator.
  * @see     java.lang.Object#equals(java.lang.Object)
  * @see java.lang.Object#hashCode()
  */
Index: matrix/src/main/java/org/apache/mahout/matrix/matrix/doublealgo/DoubleMatrix2DComparator.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/matrix/doublealgo/DoubleMatrix2DComparator.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/matrix/doublealgo/DoubleMatrix2DComparator.java	(working copy)
@@ -20,8 +20,6 @@
  * order for the data structure to serialize successfully, the comparator (if
  * provided) must implement <tt>Serializable</tt>.<p>
  *
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 09/24/99
  * @see java.util.Comparator
  * @see org.apache.mahout.colt
  * @see org.apache.mahout.matrix.Sorting
@@ -51,8 +49,8 @@
  *
  * 
  * @return a negative integer, zero, or a positive integer as the
- * 	       first argument is less than, equal to, or greater than the
- *	       second. 
+ *          first argument is less than, equal to, or greater than the
+ *         second. 
  */
 int compare(DoubleMatrix2D o1, DoubleMatrix2D o2);
 /**
@@ -73,8 +71,8 @@
  *
  * @param   obj   the reference object with which to compare.
  * @return  <code>true</code> only if the specified object is also
- *		a comparator and it imposes the same ordering as this
- *		comparator.
+ *    a comparator and it imposes the same ordering as this
+ *    comparator.
  * @see     java.lang.Object#equals(java.lang.Object)
  * @see java.lang.Object#hashCode()
  */
Index: matrix/src/main/java/org/apache/mahout/matrix/Sorting.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/Sorting.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/Sorting.java	(working copy)
@@ -27,16 +27,14 @@
  * @see org.apache.mahout.matrix.matrix.doublealgo.Sorting
  * @see java.util.Arrays
  *
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 03-Jul-99
  */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
  */
 @Deprecated
 public class Sorting extends Object {
-	private static final int SMALL = 7;
-	private static final int MEDIUM = 40;
+  private static final int SMALL = 7;
+  private static final int MEDIUM = 40;
 /**
  * Makes this class non instantiable, but still let's others inherit from it.
  */
@@ -55,25 +53,25 @@
  * @param from the leftmost search position, inclusive.
  * @param to the rightmost search position, inclusive.
  * @return index of the search key, if it is contained in the list;
- *	       otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
- *	       point</i> is defined as the the point at which the value would
- * 	       be inserted into the list: the index of the first
- *	       element greater than the key, or <tt>list.length</tt>, if all
- *	       elements in the list are less than the specified key.  Note
- *	       that this guarantees that the return value will be &gt;= 0 if
- *	       and only if the key is found.
+ *         otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
+ *         point</i> is defined as the the point at which the value would
+ *          be inserted into the list: the index of the first
+ *         element greater than the key, or <tt>list.length</tt>, if all
+ *         elements in the list are less than the specified key.  Note
+ *         that this guarantees that the return value will be &gt;= 0 if
+ *         and only if the key is found.
  * @see java.util.Arrays
  */
 public static int binarySearchFromTo(byte[] list, byte key, int from, int to) {
-	byte midVal;
-	while (from <= to) {
-		int mid = (from + to) / 2;
-		midVal = list[mid];
-		if (midVal < key) from = mid + 1;
-		else if (midVal > key) to = mid - 1;
-		else return mid; // key found
-	}
-	return -(from + 1);  // key not found.
+  byte midVal;
+  while (from <= to) {
+    int mid = (from + to) / 2;
+    midVal = list[mid];
+    if (midVal < key) from = mid + 1;
+    else if (midVal > key) to = mid - 1;
+    else return mid; // key found
+  }
+  return -(from + 1);  // key not found.
 }
 /**
  * Searches the list for the specified value using
@@ -89,25 +87,25 @@
  * @param from the leftmost search position, inclusive.
  * @param to the rightmost search position, inclusive.
  * @return index of the search key, if it is contained in the list;
- *	       otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
- *	       point</i> is defined as the the point at which the value would
- * 	       be inserted into the list: the index of the first
- *	       element greater than the key, or <tt>list.length</tt>, if all
- *	       elements in the list are less than the specified key.  Note
- *	       that this guarantees that the return value will be &gt;= 0 if
- *	       and only if the key is found.
+ *         otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
+ *         point</i> is defined as the the point at which the value would
+ *          be inserted into the list: the index of the first
+ *         element greater than the key, or <tt>list.length</tt>, if all
+ *         elements in the list are less than the specified key.  Note
+ *         that this guarantees that the return value will be &gt;= 0 if
+ *         and only if the key is found.
  * @see java.util.Arrays
  */
 public static int binarySearchFromTo(char[] list, char key, int from, int to) {
-	char midVal;
-	while (from <= to) {
-		int mid = (from + to) / 2;
-		midVal = list[mid];
-		if (midVal < key) from = mid + 1;
-		else if (midVal > key) to = mid - 1;
-		else return mid; // key found
-	}
-	return -(from + 1);  // key not found.
+  char midVal;
+  while (from <= to) {
+    int mid = (from + to) / 2;
+    midVal = list[mid];
+    if (midVal < key) from = mid + 1;
+    else if (midVal > key) to = mid - 1;
+    else return mid; // key found
+  }
+  return -(from + 1);  // key not found.
 }
 /**
  * Searches the list for the specified value using
@@ -123,25 +121,25 @@
  * @param from the leftmost search position, inclusive.
  * @param to the rightmost search position, inclusive.
  * @return index of the search key, if it is contained in the list;
- *	       otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
- *	       point</i> is defined as the the point at which the value would
- * 	       be inserted into the list: the index of the first
- *	       element greater than the key, or <tt>list.length</tt>, if all
- *	       elements in the list are less than the specified key.  Note
- *	       that this guarantees that the return value will be &gt;= 0 if
- *	       and only if the key is found.
+ *         otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
+ *         point</i> is defined as the the point at which the value would
+ *          be inserted into the list: the index of the first
+ *         element greater than the key, or <tt>list.length</tt>, if all
+ *         elements in the list are less than the specified key.  Note
+ *         that this guarantees that the return value will be &gt;= 0 if
+ *         and only if the key is found.
  * @see java.util.Arrays
  */
 public static int binarySearchFromTo(double[] list, double key, int from, int to) {
-	double midVal;
-	while (from <= to) {
-		int mid = (from + to) / 2;
-		midVal = list[mid];
-		if (midVal < key) from = mid + 1;
-		else if (midVal > key) to = mid - 1;
-		else return mid; // key found
-	}
-	return -(from + 1);  // key not found.
+  double midVal;
+  while (from <= to) {
+    int mid = (from + to) / 2;
+    midVal = list[mid];
+    if (midVal < key) from = mid + 1;
+    else if (midVal > key) to = mid - 1;
+    else return mid; // key found
+  }
+  return -(from + 1);  // key not found.
 }
 /**
  * Searches the list for the specified value using
@@ -157,25 +155,25 @@
  * @param from the leftmost search position, inclusive.
  * @param to the rightmost search position, inclusive.
  * @return index of the search key, if it is contained in the list;
- *	       otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
- *	       point</i> is defined as the the point at which the value would
- * 	       be inserted into the list: the index of the first
- *	       element greater than the key, or <tt>list.length</tt>, if all
- *	       elements in the list are less than the specified key.  Note
- *	       that this guarantees that the return value will be &gt;= 0 if
- *	       and only if the key is found.
+ *         otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
+ *         point</i> is defined as the the point at which the value would
+ *          be inserted into the list: the index of the first
+ *         element greater than the key, or <tt>list.length</tt>, if all
+ *         elements in the list are less than the specified key.  Note
+ *         that this guarantees that the return value will be &gt;= 0 if
+ *         and only if the key is found.
  * @see java.util.Arrays
  */
 public static int binarySearchFromTo(float[] list, float key, int from, int to) {
-	float midVal;
-	while (from <= to) {
-		int mid = (from + to) / 2;
-		midVal = list[mid];
-		if (midVal < key) from = mid + 1;
-		else if (midVal > key) to = mid - 1;
-		else return mid; // key found
-	}
-	return -(from + 1);  // key not found.
+  float midVal;
+  while (from <= to) {
+    int mid = (from + to) / 2;
+    midVal = list[mid];
+    if (midVal < key) from = mid + 1;
+    else if (midVal > key) to = mid - 1;
+    else return mid; // key found
+  }
+  return -(from + 1);  // key not found.
 }
 /**
  * Searches the list for the specified value using
@@ -191,34 +189,34 @@
  * @param from the leftmost search position, inclusive.
  * @param to the rightmost search position, inclusive.
  * @return index of the search key, if it is contained in the list;
- *	       otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
- *	       point</i> is defined as the the point at which the value would
- * 	       be inserted into the list: the index of the first
- *	       element greater than the key, or <tt>list.length</tt>, if all
- *	       elements in the list are less than the specified key.  Note
- *	       that this guarantees that the return value will be &gt;= 0 if
- *	       and only if the key is found.
+ *         otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
+ *         point</i> is defined as the the point at which the value would
+ *          be inserted into the list: the index of the first
+ *         element greater than the key, or <tt>list.length</tt>, if all
+ *         elements in the list are less than the specified key.  Note
+ *         that this guarantees that the return value will be &gt;= 0 if
+ *         and only if the key is found.
  * @see java.util.Arrays
  */
 public static int binarySearchFromTo(int[] list, int key, int from, int to) {
-	int midVal;
-	while (from <= to) {
-		int mid = (from + to) / 2;
-		midVal = list[mid];
-		if (midVal < key) from = mid + 1;
-		else if (midVal > key) to = mid - 1;
-		else return mid; // key found
-	}
-	return -(from + 1);  // key not found.
+  int midVal;
+  while (from <= to) {
+    int mid = (from + to) / 2;
+    midVal = list[mid];
+    if (midVal < key) from = mid + 1;
+    else if (midVal > key) to = mid - 1;
+    else return mid; // key found
+  }
+  return -(from + 1);  // key not found.
 
-	/*
-	// even for very short lists (0,1,2,3 elems) this is only 10% faster
-	while (from<=to && list[from++] < key) ;
-	if (from<=to) {
-		if (list[--from] == key) return from;
-	}
-	return -(from + 1);
-	*/
+  /*
+  // even for very short lists (0,1,2,3 elems) this is only 10% faster
+  while (from<=to && list[from++] < key) ;
+  if (from<=to) {
+    if (list[--from] == key) return from;
+  }
+  return -(from + 1);
+  */
 }
 /**
  * Searches the list for the specified value using
@@ -234,25 +232,25 @@
  * @param from the leftmost search position, inclusive.
  * @param to the rightmost search position, inclusive.
  * @return index of the search key, if it is contained in the list;
- *	       otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
- *	       point</i> is defined as the the point at which the value would
- * 	       be inserted into the list: the index of the first
- *	       element greater than the key, or <tt>list.length</tt>, if all
- *	       elements in the list are less than the specified key.  Note
- *	       that this guarantees that the return value will be &gt;= 0 if
- *	       and only if the key is found.
+ *         otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
+ *         point</i> is defined as the the point at which the value would
+ *          be inserted into the list: the index of the first
+ *         element greater than the key, or <tt>list.length</tt>, if all
+ *         elements in the list are less than the specified key.  Note
+ *         that this guarantees that the return value will be &gt;= 0 if
+ *         and only if the key is found.
  * @see java.util.Arrays
  */
 public static int binarySearchFromTo(long[] list, long key, int from, int to) {
-	long midVal;
-	while (from <= to) {
-		int mid = (from + to) / 2;
-		midVal = list[mid];
-		if (midVal < key) from = mid + 1;
-		else if (midVal > key) to = mid - 1;
-		else return mid; // key found
-	}
-	return -(from + 1);  // key not found.
+  long midVal;
+  while (from <= to) {
+    int mid = (from + to) / 2;
+    midVal = list[mid];
+    if (midVal < key) from = mid + 1;
+    else if (midVal > key) to = mid - 1;
+    else return mid; // key found
+  }
+  return -(from + 1);  // key not found.
 }
 /**
  * Searches the list for the specified value using
@@ -275,30 +273,30 @@
  * @param to the rightmost search position, inclusive.
  * @param comparator the comparator by which the list is sorted.
  * @throws ClassCastException if the list contains elements that are not
- *	       <i>mutually comparable</i> using the specified comparator.
+ *         <i>mutually comparable</i> using the specified comparator.
  * @return index of the search key, if it is contained in the list;
- *	       otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
- *	       point</i> is defined as the the point at which the value would
- * 	       be inserted into the list: the index of the first
- *	       element greater than the key, or <tt>list.length</tt>, if all
- *	       elements in the list are less than the specified key.  Note
- *	       that this guarantees that the return value will be &gt;= 0 if
- *	       and only if the key is found.
+ *         otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
+ *         point</i> is defined as the the point at which the value would
+ *          be inserted into the list: the index of the first
+ *         element greater than the key, or <tt>list.length</tt>, if all
+ *         elements in the list are less than the specified key.  Note
+ *         that this guarantees that the return value will be &gt;= 0 if
+ *         and only if the key is found.
  * @see java.util.Arrays
  * @see java.util.Comparator
  */
 public static int binarySearchFromTo(Object[] list, Object key, int from, int to, java.util.Comparator comparator) {
-	Object midVal;
-	while (from <= to) {
-		int mid =(from + to)/2;
-		midVal = list[mid];
-		int cmp = comparator.compare(midVal,key);
+  Object midVal;
+  while (from <= to) {
+    int mid =(from + to)/2;
+    midVal = list[mid];
+    int cmp = comparator.compare(midVal,key);
 
-		if (cmp < 0) from = mid + 1;
-		else if (cmp > 0) to = mid - 1;
-		else return mid; // key found
-	}
-	return -(from + 1);  // key not found.
+    if (cmp < 0) from = mid + 1;
+    else if (cmp > 0) to = mid - 1;
+    else return mid; // key found
+  }
+  return -(from + 1);  // key not found.
 }
 /**
  * Searches the list for the specified value using
@@ -314,25 +312,25 @@
  * @param from the leftmost search position, inclusive.
  * @param to the rightmost search position, inclusive.
  * @return index of the search key, if it is contained in the list;
- *	       otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
- *	       point</i> is defined as the the point at which the value would
- * 	       be inserted into the list: the index of the first
- *	       element greater than the key, or <tt>list.length</tt>, if all
- *	       elements in the list are less than the specified key.  Note
- *	       that this guarantees that the return value will be &gt;= 0 if
- *	       and only if the key is found.
+ *         otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
+ *         point</i> is defined as the the point at which the value would
+ *          be inserted into the list: the index of the first
+ *         element greater than the key, or <tt>list.length</tt>, if all
+ *         elements in the list are less than the specified key.  Note
+ *         that this guarantees that the return value will be &gt;= 0 if
+ *         and only if the key is found.
  * @see java.util.Arrays
  */
 public static int binarySearchFromTo(short[] list, short key, int from, int to) {
-	short midVal;
-	while (from <= to) {
-		int mid = (from + to) / 2;
-		midVal = list[mid];
-		if (midVal < key) from = mid + 1;
-		else if (midVal > key) to = mid - 1;
-		else return mid; // key found
-	}
-	return -(from + 1);  // key not found.
+  short midVal;
+  while (from <= to) {
+    int mid = (from + to) / 2;
+    midVal = list[mid];
+    if (midVal < key) from = mid + 1;
+    else if (midVal > key) to = mid - 1;
+    else return mid; // key found
+  }
+  return -(from + 1);  // key not found.
 }
 /**
  * Generically searches the list for the specified value using
@@ -348,75 +346,75 @@
  * @param from the leftmost search position, inclusive.
  * @param to the rightmost search position, inclusive.
  * @return index of the search key, if it is contained in the list;
- *	       otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
- *	       point</i> is defined as the the point at which the value would
- * 	       be inserted into the list: the index of the first
- *	       element greater than the key, or <tt>list.length</tt>, if all
- *	       elements in the list are less than the specified key.  Note
- *	       that this guarantees that the return value will be &gt;= 0 if
- *	       and only if the key is found.
+ *         otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
+ *         point</i> is defined as the the point at which the value would
+ *          be inserted into the list: the index of the first
+ *         element greater than the key, or <tt>list.length</tt>, if all
+ *         elements in the list are less than the specified key.  Note
+ *         that this guarantees that the return value will be &gt;= 0 if
+ *         and only if the key is found.
  * @see java.util.Arrays
  */
 public static int binarySearchFromTo(int from, int to, IntComparator comp) {
-	final int dummy = 0;
-	while (from <= to) {
-		int mid = (from + to) / 2;
-		int comparison = comp.compare(dummy,mid);
-		if (comparison < 0) from = mid + 1;
-		else if (comparison > 0) to = mid - 1;
-		else return mid; // key found
-	}
-	return -(from + 1);  // key not found.
+  final int dummy = 0;
+  while (from <= to) {
+    int mid = (from + to) / 2;
+    int comparison = comp.compare(dummy,mid);
+    if (comparison < 0) from = mid + 1;
+    else if (comparison > 0) to = mid - 1;
+    else return mid; // key found
+  }
+  return -(from + 1);  // key not found.
 }
 
 private static int lower_bound(int[] array, int first, int last, int x) {
-		int len = last - first;
-		while (len > 0) {
-			int half = len / 2;
-			int middle = first + half;
-			if (array[middle] < x) {
-				first = middle + 1;
-				len -= half + 1;
-			} else
-				len = half;
-		}
-		return first;
-	} 
+    int len = last - first;
+    while (len > 0) {
+      int half = len / 2;
+      int middle = first + half;
+      if (array[middle] < x) {
+        first = middle + 1;
+        len -= half + 1;
+      } else
+        len = half;
+    }
+    return first;
+  } 
 
 private static int upper_bound(int[] array, int first, int last, int x) {
-	int len = last - first;
-	while (len > 0) {
-		int half = len / 2;
-		int middle = first + half;
-		if (x < array[middle])
-			len = half;
-		else {
-			first = middle + 1;
-			len -= half + 1;
-		}
-	}
-	return first;
+  int len = last - first;
+  while (len > 0) {
+    int half = len / 2;
+    int middle = first + half;
+    if (x < array[middle])
+      len = half;
+    else {
+      first = middle + 1;
+      len -= half + 1;
+    }
+  }
+  return first;
 }
 
 private static void inplace_merge(int[] array, int first, int middle, int last) {
 if (first >= middle || middle >= last)
-	return;
+  return;
 if (last - first == 2) {
-	if (array[middle] < array[first]) {
-		int tmp = array[first];
-		array[first] = array[middle];
-		array[middle] = tmp;
-	}
-	return;
+  if (array[middle] < array[first]) {
+    int tmp = array[first];
+    array[first] = array[middle];
+    array[middle] = tmp;
+  }
+  return;
 }
 int firstCut;
 int secondCut;
 if (middle - first > last - middle) {
-	firstCut = first + (middle - first) / 2;
-	secondCut = lower_bound(array, middle, last, array[firstCut]);
+  firstCut = first + (middle - first) / 2;
+  secondCut = lower_bound(array, middle, last, array[firstCut]);
 } else {
-	secondCut = middle + (last - middle) / 2;
-	firstCut = upper_bound(array, first, middle, array[secondCut]);
+  secondCut = middle + (last - middle) / 2;
+  firstCut = upper_bound(array, first, middle, array[secondCut]);
 }
 
 //rotate(array, firstCut, middle, secondCut);
@@ -425,119 +423,119 @@
 // begin inline
 int first2 = firstCut; int middle2 = middle; int last2 = secondCut;
 if (middle2 != first2 && middle2 != last2) {
-	int first1 = first2; int last1 = middle2;
-	int tmp;
-	while (first1 < --last1) { tmp = array[first1]; array[last1] = array[first1]; array[first1++] = tmp; }
-	first1 = middle2; last1 = last2;
-	while (first1 < --last1) { tmp = array[first1]; array[last1] = array[first1]; array[first1++] = tmp; }
-	first1 = first2; last1 = last2;
-	while (first1 < --last1) { tmp = array[first1]; array[last1] = array[first1]; array[first1++] = tmp; }
+  int first1 = first2; int last1 = middle2;
+  int tmp;
+  while (first1 < --last1) { tmp = array[first1]; array[last1] = array[first1]; array[first1++] = tmp; }
+  first1 = middle2; last1 = last2;
+  while (first1 < --last1) { tmp = array[first1]; array[last1] = array[first1]; array[first1++] = tmp; }
+  first1 = first2; last1 = last2;
+  while (first1 < --last1) { tmp = array[first1]; array[last1] = array[first1]; array[first1++] = tmp; }
 }
 // end inline
 
-	
-	middle = firstCut + (secondCut - middle);
-	inplace_merge(array, first, firstCut, middle);
-	inplace_merge(array, middle, secondCut, last);
+  
+  middle = firstCut + (secondCut - middle);
+  inplace_merge(array, first, firstCut, middle);
+  inplace_merge(array, middle, secondCut, last);
 }
-	/**
+  /**
  * Returns the index of the median of the three indexed chars.
  */
 private static int med3(byte x[], int a, int b, int c, ByteComparator comp) {
-	int ab = comp.compare(x[a],x[b]);
-	int ac = comp.compare(x[a],x[c]);
-	int bc = comp.compare(x[b],x[c]);
-	return (ab<0 ?
-	(bc<0 ? b : ac<0 ? c : a) :
-	(bc>0 ? b : ac>0 ? c : a));
+  int ab = comp.compare(x[a],x[b]);
+  int ac = comp.compare(x[a],x[c]);
+  int bc = comp.compare(x[b],x[c]);
+  return (ab<0 ?
+  (bc<0 ? b : ac<0 ? c : a) :
+  (bc>0 ? b : ac>0 ? c : a));
 }
 /**
  * Returns the index of the median of the three indexed chars.
  */
 private static int med3(char x[], int a, int b, int c, CharComparator comp) {
-	int ab = comp.compare(x[a],x[b]);
-	int ac = comp.compare(x[a],x[c]);
-	int bc = comp.compare(x[b],x[c]);
-	return (ab<0 ?
-	(bc<0 ? b : ac<0 ? c : a) :
-	(bc>0 ? b : ac>0 ? c : a));
+  int ab = comp.compare(x[a],x[b]);
+  int ac = comp.compare(x[a],x[c]);
+  int bc = comp.compare(x[b],x[c]);
+  return (ab<0 ?
+  (bc<0 ? b : ac<0 ? c : a) :
+  (bc>0 ? b : ac>0 ? c : a));
 }
 /**
  * Returns the index of the median of the three indexed chars.
  */
 private static int med3(double x[], int a, int b, int c, DoubleComparator comp) {
-	int ab = comp.compare(x[a],x[b]);
-	int ac = comp.compare(x[a],x[c]);
-	int bc = comp.compare(x[b],x[c]);
-	return (ab<0 ?
-	(bc<0 ? b : ac<0 ? c : a) :
-	(bc>0 ? b : ac>0 ? c : a));
+  int ab = comp.compare(x[a],x[b]);
+  int ac = comp.compare(x[a],x[c]);
+  int bc = comp.compare(x[b],x[c]);
+  return (ab<0 ?
+  (bc<0 ? b : ac<0 ? c : a) :
+  (bc>0 ? b : ac>0 ? c : a));
 }
 /**
  * Returns the index of the median of the three indexed chars.
  */
 private static int med3(float x[], int a, int b, int c, FloatComparator comp) {
-	int ab = comp.compare(x[a],x[b]);
-	int ac = comp.compare(x[a],x[c]);
-	int bc = comp.compare(x[b],x[c]);
-	return (ab<0 ?
-	(bc<0 ? b : ac<0 ? c : a) :
-	(bc>0 ? b : ac>0 ? c : a));
+  int ab = comp.compare(x[a],x[b]);
+  int ac = comp.compare(x[a],x[c]);
+  int bc = comp.compare(x[b],x[c]);
+  return (ab<0 ?
+  (bc<0 ? b : ac<0 ? c : a) :
+  (bc>0 ? b : ac>0 ? c : a));
 }
 /**
  * Returns the index of the median of the three indexed chars.
  */
 private static int med3(int x[], int a, int b, int c, IntComparator comp) {
-	int ab = comp.compare(x[a],x[b]);
-	int ac = comp.compare(x[a],x[c]);
-	int bc = comp.compare(x[b],x[c]);
-	return (ab<0 ?
-	(bc<0 ? b : ac<0 ? c : a) :
-	(bc>0 ? b : ac>0 ? c : a));
+  int ab = comp.compare(x[a],x[b]);
+  int ac = comp.compare(x[a],x[c]);
+  int bc = comp.compare(x[b],x[c]);
+  return (ab<0 ?
+  (bc<0 ? b : ac<0 ? c : a) :
+  (bc>0 ? b : ac>0 ? c : a));
 }
 /**
  * Returns the index of the median of the three indexed chars.
  */
 private static int med3(long x[], int a, int b, int c, LongComparator comp) {
-	int ab = comp.compare(x[a],x[b]);
-	int ac = comp.compare(x[a],x[c]);
-	int bc = comp.compare(x[b],x[c]);
-	return (ab<0 ?
-	(bc<0 ? b : ac<0 ? c : a) :
-	(bc>0 ? b : ac>0 ? c : a));
+  int ab = comp.compare(x[a],x[b]);
+  int ac = comp.compare(x[a],x[c]);
+  int bc = comp.compare(x[b],x[c]);
+  return (ab<0 ?
+  (bc<0 ? b : ac<0 ? c : a) :
+  (bc>0 ? b : ac>0 ? c : a));
 }
 /**
  * Returns the index of the median of the three indexed chars.
  */
 private static int med3(Object x[], int a, int b, int c) {
-	int ab = ((Comparable)x[a]).compareTo((Comparable)x[b]);
-	int ac = ((Comparable)x[a]).compareTo((Comparable)x[c]);
-	int bc = ((Comparable)x[b]).compareTo((Comparable)x[c]);
-	return (ab<0 ?
-	(bc<0 ? b : ac<0 ? c : a) :
-	(bc>0 ? b : ac>0 ? c : a));
+  int ab = ((Comparable)x[a]).compareTo((Comparable)x[b]);
+  int ac = ((Comparable)x[a]).compareTo((Comparable)x[c]);
+  int bc = ((Comparable)x[b]).compareTo((Comparable)x[c]);
+  return (ab<0 ?
+  (bc<0 ? b : ac<0 ? c : a) :
+  (bc>0 ? b : ac>0 ? c : a));
 }
 /**
  * Returns the index of the median of the three indexed chars.
  */
 private static int med3(Object x[], int a, int b, int c, Comparator comp) {
-	int ab = comp.compare(x[a],x[b]);
-	int ac = comp.compare(x[a],x[c]);
-	int bc = comp.compare(x[b],x[c]);
-	return (ab<0 ?
-	(bc<0 ? b : ac<0 ? c : a) :
-	(bc>0 ? b : ac>0 ? c : a));
+  int ab = comp.compare(x[a],x[b]);
+  int ac = comp.compare(x[a],x[c]);
+  int bc = comp.compare(x[b],x[c]);
+  return (ab<0 ?
+  (bc<0 ? b : ac<0 ? c : a) :
+  (bc>0 ? b : ac>0 ? c : a));
 }
 /**
  * Returns the index of the median of the three indexed chars.
  */
 private static int med3(short x[], int a, int b, int c, ShortComparator comp) {
-	int ab = comp.compare(x[a],x[b]);
-	int ac = comp.compare(x[a],x[c]);
-	int bc = comp.compare(x[b],x[c]);
-	return (ab<0 ?
-	(bc<0 ? b : ac<0 ? c : a) :
-	(bc>0 ? b : ac>0 ? c : a));
+  int ab = comp.compare(x[a],x[b]);
+  int ac = comp.compare(x[a],x[c]);
+  int bc = comp.compare(x[b],x[c]);
+  return (ab<0 ?
+  (bc<0 ? b : ac<0 ? c : a) :
+  (bc>0 ? b : ac>0 ? c : a));
 }
 
 /**
@@ -558,12 +556,12 @@
  * @param toIndex the index of the last element (exclusive) to be sorted.
  * @throws IllegalArgumentException if <tt>fromIndex &gt; toIndex</tt>
  * @throws ArrayIndexOutOfBoundsException if <tt>fromIndex &lt; 0</tt> or
- *	       <tt>toIndex &gt; a.length</tt>
+ *         <tt>toIndex &gt; a.length</tt>
  */
 public static void mergeSort(byte[] a, int fromIndex, int toIndex) {
-	rangeCheck(a.length, fromIndex, toIndex);
-	byte aux[] = (byte[]) a.clone();
-	mergeSort1(aux, a, fromIndex, toIndex);
+  rangeCheck(a.length, fromIndex, toIndex);
+  byte aux[] = (byte[]) a.clone();
+  mergeSort1(aux, a, fromIndex, toIndex);
 }
 /**
  * Sorts the specified range of the specified array of elements according
@@ -588,16 +586,16 @@
  * @param toIndex the index of the last element (exclusive) to be sorted.
  * @param c the comparator to determine the order of the array.
  * @throws ClassCastException if the array contains elements that are not
- *	       <i>mutually comparable</i> using the specified comparator.
+ *         <i>mutually comparable</i> using the specified comparator.
  * @throws IllegalArgumentException if <tt>fromIndex &gt; toIndex</tt>
  * @throws ArrayIndexOutOfBoundsException if <tt>fromIndex &lt; 0</tt> or
- *	       <tt>toIndex &gt; a.length</tt>
+ *         <tt>toIndex &gt; a.length</tt>
  * @see Comparator
  */
 public static void mergeSort(byte[] a, int fromIndex, int toIndex, ByteComparator c) {
-	rangeCheck(a.length, fromIndex, toIndex);
-	byte aux[] = (byte[]) a.clone();
-	mergeSort1(aux, a, fromIndex, toIndex, c);
+  rangeCheck(a.length, fromIndex, toIndex);
+  byte aux[] = (byte[]) a.clone();
+  mergeSort1(aux, a, fromIndex, toIndex, c);
 }
 /**
  * Sorts the specified range of the specified array of elements.
@@ -617,12 +615,12 @@
  * @param toIndex the index of the last element (exclusive) to be sorted.
  * @throws IllegalArgumentException if <tt>fromIndex &gt; toIndex</tt>
  * @throws ArrayIndexOutOfBoundsException if <tt>fromIndex &lt; 0</tt> or
- *	       <tt>toIndex &gt; a.length</tt>
+ *         <tt>toIndex &gt; a.length</tt>
  */
 public static void mergeSort(char[] a, int fromIndex, int toIndex) {
-	rangeCheck(a.length, fromIndex, toIndex);
-	char aux[] = (char[]) a.clone();
-	mergeSort1(aux, a, fromIndex, toIndex);
+  rangeCheck(a.length, fromIndex, toIndex);
+  char aux[] = (char[]) a.clone();
+  mergeSort1(aux, a, fromIndex, toIndex);
 }
 /**
  * Sorts the specified range of the specified array of elements according
@@ -647,16 +645,16 @@
  * @param toIndex the index of the last element (exclusive) to be sorted.
  * @param c the comparator to determine the order of the array.
  * @throws ClassCastException if the array contains elements that are not
- *	       <i>mutually comparable</i> using the specified comparator.
+ *         <i>mutually comparable</i> using the specified comparator.
  * @throws IllegalArgumentException if <tt>fromIndex &gt; toIndex</tt>
  * @throws ArrayIndexOutOfBoundsException if <tt>fromIndex &lt; 0</tt> or
- *	       <tt>toIndex &gt; a.length</tt>
+ *         <tt>toIndex &gt; a.length</tt>
  * @see Comparator
  */
 public static void mergeSort(char[] a, int fromIndex, int toIndex, CharComparator c) {
-	rangeCheck(a.length, fromIndex, toIndex);
-	char aux[] = (char[]) a.clone();
-	mergeSort1(aux, a, fromIndex, toIndex, c);
+  rangeCheck(a.length, fromIndex, toIndex);
+  char aux[] = (char[]) a.clone();
+  mergeSort1(aux, a, fromIndex, toIndex, c);
 }
 /**
  * Sorts the specified range of the specified array of elements.
@@ -676,10 +674,10 @@
  * @param toIndex the index of the last element (exclusive) to be sorted.
  * @throws IllegalArgumentException if <tt>fromIndex &gt; toIndex</tt>
  * @throws ArrayIndexOutOfBoundsException if <tt>fromIndex &lt; 0</tt> or
- *	       <tt>toIndex &gt; a.length</tt>
+ *         <tt>toIndex &gt; a.length</tt>
  */
 public static void mergeSort(double[] a, int fromIndex, int toIndex) {
-	mergeSort2(a, fromIndex, toIndex);
+  mergeSort2(a, fromIndex, toIndex);
 }
 /**
  * Sorts the specified range of the specified array of elements according
@@ -704,16 +702,16 @@
  * @param toIndex the index of the last element (exclusive) to be sorted.
  * @param c the comparator to determine the order of the array.
  * @throws ClassCastException if the array contains elements that are not
- *	       <i>mutually comparable</i> using the specified comparator.
+ *         <i>mutually comparable</i> using the specified comparator.
  * @throws IllegalArgumentException if <tt>fromIndex &gt; toIndex</tt>
  * @throws ArrayIndexOutOfBoundsException if <tt>fromIndex &lt; 0</tt> or
- *	       <tt>toIndex &gt; a.length</tt>
+ *         <tt>toIndex &gt; a.length</tt>
  * @see Comparator
  */
 public static void mergeSort(double[] a, int fromIndex, int toIndex, DoubleComparator c) {
-	rangeCheck(a.length, fromIndex, toIndex);
-	double aux[] = (double[]) a.clone();
-	mergeSort1(aux, a, fromIndex, toIndex, c);
+  rangeCheck(a.length, fromIndex, toIndex);
+  double aux[] = (double[]) a.clone();
+  mergeSort1(aux, a, fromIndex, toIndex, c);
 }
 /**
  * Sorts the specified range of the specified array of elements.
@@ -733,10 +731,10 @@
  * @param toIndex the index of the last element (exclusive) to be sorted.
  * @throws IllegalArgumentException if <tt>fromIndex &gt; toIndex</tt>
  * @throws ArrayIndexOutOfBoundsException if <tt>fromIndex &lt; 0</tt> or
- *	       <tt>toIndex &gt; a.length</tt>
+ *         <tt>toIndex &gt; a.length</tt>
  */
 public static void mergeSort(float[] a, int fromIndex, int toIndex) {
-	mergeSort2(a, fromIndex, toIndex);
+  mergeSort2(a, fromIndex, toIndex);
 }
 /**
  * Sorts the specified range of the specified array of elements according
@@ -761,16 +759,16 @@
  * @param toIndex the index of the last element (exclusive) to be sorted.
  * @param c the comparator to determine the order of the array.
  * @throws ClassCastException if the array contains elements that are not
- *	       <i>mutually comparable</i> using the specified comparator.
+ *         <i>mutually comparable</i> using the specified comparator.
  * @throws IllegalArgumentException if <tt>fromIndex &gt; toIndex</tt>
  * @throws ArrayIndexOutOfBoundsException if <tt>fromIndex &lt; 0</tt> or
- *	       <tt>toIndex &gt; a.length</tt>
+ *         <tt>toIndex &gt; a.length</tt>
  * @see Comparator
  */
 public static void mergeSort(float[] a, int fromIndex, int toIndex, FloatComparator c) {
-	rangeCheck(a.length, fromIndex, toIndex);
-	float aux[] = (float[]) a.clone();
-	mergeSort1(aux, a, fromIndex, toIndex, c);
+  rangeCheck(a.length, fromIndex, toIndex);
+  float aux[] = (float[]) a.clone();
+  mergeSort1(aux, a, fromIndex, toIndex, c);
 }
 /**
  * Sorts the specified range of the specified array of elements.
@@ -790,12 +788,12 @@
  * @param toIndex the index of the last element (exclusive) to be sorted.
  * @throws IllegalArgumentException if <tt>fromIndex &gt; toIndex</tt>
  * @throws ArrayIndexOutOfBoundsException if <tt>fromIndex &lt; 0</tt> or
- *	       <tt>toIndex &gt; a.length</tt>
+ *         <tt>toIndex &gt; a.length</tt>
  */
 public static void mergeSort(int[] a, int fromIndex, int toIndex) {
-	rangeCheck(a.length, fromIndex, toIndex);
-	int aux[] = (int[]) a.clone();
-	mergeSort1(aux, a, fromIndex, toIndex);
+  rangeCheck(a.length, fromIndex, toIndex);
+  int aux[] = (int[]) a.clone();
+  mergeSort1(aux, a, fromIndex, toIndex);
 }
 /**
  * Sorts the specified range of the specified array of elements according
@@ -820,16 +818,16 @@
  * @param toIndex the index of the last element (exclusive) to be sorted.
  * @param c the comparator to determine the order of the array.
  * @throws ClassCastException if the array contains elements that are not
- *	       <i>mutually comparable</i> using the specified comparator.
+ *         <i>mutually comparable</i> using the specified comparator.
  * @throws IllegalArgumentException if <tt>fromIndex &gt; toIndex</tt>
  * @throws ArrayIndexOutOfBoundsException if <tt>fromIndex &lt; 0</tt> or
- *	       <tt>toIndex &gt; a.length</tt>
+ *         <tt>toIndex &gt; a.length</tt>
  * @see Comparator
  */
 public static void mergeSort(int[] a, int fromIndex, int toIndex, IntComparator c) {
-	rangeCheck(a.length, fromIndex, toIndex);
-	int aux[] = (int[]) a.clone();
-	mergeSort1(aux, a, fromIndex, toIndex, c);
+  rangeCheck(a.length, fromIndex, toIndex);
+  int aux[] = (int[]) a.clone();
+  mergeSort1(aux, a, fromIndex, toIndex, c);
 }
 /**
  * Sorts the specified range of the specified array of elements.
@@ -849,12 +847,12 @@
  * @param toIndex the index of the last element (exclusive) to be sorted.
  * @throws IllegalArgumentException if <tt>fromIndex &gt; toIndex</tt>
  * @throws ArrayIndexOutOfBoundsException if <tt>fromIndex &lt; 0</tt> or
- *	       <tt>toIndex &gt; a.length</tt>
+ *         <tt>toIndex &gt; a.length</tt>
  */
 public static void mergeSort(long[] a, int fromIndex, int toIndex) {
-	rangeCheck(a.length, fromIndex, toIndex);
-	long aux[] = (long[]) a.clone();
-	mergeSort1(aux, a, fromIndex, toIndex);
+  rangeCheck(a.length, fromIndex, toIndex);
+  long aux[] = (long[]) a.clone();
+  mergeSort1(aux, a, fromIndex, toIndex);
 }
 /**
  * Sorts the specified range of the specified array of elements according
@@ -879,16 +877,16 @@
  * @param toIndex the index of the last element (exclusive) to be sorted.
  * @param c the comparator to determine the order of the array.
  * @throws ClassCastException if the array contains elements that are not
- *	       <i>mutually comparable</i> using the specified comparator.
+ *         <i>mutually comparable</i> using the specified comparator.
  * @throws IllegalArgumentException if <tt>fromIndex &gt; toIndex</tt>
  * @throws ArrayIndexOutOfBoundsException if <tt>fromIndex &lt; 0</tt> or
- *	       <tt>toIndex &gt; a.length</tt>
+ *         <tt>toIndex &gt; a.length</tt>
  * @see Comparator
  */
 public static void mergeSort(long[] a, int fromIndex, int toIndex, LongComparator c) {
-	rangeCheck(a.length, fromIndex, toIndex);
-	long aux[] = (long[]) a.clone();
-	mergeSort1(aux, a, fromIndex, toIndex, c);
+  rangeCheck(a.length, fromIndex, toIndex);
+  long aux[] = (long[]) a.clone();
+  mergeSort1(aux, a, fromIndex, toIndex, c);
 }
 /**
  * Sorts the specified range of the specified array of elements.
@@ -908,12 +906,12 @@
  * @param toIndex the index of the last element (exclusive) to be sorted.
  * @throws IllegalArgumentException if <tt>fromIndex &gt; toIndex</tt>
  * @throws ArrayIndexOutOfBoundsException if <tt>fromIndex &lt; 0</tt> or
- *	       <tt>toIndex &gt; a.length</tt>
+ *         <tt>toIndex &gt; a.length</tt>
  */
 public static void mergeSort(short[] a, int fromIndex, int toIndex) {
-	rangeCheck(a.length, fromIndex, toIndex);
-	short aux[] = (short[]) a.clone();
-	mergeSort1(aux, a, fromIndex, toIndex);
+  rangeCheck(a.length, fromIndex, toIndex);
+  short aux[] = (short[]) a.clone();
+  mergeSort1(aux, a, fromIndex, toIndex);
 }
 /**
  * Sorts the specified range of the specified array of elements according
@@ -938,450 +936,450 @@
  * @param toIndex the index of the last element (exclusive) to be sorted.
  * @param c the comparator to determine the order of the array.
  * @throws ClassCastException if the array contains elements that are not
- *	       <i>mutually comparable</i> using the specified comparator.
+ *         <i>mutually comparable</i> using the specified comparator.
  * @throws IllegalArgumentException if <tt>fromIndex &gt; toIndex</tt>
  * @throws ArrayIndexOutOfBoundsException if <tt>fromIndex &lt; 0</tt> or
- *	       <tt>toIndex &gt; a.length</tt>
+ *         <tt>toIndex &gt; a.length</tt>
  * @see Comparator
  */
 public static void mergeSort(short[] a, int fromIndex, int toIndex, ShortComparator c) {
-	rangeCheck(a.length, fromIndex, toIndex);
-	short aux[] = (short[]) a.clone();
-	mergeSort1(aux, a, fromIndex, toIndex, c);
+  rangeCheck(a.length, fromIndex, toIndex);
+  short aux[] = (short[]) a.clone();
+  mergeSort1(aux, a, fromIndex, toIndex, c);
 }
 private static void mergeSort1(byte src[], byte dest[], int low, int high) {
-	int length = high - low;
-	
-	// Insertion sort on smallest arrays
-	if (length < SMALL) {
-	    for (int i=low; i<high; i++)
-			for (int j=i; j>low && dest[j-1] > dest[j]; j--)
-			    swap(dest, j, j-1);
-	    return;
-	}
+  int length = high - low;
+  
+  // Insertion sort on smallest arrays
+  if (length < SMALL) {
+      for (int i=low; i<high; i++)
+      for (int j=i; j>low && dest[j-1] > dest[j]; j--)
+          swap(dest, j, j-1);
+      return;
+  }
 
-	// Recursively sort halves of dest into src
-	int mid = (low + high)/2;
-	mergeSort1(dest, src, low, mid);
-	mergeSort1(dest, src, mid, high);
+  // Recursively sort halves of dest into src
+  int mid = (low + high)/2;
+  mergeSort1(dest, src, low, mid);
+  mergeSort1(dest, src, mid, high);
 
-	// If list is already sorted, just copy from src to dest.  This is an
-	// optimization that results in faster sorts for nearly ordered lists.
-	if (src[mid-1] <= src[mid]) {
-	   System.arraycopy(src, low, dest, low, length);
-	   return;
-	}
+  // If list is already sorted, just copy from src to dest.  This is an
+  // optimization that results in faster sorts for nearly ordered lists.
+  if (src[mid-1] <= src[mid]) {
+     System.arraycopy(src, low, dest, low, length);
+     return;
+  }
 
-	// Merge sorted halves (now in src) into dest
-	for(int i = low, p = low, q = mid; i < high; i++) {
-		if (q>=high || p<mid && src[p] <= src[q])
-			dest[i] = src[p++];
-		else
-			dest[i] = src[q++];
-	}
+  // Merge sorted halves (now in src) into dest
+  for(int i = low, p = low, q = mid; i < high; i++) {
+    if (q>=high || p<mid && src[p] <= src[q])
+      dest[i] = src[p++];
+    else
+      dest[i] = src[q++];
+  }
 }
 private static void mergeSort1(byte src[], byte dest[], int low, int high, ByteComparator c) {
-	int length = high - low;
-	
-	// Insertion sort on smallest arrays
-	if (length < SMALL) {
-	    for (int i=low; i<high; i++)
-			for (int j=i; j>low && c.compare(dest[j-1], dest[j])>0; j--)
-			    swap(dest, j, j-1);
-	    return;
-	}
+  int length = high - low;
+  
+  // Insertion sort on smallest arrays
+  if (length < SMALL) {
+      for (int i=low; i<high; i++)
+      for (int j=i; j>low && c.compare(dest[j-1], dest[j])>0; j--)
+          swap(dest, j, j-1);
+      return;
+  }
 
-	// Recursively sort halves of dest into src
-	int mid = (low + high)/2;
-	mergeSort1(dest, src, low, mid, c);
-	mergeSort1(dest, src, mid, high, c);
+  // Recursively sort halves of dest into src
+  int mid = (low + high)/2;
+  mergeSort1(dest, src, low, mid, c);
+  mergeSort1(dest, src, mid, high, c);
 
-	// If list is already sorted, just copy from src to dest.  This is an
-	// optimization that results in faster sorts for nearly ordered lists.
-	if (c.compare(src[mid-1], src[mid]) <= 0) {
-	   System.arraycopy(src, low, dest, low, length);
-	   return;
-	}
+  // If list is already sorted, just copy from src to dest.  This is an
+  // optimization that results in faster sorts for nearly ordered lists.
+  if (c.compare(src[mid-1], src[mid]) <= 0) {
+     System.arraycopy(src, low, dest, low, length);
+     return;
+  }
 
-	// Merge sorted halves (now in src) into dest
-	for(int i = low, p = low, q = mid; i < high; i++) {
-		if (q>=high || p<mid && c.compare(src[p], src[q]) <= 0)
-			dest[i] = src[p++];
-		else
-			dest[i] = src[q++];
-	}
+  // Merge sorted halves (now in src) into dest
+  for(int i = low, p = low, q = mid; i < high; i++) {
+    if (q>=high || p<mid && c.compare(src[p], src[q]) <= 0)
+      dest[i] = src[p++];
+    else
+      dest[i] = src[q++];
+  }
 }
 private static void mergeSort1(char src[], char dest[], int low, int high) {
-	int length = high - low;
-	
-	// Insertion sort on smallest arrays
-	if (length < SMALL) {
-	    for (int i=low; i<high; i++)
-			for (int j=i; j>low && dest[j-1] > dest[j]; j--)
-			    swap(dest, j, j-1);
-	    return;
-	}
+  int length = high - low;
+  
+  // Insertion sort on smallest arrays
+  if (length < SMALL) {
+      for (int i=low; i<high; i++)
+      for (int j=i; j>low && dest[j-1] > dest[j]; j--)
+          swap(dest, j, j-1);
+      return;
+  }
 
-	// Recursively sort halves of dest into src
-	int mid = (low + high)/2;
-	mergeSort1(dest, src, low, mid);
-	mergeSort1(dest, src, mid, high);
+  // Recursively sort halves of dest into src
+  int mid = (low + high)/2;
+  mergeSort1(dest, src, low, mid);
+  mergeSort1(dest, src, mid, high);
 
-	// If list is already sorted, just copy from src to dest.  This is an
-	// optimization that results in faster sorts for nearly ordered lists.
-	if (src[mid-1] <= src[mid]) {
-	   System.arraycopy(src, low, dest, low, length);
-	   return;
-	}
+  // If list is already sorted, just copy from src to dest.  This is an
+  // optimization that results in faster sorts for nearly ordered lists.
+  if (src[mid-1] <= src[mid]) {
+     System.arraycopy(src, low, dest, low, length);
+     return;
+  }
 
-	// Merge sorted halves (now in src) into dest
-	for(int i = low, p = low, q = mid; i < high; i++) {
-		if (q>=high || p<mid && src[p] <= src[q])
-			dest[i] = src[p++];
-		else
-			dest[i] = src[q++];
-	}
+  // Merge sorted halves (now in src) into dest
+  for(int i = low, p = low, q = mid; i < high; i++) {
+    if (q>=high || p<mid && src[p] <= src[q])
+      dest[i] = src[p++];
+    else
+      dest[i] = src[q++];
+  }
 }
 private static void mergeSort1(char src[], char dest[], int low, int high, CharComparator c) {
-	int length = high - low;
-	
-	// Insertion sort on smallest arrays
-	if (length < SMALL) {
-	    for (int i=low; i<high; i++)
-			for (int j=i; j>low && c.compare(dest[j-1], dest[j])>0; j--)
-			    swap(dest, j, j-1);
-	    return;
-	}
+  int length = high - low;
+  
+  // Insertion sort on smallest arrays
+  if (length < SMALL) {
+      for (int i=low; i<high; i++)
+      for (int j=i; j>low && c.compare(dest[j-1], dest[j])>0; j--)
+          swap(dest, j, j-1);
+      return;
+  }
 
-	// Recursively sort halves of dest into src
-	int mid = (low + high)/2;
-	mergeSort1(dest, src, low, mid, c);
-	mergeSort1(dest, src, mid, high, c);
+  // Recursively sort halves of dest into src
+  int mid = (low + high)/2;
+  mergeSort1(dest, src, low, mid, c);
+  mergeSort1(dest, src, mid, high, c);
 
-	// If list is already sorted, just copy from src to dest.  This is an
-	// optimization that results in faster sorts for nearly ordered lists.
-	if (c.compare(src[mid-1], src[mid]) <= 0) {
-	   System.arraycopy(src, low, dest, low, length);
-	   return;
-	}
+  // If list is already sorted, just copy from src to dest.  This is an
+  // optimization that results in faster sorts for nearly ordered lists.
+  if (c.compare(src[mid-1], src[mid]) <= 0) {
+     System.arraycopy(src, low, dest, low, length);
+     return;
+  }
 
-	// Merge sorted halves (now in src) into dest
-	for(int i = low, p = low, q = mid; i < high; i++) {
-		if (q>=high || p<mid && c.compare(src[p], src[q]) <= 0)
-			dest[i] = src[p++];
-		else
-			dest[i] = src[q++];
-	}
+  // Merge sorted halves (now in src) into dest
+  for(int i = low, p = low, q = mid; i < high; i++) {
+    if (q>=high || p<mid && c.compare(src[p], src[q]) <= 0)
+      dest[i] = src[p++];
+    else
+      dest[i] = src[q++];
+  }
 }
 private static void mergeSort1(double src[], double dest[], int low, int high) {
-	int length = high - low;
-	
-	// Insertion sort on smallest arrays
-	if (length < SMALL) {
-	    for (int i=low; i<high; i++)
-			for (int j=i; j>low && dest[j-1] > dest[j]; j--)
-			    swap(dest, j, j-1);
-	    return;
-	}
+  int length = high - low;
+  
+  // Insertion sort on smallest arrays
+  if (length < SMALL) {
+      for (int i=low; i<high; i++)
+      for (int j=i; j>low && dest[j-1] > dest[j]; j--)
+          swap(dest, j, j-1);
+      return;
+  }
 
-	// Recursively sort halves of dest into src
-	int mid = (low + high)/2;
-	mergeSort1(dest, src, low, mid);
-	mergeSort1(dest, src, mid, high);
+  // Recursively sort halves of dest into src
+  int mid = (low + high)/2;
+  mergeSort1(dest, src, low, mid);
+  mergeSort1(dest, src, mid, high);
 
-	// If list is already sorted, just copy from src to dest.  This is an
-	// optimization that results in faster sorts for nearly ordered lists.
-	if (src[mid-1] <= src[mid]) {
-	   System.arraycopy(src, low, dest, low, length);
-	   return;
-	}
+  // If list is already sorted, just copy from src to dest.  This is an
+  // optimization that results in faster sorts for nearly ordered lists.
+  if (src[mid-1] <= src[mid]) {
+     System.arraycopy(src, low, dest, low, length);
+     return;
+  }
 
-	// Merge sorted halves (now in src) into dest
-	for(int i = low, p = low, q = mid; i < high; i++) {
-		if (q>=high || p<mid && src[p] <= src[q])
-			dest[i] = src[p++];
-		else
-			dest[i] = src[q++];
-	}
+  // Merge sorted halves (now in src) into dest
+  for(int i = low, p = low, q = mid; i < high; i++) {
+    if (q>=high || p<mid && src[p] <= src[q])
+      dest[i] = src[p++];
+    else
+      dest[i] = src[q++];
+  }
 }
 private static void mergeSort1(double src[], double dest[], int low, int high, DoubleComparator c) {
-	int length = high - low;
-	
-	// Insertion sort on smallest arrays
-	if (length < SMALL) {
-	    for (int i=low; i<high; i++)
-			for (int j=i; j>low && c.compare(dest[j-1], dest[j])>0; j--)
-			    swap(dest, j, j-1);
-	    return;
-	}
+  int length = high - low;
+  
+  // Insertion sort on smallest arrays
+  if (length < SMALL) {
+      for (int i=low; i<high; i++)
+      for (int j=i; j>low && c.compare(dest[j-1], dest[j])>0; j--)
+          swap(dest, j, j-1);
+      return;
+  }
 
-	// Recursively sort halves of dest into src
-	int mid = (low + high)/2;
-	mergeSort1(dest, src, low, mid, c);
-	mergeSort1(dest, src, mid, high, c);
+  // Recursively sort halves of dest into src
+  int mid = (low + high)/2;
+  mergeSort1(dest, src, low, mid, c);
+  mergeSort1(dest, src, mid, high, c);
 
-	// If list is already sorted, just copy from src to dest.  This is an
-	// optimization that results in faster sorts for nearly ordered lists.
-	if (c.compare(src[mid-1], src[mid]) <= 0) {
-	   System.arraycopy(src, low, dest, low, length);
-	   return;
-	}
+  // If list is already sorted, just copy from src to dest.  This is an
+  // optimization that results in faster sorts for nearly ordered lists.
+  if (c.compare(src[mid-1], src[mid]) <= 0) {
+     System.arraycopy(src, low, dest, low, length);
+     return;
+  }
 
-	// Merge sorted halves (now in src) into dest
-	for(int i = low, p = low, q = mid; i < high; i++) {
-		if (q>=high || p<mid && c.compare(src[p], src[q]) <= 0)
-			dest[i] = src[p++];
-		else
-			dest[i] = src[q++];
-	}
+  // Merge sorted halves (now in src) into dest
+  for(int i = low, p = low, q = mid; i < high; i++) {
+    if (q>=high || p<mid && c.compare(src[p], src[q]) <= 0)
+      dest[i] = src[p++];
+    else
+      dest[i] = src[q++];
+  }
 }
 private static void mergeSort1(float src[], float dest[], int low, int high) {
-	int length = high - low;
-	
-	// Insertion sort on smallest arrays
-	if (length < SMALL) {
-	    for (int i=low; i<high; i++)
-			for (int j=i; j>low && dest[j-1] > dest[j]; j--)
-			    swap(dest, j, j-1);
-	    return;
-	}
+  int length = high - low;
+  
+  // Insertion sort on smallest arrays
+  if (length < SMALL) {
+      for (int i=low; i<high; i++)
+      for (int j=i; j>low && dest[j-1] > dest[j]; j--)
+          swap(dest, j, j-1);
+      return;
+  }
 
-	// Recursively sort halves of dest into src
-	int mid = (low + high)/2;
-	mergeSort1(dest, src, low, mid);
-	mergeSort1(dest, src, mid, high);
+  // Recursively sort halves of dest into src
+  int mid = (low + high)/2;
+  mergeSort1(dest, src, low, mid);
+  mergeSort1(dest, src, mid, high);
 
-	// If list is already sorted, just copy from src to dest.  This is an
-	// optimization that results in faster sorts for nearly ordered lists.
-	if (src[mid-1] <= src[mid]) {
-	   System.arraycopy(src, low, dest, low, length);
-	   return;
-	}
+  // If list is already sorted, just copy from src to dest.  This is an
+  // optimization that results in faster sorts for nearly ordered lists.
+  if (src[mid-1] <= src[mid]) {
+     System.arraycopy(src, low, dest, low, length);
+     return;
+  }
 
-	// Merge sorted halves (now in src) into dest
-	for(int i = low, p = low, q = mid; i < high; i++) {
-		if (q>=high || p<mid && src[p] <= src[q])
-			dest[i] = src[p++];
-		else
-			dest[i] = src[q++];
-	}
+  // Merge sorted halves (now in src) into dest
+  for(int i = low, p = low, q = mid; i < high; i++) {
+    if (q>=high || p<mid && src[p] <= src[q])
+      dest[i] = src[p++];
+    else
+      dest[i] = src[q++];
+  }
 }
 private static void mergeSort1(float src[], float dest[], int low, int high, FloatComparator c) {
-	int length = high - low;
-	
-	// Insertion sort on smallest arrays
-	if (length < SMALL) {
-	    for (int i=low; i<high; i++)
-			for (int j=i; j>low && c.compare(dest[j-1], dest[j])>0; j--)
-			    swap(dest, j, j-1);
-	    return;
-	}
+  int length = high - low;
+  
+  // Insertion sort on smallest arrays
+  if (length < SMALL) {
+      for (int i=low; i<high; i++)
+      for (int j=i; j>low && c.compare(dest[j-1], dest[j])>0; j--)
+          swap(dest, j, j-1);
+      return;
+  }
 
-	// Recursively sort halves of dest into src
-	int mid = (low + high)/2;
-	mergeSort1(dest, src, low, mid, c);
-	mergeSort1(dest, src, mid, high, c);
+  // Recursively sort halves of dest into src
+  int mid = (low + high)/2;
+  mergeSort1(dest, src, low, mid, c);
+  mergeSort1(dest, src, mid, high, c);
 
-	// If list is already sorted, just copy from src to dest.  This is an
-	// optimization that results in faster sorts for nearly ordered lists.
-	if (c.compare(src[mid-1], src[mid]) <= 0) {
-	   System.arraycopy(src, low, dest, low, length);
-	   return;
-	}
+  // If list is already sorted, just copy from src to dest.  This is an
+  // optimization that results in faster sorts for nearly ordered lists.
+  if (c.compare(src[mid-1], src[mid]) <= 0) {
+     System.arraycopy(src, low, dest, low, length);
+     return;
+  }
 
-	// Merge sorted halves (now in src) into dest
-	for(int i = low, p = low, q = mid; i < high; i++) {
-		if (q>=high || p<mid && c.compare(src[p], src[q]) <= 0)
-			dest[i] = src[p++];
-		else
-			dest[i] = src[q++];
-	}
+  // Merge sorted halves (now in src) into dest
+  for(int i = low, p = low, q = mid; i < high; i++) {
+    if (q>=high || p<mid && c.compare(src[p], src[q]) <= 0)
+      dest[i] = src[p++];
+    else
+      dest[i] = src[q++];
+  }
 }
 private static void mergeSort1(int src[], int dest[], int low, int high) {
-	int length = high - low;
-	
-	// Insertion sort on smallest arrays
-	if (length < SMALL) {
-	    for (int i=low; i<high; i++)
-			for (int j=i; j>low && dest[j-1] > dest[j]; j--)
-			    swap(dest, j, j-1);
-	    return;
-	}
+  int length = high - low;
+  
+  // Insertion sort on smallest arrays
+  if (length < SMALL) {
+      for (int i=low; i<high; i++)
+      for (int j=i; j>low && dest[j-1] > dest[j]; j--)
+          swap(dest, j, j-1);
+      return;
+  }
 
-	// Recursively sort halves of dest into src
-	int mid = (low + high)/2;
-	mergeSort1(dest, src, low, mid);
-	mergeSort1(dest, src, mid, high);
+  // Recursively sort halves of dest into src
+  int mid = (low + high)/2;
+  mergeSort1(dest, src, low, mid);
+  mergeSort1(dest, src, mid, high);
 
-	// If list is already sorted, just copy from src to dest.  This is an
-	// optimization that results in faster sorts for nearly ordered lists.
-	if (src[mid-1] <= src[mid]) {
-	   System.arraycopy(src, low, dest, low, length);
-	   return;
-	}
+  // If list is already sorted, just copy from src to dest.  This is an
+  // optimization that results in faster sorts for nearly ordered lists.
+  if (src[mid-1] <= src[mid]) {
+     System.arraycopy(src, low, dest, low, length);
+     return;
+  }
 
-	// Merge sorted halves (now in src) into dest
-	for(int i = low, p = low, q = mid; i < high; i++) {
-		if (q>=high || p<mid && src[p] <= src[q])
-			dest[i] = src[p++];
-		else
-			dest[i] = src[q++];
-	}
+  // Merge sorted halves (now in src) into dest
+  for(int i = low, p = low, q = mid; i < high; i++) {
+    if (q>=high || p<mid && src[p] <= src[q])
+      dest[i] = src[p++];
+    else
+      dest[i] = src[q++];
+  }
 }
 private static void mergeSort1(int src[], int dest[], int low, int high, IntComparator c) {
-	int length = high - low;
-	
-	// Insertion sort on smallest arrays
-	if (length < SMALL) {
-	    for (int i=low; i<high; i++)
-			for (int j=i; j>low && c.compare(dest[j-1], dest[j])>0; j--)
-			    swap(dest, j, j-1);
-	    return;
-	}
+  int length = high - low;
+  
+  // Insertion sort on smallest arrays
+  if (length < SMALL) {
+      for (int i=low; i<high; i++)
+      for (int j=i; j>low && c.compare(dest[j-1], dest[j])>0; j--)
+          swap(dest, j, j-1);
+      return;
+  }
 
-	// Recursively sort halves of dest into src
-	int mid = (low + high)/2;
-	mergeSort1(dest, src, low, mid, c);
-	mergeSort1(dest, src, mid, high, c);
+  // Recursively sort halves of dest into src
+  int mid = (low + high)/2;
+  mergeSort1(dest, src, low, mid, c);
+  mergeSort1(dest, src, mid, high, c);
 
-	// If list is already sorted, just copy from src to dest.  This is an
-	// optimization that results in faster sorts for nearly ordered lists.
-	if (c.compare(src[mid-1], src[mid]) <= 0) {
-	   System.arraycopy(src, low, dest, low, length);
-	   return;
-	}
+  // If list is already sorted, just copy from src to dest.  This is an
+  // optimization that results in faster sorts for nearly ordered lists.
+  if (c.compare(src[mid-1], src[mid]) <= 0) {
+     System.arraycopy(src, low, dest, low, length);
+     return;
+  }
 
-	// Merge sorted halves (now in src) into dest
-	for(int i = low, p = low, q = mid; i < high; i++) {
-		if (q>=high || p<mid && c.compare(src[p], src[q]) <= 0)
-			dest[i] = src[p++];
-		else
-			dest[i] = src[q++];
-	}
+  // Merge sorted halves (now in src) into dest
+  for(int i = low, p = low, q = mid; i < high; i++) {
+    if (q>=high || p<mid && c.compare(src[p], src[q]) <= 0)
+      dest[i] = src[p++];
+    else
+      dest[i] = src[q++];
+  }
 }
 private static void mergeSort1(long src[], long dest[], int low, int high) {
-	int length = high - low;
-	
-	// Insertion sort on smallest arrays
-	if (length < SMALL) {
-	    for (int i=low; i<high; i++)
-			for (int j=i; j>low && dest[j-1] > dest[j]; j--)
-			    swap(dest, j, j-1);
-	    return;
-	}
+  int length = high - low;
+  
+  // Insertion sort on smallest arrays
+  if (length < SMALL) {
+      for (int i=low; i<high; i++)
+      for (int j=i; j>low && dest[j-1] > dest[j]; j--)
+          swap(dest, j, j-1);
+      return;
+  }
 
-	// Recursively sort halves of dest into src
-	int mid = (low + high)/2;
-	mergeSort1(dest, src, low, mid);
-	mergeSort1(dest, src, mid, high);
+  // Recursively sort halves of dest into src
+  int mid = (low + high)/2;
+  mergeSort1(dest, src, low, mid);
+  mergeSort1(dest, src, mid, high);
 
-	// If list is already sorted, just copy from src to dest.  This is an
-	// optimization that results in faster sorts for nearly ordered lists.
-	if (src[mid-1] <= src[mid]) {
-	   System.arraycopy(src, low, dest, low, length);
-	   return;
-	}
+  // If list is already sorted, just copy from src to dest.  This is an
+  // optimization that results in faster sorts for nearly ordered lists.
+  if (src[mid-1] <= src[mid]) {
+     System.arraycopy(src, low, dest, low, length);
+     return;
+  }
 
-	// Merge sorted halves (now in src) into dest
-	for(int i = low, p = low, q = mid; i < high; i++) {
-		if (q>=high || p<mid && src[p] <= src[q])
-			dest[i] = src[p++];
-		else
-			dest[i] = src[q++];
-	}
+  // Merge sorted halves (now in src) into dest
+  for(int i = low, p = low, q = mid; i < high; i++) {
+    if (q>=high || p<mid && src[p] <= src[q])
+      dest[i] = src[p++];
+    else
+      dest[i] = src[q++];
+  }
 }
 private static void mergeSort1(long src[], long dest[], int low, int high, LongComparator c) {
-	int length = high - low;
-	
-	// Insertion sort on smallest arrays
-	if (length < SMALL) {
-	    for (int i=low; i<high; i++)
-			for (int j=i; j>low && c.compare(dest[j-1], dest[j])>0; j--)
-			    swap(dest, j, j-1);
-	    return;
-	}
+  int length = high - low;
+  
+  // Insertion sort on smallest arrays
+  if (length < SMALL) {
+      for (int i=low; i<high; i++)
+      for (int j=i; j>low && c.compare(dest[j-1], dest[j])>0; j--)
+          swap(dest, j, j-1);
+      return;
+  }
 
-	// Recursively sort halves of dest into src
-	int mid = (low + high)/2;
-	mergeSort1(dest, src, low, mid, c);
-	mergeSort1(dest, src, mid, high, c);
+  // Recursively sort halves of dest into src
+  int mid = (low + high)/2;
+  mergeSort1(dest, src, low, mid, c);
+  mergeSort1(dest, src, mid, high, c);
 
-	// If list is already sorted, just copy from src to dest.  This is an
-	// optimization that results in faster sorts for nearly ordered lists.
-	if (c.compare(src[mid-1], src[mid]) <= 0) {
-	   System.arraycopy(src, low, dest, low, length);
-	   return;
-	}
+  // If list is already sorted, just copy from src to dest.  This is an
+  // optimization that results in faster sorts for nearly ordered lists.
+  if (c.compare(src[mid-1], src[mid]) <= 0) {
+     System.arraycopy(src, low, dest, low, length);
+     return;
+  }
 
-	// Merge sorted halves (now in src) into dest
-	for(int i = low, p = low, q = mid; i < high; i++) {
-		if (q>=high || p<mid && c.compare(src[p], src[q]) <= 0)
-			dest[i] = src[p++];
-		else
-			dest[i] = src[q++];
-	}
+  // Merge sorted halves (now in src) into dest
+  for(int i = low, p = low, q = mid; i < high; i++) {
+    if (q>=high || p<mid && c.compare(src[p], src[q]) <= 0)
+      dest[i] = src[p++];
+    else
+      dest[i] = src[q++];
+  }
 }
 private static void mergeSort1(short src[], short dest[], int low, int high) {
-	int length = high - low;
-	
-	// Insertion sort on smallest arrays
-	if (length < SMALL) {
-	    for (int i=low; i<high; i++)
-			for (int j=i; j>low && dest[j-1] > dest[j]; j--)
-			    swap(dest, j, j-1);
-	    return;
-	}
+  int length = high - low;
+  
+  // Insertion sort on smallest arrays
+  if (length < SMALL) {
+      for (int i=low; i<high; i++)
+      for (int j=i; j>low && dest[j-1] > dest[j]; j--)
+          swap(dest, j, j-1);
+      return;
+  }
 
-	// Recursively sort halves of dest into src
-	int mid = (low + high)/2;
-	mergeSort1(dest, src, low, mid);
-	mergeSort1(dest, src, mid, high);
+  // Recursively sort halves of dest into src
+  int mid = (low + high)/2;
+  mergeSort1(dest, src, low, mid);
+  mergeSort1(dest, src, mid, high);
 
-	// If list is already sorted, just copy from src to dest.  This is an
-	// optimization that results in faster sorts for nearly ordered lists.
-	if (src[mid-1] <= src[mid]) {
-	   System.arraycopy(src, low, dest, low, length);
-	   return;
-	}
+  // If list is already sorted, just copy from src to dest.  This is an
+  // optimization that results in faster sorts for nearly ordered lists.
+  if (src[mid-1] <= src[mid]) {
+     System.arraycopy(src, low, dest, low, length);
+     return;
+  }
 
-	// Merge sorted halves (now in src) into dest
-	for(int i = low, p = low, q = mid; i < high; i++) {
-		if (q>=high || p<mid && src[p] <= src[q])
-			dest[i] = src[p++];
-		else
-			dest[i] = src[q++];
-	}
+  // Merge sorted halves (now in src) into dest
+  for(int i = low, p = low, q = mid; i < high; i++) {
+    if (q>=high || p<mid && src[p] <= src[q])
+      dest[i] = src[p++];
+    else
+      dest[i] = src[q++];
+  }
 }
 private static void mergeSort1(short src[], short dest[], int low, int high, ShortComparator c) {
-	int length = high - low;
-	
-	// Insertion sort on smallest arrays
-	if (length < SMALL) {
-	    for (int i=low; i<high; i++)
-			for (int j=i; j>low && c.compare(dest[j-1], dest[j])>0; j--)
-			    swap(dest, j, j-1);
-	    return;
-	}
+  int length = high - low;
+  
+  // Insertion sort on smallest arrays
+  if (length < SMALL) {
+      for (int i=low; i<high; i++)
+      for (int j=i; j>low && c.compare(dest[j-1], dest[j])>0; j--)
+          swap(dest, j, j-1);
+      return;
+  }
 
-	// Recursively sort halves of dest into src
-	int mid = (low + high)/2;
-	mergeSort1(dest, src, low, mid, c);
-	mergeSort1(dest, src, mid, high, c);
+  // Recursively sort halves of dest into src
+  int mid = (low + high)/2;
+  mergeSort1(dest, src, low, mid, c);
+  mergeSort1(dest, src, mid, high, c);
 
-	// If list is already sorted, just copy from src to dest.  This is an
-	// optimization that results in faster sorts for nearly ordered lists.
-	if (c.compare(src[mid-1], src[mid]) <= 0) {
-	   System.arraycopy(src, low, dest, low, length);
-	   return;
-	}
+  // If list is already sorted, just copy from src to dest.  This is an
+  // optimization that results in faster sorts for nearly ordered lists.
+  if (c.compare(src[mid-1], src[mid]) <= 0) {
+     System.arraycopy(src, low, dest, low, length);
+     return;
+  }
 
-	// Merge sorted halves (now in src) into dest
-	for(int i = low, p = low, q = mid; i < high; i++) {
-		if (q>=high || p<mid && c.compare(src[p], src[q]) <= 0)
-			dest[i] = src[p++];
-		else
-			dest[i] = src[q++];
-	}
+  // Merge sorted halves (now in src) into dest
+  for(int i = low, p = low, q = mid; i < high; i++) {
+    if (q>=high || p<mid && c.compare(src[p], src[q]) <= 0)
+      dest[i] = src[p++];
+    else
+      dest[i] = src[q++];
+  }
 }
 private static void mergeSort2(double a[], int fromIndex, int toIndex) {
 rangeCheck(a.length, fromIndex, toIndex);
@@ -1398,16 +1396,16 @@
 int numNegZeros = 0;
 int i = fromIndex, n = toIndex;
 while(i < n) {
-	if (a[i] != a[i]) {
-		a[i] = a[--n];
-		a[n] = Double.NaN;
-	} else {
-		if (a[i]==0 && Double.doubleToLongBits(a[i])==NEG_ZERO_BITS) {
-			a[i] = 0.0d;
-			numNegZeros++;
-		}
-		i++;
-	}
+  if (a[i] != a[i]) {
+    a[i] = a[--n];
+    a[n] = Double.NaN;
+  } else {
+    if (a[i]==0 && Double.doubleToLongBits(a[i])==NEG_ZERO_BITS) {
+      a[i] = 0.0d;
+      numNegZeros++;
+    }
+    i++;
+  }
 }
 
 // Main sort phase: mergesort everything but the NaN's
@@ -1416,14 +1414,14 @@
 
 // Postprocessing phase: change 0.0's to -0.0's as required
 if (numNegZeros != 0) {
-	int j = new org.apache.mahout.matrix.list.DoubleArrayList(a).binarySearchFromTo(0.0d, fromIndex, n-1); // posn of ANY zero
-	do {
-		j--;
-	} while (j>=0 && a[j]==0.0d);
+  int j = new org.apache.mahout.matrix.list.DoubleArrayList(a).binarySearchFromTo(0.0d, fromIndex, n-1); // posn of ANY zero
+  do {
+    j--;
+  } while (j>=0 && a[j]==0.0d);
 
-	// j is now one less than the index of the FIRST zero
-	for (int k=0; k<numNegZeros; k++)
-		a[++j] = -0.0d;
+  // j is now one less than the index of the FIRST zero
+  for (int k=0; k<numNegZeros; k++)
+    a[++j] = -0.0d;
 }
 }
 private static void mergeSort2(float a[], int fromIndex, int toIndex) {
@@ -1441,16 +1439,16 @@
 int numNegZeros = 0;
 int i = fromIndex, n = toIndex;
 while(i < n) {
-	if (a[i] != a[i]) {
-		a[i] = a[--n];
-		a[n] = Float.NaN;
-	} else {
-		if (a[i]==0 && Float.floatToIntBits(a[i])==NEG_ZERO_BITS) {
-			a[i] = 0.0f;
-			numNegZeros++;
-		}
-		i++;
-	}
+  if (a[i] != a[i]) {
+    a[i] = a[--n];
+    a[n] = Float.NaN;
+  } else {
+    if (a[i]==0 && Float.floatToIntBits(a[i])==NEG_ZERO_BITS) {
+      a[i] = 0.0f;
+      numNegZeros++;
+    }
+    i++;
+  }
 }
 
 // Main sort phase: mergesort everything but the NaN's
@@ -1459,14 +1457,14 @@
 
 // Postprocessing phase: change 0.0's to -0.0's as required
 if (numNegZeros != 0) {
-	int j = new org.apache.mahout.matrix.list.FloatArrayList(a).binarySearchFromTo(0.0f, fromIndex, n-1); // posn of ANY zero
-	do {
-		j--;
-	} while (j>=0 && a[j]==0.0f);
+  int j = new org.apache.mahout.matrix.list.FloatArrayList(a).binarySearchFromTo(0.0f, fromIndex, n-1); // posn of ANY zero
+  do {
+    j--;
+  } while (j>=0 && a[j]==0.0f);
 
-	// j is now one less than the index of the FIRST zero
-	for (int k=0; k<numNegZeros; k++)
-		a[++j] = -0.0f;
+  // j is now one less than the index of the FIRST zero
+  for (int k=0; k<numNegZeros; k++)
+    a[++j] = -0.0f;
 }
 }
 /**
@@ -1487,34 +1485,34 @@
  * @param toIndex the index of the last element (exclusive) to be sorted.
  * @throws IllegalArgumentException if <tt>fromIndex &gt; toIndex</tt>
  * @throws ArrayIndexOutOfBoundsException if <tt>fromIndex &lt; 0</tt> or
- *	       <tt>toIndex &gt; a.length</tt>
+ *         <tt>toIndex &gt; a.length</tt>
  */
 public static void mergeSortInPlace(int[] a, int fromIndex, int toIndex) {
-	rangeCheck(a.length, fromIndex, toIndex);
-	int length = toIndex - fromIndex;
+  rangeCheck(a.length, fromIndex, toIndex);
+  int length = toIndex - fromIndex;
 
-	// Insertion sort on smallest arrays
-	if (length < SMALL) {
-		for (int i = fromIndex; i < toIndex; i++) { 
-			for (int j = i; j > fromIndex && a[j - 1] > a[j]; j--) {
-				int tmp = a[j]; a[j] = a[j - 1]; a[j-1] = tmp;
-			}
-		}
-		return;
-	}
+  // Insertion sort on smallest arrays
+  if (length < SMALL) {
+    for (int i = fromIndex; i < toIndex; i++) { 
+      for (int j = i; j > fromIndex && a[j - 1] > a[j]; j--) {
+        int tmp = a[j]; a[j] = a[j - 1]; a[j-1] = tmp;
+      }
+    }
+    return;
+  }
 
-	// Recursively sort halves
-	int mid = (fromIndex + toIndex) / 2;
-	mergeSortInPlace(a,fromIndex, mid);
-	mergeSortInPlace(a,mid, toIndex);
+  // Recursively sort halves
+  int mid = (fromIndex + toIndex) / 2;
+  mergeSortInPlace(a,fromIndex, mid);
+  mergeSortInPlace(a,mid, toIndex);
 
-	// If list is already sorted, nothing left to do.  This is an
-	// optimization that results in faster sorts for nearly ordered lists.
-	if (a[mid-1] <= a[mid]) return;
+  // If list is already sorted, nothing left to do.  This is an
+  // optimization that results in faster sorts for nearly ordered lists.
+  if (a[mid-1] <= a[mid]) return;
 
-	// Merge sorted halves 
-	//jal.INT.Sorting.inplace_merge(a, fromIndex, mid, toIndex);
-	inplace_merge(a, fromIndex, mid, toIndex);
+  // Merge sorted halves 
+  //jal.INT.Sorting.inplace_merge(a, fromIndex, mid, toIndex);
+  inplace_merge(a, fromIndex, mid, toIndex);
 }
 /**
  * Sorts the specified range of the specified array of elements according
@@ -1537,15 +1535,15 @@
  * @param toIndex the index of the last element (exclusive) to be sorted.
  * @param c the comparator to determine the order of the array.
  * @throws ClassCastException if the array contains elements that are not
- *	       <i>mutually comparable</i> using the specified comparator.
+ *         <i>mutually comparable</i> using the specified comparator.
  * @throws IllegalArgumentException if <tt>fromIndex &gt; toIndex</tt>
  * @throws ArrayIndexOutOfBoundsException if <tt>fromIndex &lt; 0</tt> or
- *	       <tt>toIndex &gt; a.length</tt>
+ *         <tt>toIndex &gt; a.length</tt>
  * @see Comparator
  */
 public static void quickSort(byte[] a, int fromIndex, int toIndex, ByteComparator c) {
-	rangeCheck(a.length, fromIndex, toIndex);
-	quickSort1(a, fromIndex, toIndex-fromIndex, c);
+  rangeCheck(a.length, fromIndex, toIndex);
+  quickSort1(a, fromIndex, toIndex-fromIndex, c);
 }
 /**
  * Sorts the specified range of the specified array of elements according
@@ -1568,15 +1566,15 @@
  * @param toIndex the index of the last element (exclusive) to be sorted.
  * @param c the comparator to determine the order of the array.
  * @throws ClassCastException if the array contains elements that are not
- *	       <i>mutually comparable</i> using the specified comparator.
+ *         <i>mutually comparable</i> using the specified comparator.
  * @throws IllegalArgumentException if <tt>fromIndex &gt; toIndex</tt>
  * @throws ArrayIndexOutOfBoundsException if <tt>fromIndex &lt; 0</tt> or
- *	       <tt>toIndex &gt; a.length</tt>
+ *         <tt>toIndex &gt; a.length</tt>
  * @see Comparator
  */
 public static void quickSort(char[] a, int fromIndex, int toIndex, CharComparator c) {
-	rangeCheck(a.length, fromIndex, toIndex);
-	quickSort1(a, fromIndex, toIndex-fromIndex, c);
+  rangeCheck(a.length, fromIndex, toIndex);
+  quickSort1(a, fromIndex, toIndex-fromIndex, c);
 }
 /**
  * Sorts the specified range of the specified array of elements according
@@ -1599,15 +1597,15 @@
  * @param toIndex the index of the last element (exclusive) to be sorted.
  * @param c the comparator to determine the order of the array.
  * @throws ClassCastException if the array contains elements that are not
- *	       <i>mutually comparable</i> using the specified comparator.
+ *         <i>mutually comparable</i> using the specified comparator.
  * @throws IllegalArgumentException if <tt>fromIndex &gt; toIndex</tt>
  * @throws ArrayIndexOutOfBoundsException if <tt>fromIndex &lt; 0</tt> or
- *	       <tt>toIndex &gt; a.length</tt>
+ *         <tt>toIndex &gt; a.length</tt>
  * @see Comparator
  */
 public static void quickSort(double[] a, int fromIndex, int toIndex, DoubleComparator c) {
-	rangeCheck(a.length, fromIndex, toIndex);
-	quickSort1(a, fromIndex, toIndex-fromIndex, c);
+  rangeCheck(a.length, fromIndex, toIndex);
+  quickSort1(a, fromIndex, toIndex-fromIndex, c);
 }
 /**
  * Sorts the specified range of the specified array of elements according
@@ -1630,15 +1628,15 @@
  * @param toIndex the index of the last element (exclusive) to be sorted.
  * @param c the comparator to determine the order of the array.
  * @throws ClassCastException if the array contains elements that are not
- *	       <i>mutually comparable</i> using the specified comparator.
+ *         <i>mutually comparable</i> using the specified comparator.
  * @throws IllegalArgumentException if <tt>fromIndex &gt; toIndex</tt>
  * @throws ArrayIndexOutOfBoundsException if <tt>fromIndex &lt; 0</tt> or
- *	       <tt>toIndex &gt; a.length</tt>
+ *         <tt>toIndex &gt; a.length</tt>
  * @see Comparator
  */
 public static void quickSort(float[] a, int fromIndex, int toIndex, FloatComparator c) {
-	rangeCheck(a.length, fromIndex, toIndex);
-	quickSort1(a, fromIndex, toIndex-fromIndex, c);
+  rangeCheck(a.length, fromIndex, toIndex);
+  quickSort1(a, fromIndex, toIndex-fromIndex, c);
 }
 /**
  * Sorts the specified range of the specified array of elements according
@@ -1661,15 +1659,15 @@
  * @param toIndex the index of the last element (exclusive) to be sorted.
  * @param c the comparator to determine the order of the array.
  * @throws ClassCastException if the array contains elements that are not
- *	       <i>mutually comparable</i> using the specified comparator.
+ *         <i>mutually comparable</i> using the specified comparator.
  * @throws IllegalArgumentException if <tt>fromIndex &gt; toIndex</tt>
  * @throws ArrayIndexOutOfBoundsException if <tt>fromIndex &lt; 0</tt> or
- *	       <tt>toIndex &gt; a.length</tt>
+ *         <tt>toIndex &gt; a.length</tt>
  * @see Comparator
  */
 public static void quickSort(int[] a, int fromIndex, int toIndex, IntComparator c) {
-	rangeCheck(a.length, fromIndex, toIndex);
-	quickSort1(a, fromIndex, toIndex-fromIndex, c);
+  rangeCheck(a.length, fromIndex, toIndex);
+  quickSort1(a, fromIndex, toIndex-fromIndex, c);
 }
 /**
  * Sorts the specified range of the specified array of elements according
@@ -1692,15 +1690,15 @@
  * @param toIndex the index of the last element (exclusive) to be sorted.
  * @param c the comparator to determine the order of the array.
  * @throws ClassCastException if the array contains elements that are not
- *	       <i>mutually comparable</i> using the specified comparator.
+ *         <i>mutually comparable</i> using the specified comparator.
  * @throws IllegalArgumentException if <tt>fromIndex &gt; toIndex</tt>
  * @throws ArrayIndexOutOfBoundsException if <tt>fromIndex &lt; 0</tt> or
- *	       <tt>toIndex &gt; a.length</tt>
+ *         <tt>toIndex &gt; a.length</tt>
  * @see Comparator
  */
 public static void quickSort(long[] a, int fromIndex, int toIndex, LongComparator c) {
-	rangeCheck(a.length, fromIndex, toIndex);
-	quickSort1(a, fromIndex, toIndex-fromIndex, c);
+  rangeCheck(a.length, fromIndex, toIndex);
+  quickSort1(a, fromIndex, toIndex-fromIndex, c);
 }
 /**
  * Sorts the specified range of the receiver into
@@ -1720,7 +1718,7 @@
  * @param a the array to be sorted.
  */
 public static void quickSort(Object[] a) {
-	quickSort1(a, 0, a.length);
+  quickSort1(a, 0, a.length);
 }
 /**
  * Sorts the specified range of the receiver into
@@ -1737,11 +1735,11 @@
  * @param toIndex the index of the last element (exclusive) to be sorted.
  * @throws IllegalArgumentException if <tt>fromIndex &gt; toIndex</tt>
  * @throws ArrayIndexOutOfBoundsException if <tt>fromIndex &lt; 0</tt> or
- *	       <tt>toIndex &gt; a.length</tt>
+ *         <tt>toIndex &gt; a.length</tt>
  */
 public static void quickSort(Object[] a, int fromIndex, int toIndex) {
-	rangeCheck(a.length, fromIndex, toIndex);
-	quickSort1(a, fromIndex, toIndex-fromIndex);
+  rangeCheck(a.length, fromIndex, toIndex);
+  quickSort1(a, fromIndex, toIndex-fromIndex);
 }
 /**
  * Sorts the specified range of the specified array according
@@ -1764,15 +1762,15 @@
  * @param toIndex the index of the last element (exclusive) to be sorted.
  * @param c the comparator to determine the order of the receiver.
  * @throws ClassCastException if the array contains elements that are not
- *	       <i>mutually comparable</i> using the specified comparator.
+ *         <i>mutually comparable</i> using the specified comparator.
  * @throws IllegalArgumentException if <tt>fromIndex &gt; toIndex</tt>
  * @throws ArrayIndexOutOfBoundsException if <tt>fromIndex &lt; 0</tt> or
- *	       <tt>toIndex &gt; a.length</tt>
+ *         <tt>toIndex &gt; a.length</tt>
  * @see Comparator
  */
 public static void quickSort(Object[] a, int fromIndex, int toIndex, Comparator c) {
-	rangeCheck(a.length, fromIndex, toIndex);
-	quickSort1(a, fromIndex, toIndex-fromIndex, c);
+  rangeCheck(a.length, fromIndex, toIndex);
+  quickSort1(a, fromIndex, toIndex-fromIndex, c);
 }
 /**
  * Sorts the specified array according
@@ -1792,14 +1790,14 @@
  * @param a the array to be sorted.
  * @param c the comparator to determine the order of the receiver.
  * @throws ClassCastException if the array contains elements that are not
- *	       <i>mutually comparable</i> using the specified comparator.
+ *         <i>mutually comparable</i> using the specified comparator.
  * @throws IllegalArgumentException if <tt>fromIndex &gt; toIndex</tt>
  * @throws ArrayIndexOutOfBoundsException if <tt>fromIndex &lt; 0</tt> or
- *	       <tt>toIndex &gt; a.length</tt>
+ *         <tt>toIndex &gt; a.length</tt>
  * @see Comparator
  */
 public static void quickSort(Object[] a, Comparator c) {
-	quickSort1(a, 0, a.length, c);
+  quickSort1(a, 0, a.length, c);
 }
 /**
  * Sorts the specified range of the specified array of elements according
@@ -1824,660 +1822,660 @@
  * @param toIndex the index of the last element (exclusive) to be sorted.
  * @param c the comparator to determine the order of the array.
  * @throws ClassCastException if the array contains elements that are not
- *	       <i>mutually comparable</i> using the specified comparator.
+ *         <i>mutually comparable</i> using the specified comparator.
  * @throws IllegalArgumentException if <tt>fromIndex &gt; toIndex</tt>
  * @throws ArrayIndexOutOfBoundsException if <tt>fromIndex &lt; 0</tt> or
- *	       <tt>toIndex &gt; a.length</tt>
+ *         <tt>toIndex &gt; a.length</tt>
  * @see Comparator
  */
 public static void quickSort(short[] a, int fromIndex, int toIndex, ShortComparator c) {
-	rangeCheck(a.length, fromIndex, toIndex);
-	quickSort1(a, fromIndex, toIndex-fromIndex, c);
+  rangeCheck(a.length, fromIndex, toIndex);
+  quickSort1(a, fromIndex, toIndex-fromIndex, c);
 }
 /**
  * Sorts the specified sub-array of chars into ascending order.
  */
 private static void quickSort1(byte x[], int off, int len, ByteComparator comp) {
-	// Insertion sort on smallest arrays
-	if (len < SMALL) {
-		for (int i=off; i<len+off; i++)
-		for (int j=i; j>off && comp.compare(x[j-1],x[j])>0; j--)
-		    swap(x, j, j-1);
-		return;
-	}
+  // Insertion sort on smallest arrays
+  if (len < SMALL) {
+    for (int i=off; i<len+off; i++)
+    for (int j=i; j>off && comp.compare(x[j-1],x[j])>0; j--)
+        swap(x, j, j-1);
+    return;
+  }
 
-	// Choose a partition element, v
-	int m = off + len/2;       // Small arrays, middle element
-	if (len > SMALL) {
-		int l = off;
-		int n = off + len - 1;
-		if (len > MEDIUM) {        // Big arrays, pseudomedian of 9
-		int s = len/8;
-		l = med3(x, l,     l+s, l+2*s, comp);
-		m = med3(x, m-s,   m,   m+s, comp);
-		n = med3(x, n-2*s, n-s, n, comp);
-		}
-		m = med3(x, l, m, n, comp); // Mid-size, med of 3
-	}
-	byte v = x[m];
+  // Choose a partition element, v
+  int m = off + len/2;       // Small arrays, middle element
+  if (len > SMALL) {
+    int l = off;
+    int n = off + len - 1;
+    if (len > MEDIUM) {        // Big arrays, pseudomedian of 9
+    int s = len/8;
+    l = med3(x, l,     l+s, l+2*s, comp);
+    m = med3(x, m-s,   m,   m+s, comp);
+    n = med3(x, n-2*s, n-s, n, comp);
+    }
+    m = med3(x, l, m, n, comp); // Mid-size, med of 3
+  }
+  byte v = x[m];
 
-	// Establish Invariant: v* (<v)* (>v)* v*
-	int a = off, b = a, c = off + len - 1, d = c;
-	while(true) {
-		int comparison;
-		while (b <= c && (comparison=comp.compare(x[b],v))<=0) {
-		if (comparison == 0)
-		    swap(x, a++, b);
-		b++;
-		}
-		while (c >= b && (comparison=comp.compare(x[c],v))>=0) {
-		if (comparison == 0)
-		    swap(x, c, d--);
-		c--;
-		}
-		if (b > c)
-		break;
-		swap(x, b++, c--);
-	}
+  // Establish Invariant: v* (<v)* (>v)* v*
+  int a = off, b = a, c = off + len - 1, d = c;
+  while(true) {
+    int comparison;
+    while (b <= c && (comparison=comp.compare(x[b],v))<=0) {
+    if (comparison == 0)
+        swap(x, a++, b);
+    b++;
+    }
+    while (c >= b && (comparison=comp.compare(x[c],v))>=0) {
+    if (comparison == 0)
+        swap(x, c, d--);
+    c--;
+    }
+    if (b > c)
+    break;
+    swap(x, b++, c--);
+  }
 
-	// Swap partition elements back to middle
-	int s, n = off + len;
-	s = Math.min(a-off, b-a  );  vecswap(x, off, b-s, s);
-	s = Math.min(d-c,   n-d-1);  vecswap(x, b,   n-s, s);
+  // Swap partition elements back to middle
+  int s, n = off + len;
+  s = Math.min(a-off, b-a  );  vecswap(x, off, b-s, s);
+  s = Math.min(d-c,   n-d-1);  vecswap(x, b,   n-s, s);
 
-	// Recursively sort non-partition-elements
-	if ((s = b-a) > 1)
-		quickSort1(x, off, s, comp);
-	if ((s = d-c) > 1)
-		quickSort1(x, n-s, s, comp);
+  // Recursively sort non-partition-elements
+  if ((s = b-a) > 1)
+    quickSort1(x, off, s, comp);
+  if ((s = d-c) > 1)
+    quickSort1(x, n-s, s, comp);
 }
 /**
  * Sorts the specified sub-array of chars into ascending order.
  */
 private static void quickSort1(char x[], int off, int len, CharComparator comp) {
-	// Insertion sort on smallest arrays
-	if (len < SMALL) {
-		for (int i=off; i<len+off; i++)
-		for (int j=i; j>off && comp.compare(x[j-1],x[j])>0; j--)
-		    swap(x, j, j-1);
-		return;
-	}
+  // Insertion sort on smallest arrays
+  if (len < SMALL) {
+    for (int i=off; i<len+off; i++)
+    for (int j=i; j>off && comp.compare(x[j-1],x[j])>0; j--)
+        swap(x, j, j-1);
+    return;
+  }
 
-	// Choose a partition element, v
-	int m = off + len/2;       // Small arrays, middle element
-	if (len > SMALL) {
-		int l = off;
-		int n = off + len - 1;
-		if (len > MEDIUM) {        // Big arrays, pseudomedian of 9
-		int s = len/8;
-		l = med3(x, l,     l+s, l+2*s, comp);
-		m = med3(x, m-s,   m,   m+s, comp);
-		n = med3(x, n-2*s, n-s, n, comp);
-		}
-		m = med3(x, l, m, n, comp); // Mid-size, med of 3
-	}
-	char v = x[m];
+  // Choose a partition element, v
+  int m = off + len/2;       // Small arrays, middle element
+  if (len > SMALL) {
+    int l = off;
+    int n = off + len - 1;
+    if (len > MEDIUM) {        // Big arrays, pseudomedian of 9
+    int s = len/8;
+    l = med3(x, l,     l+s, l+2*s, comp);
+    m = med3(x, m-s,   m,   m+s, comp);
+    n = med3(x, n-2*s, n-s, n, comp);
+    }
+    m = med3(x, l, m, n, comp); // Mid-size, med of 3
+  }
+  char v = x[m];
 
-	// Establish Invariant: v* (<v)* (>v)* v*
-	int a = off, b = a, c = off + len - 1, d = c;
-	while(true) {
-		int comparison;
-		while (b <= c && (comparison=comp.compare(x[b],v))<=0) {
-		if (comparison == 0)
-		    swap(x, a++, b);
-		b++;
-		}
-		while (c >= b && (comparison=comp.compare(x[c],v))>=0) {
-		if (comparison == 0)
-		    swap(x, c, d--);
-		c--;
-		}
-		if (b > c)
-		break;
-		swap(x, b++, c--);
-	}
+  // Establish Invariant: v* (<v)* (>v)* v*
+  int a = off, b = a, c = off + len - 1, d = c;
+  while(true) {
+    int comparison;
+    while (b <= c && (comparison=comp.compare(x[b],v))<=0) {
+    if (comparison == 0)
+        swap(x, a++, b);
+    b++;
+    }
+    while (c >= b && (comparison=comp.compare(x[c],v))>=0) {
+    if (comparison == 0)
+        swap(x, c, d--);
+    c--;
+    }
+    if (b > c)
+    break;
+    swap(x, b++, c--);
+  }
 
-	// Swap partition elements back to middle
-	int s, n = off + len;
-	s = Math.min(a-off, b-a  );  vecswap(x, off, b-s, s);
-	s = Math.min(d-c,   n-d-1);  vecswap(x, b,   n-s, s);
+  // Swap partition elements back to middle
+  int s, n = off + len;
+  s = Math.min(a-off, b-a  );  vecswap(x, off, b-s, s);
+  s = Math.min(d-c,   n-d-1);  vecswap(x, b,   n-s, s);
 
-	// Recursively sort non-partition-elements
-	if ((s = b-a) > 1)
-		quickSort1(x, off, s, comp);
-	if ((s = d-c) > 1)
-		quickSort1(x, n-s, s, comp);
+  // Recursively sort non-partition-elements
+  if ((s = b-a) > 1)
+    quickSort1(x, off, s, comp);
+  if ((s = d-c) > 1)
+    quickSort1(x, n-s, s, comp);
 }
 /**
  * Sorts the specified sub-array of chars into ascending order.
  */
 private static void quickSort1(double x[], int off, int len, DoubleComparator comp) {
-	// Insertion sort on smallest arrays
-	if (len < SMALL) {
-		for (int i=off; i<len+off; i++)
-		for (int j=i; j>off && comp.compare(x[j-1],x[j])>0; j--)
-		    swap(x, j, j-1);
-		return;
-	}
+  // Insertion sort on smallest arrays
+  if (len < SMALL) {
+    for (int i=off; i<len+off; i++)
+    for (int j=i; j>off && comp.compare(x[j-1],x[j])>0; j--)
+        swap(x, j, j-1);
+    return;
+  }
 
-	// Choose a partition element, v
-	int m = off + len/2;       // Small arrays, middle element
-	if (len > SMALL) {
-		int l = off;
-		int n = off + len - 1;
-		if (len > MEDIUM) {        // Big arrays, pseudomedian of 9
-		int s = len/8;
-		l = med3(x, l,     l+s, l+2*s, comp);
-		m = med3(x, m-s,   m,   m+s, comp);
-		n = med3(x, n-2*s, n-s, n, comp);
-		}
-		m = med3(x, l, m, n, comp); // Mid-size, med of 3
-	}
-	double v = x[m];
+  // Choose a partition element, v
+  int m = off + len/2;       // Small arrays, middle element
+  if (len > SMALL) {
+    int l = off;
+    int n = off + len - 1;
+    if (len > MEDIUM) {        // Big arrays, pseudomedian of 9
+    int s = len/8;
+    l = med3(x, l,     l+s, l+2*s, comp);
+    m = med3(x, m-s,   m,   m+s, comp);
+    n = med3(x, n-2*s, n-s, n, comp);
+    }
+    m = med3(x, l, m, n, comp); // Mid-size, med of 3
+  }
+  double v = x[m];
 
-	// Establish Invariant: v* (<v)* (>v)* v*
-	int a = off, b = a, c = off + len - 1, d = c;
-	while(true) {
-		int comparison;
-		while (b <= c && (comparison=comp.compare(x[b],v))<=0) {
-		if (comparison == 0)
-		    swap(x, a++, b);
-		b++;
-		}
-		while (c >= b && (comparison=comp.compare(x[c],v))>=0) {
-		if (comparison == 0)
-		    swap(x, c, d--);
-		c--;
-		}
-		if (b > c)
-		break;
-		swap(x, b++, c--);
-	}
+  // Establish Invariant: v* (<v)* (>v)* v*
+  int a = off, b = a, c = off + len - 1, d = c;
+  while(true) {
+    int comparison;
+    while (b <= c && (comparison=comp.compare(x[b],v))<=0) {
+    if (comparison == 0)
+        swap(x, a++, b);
+    b++;
+    }
+    while (c >= b && (comparison=comp.compare(x[c],v))>=0) {
+    if (comparison == 0)
+        swap(x, c, d--);
+    c--;
+    }
+    if (b > c)
+    break;
+    swap(x, b++, c--);
+  }
 
-	// Swap partition elements back to middle
-	int s, n = off + len;
-	s = Math.min(a-off, b-a  );  vecswap(x, off, b-s, s);
-	s = Math.min(d-c,   n-d-1);  vecswap(x, b,   n-s, s);
+  // Swap partition elements back to middle
+  int s, n = off + len;
+  s = Math.min(a-off, b-a  );  vecswap(x, off, b-s, s);
+  s = Math.min(d-c,   n-d-1);  vecswap(x, b,   n-s, s);
 
-	// Recursively sort non-partition-elements
-	if ((s = b-a) > 1)
-		quickSort1(x, off, s, comp);
-	if ((s = d-c) > 1)
-		quickSort1(x, n-s, s, comp);
+  // Recursively sort non-partition-elements
+  if ((s = b-a) > 1)
+    quickSort1(x, off, s, comp);
+  if ((s = d-c) > 1)
+    quickSort1(x, n-s, s, comp);
 }
 /**
  * Sorts the specified sub-array of chars into ascending order.
  */
 private static void quickSort1(float x[], int off, int len, FloatComparator comp) {
-	// Insertion sort on smallest arrays
-	if (len < SMALL) {
-		for (int i=off; i<len+off; i++)
-		for (int j=i; j>off && comp.compare(x[j-1],x[j])>0; j--)
-		    swap(x, j, j-1);
-		return;
-	}
+  // Insertion sort on smallest arrays
+  if (len < SMALL) {
+    for (int i=off; i<len+off; i++)
+    for (int j=i; j>off && comp.compare(x[j-1],x[j])>0; j--)
+        swap(x, j, j-1);
+    return;
+  }
 
-	// Choose a partition element, v
-	int m = off + len/2;       // Small arrays, middle element
-	if (len > SMALL) {
-		int l = off;
-		int n = off + len - 1;
-		if (len > MEDIUM) {        // Big arrays, pseudomedian of 9
-		int s = len/8;
-		l = med3(x, l,     l+s, l+2*s, comp);
-		m = med3(x, m-s,   m,   m+s, comp);
-		n = med3(x, n-2*s, n-s, n, comp);
-		}
-		m = med3(x, l, m, n, comp); // Mid-size, med of 3
-	}
-	float v = x[m];
+  // Choose a partition element, v
+  int m = off + len/2;       // Small arrays, middle element
+  if (len > SMALL) {
+    int l = off;
+    int n = off + len - 1;
+    if (len > MEDIUM) {        // Big arrays, pseudomedian of 9
+    int s = len/8;
+    l = med3(x, l,     l+s, l+2*s, comp);
+    m = med3(x, m-s,   m,   m+s, comp);
+    n = med3(x, n-2*s, n-s, n, comp);
+    }
+    m = med3(x, l, m, n, comp); // Mid-size, med of 3
+  }
+  float v = x[m];
 
-	// Establish Invariant: v* (<v)* (>v)* v*
-	int a = off, b = a, c = off + len - 1, d = c;
-	while(true) {
-		int comparison;
-		while (b <= c && (comparison=comp.compare(x[b],v))<=0) {
-		if (comparison == 0)
-		    swap(x, a++, b);
-		b++;
-		}
-		while (c >= b && (comparison=comp.compare(x[c],v))>=0) {
-		if (comparison == 0)
-		    swap(x, c, d--);
-		c--;
-		}
-		if (b > c)
-		break;
-		swap(x, b++, c--);
-	}
+  // Establish Invariant: v* (<v)* (>v)* v*
+  int a = off, b = a, c = off + len - 1, d = c;
+  while(true) {
+    int comparison;
+    while (b <= c && (comparison=comp.compare(x[b],v))<=0) {
+    if (comparison == 0)
+        swap(x, a++, b);
+    b++;
+    }
+    while (c >= b && (comparison=comp.compare(x[c],v))>=0) {
+    if (comparison == 0)
+        swap(x, c, d--);
+    c--;
+    }
+    if (b > c)
+    break;
+    swap(x, b++, c--);
+  }
 
-	// Swap partition elements back to middle
-	int s, n = off + len;
-	s = Math.min(a-off, b-a  );  vecswap(x, off, b-s, s);
-	s = Math.min(d-c,   n-d-1);  vecswap(x, b,   n-s, s);
+  // Swap partition elements back to middle
+  int s, n = off + len;
+  s = Math.min(a-off, b-a  );  vecswap(x, off, b-s, s);
+  s = Math.min(d-c,   n-d-1);  vecswap(x, b,   n-s, s);
 
-	// Recursively sort non-partition-elements
-	if ((s = b-a) > 1)
-		quickSort1(x, off, s, comp);
-	if ((s = d-c) > 1)
-		quickSort1(x, n-s, s, comp);
+  // Recursively sort non-partition-elements
+  if ((s = b-a) > 1)
+    quickSort1(x, off, s, comp);
+  if ((s = d-c) > 1)
+    quickSort1(x, n-s, s, comp);
 }
 /**
  * Sorts the specified sub-array of chars into ascending order.
  */
 private static void quickSort1(int x[], int off, int len, IntComparator comp) {
-	// Insertion sort on smallest arrays
-	if (len < SMALL) {
-		for (int i=off; i<len+off; i++)
-		for (int j=i; j>off && comp.compare(x[j-1],x[j])>0; j--)
-		    swap(x, j, j-1);
-		return;
-	}
+  // Insertion sort on smallest arrays
+  if (len < SMALL) {
+    for (int i=off; i<len+off; i++)
+    for (int j=i; j>off && comp.compare(x[j-1],x[j])>0; j--)
+        swap(x, j, j-1);
+    return;
+  }
 
-	// Choose a partition element, v
-	int m = off + len/2;       // Small arrays, middle element
-	if (len > SMALL) {
-		int l = off;
-		int n = off + len - 1;
-		if (len > MEDIUM) {        // Big arrays, pseudomedian of 9
-		int s = len/8;
-		l = med3(x, l,     l+s, l+2*s, comp);
-		m = med3(x, m-s,   m,   m+s, comp);
-		n = med3(x, n-2*s, n-s, n, comp);
-		}
-		m = med3(x, l, m, n, comp); // Mid-size, med of 3
-	}
-	int v = x[m];
+  // Choose a partition element, v
+  int m = off + len/2;       // Small arrays, middle element
+  if (len > SMALL) {
+    int l = off;
+    int n = off + len - 1;
+    if (len > MEDIUM) {        // Big arrays, pseudomedian of 9
+    int s = len/8;
+    l = med3(x, l,     l+s, l+2*s, comp);
+    m = med3(x, m-s,   m,   m+s, comp);
+    n = med3(x, n-2*s, n-s, n, comp);
+    }
+    m = med3(x, l, m, n, comp); // Mid-size, med of 3
+  }
+  int v = x[m];
 
-	// Establish Invariant: v* (<v)* (>v)* v*
-	int a = off, b = a, c = off + len - 1, d = c;
-	while(true) {
-		int comparison;
-		while (b <= c && (comparison=comp.compare(x[b],v))<=0) {
-		if (comparison == 0)
-		    swap(x, a++, b);
-		b++;
-		}
-		while (c >= b && (comparison=comp.compare(x[c],v))>=0) {
-		if (comparison == 0)
-		    swap(x, c, d--);
-		c--;
-		}
-		if (b > c)
-		break;
-		swap(x, b++, c--);
-	}
+  // Establish Invariant: v* (<v)* (>v)* v*
+  int a = off, b = a, c = off + len - 1, d = c;
+  while(true) {
+    int comparison;
+    while (b <= c && (comparison=comp.compare(x[b],v))<=0) {
+    if (comparison == 0)
+        swap(x, a++, b);
+    b++;
+    }
+    while (c >= b && (comparison=comp.compare(x[c],v))>=0) {
+    if (comparison == 0)
+        swap(x, c, d--);
+    c--;
+    }
+    if (b > c)
+    break;
+    swap(x, b++, c--);
+  }
 
-	// Swap partition elements back to middle
-	int s, n = off + len;
-	s = Math.min(a-off, b-a  );  vecswap(x, off, b-s, s);
-	s = Math.min(d-c,   n-d-1);  vecswap(x, b,   n-s, s);
+  // Swap partition elements back to middle
+  int s, n = off + len;
+  s = Math.min(a-off, b-a  );  vecswap(x, off, b-s, s);
+  s = Math.min(d-c,   n-d-1);  vecswap(x, b,   n-s, s);
 
-	// Recursively sort non-partition-elements
-	if ((s = b-a) > 1)
-		quickSort1(x, off, s, comp);
-	if ((s = d-c) > 1)
-		quickSort1(x, n-s, s, comp);
+  // Recursively sort non-partition-elements
+  if ((s = b-a) > 1)
+    quickSort1(x, off, s, comp);
+  if ((s = d-c) > 1)
+    quickSort1(x, n-s, s, comp);
 }
 /**
  * Sorts the specified sub-array of chars into ascending order.
  */
 private static void quickSort1(long x[], int off, int len, LongComparator comp) {
-	// Insertion sort on smallest arrays
-	if (len < SMALL) {
-		for (int i=off; i<len+off; i++)
-		for (int j=i; j>off && comp.compare(x[j-1],x[j])>0; j--)
-		    swap(x, j, j-1);
-		return;
-	}
+  // Insertion sort on smallest arrays
+  if (len < SMALL) {
+    for (int i=off; i<len+off; i++)
+    for (int j=i; j>off && comp.compare(x[j-1],x[j])>0; j--)
+        swap(x, j, j-1);
+    return;
+  }
 
-	// Choose a partition element, v
-	int m = off + len/2;       // Small arrays, middle element
-	if (len > SMALL) {
-		int l = off;
-		int n = off + len - 1;
-		if (len > MEDIUM) {        // Big arrays, pseudomedian of 9
-		int s = len/8;
-		l = med3(x, l,     l+s, l+2*s, comp);
-		m = med3(x, m-s,   m,   m+s, comp);
-		n = med3(x, n-2*s, n-s, n, comp);
-		}
-		m = med3(x, l, m, n, comp); // Mid-size, med of 3
-	}
-	long v = x[m];
+  // Choose a partition element, v
+  int m = off + len/2;       // Small arrays, middle element
+  if (len > SMALL) {
+    int l = off;
+    int n = off + len - 1;
+    if (len > MEDIUM) {        // Big arrays, pseudomedian of 9
+    int s = len/8;
+    l = med3(x, l,     l+s, l+2*s, comp);
+    m = med3(x, m-s,   m,   m+s, comp);
+    n = med3(x, n-2*s, n-s, n, comp);
+    }
+    m = med3(x, l, m, n, comp); // Mid-size, med of 3
+  }
+  long v = x[m];
 
-	// Establish Invariant: v* (<v)* (>v)* v*
-	int a = off, b = a, c = off + len - 1, d = c;
-	while(true) {
-		int comparison;
-		while (b <= c && (comparison=comp.compare(x[b],v))<=0) {
-		if (comparison == 0)
-		    swap(x, a++, b);
-		b++;
-		}
-		while (c >= b && (comparison=comp.compare(x[c],v))>=0) {
-		if (comparison == 0)
-		    swap(x, c, d--);
-		c--;
-		}
-		if (b > c)
-		break;
-		swap(x, b++, c--);
-	}
+  // Establish Invariant: v* (<v)* (>v)* v*
+  int a = off, b = a, c = off + len - 1, d = c;
+  while(true) {
+    int comparison;
+    while (b <= c && (comparison=comp.compare(x[b],v))<=0) {
+    if (comparison == 0)
+        swap(x, a++, b);
+    b++;
+    }
+    while (c >= b && (comparison=comp.compare(x[c],v))>=0) {
+    if (comparison == 0)
+        swap(x, c, d--);
+    c--;
+    }
+    if (b > c)
+    break;
+    swap(x, b++, c--);
+  }
 
-	// Swap partition elements back to middle
-	int s, n = off + len;
-	s = Math.min(a-off, b-a  );  vecswap(x, off, b-s, s);
-	s = Math.min(d-c,   n-d-1);  vecswap(x, b,   n-s, s);
+  // Swap partition elements back to middle
+  int s, n = off + len;
+  s = Math.min(a-off, b-a  );  vecswap(x, off, b-s, s);
+  s = Math.min(d-c,   n-d-1);  vecswap(x, b,   n-s, s);
 
-	// Recursively sort non-partition-elements
-	if ((s = b-a) > 1)
-		quickSort1(x, off, s, comp);
-	if ((s = d-c) > 1)
-		quickSort1(x, n-s, s, comp);
+  // Recursively sort non-partition-elements
+  if ((s = b-a) > 1)
+    quickSort1(x, off, s, comp);
+  if ((s = d-c) > 1)
+    quickSort1(x, n-s, s, comp);
 }
 /**
  * Sorts the specified sub-array of chars into ascending order.
  */
 private static void quickSort1(Object x[], int off, int len) {
-	// Insertion sort on smallest arrays
-	if (len < SMALL) {
-	    for (int i=off; i<len+off; i++)
-		for (int j=i; j>off && ((Comparable)x[j-1]).compareTo((Comparable)x[j])>0; j--)
-		    swap(x, j, j-1);
-	    return;
-	}
+  // Insertion sort on smallest arrays
+  if (len < SMALL) {
+      for (int i=off; i<len+off; i++)
+    for (int j=i; j>off && ((Comparable)x[j-1]).compareTo((Comparable)x[j])>0; j--)
+        swap(x, j, j-1);
+      return;
+  }
 
-	// Choose a partition element, v
-	int m = off + len/2;       // Small arrays, middle element
-	if (len > SMALL) {
-	    int l = off;
-	    int n = off + len - 1;
-	    if (len > MEDIUM) {        // Big arrays, pseudomedian of 9
-		int s = len/8;
-		l = med3(x, l,     l+s, l+2*s);
-		m = med3(x, m-s,   m,   m+s);
-		n = med3(x, n-2*s, n-s, n);
-	    }
-	    m = med3(x, l, m, n); // Mid-size, med of 3
-	}
-	Comparable v = (Comparable)x[m];
+  // Choose a partition element, v
+  int m = off + len/2;       // Small arrays, middle element
+  if (len > SMALL) {
+      int l = off;
+      int n = off + len - 1;
+      if (len > MEDIUM) {        // Big arrays, pseudomedian of 9
+    int s = len/8;
+    l = med3(x, l,     l+s, l+2*s);
+    m = med3(x, m-s,   m,   m+s);
+    n = med3(x, n-2*s, n-s, n);
+      }
+      m = med3(x, l, m, n); // Mid-size, med of 3
+  }
+  Comparable v = (Comparable)x[m];
 
-	// Establish Invariant: v* (<v)* (>v)* v*
-	int a = off, b = a, c = off + len - 1, d = c;
-	while(true) {
-		int comparison;
-	    while (b <= c && (comparison=((Comparable)x[b]).compareTo(v))<=0) {
-		if (comparison == 0)
-		    swap(x, a++, b);
-		b++;
-	    }
-	    while (c >= b && (comparison=((Comparable)x[c]).compareTo(v))>=0) {
-		if (comparison == 0)
-		    swap(x, c, d--);
-		c--;
-	    }
-	    if (b > c)
-		break;
-	    swap(x, b++, c--);
-	}
+  // Establish Invariant: v* (<v)* (>v)* v*
+  int a = off, b = a, c = off + len - 1, d = c;
+  while(true) {
+    int comparison;
+      while (b <= c && (comparison=((Comparable)x[b]).compareTo(v))<=0) {
+    if (comparison == 0)
+        swap(x, a++, b);
+    b++;
+      }
+      while (c >= b && (comparison=((Comparable)x[c]).compareTo(v))>=0) {
+    if (comparison == 0)
+        swap(x, c, d--);
+    c--;
+      }
+      if (b > c)
+    break;
+      swap(x, b++, c--);
+  }
 
-	// Swap partition elements back to middle
-	int s, n = off + len;
-	s = Math.min(a-off, b-a  );  vecswap(x, off, b-s, s);
-	s = Math.min(d-c,   n-d-1);  vecswap(x, b,   n-s, s);
+  // Swap partition elements back to middle
+  int s, n = off + len;
+  s = Math.min(a-off, b-a  );  vecswap(x, off, b-s, s);
+  s = Math.min(d-c,   n-d-1);  vecswap(x, b,   n-s, s);
 
-	// Recursively sort non-partition-elements
-	if ((s = b-a) > 1)
-	    quickSort1(x, off, s);
-	if ((s = d-c) > 1)
-	    quickSort1(x, n-s, s);
+  // Recursively sort non-partition-elements
+  if ((s = b-a) > 1)
+      quickSort1(x, off, s);
+  if ((s = d-c) > 1)
+      quickSort1(x, n-s, s);
 }
 /**
  * Sorts the specified sub-array of chars into ascending order.
  */
 private static void quickSort1(Object x[], int off, int len, Comparator comp) {
-	// Insertion sort on smallest arrays
-	if (len < SMALL) {
-		for (int i=off; i<len+off; i++)
-		for (int j=i; j>off && comp.compare(x[j-1],x[j])>0; j--)
-		    swap(x, j, j-1);
-		return;
-	}
+  // Insertion sort on smallest arrays
+  if (len < SMALL) {
+    for (int i=off; i<len+off; i++)
+    for (int j=i; j>off && comp.compare(x[j-1],x[j])>0; j--)
+        swap(x, j, j-1);
+    return;
+  }
 
-	// Choose a partition element, v
-	int m = off + len/2;       // Small arrays, middle element
-	if (len > SMALL) {
-		int l = off;
-		int n = off + len - 1;
-		if (len > MEDIUM) {        // Big arrays, pseudomedian of 9
-		int s = len/8;
-		l = med3(x, l,     l+s, l+2*s, comp);
-		m = med3(x, m-s,   m,   m+s, comp);
-		n = med3(x, n-2*s, n-s, n, comp);
-		}
-		m = med3(x, l, m, n, comp); // Mid-size, med of 3
-	}
-	Object v = x[m];
+  // Choose a partition element, v
+  int m = off + len/2;       // Small arrays, middle element
+  if (len > SMALL) {
+    int l = off;
+    int n = off + len - 1;
+    if (len > MEDIUM) {        // Big arrays, pseudomedian of 9
+    int s = len/8;
+    l = med3(x, l,     l+s, l+2*s, comp);
+    m = med3(x, m-s,   m,   m+s, comp);
+    n = med3(x, n-2*s, n-s, n, comp);
+    }
+    m = med3(x, l, m, n, comp); // Mid-size, med of 3
+  }
+  Object v = x[m];
 
-	// Establish Invariant: v* (<v)* (>v)* v*
-	int a = off, b = a, c = off + len - 1, d = c;
-	while(true) {
-		int comparison;
-		while (b <= c && (comparison=comp.compare(x[b],v))<=0) {
-		if (comparison == 0)
-		    swap(x, a++, b);
-		b++;
-		}
-		while (c >= b && (comparison=comp.compare(x[c],v))>=0) {
-		if (comparison == 0)
-		    swap(x, c, d--);
-		c--;
-		}
-		if (b > c)
-		break;
-		swap(x, b++, c--);
-	}
+  // Establish Invariant: v* (<v)* (>v)* v*
+  int a = off, b = a, c = off + len - 1, d = c;
+  while(true) {
+    int comparison;
+    while (b <= c && (comparison=comp.compare(x[b],v))<=0) {
+    if (comparison == 0)
+        swap(x, a++, b);
+    b++;
+    }
+    while (c >= b && (comparison=comp.compare(x[c],v))>=0) {
+    if (comparison == 0)
+        swap(x, c, d--);
+    c--;
+    }
+    if (b > c)
+    break;
+    swap(x, b++, c--);
+  }
 
-	// Swap partition elements back to middle
-	int s, n = off + len;
-	s = Math.min(a-off, b-a  );  vecswap(x, off, b-s, s);
-	s = Math.min(d-c,   n-d-1);  vecswap(x, b,   n-s, s);
+  // Swap partition elements back to middle
+  int s, n = off + len;
+  s = Math.min(a-off, b-a  );  vecswap(x, off, b-s, s);
+  s = Math.min(d-c,   n-d-1);  vecswap(x, b,   n-s, s);
 
-	// Recursively sort non-partition-elements
-	if ((s = b-a) > 1)
-		quickSort1(x, off, s, comp);
-	if ((s = d-c) > 1)
-		quickSort1(x, n-s, s, comp);
+  // Recursively sort non-partition-elements
+  if ((s = b-a) > 1)
+    quickSort1(x, off, s, comp);
+  if ((s = d-c) > 1)
+    quickSort1(x, n-s, s, comp);
 }
 /**
  * Sorts the specified sub-array of chars into ascending order.
  */
 private static void quickSort1(short x[], int off, int len, ShortComparator comp) {
-	// Insertion sort on smallest arrays
-	if (len < SMALL) {
-		for (int i=off; i<len+off; i++)
-		for (int j=i; j>off && comp.compare(x[j-1],x[j])>0; j--)
-		    swap(x, j, j-1);
-		return;
-	}
+  // Insertion sort on smallest arrays
+  if (len < SMALL) {
+    for (int i=off; i<len+off; i++)
+    for (int j=i; j>off && comp.compare(x[j-1],x[j])>0; j--)
+        swap(x, j, j-1);
+    return;
+  }
 
-	// Choose a partition element, v
-	int m = off + len/2;       // Small arrays, middle element
-	if (len > SMALL) {
-		int l = off;
-		int n = off + len - 1;
-		if (len > MEDIUM) {        // Big arrays, pseudomedian of 9
-		int s = len/8;
-		l = med3(x, l,     l+s, l+2*s, comp);
-		m = med3(x, m-s,   m,   m+s, comp);
-		n = med3(x, n-2*s, n-s, n, comp);
-		}
-		m = med3(x, l, m, n, comp); // Mid-size, med of 3
-	}
-	short v = x[m];
+  // Choose a partition element, v
+  int m = off + len/2;       // Small arrays, middle element
+  if (len > SMALL) {
+    int l = off;
+    int n = off + len - 1;
+    if (len > MEDIUM) {        // Big arrays, pseudomedian of 9
+    int s = len/8;
+    l = med3(x, l,     l+s, l+2*s, comp);
+    m = med3(x, m-s,   m,   m+s, comp);
+    n = med3(x, n-2*s, n-s, n, comp);
+    }
+    m = med3(x, l, m, n, comp); // Mid-size, med of 3
+  }
+  short v = x[m];
 
-	// Establish Invariant: v* (<v)* (>v)* v*
-	int a = off, b = a, c = off + len - 1, d = c;
-	while(true) {
-		int comparison;
-		while (b <= c && (comparison=comp.compare(x[b],v))<=0) {
-		if (comparison == 0)
-		    swap(x, a++, b);
-		b++;
-		}
-		while (c >= b && (comparison=comp.compare(x[c],v))>=0) {
-		if (comparison == 0)
-		    swap(x, c, d--);
-		c--;
-		}
-		if (b > c)
-		break;
-		swap(x, b++, c--);
-	}
+  // Establish Invariant: v* (<v)* (>v)* v*
+  int a = off, b = a, c = off + len - 1, d = c;
+  while(true) {
+    int comparison;
+    while (b <= c && (comparison=comp.compare(x[b],v))<=0) {
+    if (comparison == 0)
+        swap(x, a++, b);
+    b++;
+    }
+    while (c >= b && (comparison=comp.compare(x[c],v))>=0) {
+    if (comparison == 0)
+        swap(x, c, d--);
+    c--;
+    }
+    if (b > c)
+    break;
+    swap(x, b++, c--);
+  }
 
-	// Swap partition elements back to middle
-	int s, n = off + len;
-	s = Math.min(a-off, b-a  );  vecswap(x, off, b-s, s);
-	s = Math.min(d-c,   n-d-1);  vecswap(x, b,   n-s, s);
+  // Swap partition elements back to middle
+  int s, n = off + len;
+  s = Math.min(a-off, b-a  );  vecswap(x, off, b-s, s);
+  s = Math.min(d-c,   n-d-1);  vecswap(x, b,   n-s, s);
 
-	// Recursively sort non-partition-elements
-	if ((s = b-a) > 1)
-		quickSort1(x, off, s, comp);
-	if ((s = d-c) > 1)
-		quickSort1(x, n-s, s, comp);
+  // Recursively sort non-partition-elements
+  if ((s = b-a) > 1)
+    quickSort1(x, off, s, comp);
+  if ((s = d-c) > 1)
+    quickSort1(x, n-s, s, comp);
 }
 /**
  * Check that fromIndex and toIndex are in range, and throw an
  * appropriate exception if they aren't.
  */
 private static void rangeCheck(int arrayLen, int fromIndex, int toIndex) {
-	if (fromIndex > toIndex)
-		throw new IllegalArgumentException("fromIndex(" + fromIndex +
-				   ") > toIndex(" + toIndex+")");
-	if (fromIndex < 0)
-		throw new ArrayIndexOutOfBoundsException(fromIndex);
-	if (toIndex > arrayLen)
-		throw new ArrayIndexOutOfBoundsException(toIndex);
+  if (fromIndex > toIndex)
+    throw new IllegalArgumentException("fromIndex(" + fromIndex +
+           ") > toIndex(" + toIndex+")");
+  if (fromIndex < 0)
+    throw new ArrayIndexOutOfBoundsException(fromIndex);
+  if (toIndex > arrayLen)
+    throw new ArrayIndexOutOfBoundsException(toIndex);
 }
 /**
  * Swaps x[a] with x[b].
  */
 private static void swap(byte x[], int a, int b) {
-	byte t = x[a];
-	x[a] = x[b];
-	x[b] = t;
+  byte t = x[a];
+  x[a] = x[b];
+  x[b] = t;
 }
 /**
  * Swaps x[a] with x[b].
  */
 private static void swap(char x[], int a, int b) {
-	char t = x[a];
-	x[a] = x[b];
-	x[b] = t;
+  char t = x[a];
+  x[a] = x[b];
+  x[b] = t;
 }
 /**
  * Swaps x[a] with x[b].
  */
 private static void swap(double x[], int a, int b) {
-	double t = x[a];
-	x[a] = x[b];
-	x[b] = t;
+  double t = x[a];
+  x[a] = x[b];
+  x[b] = t;
 }
 /**
  * Swaps x[a] with x[b].
  */
 private static void swap(float x[], int a, int b) {
-	float t = x[a];
-	x[a] = x[b];
-	x[b] = t;
+  float t = x[a];
+  x[a] = x[b];
+  x[b] = t;
 }
 /**
  * Swaps x[a] with x[b].
  */
 private static void swap(int x[], int a, int b) {
-	int t = x[a];
-	x[a] = x[b];
-	x[b] = t;
+  int t = x[a];
+  x[a] = x[b];
+  x[b] = t;
 }
 /**
  * Swaps x[a] with x[b].
  */
 private static void swap(long x[], int a, int b) {
-	long t = x[a];
-	x[a] = x[b];
-	x[b] = t;
+  long t = x[a];
+  x[a] = x[b];
+  x[b] = t;
 }
 /**
  * Swaps x[a] with x[b].
  */
 private static void swap(Object x[], int a, int b) {
-	Object t = x[a];
-	x[a] = x[b];
-	x[b] = t;
+  Object t = x[a];
+  x[a] = x[b];
+  x[b] = t;
 }
 /**
  * Swaps x[a] with x[b].
  */
 private static void swap(short x[], int a, int b) {
-	short t = x[a];
-	x[a] = x[b];
-	x[b] = t;
+  short t = x[a];
+  x[a] = x[b];
+  x[b] = t;
 }
-	/**
-	 * Swaps x[a .. (a+n-1)] with x[b .. (b+n-1)].
-	 */
-	private static void vecswap(byte x[], int a, int b, int n) {
-	for (int i=0; i<n; i++, a++, b++)
-	    swap(x, a, b);
-	}
-	/**
-	 * Swaps x[a .. (a+n-1)] with x[b .. (b+n-1)].
-	 */
-	private static void vecswap(char x[], int a, int b, int n) {
-	for (int i=0; i<n; i++, a++, b++)
-	    swap(x, a, b);
-	}
-	/**
-	 * Swaps x[a .. (a+n-1)] with x[b .. (b+n-1)].
-	 */
-	private static void vecswap(double x[], int a, int b, int n) {
-	for (int i=0; i<n; i++, a++, b++)
-	    swap(x, a, b);
-	}
-	/**
-	 * Swaps x[a .. (a+n-1)] with x[b .. (b+n-1)].
-	 */
-	private static void vecswap(float x[], int a, int b, int n) {
-	for (int i=0; i<n; i++, a++, b++)
-	    swap(x, a, b);
-	}
-	/**
-	 * Swaps x[a .. (a+n-1)] with x[b .. (b+n-1)].
-	 */
-	private static void vecswap(int x[], int a, int b, int n) {
-	for (int i=0; i<n; i++, a++, b++)
-	    swap(x, a, b);
-	}
-	/**
-	 * Swaps x[a .. (a+n-1)] with x[b .. (b+n-1)].
-	 */
-	private static void vecswap(long x[], int a, int b, int n) {
-	for (int i=0; i<n; i++, a++, b++)
-	    swap(x, a, b);
-	}
-	/**
-	 * Swaps x[a .. (a+n-1)] with x[b .. (b+n-1)].
-	 */
-	private static void vecswap(Object x[], int a, int b, int n) {
-	for (int i=0; i<n; i++, a++, b++)
-	    swap(x, a, b);
-	}
-	/**
-	 * Swaps x[a .. (a+n-1)] with x[b .. (b+n-1)].
-	 */
-	private static void vecswap(short x[], int a, int b, int n) {
-	for (int i=0; i<n; i++, a++, b++)
-	    swap(x, a, b);
-	}
+  /**
+   * Swaps x[a .. (a+n-1)] with x[b .. (b+n-1)].
+   */
+  private static void vecswap(byte x[], int a, int b, int n) {
+  for (int i=0; i<n; i++, a++, b++)
+      swap(x, a, b);
+  }
+  /**
+   * Swaps x[a .. (a+n-1)] with x[b .. (b+n-1)].
+   */
+  private static void vecswap(char x[], int a, int b, int n) {
+  for (int i=0; i<n; i++, a++, b++)
+      swap(x, a, b);
+  }
+  /**
+   * Swaps x[a .. (a+n-1)] with x[b .. (b+n-1)].
+   */
+  private static void vecswap(double x[], int a, int b, int n) {
+  for (int i=0; i<n; i++, a++, b++)
+      swap(x, a, b);
+  }
+  /**
+   * Swaps x[a .. (a+n-1)] with x[b .. (b+n-1)].
+   */
+  private static void vecswap(float x[], int a, int b, int n) {
+  for (int i=0; i<n; i++, a++, b++)
+      swap(x, a, b);
+  }
+  /**
+   * Swaps x[a .. (a+n-1)] with x[b .. (b+n-1)].
+   */
+  private static void vecswap(int x[], int a, int b, int n) {
+  for (int i=0; i<n; i++, a++, b++)
+      swap(x, a, b);
+  }
+  /**
+   * Swaps x[a .. (a+n-1)] with x[b .. (b+n-1)].
+   */
+  private static void vecswap(long x[], int a, int b, int n) {
+  for (int i=0; i<n; i++, a++, b++)
+      swap(x, a, b);
+  }
+  /**
+   * Swaps x[a .. (a+n-1)] with x[b .. (b+n-1)].
+   */
+  private static void vecswap(Object x[], int a, int b, int n) {
+  for (int i=0; i<n; i++, a++, b++)
+      swap(x, a, b);
+  }
+  /**
+   * Swaps x[a .. (a+n-1)] with x[b .. (b+n-1)].
+   */
+  private static void vecswap(short x[], int a, int b, int n) {
+  for (int i=0; i<n; i++, a++, b++)
+      swap(x, a, b);
+  }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/buffer/IntBufferConsumer.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/buffer/IntBufferConsumer.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/buffer/IntBufferConsumer.java	(working copy)
@@ -12,8 +12,6 @@
 /**
  * Target of a streaming <tt>IntBuffer</tt> into which data is flushed upon buffer overflow.
  *
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 09/24/99
  */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
Index: matrix/src/main/java/org/apache/mahout/matrix/buffer/ObjectBuffer.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/buffer/ObjectBuffer.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/buffer/ObjectBuffer.java	(working copy)
@@ -12,32 +12,30 @@
 /**
  * Fixed sized (non resizable) streaming buffer connected to a target <tt>ObjectBufferConsumer</tt> to which data is automatically flushed upon buffer overflow.
  *
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 09/24/99
  */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
  */
 @Deprecated
 public class ObjectBuffer extends org.apache.mahout.matrix.PersistentObject implements ObjectBufferConsumer {
-	protected ObjectBufferConsumer target;
-	protected Object[] elements;
+  protected ObjectBufferConsumer target;
+  protected Object[] elements;
 
-	// vars cached for speed
-	protected ObjectArrayList list;
-	protected int capacity;
-	protected int size; 
+  // vars cached for speed
+  protected ObjectArrayList list;
+  protected int capacity;
+  protected int size; 
 /**
  * Constructs and returns a new buffer with the given target.
  * @param target the target to flush to.
  * @param capacity the number of points the buffer shall be capable of holding before overflowing and flushing to the target.
  */
 public ObjectBuffer(ObjectBufferConsumer target, int capacity) {
-	this.target = target;
-	this.capacity = capacity;
-	this.elements = new Object[capacity];
-	this.list = new ObjectArrayList(elements);
-	this.size = 0;
+  this.target = target;
+  this.capacity = capacity;
+  this.elements = new Object[capacity];
+  this.list = new ObjectArrayList(elements);
+  this.size = 0;
 }
 /**
  * Adds the specified element to the receiver.
@@ -45,33 +43,33 @@
  * @param element the element to add.
  */
 public void add(Object element) {
-	if (this.size == this.capacity) flush();
-	this.elements[size++] = element;
+  if (this.size == this.capacity) flush();
+  this.elements[size++] = element;
 }
 /**
  * Adds all elements of the specified list to the receiver.
  * @param list the list of which all elements shall be added.
  */
 public void addAllOf(ObjectArrayList list) {
-	int listSize = list.size();
-	if (this.size + listSize >= this.capacity) flush();
-	this.target.addAllOf(list);
+  int listSize = list.size();
+  if (this.size + listSize >= this.capacity) flush();
+  this.target.addAllOf(list);
 }
 /**
  * Sets the receiver's size to zero.
  * In other words, forgets about any internally buffered elements.
  */
 public void clear() {
-	this.size = 0;
+  this.size = 0;
 }
 /**
  * Adds all internally buffered elements to the receiver's target, then resets the current buffer size to zero.
  */
 public void flush() {
-	if (this.size > 0) {
-		list.setSize(this.size);
-		this.target.addAllOf(list);
-		this.size = 0;
-	}
+  if (this.size > 0) {
+    list.setSize(this.size);
+    this.target.addAllOf(list);
+    this.size = 0;
+  }
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/buffer/DoubleBuffer.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/buffer/DoubleBuffer.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/buffer/DoubleBuffer.java	(working copy)
@@ -12,32 +12,30 @@
 /**
  * Fixed sized (non resizable) streaming buffer connected to a target <tt>DoubleBufferConsumer</tt> to which data is automatically flushed upon buffer overflow.
  *
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 09/24/99
  */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
  */
 @Deprecated
 public class DoubleBuffer extends org.apache.mahout.matrix.PersistentObject implements DoubleBufferConsumer {
-	protected DoubleBufferConsumer target;
-	protected double[] elements;
+  protected DoubleBufferConsumer target;
+  protected double[] elements;
 
-	// vars cached for speed
-	protected DoubleArrayList list;
-	protected int capacity;
-	protected int size; 
+  // vars cached for speed
+  protected DoubleArrayList list;
+  protected int capacity;
+  protected int size; 
 /**
  * Constructs and returns a new buffer with the given target.
  * @param target the target to flush to.
  * @param capacity the number of points the buffer shall be capable of holding before overflowing and flushing to the target.
  */
 public DoubleBuffer(DoubleBufferConsumer target, int capacity) {
-	this.target = target;
-	this.capacity = capacity;
-	this.elements = new double[capacity];
-	this.list = new DoubleArrayList(elements);
-	this.size = 0;
+  this.target = target;
+  this.capacity = capacity;
+  this.elements = new double[capacity];
+  this.list = new DoubleArrayList(elements);
+  this.size = 0;
 }
 /**
  * Adds the specified element to the receiver.
@@ -45,33 +43,33 @@
  * @param element the element to add.
  */
 public void add(double element) {
-	if (this.size == this.capacity) flush();
-	this.elements[size++] = element;
+  if (this.size == this.capacity) flush();
+  this.elements[size++] = element;
 }
 /**
  * Adds all elements of the specified list to the receiver.
  * @param list the list of which all elements shall be added.
  */
 public void addAllOf(DoubleArrayList list) {
-	int listSize = list.size();
-	if (this.size + listSize >= this.capacity) flush();
-	this.target.addAllOf(list);
+  int listSize = list.size();
+  if (this.size + listSize >= this.capacity) flush();
+  this.target.addAllOf(list);
 }
 /**
  * Sets the receiver's size to zero.
  * In other words, forgets about any internally buffered elements.
  */
 public void clear() {
-	this.size = 0;
+  this.size = 0;
 }
 /**
  * Adds all internally buffered elements to the receiver's target, then resets the current buffer size to zero.
  */
 public void flush() {
-	if (this.size > 0) {
-		list.setSize(this.size);
-		this.target.addAllOf(list);
-		this.size = 0;
-	}
+  if (this.size > 0) {
+    list.setSize(this.size);
+    this.target.addAllOf(list);
+    this.size = 0;
+  }
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/buffer/DoubleBuffer2DConsumer.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/buffer/DoubleBuffer2DConsumer.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/buffer/DoubleBuffer2DConsumer.java	(working copy)
@@ -12,8 +12,6 @@
 /**
  * Target of a streaming <tt>DoubleBuffer2D</tt> into which data is flushed upon buffer overflow.
  *
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 09/24/99
  */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
Index: matrix/src/main/java/org/apache/mahout/matrix/buffer/DoubleBuffer3DConsumer.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/buffer/DoubleBuffer3DConsumer.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/buffer/DoubleBuffer3DConsumer.java	(working copy)
@@ -12,8 +12,6 @@
 /**
  * Target of a streaming <tt>DoubleBuffer3D</tt> into which data is flushed upon buffer overflow.
  *
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 09/24/99
  */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
Index: matrix/src/main/java/org/apache/mahout/matrix/buffer/IntBuffer2D.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/buffer/IntBuffer2D.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/buffer/IntBuffer2D.java	(working copy)
@@ -12,36 +12,34 @@
 /**
  * Fixed sized (non resizable) streaming buffer connected to a target <tt>IntBuffer2DConsumer</tt> to which data is automatically flushed upon buffer overflow.
  *
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 09/24/99
  */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
  */
 @Deprecated
 public class IntBuffer2D extends org.apache.mahout.matrix.PersistentObject implements IntBuffer2DConsumer {
-	protected IntBuffer2DConsumer target;
-	protected int[] xElements;
-	protected int[] yElements;
+  protected IntBuffer2DConsumer target;
+  protected int[] xElements;
+  protected int[] yElements;
 
-	// vars cached for speed
-	protected IntArrayList xList;
-	protected IntArrayList yList;
-	protected int capacity;
-	protected int size; 
+  // vars cached for speed
+  protected IntArrayList xList;
+  protected IntArrayList yList;
+  protected int capacity;
+  protected int size; 
 /**
  * Constructs and returns a new buffer with the given target.
  * @param target the target to flush to.
  * @param capacity the number of points the buffer shall be capable of holding before overflowing and flushing to the target.
  */
 public IntBuffer2D(IntBuffer2DConsumer target, int capacity) {
-	this.target = target;
-	this.capacity = capacity;
-	this.xElements = new int[capacity];
-	this.yElements = new int[capacity];
-	this.xList = new IntArrayList(xElements);
-	this.yList = new IntArrayList(yElements);
-	this.size = 0;
+  this.target = target;
+  this.capacity = capacity;
+  this.xElements = new int[capacity];
+  this.yElements = new int[capacity];
+  this.xList = new IntArrayList(xElements);
+  this.yList = new IntArrayList(yElements);
+  this.size = 0;
 }
 /**
  * Adds the specified point (x,y) to the receiver.
@@ -50,9 +48,9 @@
  * @param y the y-coordinate of the point to add.
  */
 public void add(int x, int y) {
-	if (this.size == this.capacity) flush();
-	this.xElements[this.size] = x;
-	this.yElements[this.size++] = y;
+  if (this.size == this.capacity) flush();
+  this.xElements[this.size] = x;
+  this.yElements[this.size++] = y;
 }
 /**
  * Adds all specified points (x,y) to the receiver.
@@ -60,26 +58,26 @@
  * @param y the y-coordinates of the points to add.
  */
 public void addAllOf(IntArrayList x, IntArrayList y) {
-	int listSize = x.size();
-	if (this.size + listSize >= this.capacity) flush();
-	this.target.addAllOf(x, y);
+  int listSize = x.size();
+  if (this.size + listSize >= this.capacity) flush();
+  this.target.addAllOf(x, y);
 }
 /**
  * Sets the receiver's size to zero.
  * In other words, forgets about any internally buffered elements.
  */
 public void clear() {
-	this.size = 0;
+  this.size = 0;
 }
 /**
  * Adds all internally buffered points to the receiver's target, then resets the current buffer size to zero.
  */
 public void flush() {
-	if (this.size > 0) {
-		xList.setSize(this.size);
-		yList.setSize(this.size);
-		this.target.addAllOf(xList,yList);
-		this.size = 0;
-	}
+  if (this.size > 0) {
+    xList.setSize(this.size);
+    yList.setSize(this.size);
+    this.target.addAllOf(xList,yList);
+    this.size = 0;
+  }
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/buffer/IntBuffer3D.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/buffer/IntBuffer3D.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/buffer/IntBuffer3D.java	(working copy)
@@ -12,40 +12,38 @@
 /**
  * Fixed sized (non resizable) streaming buffer connected to a target <tt>IntBuffer3DConsumer</tt> to which data is automatically flushed upon buffer overflow.
  *
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 09/24/99
  */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
  */
 @Deprecated
 public class IntBuffer3D extends org.apache.mahout.matrix.PersistentObject  implements IntBuffer3DConsumer {
-	protected IntBuffer3DConsumer target;
-	protected int[] xElements;
-	protected int[] yElements;
-	protected int[] zElements;
+  protected IntBuffer3DConsumer target;
+  protected int[] xElements;
+  protected int[] yElements;
+  protected int[] zElements;
 
-	// vars cached for speed
-	protected IntArrayList xList;
-	protected IntArrayList yList;
-	protected IntArrayList zList;
-	protected int capacity;
-	protected int size; 
+  // vars cached for speed
+  protected IntArrayList xList;
+  protected IntArrayList yList;
+  protected IntArrayList zList;
+  protected int capacity;
+  protected int size; 
 /**
  * Constructs and returns a new buffer with the given target.
  * @param target the target to flush to.
  * @param capacity the number of points the buffer shall be capable of holding before overflowing and flushing to the target.
  */
 public IntBuffer3D(IntBuffer3DConsumer target, int capacity) {
-	this.target = target;
-	this.capacity = capacity;
-	this.xElements = new int[capacity];
-	this.yElements = new int[capacity];
-	this.zElements = new int[capacity];
-	this.xList = new IntArrayList(xElements);
-	this.yList = new IntArrayList(yElements);
-	this.zList = new IntArrayList(zElements);
-	this.size = 0;
+  this.target = target;
+  this.capacity = capacity;
+  this.xElements = new int[capacity];
+  this.yElements = new int[capacity];
+  this.zElements = new int[capacity];
+  this.xList = new IntArrayList(xElements);
+  this.yList = new IntArrayList(yElements);
+  this.zList = new IntArrayList(zElements);
+  this.size = 0;
 }
 /**
  * Adds the specified point (x,y,z) to the receiver.
@@ -55,10 +53,10 @@
  * @param z the z-coordinate of the point to add.
  */
 public void add(int x, int y, int z) {
-	if (this.size == this.capacity) flush();
-	this.xElements[this.size] = x;
-	this.yElements[this.size] = y;
-	this.zElements[this.size++] = z;
+  if (this.size == this.capacity) flush();
+  this.xElements[this.size] = x;
+  this.yElements[this.size] = y;
+  this.zElements[this.size++] = z;
 }
 /**
  * Adds all specified (x,y,z) points to the receiver.
@@ -67,27 +65,27 @@
  * @param zElements the y-coordinates of the points.
  */
 public void addAllOf(IntArrayList xElements, IntArrayList yElements, IntArrayList zElements) {
-	int listSize = xElements.size();
-	if (this.size + listSize >= this.capacity) flush();
-	this.target.addAllOf(xElements, yElements, zElements);
+  int listSize = xElements.size();
+  if (this.size + listSize >= this.capacity) flush();
+  this.target.addAllOf(xElements, yElements, zElements);
 }
 /**
  * Sets the receiver's size to zero.
  * In other words, forgets about any internally buffered elements.
  */
 public void clear() {
-	this.size = 0;
+  this.size = 0;
 }
 /**
  * Adds all internally buffered points to the receiver's target, then resets the current buffer size to zero.
  */
 public void flush() {
-	if (this.size > 0) {
-		xList.setSize(this.size);
-		yList.setSize(this.size);
-		zList.setSize(this.size);
-		this.target.addAllOf(xList,yList,zList);
-		this.size = 0;
-	}
+  if (this.size > 0) {
+    xList.setSize(this.size);
+    yList.setSize(this.size);
+    zList.setSize(this.size);
+    this.target.addAllOf(xList,yList,zList);
+    this.size = 0;
+  }
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/buffer/ObjectBufferConsumer.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/buffer/ObjectBufferConsumer.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/buffer/ObjectBufferConsumer.java	(working copy)
@@ -12,8 +12,6 @@
 /**
  * Target of a streaming <tt>ObjectBuffer</tt> into which data is flushed upon buffer overflow.
  *
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 09/24/99
  */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
Index: matrix/src/main/java/org/apache/mahout/matrix/buffer/DoubleBufferConsumer.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/buffer/DoubleBufferConsumer.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/buffer/DoubleBufferConsumer.java	(working copy)
@@ -12,8 +12,6 @@
 /**
  * Target of a streaming <tt>DoubleBuffer</tt> into which data is flushed upon buffer overflow.
  *
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 09/24/99
  */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
Index: matrix/src/main/java/org/apache/mahout/matrix/buffer/IntBuffer.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/buffer/IntBuffer.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/buffer/IntBuffer.java	(working copy)
@@ -12,32 +12,30 @@
 /**
  * Fixed sized (non resizable) streaming buffer connected to a target <tt>IntBufferConsumer</tt> to which data is automatically flushed upon buffer overflow.
  *
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 09/24/99
  */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
  */
 @Deprecated
 public class IntBuffer extends org.apache.mahout.matrix.PersistentObject implements IntBufferConsumer {
-	protected IntBufferConsumer target;
-	protected int[] elements;
+  protected IntBufferConsumer target;
+  protected int[] elements;
 
-	// vars cached for speed
-	protected IntArrayList list;
-	protected int capacity;
-	protected int size; 
+  // vars cached for speed
+  protected IntArrayList list;
+  protected int capacity;
+  protected int size; 
 /**
  * Constructs and returns a new buffer with the given target.
  * @param target the target to flush to.
  * @param capacity the number of points the buffer shall be capable of holding before overflowing and flushing to the target.
  */
 public IntBuffer(IntBufferConsumer target, int capacity) {
-	this.target = target;
-	this.capacity = capacity;
-	this.elements = new int[capacity];
-	this.list = new IntArrayList(elements);
-	this.size = 0;
+  this.target = target;
+  this.capacity = capacity;
+  this.elements = new int[capacity];
+  this.list = new IntArrayList(elements);
+  this.size = 0;
 }
 /**
  * Adds the specified element to the receiver.
@@ -45,33 +43,33 @@
  * @param element the element to add.
  */
 public void add(int element) {
-	if (this.size == this.capacity) flush();
-	this.elements[size++] = element;
+  if (this.size == this.capacity) flush();
+  this.elements[size++] = element;
 }
 /**
  * Adds all elements of the specified list to the receiver.
  * @param list the list of which all elements shall be added.
  */
 public void addAllOf(IntArrayList list) {
-	int listSize = list.size();
-	if (this.size + listSize >= this.capacity) flush();
-	this.target.addAllOf(list);
+  int listSize = list.size();
+  if (this.size + listSize >= this.capacity) flush();
+  this.target.addAllOf(list);
 }
 /**
  * Sets the receiver's size to zero.
  * In other words, forgets about any internally buffered elements.
  */
 public void clear() {
-	this.size = 0;
+  this.size = 0;
 }
 /**
  * Adds all internally buffered elements to the receiver's target, then resets the current buffer size to zero.
  */
 public void flush() {
-	if (this.size > 0) {
-		list.setSize(this.size);
-		this.target.addAllOf(list);
-		this.size = 0;
-	}
+  if (this.size > 0) {
+    list.setSize(this.size);
+    this.target.addAllOf(list);
+    this.size = 0;
+  }
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/buffer/IntBuffer2DConsumer.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/buffer/IntBuffer2DConsumer.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/buffer/IntBuffer2DConsumer.java	(working copy)
@@ -12,8 +12,6 @@
 /**
  * Target of a streaming <tt>IntBuffer2D</tt> into which data is flushed upon buffer overflow.
  *
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 09/24/99
  */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
Index: matrix/src/main/java/org/apache/mahout/matrix/buffer/IntBuffer3DConsumer.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/buffer/IntBuffer3DConsumer.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/buffer/IntBuffer3DConsumer.java	(working copy)
@@ -12,8 +12,6 @@
 /**
  * Target of a streaming <tt>IntBuffer3D</tt> into which data is flushed upon buffer overflow.
  *
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 09/24/99
  */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
Index: matrix/src/main/java/org/apache/mahout/matrix/buffer/DoubleBuffer2D.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/buffer/DoubleBuffer2D.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/buffer/DoubleBuffer2D.java	(working copy)
@@ -12,36 +12,34 @@
 /**
  * Fixed sized (non resizable) streaming buffer connected to a target <tt>DoubleBuffer2DConsumer</tt> to which data is automatically flushed upon buffer overflow.
  *
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 09/24/99
  */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
  */
 @Deprecated
 public class DoubleBuffer2D extends org.apache.mahout.matrix.PersistentObject implements DoubleBuffer2DConsumer {
-	protected DoubleBuffer2DConsumer target;
-	protected double[] xElements;
-	protected double[] yElements;
+  protected DoubleBuffer2DConsumer target;
+  protected double[] xElements;
+  protected double[] yElements;
 
-	// vars cached for speed
-	protected DoubleArrayList xList;
-	protected DoubleArrayList yList;
-	protected int capacity;
-	protected int size; 
+  // vars cached for speed
+  protected DoubleArrayList xList;
+  protected DoubleArrayList yList;
+  protected int capacity;
+  protected int size; 
 /**
  * Constructs and returns a new buffer with the given target.
  * @param target the target to flush to.
  * @param capacity the number of points the buffer shall be capable of holding before overflowing and flushing to the target.
  */
 public DoubleBuffer2D(DoubleBuffer2DConsumer target, int capacity) {
-	this.target = target;
-	this.capacity = capacity;
-	this.xElements = new double[capacity];
-	this.yElements = new double[capacity];
-	this.xList = new DoubleArrayList(xElements);
-	this.yList = new DoubleArrayList(yElements);
-	this.size = 0;
+  this.target = target;
+  this.capacity = capacity;
+  this.xElements = new double[capacity];
+  this.yElements = new double[capacity];
+  this.xList = new DoubleArrayList(xElements);
+  this.yList = new DoubleArrayList(yElements);
+  this.size = 0;
 }
 /**
  * Adds the specified point (x,y) to the receiver.
@@ -50,9 +48,9 @@
  * @param y the y-coordinate of the point to add.
  */
 public void add(double x, double y) {
-	if (this.size == this.capacity) flush();
-	this.xElements[this.size] = x;
-	this.yElements[this.size++] = y;
+  if (this.size == this.capacity) flush();
+  this.xElements[this.size] = x;
+  this.yElements[this.size++] = y;
 }
 /**
  * Adds all specified points (x,y) to the receiver.
@@ -60,26 +58,26 @@
  * @param y the y-coordinates of the points to add.
  */
 public void addAllOf(DoubleArrayList x, DoubleArrayList y) {
-	int listSize = x.size();
-	if (this.size + listSize >= this.capacity) flush();
-	this.target.addAllOf(x, y);
+  int listSize = x.size();
+  if (this.size + listSize >= this.capacity) flush();
+  this.target.addAllOf(x, y);
 }
 /**
  * Sets the receiver's size to zero.
  * In other words, forgets about any internally buffered elements.
  */
 public void clear() {
-	this.size = 0;
+  this.size = 0;
 }
 /**
  * Adds all internally buffered points to the receiver's target, then resets the current buffer size to zero.
  */
 public void flush() {
-	if (this.size > 0) {
-		xList.setSize(this.size);
-		yList.setSize(this.size);
-		this.target.addAllOf(xList,yList);
-		this.size = 0;
-	}
+  if (this.size > 0) {
+    xList.setSize(this.size);
+    yList.setSize(this.size);
+    this.target.addAllOf(xList,yList);
+    this.size = 0;
+  }
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/buffer/DoubleBuffer3D.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/buffer/DoubleBuffer3D.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/buffer/DoubleBuffer3D.java	(working copy)
@@ -12,40 +12,38 @@
 /**
  * Fixed sized (non resizable) streaming buffer connected to a target <tt>DoubleBuffer3DConsumer</tt> to which data is automatically flushed upon buffer overflow.
  *
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 09/24/99
  */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
  */
 @Deprecated
 public class DoubleBuffer3D extends org.apache.mahout.matrix.PersistentObject  implements DoubleBuffer3DConsumer {
-	protected DoubleBuffer3DConsumer target;
-	protected double[] xElements;
-	protected double[] yElements;
-	protected double[] zElements;
+  protected DoubleBuffer3DConsumer target;
+  protected double[] xElements;
+  protected double[] yElements;
+  protected double[] zElements;
 
-	// vars cached for speed
-	protected DoubleArrayList xList;
-	protected DoubleArrayList yList;
-	protected DoubleArrayList zList;
-	protected int capacity;
-	protected int size; 
+  // vars cached for speed
+  protected DoubleArrayList xList;
+  protected DoubleArrayList yList;
+  protected DoubleArrayList zList;
+  protected int capacity;
+  protected int size; 
 /**
  * Constructs and returns a new buffer with the given target.
  * @param target the target to flush to.
  * @param capacity the number of points the buffer shall be capable of holding before overflowing and flushing to the target.
  */
 public DoubleBuffer3D(DoubleBuffer3DConsumer target, int capacity) {
-	this.target = target;
-	this.capacity = capacity;
-	this.xElements = new double[capacity];
-	this.yElements = new double[capacity];
-	this.zElements = new double[capacity];
-	this.xList = new DoubleArrayList(xElements);
-	this.yList = new DoubleArrayList(yElements);
-	this.zList = new DoubleArrayList(zElements);
-	this.size = 0;
+  this.target = target;
+  this.capacity = capacity;
+  this.xElements = new double[capacity];
+  this.yElements = new double[capacity];
+  this.zElements = new double[capacity];
+  this.xList = new DoubleArrayList(xElements);
+  this.yList = new DoubleArrayList(yElements);
+  this.zList = new DoubleArrayList(zElements);
+  this.size = 0;
 }
 /**
  * Adds the specified point (x,y,z) to the receiver.
@@ -55,10 +53,10 @@
  * @param z the z-coordinate of the point to add.
  */
 public void add(double x, double y, double z) {
-	if (this.size == this.capacity) flush();
-	this.xElements[this.size] = x;
-	this.yElements[this.size] = y;
-	this.zElements[this.size++] = z;
+  if (this.size == this.capacity) flush();
+  this.xElements[this.size] = x;
+  this.yElements[this.size] = y;
+  this.zElements[this.size++] = z;
 }
 /**
  * Adds all specified (x,y,z) points to the receiver.
@@ -67,27 +65,27 @@
  * @param zElements the y-coordinates of the points.
  */
 public void addAllOf(DoubleArrayList xElements, DoubleArrayList yElements, DoubleArrayList zElements) {
-	int listSize = xElements.size();
-	if (this.size + listSize >= this.capacity) flush();
-	this.target.addAllOf(xElements, yElements, zElements);
+  int listSize = xElements.size();
+  if (this.size + listSize >= this.capacity) flush();
+  this.target.addAllOf(xElements, yElements, zElements);
 }
 /**
  * Sets the receiver's size to zero.
  * In other words, forgets about any internally buffered elements.
  */
 public void clear() {
-	this.size = 0;
+  this.size = 0;
 }
 /**
  * Adds all internally buffered points to the receiver's target, then resets the current buffer size to zero.
  */
 public void flush() {
-	if (this.size > 0) {
-		xList.setSize(this.size);
-		yList.setSize(this.size);
-		zList.setSize(this.size);
-		this.target.addAllOf(xList,yList,zList);
-		this.size = 0;
-	}
+  if (this.size > 0) {
+    xList.setSize(this.size);
+    yList.setSize(this.size);
+    zList.setSize(this.size);
+    this.target.addAllOf(xList,yList,zList);
+    this.size = 0;
+  }
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/list/AbstractBooleanList.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/list/AbstractBooleanList.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/list/AbstractBooleanList.java	(working copy)
@@ -18,13 +18,13 @@
  */
 @Deprecated
 public abstract class AbstractBooleanList extends AbstractList {
-	/**
-	 * The size of the list.
-	 * This is a READ_ONLY variable for all methods but setSizeRaw(int newSize) !!!
-	 * If you violate this principle in subclasses, you should exactly know what you are doing.
-	 * @serial
-	 */
-	protected int size; 
+  /**
+   * The size of the list.
+   * This is a READ_ONLY variable for all methods but setSizeRaw(int newSize) !!!
+   * If you violate this principle in subclasses, you should exactly know what you are doing.
+   * @serial
+   */
+  protected int size; 
 /**
  * Makes this class non instantiable, but still let's others inherit from it.
  */
@@ -35,7 +35,7 @@
  * @param element element to be appended to this list.
  */
 public void add(boolean element) {
-	beforeInsert(size,element);
+  beforeInsert(size,element);
 }
 /**
  * Appends the part of the specified list between <code>from</code> (inclusive) and <code>to</code> (inclusive) to the receiver.
@@ -46,7 +46,7 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>other.size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=other.size())</tt>).
  */
 public void addAllOfFromTo(AbstractBooleanList other, int from, int to) {
-	beforeInsertAllOfFromTo(size,other,from,to);
+  beforeInsertAllOfFromTo(size,other,from,to);
 }
 /**
  * Inserts the specified element before the specified position into the receiver. 
@@ -58,8 +58,8 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>index &lt; 0 || index &gt; size()</tt>).
  */
 public void beforeInsert(int index, boolean element) {
-	beforeInsertDummies(index,1);
-	set(index,element);
+  beforeInsertDummies(index,1);
+  set(index,element);
 }
 /**
  * Inserts the part of the specified list between <code>otherFrom</code> (inclusive) and <code>otherTo</code> (inclusive) before the specified position into the receiver. 
@@ -74,9 +74,9 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>index &lt; 0 || index &gt; size()</tt>).
  */
 public void beforeInsertAllOfFromTo(int index, AbstractBooleanList other, int from, int to) {
-	int length=to-from+1;
-	this.beforeInsertDummies(index, length);
-	this.replaceFromToWithFrom(index, index+length-1, other, from);
+  int length=to-from+1;
+  this.beforeInsertDummies(index, length);
+  this.replaceFromToWithFrom(index, index+length-1, other, from);
 }
 /**
  * Inserts <tt>length</tt> dummy elements before the specified position into the receiver. 
@@ -89,13 +89,13 @@
  * @throws IndexOutOfBoundsException if <tt>index &lt; 0 || index &gt; size()</tt>.
  */
 protected void beforeInsertDummies(int index, int length) {
-	if (index > size || index < 0) 
-		throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
-	if (length > 0) {
-		ensureCapacity(size + length);
-		setSizeRaw(size + length);
-		replaceFromToWithFrom(index+length,size-1,this,index);
-	}
+  if (index > size || index < 0) 
+    throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
+  if (length > 0) {
+    ensureCapacity(size + length);
+    setSizeRaw(size + length);
+    replaceFromToWithFrom(index+length,size-1,this,index);
+  }
 }
 /**
  * Searches the receiver for the specified value using
@@ -108,17 +108,17 @@
  *
  * @param key the value to be searched for.
  * @return index of the search key, if it is contained in the receiver;
- *	       otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
- *	       point</i> is defined as the the point at which the value would
- * 	       be inserted into the receiver: the index of the first
- *	       element greater than the key, or <tt>receiver.size()</tt>, if all
- *	       elements in the receiver are less than the specified key.  Note
- *	       that this guarantees that the return value will be &gt;= 0 if
- *	       and only if the key is found.
+ *         otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
+ *         point</i> is defined as the the point at which the value would
+ *          be inserted into the receiver: the index of the first
+ *         element greater than the key, or <tt>receiver.size()</tt>, if all
+ *         elements in the receiver are less than the specified key.  Note
+ *         that this guarantees that the return value will be &gt;= 0 if
+ *         and only if the key is found.
  * @see java.util.Arrays
  */
 public int binarySearch(boolean key) {
-	return this.binarySearchFromTo(key, 0, size-1);
+  return this.binarySearchFromTo(key, 0, size-1);
 }
 /**
  * Searches the receiver for the specified value using
@@ -133,28 +133,28 @@
  * @param from the leftmost search position, inclusive.
  * @param to the rightmost search position, inclusive.
  * @return index of the search key, if it is contained in the receiver;
- *	       otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
- *	       point</i> is defined as the the point at which the value would
- * 	       be inserted into the receiver: the index of the first
- *	       element greater than the key, or <tt>receiver.size()</tt>, if all
- *	       elements in the receiver are less than the specified key.  Note
- *	       that this guarantees that the return value will be &gt;= 0 if
- *	       and only if the key is found.
+ *         otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
+ *         point</i> is defined as the the point at which the value would
+ *          be inserted into the receiver: the index of the first
+ *         element greater than the key, or <tt>receiver.size()</tt>, if all
+ *         elements in the receiver are less than the specified key.  Note
+ *         that this guarantees that the return value will be &gt;= 0 if
+ *         and only if the key is found.
  * @see java.util.Arrays
  */
 public int binarySearchFromTo(boolean key, int from, int to) {
-	int low=from;
-	int high=to;
-	int intKey = toInt(key);
-	while (low <= high) {
-		int mid =(low + high)/2;
-		boolean midVal = get(mid);
-		
-		if (toInt(midVal) < intKey) low = mid + 1;
-		else if (toInt(midVal) > intKey) high = mid - 1;
-		else return mid; // key found
-	}
-	return -(low + 1);  // key not found.
+  int low=from;
+  int high=to;
+  int intKey = toInt(key);
+  while (low <= high) {
+    int mid =(low + high)/2;
+    boolean midVal = get(mid);
+    
+    if (toInt(midVal) < intKey) low = mid + 1;
+    else if (toInt(midVal) > intKey) high = mid - 1;
+    else return mid; // key found
+  }
+  return -(low + 1);  // key not found.
 }
 /**
  * Returns a deep copy of the receiver. 
@@ -162,7 +162,7 @@
  * @return  a deep copy of the receiver.
  */
 public Object clone() {
-	return partFromTo(0,size-1);
+  return partFromTo(0,size-1);
 }
 /**
  * Returns true if the receiver contains the specified element.
@@ -170,7 +170,7 @@
  * @param element element whose presence in the receiver is to be tested.
  */
 public boolean contains(boolean elem) {
-	return indexOfFromTo(elem,0,size-1) >=0;
+  return indexOfFromTo(elem,0,size-1) >=0;
 }
 /**
  * Deletes the first element from the receiver that is identical to the specified element.
@@ -179,8 +179,8 @@
  * @param element the element to be deleted.
  */
 public void delete(boolean element) {
-	int index = indexOfFromTo(element, 0, size-1);
-	if (index>=0) remove(index);
+  int index = indexOfFromTo(element, 0, size-1);
+  if (index>=0) remove(index);
 }
 /**
  * Returns the elements currently stored, possibly including invalid elements between size and capacity.
@@ -191,9 +191,9 @@
  * @return the elements currently stored.
  */
 public boolean[] elements() {
-	boolean[] myElements = new boolean[size];
-	for (int i=size; --i >= 0; ) myElements[i]=getQuick(i);
-	return myElements;
+  boolean[] myElements = new boolean[size];
+  for (int i=size; --i >= 0; ) myElements[i]=getQuick(i);
+  return myElements;
 }
 /**
  * Sets the receiver's elements to be the specified array.
@@ -205,9 +205,9 @@
  * @return the receiver itself.
  */
 public AbstractBooleanList elements(boolean[] elements) {
-	clear();
-	addAllOfFromTo(new BooleanArrayList(elements),0,elements.length-1);
-	return this;
+  clear();
+  addAllOfFromTo(new BooleanArrayList(elements),0,elements.length-1);
+  return this;
 }
 /**
  * Ensures that the receiver can hold at least the specified number of elements without needing to allocate new internal memory.
@@ -227,16 +227,16 @@
  * @return true if the specified Object is equal to the receiver.
  */
 public boolean equals(Object otherObj) { //delta
-	if (! (otherObj instanceof AbstractBooleanList)) {return false;}
-	if (this==otherObj) return true;
-	if (otherObj==null) return false;
-	AbstractBooleanList other = (AbstractBooleanList) otherObj;
-	if (size()!=other.size()) return false;
+  if (! (otherObj instanceof AbstractBooleanList)) {return false;}
+  if (this==otherObj) return true;
+  if (otherObj==null) return false;
+  AbstractBooleanList other = (AbstractBooleanList) otherObj;
+  if (size()!=other.size()) return false;
 
-	for (int i=size(); --i >= 0; ) {
-	    if (getQuick(i) != other.getQuick(i)) return false;
-	}
-	return true;
+  for (int i=size(); --i >= 0; ) {
+      if (getQuick(i) != other.getQuick(i)) return false;
+  }
+  return true;
 }
 /**
  * Sets the specified range of elements in the specified array to the specified value.
@@ -246,8 +246,8 @@
  * @param val the value to be stored in the specified elements of the receiver.
  */
 public void fillFromToWith(int from, int to, boolean val) {
-	checkRangeFromTo(from,to,this.size);
-	for (int i=from; i<=to;) setQuick(i++,val); 
+  checkRangeFromTo(from,to,this.size);
+  for (int i=from; i<=to;) setQuick(i++,val); 
 }
 /**
  * Applies a procedure to each element of the receiver, if any.
@@ -256,20 +256,20 @@
  * @return <tt>false</tt> if the procedure stopped before all elements where iterated over, <tt>true</tt> otherwise. 
  */
 public boolean forEach(BooleanProcedure procedure) {
-	for (int i=0; i<size;) if (! procedure.apply(get(i++))) return false;
-	return true;
+  for (int i=0; i<size;) if (! procedure.apply(get(i++))) return false;
+  return true;
 }
 /**
  * Returns the element at the specified position in the receiver.
  *
  * @param index index of element to return.
  * @exception IndexOutOfBoundsException index is out of range (index
- * 		  &lt; 0 || index &gt;= size()).
+ *       &lt; 0 || index &gt;= size()).
  */
 public boolean get(int index) {
-	if (index >= size || index < 0)
-		throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
-	return getQuick(index);
+  if (index >= size || index < 0)
+    throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
+  return getQuick(index);
 }
 /**
  * Returns the element at the specified position in the receiver; <b>WARNING:</b> Does not check preconditions. 
@@ -291,7 +291,7 @@
  * @return  the index of the first occurrence of the element in the receiver; returns <code>-1</code> if the element is not found.
  */
 public int indexOf(boolean element) { //delta
-	return indexOfFromTo(element, 0, size-1);
+  return indexOfFromTo(element, 0, size-1);
 }
 /**
  * Returns the index of the first occurrence of the specified
@@ -306,12 +306,12 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public int indexOfFromTo(boolean element, int from, int to) {
-	checkRangeFromTo(from, to, size);
+  checkRangeFromTo(from, to, size);
 
-	for (int i = from ; i <= to; i++) {
-	    if (element==getQuick(i)) return i; //found
-	}
-	return -1; //not found
+  for (int i = from ; i <= to; i++) {
+      if (element==getQuick(i)) return i; //found
+  }
+  return -1; //not found
 }
 /**
  * Returns the index of the last occurrence of the specified
@@ -321,7 +321,7 @@
  * @return  the index of the last occurrence of the element in the receiver; returns <code>-1</code> if the element is not found.
  */
 public int lastIndexOf(boolean element) {
-	return lastIndexOfFromTo(element, 0, size-1);
+  return lastIndexOfFromTo(element, 0, size-1);
 }
 /**
  * Returns the index of the last occurrence of the specified
@@ -336,12 +336,12 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public int lastIndexOfFromTo(boolean element, int from, int to) {
-	checkRangeFromTo(from, to, size());
+  checkRangeFromTo(from, to, size());
 
-	for (int i = to ; i >= from; i--) {
-	    if (element==getQuick(i)) return i; //found
-	}
-	return -1; //not found
+  for (int i = to ; i >= from; i--) {
+      if (element==getQuick(i)) return i; //found
+  }
+  return -1; //not found
 }
 /**
  * Returns a new list of the part of the receiver between <code>from</code>, inclusive, and <code>to</code>, inclusive.
@@ -351,12 +351,12 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public AbstractBooleanList partFromTo(int from, int to) {
-	checkRangeFromTo(from, to, size);
+  checkRangeFromTo(from, to, size);
 
-	int length = to-from+1;
-	BooleanArrayList part = new BooleanArrayList(length);
-	part.addAllOfFromTo(this,from,to);
-	return part;
+  int length = to-from+1;
+  BooleanArrayList part = new BooleanArrayList(length);
+  part.addAllOfFromTo(this,from,to);
+  return part;
 }
 /**
 * Removes from the receiver all elements that are contained in the specified list.
@@ -366,17 +366,17 @@
 * @return <code>true</code> if the receiver changed as a result of the call.
 */
 public boolean removeAll(AbstractBooleanList other) {
-	if (other.size()==0) return false; //nothing to do
-	int limit = other.size()-1;
-	int j=0;
+  if (other.size()==0) return false; //nothing to do
+  int limit = other.size()-1;
+  int j=0;
 
-	for (int i=0; i<size ; i++) {
-		if (other.indexOfFromTo(getQuick(i), 0, limit) < 0) setQuick(j++,getQuick(i));
-	}
+  for (int i=0; i<size ; i++) {
+    if (other.indexOfFromTo(getQuick(i), 0, limit) < 0) setQuick(j++,getQuick(i));
+  }
 
-	boolean modified = (j!=size);
-	setSize(j);
-	return modified;
+  boolean modified = (j!=size);
+  setSize(j);
+  return modified;
 }
 /**
  * Removes from the receiver all elements whose index is between
@@ -389,14 +389,14 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public void removeFromTo(int from, int to) {
-	checkRangeFromTo(from, to, size);
-	int numMoved = size - to - 1;
-	if (numMoved > 0) {
-		replaceFromToWithFrom(from, from-1+numMoved, this, to+1);
-		//fillFromToWith(from+numMoved, size-1, 0.0f); //delta
-	}
-	int width = to-from+1;
-	if (width>0) setSizeRaw(size-width);
+  checkRangeFromTo(from, to, size);
+  int numMoved = size - to - 1;
+  if (numMoved > 0) {
+    replaceFromToWithFrom(from, from-1+numMoved, this, to+1);
+    //fillFromToWith(from+numMoved, size-1, 0.0f); //delta
+  }
+  int width = to-from+1;
+  if (width>0) setSizeRaw(size-width);
 }
 /**
  * Replaces a number of elements in the receiver with the same number of elements of another list.
@@ -409,22 +409,22 @@
  * @param otherFrom position of first element within other list to be copied.
  */
 public void replaceFromToWithFrom(int from, int to, AbstractBooleanList other, int otherFrom) {
-	int length=to-from+1;
-	if (length>0) {
-		checkRangeFromTo(from, to, size());
-		checkRangeFromTo(otherFrom,otherFrom+length-1,other.size());
+  int length=to-from+1;
+  if (length>0) {
+    checkRangeFromTo(from, to, size());
+    checkRangeFromTo(otherFrom,otherFrom+length-1,other.size());
 
-		// unambiguous copy (it may hold other==this)
-		if (from<=otherFrom) {
-			for (; --length >= 0; ) setQuick(from++,other.getQuick(otherFrom++));
-		}
-		else {
-			int otherTo = otherFrom+length-1;
-			for (; --length >= 0; ) setQuick(to--,other.getQuick(otherTo--));
-		}
+    // unambiguous copy (it may hold other==this)
+    if (from<=otherFrom) {
+      for (; --length >= 0; ) setQuick(from++,other.getQuick(otherFrom++));
+    }
+    else {
+      int otherTo = otherFrom+length-1;
+      for (; --length >= 0; ) setQuick(to--,other.getQuick(otherTo--));
+    }
 
-			
-	}
+      
+  }
 }
 /**
 * Replaces the part between <code>from</code> (inclusive) and <code>to</code> (inclusive) with the other list's
@@ -470,36 +470,36 @@
 * </pre>
 */
 public void replaceFromToWithFromTo(int from, int to, AbstractBooleanList other, int otherFrom, int otherTo) {
-	if (otherFrom>otherTo) {
-		throw new IndexOutOfBoundsException("otherFrom: "+otherFrom+", otherTo: "+otherTo);
-	}
+  if (otherFrom>otherTo) {
+    throw new IndexOutOfBoundsException("otherFrom: "+otherFrom+", otherTo: "+otherTo);
+  }
 
-	if (this==other && to-from!=otherTo-otherFrom) { // avoid stumbling over my own feet
-		replaceFromToWithFromTo(from, to, partFromTo(otherFrom, otherTo), 0, otherTo-otherFrom);
-		return;
-	}
-	
-	int length=otherTo-otherFrom+1;
-	int diff=length;
-	int theLast=from-1;
+  if (this==other && to-from!=otherTo-otherFrom) { // avoid stumbling over my own feet
+    replaceFromToWithFromTo(from, to, partFromTo(otherFrom, otherTo), 0, otherTo-otherFrom);
+    return;
+  }
+  
+  int length=otherTo-otherFrom+1;
+  int diff=length;
+  int theLast=from-1;
 
-	if (to>=from) {
-		diff -= (to-from+1);
-		theLast=to;
-	}
-	
-	if (diff>0) {
-		beforeInsertDummies(theLast+1, diff);
-	}
-	else {
-		if (diff<0) {
-			removeFromTo(theLast+diff, theLast-1);
-		}
-	}
+  if (to>=from) {
+    diff -= (to-from+1);
+    theLast=to;
+  }
+  
+  if (diff>0) {
+    beforeInsertDummies(theLast+1, diff);
+  }
+  else {
+    if (diff<0) {
+      removeFromTo(theLast+diff, theLast-1);
+    }
+  }
 
-	if (length>0) {
-		replaceFromToWithFrom(from,from+length-1,other,otherFrom);
-	}
+  if (length>0) {
+    replaceFromToWithFrom(from,from+length-1,other,otherFrom);
+  }
 }
 /**
  * Replaces the part of the receiver starting at <code>from</code> (inclusive) with all the elements of the specified collection.
@@ -511,12 +511,12 @@
  * @exception IndexOutOfBoundsException index is out of range (index &lt; 0 || index &gt;= size()).
  */
 public void replaceFromWith(int from, java.util.Collection other) {
-	checkRange(from,size());
-	java.util.Iterator e = other.iterator();
-	int index=from;
-	int limit = Math.min(size()-from, other.size());
-	for (int i=0; i<limit; i++)
-	    set(index++,((Boolean) e.next()).booleanValue()); //delta
+  checkRange(from,size());
+  java.util.Iterator e = other.iterator();
+  int index=from;
+  int limit = Math.min(size()-from, other.size());
+  for (int i=0; i<limit; i++)
+      set(index++,((Boolean) e.next()).booleanValue()); //delta
 }
 /**
 * Retains (keeps) only the elements in the receiver that are contained in the specified other list.
@@ -526,36 +526,36 @@
 * @return <code>true</code> if the receiver changed as a result of the call.
 */
 public boolean retainAll(AbstractBooleanList other) {
-	if (other.size()==0) {
-		if (size==0) return false;
-		setSize(0);
-		return true;
-	}
-	
-	int limit = other.size()-1;
-	int j=0;
-	for (int i=0; i<size ; i++) {
-		if (other.indexOfFromTo(getQuick(i), 0, limit) >= 0) setQuick(j++, getQuick(i));
-	}
+  if (other.size()==0) {
+    if (size==0) return false;
+    setSize(0);
+    return true;
+  }
+  
+  int limit = other.size()-1;
+  int j=0;
+  for (int i=0; i<size ; i++) {
+    if (other.indexOfFromTo(getQuick(i), 0, limit) >= 0) setQuick(j++, getQuick(i));
+  }
 
-	boolean modified = (j!=size);
-	setSize(j);
-	return modified;
+  boolean modified = (j!=size);
+  setSize(j);
+  return modified;
 }
 /**
  * Reverses the elements of the receiver.
  * Last becomes first, second last becomes second first, and so on.
  */
 public void reverse() {
-	boolean tmp;
-	int limit=size()/2;
-	int j=size()-1;
+  boolean tmp;
+  int limit=size()/2;
+  int j=size()-1;
 
-	for (int i=0; i<limit;) { //swap
-		tmp=getQuick(i);
-		setQuick(i++,getQuick(j));
-		setQuick(j--,tmp);
-	}
+  for (int i=0; i<limit;) { //swap
+    tmp=getQuick(i);
+    setQuick(i++,getQuick(j));
+    setQuick(j--,tmp);
+  }
 }
 /**
  * Replaces the element at the specified position in the receiver with the specified element.
@@ -565,9 +565,9 @@
  * @throws IndexOutOfBoundsException if <tt>index &lt; 0 || index &gt;= size()</tt>.
  */
 public void set(int index, boolean element) {
-	if (index >= size || index < 0)
-		throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
-	setQuick(index,element);
+  if (index >= size || index < 0)
+    throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
+  setQuick(index,element);
 }
 /**
  * Replaces the element at the specified position in the receiver with the specified element; <b>WARNING:</b> Does not check preconditions.
@@ -598,7 +598,7 @@
  * }
  */
 protected void setSizeRaw(int newSize) {
-	size = newSize;
+  size = newSize;
 }
 /**
  * Randomly permutes the part of the receiver between <code>from</code> (inclusive) and <code>to</code> (inclusive). 
@@ -607,17 +607,17 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public void shuffleFromTo(int from, int to) {
-	checkRangeFromTo(from, to, size());
-	
-	org.apache.mahout.jet.random.Uniform gen = new org.apache.mahout.jet.random.Uniform(new org.apache.mahout.jet.random.engine.DRand(new java.util.Date()));
-	for (int i=from; i<to; i++) { 
-		int random = gen.nextIntFromTo(i, to);
+  checkRangeFromTo(from, to, size());
+  
+  org.apache.mahout.jet.random.Uniform gen = new org.apache.mahout.jet.random.Uniform(new org.apache.mahout.jet.random.engine.DRand(new java.util.Date()));
+  for (int i=from; i<to; i++) { 
+    int random = gen.nextIntFromTo(i, to);
 
-		//swap(i, random)
-		boolean tmpElement = getQuick(random);
-		setQuick(random,getQuick(i)); 
-		setQuick(i,tmpElement); 
-	}  
+    //swap(i, random)
+    boolean tmpElement = getQuick(random);
+    setQuick(random,getQuick(i)); 
+    setQuick(i,tmpElement); 
+  }  
 }
 /**
  * Returns the number of elements contained in the receiver.
@@ -625,39 +625,39 @@
  * @returns  the number of elements contained in the receiver.
  */
 public int size() {
-	return size;
+  return size;
 }
 /**
  * Returns a list which is a concatenation of <code>times</code> times the receiver.
  * @param times the number of times the receiver shall be copied.
  */
 public AbstractBooleanList times(int times) {
-	AbstractBooleanList newList = new BooleanArrayList(times*size());
-	for (int i=times; --i >= 0; ) {
-		newList.addAllOfFromTo(this,0,size()-1);
-	}
-	return newList;
+  AbstractBooleanList newList = new BooleanArrayList(times*size());
+  for (int i=times; --i >= 0; ) {
+    newList.addAllOfFromTo(this,0,size()-1);
+  }
+  return newList;
 }
 /**
  * Transforms a boolean value to an integer (false --> 0, true --> 1)
  */
 protected static int toInt(boolean value) {
-	return value ? 1 : 0;
+  return value ? 1 : 0;
 }
 /**
  * Returns a <code>java.util.ArrayList</code> containing all the elements in the receiver.
  */
 public java.util.ArrayList toList() {
-	int mySize = size();
-	java.util.ArrayList list = new java.util.ArrayList(mySize);
-	for (int i=0; i < mySize; i++) list.add(new Boolean(get(i)));
-	return list;
+  int mySize = size();
+  java.util.ArrayList list = new java.util.ArrayList(mySize);
+  for (int i=0; i < mySize; i++) list.add(new Boolean(get(i)));
+  return list;
 }
 /**
 * Returns a string representation of the receiver, containing
 * the String representation of each element.
 */
 public String toString() {
-	return org.apache.mahout.matrix.Arrays.toString(partFromTo(0, size()-1).elements());
+  return org.apache.mahout.matrix.Arrays.toString(partFromTo(0, size()-1).elements());
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/list/AbstractList.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/list/AbstractList.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/list/AbstractList.java	(working copy)
@@ -17,8 +17,8 @@
 @author wolfgang.hoschek@cern.ch
 @version 1.0, 09/24/99
 @see     java.util.ArrayList
-@see	    java.util.Vector
-@see	    java.util.Arrays
+@see      java.util.Vector
+@see      java.util.Arrays
 */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
@@ -37,7 +37,7 @@
  * of the same parameter type of the receiver.
  */
 public void addAllOf(java.util.Collection collection) {
-	this.beforeInsertAllOf(size(), collection);
+  this.beforeInsertAllOf(size(), collection);
 }
 /** Inserts all elements of the specified collection before the specified position into the receiver. 
  * Shifts the element
@@ -51,8 +51,8 @@
  * @throws IndexOutOfBoundsException if <tt>index &lt; 0 || index &gt; size()</tt>.
  */
 public void beforeInsertAllOf(int index, java.util.Collection collection) {
-	this.beforeInsertDummies(index, collection.size());
-	this.replaceFromWith(index, collection);
+  this.beforeInsertDummies(index, collection.size());
+  this.replaceFromWith(index, collection);
 }
 /**
  * Inserts <tt>length</tt> dummy elements before the specified position into the receiver. 
@@ -69,24 +69,24 @@
  * Checks if the given index is in range.
  */
 protected static void checkRange(int index, int theSize) {
-	if (index >= theSize || index < 0)
-		throw new IndexOutOfBoundsException("Index: "+index+", Size: "+theSize);
+  if (index >= theSize || index < 0)
+    throw new IndexOutOfBoundsException("Index: "+index+", Size: "+theSize);
 }
 /**
  * Checks if the given range is within the contained array's bounds.
  * @throws IndexOutOfBoundsException if <tt>to!=from-1 || from&lt;0 || from&gt;to || to&gt;=size()</tt>.
  */
 protected static void checkRangeFromTo(int from, int to, int theSize) {
-	if (to==from-1) return;
-	if (from<0 || from>to || to>=theSize)
-		throw new IndexOutOfBoundsException("from: "+from+", to: "+to+", size="+theSize);
+  if (to==from-1) return;
+  if (from<0 || from>to || to>=theSize)
+    throw new IndexOutOfBoundsException("from: "+from+", to: "+to+", size="+theSize);
 }
 /**
  * Removes all elements from the receiver.  The receiver will
  * be empty after this call returns, but keep its current capacity.
  */
 public void clear() {
-	removeFromTo(0,size()-1);
+  removeFromTo(0,size()-1);
 }
 /**
  * Sorts the receiver into ascending order.  
@@ -103,7 +103,7 @@
  * It is generally better to call <tt>sort()</tt> or <tt>sortFromTo(...)</tt> instead, because those methods automatically choose the best sorting algorithm.
  */
 public final void mergeSort() {
-	mergeSortFromTo(0, size()-1);
+  mergeSortFromTo(0, size()-1);
 }
 /**
  * Sorts the receiver into ascending order.  
@@ -137,7 +137,7 @@
  * It is generally better to call <tt>sort()</tt> or <tt>sortFromTo(...)</tt> instead, because those methods automatically choose the best sorting algorithm.
  */
 public final void quickSort() {
-	quickSortFromTo(0, size()-1);
+  quickSortFromTo(0, size()-1);
 }
 /**
  * Sorts the specified range of the receiver into
@@ -164,7 +164,7 @@
  * @throws IndexOutOfBoundsException if <tt>index &lt; 0 || index &gt;= size()</tt>.
  */
 public void remove(int index) {
-	removeFromTo(index, index);
+  removeFromTo(index, index);
 }
 /**
  * Removes from the receiver all elements whose index is between
@@ -201,19 +201,19 @@
  * @throws IndexOutOfBoundsException if <tt>newSize &lt; 0</tt>.
  */
 public void setSize(int newSize) {
-	if (newSize<0) throw new IndexOutOfBoundsException("newSize:"+newSize);
+  if (newSize<0) throw new IndexOutOfBoundsException("newSize:"+newSize);
 
-	int currentSize = size();
-	if (newSize!=currentSize) {
-		if (newSize>currentSize) beforeInsertDummies(currentSize,newSize-currentSize);
-		else if (newSize<currentSize) removeFromTo(newSize, currentSize-1);
-	}
+  int currentSize = size();
+  if (newSize!=currentSize) {
+    if (newSize>currentSize) beforeInsertDummies(currentSize,newSize-currentSize);
+    else if (newSize<currentSize) removeFromTo(newSize, currentSize-1);
+  }
 }
 /**
  * Randomly permutes the receiver. After invocation, all elements will be at random positions.
  */
 public final void shuffle() {
-	shuffleFromTo(0, size()-1);
+  shuffleFromTo(0, size()-1);
 }
 /**
  * Randomly permutes the receiver between <code>from</code> (inclusive) and <code>to</code> (inclusive). 
@@ -231,7 +231,7 @@
  * Override <tt>sortFromTo(...)</tt> if you can determine which sort is most appropriate for the given data set.
  */
 public final void sort() {
-	sortFromTo(0, size()-1);
+  sortFromTo(0, size()-1);
 }
 /**
  * Sorts the specified range of the receiver into ascending order. 
@@ -245,7 +245,7 @@
  * @throws IndexOutOfBoundsException if <tt>(from&lt;0 || from&gt;to || to&gt;=size()) && to!=from-1</tt>.
  */
 public void sortFromTo(int from, int to) {
-	quickSortFromTo(from, to);
+  quickSortFromTo(from, to);
 }
 /**
  * Trims the capacity of the receiver to be the receiver's current 
Index: matrix/src/main/java/org/apache/mahout/matrix/list/adapter/FloatListAdapter.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/list/adapter/FloatListAdapter.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/list/adapter/FloatListAdapter.java	(working copy)
@@ -22,12 +22,12 @@
  */
 @Deprecated
 public class FloatListAdapter extends java.util.AbstractList implements java.util.List {
-	protected AbstractFloatList content;
+  protected AbstractFloatList content;
 /**
  * Constructs a list backed by the specified content list.
  */
 public FloatListAdapter(AbstractFloatList content) {
-	this.content = content;
+  this.content = content;
 }
 /**
  * Inserts the specified element at the specified position in this list
@@ -39,15 +39,15 @@
  * @param element element to be inserted.
  * 
  * @throws ClassCastException if the class of the specified element
- * 		  prevents it from being added to this list.
+ *       prevents it from being added to this list.
  * @throws IllegalArgumentException if some aspect of the specified
- *		  element prevents it from being added to this list.
+ *      element prevents it from being added to this list.
  * @throws IndexOutOfBoundsException index is out of range (<tt>index &lt;
- *		  0 || index &gt; size()</tt>).
+ *      0 || index &gt; size()</tt>).
  */
 public void add(int index, Object element) {
-	content.beforeInsert(index,value(element));
-	modCount++;
+  content.beforeInsert(index,value(element));
+  modCount++;
 }
 /**
  * Returns the element at the specified position in this list.
@@ -56,16 +56,16 @@
  * 
  * @return the element at the specified position in this list.
  * @throws IndexOutOfBoundsException if the given index is out of range
- * 		  (<tt>index &lt; 0 || index &gt;= size()</tt>).
+ *       (<tt>index &lt; 0 || index &gt;= size()</tt>).
  */
 public Object get(int index) {
-	return object(content.get(index));
+  return object(content.get(index));
 }
 /**
  * Transforms an element of a primitive data type to an object. 
  */
 protected static Object object(float element) {
-	return new Float(element);
+  return new Float(element);
 }
 /**
  * Removes the element at the specified position in this list (optional
@@ -77,13 +77,13 @@
  * @return the element previously at the specified position.
  * 
  * @throws IndexOutOfBoundsException if the specified index is out of
- * 		  range (<tt>index &lt; 0 || index &gt;= size()</tt>).
+ *       range (<tt>index &lt; 0 || index &gt;= size()</tt>).
  */
 public Object remove(int index) {
-	Object old = get(index);
-	content.remove(index);
-	modCount++;
-	return old;
+  Object old = get(index);
+  content.remove(index);
+  modCount++;
+  return old;
 }
 /**
  * Replaces the element at the specified position in this list with the
@@ -94,18 +94,18 @@
  * @return the element previously at the specified position.
  * 
  * @throws ClassCastException if the class of the specified element
- * 		  prevents it from being added to this list.
+ *       prevents it from being added to this list.
  * @throws IllegalArgumentException if some aspect of the specified
- *		  element prevents it from being added to this list.
+ *      element prevents it from being added to this list.
  * 
  * @throws IndexOutOfBoundsException if the specified index is out of
  *            range (<tt>index &lt; 0 || index &gt;= size()</tt>).
  */
 
 public Object set(int index, Object element) {
-	Object old = get(index);
-	content.set(index,value(element));
-	return old;
+  Object old = get(index);
+  content.set(index,value(element));
+  return old;
 }
 /**
  * Returns the number of elements in this list.
@@ -113,12 +113,12 @@
  * @return  the number of elements in this list.
  */
 public int size() {
-	return content.size();
+  return content.size();
 }
 /**
  * Transforms an object element to a primitive data type. 
  */
 protected static float value(Object element) {
-	return ((Number)element).floatValue();
+  return ((Number)element).floatValue();
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/list/adapter/ObjectListAdapter.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/list/adapter/ObjectListAdapter.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/list/adapter/ObjectListAdapter.java	(working copy)
@@ -18,12 +18,12 @@
  */
 @Deprecated
 public class ObjectListAdapter extends java.util.AbstractList implements java.util.List {
-	protected ObjectArrayList content;
+  protected ObjectArrayList content;
 /**
  * Constructs a list backed by the specified content list.
  */
 public ObjectListAdapter(ObjectArrayList content) {
-	this.content = content;
+  this.content = content;
 }
 /**
  * Inserts the specified element at the specified position in this list
@@ -35,15 +35,15 @@
  * @param element element to be inserted.
  * 
  * @throws ClassCastException if the class of the specified element
- * 		  prevents it from being added to this list.
+ *       prevents it from being added to this list.
  * @throws IllegalArgumentException if some aspect of the specified
- *		  element prevents it from being added to this list.
+ *      element prevents it from being added to this list.
  * @throws IndexOutOfBoundsException index is out of range (<tt>index &lt;
- *		  0 || index &gt; size()</tt>).
+ *      0 || index &gt; size()</tt>).
  */
 public void add(int index, Object element) {
-	content.beforeInsert(index,element);
-	modCount++;
+  content.beforeInsert(index,element);
+  modCount++;
 }
 /**
  * Returns the element at the specified position in this list.
@@ -52,10 +52,10 @@
  * 
  * @return the element at the specified position in this list.
  * @throws IndexOutOfBoundsException if the given index is out of range
- * 		  (<tt>index &lt; 0 || index &gt;= size()</tt>).
+ *       (<tt>index &lt; 0 || index &gt;= size()</tt>).
  */
 public Object get(int index) {
-	return content.get(index);
+  return content.get(index);
 }
 /**
  * Removes the element at the specified position in this list (optional
@@ -67,13 +67,13 @@
  * @return the element previously at the specified position.
  * 
  * @throws IndexOutOfBoundsException if the specified index is out of
- * 		  range (<tt>index &lt; 0 || index &gt;= size()</tt>).
+ *       range (<tt>index &lt; 0 || index &gt;= size()</tt>).
  */
 public Object remove(int index) {
-	Object old = get(index);
-	content.remove(index);
-	modCount++;
-	return old;
+  Object old = get(index);
+  content.remove(index);
+  modCount++;
+  return old;
 }
 /**
  * Replaces the element at the specified position in this list with the
@@ -84,18 +84,18 @@
  * @return the element previously at the specified position.
  * 
  * @throws ClassCastException if the class of the specified element
- * 		  prevents it from being added to this list.
+ *       prevents it from being added to this list.
  * @throws IllegalArgumentException if some aspect of the specified
- *		  element prevents it from being added to this list.
+ *      element prevents it from being added to this list.
  * 
  * @throws IndexOutOfBoundsException if the specified index is out of
  *            range (<tt>index &lt; 0 || index &gt;= size()</tt>).
  */
 
 public Object set(int index, Object element) {
-	Object old = get(index);
-	content.set(index,element);
-	return old;
+  Object old = get(index);
+  content.set(index,element);
+  return old;
 }
 /**
  * Returns the number of elements in this list.
@@ -103,6 +103,6 @@
  * @return  the number of elements in this list.
  */
 public int size() {
-	return content.size();
+  return content.size();
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/list/adapter/DoubleListAdapter.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/list/adapter/DoubleListAdapter.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/list/adapter/DoubleListAdapter.java	(working copy)
@@ -22,12 +22,12 @@
  */
 @Deprecated
 public class DoubleListAdapter extends java.util.AbstractList implements java.util.List {
-	protected AbstractDoubleList content;
+  protected AbstractDoubleList content;
 /**
  * Constructs a list backed by the specified content list.
  */
 public DoubleListAdapter(AbstractDoubleList content) {
-	this.content = content;
+  this.content = content;
 }
 /**
  * Inserts the specified element at the specified position in this list
@@ -39,15 +39,15 @@
  * @param element element to be inserted.
  * 
  * @throws ClassCastException if the class of the specified element
- * 		  prevents it from being added to this list.
+ *       prevents it from being added to this list.
  * @throws IllegalArgumentException if some aspect of the specified
- *		  element prevents it from being added to this list.
+ *      element prevents it from being added to this list.
  * @throws IndexOutOfBoundsException index is out of range (<tt>index &lt;
- *		  0 || index &gt; size()</tt>).
+ *      0 || index &gt; size()</tt>).
  */
 public void add(int index, Object element) {
-	content.beforeInsert(index,value(element));
-	modCount++;
+  content.beforeInsert(index,value(element));
+  modCount++;
 }
 /**
  * Returns the element at the specified position in this list.
@@ -56,16 +56,16 @@
  * 
  * @return the element at the specified position in this list.
  * @throws IndexOutOfBoundsException if the given index is out of range
- * 		  (<tt>index &lt; 0 || index &gt;= size()</tt>).
+ *       (<tt>index &lt; 0 || index &gt;= size()</tt>).
  */
 public Object get(int index) {
-	return object(content.get(index));
+  return object(content.get(index));
 }
 /**
  * Transforms an element of a primitive data type to an object. 
  */
 protected static Object object(double element) {
-	return new Double(element);
+  return new Double(element);
 }
 /**
  * Removes the element at the specified position in this list (optional
@@ -77,13 +77,13 @@
  * @return the element previously at the specified position.
  * 
  * @throws IndexOutOfBoundsException if the specified index is out of
- * 		  range (<tt>index &lt; 0 || index &gt;= size()</tt>).
+ *       range (<tt>index &lt; 0 || index &gt;= size()</tt>).
  */
 public Object remove(int index) {
-	Object old = get(index);
-	content.remove(index);
-	modCount++;
-	return old;
+  Object old = get(index);
+  content.remove(index);
+  modCount++;
+  return old;
 }
 /**
  * Replaces the element at the specified position in this list with the
@@ -94,18 +94,18 @@
  * @return the element previously at the specified position.
  * 
  * @throws ClassCastException if the class of the specified element
- * 		  prevents it from being added to this list.
+ *       prevents it from being added to this list.
  * @throws IllegalArgumentException if some aspect of the specified
- *		  element prevents it from being added to this list.
+ *      element prevents it from being added to this list.
  * 
  * @throws IndexOutOfBoundsException if the specified index is out of
  *            range (<tt>index &lt; 0 || index &gt;= size()</tt>).
  */
 
 public Object set(int index, Object element) {
-	Object old = get(index);
-	content.set(index,value(element));
-	return old;
+  Object old = get(index);
+  content.set(index,value(element));
+  return old;
 }
 /**
  * Returns the number of elements in this list.
@@ -113,12 +113,12 @@
  * @return  the number of elements in this list.
  */
 public int size() {
-	return content.size();
+  return content.size();
 }
 /**
  * Transforms an object element to a primitive data type. 
  */
 protected static double value(Object element) {
-	return ((Number)element).doubleValue();
+  return ((Number)element).doubleValue();
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/list/adapter/IntListAdapter.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/list/adapter/IntListAdapter.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/list/adapter/IntListAdapter.java	(working copy)
@@ -22,12 +22,12 @@
  */
 @Deprecated
 public class IntListAdapter extends java.util.AbstractList implements java.util.List {
-	protected AbstractIntList content;
+  protected AbstractIntList content;
 /**
  * Constructs a list backed by the specified content list.
  */
 public IntListAdapter(AbstractIntList content) {
-	this.content = content;
+  this.content = content;
 }
 /**
  * Inserts the specified element at the specified position in this list
@@ -39,15 +39,15 @@
  * @param element element to be inserted.
  * 
  * @throws ClassCastException if the class of the specified element
- * 		  prevents it from being added to this list.
+ *       prevents it from being added to this list.
  * @throws IllegalArgumentException if some aspect of the specified
- *		  element prevents it from being added to this list.
+ *      element prevents it from being added to this list.
  * @throws IndexOutOfBoundsException index is out of range (<tt>index &lt;
- *		  0 || index &gt; size()</tt>).
+ *      0 || index &gt; size()</tt>).
  */
 public void add(int index, Object element) {
-	content.beforeInsert(index,value(element));
-	modCount++;
+  content.beforeInsert(index,value(element));
+  modCount++;
 }
 /**
  * Returns the element at the specified position in this list.
@@ -56,16 +56,16 @@
  * 
  * @return the element at the specified position in this list.
  * @throws IndexOutOfBoundsException if the given index is out of range
- * 		  (<tt>index &lt; 0 || index &gt;= size()</tt>).
+ *       (<tt>index &lt; 0 || index &gt;= size()</tt>).
  */
 public Object get(int index) {
-	return object(content.get(index));
+  return object(content.get(index));
 }
 /**
  * Transforms an element of a primitive data type to an object. 
  */
 protected static Object object(int element) {
-	return new Integer(element);
+  return new Integer(element);
 }
 /**
  * Removes the element at the specified position in this list (optional
@@ -77,13 +77,13 @@
  * @return the element previously at the specified position.
  * 
  * @throws IndexOutOfBoundsException if the specified index is out of
- * 		  range (<tt>index &lt; 0 || index &gt;= size()</tt>).
+ *       range (<tt>index &lt; 0 || index &gt;= size()</tt>).
  */
 public Object remove(int index) {
-	Object old = get(index);
-	content.remove(index);
-	modCount++;
-	return old;
+  Object old = get(index);
+  content.remove(index);
+  modCount++;
+  return old;
 }
 /**
  * Replaces the element at the specified position in this list with the
@@ -94,18 +94,18 @@
  * @return the element previously at the specified position.
  * 
  * @throws ClassCastException if the class of the specified element
- * 		  prevents it from being added to this list.
+ *       prevents it from being added to this list.
  * @throws IllegalArgumentException if some aspect of the specified
- *		  element prevents it from being added to this list.
+ *      element prevents it from being added to this list.
  * 
  * @throws IndexOutOfBoundsException if the specified index is out of
  *            range (<tt>index &lt; 0 || index &gt;= size()</tt>).
  */
 
 public Object set(int index, Object element) {
-	Object old = get(index);
-	content.set(index,value(element));
-	return old;
+  Object old = get(index);
+  content.set(index,value(element));
+  return old;
 }
 /**
  * Returns the number of elements in this list.
@@ -113,12 +113,12 @@
  * @return  the number of elements in this list.
  */
 public int size() {
-	return content.size();
+  return content.size();
 }
 /**
  * Transforms an object element to a primitive data type. 
  */
 protected static int value(Object element) {
-	return ((Number)element).intValue();
+  return ((Number)element).intValue();
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/list/adapter/LongListAdapter.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/list/adapter/LongListAdapter.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/list/adapter/LongListAdapter.java	(working copy)
@@ -22,12 +22,12 @@
  */
 @Deprecated
 public class LongListAdapter extends java.util.AbstractList implements java.util.List {
-	protected AbstractLongList content;
+  protected AbstractLongList content;
 /**
  * Constructs a list backed by the specified content list.
  */
 public LongListAdapter(AbstractLongList content) {
-	this.content = content;
+  this.content = content;
 }
 /**
  * Inserts the specified element at the specified position in this list
@@ -39,15 +39,15 @@
  * @param element element to be inserted.
  * 
  * @throws ClassCastException if the class of the specified element
- * 		  prevents it from being added to this list.
+ *       prevents it from being added to this list.
  * @throws IllegalArgumentException if some aspect of the specified
- *		  element prevents it from being added to this list.
+ *      element prevents it from being added to this list.
  * @throws IndexOutOfBoundsException index is out of range (<tt>index &lt;
- *		  0 || index &gt; size()</tt>).
+ *      0 || index &gt; size()</tt>).
  */
 public void add(int index, Object element) {
-	content.beforeInsert(index,value(element));
-	modCount++;
+  content.beforeInsert(index,value(element));
+  modCount++;
 }
 /**
  * Returns the element at the specified position in this list.
@@ -56,16 +56,16 @@
  * 
  * @return the element at the specified position in this list.
  * @throws IndexOutOfBoundsException if the given index is out of range
- * 		  (<tt>index &lt; 0 || index &gt;= size()</tt>).
+ *       (<tt>index &lt; 0 || index &gt;= size()</tt>).
  */
 public Object get(int index) {
-	return object(content.get(index));
+  return object(content.get(index));
 }
 /**
  * Transforms an element of a primitive data type to an object. 
  */
 protected static Object object(long element) {
-	return new Long(element);
+  return new Long(element);
 }
 /**
  * Removes the element at the specified position in this list (optional
@@ -77,13 +77,13 @@
  * @return the element previously at the specified position.
  * 
  * @throws IndexOutOfBoundsException if the specified index is out of
- * 		  range (<tt>index &lt; 0 || index &gt;= size()</tt>).
+ *       range (<tt>index &lt; 0 || index &gt;= size()</tt>).
  */
 public Object remove(int index) {
-	Object old = get(index);
-	content.remove(index);
-	modCount++;
-	return old;
+  Object old = get(index);
+  content.remove(index);
+  modCount++;
+  return old;
 }
 /**
  * Replaces the element at the specified position in this list with the
@@ -94,18 +94,18 @@
  * @return the element previously at the specified position.
  * 
  * @throws ClassCastException if the class of the specified element
- * 		  prevents it from being added to this list.
+ *       prevents it from being added to this list.
  * @throws IllegalArgumentException if some aspect of the specified
- *		  element prevents it from being added to this list.
+ *      element prevents it from being added to this list.
  * 
  * @throws IndexOutOfBoundsException if the specified index is out of
  *            range (<tt>index &lt; 0 || index &gt;= size()</tt>).
  */
 
 public Object set(int index, Object element) {
-	Object old = get(index);
-	content.set(index,value(element));
-	return old;
+  Object old = get(index);
+  content.set(index,value(element));
+  return old;
 }
 /**
  * Returns the number of elements in this list.
@@ -113,12 +113,12 @@
  * @return  the number of elements in this list.
  */
 public int size() {
-	return content.size();
+  return content.size();
 }
 /**
  * Transforms an object element to a primitive data type. 
  */
 protected static long value(Object element) {
-	return ((Number)element).longValue();
+  return ((Number)element).longValue();
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/list/FloatArrayList.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/list/FloatArrayList.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/list/FloatArrayList.java	(working copy)
@@ -18,17 +18,17 @@
  */
 @Deprecated
 public class FloatArrayList extends AbstractFloatList {
-	/**
-	 * The array buffer into which the elements of the list are stored.
-	 * The capacity of the list is the length of this array buffer.
-	 * @serial
-	 */
-	protected float[] elements;
+  /**
+   * The array buffer into which the elements of the list are stored.
+   * The capacity of the list is the length of this array buffer.
+   * @serial
+   */
+  protected float[] elements;
 /**
  * Constructs an empty list.
  */
 public FloatArrayList() {
-	this(10);
+  this(10);
 }
 /**
  * Constructs a list containing the specified elements. 
@@ -40,7 +40,7 @@
  * @param elements the array to be backed by the the constructed list
  */
 public FloatArrayList(float[] elements) {
-	elements(elements);
+  elements(elements);
 }
 /**
  * Constructs an empty list with the specified initial capacity.
@@ -48,8 +48,8 @@
  * @param   initialCapacity   the number of elements the receiver can hold without auto-expanding itself by allocating new internal memory.
  */
 public FloatArrayList(int initialCapacity) {
-	this(new float[initialCapacity]);
-	setSizeRaw(0);
+  this(new float[initialCapacity]);
+  setSizeRaw(0);
 }
 /**
  * Appends the specified element to the end of this list.
@@ -57,9 +57,9 @@
  * @param element element to be appended to this list.
  */
 public void add(float element) {
-	// overridden for performance only.
-	if (size == elements.length) ensureCapacity(size + 1); 
-	elements[size++] = element;
+  // overridden for performance only.
+  if (size == elements.length) ensureCapacity(size + 1); 
+  elements[size++] = element;
 }
 /**
  * Inserts the specified element before the specified position into the receiver. 
@@ -71,13 +71,13 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>index &lt; 0 || index &gt; size()</tt>).
  */
 public void beforeInsert(int index, float element) {
-	// overridden for performance only.
-	if (index > size || index < 0) 
-		throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
-	ensureCapacity(size + 1);
-	System.arraycopy(elements, index, elements, index+1, size-index);
-	elements[index] = element;
-	size++;
+  // overridden for performance only.
+  if (index > size || index < 0) 
+    throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
+  ensureCapacity(size + 1);
+  System.arraycopy(elements, index, elements, index+1, size-index);
+  elements[index] = element;
+  size++;
 }
 /**
  * Searches the receiver for the specified value using
@@ -92,18 +92,18 @@
  * @param from the leftmost search position, inclusive.
  * @param to the rightmost search position, inclusive.
  * @return index of the search key, if it is contained in the receiver;
- *	       otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
- *	       point</i> is defined as the the point at which the value would
- * 	       be inserted into the receiver: the index of the first
- *	       element greater than the key, or <tt>receiver.size()</tt>, if all
- *	       elements in the receiver are less than the specified key.  Note
- *	       that this guarantees that the return value will be &gt;= 0 if
- *	       and only if the key is found.
+ *         otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
+ *         point</i> is defined as the the point at which the value would
+ *          be inserted into the receiver: the index of the first
+ *         element greater than the key, or <tt>receiver.size()</tt>, if all
+ *         elements in the receiver are less than the specified key.  Note
+ *         that this guarantees that the return value will be &gt;= 0 if
+ *         and only if the key is found.
  * @see org.apache.mahout.matrix.Sorting
  * @see java.util.Arrays
  */
 public int binarySearchFromTo(float key, int from, int to) {
-	return org.apache.mahout.matrix.Sorting.binarySearchFromTo(this.elements,key,from,to);
+  return org.apache.mahout.matrix.Sorting.binarySearchFromTo(this.elements,key,from,to);
 }
 /**
  * Returns a deep copy of the receiver. 
@@ -111,10 +111,10 @@
  * @return  a deep copy of the receiver.
  */
 public Object clone() {
-	// overridden for performance only.
-	FloatArrayList clone = new FloatArrayList((float[]) elements.clone());
-	clone.setSizeRaw(size);
-	return clone;
+  // overridden for performance only.
+  FloatArrayList clone = new FloatArrayList((float[]) elements.clone());
+  clone.setSizeRaw(size);
+  return clone;
 }
 /**
  * Returns a deep copy of the receiver; uses <code>clone()</code> and casts the result.
@@ -122,7 +122,7 @@
  * @return  a deep copy of the receiver.
  */
 public FloatArrayList copy() {
-	return (FloatArrayList) clone();
+  return (FloatArrayList) clone();
 }
 /**
  * Returns the elements currently stored, including invalid elements between size and capacity, if any.
@@ -133,7 +133,7 @@
  * @return the elements currently stored.
  */
 public float[] elements() {
-	return elements;
+  return elements;
 }
 /**
  * Sets the receiver's elements to be the specified array (not a copy of it).
@@ -146,9 +146,9 @@
  * @return the receiver itself.
  */
 public AbstractFloatList elements(float[] elements) {
-	this.elements=elements;
-	this.size=elements.length;
-	return this;
+  this.elements=elements;
+  this.size=elements.length;
+  return this;
 }
 /**
  * Ensures that the receiver can hold at least the specified number of elements without needing to allocate new internal memory.
@@ -157,7 +157,7 @@
  * @param   minCapacity   the desired minimum capacity.
  */
 public void ensureCapacity(int minCapacity) {
-	elements = org.apache.mahout.matrix.Arrays.ensureCapacity(elements,minCapacity);
+  elements = org.apache.mahout.matrix.Arrays.ensureCapacity(elements,minCapacity);
 }
 /**
  * Compares the specified Object with the receiver.  
@@ -170,19 +170,19 @@
  * @return true if the specified Object is equal to the receiver.
  */
 public boolean equals(Object otherObj) { //delta
-	// overridden for performance only.
-	if (! (otherObj instanceof FloatArrayList)) return super.equals(otherObj);
-	if (this==otherObj) return true;
-	if (otherObj==null) return false;
-	FloatArrayList other = (FloatArrayList) otherObj;
-	if (size()!=other.size()) return false;
+  // overridden for performance only.
+  if (! (otherObj instanceof FloatArrayList)) return super.equals(otherObj);
+  if (this==otherObj) return true;
+  if (otherObj==null) return false;
+  FloatArrayList other = (FloatArrayList) otherObj;
+  if (size()!=other.size()) return false;
 
-	float[] theElements = elements();
-	float[] otherElements = other.elements();
-	for (int i=size(); --i >= 0; ) {
-	    if (theElements[i] != otherElements[i]) return false;
-	}
-	return true;
+  float[] theElements = elements();
+  float[] otherElements = other.elements();
+  for (int i=size(); --i >= 0; ) {
+      if (theElements[i] != otherElements[i]) return false;
+  }
+  return true;
 }
 /**
  * Applies a procedure to each element of the receiver, if any.
@@ -191,25 +191,25 @@
  * @return <tt>false</tt> if the procedure stopped before all elements where iterated over, <tt>true</tt> otherwise. 
  */
 public boolean forEach(FloatProcedure procedure) {
-	// overridden for performance only.
-	float[] theElements = elements;
-	int theSize = size;
-	
-	for (int i=0; i<theSize;) if (! procedure.apply(theElements[i++])) return false;
-	return true;
+  // overridden for performance only.
+  float[] theElements = elements;
+  int theSize = size;
+  
+  for (int i=0; i<theSize;) if (! procedure.apply(theElements[i++])) return false;
+  return true;
 }
 /**
  * Returns the element at the specified position in the receiver.
  *
  * @param index index of element to return.
  * @exception IndexOutOfBoundsException index is out of range (index
- * 		  &lt; 0 || index &gt;= size()).
+ *       &lt; 0 || index &gt;= size()).
  */
 public float get(int index) {
-	// overridden for performance only.
-	if (index >= size || index < 0)
-		throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
-	return elements[index];
+  // overridden for performance only.
+  if (index >= size || index < 0)
+    throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
+  return elements[index];
 }
 /**
  * Returns the element at the specified position in the receiver; <b>WARNING:</b> Does not check preconditions. 
@@ -220,7 +220,7 @@
  * @param index index of element to return.
  */
 public float getQuick(int index) {
-	return elements[index];
+  return elements[index];
 }
 /**
  * Returns the index of the first occurrence of the specified
@@ -235,15 +235,15 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public int indexOfFromTo(float element, int from, int to) {
-	// overridden for performance only.
-	if (size==0) return -1;
-	checkRangeFromTo(from, to, size);
+  // overridden for performance only.
+  if (size==0) return -1;
+  checkRangeFromTo(from, to, size);
 
-	float[] theElements = elements;
-	for (int i = from ; i <= to; i++) {
-	    if (element==theElements[i]) {return i;} //found
-	}
-	return -1; //not found
+  float[] theElements = elements;
+  for (int i = from ; i <= to; i++) {
+      if (element==theElements[i]) {return i;} //found
+  }
+  return -1; //not found
 }
 /**
  * Returns the index of the last occurrence of the specified
@@ -258,15 +258,15 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public int lastIndexOfFromTo(float element, int from, int to) {
-	// overridden for performance only.
-	if (size==0) return -1;
-	checkRangeFromTo(from, to, size);
+  // overridden for performance only.
+  if (size==0) return -1;
+  checkRangeFromTo(from, to, size);
 
-	float[] theElements = elements;
-	for (int i = to ; i >= from; i--) {
-	    if (element==theElements[i]) {return i;} //found
-	}
-	return -1; //not found
+  float[] theElements = elements;
+  for (int i = to ; i >= from; i--) {
+      if (element==theElements[i]) {return i;} //found
+  }
+  return -1; //not found
 }
 /**
  * Returns a new list of the part of the receiver between <code>from</code>, inclusive, and <code>to</code>, inclusive.
@@ -276,13 +276,13 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public AbstractFloatList partFromTo(int from, int to) {
-	if (size==0) return new FloatArrayList(0);
+  if (size==0) return new FloatArrayList(0);
 
-	checkRangeFromTo(from, to, size);
+  checkRangeFromTo(from, to, size);
 
-	float[] part = new float[to-from+1];
-	System.arraycopy(elements, from, part, 0, to-from+1);
-	return new FloatArrayList(part);
+  float[] part = new float[to-from+1];
+  System.arraycopy(elements, from, part, 0, to-from+1);
+  return new FloatArrayList(part);
 }
 /**
 * Removes from the receiver all elements that are contained in the specified list.
@@ -292,46 +292,46 @@
 * @return <code>true</code> if the receiver changed as a result of the call.
 */
 public boolean removeAll(AbstractFloatList other) {
-	// overridden for performance only.
-	if (! (other instanceof FloatArrayList))	return super.removeAll(other);
-	
-	/* There are two possibilities to do the thing
-	   a) use other.indexOf(...)
-	   b) sort other, then use other.binarySearch(...)
-	   
-	   Let's try to figure out which one is faster. Let M=size, N=other.size, then
-	   a) takes O(M*N) steps
-	   b) takes O(N*logN + M*logN) steps (sorting is O(N*logN) and binarySearch is O(logN))
+  // overridden for performance only.
+  if (! (other instanceof FloatArrayList))  return super.removeAll(other);
+  
+  /* There are two possibilities to do the thing
+     a) use other.indexOf(...)
+     b) sort other, then use other.binarySearch(...)
+     
+     Let's try to figure out which one is faster. Let M=size, N=other.size, then
+     a) takes O(M*N) steps
+     b) takes O(N*logN + M*logN) steps (sorting is O(N*logN) and binarySearch is O(logN))
  
-	   Hence, if N*logN + M*logN < M*N, we use b) otherwise we use a).
-	*/
-	if (other.size()==0) {return false;} //nothing to do
-	int limit = other.size()-1;
-	int j=0;
-	float[] theElements = elements;
-	int mySize = size();
+     Hence, if N*logN + M*logN < M*N, we use b) otherwise we use a).
+  */
+  if (other.size()==0) {return false;} //nothing to do
+  int limit = other.size()-1;
+  int j=0;
+  float[] theElements = elements;
+  int mySize = size();
 
-	double N=(double) other.size();
-	double M=(double) mySize;
-	if ( (N+M)* org.apache.mahout.jet.math.Arithmetic.log2(N) < M*N ) {
-		// it is faster to sort other before searching in it
-		FloatArrayList sortedList = (FloatArrayList) other.clone();
-		sortedList.quickSort();
+  double N=(double) other.size();
+  double M=(double) mySize;
+  if ( (N+M)* org.apache.mahout.jet.math.Arithmetic.log2(N) < M*N ) {
+    // it is faster to sort other before searching in it
+    FloatArrayList sortedList = (FloatArrayList) other.clone();
+    sortedList.quickSort();
 
-		for (int i=0; i<mySize ; i++) {
-			if (sortedList.binarySearchFromTo(theElements[i], 0, limit) < 0) theElements[j++]=theElements[i];
-		}
-	}
-	else {
-		// it is faster to search in other without sorting
-		for (int i=0; i<mySize ; i++) {
-			if (other.indexOfFromTo(theElements[i], 0, limit) < 0) theElements[j++]=theElements[i];
-		}
-	}
+    for (int i=0; i<mySize ; i++) {
+      if (sortedList.binarySearchFromTo(theElements[i], 0, limit) < 0) theElements[j++]=theElements[i];
+    }
+  }
+  else {
+    // it is faster to search in other without sorting
+    for (int i=0; i<mySize ; i++) {
+      if (other.indexOfFromTo(theElements[i], 0, limit) < 0) theElements[j++]=theElements[i];
+    }
+  }
 
-	boolean modified = (j!=mySize);
-	setSize(j);
-	return modified;
+  boolean modified = (j!=mySize);
+  setSize(j);
+  return modified;
 }
 /**
  * Replaces a number of elements in the receiver with the same number of elements of another list.
@@ -344,18 +344,18 @@
  * @param otherFrom position of first element within other list to be copied.
  */
 public void replaceFromToWithFrom(int from, int to, AbstractFloatList other, int otherFrom) {
-	// overridden for performance only.
-	if (! (other instanceof FloatArrayList)) {
-		// slower
-		super.replaceFromToWithFrom(from,to,other,otherFrom);
-		return;
-	}
-	int length=to-from+1;
-	if (length>0) {
-		checkRangeFromTo(from, to, size());
-		checkRangeFromTo(otherFrom,otherFrom+length-1,other.size());
-		System.arraycopy(((FloatArrayList) other).elements, otherFrom, elements, from, length);
-	}
+  // overridden for performance only.
+  if (! (other instanceof FloatArrayList)) {
+    // slower
+    super.replaceFromToWithFrom(from,to,other,otherFrom);
+    return;
+  }
+  int length=to-from+1;
+  if (length>0) {
+    checkRangeFromTo(from, to, size());
+    checkRangeFromTo(otherFrom,otherFrom+length-1,other.size());
+    System.arraycopy(((FloatArrayList) other).elements, otherFrom, elements, from, length);
+  }
 }
 /**
 * Retains (keeps) only the elements in the receiver that are contained in the specified other list.
@@ -365,62 +365,62 @@
 * @return <code>true</code> if the receiver changed as a result of the call.
 */
 public boolean retainAll(AbstractFloatList other) {
-	// overridden for performance only.
-	if (! (other instanceof FloatArrayList))	return super.retainAll(other);
-	
-	/* There are two possibilities to do the thing
-	   a) use other.indexOf(...)
-	   b) sort other, then use other.binarySearch(...)
-	   
-	   Let's try to figure out which one is faster. Let M=size, N=other.size, then
-	   a) takes O(M*N) steps
-	   b) takes O(N*logN + M*logN) steps (sorting is O(N*logN) and binarySearch is O(logN))
+  // overridden for performance only.
+  if (! (other instanceof FloatArrayList))  return super.retainAll(other);
+  
+  /* There are two possibilities to do the thing
+     a) use other.indexOf(...)
+     b) sort other, then use other.binarySearch(...)
+     
+     Let's try to figure out which one is faster. Let M=size, N=other.size, then
+     a) takes O(M*N) steps
+     b) takes O(N*logN + M*logN) steps (sorting is O(N*logN) and binarySearch is O(logN))
 
-	   Hence, if N*logN + M*logN < M*N, we use b) otherwise we use a).
-	*/
-	int limit = other.size()-1;
-	int j=0;
-	float[] theElements = elements;
-	int mySize = size();
+     Hence, if N*logN + M*logN < M*N, we use b) otherwise we use a).
+  */
+  int limit = other.size()-1;
+  int j=0;
+  float[] theElements = elements;
+  int mySize = size();
 
-	double N=(double) other.size();
-	double M=(double) mySize;
-	if ( (N+M)* org.apache.mahout.jet.math.Arithmetic.log2(N) < M*N ) {
-		// it is faster to sort other before searching in it
-		FloatArrayList sortedList = (FloatArrayList) other.clone();
-		sortedList.quickSort();
+  double N=(double) other.size();
+  double M=(double) mySize;
+  if ( (N+M)* org.apache.mahout.jet.math.Arithmetic.log2(N) < M*N ) {
+    // it is faster to sort other before searching in it
+    FloatArrayList sortedList = (FloatArrayList) other.clone();
+    sortedList.quickSort();
 
-		for (int i=0; i<mySize ; i++) {
-			if (sortedList.binarySearchFromTo(theElements[i], 0, limit) >= 0) theElements[j++]=theElements[i];
-		}
-	}
-	else {
-		// it is faster to search in other without sorting
-		for (int i=0; i<mySize ; i++) {
-			if (other.indexOfFromTo(theElements[i], 0, limit) >= 0) theElements[j++]=theElements[i];
-		}
-	}
+    for (int i=0; i<mySize ; i++) {
+      if (sortedList.binarySearchFromTo(theElements[i], 0, limit) >= 0) theElements[j++]=theElements[i];
+    }
+  }
+  else {
+    // it is faster to search in other without sorting
+    for (int i=0; i<mySize ; i++) {
+      if (other.indexOfFromTo(theElements[i], 0, limit) >= 0) theElements[j++]=theElements[i];
+    }
+  }
 
-	boolean modified = (j!=mySize);
-	setSize(j);
-	return modified;
+  boolean modified = (j!=mySize);
+  setSize(j);
+  return modified;
 }
 /**
  * Reverses the elements of the receiver.
  * Last becomes first, second last becomes second first, and so on.
  */
 public void reverse() {
-	// overridden for performance only.
-	float tmp;
-	int limit=size/2;
-	int j=size-1;
+  // overridden for performance only.
+  float tmp;
+  int limit=size/2;
+  int j=size-1;
 
-	float[] theElements = elements;
-	for (int i=0; i<limit;) { //swap
-		tmp=theElements[i];
-		theElements[i++]=theElements[j];
-		theElements[j--]=tmp;
-	}
+  float[] theElements = elements;
+  for (int i=0; i<limit;) { //swap
+    tmp=theElements[i];
+    theElements[i++]=theElements[j];
+    theElements[j--]=tmp;
+  }
 }
 /**
  * Replaces the element at the specified position in the receiver with the specified element.
@@ -428,13 +428,13 @@
  * @param index index of element to replace.
  * @param element element to be stored at the specified position.
  * @exception IndexOutOfBoundsException index is out of range (index
- * 		  &lt; 0 || index &gt;= size()).
+ *       &lt; 0 || index &gt;= size()).
  */
 public void set(int index, float element) {
-	// overridden for performance only.
-	if (index >= size || index < 0)
-		throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
-	elements[index] = element;
+  // overridden for performance only.
+  if (index >= size || index < 0)
+    throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
+  elements[index] = element;
 }
 /**
  * Replaces the element at the specified position in the receiver with the specified element; <b>WARNING:</b> Does not check preconditions.
@@ -446,7 +446,7 @@
  * @param element element to be stored at the specified position.
  */
 public void setQuick(int index, float element) {
-	elements[index] = element;
+  elements[index] = element;
 }
 /**
  * Randomly permutes the part of the receiver between <code>from</code> (inclusive) and <code>to</code> (inclusive). 
@@ -455,22 +455,22 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public void shuffleFromTo(int from, int to) {
-	// overridden for performance only.
-	if (size==0) {return;}
-	checkRangeFromTo(from, to, size);
-	
-	org.apache.mahout.jet.random.Uniform gen = new org.apache.mahout.jet.random.Uniform(new org.apache.mahout.jet.random.engine.DRand(new java.util.Date()));
-	float tmpElement;
-	float[] theElements = elements;
-	int random;
-	for (int i=from; i<to; i++) { 
-		random = gen.nextIntFromTo(i, to);
+  // overridden for performance only.
+  if (size==0) {return;}
+  checkRangeFromTo(from, to, size);
+  
+  org.apache.mahout.jet.random.Uniform gen = new org.apache.mahout.jet.random.Uniform(new org.apache.mahout.jet.random.engine.DRand(new java.util.Date()));
+  float tmpElement;
+  float[] theElements = elements;
+  int random;
+  for (int i=from; i<to; i++) { 
+    random = gen.nextIntFromTo(i, to);
 
-		//swap(i, random)
-		tmpElement = theElements[random];
-		theElements[random]=theElements[i]; 
-		theElements[i]=tmpElement; 
-	}  
+    //swap(i, random)
+    tmpElement = theElements[random];
+    theElements[random]=theElements[i]; 
+    theElements[i]=tmpElement; 
+  }  
 }
 /**
  * Trims the capacity of the receiver to be the receiver's current 
@@ -478,6 +478,6 @@
  * storage of the receiver.
  */
 public void trimToSize() {
-	elements = org.apache.mahout.matrix.Arrays.trimToCapacity(elements,size());
+  elements = org.apache.mahout.matrix.Arrays.trimToCapacity(elements,size());
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/list/ObjectArrayList.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/list/ObjectArrayList.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/list/ObjectArrayList.java	(working copy)
@@ -18,23 +18,23 @@
  */
 @Deprecated
 public class ObjectArrayList extends AbstractList {
-	/**
-	 * The array buffer into which the elements of the list are stored.
-	 * The capacity of the list is the length of this array buffer.
-	 * @serial
-	 */
-	protected Object[] elements;
-	
-	/**
-	 * The size of the list.
-	 * @serial
-	 */
-	protected int size;
+  /**
+   * The array buffer into which the elements of the list are stored.
+   * The capacity of the list is the length of this array buffer.
+   * @serial
+   */
+  protected Object[] elements;
+  
+  /**
+   * The size of the list.
+   * @serial
+   */
+  protected int size;
 /**
  * Constructs an empty list.
  */
 public ObjectArrayList() {
-	this(10);
+  this(10);
 }
 /**
  * Constructs a list containing the specified elements. 
@@ -46,7 +46,7 @@
  * @param elements the array to be backed by the the constructed list
  */
 public ObjectArrayList(Object[] elements) {
-	elements(elements);
+  elements(elements);
 }
 /**
  * Constructs an empty list with the specified initial capacity.
@@ -54,8 +54,8 @@
  * @param   initialCapacity   the number of elements the receiver can hold without auto-expanding itself by allocating new internal memory.
  */
 public ObjectArrayList(int initialCapacity) {
-	this(new Object[initialCapacity]);
-	size=0;
+  this(new Object[initialCapacity]);
+  size=0;
 }
 /**
  * Appends the specified element to the end of this list.
@@ -63,8 +63,8 @@
  * @param element element to be appended to this list.
  */
 public void add(Object element) {
-	if (size == elements.length) ensureCapacity(size + 1); 
-	elements[size++] = element;
+  if (size == elements.length) ensureCapacity(size + 1); 
+  elements[size++] = element;
 }
 /**
  * Appends the part of the specified list between <code>from</code> (inclusive) and <code>to</code> (inclusive) to the receiver.
@@ -75,7 +75,7 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>other.size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=other.size())</tt>).
  */
 public void addAllOfFromTo(ObjectArrayList other, int from, int to) {
-	beforeInsertAllOfFromTo(size, other, from, to);
+  beforeInsertAllOfFromTo(size, other, from, to);
 }
 /**
  * Inserts the specified element before the specified position into the receiver. 
@@ -87,13 +87,13 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>index &lt; 0 || index &gt; size()</tt>).
  */
 public void beforeInsert(int index, Object element) {
-	// overridden for performance only.
-	if (index > size || index < 0) 
-		throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
-	ensureCapacity(size + 1);
-	System.arraycopy(elements, index, elements, index+1, size-index);
-	elements[index] = element;
-	size++;
+  // overridden for performance only.
+  if (index > size || index < 0) 
+    throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
+  ensureCapacity(size + 1);
+  System.arraycopy(elements, index, elements, index+1, size-index);
+  elements[index] = element;
+  size++;
 }
 /**
  * Inserts the part of the specified list between <code>otherFrom</code> (inclusive) and <code>otherTo</code> (inclusive) before the specified position into the receiver. 
@@ -108,9 +108,9 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>index &lt; 0 || index &gt; size()</tt>).
  */
 public void beforeInsertAllOfFromTo(int index, ObjectArrayList other, int from, int to) {
-	int length=to-from+1;
-	this.beforeInsertDummies(index, length);
-	this.replaceFromToWithFrom(index, index+length-1, other, from);
+  int length=to-from+1;
+  this.beforeInsertDummies(index, length);
+  this.replaceFromToWithFrom(index, index+length-1, other, from);
 }
 /**
  * Inserts length dummies before the specified position into the receiver. 
@@ -121,13 +121,13 @@
  * @param length number of dummies to be inserted.
  */
 protected void beforeInsertDummies(int index, int length) {
-	if (index > size || index < 0) 
-		throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
-	if (length > 0) {
-		ensureCapacity(size + length);
-	    System.arraycopy(elements, index, elements, index + length, size-index);
-		size += length;
-	}
+  if (index > size || index < 0) 
+    throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
+  if (length > 0) {
+    ensureCapacity(size + length);
+      System.arraycopy(elements, index, elements, index + length, size-index);
+    size += length;
+  }
 }
 /**
  * Searches the receiver for the specified value using
@@ -141,18 +141,18 @@
  *
  * @param key the value to be searched for.
  * @return index of the search key, if it is contained in the receiver;
- *	       otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
- *	       point</i> is defined as the the point at which the value would
- * 	       be inserted into the receiver: the index of the first
- *	       element greater than the key, or <tt>receiver.size()</tt>, if all
- *	       elements in the receiver are less than the specified key.  Note
- *	       that this guarantees that the return value will be &gt;= 0 if
- *	       and only if the key is found.
+ *         otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
+ *         point</i> is defined as the the point at which the value would
+ *          be inserted into the receiver: the index of the first
+ *         element greater than the key, or <tt>receiver.size()</tt>, if all
+ *         elements in the receiver are less than the specified key.  Note
+ *         that this guarantees that the return value will be &gt;= 0 if
+ *         and only if the key is found.
  * @see Comparable
  * @see java.util.Arrays
  */
 public int binarySearch(Object key) {
-	return this.binarySearchFromTo(key, 0, size-1);
+  return this.binarySearchFromTo(key, 0, size-1);
 }
 /**
  * Searches the receiver for the specified value using
@@ -169,30 +169,30 @@
  * @param from the leftmost search position, inclusive.
  * @param to the rightmost search position, inclusive.
  * @return index of the search key, if it is contained in the receiver;
- *	       otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
- *	       point</i> is defined as the the point at which the value would
- * 	       be inserted into the receiver: the index of the first
- *	       element greater than the key, or <tt>receiver.size()</tt>, if all
- *	       elements in the receiver are less than the specified key.  Note
- *	       that this guarantees that the return value will be &gt;= 0 if
- *	       and only if the key is found.
+ *         otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
+ *         point</i> is defined as the the point at which the value would
+ *          be inserted into the receiver: the index of the first
+ *         element greater than the key, or <tt>receiver.size()</tt>, if all
+ *         elements in the receiver are less than the specified key.  Note
+ *         that this guarantees that the return value will be &gt;= 0 if
+ *         and only if the key is found.
  * @see Comparable
  * @see java.util.Arrays
  */
 public int binarySearchFromTo(Object key, int from, int to) {
-	int low = from;
-	int high = to;
+  int low = from;
+  int high = to;
 
-	while (low <= high) {
-		int mid =(low + high)/2;
-		Object midVal = elements[mid];
-		int cmp = ((Comparable)midVal).compareTo(key);
+  while (low <= high) {
+    int mid =(low + high)/2;
+    Object midVal = elements[mid];
+    int cmp = ((Comparable)midVal).compareTo(key);
 
-		if (cmp < 0) low = mid + 1;
-		else if (cmp > 0) high = mid - 1;
-		else return mid; // key found
-	}
-	return -(low + 1);  // key not found.
+    if (cmp < 0) low = mid + 1;
+    else if (cmp > 0) high = mid - 1;
+    else return mid; // key found
+  }
+  return -(low + 1);  // key not found.
 }
 /**
  * Searches the receiver for the specified value using
@@ -214,21 +214,21 @@
  * @param to the rightmost search position, inclusive.
  * @param comparator the comparator by which the receiver is sorted.
  * @throws ClassCastException if the receiver contains elements that are not
- *	       <i>mutually comparable</i> using the specified comparator.
+ *         <i>mutually comparable</i> using the specified comparator.
  * @return index of the search key, if it is contained in the receiver;
- *	       otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
- *	       point</i> is defined as the the point at which the value would
- * 	       be inserted into the receiver: the index of the first
- *	       element greater than the key, or <tt>receiver.size()</tt>, if all
- *	       elements in the receiver are less than the specified key.  Note
- *	       that this guarantees that the return value will be &gt;= 0 if
- *	       and only if the key is found.
+ *         otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
+ *         point</i> is defined as the the point at which the value would
+ *          be inserted into the receiver: the index of the first
+ *         element greater than the key, or <tt>receiver.size()</tt>, if all
+ *         elements in the receiver are less than the specified key.  Note
+ *         that this guarantees that the return value will be &gt;= 0 if
+ *         and only if the key is found.
  * @see org.apache.mahout.matrix.Sorting
  * @see java.util.Arrays
  * @see java.util.Comparator
  */
 public int binarySearchFromTo(Object key, int from, int to, java.util.Comparator comparator) {
-	return org.apache.mahout.matrix.Sorting.binarySearchFromTo(this.elements,key,from,to,comparator);
+  return org.apache.mahout.matrix.Sorting.binarySearchFromTo(this.elements,key,from,to,comparator);
 }
 /**
  * Returns a copy of the receiver such that the copy and the receiver <i>share</i> the same elements, but do not share the same array to index them;
@@ -238,9 +238,9 @@
  * @return  a copy of the receiver.
  */
 public Object clone() {
-	ObjectArrayList v = (ObjectArrayList)super.clone();
-	v.elements = (Object[]) elements.clone();
-	return v;
+  ObjectArrayList v = (ObjectArrayList)super.clone();
+  v.elements = (Object[]) elements.clone();
+  return v;
 }
 /**
  * Returns true if the receiver contains the specified element.
@@ -250,7 +250,7 @@
  * @param testForEquality if true -> test for equality, otherwise for identity.
  */
 public boolean contains(Object elem, boolean testForEquality) {
-	return indexOfFromTo(elem,0,size-1, testForEquality) >=0;
+  return indexOfFromTo(elem,0,size-1, testForEquality) >=0;
 }
 /**
  * Returns a copy of the receiver; call <code>clone()</code> and casts the result.
@@ -261,7 +261,7 @@
  * @return  a copy of the receiver.
  */
 public ObjectArrayList copy() {
-	return (ObjectArrayList) clone();
+  return (ObjectArrayList) clone();
 }
 /**
  * Deletes the first element from the receiver that matches the specified element.
@@ -276,8 +276,8 @@
  * @param element the element to be deleted.
  */
 public void delete(Object element, boolean testForEquality) {
-	int index = indexOfFromTo(element, 0, size-1, testForEquality);
-	if (index>=0) removeFromTo(index,index);
+  int index = indexOfFromTo(element, 0, size-1, testForEquality);
+  if (index>=0) removeFromTo(index,index);
 }
 /**
  * Returns the elements currently stored, including invalid elements between size and capacity, if any.
@@ -288,7 +288,7 @@
  * @return the elements currently stored.
  */
 public Object[] elements() {
-	return elements;
+  return elements;
 }
 /**
  * Sets the receiver's elements to be the specified array (not a copy of it).
@@ -301,9 +301,9 @@
  * @return the receiver itself.
  */
 public ObjectArrayList elements(Object[] elements) {
-	this.elements=elements;
-	this.size=elements.length;
-	return this;
+  this.elements=elements;
+  this.size=elements.length;
+  return this;
 }
 /**
  * Ensures that the receiver can hold at least the specified number of elements without needing to allocate new internal memory.
@@ -312,7 +312,7 @@
  * @param   minCapacity   the desired minimum capacity.
  */
 public void ensureCapacity(int minCapacity) {
-	elements = org.apache.mahout.matrix.Arrays.ensureCapacity(elements,minCapacity);
+  elements = org.apache.mahout.matrix.Arrays.ensureCapacity(elements,minCapacity);
 }
 /**
 * Compares the specified Object with the receiver for equality.
@@ -328,7 +328,7 @@
 * @return true if the specified Object is equal to the receiver.
 */
 public boolean equals(Object otherObj) { //delta
-	return equals(otherObj, true);
+  return equals(otherObj, true);
 }
 /**
 * Compares the specified Object with the receiver for equality.
@@ -346,27 +346,27 @@
 * @return true if the specified Object is equal to the receiver.
 */
 public boolean equals(Object otherObj, boolean testForEquality) { //delta
-	if (! (otherObj instanceof ObjectArrayList)) {return false;}
-	if (this==otherObj) return true;
-	if (otherObj==null) return false;
-	ObjectArrayList other = (ObjectArrayList) otherObj;
-	if (elements==other.elements()) return true;
-	if (size!=other.size()) return false;
+  if (! (otherObj instanceof ObjectArrayList)) {return false;}
+  if (this==otherObj) return true;
+  if (otherObj==null) return false;
+  ObjectArrayList other = (ObjectArrayList) otherObj;
+  if (elements==other.elements()) return true;
+  if (size!=other.size()) return false;
 
-	Object[] otherElements = other.elements();
-	Object[] theElements = elements;
-	if (! testForEquality) {
-		for (int i=size; --i >= 0; ) {
-			if (theElements[i] != otherElements[i]) return false;
-		}
-	}
-	else {
-		for (int i=size; --i >= 0; ) {
-			if (!(theElements[i]==null ? otherElements[i]==null : theElements[i].equals(otherElements[i]))) return false;
-		}
-	}
+  Object[] otherElements = other.elements();
+  Object[] theElements = elements;
+  if (! testForEquality) {
+    for (int i=size; --i >= 0; ) {
+      if (theElements[i] != otherElements[i]) return false;
+    }
+  }
+  else {
+    for (int i=size; --i >= 0; ) {
+      if (!(theElements[i]==null ? otherElements[i]==null : theElements[i].equals(otherElements[i]))) return false;
+    }
+  }
 
-	return true;
+  return true;
 
 }
 /**
@@ -377,8 +377,8 @@
  * @param val the value to be stored in the specified elements of the receiver.
  */
 public void fillFromToWith(int from, int to, Object val) {
-	checkRangeFromTo(from,to,this.size);
-	for (int i=from; i<=to;) setQuick(i++,val); 
+  checkRangeFromTo(from,to,this.size);
+  for (int i=from; i<=to;) setQuick(i++,val); 
 }
 /**
  * Applies a procedure to each element of the receiver, if any.
@@ -387,11 +387,11 @@
  * @return <tt>false</tt> if the procedure stopped before all elements where iterated over, <tt>true</tt> otherwise. 
  */
 public boolean forEach(ObjectProcedure procedure) {
-	Object[] theElements = elements;
-	int theSize = size;
-	
-	for (int i=0; i<theSize;) if (! procedure.apply(theElements[i++])) return false;
-	return true;
+  Object[] theElements = elements;
+  int theSize = size;
+  
+  for (int i=0; i<theSize;) if (! procedure.apply(theElements[i++])) return false;
+  return true;
 }
 /**
  * Returns the element at the specified position in the receiver.
@@ -400,9 +400,9 @@
  * @exception IndexOutOfBoundsException index is out of range (index &lt; 0 || index &gt;= size()).
  */
 public Object get(int index) {
-	if (index >= size || index < 0)
-		throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
-	return elements[index];
+  if (index >= size || index < 0)
+    throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
+  return elements[index];
 }
 /**
  * Returns the element at the specified position in the receiver; <b>WARNING:</b> Does not check preconditions. 
@@ -413,7 +413,7 @@
  * @param index index of element to return.
  */
 public Object getQuick(int index) {
-	return elements[index];
+  return elements[index];
 }
 /**
  * Returns the index of the first occurrence of the specified
@@ -425,7 +425,7 @@
  * @return  the index of the first occurrence of the element in the receiver; returns <code>-1</code> if the element is not found.
  */
 public int indexOf(Object element, boolean testForEquality) {
-	return this.indexOfFromTo(element, 0, size-1, testForEquality);
+  return this.indexOfFromTo(element, 0, size-1, testForEquality);
 }
 /**
  * Returns the index of the first occurrence of the specified
@@ -442,22 +442,22 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public int indexOfFromTo(Object element, int from, int to, boolean testForEquality) {
-	if (size==0) return -1;
-	checkRangeFromTo(from, to, size);
+  if (size==0) return -1;
+  checkRangeFromTo(from, to, size);
 
-	Object[] theElements = elements;
-	if (testForEquality && element!=null) {
-		for (int i = from ; i <= to; i++) {
-		    if (element.equals(theElements[i])) {return i;} //found
-		}
+  Object[] theElements = elements;
+  if (testForEquality && element!=null) {
+    for (int i = from ; i <= to; i++) {
+        if (element.equals(theElements[i])) {return i;} //found
+    }
 
-	}
-	else {
-		for (int i = from ; i <= to; i++) {
-		    if (element==theElements[i]) {return i;} //found
-		}
-	}
-	return -1; //not found
+  }
+  else {
+    for (int i = from ; i <= to; i++) {
+        if (element==theElements[i]) {return i;} //found
+    }
+  }
+  return -1; //not found
 }
 /**
  * Determines whether the receiver is sorted ascending, according to the <i>natural ordering</i> of its
@@ -473,14 +473,14 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public boolean isSortedFromTo(int from, int to) {
-	if (size==0) return true;
-	checkRangeFromTo(from, to, size);
-	
-	Object[] theElements = elements;
-	for (int i=from+1; i<=to; i++ ) {
-		if (((Comparable)theElements[i]).compareTo((Comparable) theElements[i-1]) < 0) return false;
-	}
-	return true;
+  if (size==0) return true;
+  checkRangeFromTo(from, to, size);
+  
+  Object[] theElements = elements;
+  for (int i=from+1; i<=to; i++ ) {
+    if (((Comparable)theElements[i]).compareTo((Comparable) theElements[i-1]) < 0) return false;
+  }
+  return true;
 }
 /**
  * Returns the index of the last occurrence of the specified
@@ -492,7 +492,7 @@
  * @return  the index of the last occurrence of the element in the receiver; returns <code>-1</code> if the element is not found.
  */
 public int lastIndexOf(Object element, boolean testForEquality) {
-	return lastIndexOfFromTo(element, 0, size-1, testForEquality);
+  return lastIndexOfFromTo(element, 0, size-1, testForEquality);
 }
 /**
  * Returns the index of the last occurrence of the specified
@@ -508,22 +508,22 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public int lastIndexOfFromTo(Object element, int from, int to, boolean testForEquality) {
-	if (size==0) return -1;
-	checkRangeFromTo(from, to, size);
+  if (size==0) return -1;
+  checkRangeFromTo(from, to, size);
 
-	Object[] theElements = elements;
-	if (testForEquality && element!=null) {
-		for (int i = to ; i >= from; i--) {
-		    if (element.equals(theElements[i])) {return i;} //found
-		}
+  Object[] theElements = elements;
+  if (testForEquality && element!=null) {
+    for (int i = to ; i >= from; i--) {
+        if (element.equals(theElements[i])) {return i;} //found
+    }
 
-	}
-	else {
-		for (int i = to ; i >= from; i--) {
-		    if (element==theElements[i]) {return i;} //found
-		}
-	}
-	return -1; //not found
+  }
+  else {
+    for (int i = to ; i >= from; i--) {
+        if (element==theElements[i]) {return i;} //found
+    }
+  }
+  return -1; //not found
 }
 /**
  * Sorts the specified range of the receiver into
@@ -551,9 +551,9 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public void mergeSortFromTo(int from, int to) {
-	if (size==0) return;
-	checkRangeFromTo(from, to, size);
-	java.util.Arrays.sort(elements, from, to+1);
+  if (size==0) return;
+  checkRangeFromTo(from, to, size);
+  java.util.Arrays.sort(elements, from, to+1);
 }
 /**
  * Sorts the receiver according
@@ -577,17 +577,17 @@
  * @param to the index of the last element (inclusive) to be sorted.
  * @param c the comparator to determine the order of the receiver.
  * @throws ClassCastException if the array contains elements that are not
- *	       <i>mutually comparable</i> using the specified comparator.
+ *         <i>mutually comparable</i> using the specified comparator.
  * @throws IllegalArgumentException if <tt>fromIndex &gt; toIndex</tt>
  * @throws ArrayIndexOutOfBoundsException if <tt>fromIndex &lt; 0</tt> or
- *	       <tt>toIndex &gt; a.length</tt>
+ *         <tt>toIndex &gt; a.length</tt>
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  * @see Comparator
  */
 public void mergeSortFromTo(int from, int to, java.util.Comparator c) {
-	if (size==0) return;
-	checkRangeFromTo(from, to, size);
-	java.util.Arrays.sort(elements, from, to+1, c);
+  if (size==0) return;
+  checkRangeFromTo(from, to, size);
+  java.util.Arrays.sort(elements, from, to+1, c);
 }
 /**
  * Returns a new list of the part of the receiver between <code>from</code>, inclusive, and <code>to</code>, inclusive.
@@ -597,13 +597,13 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
 */
 public ObjectArrayList partFromTo(int from, int to) {
-	if (size==0) return new ObjectArrayList(0);
+  if (size==0) return new ObjectArrayList(0);
 
-	checkRangeFromTo(from, to, size);
+  checkRangeFromTo(from, to, size);
 
-	Object[] part = new Object[to-from+1];
-	System.arraycopy(elements, from, part, 0, to-from+1);
-	return new ObjectArrayList(part);
+  Object[] part = new Object[to-from+1];
+  System.arraycopy(elements, from, part, 0, to-from+1);
+  return new ObjectArrayList(part);
 }
 /**
  * Sorts the specified range of the receiver into
@@ -629,9 +629,9 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public void quickSortFromTo(int from, int to) {
-	if (size==0) return;
-	checkRangeFromTo(from, to, size);
-	org.apache.mahout.matrix.Sorting.quickSort(elements, from, to+1);
+  if (size==0) return;
+  checkRangeFromTo(from, to, size);
+  org.apache.mahout.matrix.Sorting.quickSort(elements, from, to+1);
 }
 /**
  * Sorts the receiver according
@@ -652,17 +652,17 @@
  * @param to the index of the last element (inclusive) to be sorted.
  * @param c the comparator to determine the order of the receiver.
  * @throws ClassCastException if the array contains elements that are not
- *	       <i>mutually comparable</i> using the specified comparator.
+ *         <i>mutually comparable</i> using the specified comparator.
  * @throws IllegalArgumentException if <tt>fromIndex &gt; toIndex</tt>
  * @throws ArrayIndexOutOfBoundsException if <tt>fromIndex &lt; 0</tt> or
- *	       <tt>toIndex &gt; a.length</tt>
+ *         <tt>toIndex &gt; a.length</tt>
  * @see Comparator
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public void quickSortFromTo(int from, int to, java.util.Comparator c) {
-	if (size==0) return;
-	checkRangeFromTo(from, to, size);
-	org.apache.mahout.matrix.Sorting.quickSort(elements, from, to+1, c);
+  if (size==0) return;
+  checkRangeFromTo(from, to, size);
+  org.apache.mahout.matrix.Sorting.quickSort(elements, from, to+1, c);
 }
 /**
 * Removes from the receiver all elements that are contained in the specified list.
@@ -673,17 +673,17 @@
 * @return <code>true</code> if the receiver changed as a result of the call.
 */
 public boolean removeAll(ObjectArrayList other, boolean testForEquality) {
-	if (other.size==0) return false; //nothing to do
-	int limit = other.size-1;
-	int j=0;
-	Object[] theElements = elements;
-	for (int i=0; i<size ; i++) {
-		if (other.indexOfFromTo(theElements[i], 0, limit, testForEquality) < 0) theElements[j++]=theElements[i];
-	}
+  if (other.size==0) return false; //nothing to do
+  int limit = other.size-1;
+  int j=0;
+  Object[] theElements = elements;
+  for (int i=0; i<size ; i++) {
+    if (other.indexOfFromTo(theElements[i], 0, limit, testForEquality) < 0) theElements[j++]=theElements[i];
+  }
 
-	boolean modified = (j!=size);
-	setSize(j);
-	return modified;
+  boolean modified = (j!=size);
+  setSize(j);
+  return modified;
 }
 /**
  * Removes from the receiver all elements whose index is between
@@ -696,14 +696,14 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public void removeFromTo(int from, int to) {
-	checkRangeFromTo(from, to, size);
-	int numMoved = size - to - 1;
-	if (numMoved >= 0) {
-		System.arraycopy(elements, to+1, elements, from, numMoved);
-		fillFromToWith(from+numMoved, size-1, null); //delta
-	}
-	int width = to-from+1;
-	if (width>0) size -= width;
+  checkRangeFromTo(from, to, size);
+  int numMoved = size - to - 1;
+  if (numMoved >= 0) {
+    System.arraycopy(elements, to+1, elements, from, numMoved);
+    fillFromToWith(from+numMoved, size-1, null); //delta
+  }
+  int width = to-from+1;
+  if (width>0) size -= width;
 }
 /**
  * Replaces a number of elements in the receiver with the same number of elements of another list.
@@ -716,12 +716,12 @@
  * @param otherFrom position of first element within other list to be copied.
  */
 public void replaceFromToWithFrom(int from, int to, ObjectArrayList other, int otherFrom) {
-	int length=to-from+1;
-	if (length>0) {
-		checkRangeFromTo(from, to, size);
-		checkRangeFromTo(otherFrom,otherFrom+length-1,other.size);
-		System.arraycopy(other.elements, otherFrom, elements, from, length);
-	}
+  int length=to-from+1;
+  if (length>0) {
+    checkRangeFromTo(from, to, size);
+    checkRangeFromTo(otherFrom,otherFrom+length-1,other.size);
+    System.arraycopy(other.elements, otherFrom, elements, from, length);
+  }
 }
 /**
 * Replaces the part between <code>from</code> (inclusive) and <code>to</code> (inclusive) with the other list's
@@ -767,39 +767,39 @@
 * </pre>
 */
 public void replaceFromToWithFromTo(int from, int to, ObjectArrayList other, int otherFrom, int otherTo) {
-	if (otherFrom>otherTo) {
-		throw new IndexOutOfBoundsException("otherFrom: "+otherFrom+", otherTo: "+otherTo);
-	}
-	if (this==other && to-from!=otherTo-otherFrom) { // avoid stumbling over my own feet
-		replaceFromToWithFromTo(from, to, partFromTo(otherFrom, otherTo), 0, otherTo-otherFrom);
-		return;
-	}
-	
-	int length=otherTo-otherFrom+1;
-	int diff=length;
-	int theLast=from-1;
+  if (otherFrom>otherTo) {
+    throw new IndexOutOfBoundsException("otherFrom: "+otherFrom+", otherTo: "+otherTo);
+  }
+  if (this==other && to-from!=otherTo-otherFrom) { // avoid stumbling over my own feet
+    replaceFromToWithFromTo(from, to, partFromTo(otherFrom, otherTo), 0, otherTo-otherFrom);
+    return;
+  }
+  
+  int length=otherTo-otherFrom+1;
+  int diff=length;
+  int theLast=from-1;
 
-	//System.out.println("from="+from);
-	//System.out.println("to="+to);
-	//System.out.println("diff="+diff);
-	
-	if (to>=from) {
-		diff -= (to-from+1);
-		theLast=to;
-	}
-	
-	if (diff>0) {
-		beforeInsertDummies(theLast+1, diff);
-	}
-	else {
-		if (diff<0) {
-			removeFromTo(theLast+diff, theLast-1);
-		}
-	}
+  //System.out.println("from="+from);
+  //System.out.println("to="+to);
+  //System.out.println("diff="+diff);
+  
+  if (to>=from) {
+    diff -= (to-from+1);
+    theLast=to;
+  }
+  
+  if (diff>0) {
+    beforeInsertDummies(theLast+1, diff);
+  }
+  else {
+    if (diff<0) {
+      removeFromTo(theLast+diff, theLast-1);
+    }
+  }
 
-	if (length>0) {
-		System.arraycopy(other.elements, otherFrom, elements, from, length);
-	}
+  if (length>0) {
+    System.arraycopy(other.elements, otherFrom, elements, from, length);
+  }
 }
 /**
  * Replaces the part of the receiver starting at <code>from</code> (inclusive) with all the elements of the specified collection.
@@ -811,12 +811,12 @@
  * @exception IndexOutOfBoundsException index is out of range (index &lt; 0 || index &gt;= size()).
  */
 public void replaceFromWith(int from, java.util.Collection other) {
-	checkRange(from,size);
-	java.util.Iterator e = other.iterator();
-	int index=from;
-	int limit = Math.min(size-from, other.size());
-	for (int i=0; i<limit; i++)
-	    elements[index++] = e.next(); //delta
+  checkRange(from,size);
+  java.util.Iterator e = other.iterator();
+  int index=from;
+  int limit = Math.min(size-from, other.size());
+  for (int i=0; i<limit; i++)
+      elements[index++] = e.next(); //delta
 }
 /**
 * Retains (keeps) only the elements in the receiver that are contained in the specified other list.
@@ -828,39 +828,39 @@
 * @return <code>true</code> if the receiver changed as a result of the call.
 */
 public boolean retainAll(ObjectArrayList other, boolean testForEquality) {
-	if (other.size==0) {
-		if (size==0) return false;
-		setSize(0);
-		return true;
-	}
-	
-	int limit = other.size-1;
-	int j=0;
-	Object[] theElements = elements;
+  if (other.size==0) {
+    if (size==0) return false;
+    setSize(0);
+    return true;
+  }
+  
+  int limit = other.size-1;
+  int j=0;
+  Object[] theElements = elements;
 
-	for (int i=0; i<size ; i++) {
-		if (other.indexOfFromTo(theElements[i], 0, limit, testForEquality) >= 0) theElements[j++]=theElements[i];
-	}
+  for (int i=0; i<size ; i++) {
+    if (other.indexOfFromTo(theElements[i], 0, limit, testForEquality) >= 0) theElements[j++]=theElements[i];
+  }
 
-	boolean modified = (j!=size);
-	setSize(j);
-	return modified;
+  boolean modified = (j!=size);
+  setSize(j);
+  return modified;
 }
 /**
  * Reverses the elements of the receiver.
  * Last becomes first, second last becomes second first, and so on.
  */
 public void reverse() {
-	Object tmp;
-	int limit=size/2;
-	int j=size-1;
-	
-	Object[] theElements = elements;
-	for (int i=0; i<limit;) { //swap
-		tmp=theElements[i];
-		theElements[i++]=theElements[j];
-		theElements[j--]=tmp;
-	}
+  Object tmp;
+  int limit=size/2;
+  int j=size-1;
+  
+  Object[] theElements = elements;
+  for (int i=0; i<limit;) { //swap
+    tmp=theElements[i];
+    theElements[i++]=theElements[j];
+    theElements[j--]=tmp;
+  }
 }
 /**
  * Replaces the element at the specified position in the receiver with the specified element.
@@ -868,12 +868,12 @@
  * @param index index of element to replace.
  * @param element element to be stored at the specified position.
  * @exception IndexOutOfBoundsException index is out of range (index
- * 		  &lt; 0 || index &gt;= size()).
+ *       &lt; 0 || index &gt;= size()).
 */
 public void set(int index, Object element) {
-	if (index >= size || index < 0)
-		throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
-	elements[index] = element;
+  if (index >= size || index < 0)
+    throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
+  elements[index] = element;
 }
 /**
  * Replaces the element at the specified position in the receiver with the specified element; <b>WARNING:</b> Does not check preconditions.
@@ -885,7 +885,7 @@
  * @param element element to be stored at the specified position.
  */
 public void setQuick(int index, Object element) {
-	elements[index] = element;
+  elements[index] = element;
 }
 /**
  * Randomly permutes the part of the receiver between <code>from</code> (inclusive) and <code>to</code> (inclusive). 
@@ -894,21 +894,21 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public void shuffleFromTo(int from, int to) {
-	if (size == 0) return;
-	checkRangeFromTo(from, to, size);
-	
-	org.apache.mahout.jet.random.Uniform gen = new org.apache.mahout.jet.random.Uniform(new org.apache.mahout.jet.random.engine.DRand(new java.util.Date()));
-	Object tmpElement;
-	Object[] theElements = elements;
-	int random;
-	for (int i = from; i < to; i++) {
-		random = gen.nextIntFromTo(i, to);
+  if (size == 0) return;
+  checkRangeFromTo(from, to, size);
+  
+  org.apache.mahout.jet.random.Uniform gen = new org.apache.mahout.jet.random.Uniform(new org.apache.mahout.jet.random.engine.DRand(new java.util.Date()));
+  Object tmpElement;
+  Object[] theElements = elements;
+  int random;
+  for (int i = from; i < to; i++) {
+    random = gen.nextIntFromTo(i, to);
 
-		//swap(i, random)
-		tmpElement = theElements[random];
-		theElements[random] = theElements[i];
-		theElements[i] = tmpElement;
-	}
+    //swap(i, random)
+    tmpElement = theElements[random];
+    theElements[random] = theElements[i];
+    theElements[i] = tmpElement;
+  }
 }
 /**
  * Returns the number of elements contained in the receiver.
@@ -916,18 +916,18 @@
  * @returns  the number of elements contained in the receiver.
  */
 public int size() {
-	return size;
+  return size;
 }
 /**
  * Returns a list which is a concatenation of <code>times</code> times the receiver.
  * @param times the number of times the receiver shall be copied.
  */
 public ObjectArrayList times(int times) {
-	ObjectArrayList newList = new ObjectArrayList(times*size);
-	for (int i=times; --i >= 0; ) {
-		newList.addAllOfFromTo(this,0,size()-1);
-	}
-	return newList;
+  ObjectArrayList newList = new ObjectArrayList(times*size);
+  for (int i=times; --i >= 0; ) {
+    newList.addAllOfFromTo(this,0,size()-1);
+  }
+  return newList;
 }
 /**
  * Returns an array containing all of the elements in the receiver in the
@@ -944,39 +944,39 @@
  * does not contain any null elements.
  *
  * @param array the array into which the elements of the receiver are to
- *		be stored, if it is big enough; otherwise, a new array of the
- * 		same runtime type is allocated for this purpose.
+ *    be stored, if it is big enough; otherwise, a new array of the
+ *     same runtime type is allocated for this purpose.
  * @return an array containing the elements of the receiver.
  * @exception ArrayStoreException the runtime type of <tt>array</tt> is not a supertype
  * of the runtime type of every element in the receiver.
  */
 public Object[] toArray(Object array[]) {
-	if (array.length < size)
-		array = (Object[])java.lang.reflect.Array.newInstance(array.getClass().getComponentType(), size);
+  if (array.length < size)
+    array = (Object[])java.lang.reflect.Array.newInstance(array.getClass().getComponentType(), size);
 
-	Object[] theElements = elements;
-	for (int i=size; --i >=0; ) array[i]=theElements[i];
+  Object[] theElements = elements;
+  for (int i=size; --i >=0; ) array[i]=theElements[i];
 
-	if (array.length > size) array[size] = null;
+  if (array.length > size) array[size] = null;
 
-	return array;
+  return array;
 }
 /**
  * Returns a <code>java.util.ArrayList</code> containing all the elements in the receiver.
  */
 public java.util.ArrayList toList() {
-	int mySize = size();
-	Object[] theElements = elements;
-	java.util.ArrayList list = new java.util.ArrayList(mySize);
-	for (int i=0; i < mySize; i++) list.add(theElements[i]);
-	return list;
+  int mySize = size();
+  Object[] theElements = elements;
+  java.util.ArrayList list = new java.util.ArrayList(mySize);
+  for (int i=0; i < mySize; i++) list.add(theElements[i]);
+  return list;
 }
 /**
 * Returns a string representation of the receiver, containing
 * the String representation of each element.
 */
 public String toString() {
-	return org.apache.mahout.matrix.Arrays.toString(partFromTo(0, size()-1).elements());
+  return org.apache.mahout.matrix.Arrays.toString(partFromTo(0, size()-1).elements());
 }
 /**
  * Trims the capacity of the receiver to be the receiver's current 
@@ -984,6 +984,6 @@
  * storage of the receiver.
  */
 public void trimToSize() {
-	elements = org.apache.mahout.matrix.Arrays.trimToCapacity(elements,size());
+  elements = org.apache.mahout.matrix.Arrays.trimToCapacity(elements,size());
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/list/SimpleLongArrayList.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/list/SimpleLongArrayList.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/list/SimpleLongArrayList.java	(working copy)
@@ -17,23 +17,23 @@
  */
 @Deprecated
 public class SimpleLongArrayList extends AbstractLongList {
-	/**
-	 * The array buffer into which the elements of the list are stored.
-	 * The capacity of the list is the length of this array buffer.
-	 * @serial
-	 */
-	protected long[] elements;
-	
-	/**
-	 * The size of the list.
-	 * @serial
-	 */
-	protected int size;
+  /**
+   * The array buffer into which the elements of the list are stored.
+   * The capacity of the list is the length of this array buffer.
+   * @serial
+   */
+  protected long[] elements;
+  
+  /**
+   * The size of the list.
+   * @serial
+   */
+  protected int size;
 /**
  * Constructs an empty list.
  */
 public SimpleLongArrayList() {
-	this(10);
+  this(10);
 }
 /**
  * Constructs a list containing the specified elements. 
@@ -45,7 +45,7 @@
  * @param elements the array to be backed by the the constructed list
  */
 public SimpleLongArrayList(long[] elements) {
-	elements(elements);
+  elements(elements);
 }
 /**
  * Constructs an empty list with the specified initial capacity.
@@ -53,12 +53,12 @@
  * @param   initialCapacity   the number of elements the receiver can hold without auto-expanding itself by allocating new internal memory.
  */
 public SimpleLongArrayList(int initialCapacity) {
-	super();
-	if (initialCapacity < 0)
-	   throw new IllegalArgumentException("Illegal Capacity: "+ initialCapacity);
+  super();
+  if (initialCapacity < 0)
+     throw new IllegalArgumentException("Illegal Capacity: "+ initialCapacity);
 
-	this.elements(new long[initialCapacity]);
-	size=0;
+  this.elements(new long[initialCapacity]);
+  size=0;
 }
 /**
  * Ensures that the receiver can hold at least the specified number of elements without needing to allocate new internal memory.
@@ -67,7 +67,7 @@
  * @param   minCapacity   the desired minimum capacity.
  */
 public void ensureCapacity(int minCapacity) {
-	elements = org.apache.mahout.matrix.Arrays.ensureCapacity(elements,minCapacity);
+  elements = org.apache.mahout.matrix.Arrays.ensureCapacity(elements,minCapacity);
 }
 /**
  * Returns the element at the specified position in the receiver; <b>WARNING:</b> Does not check preconditions. 
@@ -78,7 +78,7 @@
  * @param index index of element to return.
  */
 protected long getQuick(int index) {
-	return elements[index];
+  return elements[index];
 }
 /**
  * Replaces the element at the specified position in the receiver with the specified element; <b>WARNING:</b> Does not check preconditions. 
@@ -90,7 +90,7 @@
  * @param element element to be stored at the specified position.
  */
 protected void setQuick(int index, long element) {
-	elements[index] = element;
+  elements[index] = element;
 }
 /**
 * Trims the capacity of the receiver to be the receiver's current 
@@ -98,6 +98,6 @@
 * storage of the receiver. 
 */
 public void trimToSize() {
-	elements = org.apache.mahout.matrix.Arrays.trimToCapacity(elements,size());
+  elements = org.apache.mahout.matrix.Arrays.trimToCapacity(elements,size());
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/list/DoubleArrayList.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/list/DoubleArrayList.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/list/DoubleArrayList.java	(working copy)
@@ -18,17 +18,17 @@
  */
 @Deprecated
 public class DoubleArrayList extends AbstractDoubleList {
-	/**
-	 * The array buffer into which the elements of the list are stored.
-	 * The capacity of the list is the length of this array buffer.
-	 * @serial
-	 */
-	protected double[] elements;
+  /**
+   * The array buffer into which the elements of the list are stored.
+   * The capacity of the list is the length of this array buffer.
+   * @serial
+   */
+  protected double[] elements;
 /**
  * Constructs an empty list.
  */
 public DoubleArrayList() {
-	this(10);
+  this(10);
 }
 /**
  * Constructs a list containing the specified elements. 
@@ -40,7 +40,7 @@
  * @param elements the array to be backed by the the constructed list
  */
 public DoubleArrayList(double[] elements) {
-	elements(elements);
+  elements(elements);
 }
 /**
  * Constructs an empty list with the specified initial capacity.
@@ -48,8 +48,8 @@
  * @param   initialCapacity   the number of elements the receiver can hold without auto-expanding itself by allocating new internal memory.
  */
 public DoubleArrayList(int initialCapacity) {
-	this(new double[initialCapacity]);
-	setSizeRaw(0);
+  this(new double[initialCapacity]);
+  setSizeRaw(0);
 }
 /**
  * Appends the specified element to the end of this list.
@@ -57,9 +57,9 @@
  * @param element element to be appended to this list.
  */
 public void add(double element) {
-	// overridden for performance only.  
-	if (size == elements.length) ensureCapacity(size + 1); 
-	elements[size++] = element;
+  // overridden for performance only.  
+  if (size == elements.length) ensureCapacity(size + 1); 
+  elements[size++] = element;
 }
 /**
  * Inserts the specified element before the specified position into the receiver. 
@@ -71,17 +71,17 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>index &lt; 0 || index &gt; size()</tt>).
  */
 public void beforeInsert(int index, double element) {
-	// overridden for performance only.
-	if (size == index) {
-		add(element);
-		return;
-	}
-	if (index > size || index < 0) 
-		throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
-	ensureCapacity(size + 1);
-	System.arraycopy(elements, index, elements, index+1, size-index);
-	elements[index] = element;
-	size++;
+  // overridden for performance only.
+  if (size == index) {
+    add(element);
+    return;
+  }
+  if (index > size || index < 0) 
+    throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
+  ensureCapacity(size + 1);
+  System.arraycopy(elements, index, elements, index+1, size-index);
+  elements[index] = element;
+  size++;
 }
 /**
  * Searches the receiver for the specified value using
@@ -96,18 +96,18 @@
  * @param from the leftmost search position, inclusive.
  * @param to the rightmost search position, inclusive.
  * @return index of the search key, if it is contained in the receiver;
- *	       otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
- *	       point</i> is defined as the the point at which the value would
- * 	       be inserted into the receiver: the index of the first
- *	       element greater than the key, or <tt>receiver.size()</tt>, if all
- *	       elements in the receiver are less than the specified key.  Note
- *	       that this guarantees that the return value will be &gt;= 0 if
- *	       and only if the key is found.
+ *         otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
+ *         point</i> is defined as the the point at which the value would
+ *          be inserted into the receiver: the index of the first
+ *         element greater than the key, or <tt>receiver.size()</tt>, if all
+ *         elements in the receiver are less than the specified key.  Note
+ *         that this guarantees that the return value will be &gt;= 0 if
+ *         and only if the key is found.
  * @see org.apache.mahout.matrix.Sorting
  * @see java.util.Arrays
  */
 public int binarySearchFromTo(double key, int from, int to) {
-	return org.apache.mahout.matrix.Sorting.binarySearchFromTo(this.elements,key,from,to);
+  return org.apache.mahout.matrix.Sorting.binarySearchFromTo(this.elements,key,from,to);
 }
 /**
  * Returns a deep copy of the receiver. 
@@ -115,10 +115,10 @@
  * @return  a deep copy of the receiver.
  */
 public Object clone() {
-	// overridden for performance only.
-	DoubleArrayList clone = new DoubleArrayList((double[]) elements.clone());
-	clone.setSizeRaw(size);
-	return clone;
+  // overridden for performance only.
+  DoubleArrayList clone = new DoubleArrayList((double[]) elements.clone());
+  clone.setSizeRaw(size);
+  return clone;
 }
 /**
  * Returns a deep copy of the receiver; uses <code>clone()</code> and casts the result.
@@ -126,7 +126,7 @@
  * @return  a deep copy of the receiver.
  */
 public DoubleArrayList copy() {
-	return (DoubleArrayList) clone();
+  return (DoubleArrayList) clone();
 }
 /**
  * Returns the elements currently stored, including invalid elements between size and capacity, if any.
@@ -137,7 +137,7 @@
  * @return the elements currently stored.
  */
 public double[] elements() {
-	return elements;
+  return elements;
 }
 /**
  * Sets the receiver's elements to be the specified array (not a copy of it).
@@ -150,9 +150,9 @@
  * @return the receiver itself.
  */
 public AbstractDoubleList elements(double[] elements) {
-	this.elements=elements;
-	this.size=elements.length;
-	return this;
+  this.elements=elements;
+  this.size=elements.length;
+  return this;
 }
 /**
  * Ensures that the receiver can hold at least the specified number of elements without needing to allocate new internal memory.
@@ -161,7 +161,7 @@
  * @param   minCapacity   the desired minimum capacity.
  */
 public void ensureCapacity(int minCapacity) {
-	elements = org.apache.mahout.matrix.Arrays.ensureCapacity(elements,minCapacity);
+  elements = org.apache.mahout.matrix.Arrays.ensureCapacity(elements,minCapacity);
 }
 /**
  * Compares the specified Object with the receiver.  
@@ -174,19 +174,19 @@
  * @return true if the specified Object is equal to the receiver.
  */
 public boolean equals(Object otherObj) { //delta
-	// overridden for performance only.
-	if (! (otherObj instanceof DoubleArrayList)) return super.equals(otherObj);
-	if (this==otherObj) return true;
-	if (otherObj==null) return false;
-	DoubleArrayList other = (DoubleArrayList) otherObj;
-	if (size()!=other.size()) return false;
+  // overridden for performance only.
+  if (! (otherObj instanceof DoubleArrayList)) return super.equals(otherObj);
+  if (this==otherObj) return true;
+  if (otherObj==null) return false;
+  DoubleArrayList other = (DoubleArrayList) otherObj;
+  if (size()!=other.size()) return false;
 
-	double[] theElements = elements();
-	double[] otherElements = other.elements();
-	for (int i=size(); --i >= 0; ) {
-	    if (theElements[i] != otherElements[i]) return false;
-	}
-	return true;
+  double[] theElements = elements();
+  double[] otherElements = other.elements();
+  for (int i=size(); --i >= 0; ) {
+      if (theElements[i] != otherElements[i]) return false;
+  }
+  return true;
 }
 /**
  * Applies a procedure to each element of the receiver, if any.
@@ -195,25 +195,25 @@
  * @return <tt>false</tt> if the procedure stopped before all elements where iterated over, <tt>true</tt> otherwise. 
  */
 public boolean forEach(DoubleProcedure procedure) {
-	// overridden for performance only.
-	double[] theElements = elements;
-	int theSize = size;
-	
-	for (int i=0; i<theSize;) if (! procedure.apply(theElements[i++])) return false;
-	return true;
+  // overridden for performance only.
+  double[] theElements = elements;
+  int theSize = size;
+  
+  for (int i=0; i<theSize;) if (! procedure.apply(theElements[i++])) return false;
+  return true;
 }
 /**
  * Returns the element at the specified position in the receiver.
  *
  * @param index index of element to return.
  * @exception IndexOutOfBoundsException index is out of range (index
- * 		  &lt; 0 || index &gt;= size()).
+ *       &lt; 0 || index &gt;= size()).
  */
 public double get(int index) {
-	// overridden for performance only.
-	if (index >= size || index < 0)
-		throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
-	return elements[index];
+  // overridden for performance only.
+  if (index >= size || index < 0)
+    throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
+  return elements[index];
 }
 /**
  * Returns the element at the specified position in the receiver; <b>WARNING:</b> Does not check preconditions. 
@@ -224,7 +224,7 @@
  * @param index index of element to return.
  */
 public double getQuick(int index) {
-	return elements[index];
+  return elements[index];
 }
 /**
  * Returns the index of the first occurrence of the specified
@@ -239,15 +239,15 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public int indexOfFromTo(double element, int from, int to) {
-	// overridden for performance only.
-	if (size==0) return -1;
-	checkRangeFromTo(from, to, size);
+  // overridden for performance only.
+  if (size==0) return -1;
+  checkRangeFromTo(from, to, size);
 
-	double[] theElements = elements;
-	for (int i = from ; i <= to; i++) {
-	    if (element==theElements[i]) {return i;} //found
-	}
-	return -1; //not found
+  double[] theElements = elements;
+  for (int i = from ; i <= to; i++) {
+      if (element==theElements[i]) {return i;} //found
+  }
+  return -1; //not found
 }
 /**
  * Returns the index of the last occurrence of the specified
@@ -262,15 +262,15 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public int lastIndexOfFromTo(double element, int from, int to) {
-	// overridden for performance only.
-	if (size==0) return -1;
-	checkRangeFromTo(from, to, size);
+  // overridden for performance only.
+  if (size==0) return -1;
+  checkRangeFromTo(from, to, size);
 
-	double[] theElements = elements;
-	for (int i = to ; i >= from; i--) {
-	    if (element==theElements[i]) {return i;} //found
-	}
-	return -1; //not found
+  double[] theElements = elements;
+  for (int i = to ; i >= from; i--) {
+      if (element==theElements[i]) {return i;} //found
+  }
+  return -1; //not found
 }
 /**
  * Returns a new list of the part of the receiver between <code>from</code>, inclusive, and <code>to</code>, inclusive.
@@ -280,13 +280,13 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public AbstractDoubleList partFromTo(int from, int to) {
-	if (size==0) return new DoubleArrayList(0);
+  if (size==0) return new DoubleArrayList(0);
 
-	checkRangeFromTo(from, to, size);
+  checkRangeFromTo(from, to, size);
 
-	double[] part = new double[to-from+1];
-	System.arraycopy(elements, from, part, 0, to-from+1);
-	return new DoubleArrayList(part);
+  double[] part = new double[to-from+1];
+  System.arraycopy(elements, from, part, 0, to-from+1);
+  return new DoubleArrayList(part);
 }
 /**
 * Removes from the receiver all elements that are contained in the specified list.
@@ -296,46 +296,46 @@
 * @return <code>true</code> if the receiver changed as a result of the call.
 */
 public boolean removeAll(AbstractDoubleList other) {
-	// overridden for performance only.
-	if (! (other instanceof DoubleArrayList))	return super.removeAll(other);
-	
-	/* There are two possibilities to do the thing
-	   a) use other.indexOf(...)
-	   b) sort other, then use other.binarySearch(...)
-	   
-	   Let's try to figure out which one is faster. Let M=size, N=other.size, then
-	   a) takes O(M*N) steps
-	   b) takes O(N*logN + M*logN) steps (sorting is O(N*logN) and binarySearch is O(logN))
+  // overridden for performance only.
+  if (! (other instanceof DoubleArrayList))  return super.removeAll(other);
+  
+  /* There are two possibilities to do the thing
+     a) use other.indexOf(...)
+     b) sort other, then use other.binarySearch(...)
+     
+     Let's try to figure out which one is faster. Let M=size, N=other.size, then
+     a) takes O(M*N) steps
+     b) takes O(N*logN + M*logN) steps (sorting is O(N*logN) and binarySearch is O(logN))
  
-	   Hence, if N*logN + M*logN < M*N, we use b) otherwise we use a).
-	*/
-	if (other.size()==0) {return false;} //nothing to do
-	int limit = other.size()-1;
-	int j=0;
-	double[] theElements = elements;
-	int mySize = size();
+     Hence, if N*logN + M*logN < M*N, we use b) otherwise we use a).
+  */
+  if (other.size()==0) {return false;} //nothing to do
+  int limit = other.size()-1;
+  int j=0;
+  double[] theElements = elements;
+  int mySize = size();
 
-	double N=(double) other.size();
-	double M=(double) mySize;
-	if ( (N+M)* org.apache.mahout.jet.math.Arithmetic.log2(N) < M*N ) {
-		// it is faster to sort other before searching in it
-		DoubleArrayList sortedList = (DoubleArrayList) other.clone();
-		sortedList.quickSort();
+  double N=(double) other.size();
+  double M=(double) mySize;
+  if ( (N+M)* org.apache.mahout.jet.math.Arithmetic.log2(N) < M*N ) {
+    // it is faster to sort other before searching in it
+    DoubleArrayList sortedList = (DoubleArrayList) other.clone();
+    sortedList.quickSort();
 
-		for (int i=0; i<mySize ; i++) {
-			if (sortedList.binarySearchFromTo(theElements[i], 0, limit) < 0) theElements[j++]=theElements[i];
-		}
-	}
-	else {
-		// it is faster to search in other without sorting
-		for (int i=0; i<mySize ; i++) {
-			if (other.indexOfFromTo(theElements[i], 0, limit) < 0) theElements[j++]=theElements[i];
-		}
-	}
+    for (int i=0; i<mySize ; i++) {
+      if (sortedList.binarySearchFromTo(theElements[i], 0, limit) < 0) theElements[j++]=theElements[i];
+    }
+  }
+  else {
+    // it is faster to search in other without sorting
+    for (int i=0; i<mySize ; i++) {
+      if (other.indexOfFromTo(theElements[i], 0, limit) < 0) theElements[j++]=theElements[i];
+    }
+  }
 
-	boolean modified = (j!=mySize);
-	setSize(j);
-	return modified;
+  boolean modified = (j!=mySize);
+  setSize(j);
+  return modified;
 }
 /**
  * Replaces a number of elements in the receiver with the same number of elements of another list.
@@ -348,18 +348,18 @@
  * @param otherFrom position of first element within other list to be copied.
  */
 public void replaceFromToWithFrom(int from, int to, AbstractDoubleList other, int otherFrom) {
-	// overridden for performance only.
-	if (! (other instanceof DoubleArrayList)) {
-		// slower
-		super.replaceFromToWithFrom(from,to,other,otherFrom);
-		return;
-	}
-	int length=to-from+1;
-	if (length>0) {
-		checkRangeFromTo(from, to, size());
-		checkRangeFromTo(otherFrom,otherFrom+length-1,other.size());
-		System.arraycopy(((DoubleArrayList) other).elements, otherFrom, elements, from, length);
-	}
+  // overridden for performance only.
+  if (! (other instanceof DoubleArrayList)) {
+    // slower
+    super.replaceFromToWithFrom(from,to,other,otherFrom);
+    return;
+  }
+  int length=to-from+1;
+  if (length>0) {
+    checkRangeFromTo(from, to, size());
+    checkRangeFromTo(otherFrom,otherFrom+length-1,other.size());
+    System.arraycopy(((DoubleArrayList) other).elements, otherFrom, elements, from, length);
+  }
 }
 /**
 * Retains (keeps) only the elements in the receiver that are contained in the specified other list.
@@ -369,62 +369,62 @@
 * @return <code>true</code> if the receiver changed as a result of the call.
 */
 public boolean retainAll(AbstractDoubleList other) {
-	// overridden for performance only.
-	if (! (other instanceof DoubleArrayList))	return super.retainAll(other);
-	
-	/* There are two possibilities to do the thing
-	   a) use other.indexOf(...)
-	   b) sort other, then use other.binarySearch(...)
-	   
-	   Let's try to figure out which one is faster. Let M=size, N=other.size, then
-	   a) takes O(M*N) steps
-	   b) takes O(N*logN + M*logN) steps (sorting is O(N*logN) and binarySearch is O(logN))
+  // overridden for performance only.
+  if (! (other instanceof DoubleArrayList))  return super.retainAll(other);
+  
+  /* There are two possibilities to do the thing
+     a) use other.indexOf(...)
+     b) sort other, then use other.binarySearch(...)
+     
+     Let's try to figure out which one is faster. Let M=size, N=other.size, then
+     a) takes O(M*N) steps
+     b) takes O(N*logN + M*logN) steps (sorting is O(N*logN) and binarySearch is O(logN))
 
-	   Hence, if N*logN + M*logN < M*N, we use b) otherwise we use a).
-	*/
-	int limit = other.size()-1;
-	int j=0;
-	double[] theElements = elements;
-	int mySize = size();
+     Hence, if N*logN + M*logN < M*N, we use b) otherwise we use a).
+  */
+  int limit = other.size()-1;
+  int j=0;
+  double[] theElements = elements;
+  int mySize = size();
 
-	double N=(double) other.size();
-	double M=(double) mySize;
-	if ( (N+M)* org.apache.mahout.jet.math.Arithmetic.log2(N) < M*N ) {
-		// it is faster to sort other before searching in it
-		DoubleArrayList sortedList = (DoubleArrayList) other.clone();
-		sortedList.quickSort();
+  double N=(double) other.size();
+  double M=(double) mySize;
+  if ( (N+M)* org.apache.mahout.jet.math.Arithmetic.log2(N) < M*N ) {
+    // it is faster to sort other before searching in it
+    DoubleArrayList sortedList = (DoubleArrayList) other.clone();
+    sortedList.quickSort();
 
-		for (int i=0; i<mySize ; i++) {
-			if (sortedList.binarySearchFromTo(theElements[i], 0, limit) >= 0) theElements[j++]=theElements[i];
-		}
-	}
-	else {
-		// it is faster to search in other without sorting
-		for (int i=0; i<mySize ; i++) {
-			if (other.indexOfFromTo(theElements[i], 0, limit) >= 0) theElements[j++]=theElements[i];
-		}
-	}
+    for (int i=0; i<mySize ; i++) {
+      if (sortedList.binarySearchFromTo(theElements[i], 0, limit) >= 0) theElements[j++]=theElements[i];
+    }
+  }
+  else {
+    // it is faster to search in other without sorting
+    for (int i=0; i<mySize ; i++) {
+      if (other.indexOfFromTo(theElements[i], 0, limit) >= 0) theElements[j++]=theElements[i];
+    }
+  }
 
-	boolean modified = (j!=mySize);
-	setSize(j);
-	return modified;
+  boolean modified = (j!=mySize);
+  setSize(j);
+  return modified;
 }
 /**
  * Reverses the elements of the receiver.
  * Last becomes first, second last becomes second first, and so on.
  */
 public void reverse() {
-	// overridden for performance only.
-	double tmp;
-	int limit=size/2;
-	int j=size-1;
+  // overridden for performance only.
+  double tmp;
+  int limit=size/2;
+  int j=size-1;
 
-	double[] theElements = elements;
-	for (int i=0; i<limit;) { //swap
-		tmp=theElements[i];
-		theElements[i++]=theElements[j];
-		theElements[j--]=tmp;
-	}
+  double[] theElements = elements;
+  for (int i=0; i<limit;) { //swap
+    tmp=theElements[i];
+    theElements[i++]=theElements[j];
+    theElements[j--]=tmp;
+  }
 }
 /**
  * Replaces the element at the specified position in the receiver with the specified element.
@@ -432,13 +432,13 @@
  * @param index index of element to replace.
  * @param element element to be stored at the specified position.
  * @exception IndexOutOfBoundsException index is out of range (index
- * 		  &lt; 0 || index &gt;= size()).
+ *       &lt; 0 || index &gt;= size()).
  */
 public void set(int index, double element) {
-	// overridden for performance only.
-	if (index >= size || index < 0)
-		throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
-	elements[index] = element;
+  // overridden for performance only.
+  if (index >= size || index < 0)
+    throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
+  elements[index] = element;
 }
 /**
  * Replaces the element at the specified position in the receiver with the specified element; <b>WARNING:</b> Does not check preconditions.
@@ -450,7 +450,7 @@
  * @param element element to be stored at the specified position.
  */
 public void setQuick(int index, double element) {
-	elements[index] = element;
+  elements[index] = element;
 }
 /**
  * Randomly permutes the part of the receiver between <code>from</code> (inclusive) and <code>to</code> (inclusive). 
@@ -459,22 +459,22 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public void shuffleFromTo(int from, int to) {
-	// overridden for performance only.
-	if (size==0) {return;}
-	checkRangeFromTo(from, to, size);
+  // overridden for performance only.
+  if (size==0) {return;}
+  checkRangeFromTo(from, to, size);
 
-	org.apache.mahout.jet.random.Uniform gen = new org.apache.mahout.jet.random.Uniform(new org.apache.mahout.jet.random.engine.DRand(new java.util.Date()));
-	double tmpElement;
-	double[] theElements = elements;
-	int random;
-	for (int i=from; i<to; i++) { 
-		random = gen.nextIntFromTo(i, to);
+  org.apache.mahout.jet.random.Uniform gen = new org.apache.mahout.jet.random.Uniform(new org.apache.mahout.jet.random.engine.DRand(new java.util.Date()));
+  double tmpElement;
+  double[] theElements = elements;
+  int random;
+  for (int i=from; i<to; i++) { 
+    random = gen.nextIntFromTo(i, to);
 
-		//swap(i, random)
-		tmpElement = theElements[random];
-		theElements[random]=theElements[i]; 
-		theElements[i]=tmpElement; 
-	}  
+    //swap(i, random)
+    tmpElement = theElements[random];
+    theElements[random]=theElements[i]; 
+    theElements[i]=tmpElement; 
+  }  
 }
 /**
  * Trims the capacity of the receiver to be the receiver's current 
@@ -482,6 +482,6 @@
  * storage of the receiver.
  */
 public void trimToSize() {
-	elements = org.apache.mahout.matrix.Arrays.trimToCapacity(elements,size());
+  elements = org.apache.mahout.matrix.Arrays.trimToCapacity(elements,size());
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/list/CharArrayList.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/list/CharArrayList.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/list/CharArrayList.java	(working copy)
@@ -18,17 +18,17 @@
  */
 @Deprecated
 public class CharArrayList extends AbstractCharList {
-	/**
-	 * The array buffer into which the elements of the list are stored.
-	 * The capacity of the list is the length of this array buffer.
-	 * @serial
-	 */
-	protected char[] elements;
+  /**
+   * The array buffer into which the elements of the list are stored.
+   * The capacity of the list is the length of this array buffer.
+   * @serial
+   */
+  protected char[] elements;
 /**
  * Constructs an empty list.
  */
 public CharArrayList() {
-	this(10);
+  this(10);
 }
 /**
  * Constructs a list containing the specified elements. 
@@ -40,7 +40,7 @@
  * @param elements the array to be backed by the the constructed list
  */
 public CharArrayList(char[] elements) {
-	elements(elements);
+  elements(elements);
 }
 /**
  * Constructs an empty list with the specified initial capacity.
@@ -48,8 +48,8 @@
  * @param   initialCapacity   the number of elements the receiver can hold without auto-expanding itself by allocating new internal memory.
  */
 public CharArrayList(int initialCapacity) {
-	this(new char[initialCapacity]);
-	setSizeRaw(0);
+  this(new char[initialCapacity]);
+  setSizeRaw(0);
 }
 /**
  * Appends the specified element to the end of this list.
@@ -57,11 +57,11 @@
  * @param element element to be appended to this list.
  */
 public void add(char element) {
-	// overridden for performance only.
-	if (size == elements.length) {
-		ensureCapacity(size + 1); 
-	}
-	elements[size++] = element;
+  // overridden for performance only.
+  if (size == elements.length) {
+    ensureCapacity(size + 1); 
+  }
+  elements[size++] = element;
 }
 /**
  * Inserts the specified element before the specified position into the receiver. 
@@ -73,13 +73,13 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>index &lt; 0 || index &gt; size()</tt>).
  */
 public void beforeInsert(int index, char element) {
-	// overridden for performance only.
-	if (index > size || index < 0) 
-		throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
-	ensureCapacity(size + 1);
-	System.arraycopy(elements, index, elements, index+1, size-index);
-	elements[index] = element;
-	size++;
+  // overridden for performance only.
+  if (index > size || index < 0) 
+    throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
+  ensureCapacity(size + 1);
+  System.arraycopy(elements, index, elements, index+1, size-index);
+  elements[index] = element;
+  size++;
 }
 /**
  * Searches the receiver for the specified value using
@@ -94,18 +94,18 @@
  * @param from the leftmost search position, inclusive.
  * @param to the rightmost search position, inclusive.
  * @return index of the search key, if it is contained in the receiver;
- *	       otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
- *	       point</i> is defined as the the point at which the value would
- * 	       be inserted into the receiver: the index of the first
- *	       element greater than the key, or <tt>receiver.size()</tt>, if all
- *	       elements in the receiver are less than the specified key.  Note
- *	       that this guarantees that the return value will be &gt;= 0 if
- *	       and only if the key is found.
+ *         otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
+ *         point</i> is defined as the the point at which the value would
+ *          be inserted into the receiver: the index of the first
+ *         element greater than the key, or <tt>receiver.size()</tt>, if all
+ *         elements in the receiver are less than the specified key.  Note
+ *         that this guarantees that the return value will be &gt;= 0 if
+ *         and only if the key is found.
  * @see org.apache.mahout.matrix.Sorting
  * @see java.util.Arrays
  */
 public int binarySearchFromTo(char key, int from, int to) {
-	return org.apache.mahout.matrix.Sorting.binarySearchFromTo(this.elements,key,from,to);
+  return org.apache.mahout.matrix.Sorting.binarySearchFromTo(this.elements,key,from,to);
 }
 /**
  * Returns a deep copy of the receiver. 
@@ -113,10 +113,10 @@
  * @return  a deep copy of the receiver.
  */
 public Object clone() {
-	// overridden for performance only.
-	CharArrayList clone = new CharArrayList((char[]) elements.clone());
-	clone.setSizeRaw(size);
-	return clone;
+  // overridden for performance only.
+  CharArrayList clone = new CharArrayList((char[]) elements.clone());
+  clone.setSizeRaw(size);
+  return clone;
 }
 /**
  * Returns a deep copy of the receiver; uses <code>clone()</code> and casts the result.
@@ -124,7 +124,7 @@
  * @return  a deep copy of the receiver.
  */
 public CharArrayList copy() {
-	return (CharArrayList) clone();
+  return (CharArrayList) clone();
 }
  /**
  * Sorts the specified range of the receiver into ascending numerical order. 
@@ -141,28 +141,28 @@
  * @param max the largest element contained in the range.
  */
 protected void countSortFromTo(int from, int to, char min, char max) {
-	if (size==0) return;
-	checkRangeFromTo(from, to, size);
+  if (size==0) return;
+  checkRangeFromTo(from, to, size);
 
-	final int width = (int) (max-min+1);
-	
-	int[] counts = new int[width];
-	char[] theElements = elements;	
-	for (int i=from; i<=to; ) counts[(int)(theElements[i++]-min)]++;
+  final int width = (int) (max-min+1);
+  
+  int[] counts = new int[width];
+  char[] theElements = elements;  
+  for (int i=from; i<=to; ) counts[(int)(theElements[i++]-min)]++;
 
-	int fromIndex = from;
-	char val = min;
-	for (int i=0; i<width; i++, val++) {
-		int c = counts[i];
-		if (c>0) {
-			if (c==1) theElements[fromIndex++]=val;
-			else {
-				int toIndex = fromIndex + c - 1;
-				fillFromToWith(fromIndex,toIndex,val);
-				fromIndex = toIndex + 1;
-			}
-		}
-	}
+  int fromIndex = from;
+  char val = min;
+  for (int i=0; i<width; i++, val++) {
+    int c = counts[i];
+    if (c>0) {
+      if (c==1) theElements[fromIndex++]=val;
+      else {
+        int toIndex = fromIndex + c - 1;
+        fillFromToWith(fromIndex,toIndex,val);
+        fromIndex = toIndex + 1;
+      }
+    }
+  }
 }
 /**
  * Returns the elements currently stored, including invalid elements between size and capacity, if any.
@@ -173,7 +173,7 @@
  * @return the elements currently stored.
  */
 public char[] elements() {
-	return elements;
+  return elements;
 }
 /**
  * Sets the receiver's elements to be the specified array (not a copy of it).
@@ -186,9 +186,9 @@
  * @return the receiver itself.
  */
 public AbstractCharList elements(char[] elements) {
-	this.elements=elements;
-	this.size=elements.length;
-	return this;
+  this.elements=elements;
+  this.size=elements.length;
+  return this;
 }
 /**
  * Ensures that the receiver can hold at least the specified number of elements without needing to allocate new internal memory.
@@ -197,7 +197,7 @@
  * @param   minCapacity   the desired minimum capacity.
  */
 public void ensureCapacity(int minCapacity) {
-	elements = org.apache.mahout.matrix.Arrays.ensureCapacity(elements,minCapacity);
+  elements = org.apache.mahout.matrix.Arrays.ensureCapacity(elements,minCapacity);
 }
 /**
  * Compares the specified Object with the receiver.  
@@ -210,19 +210,19 @@
  * @return true if the specified Object is equal to the receiver.
  */
 public boolean equals(Object otherObj) { //delta
-	// overridden for performance only.
-	if (! (otherObj instanceof CharArrayList)) return super.equals(otherObj);
-	if (this==otherObj) return true;
-	if (otherObj==null) return false;
-	CharArrayList other = (CharArrayList) otherObj;
-	if (size()!=other.size()) return false;
+  // overridden for performance only.
+  if (! (otherObj instanceof CharArrayList)) return super.equals(otherObj);
+  if (this==otherObj) return true;
+  if (otherObj==null) return false;
+  CharArrayList other = (CharArrayList) otherObj;
+  if (size()!=other.size()) return false;
 
-	char[] theElements = elements();
-	char[] otherElements = other.elements();
-	for (int i=size(); --i >= 0; ) {
-	    if (theElements[i] != otherElements[i]) return false;
-	}
-	return true;
+  char[] theElements = elements();
+  char[] otherElements = other.elements();
+  for (int i=size(); --i >= 0; ) {
+      if (theElements[i] != otherElements[i]) return false;
+  }
+  return true;
 }
 /**
  * Applies a procedure to each element of the receiver, if any.
@@ -231,25 +231,25 @@
  * @return <tt>false</tt> if the procedure stopped before all elements where iterated over, <tt>true</tt> otherwise. 
  */
 public boolean forEach(CharProcedure procedure) {
-	// overridden for performance only.
-	char[] theElements = elements;
-	int theSize = size;
-	
-	for (int i=0; i<theSize;) if (! procedure.apply(theElements[i++])) return false;
-	return true;
+  // overridden for performance only.
+  char[] theElements = elements;
+  int theSize = size;
+  
+  for (int i=0; i<theSize;) if (! procedure.apply(theElements[i++])) return false;
+  return true;
 }
 /**
  * Returns the element at the specified position in the receiver.
  *
  * @param index index of element to return.
  * @exception IndexOutOfBoundsException index is out of range (index
- * 		  &lt; 0 || index &gt;= size()).
+ *       &lt; 0 || index &gt;= size()).
  */
 public char get(int index) {
-	// overridden for performance only.
-	if (index >= size || index < 0)
-		throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
-	return elements[index];
+  // overridden for performance only.
+  if (index >= size || index < 0)
+    throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
+  return elements[index];
 }
 /**
  * Returns the element at the specified position in the receiver; <b>WARNING:</b> Does not check preconditions. 
@@ -260,7 +260,7 @@
  * @param index index of element to return.
  */
 public char getQuick(int index) {
-	return elements[index];
+  return elements[index];
 }
 /**
  * Returns the index of the first occurrence of the specified
@@ -275,15 +275,15 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public int indexOfFromTo(char element, int from, int to) {
-	// overridden for performance only.
-	if (size==0) return -1;
-	checkRangeFromTo(from, to, size);
+  // overridden for performance only.
+  if (size==0) return -1;
+  checkRangeFromTo(from, to, size);
 
-	char[] theElements = elements;
-	for (int i = from ; i <= to; i++) {
-	    if (element==theElements[i]) {return i;} //found
-	}
-	return -1; //not found
+  char[] theElements = elements;
+  for (int i = from ; i <= to; i++) {
+      if (element==theElements[i]) {return i;} //found
+  }
+  return -1; //not found
 }
 /**
  * Returns the index of the last occurrence of the specified
@@ -298,15 +298,15 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public int lastIndexOfFromTo(char element, int from, int to) {
-	// overridden for performance only.
-	if (size==0) return -1;
-	checkRangeFromTo(from, to, size);
+  // overridden for performance only.
+  if (size==0) return -1;
+  checkRangeFromTo(from, to, size);
 
-	char[] theElements = elements;
-	for (int i = to ; i >= from; i--) {
-	    if (element==theElements[i]) {return i;} //found
-	}
-	return -1; //not found
+  char[] theElements = elements;
+  for (int i = to ; i >= from; i--) {
+      if (element==theElements[i]) {return i;} //found
+  }
+  return -1; //not found
 }
 /**
  * Returns a new list of the part of the receiver between <code>from</code>, inclusive, and <code>to</code>, inclusive.
@@ -316,13 +316,13 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public AbstractCharList partFromTo(int from, int to) {
-	if (size==0) return new CharArrayList(0);
+  if (size==0) return new CharArrayList(0);
 
-	checkRangeFromTo(from, to, size);
+  checkRangeFromTo(from, to, size);
 
-	char[] part = new char[to-from+1];
-	System.arraycopy(elements, from, part, 0, to-from+1);
-	return new CharArrayList(part);
+  char[] part = new char[to-from+1];
+  System.arraycopy(elements, from, part, 0, to-from+1);
+  return new CharArrayList(part);
 }
 /**
 * Removes from the receiver all elements that are contained in the specified list.
@@ -332,46 +332,46 @@
 * @return <code>true</code> if the receiver changed as a result of the call.
 */
 public boolean removeAll(AbstractCharList other) {
-	// overridden for performance only.
-	if (! (other instanceof CharArrayList))	return super.removeAll(other);
-	
-	/* There are two possibilities to do the thing
-	   a) use other.indexOf(...)
-	   b) sort other, then use other.binarySearch(...)
-	   
-	   Let's try to figure out which one is faster. Let M=size, N=other.size, then
-	   a) takes O(M*N) steps
-	   b) takes O(N*logN + M*logN) steps (sorting is O(N*logN) and binarySearch is O(logN))
+  // overridden for performance only.
+  if (! (other instanceof CharArrayList))  return super.removeAll(other);
+  
+  /* There are two possibilities to do the thing
+     a) use other.indexOf(...)
+     b) sort other, then use other.binarySearch(...)
+     
+     Let's try to figure out which one is faster. Let M=size, N=other.size, then
+     a) takes O(M*N) steps
+     b) takes O(N*logN + M*logN) steps (sorting is O(N*logN) and binarySearch is O(logN))
  
-	   Hence, if N*logN + M*logN < M*N, we use b) otherwise we use a).
-	*/
-	if (other.size()==0) {return false;} //nothing to do
-	int limit = other.size()-1;
-	int j=0;
-	char[] theElements = elements;
-	int mySize = size();
+     Hence, if N*logN + M*logN < M*N, we use b) otherwise we use a).
+  */
+  if (other.size()==0) {return false;} //nothing to do
+  int limit = other.size()-1;
+  int j=0;
+  char[] theElements = elements;
+  int mySize = size();
 
-	double N=(double) other.size();
-	double M=(double) mySize;
-	if ( (N+M)* org.apache.mahout.jet.math.Arithmetic.log2(N) < M*N ) {
-		// it is faster to sort other before searching in it
-		CharArrayList sortedList = (CharArrayList) other.clone();
-		sortedList.quickSort();
+  double N=(double) other.size();
+  double M=(double) mySize;
+  if ( (N+M)* org.apache.mahout.jet.math.Arithmetic.log2(N) < M*N ) {
+    // it is faster to sort other before searching in it
+    CharArrayList sortedList = (CharArrayList) other.clone();
+    sortedList.quickSort();
 
-		for (int i=0; i<mySize ; i++) {
-			if (sortedList.binarySearchFromTo(theElements[i], 0, limit) < 0) theElements[j++]=theElements[i];
-		}
-	}
-	else {
-		// it is faster to search in other without sorting
-		for (int i=0; i<mySize ; i++) {
-			if (other.indexOfFromTo(theElements[i], 0, limit) < 0) theElements[j++]=theElements[i];
-		}
-	}
+    for (int i=0; i<mySize ; i++) {
+      if (sortedList.binarySearchFromTo(theElements[i], 0, limit) < 0) theElements[j++]=theElements[i];
+    }
+  }
+  else {
+    // it is faster to search in other without sorting
+    for (int i=0; i<mySize ; i++) {
+      if (other.indexOfFromTo(theElements[i], 0, limit) < 0) theElements[j++]=theElements[i];
+    }
+  }
 
-	boolean modified = (j!=mySize);
-	setSize(j);
-	return modified;
+  boolean modified = (j!=mySize);
+  setSize(j);
+  return modified;
 }
 /**
  * Replaces a number of elements in the receiver with the same number of elements of another list.
@@ -384,18 +384,18 @@
  * @param otherFrom position of first element within other list to be copied.
  */
 public void replaceFromToWithFrom(int from, int to, AbstractCharList other, int otherFrom) {
-	// overridden for performance only.
-	if (! (other instanceof CharArrayList)) {
-		// slower
-		super.replaceFromToWithFrom(from,to,other,otherFrom);
-		return;
-	}
-	int length=to-from+1;
-	if (length>0) {
-		checkRangeFromTo(from, to, size());
-		checkRangeFromTo(otherFrom,otherFrom+length-1,other.size());
-		System.arraycopy(((CharArrayList) other).elements, otherFrom, elements, from, length);
-	}
+  // overridden for performance only.
+  if (! (other instanceof CharArrayList)) {
+    // slower
+    super.replaceFromToWithFrom(from,to,other,otherFrom);
+    return;
+  }
+  int length=to-from+1;
+  if (length>0) {
+    checkRangeFromTo(from, to, size());
+    checkRangeFromTo(otherFrom,otherFrom+length-1,other.size());
+    System.arraycopy(((CharArrayList) other).elements, otherFrom, elements, from, length);
+  }
 }
 /**
 * Retains (keeps) only the elements in the receiver that are contained in the specified other list.
@@ -405,62 +405,62 @@
 * @return <code>true</code> if the receiver changed as a result of the call.
 */
 public boolean retainAll(AbstractCharList other) {
-	// overridden for performance only.
-	if (! (other instanceof CharArrayList))	return super.retainAll(other);
-	
-	/* There are two possibilities to do the thing
-	   a) use other.indexOf(...)
-	   b) sort other, then use other.binarySearch(...)
-	   
-	   Let's try to figure out which one is faster. Let M=size, N=other.size, then
-	   a) takes O(M*N) steps
-	   b) takes O(N*logN + M*logN) steps (sorting is O(N*logN) and binarySearch is O(logN))
+  // overridden for performance only.
+  if (! (other instanceof CharArrayList))  return super.retainAll(other);
+  
+  /* There are two possibilities to do the thing
+     a) use other.indexOf(...)
+     b) sort other, then use other.binarySearch(...)
+     
+     Let's try to figure out which one is faster. Let M=size, N=other.size, then
+     a) takes O(M*N) steps
+     b) takes O(N*logN + M*logN) steps (sorting is O(N*logN) and binarySearch is O(logN))
 
-	   Hence, if N*logN + M*logN < M*N, we use b) otherwise we use a).
-	*/
-	int limit = other.size()-1;
-	int j=0;
-	char[] theElements = elements;
-	int mySize = size();
+     Hence, if N*logN + M*logN < M*N, we use b) otherwise we use a).
+  */
+  int limit = other.size()-1;
+  int j=0;
+  char[] theElements = elements;
+  int mySize = size();
 
-	double N=(double) other.size();
-	double M=(double) mySize;
-	if ( (N+M)* org.apache.mahout.jet.math.Arithmetic.log2(N) < M*N ) {
-		// it is faster to sort other before searching in it
-		CharArrayList sortedList = (CharArrayList) other.clone();
-		sortedList.quickSort();
+  double N=(double) other.size();
+  double M=(double) mySize;
+  if ( (N+M)* org.apache.mahout.jet.math.Arithmetic.log2(N) < M*N ) {
+    // it is faster to sort other before searching in it
+    CharArrayList sortedList = (CharArrayList) other.clone();
+    sortedList.quickSort();
 
-		for (int i=0; i<mySize ; i++) {
-			if (sortedList.binarySearchFromTo(theElements[i], 0, limit) >= 0) theElements[j++]=theElements[i];
-		}
-	}
-	else {
-		// it is faster to search in other without sorting
-		for (int i=0; i<mySize ; i++) {
-			if (other.indexOfFromTo(theElements[i], 0, limit) >= 0) theElements[j++]=theElements[i];
-		}
-	}
+    for (int i=0; i<mySize ; i++) {
+      if (sortedList.binarySearchFromTo(theElements[i], 0, limit) >= 0) theElements[j++]=theElements[i];
+    }
+  }
+  else {
+    // it is faster to search in other without sorting
+    for (int i=0; i<mySize ; i++) {
+      if (other.indexOfFromTo(theElements[i], 0, limit) >= 0) theElements[j++]=theElements[i];
+    }
+  }
 
-	boolean modified = (j!=mySize);
-	setSize(j);
-	return modified;
+  boolean modified = (j!=mySize);
+  setSize(j);
+  return modified;
 }
 /**
  * Reverses the elements of the receiver.
  * Last becomes first, second last becomes second first, and so on.
  */
 public void reverse() {
-	// overridden for performance only.
-	char tmp;
-	int limit=size/2;
-	int j=size-1;
+  // overridden for performance only.
+  char tmp;
+  int limit=size/2;
+  int j=size-1;
 
-	char[] theElements = elements;
-	for (int i=0; i<limit;) { //swap
-		tmp=theElements[i];
-		theElements[i++]=theElements[j];
-		theElements[j--]=tmp;
-	}
+  char[] theElements = elements;
+  for (int i=0; i<limit;) { //swap
+    tmp=theElements[i];
+    theElements[i++]=theElements[j];
+    theElements[j--]=tmp;
+  }
 }
 /**
  * Replaces the element at the specified position in the receiver with the specified element.
@@ -468,13 +468,13 @@
  * @param index index of element to replace.
  * @param element element to be stored at the specified position.
  * @exception IndexOutOfBoundsException index is out of range (index
- * 		  &lt; 0 || index &gt;= size()).
+ *       &lt; 0 || index &gt;= size()).
  */
 public void set(int index, char element) {
-	// overridden for performance only.
-	if (index >= size || index < 0)
-		throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
-	elements[index] = element;
+  // overridden for performance only.
+  if (index >= size || index < 0)
+    throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
+  elements[index] = element;
 }
 /**
  * Replaces the element at the specified position in the receiver with the specified element; <b>WARNING:</b> Does not check preconditions.
@@ -486,7 +486,7 @@
  * @param element element to be stored at the specified position.
  */
 public void setQuick(int index, char element) {
-	elements[index] = element;
+  elements[index] = element;
 }
 /**
  * Randomly permutes the part of the receiver between <code>from</code> (inclusive) and <code>to</code> (inclusive). 
@@ -495,22 +495,22 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public void shuffleFromTo(int from, int to) {
-	// overridden for performance only.
-	if (size==0) {return;}
-	checkRangeFromTo(from, to, size);
-	
-	org.apache.mahout.jet.random.Uniform gen = new org.apache.mahout.jet.random.Uniform(new org.apache.mahout.jet.random.engine.DRand(new java.util.Date()));
-	char tmpElement;
-	char[] theElements = elements;
-	int random;
-	for (int i=from; i<to; i++) { 
-		random = gen.nextIntFromTo(i, to);
+  // overridden for performance only.
+  if (size==0) {return;}
+  checkRangeFromTo(from, to, size);
+  
+  org.apache.mahout.jet.random.Uniform gen = new org.apache.mahout.jet.random.Uniform(new org.apache.mahout.jet.random.engine.DRand(new java.util.Date()));
+  char tmpElement;
+  char[] theElements = elements;
+  int random;
+  for (int i=from; i<to; i++) { 
+    random = gen.nextIntFromTo(i, to);
 
-		//swap(i, random)
-		tmpElement = theElements[random];
-		theElements[random]=theElements[i]; 
-		theElements[i]=tmpElement; 
-	}  
+    //swap(i, random)
+    tmpElement = theElements[random];
+    theElements[random]=theElements[i]; 
+    theElements[i]=tmpElement; 
+  }  
 }
 /**
  * Sorts the specified range of the receiver into ascending order. 
@@ -529,39 +529,39 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public void sortFromTo(int from, int to) {
-	/* 
-	 * Computes min and max and decides on this basis.
-	 * In practice the additional overhead is very small compared to the potential gains.
-	 */
-	final int widthThreshold = 10000; // never consider options resulting in outrageous memory allocations.
-	
-	if (size==0) return;
-	checkRangeFromTo(from, to, size);
+  /* 
+   * Computes min and max and decides on this basis.
+   * In practice the additional overhead is very small compared to the potential gains.
+   */
+  final int widthThreshold = 10000; // never consider options resulting in outrageous memory allocations.
+  
+  if (size==0) return;
+  checkRangeFromTo(from, to, size);
 
-	// determine minimum and maximum.
-	char min=elements[from];
-	char max=elements[from];
+  // determine minimum and maximum.
+  char min=elements[from];
+  char max=elements[from];
 
-	char[] theElements = elements;
-	for (int i=from+1; i<=to; ) {
-		char elem = theElements[i++];
-		if (elem>max) max=elem;
-		else if (elem<min) min=elem;
-	}
+  char[] theElements = elements;
+  for (int i=from+1; i<=to; ) {
+    char elem = theElements[i++];
+    if (elem>max) max=elem;
+    else if (elem<min) min=elem;
+  }
 
-	// try to figure out which option is fastest.
-	double N = (double)to - (double)from + 1.0;
-	double quickSortEstimate = 	N * Math.log(N)/0.6931471805599453; // O(N*log(N,base=2)) ; ln(2)=0.6931471805599453
+  // try to figure out which option is fastest.
+  double N = (double)to - (double)from + 1.0;
+  double quickSortEstimate =   N * Math.log(N)/0.6931471805599453; // O(N*log(N,base=2)) ; ln(2)=0.6931471805599453
 
-	double width = (double)max - (double)min + 1.0;
-	double countSortEstimate = 	Math.max(width,N); // O(Max(width,N))
-	
-	if (width < widthThreshold && countSortEstimate < quickSortEstimate) {
-		countSortFromTo(from, to, min, max);
-	}
-	else {
-		quickSortFromTo(from, to);
-	}
+  double width = (double)max - (double)min + 1.0;
+  double countSortEstimate =   Math.max(width,N); // O(Max(width,N))
+  
+  if (width < widthThreshold && countSortEstimate < quickSortEstimate) {
+    countSortFromTo(from, to, min, max);
+  }
+  else {
+    quickSortFromTo(from, to);
+  }
 }
 /**
  * Trims the capacity of the receiver to be the receiver's current 
@@ -569,6 +569,6 @@
  * storage of the receiver.
  */
 public void trimToSize() {
-	elements = org.apache.mahout.matrix.Arrays.trimToCapacity(elements,size());
+  elements = org.apache.mahout.matrix.Arrays.trimToCapacity(elements,size());
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/list/AbstractIntList.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/list/AbstractIntList.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/list/AbstractIntList.java	(working copy)
@@ -19,13 +19,13 @@
  */
 @Deprecated
 public abstract class AbstractIntList extends AbstractList implements org.apache.mahout.matrix.buffer.IntBufferConsumer {
-	/**
-	 * The size of the list.
-	 * This is a READ_ONLY variable for all methods but setSizeRaw(int newSize) !!!
-	 * If you violate this principle in subclasses, you should exactly know what you are doing.
-	 * @serial
-	 */
-	protected int size;
+  /**
+   * The size of the list.
+   * This is a READ_ONLY variable for all methods but setSizeRaw(int newSize) !!!
+   * If you violate this principle in subclasses, you should exactly know what you are doing.
+   * @serial
+   */
+  protected int size;
 /**
  * Makes this class non instantiable, but still let's others inherit from it.
  */
@@ -36,14 +36,14 @@
  * @param element element to be appended to this list.
  */
 public void add(int element) {
-	beforeInsert(size,element);
+  beforeInsert(size,element);
 }
 /**
  * Appends all elements of the specified list to the receiver.
  * @param list the list of which all elements shall be appended.
  */
 public void addAllOf(IntArrayList other) {
-	addAllOfFromTo(other,0,other.size()-1); 
+  addAllOfFromTo(other,0,other.size()-1); 
 }
 /**
  * Appends the part of the specified list between <code>from</code> (inclusive) and <code>to</code> (inclusive) to the receiver.
@@ -54,7 +54,7 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>other.size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=other.size())</tt>).
  */
 public void addAllOfFromTo(AbstractIntList other, int from, int to) {
-	beforeInsertAllOfFromTo(size,other,from,to);
+  beforeInsertAllOfFromTo(size,other,from,to);
 }
 /**
  * Inserts the specified element before the specified position into the receiver. 
@@ -66,8 +66,8 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>index &lt; 0 || index &gt; size()</tt>).
  */
 public void beforeInsert(int index, int element) {
-	beforeInsertDummies(index,1);
-	set(index,element);
+  beforeInsertDummies(index,1);
+  set(index,element);
 }
 /**
  * Inserts the part of the specified list between <code>otherFrom</code> (inclusive) and <code>otherTo</code> (inclusive) before the specified position into the receiver. 
@@ -82,9 +82,9 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>index &lt; 0 || index &gt; size()</tt>).
  */
 public void beforeInsertAllOfFromTo(int index, AbstractIntList other, int from, int to) {
-	int length=to-from+1;
-	this.beforeInsertDummies(index, length);
-	this.replaceFromToWithFrom(index, index+length-1, other, from);
+  int length=to-from+1;
+  this.beforeInsertDummies(index, length);
+  this.replaceFromToWithFrom(index, index+length-1, other, from);
 }
 /**
  * Inserts <tt>length</tt> dummy elements before the specified position into the receiver. 
@@ -97,13 +97,13 @@
  * @throws IndexOutOfBoundsException if <tt>index &lt; 0 || index &gt; size()</tt>.
  */
 protected void beforeInsertDummies(int index, int length) {
-	if (index > size || index < 0) 
-		throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
-	if (length > 0) {
-		ensureCapacity(size + length);
-		setSizeRaw(size + length);
-		replaceFromToWithFrom(index+length,size-1,this,index);
-	}
+  if (index > size || index < 0) 
+    throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
+  if (length > 0) {
+    ensureCapacity(size + length);
+    setSizeRaw(size + length);
+    replaceFromToWithFrom(index+length,size-1,this,index);
+  }
 }
 /**
  * Searches the receiver for the specified value using
@@ -116,17 +116,17 @@
  *
  * @param key the value to be searched for.
  * @return index of the search key, if it is contained in the receiver;
- *	       otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
- *	       point</i> is defined as the the point at which the value would
- * 	       be inserted into the receiver: the index of the first
- *	       element greater than the key, or <tt>receiver.size()</tt>, if all
- *	       elements in the receiver are less than the specified key.  Note
- *	       that this guarantees that the return value will be &gt;= 0 if
- *	       and only if the key is found.
+ *         otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
+ *         point</i> is defined as the the point at which the value would
+ *          be inserted into the receiver: the index of the first
+ *         element greater than the key, or <tt>receiver.size()</tt>, if all
+ *         elements in the receiver are less than the specified key.  Note
+ *         that this guarantees that the return value will be &gt;= 0 if
+ *         and only if the key is found.
  * @see java.util.Arrays
  */
 public int binarySearch(int key) {
-	return this.binarySearchFromTo(key, 0, size-1);
+  return this.binarySearchFromTo(key, 0, size-1);
 }
 /**
  * Searches the receiver for the specified value using
@@ -141,27 +141,27 @@
  * @param from the leftmost search position, inclusive.
  * @param to the rightmost search position, inclusive.
  * @return index of the search key, if it is contained in the receiver;
- *	       otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
- *	       point</i> is defined as the the point at which the value would
- * 	       be inserted into the receiver: the index of the first
- *	       element greater than the key, or <tt>receiver.size()</tt>, if all
- *	       elements in the receiver are less than the specified key.  Note
- *	       that this guarantees that the return value will be &gt;= 0 if
- *	       and only if the key is found.
+ *         otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
+ *         point</i> is defined as the the point at which the value would
+ *          be inserted into the receiver: the index of the first
+ *         element greater than the key, or <tt>receiver.size()</tt>, if all
+ *         elements in the receiver are less than the specified key.  Note
+ *         that this guarantees that the return value will be &gt;= 0 if
+ *         and only if the key is found.
  * @see java.util.Arrays
  */
 public int binarySearchFromTo(int key, int from, int to) {
-	int low=from;
-	int high=to;
-	while (low <= high) {
-		int mid =(low + high)/2;
-		int midVal = get(mid);
+  int low=from;
+  int high=to;
+  while (low <= high) {
+    int mid =(low + high)/2;
+    int midVal = get(mid);
 
-		if (midVal < key) low = mid + 1;
-		else if (midVal > key) high = mid - 1;
-		else return mid; // key found
-	}
-	return -(low + 1);  // key not found.
+    if (midVal < key) low = mid + 1;
+    else if (midVal > key) high = mid - 1;
+    else return mid; // key found
+  }
+  return -(low + 1);  // key not found.
 }
 /**
  * Returns a deep copy of the receiver. 
@@ -169,7 +169,7 @@
  * @return  a deep copy of the receiver.
  */
 public Object clone() {
-	return partFromTo(0,size-1);
+  return partFromTo(0,size-1);
 }
 /**
  * Returns true if the receiver contains the specified element.
@@ -177,7 +177,7 @@
  * @param element element whose presence in the receiver is to be tested.
  */
 public boolean contains(int elem) {
-	return indexOfFromTo(elem,0,size-1) >=0;
+  return indexOfFromTo(elem,0,size-1) >=0;
 }
 /**
  * Deletes the first element from the receiver that is identical to the specified element.
@@ -186,8 +186,8 @@
  * @param element the element to be deleted.
  */
 public void delete(int element) {
-	int index = indexOfFromTo(element, 0, size-1);
-	if (index>=0) remove(index);
+  int index = indexOfFromTo(element, 0, size-1);
+  if (index>=0) remove(index);
 }
 /**
  * Returns the elements currently stored, possibly including invalid elements between size and capacity.
@@ -198,9 +198,9 @@
  * @return the elements currently stored.
  */
 public int[] elements() {
-	int[] myElements = new int[size];
-	for (int i=size; --i >= 0; ) myElements[i]=getQuick(i);
-	return myElements;
+  int[] myElements = new int[size];
+  for (int i=size; --i >= 0; ) myElements[i]=getQuick(i);
+  return myElements;
 }
 /**
  * Sets the receiver's elements to be the specified array.
@@ -212,9 +212,9 @@
  * @return the receiver itself.
  */
 public AbstractIntList elements(int[] elements) {
-	clear();
-	addAllOfFromTo(new IntArrayList(elements),0,elements.length-1);
-	return this;
+  clear();
+  addAllOfFromTo(new IntArrayList(elements),0,elements.length-1);
+  return this;
 }
 /**
  * Ensures that the receiver can hold at least the specified number of elements without needing to allocate new internal memory.
@@ -234,16 +234,16 @@
  * @return true if the specified Object is equal to the receiver.
  */
 public boolean equals(Object otherObj) { //delta
-	if (! (otherObj instanceof AbstractIntList)) {return false;}
-	if (this==otherObj) return true;
-	if (otherObj==null) return false;
-	AbstractIntList other = (AbstractIntList) otherObj;
-	if (size()!=other.size()) return false;
+  if (! (otherObj instanceof AbstractIntList)) {return false;}
+  if (this==otherObj) return true;
+  if (otherObj==null) return false;
+  AbstractIntList other = (AbstractIntList) otherObj;
+  if (size()!=other.size()) return false;
 
-	for (int i=size(); --i >= 0; ) {
-	    if (getQuick(i) != other.getQuick(i)) return false;
-	}
-	return true;
+  for (int i=size(); --i >= 0; ) {
+      if (getQuick(i) != other.getQuick(i)) return false;
+  }
+  return true;
 }
 /**
  * Sets the specified range of elements in the specified array to the specified value.
@@ -253,8 +253,8 @@
  * @param val the value to be stored in the specified elements of the receiver.
  */
 public void fillFromToWith(int from, int to, int val) {
-	checkRangeFromTo(from,to,this.size);
-	for (int i=from; i<=to;) setQuick(i++,val); 
+  checkRangeFromTo(from,to,this.size);
+  for (int i=from; i<=to;) setQuick(i++,val); 
 }
 /**
  * Applies a procedure to each element of the receiver, if any.
@@ -263,20 +263,20 @@
  * @return <tt>false</tt> if the procedure stopped before all elements where iterated over, <tt>true</tt> otherwise. 
  */
 public boolean forEach(IntProcedure procedure) {
-	for (int i=0; i<size;) if (! procedure.apply(get(i++))) return false;
-	return true;
+  for (int i=0; i<size;) if (! procedure.apply(get(i++))) return false;
+  return true;
 }
 /**
  * Returns the element at the specified position in the receiver.
  *
  * @param index index of element to return.
  * @exception IndexOutOfBoundsException index is out of range (index
- * 		  &lt; 0 || index &gt;= size()).
+ *       &lt; 0 || index &gt;= size()).
  */
 public int get(int index) {
-	if (index >= size || index < 0)
-		throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
-	return getQuick(index);
+  if (index >= size || index < 0)
+    throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
+  return getQuick(index);
 }
 /**
  * Returns the element at the specified position in the receiver; <b>WARNING:</b> Does not check preconditions. 
@@ -298,7 +298,7 @@
  * @return  the index of the first occurrence of the element in the receiver; returns <code>-1</code> if the element is not found.
  */
 public int indexOf(int element) { //delta
-	return indexOfFromTo(element, 0, size-1);
+  return indexOfFromTo(element, 0, size-1);
 }
 /**
  * Returns the index of the first occurrence of the specified
@@ -313,12 +313,12 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public int indexOfFromTo(int element, int from, int to) {
-	checkRangeFromTo(from, to, size);
+  checkRangeFromTo(from, to, size);
 
-	for (int i = from ; i <= to; i++) {
-	    if (element==getQuick(i)) return i; //found
-	}
-	return -1; //not found
+  for (int i = from ; i <= to; i++) {
+      if (element==getQuick(i)) return i; //found
+  }
+  return -1; //not found
 }
 /**
  * Returns the index of the last occurrence of the specified
@@ -328,7 +328,7 @@
  * @return  the index of the last occurrence of the element in the receiver; returns <code>-1</code> if the element is not found.
  */
 public int lastIndexOf(int element) {
-	return lastIndexOfFromTo(element, 0, size-1);
+  return lastIndexOfFromTo(element, 0, size-1);
 }
 /**
  * Returns the index of the last occurrence of the specified
@@ -343,12 +343,12 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public int lastIndexOfFromTo(int element, int from, int to) {
-	checkRangeFromTo(from, to, size());
+  checkRangeFromTo(from, to, size());
 
-	for (int i = to ; i >= from; i--) {
-	    if (element==getQuick(i)) return i; //found
-	}
-	return -1; //not found
+  for (int i = to ; i >= from; i--) {
+      if (element==getQuick(i)) return i; //found
+  }
+  return -1; //not found
 }
 /**
  * Sorts the specified range of the receiver into ascending order. 
@@ -367,13 +367,13 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public void mergeSortFromTo(int from, int to) {
-	int mySize = size();
-	checkRangeFromTo(from, to, mySize);
-	
-	int[] myElements = elements();
-	org.apache.mahout.matrix.Sorting.mergeSort(myElements, from, to+1);
-	elements(myElements);
-	setSizeRaw(mySize);
+  int mySize = size();
+  checkRangeFromTo(from, to, mySize);
+  
+  int[] myElements = elements();
+  org.apache.mahout.matrix.Sorting.mergeSort(myElements, from, to+1);
+  elements(myElements);
+  setSizeRaw(mySize);
 }
 /**
  * Sorts the receiver according
@@ -397,21 +397,21 @@
  * @param to the index of the last element (inclusive) to be sorted.
  * @param c the comparator to determine the order of the receiver.
  * @throws ClassCastException if the array contains elements that are not
- *	       <i>mutually comparable</i> using the specified comparator.
+ *         <i>mutually comparable</i> using the specified comparator.
  * @throws IllegalArgumentException if <tt>fromIndex &gt; toIndex</tt>
  * @throws ArrayIndexOutOfBoundsException if <tt>fromIndex &lt; 0</tt> or
- *	       <tt>toIndex &gt; a.length</tt>
+ *         <tt>toIndex &gt; a.length</tt>
  * @see Comparator
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public void mergeSortFromTo(int from, int to, IntComparator c) {
-	int mySize = size();
-	checkRangeFromTo(from, to, mySize);
-	
-	int[] myElements = elements();
-	org.apache.mahout.matrix.Sorting.mergeSort(myElements, from, to+1, c);
-	elements(myElements);
-	setSizeRaw(mySize);
+  int mySize = size();
+  checkRangeFromTo(from, to, mySize);
+  
+  int[] myElements = elements();
+  org.apache.mahout.matrix.Sorting.mergeSort(myElements, from, to+1, c);
+  elements(myElements);
+  setSizeRaw(mySize);
 }
 /**
  * Returns a new list of the part of the receiver between <code>from</code>, inclusive, and <code>to</code>, inclusive.
@@ -421,12 +421,12 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public AbstractIntList partFromTo(int from, int to) {
-	checkRangeFromTo(from, to, size);
+  checkRangeFromTo(from, to, size);
 
-	int length = to-from+1;
-	IntArrayList part = new IntArrayList(length);
-	part.addAllOfFromTo(this,from,to);
-	return part;
+  int length = to-from+1;
+  IntArrayList part = new IntArrayList(length);
+  part.addAllOfFromTo(this,from,to);
+  return part;
 }
 /**
  * Sorts the specified range of the receiver into
@@ -445,14 +445,14 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public void quickSortFromTo(int from, int to) {
-	int mySize = size();
-	checkRangeFromTo(from, to, mySize);
-	
-	int[] myElements = elements();
-	java.util.Arrays.sort(myElements, from, to+1);
-	//org.apache.mahout.matrix.Sorting.mergeSort(myElements, from, to+1); // TODO just for debugging
-	elements(myElements);
-	setSizeRaw(mySize);
+  int mySize = size();
+  checkRangeFromTo(from, to, mySize);
+  
+  int[] myElements = elements();
+  java.util.Arrays.sort(myElements, from, to+1);
+  //org.apache.mahout.matrix.Sorting.mergeSort(myElements, from, to+1); // TODO just for debugging
+  elements(myElements);
+  setSizeRaw(mySize);
 }
 /**
  * Sorts the receiver according
@@ -474,21 +474,21 @@
  * @param to the index of the last element (inclusive) to be sorted.
  * @param c the comparator to determine the order of the receiver.
  * @throws ClassCastException if the array contains elements that are not
- *	       <i>mutually comparable</i> using the specified comparator.
+ *         <i>mutually comparable</i> using the specified comparator.
  * @throws IllegalArgumentException if <tt>fromIndex &gt; toIndex</tt>
  * @throws ArrayIndexOutOfBoundsException if <tt>fromIndex &lt; 0</tt> or
- *	       <tt>toIndex &gt; a.length</tt>
+ *         <tt>toIndex &gt; a.length</tt>
  * @see Comparator
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public void quickSortFromTo(int from, int to, IntComparator c) {
-	int mySize = size();
-	checkRangeFromTo(from, to, mySize);
-	
-	int[] myElements = elements();
-	org.apache.mahout.matrix.Sorting.quickSort(myElements, from, to+1,c);
-	elements(myElements);
-	setSizeRaw(mySize);
+  int mySize = size();
+  checkRangeFromTo(from, to, mySize);
+  
+  int[] myElements = elements();
+  org.apache.mahout.matrix.Sorting.quickSort(myElements, from, to+1,c);
+  elements(myElements);
+  setSizeRaw(mySize);
 }
 /**
 * Removes from the receiver all elements that are contained in the specified list.
@@ -498,17 +498,17 @@
 * @return <code>true</code> if the receiver changed as a result of the call.
 */
 public boolean removeAll(AbstractIntList other) {
-	if (other.size()==0) return false; //nothing to do
-	int limit = other.size()-1;
-	int j=0;
+  if (other.size()==0) return false; //nothing to do
+  int limit = other.size()-1;
+  int j=0;
 
-	for (int i=0; i<size ; i++) {
-		if (other.indexOfFromTo(getQuick(i), 0, limit) < 0) setQuick(j++,getQuick(i));
-	}
+  for (int i=0; i<size ; i++) {
+    if (other.indexOfFromTo(getQuick(i), 0, limit) < 0) setQuick(j++,getQuick(i));
+  }
 
-	boolean modified = (j!=size);
-	setSize(j);
-	return modified;
+  boolean modified = (j!=size);
+  setSize(j);
+  return modified;
 }
 /**
  * Removes from the receiver all elements whose index is between
@@ -521,14 +521,14 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public void removeFromTo(int from, int to) {
-	checkRangeFromTo(from, to, size);
-	int numMoved = size - to - 1;
-	if (numMoved > 0) {
-		replaceFromToWithFrom(from, from-1+numMoved, this, to+1);
-		//fillFromToWith(from+numMoved, size-1, 0.0f); //delta
-	}
-	int width = to-from+1;
-	if (width>0) setSizeRaw(size-width);
+  checkRangeFromTo(from, to, size);
+  int numMoved = size - to - 1;
+  if (numMoved > 0) {
+    replaceFromToWithFrom(from, from-1+numMoved, this, to+1);
+    //fillFromToWith(from+numMoved, size-1, 0.0f); //delta
+  }
+  int width = to-from+1;
+  if (width>0) setSizeRaw(size-width);
 }
 /**
  * Replaces a number of elements in the receiver with the same number of elements of another list.
@@ -541,22 +541,22 @@
  * @param otherFrom position of first element within other list to be copied.
  */
 public void replaceFromToWithFrom(int from, int to, AbstractIntList other, int otherFrom) {
-	int length=to-from+1;
-	if (length>0) {
-		checkRangeFromTo(from, to, size());
-		checkRangeFromTo(otherFrom,otherFrom+length-1,other.size());
+  int length=to-from+1;
+  if (length>0) {
+    checkRangeFromTo(from, to, size());
+    checkRangeFromTo(otherFrom,otherFrom+length-1,other.size());
 
-		// unambiguous copy (it may hold other==this)
-		if (from<=otherFrom) {
-			for (; --length >= 0; ) setQuick(from++,other.getQuick(otherFrom++));
-		}
-		else {
-			int otherTo = otherFrom+length-1;
-			for (; --length >= 0; ) setQuick(to--,other.getQuick(otherTo--));
-		}
+    // unambiguous copy (it may hold other==this)
+    if (from<=otherFrom) {
+      for (; --length >= 0; ) setQuick(from++,other.getQuick(otherFrom++));
+    }
+    else {
+      int otherTo = otherFrom+length-1;
+      for (; --length >= 0; ) setQuick(to--,other.getQuick(otherTo--));
+    }
 
-			
-	}
+      
+  }
 }
 /**
 * Replaces the part between <code>from</code> (inclusive) and <code>to</code> (inclusive) with the other list's
@@ -602,36 +602,36 @@
 * </pre>
 */
 public void replaceFromToWithFromTo(int from, int to, AbstractIntList other, int otherFrom, int otherTo) {
-	if (otherFrom>otherTo) {
-		throw new IndexOutOfBoundsException("otherFrom: "+otherFrom+", otherTo: "+otherTo);
-	}
+  if (otherFrom>otherTo) {
+    throw new IndexOutOfBoundsException("otherFrom: "+otherFrom+", otherTo: "+otherTo);
+  }
 
-	if (this==other && to-from!=otherTo-otherFrom) { // avoid stumbling over my own feet
-		replaceFromToWithFromTo(from, to, partFromTo(otherFrom, otherTo), 0, otherTo-otherFrom);
-		return;
-	}
-	
-	int length=otherTo-otherFrom+1;
-	int diff=length;
-	int theLast=from-1;
+  if (this==other && to-from!=otherTo-otherFrom) { // avoid stumbling over my own feet
+    replaceFromToWithFromTo(from, to, partFromTo(otherFrom, otherTo), 0, otherTo-otherFrom);
+    return;
+  }
+  
+  int length=otherTo-otherFrom+1;
+  int diff=length;
+  int theLast=from-1;
 
-	if (to>=from) {
-		diff -= (to-from+1);
-		theLast=to;
-	}
-	
-	if (diff>0) {
-		beforeInsertDummies(theLast+1, diff);
-	}
-	else {
-		if (diff<0) {
-			removeFromTo(theLast+diff, theLast-1);
-		}
-	}
+  if (to>=from) {
+    diff -= (to-from+1);
+    theLast=to;
+  }
+  
+  if (diff>0) {
+    beforeInsertDummies(theLast+1, diff);
+  }
+  else {
+    if (diff<0) {
+      removeFromTo(theLast+diff, theLast-1);
+    }
+  }
 
-	if (length>0) {
-		replaceFromToWithFrom(from,from+length-1,other,otherFrom);
-	}
+  if (length>0) {
+    replaceFromToWithFrom(from,from+length-1,other,otherFrom);
+  }
 }
 /**
  * Replaces the part of the receiver starting at <code>from</code> (inclusive) with all the elements of the specified collection.
@@ -643,12 +643,12 @@
  * @exception IndexOutOfBoundsException index is out of range (index &lt; 0 || index &gt;= size()).
  */
 public void replaceFromWith(int from, java.util.Collection other) {
-	checkRange(from,size());
-	java.util.Iterator e = other.iterator();
-	int index=from;
-	int limit = Math.min(size()-from, other.size());
-	for (int i=0; i<limit; i++)
-	    set(index++,((Number) e.next()).intValue()); //delta
+  checkRange(from,size());
+  java.util.Iterator e = other.iterator();
+  int index=from;
+  int limit = Math.min(size()-from, other.size());
+  for (int i=0; i<limit; i++)
+      set(index++,((Number) e.next()).intValue()); //delta
 }
 /**
 * Retains (keeps) only the elements in the receiver that are contained in the specified other list.
@@ -658,36 +658,36 @@
 * @return <code>true</code> if the receiver changed as a result of the call.
 */
 public boolean retainAll(AbstractIntList other) {
-	if (other.size()==0) {
-		if (size==0) return false;
-		setSize(0);
-		return true;
-	}
-	
-	int limit = other.size()-1;
-	int j=0;
-	for (int i=0; i<size ; i++) {
-		if (other.indexOfFromTo(getQuick(i), 0, limit) >= 0) setQuick(j++, getQuick(i));
-	}
+  if (other.size()==0) {
+    if (size==0) return false;
+    setSize(0);
+    return true;
+  }
+  
+  int limit = other.size()-1;
+  int j=0;
+  for (int i=0; i<size ; i++) {
+    if (other.indexOfFromTo(getQuick(i), 0, limit) >= 0) setQuick(j++, getQuick(i));
+  }
 
-	boolean modified = (j!=size);
-	setSize(j);
-	return modified;
+  boolean modified = (j!=size);
+  setSize(j);
+  return modified;
 }
 /**
  * Reverses the elements of the receiver.
  * Last becomes first, second last becomes second first, and so on.
  */
 public void reverse() {
-	int tmp;
-	int limit=size()/2;
-	int j=size()-1;
+  int tmp;
+  int limit=size()/2;
+  int j=size()-1;
 
-	for (int i=0; i<limit;) { //swap
-		tmp=getQuick(i);
-		setQuick(i++,getQuick(j));
-		setQuick(j--,tmp);
-	}
+  for (int i=0; i<limit;) { //swap
+    tmp=getQuick(i);
+    setQuick(i++,getQuick(j));
+    setQuick(j--,tmp);
+  }
 }
 /**
  * Replaces the element at the specified position in the receiver with the specified element.
@@ -697,9 +697,9 @@
  * @throws IndexOutOfBoundsException if <tt>index &lt; 0 || index &gt;= size()</tt>.
  */
 public void set(int index, int element) {
-	if (index >= size || index < 0)
-		throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
-	setQuick(index,element);
+  if (index >= size || index < 0)
+    throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
+  setQuick(index,element);
 }
 /**
  * Replaces the element at the specified position in the receiver with the specified element; <b>WARNING:</b> Does not check preconditions.
@@ -730,7 +730,7 @@
  * }
  */
 protected void setSizeRaw(int newSize) {
-	size = newSize;
+  size = newSize;
 }
 /**
  * Randomly permutes the part of the receiver between <code>from</code> (inclusive) and <code>to</code> (inclusive). 
@@ -739,17 +739,17 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public void shuffleFromTo(int from, int to) {
-	checkRangeFromTo(from, to, size());
-	
-	org.apache.mahout.jet.random.Uniform gen = new org.apache.mahout.jet.random.Uniform(new org.apache.mahout.jet.random.engine.DRand(new java.util.Date()));
-	for (int i=from; i<to; i++) { 
-		int random = gen.nextIntFromTo(i, to);
+  checkRangeFromTo(from, to, size());
+  
+  org.apache.mahout.jet.random.Uniform gen = new org.apache.mahout.jet.random.Uniform(new org.apache.mahout.jet.random.engine.DRand(new java.util.Date()));
+  for (int i=from; i<to; i++) { 
+    int random = gen.nextIntFromTo(i, to);
 
-		//swap(i, random)
-		int tmpElement = getQuick(random);
-		setQuick(random,getQuick(i)); 
-		setQuick(i,tmpElement); 
-	}  
+    //swap(i, random)
+    int tmpElement = getQuick(random);
+    setQuick(random,getQuick(i)); 
+    setQuick(i,tmpElement); 
+  }  
 }
 /**
  * Returns the number of elements contained in the receiver.
@@ -757,33 +757,33 @@
  * @returns  the number of elements contained in the receiver.
  */
 public int size() {
-	return size;
+  return size;
 }
 /**
  * Returns a list which is a concatenation of <code>times</code> times the receiver.
  * @param times the number of times the receiver shall be copied.
  */
 public AbstractIntList times(int times) {
-	AbstractIntList newList = new IntArrayList(times*size());
-	for (int i=times; --i >= 0; ) {
-		newList.addAllOfFromTo(this,0,size()-1);
-	}
-	return newList;
+  AbstractIntList newList = new IntArrayList(times*size());
+  for (int i=times; --i >= 0; ) {
+    newList.addAllOfFromTo(this,0,size()-1);
+  }
+  return newList;
 }
 /**
  * Returns a <code>java.util.ArrayList</code> containing all the elements in the receiver.
  */
 public java.util.ArrayList toList() {
-	int mySize = size();
-	java.util.ArrayList list = new java.util.ArrayList(mySize);
-	for (int i=0; i < mySize; i++) list.add(new Integer(get(i)));
-	return list;
+  int mySize = size();
+  java.util.ArrayList list = new java.util.ArrayList(mySize);
+  for (int i=0; i < mySize; i++) list.add(new Integer(get(i)));
+  return list;
 }
 /**
 * Returns a string representation of the receiver, containing
 * the String representation of each element.
 */
 public String toString() {
-	return org.apache.mahout.matrix.Arrays.toString(partFromTo(0, size()-1).elements());
+  return org.apache.mahout.matrix.Arrays.toString(partFromTo(0, size()-1).elements());
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/list/BooleanArrayList.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/list/BooleanArrayList.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/list/BooleanArrayList.java	(working copy)
@@ -18,17 +18,17 @@
  */
 @Deprecated
 public class BooleanArrayList extends AbstractBooleanList {
-	/**
-	 * The array buffer into which the elements of the list are stored.
-	 * The capacity of the list is the length of this array buffer.
-	 * @serial
-	 */
-	protected boolean[] elements;
+  /**
+   * The array buffer into which the elements of the list are stored.
+   * The capacity of the list is the length of this array buffer.
+   * @serial
+   */
+  protected boolean[] elements;
 /**
  * Constructs an empty list.
  */
 public BooleanArrayList() {
-	this(10);
+  this(10);
 }
 /**
  * Constructs a list containing the specified elements. 
@@ -40,7 +40,7 @@
  * @param elements the array to be backed by the the constructed list
  */
 public BooleanArrayList(boolean[] elements) {
-	elements(elements);
+  elements(elements);
 }
 /**
  * Constructs an empty list with the specified initial capacity.
@@ -48,8 +48,8 @@
  * @param   initialCapacity   the number of elements the receiver can hold without auto-expanding itself by allocating new internal memory.
  */
 public BooleanArrayList(int initialCapacity) {
-	this(new boolean[initialCapacity]);
-	setSizeRaw(0);
+  this(new boolean[initialCapacity]);
+  setSizeRaw(0);
 }
 /**
  * Appends the specified element to the end of this list.
@@ -57,11 +57,11 @@
  * @param element element to be appended to this list.
  */
 public void add(boolean element) {
-	// overridden for performance only.
-	if (size == elements.length) {
-		ensureCapacity(size + 1); 
-	}
-	elements[size++] = element;
+  // overridden for performance only.
+  if (size == elements.length) {
+    ensureCapacity(size + 1); 
+  }
+  elements[size++] = element;
 }
 /**
  * Inserts the specified element before the specified position into the receiver. 
@@ -73,13 +73,13 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>index &lt; 0 || index &gt; size()</tt>).
  */
 public void beforeInsert(int index, boolean element) {
-	// overridden for performance only.
-	if (index > size || index < 0) 
-		throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
-	ensureCapacity(size + 1);
-	System.arraycopy(elements, index, elements, index+1, size-index);
-	elements[index] = element;
-	size++;
+  // overridden for performance only.
+  if (index > size || index < 0) 
+    throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
+  ensureCapacity(size + 1);
+  System.arraycopy(elements, index, elements, index+1, size-index);
+  elements[index] = element;
+  size++;
 }
 /**
  * Returns a deep copy of the receiver. 
@@ -87,10 +87,10 @@
  * @return  a deep copy of the receiver.
  */
 public Object clone() {
-	// overridden for performance only.
-	BooleanArrayList clone = new BooleanArrayList((boolean[]) elements.clone());
-	clone.setSizeRaw(size);
-	return clone;
+  // overridden for performance only.
+  BooleanArrayList clone = new BooleanArrayList((boolean[]) elements.clone());
+  clone.setSizeRaw(size);
+  return clone;
 }
 /**
  * Returns a deep copy of the receiver; uses <code>clone()</code> and casts the result.
@@ -98,7 +98,7 @@
  * @return  a deep copy of the receiver.
  */
 public BooleanArrayList copy() {
-	return (BooleanArrayList) clone();
+  return (BooleanArrayList) clone();
 }
 /**
  * Sorts the specified range of the receiver into ascending numerical order (<tt>false &lt; true</tt>). 
@@ -110,16 +110,16 @@
  * @param to the index of the last element (inclusive) to be sorted.
  */
 public void countSortFromTo(int from, int to) {
-	if (size==0) return;
-	checkRangeFromTo(from, to, size);
-	
-	boolean[] theElements = elements;
-	int trues = 0;
-	for (int i=from; i<=to;) if (theElements[i++]) trues++;
+  if (size==0) return;
+  checkRangeFromTo(from, to, size);
+  
+  boolean[] theElements = elements;
+  int trues = 0;
+  for (int i=from; i<=to;) if (theElements[i++]) trues++;
 
-	int falses = to-from+1-trues;
-	if (falses>0) fillFromToWith(from,from+falses-1,false);
-	if (trues>0) fillFromToWith(from+falses,from+falses-1+trues,true);
+  int falses = to-from+1-trues;
+  if (falses>0) fillFromToWith(from,from+falses-1,false);
+  if (trues>0) fillFromToWith(from+falses,from+falses-1+trues,true);
 }
 /**
  * Returns the elements currently stored, including invalid elements between size and capacity, if any.
@@ -130,7 +130,7 @@
  * @return the elements currently stored.
  */
 public boolean[] elements() {
-	return elements;
+  return elements;
 }
 /**
  * Sets the receiver's elements to be the specified array (not a copy of it).
@@ -143,9 +143,9 @@
  * @return the receiver itself.
  */
 public AbstractBooleanList elements(boolean[] elements) {
-	this.elements=elements;
-	this.size=elements.length;
-	return this;
+  this.elements=elements;
+  this.size=elements.length;
+  return this;
 }
 /**
  * Ensures that the receiver can hold at least the specified number of elements without needing to allocate new internal memory.
@@ -154,7 +154,7 @@
  * @param   minCapacity   the desired minimum capacity.
  */
 public void ensureCapacity(int minCapacity) {
-	elements = org.apache.mahout.matrix.Arrays.ensureCapacity(elements,minCapacity);
+  elements = org.apache.mahout.matrix.Arrays.ensureCapacity(elements,minCapacity);
 }
 /**
  * Compares the specified Object with the receiver.  
@@ -167,19 +167,19 @@
  * @return true if the specified Object is equal to the receiver.
  */
 public boolean equals(Object otherObj) { //delta
-	// overridden for performance only.
-	if (! (otherObj instanceof BooleanArrayList)) return super.equals(otherObj);
-	if (this==otherObj) return true;
-	if (otherObj==null) return false;
-	BooleanArrayList other = (BooleanArrayList) otherObj;
-	if (size()!=other.size()) return false;
+  // overridden for performance only.
+  if (! (otherObj instanceof BooleanArrayList)) return super.equals(otherObj);
+  if (this==otherObj) return true;
+  if (otherObj==null) return false;
+  BooleanArrayList other = (BooleanArrayList) otherObj;
+  if (size()!=other.size()) return false;
 
-	boolean[] theElements = elements();
-	boolean[] otherElements = other.elements();
-	for (int i=size(); --i >= 0; ) {
-	    if (theElements[i] != otherElements[i]) return false;
-	}
-	return true;
+  boolean[] theElements = elements();
+  boolean[] otherElements = other.elements();
+  for (int i=size(); --i >= 0; ) {
+      if (theElements[i] != otherElements[i]) return false;
+  }
+  return true;
 }
 /**
  * Applies a procedure to each element of the receiver, if any.
@@ -188,25 +188,25 @@
  * @return <tt>false</tt> if the procedure stopped before all elements where iterated over, <tt>true</tt> otherwise. 
  */
 public boolean forEach(BooleanProcedure procedure) {
-	// overridden for performance only.
-	boolean[] theElements = elements;
-	int theSize = size;
-	
-	for (int i=0; i<theSize;) if (! procedure.apply(theElements[i++])) return false;
-	return true;
+  // overridden for performance only.
+  boolean[] theElements = elements;
+  int theSize = size;
+  
+  for (int i=0; i<theSize;) if (! procedure.apply(theElements[i++])) return false;
+  return true;
 }
 /**
  * Returns the element at the specified position in the receiver.
  *
  * @param index index of element to return.
  * @exception IndexOutOfBoundsException index is out of range (index
- * 		  &lt; 0 || index &gt;= size()).
+ *       &lt; 0 || index &gt;= size()).
  */
 public boolean get(int index) {
-	// overridden for performance only.
-	if (index >= size || index < 0)
-		throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
-	return elements[index];
+  // overridden for performance only.
+  if (index >= size || index < 0)
+    throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
+  return elements[index];
 }
 /**
  * Returns the element at the specified position in the receiver; <b>WARNING:</b> Does not check preconditions. 
@@ -217,7 +217,7 @@
  * @param index index of element to return.
  */
 public boolean getQuick(int index) {
-	return elements[index];
+  return elements[index];
 }
 /**
  * Returns the index of the first occurrence of the specified
@@ -232,15 +232,15 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public int indexOfFromTo(boolean element, int from, int to) {
-	// overridden for performance only.
-	if (size==0) return -1;
-	checkRangeFromTo(from, to, size);
+  // overridden for performance only.
+  if (size==0) return -1;
+  checkRangeFromTo(from, to, size);
 
-	boolean[] theElements = elements;
-	for (int i = from ; i <= to; i++) {
-	    if (element==theElements[i]) {return i;} //found
-	}
-	return -1; //not found
+  boolean[] theElements = elements;
+  for (int i = from ; i <= to; i++) {
+      if (element==theElements[i]) {return i;} //found
+  }
+  return -1; //not found
 }
 /**
  * Returns the index of the last occurrence of the specified
@@ -255,15 +255,15 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public int lastIndexOfFromTo(boolean element, int from, int to) {
-	// overridden for performance only.
-	if (size==0) return -1;
-	checkRangeFromTo(from, to, size);
+  // overridden for performance only.
+  if (size==0) return -1;
+  checkRangeFromTo(from, to, size);
 
-	boolean[] theElements = elements;
-	for (int i = to ; i >= from; i--) {
-	    if (element==theElements[i]) {return i;} //found
-	}
-	return -1; //not found
+  boolean[] theElements = elements;
+  for (int i = to ; i >= from; i--) {
+      if (element==theElements[i]) {return i;} //found
+  }
+  return -1; //not found
 }
 /**
  * Sorts the specified range of the receiver into ascending order (<tt>false &lt; true</tt>). 
@@ -276,7 +276,7 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public void mergeSortFromTo(int from, int to) {
-	countSortFromTo(from, to);
+  countSortFromTo(from, to);
 }
 /**
  * Returns a new list of the part of the receiver between <code>from</code>, inclusive, and <code>to</code>, inclusive.
@@ -286,13 +286,13 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public AbstractBooleanList partFromTo(int from, int to) {
-	if (size==0) return new BooleanArrayList(0);
+  if (size==0) return new BooleanArrayList(0);
 
-	checkRangeFromTo(from, to, size);
+  checkRangeFromTo(from, to, size);
 
-	boolean[] part = new boolean[to-from+1];
-	System.arraycopy(elements, from, part, 0, to-from+1);
-	return new BooleanArrayList(part);
+  boolean[] part = new boolean[to-from+1];
+  System.arraycopy(elements, from, part, 0, to-from+1);
+  return new BooleanArrayList(part);
 }
 /**
  * Sorts the specified range of the receiver into ascending order (<tt>false &lt; true</tt>). 
@@ -305,7 +305,7 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public void quickSortFromTo(int from, int to) {
-	countSortFromTo(from, to);
+  countSortFromTo(from, to);
 }
 /**
 * Removes from the receiver all elements that are contained in the specified list.
@@ -315,46 +315,46 @@
 * @return <code>true</code> if the receiver changed as a result of the call.
 */
 public boolean removeAll(AbstractBooleanList other) {
-	// overridden for performance only.
-	if (! (other instanceof BooleanArrayList))	return super.removeAll(other);
-	
-	/* There are two possibilities to do the thing
-	   a) use other.indexOf(...)
-	   b) sort other, then use other.binarySearch(...)
-	   
-	   Let's try to figure out which one is faster. Let M=size, N=other.size, then
-	   a) takes O(M*N) steps
-	   b) takes O(N*logN + M*logN) steps (sorting is O(N*logN) and binarySearch is O(logN))
+  // overridden for performance only.
+  if (! (other instanceof BooleanArrayList))  return super.removeAll(other);
+  
+  /* There are two possibilities to do the thing
+     a) use other.indexOf(...)
+     b) sort other, then use other.binarySearch(...)
+     
+     Let's try to figure out which one is faster. Let M=size, N=other.size, then
+     a) takes O(M*N) steps
+     b) takes O(N*logN + M*logN) steps (sorting is O(N*logN) and binarySearch is O(logN))
  
-	   Hence, if N*logN + M*logN < M*N, we use b) otherwise we use a).
-	*/
-	if (other.size()==0) {return false;} //nothing to do
-	int limit = other.size()-1;
-	int j=0;
-	boolean[] theElements = elements;
-	int mySize = size();
+     Hence, if N*logN + M*logN < M*N, we use b) otherwise we use a).
+  */
+  if (other.size()==0) {return false;} //nothing to do
+  int limit = other.size()-1;
+  int j=0;
+  boolean[] theElements = elements;
+  int mySize = size();
 
-	double N=(double) other.size();
-	double M=(double) mySize;
-	if ( (N+M)* org.apache.mahout.jet.math.Arithmetic.log2(N) < M*N ) {
-		// it is faster to sort other before searching in it
-		BooleanArrayList sortedList = (BooleanArrayList) other.clone();
-		sortedList.quickSort();
+  double N=(double) other.size();
+  double M=(double) mySize;
+  if ( (N+M)* org.apache.mahout.jet.math.Arithmetic.log2(N) < M*N ) {
+    // it is faster to sort other before searching in it
+    BooleanArrayList sortedList = (BooleanArrayList) other.clone();
+    sortedList.quickSort();
 
-		for (int i=0; i<mySize ; i++) {
-			if (sortedList.binarySearchFromTo(theElements[i], 0, limit) < 0) theElements[j++]=theElements[i];
-		}
-	}
-	else {
-		// it is faster to search in other without sorting
-		for (int i=0; i<mySize ; i++) {
-			if (other.indexOfFromTo(theElements[i], 0, limit) < 0) theElements[j++]=theElements[i];
-		}
-	}
+    for (int i=0; i<mySize ; i++) {
+      if (sortedList.binarySearchFromTo(theElements[i], 0, limit) < 0) theElements[j++]=theElements[i];
+    }
+  }
+  else {
+    // it is faster to search in other without sorting
+    for (int i=0; i<mySize ; i++) {
+      if (other.indexOfFromTo(theElements[i], 0, limit) < 0) theElements[j++]=theElements[i];
+    }
+  }
 
-	boolean modified = (j!=mySize);
-	setSize(j);
-	return modified;
+  boolean modified = (j!=mySize);
+  setSize(j);
+  return modified;
 }
 /**
  * Replaces a number of elements in the receiver with the same number of elements of another list.
@@ -367,18 +367,18 @@
  * @param otherFrom position of first element within other list to be copied.
  */
 public void replaceFromToWithFrom(int from, int to, AbstractBooleanList other, int otherFrom) {
-	// overridden for performance only.
-	if (! (other instanceof BooleanArrayList)) {
-		// slower
-		super.replaceFromToWithFrom(from,to,other,otherFrom);
-		return;
-	}
-	int length=to-from+1;
-	if (length>0) {
-		checkRangeFromTo(from, to, size());
-		checkRangeFromTo(otherFrom,otherFrom+length-1,other.size());
-		System.arraycopy(((BooleanArrayList) other).elements, otherFrom, elements, from, length);
-	}
+  // overridden for performance only.
+  if (! (other instanceof BooleanArrayList)) {
+    // slower
+    super.replaceFromToWithFrom(from,to,other,otherFrom);
+    return;
+  }
+  int length=to-from+1;
+  if (length>0) {
+    checkRangeFromTo(from, to, size());
+    checkRangeFromTo(otherFrom,otherFrom+length-1,other.size());
+    System.arraycopy(((BooleanArrayList) other).elements, otherFrom, elements, from, length);
+  }
 }
 /**
 * Retains (keeps) only the elements in the receiver that are contained in the specified other list.
@@ -388,62 +388,62 @@
 * @return <code>true</code> if the receiver changed as a result of the call.
 */
 public boolean retainAll(AbstractBooleanList other) {
-	// overridden for performance only.
-	if (! (other instanceof BooleanArrayList))	return super.retainAll(other);
-	
-	/* There are two possibilities to do the thing
-	   a) use other.indexOf(...)
-	   b) sort other, then use other.binarySearch(...)
-	   
-	   Let's try to figure out which one is faster. Let M=size, N=other.size, then
-	   a) takes O(M*N) steps
-	   b) takes O(N*logN + M*logN) steps (sorting is O(N*logN) and binarySearch is O(logN))
+  // overridden for performance only.
+  if (! (other instanceof BooleanArrayList))  return super.retainAll(other);
+  
+  /* There are two possibilities to do the thing
+     a) use other.indexOf(...)
+     b) sort other, then use other.binarySearch(...)
+     
+     Let's try to figure out which one is faster. Let M=size, N=other.size, then
+     a) takes O(M*N) steps
+     b) takes O(N*logN + M*logN) steps (sorting is O(N*logN) and binarySearch is O(logN))
 
-	   Hence, if N*logN + M*logN < M*N, we use b) otherwise we use a).
-	*/
-	int limit = other.size()-1;
-	int j=0;
-	boolean[] theElements = elements;
-	int mySize = size();
+     Hence, if N*logN + M*logN < M*N, we use b) otherwise we use a).
+  */
+  int limit = other.size()-1;
+  int j=0;
+  boolean[] theElements = elements;
+  int mySize = size();
 
-	double N=(double) other.size();
-	double M=(double) mySize;
-	if ( (N+M)* org.apache.mahout.jet.math.Arithmetic.log2(N) < M*N ) {
-		// it is faster to sort other before searching in it
-		BooleanArrayList sortedList = (BooleanArrayList) other.clone();
-		sortedList.quickSort();
+  double N=(double) other.size();
+  double M=(double) mySize;
+  if ( (N+M)* org.apache.mahout.jet.math.Arithmetic.log2(N) < M*N ) {
+    // it is faster to sort other before searching in it
+    BooleanArrayList sortedList = (BooleanArrayList) other.clone();
+    sortedList.quickSort();
 
-		for (int i=0; i<mySize ; i++) {
-			if (sortedList.binarySearchFromTo(theElements[i], 0, limit) >= 0) theElements[j++]=theElements[i];
-		}
-	}
-	else {
-		// it is faster to search in other without sorting
-		for (int i=0; i<mySize ; i++) {
-			if (other.indexOfFromTo(theElements[i], 0, limit) >= 0) theElements[j++]=theElements[i];
-		}
-	}
+    for (int i=0; i<mySize ; i++) {
+      if (sortedList.binarySearchFromTo(theElements[i], 0, limit) >= 0) theElements[j++]=theElements[i];
+    }
+  }
+  else {
+    // it is faster to search in other without sorting
+    for (int i=0; i<mySize ; i++) {
+      if (other.indexOfFromTo(theElements[i], 0, limit) >= 0) theElements[j++]=theElements[i];
+    }
+  }
 
-	boolean modified = (j!=mySize);
-	setSize(j);
-	return modified;
+  boolean modified = (j!=mySize);
+  setSize(j);
+  return modified;
 }
 /**
  * Reverses the elements of the receiver.
  * Last becomes first, second last becomes second first, and so on.
  */
 public void reverse() {
-	// overridden for performance only.
-	boolean tmp;
-	int limit=size/2;
-	int j=size-1;
+  // overridden for performance only.
+  boolean tmp;
+  int limit=size/2;
+  int j=size-1;
 
-	boolean[] theElements = elements;
-	for (int i=0; i<limit;) { //swap
-		tmp=theElements[i];
-		theElements[i++]=theElements[j];
-		theElements[j--]=tmp;
-	}
+  boolean[] theElements = elements;
+  for (int i=0; i<limit;) { //swap
+    tmp=theElements[i];
+    theElements[i++]=theElements[j];
+    theElements[j--]=tmp;
+  }
 }
 /**
  * Replaces the element at the specified position in the receiver with the specified element.
@@ -451,13 +451,13 @@
  * @param index index of element to replace.
  * @param element element to be stored at the specified position.
  * @exception IndexOutOfBoundsException index is out of range (index
- * 		  &lt; 0 || index &gt;= size()).
+ *       &lt; 0 || index &gt;= size()).
  */
 public void set(int index, boolean element) {
-	// overridden for performance only.
-	if (index >= size || index < 0)
-		throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
-	elements[index] = element;
+  // overridden for performance only.
+  if (index >= size || index < 0)
+    throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
+  elements[index] = element;
 }
 /**
  * Replaces the element at the specified position in the receiver with the specified element; <b>WARNING:</b> Does not check preconditions.
@@ -469,7 +469,7 @@
  * @param element element to be stored at the specified position.
  */
 public void setQuick(int index, boolean element) {
-	elements[index] = element;
+  elements[index] = element;
 }
 /**
  * Randomly permutes the part of the receiver between <code>from</code> (inclusive) and <code>to</code> (inclusive). 
@@ -478,22 +478,22 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public void shuffleFromTo(int from, int to) {
-	// overridden for performance only.
-	if (size==0) {return;}
-	checkRangeFromTo(from, to, size);
-	
-	org.apache.mahout.jet.random.Uniform gen = new org.apache.mahout.jet.random.Uniform(new org.apache.mahout.jet.random.engine.DRand(new java.util.Date()));
-	boolean tmpElement;
-	boolean[] theElements = elements;
-	int random;
-	for (int i=from; i<to; i++) { 
-		random = gen.nextIntFromTo(i, to);
+  // overridden for performance only.
+  if (size==0) {return;}
+  checkRangeFromTo(from, to, size);
+  
+  org.apache.mahout.jet.random.Uniform gen = new org.apache.mahout.jet.random.Uniform(new org.apache.mahout.jet.random.engine.DRand(new java.util.Date()));
+  boolean tmpElement;
+  boolean[] theElements = elements;
+  int random;
+  for (int i=from; i<to; i++) { 
+    random = gen.nextIntFromTo(i, to);
 
-		//swap(i, random)
-		tmpElement = theElements[random];
-		theElements[random]=theElements[i]; 
-		theElements[i]=tmpElement; 
-	}  
+    //swap(i, random)
+    tmpElement = theElements[random];
+    theElements[random]=theElements[i]; 
+    theElements[i]=tmpElement; 
+  }  
 }
 /**
  * Sorts the specified range of the receiver into ascending order. 
@@ -505,7 +505,7 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public void sortFromTo(int from, int to) {
-	countSortFromTo(from, to);
+  countSortFromTo(from, to);
 }
 /**
  * Trims the capacity of the receiver to be the receiver's current 
@@ -513,6 +513,6 @@
  * storage of the receiver.
  */
 public void trimToSize() {
-	elements = org.apache.mahout.matrix.Arrays.trimToCapacity(elements,size());
+  elements = org.apache.mahout.matrix.Arrays.trimToCapacity(elements,size());
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/list/package.html
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/list/package.html	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/list/package.html	(working copy)
@@ -2,7 +2,7 @@
 <BODY>
 Resizable lists holding objects or primitive data types such as <tt>int</tt>,
 <tt>double</tt>, etc. For non-resizable lists (1-dimensional matrices) see
-package {@link cern.colt.matrix}.<p></p>
+package {@link org.apache.mahout.matrix.matrix}.<p></p>
 
 <h1><a name="Overview"></a>Getting Started</h1>
 
@@ -73,16 +73,16 @@
 <h2>3. Organization of this package</h2>
 
 <p>Class naming follows the schema <tt>&lt;ElementType&gt;&lt;ImplementationTechnique&gt;List</tt>.
-  For example, we have a {@link cern.colt.list.DoubleArrayList}, which is a list
+  For example, we have a {@link org.apache.mahout.matrix.list.DoubleArrayList}, which is a list
   holding <tt>double</tt> elements implemented with <tt>double</tt>[] arrays.
 </p>
 
 <p>The classes for lists of a given value type are derived from a common abstract
   base class tagged <tt>Abstract&lt;ElementType&gt;</tt><tt>List</tt>. For example,
-  all lists operating on <tt>double</tt> elements are derived from {@link cern.colt.list.AbstractDoubleList},
+  all lists operating on <tt>double</tt> elements are derived from {@link org.apache.mahout.matrix.list.AbstractDoubleList},
   which in turn is derived from an abstract base class tying together all lists
-  regardless of value type, {@link cern.colt.list.AbstractList}, which finally
-  is rooted in grandmother {@link cern.colt.list.AbstractCollection}. The abstract
+  regardless of value type, {@link org.apache.mahout.matrix.list.AbstractList}, which finally
+  is rooted in grandmother {@link org.apache.mahout.matrix.list.AbstractCollection}. The abstract
   base classes provide skeleton implementations for all but few methods. Experimental
   data layouts (such as compressed, sparse, linked, etc.) can easily be implemented
   and inherit a rich set of functionality. Have a look at the javadoc <a href="package-tree.html">tree
Index: matrix/src/main/java/org/apache/mahout/matrix/list/AbstractCollection.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/list/AbstractCollection.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/list/AbstractCollection.java	(working copy)
@@ -17,8 +17,8 @@
 @author wolfgang.hoschek@cern.ch
 @version 1.0, 09/24/99
 @see     java.util.ArrayList
-@see	    java.util.Vector
-@see	    java.util.Arrays
+@see      java.util.Vector
+@see      java.util.Arrays
 */
 //public abstract class AbstractCollection extends Object implements Cloneable, java.io.Serializable {
 /** 
@@ -42,7 +42,7 @@
  *          <code>false</code> otherwise.
  */
 public boolean isEmpty() {
-	return size() == 0;
+  return size() == 0;
 }
 /**
  * Returns the number of elements contained in the receiver.
@@ -59,6 +59,6 @@
 * the String representation of each element.
 */
 public String toString() {
-	return toList().toString();
+  return toList().toString();
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/list/AbstractLongList.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/list/AbstractLongList.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/list/AbstractLongList.java	(working copy)
@@ -19,13 +19,13 @@
  */
 @Deprecated
 public abstract class AbstractLongList extends AbstractList {
-	/**
-	 * The size of the list.
-	 * This is a READ_ONLY variable for all methods but setSizeRaw(int newSize) !!!
-	 * If you violate this principle in subclasses, you should exactly know what you are doing.
-	 * @serial
-	 */
-	protected int size;
+  /**
+   * The size of the list.
+   * This is a READ_ONLY variable for all methods but setSizeRaw(int newSize) !!!
+   * If you violate this principle in subclasses, you should exactly know what you are doing.
+   * @serial
+   */
+  protected int size;
 /**
  * Makes this class non instantiable, but still let's others inherit from it.
  */
@@ -36,7 +36,7 @@
  * @param element element to be appended to this list.
  */
 public void add(long element) {
-	beforeInsert(size,element);
+  beforeInsert(size,element);
 }
 /**
  * Appends the part of the specified list between <code>from</code> (inclusive) and <code>to</code> (inclusive) to the receiver.
@@ -47,7 +47,7 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>other.size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=other.size())</tt>).
  */
 public void addAllOfFromTo(AbstractLongList other, int from, int to) {
-	beforeInsertAllOfFromTo(size,other,from,to);
+  beforeInsertAllOfFromTo(size,other,from,to);
 }
 /**
  * Inserts the specified element before the specified position into the receiver. 
@@ -59,8 +59,8 @@
  * @throws IndexOutOfBoundsException if <tt>index &lt; 0 || index &gt; size()</tt>.
  */
 public void beforeInsert(int index, long element) {
-	beforeInsertDummies(index,1);
-	set(index,element);
+  beforeInsertDummies(index,1);
+  set(index,element);
 }
 /**
  * Inserts the part of the specified list between <code>otherFrom</code> (inclusive) and <code>otherTo</code> (inclusive) before the specified position into the receiver. 
@@ -75,9 +75,9 @@
  * @throws IndexOutOfBoundsException if <tt>index &lt; 0 || index &gt; size()</tt>.
  */
 public void beforeInsertAllOfFromTo(int index, AbstractLongList other, int from, int to) {
-	int length=to-from+1;
-	this.beforeInsertDummies(index, length);
-	this.replaceFromToWithFrom(index, index+length-1, other, from);
+  int length=to-from+1;
+  this.beforeInsertDummies(index, length);
+  this.replaceFromToWithFrom(index, index+length-1, other, from);
 }
 /**
  * Inserts <tt>length</tt> dummy elements before the specified position into the receiver. 
@@ -90,13 +90,13 @@
  * @throws IndexOutOfBoundsException if <tt>index &lt; 0 || index &gt; size()</tt>.
  */
 protected void beforeInsertDummies(int index, int length) {
-	if (index > size || index < 0) 
-		throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
-	if (length > 0) {
-		ensureCapacity(size + length);
-		setSizeRaw(size + length);
-		replaceFromToWithFrom(index+length,size-1,this,index);
-	}
+  if (index > size || index < 0) 
+    throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
+  if (length > 0) {
+    ensureCapacity(size + length);
+    setSizeRaw(size + length);
+    replaceFromToWithFrom(index+length,size-1,this,index);
+  }
 }
 /**
  * Searches the receiver for the specified value using
@@ -109,17 +109,17 @@
  *
  * @param key the value to be searched for.
  * @return index of the search key, if it is contained in the receiver;
- *	       otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
- *	       point</i> is defined as the the point at which the value would
- * 	       be inserted into the receiver: the index of the first
- *	       element greater than the key, or <tt>receiver.size()</tt>, if all
- *	       elements in the receiver are less than the specified key.  Note
- *	       that this guarantees that the return value will be &gt;= 0 if
- *	       and only if the key is found.
+ *         otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
+ *         point</i> is defined as the the point at which the value would
+ *          be inserted into the receiver: the index of the first
+ *         element greater than the key, or <tt>receiver.size()</tt>, if all
+ *         elements in the receiver are less than the specified key.  Note
+ *         that this guarantees that the return value will be &gt;= 0 if
+ *         and only if the key is found.
  * @see java.util.Arrays
  */
 public int binarySearch(long key) {
-	return this.binarySearchFromTo(key, 0, size-1);
+  return this.binarySearchFromTo(key, 0, size-1);
 }
 /**
  * Searches the receiver for the specified value using
@@ -134,27 +134,27 @@
  * @param from the leftmost search position, inclusive.
  * @param to the rightmost search position, inclusive.
  * @return index of the search key, if it is contained in the receiver;
- *	       otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
- *	       point</i> is defined as the the point at which the value would
- * 	       be inserted into the receiver: the index of the first
- *	       element greater than the key, or <tt>receiver.size()</tt>, if all
- *	       elements in the receiver are less than the specified key.  Note
- *	       that this guarantees that the return value will be &gt;= 0 if
- *	       and only if the key is found.
+ *         otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
+ *         point</i> is defined as the the point at which the value would
+ *          be inserted into the receiver: the index of the first
+ *         element greater than the key, or <tt>receiver.size()</tt>, if all
+ *         elements in the receiver are less than the specified key.  Note
+ *         that this guarantees that the return value will be &gt;= 0 if
+ *         and only if the key is found.
  * @see java.util.Arrays
  */
 public int binarySearchFromTo(long key, int from, int to) {
-	int low=from;
-	int high=to;
-	while (low <= high) {
-		int mid =(low + high)/2;
-		long midVal = get(mid);
+  int low=from;
+  int high=to;
+  while (low <= high) {
+    int mid =(low + high)/2;
+    long midVal = get(mid);
 
-		if (midVal < key) low = mid + 1;
-		else if (midVal > key) high = mid - 1;
-		else return mid; // key found
-	}
-	return -(low + 1);  // key not found.
+    if (midVal < key) low = mid + 1;
+    else if (midVal > key) high = mid - 1;
+    else return mid; // key found
+  }
+  return -(low + 1);  // key not found.
 }
 /**
  * Returns a deep copy of the receiver. 
@@ -162,7 +162,7 @@
  * @return  a deep copy of the receiver.
  */
 public Object clone() {
-	return partFromTo(0,size-1);
+  return partFromTo(0,size-1);
 }
 /**
  * Returns true if the receiver contains the specified element.
@@ -170,7 +170,7 @@
  * @param element element whose presence in the receiver is to be tested.
  */
 public boolean contains(long elem) {
-	return indexOfFromTo(elem,0,size-1) >=0;
+  return indexOfFromTo(elem,0,size-1) >=0;
 }
 /**
  * Deletes the first element from the receiver that is identical to the specified element.
@@ -179,8 +179,8 @@
  * @param element the element to be deleted.
  */
 public void delete(long element) {
-	int index = indexOfFromTo(element, 0, size-1);
-	if (index>=0) remove(index);
+  int index = indexOfFromTo(element, 0, size-1);
+  if (index>=0) remove(index);
 }
 /**
  * Returns the elements currently stored, possibly including invalid elements between size and capacity.
@@ -191,9 +191,9 @@
  * @return the elements currently stored.
  */
 public long[] elements() {
-	long[] myElements = new long[size];
-	for (int i=size; --i >= 0; ) myElements[i]=getQuick(i);
-	return myElements;
+  long[] myElements = new long[size];
+  for (int i=size; --i >= 0; ) myElements[i]=getQuick(i);
+  return myElements;
 }
 /**
  * Sets the receiver's elements to be the specified array.
@@ -205,9 +205,9 @@
  * @return the receiver itself.
  */
 public AbstractLongList elements(long[] elements) {
-	clear();
-	addAllOfFromTo(new LongArrayList(elements),0,elements.length-1);
-	return this;
+  clear();
+  addAllOfFromTo(new LongArrayList(elements),0,elements.length-1);
+  return this;
 }
 /**
  * Ensures that the receiver can hold at least the specified number of elements without needing to allocate new internal memory.
@@ -227,16 +227,16 @@
  * @return true if the specified Object is equal to the receiver.
  */
 public boolean equals(Object otherObj) { //delta
-	if (! (otherObj instanceof AbstractLongList)) {return false;}
-	if (this==otherObj) return true;
-	if (otherObj==null) return false;
-	AbstractLongList other = (AbstractLongList) otherObj;
-	if (size()!=other.size()) return false;
+  if (! (otherObj instanceof AbstractLongList)) {return false;}
+  if (this==otherObj) return true;
+  if (otherObj==null) return false;
+  AbstractLongList other = (AbstractLongList) otherObj;
+  if (size()!=other.size()) return false;
 
-	for (int i=size(); --i >= 0; ) {
-	    if (getQuick(i) != other.getQuick(i)) return false;
-	}
-	return true;
+  for (int i=size(); --i >= 0; ) {
+      if (getQuick(i) != other.getQuick(i)) return false;
+  }
+  return true;
 }
 /**
  * Sets the specified range of elements in the specified array to the specified value.
@@ -246,8 +246,8 @@
  * @param val the value to be stored in the specified elements of the receiver.
  */
 public void fillFromToWith(int from, int to, long val) {
-	checkRangeFromTo(from,to,this.size);
-	for (int i=from; i<=to;) setQuick(i++,val); 
+  checkRangeFromTo(from,to,this.size);
+  for (int i=from; i<=to;) setQuick(i++,val); 
 }
 /**
  * Applies a procedure to each element of the receiver, if any.
@@ -256,20 +256,20 @@
  * @return <tt>false</tt> if the procedure stopped before all elements where iterated over, <tt>true</tt> otherwise. 
  */
 public boolean forEach(LongProcedure procedure) {
-	for (int i=0; i<size;) if (! procedure.apply(get(i++))) return false;
-	return true;
+  for (int i=0; i<size;) if (! procedure.apply(get(i++))) return false;
+  return true;
 }
 /**
  * Returns the element at the specified position in the receiver.
  *
  * @param index index of element to return.
  * @exception IndexOutOfBoundsException index is out of range (index
- * 		  &lt; 0 || index &gt;= size()).
+ *       &lt; 0 || index &gt;= size()).
  */
 public long get(int index) {
-	if (index >= size || index < 0)
-		throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
-	return getQuick(index);
+  if (index >= size || index < 0)
+    throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
+  return getQuick(index);
 }
 /**
  * Returns the element at the specified position in the receiver; <b>WARNING:</b> Does not check preconditions. 
@@ -291,7 +291,7 @@
  * @return  the index of the first occurrence of the element in the receiver; returns <code>-1</code> if the element is not found.
  */
 public int indexOf(long element) { //delta
-	return indexOfFromTo(element, 0, size-1);
+  return indexOfFromTo(element, 0, size-1);
 }
 /**
  * Returns the index of the first occurrence of the specified
@@ -306,12 +306,12 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public int indexOfFromTo(long element, int from, int to) {
-	checkRangeFromTo(from, to, size);
+  checkRangeFromTo(from, to, size);
 
-	for (int i = from ; i <= to; i++) {
-	    if (element==getQuick(i)) return i; //found
-	}
-	return -1; //not found
+  for (int i = from ; i <= to; i++) {
+      if (element==getQuick(i)) return i; //found
+  }
+  return -1; //not found
 }
 /**
  * Returns the index of the last occurrence of the specified
@@ -321,7 +321,7 @@
  * @return  the index of the last occurrence of the element in the receiver; returns <code>-1</code> if the element is not found.
  */
 public int lastIndexOf(long element) {
-	return lastIndexOfFromTo(element, 0, size-1);
+  return lastIndexOfFromTo(element, 0, size-1);
 }
 /**
  * Returns the index of the last occurrence of the specified
@@ -336,12 +336,12 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public int lastIndexOfFromTo(long element, int from, int to) {
-	checkRangeFromTo(from, to, size());
+  checkRangeFromTo(from, to, size());
 
-	for (int i = to ; i >= from; i--) {
-	    if (element==getQuick(i)) return i; //found
-	}
-	return -1; //not found
+  for (int i = to ; i >= from; i--) {
+      if (element==getQuick(i)) return i; //found
+  }
+  return -1; //not found
 }
 /**
  * Sorts the specified range of the receiver into ascending order. 
@@ -360,13 +360,13 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public void mergeSortFromTo(int from, int to) {
-	int mySize = size();
-	checkRangeFromTo(from, to, mySize);
-	
-	long[] myElements = elements();
-	org.apache.mahout.matrix.Sorting.mergeSort(myElements, from, to+1);
-	elements(myElements);
-	setSizeRaw(mySize);
+  int mySize = size();
+  checkRangeFromTo(from, to, mySize);
+  
+  long[] myElements = elements();
+  org.apache.mahout.matrix.Sorting.mergeSort(myElements, from, to+1);
+  elements(myElements);
+  setSizeRaw(mySize);
 }
 /**
  * Sorts the receiver according
@@ -390,21 +390,21 @@
  * @param to the index of the last element (inclusive) to be sorted.
  * @param c the comparator to determine the order of the receiver.
  * @throws ClassCastException if the array contains elements that are not
- *	       <i>mutually comparable</i> using the specified comparator.
+ *         <i>mutually comparable</i> using the specified comparator.
  * @throws IllegalArgumentException if <tt>fromIndex &gt; toIndex</tt>
  * @throws ArrayIndexOutOfBoundsException if <tt>fromIndex &lt; 0</tt> or
- *	       <tt>toIndex &gt; a.length</tt>
+ *         <tt>toIndex &gt; a.length</tt>
  * @see Comparator
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public void mergeSortFromTo(int from, int to, LongComparator c) {
-	int mySize = size();
-	checkRangeFromTo(from, to, mySize);
-	
-	long[] myElements = elements();
-	org.apache.mahout.matrix.Sorting.mergeSort(myElements, from, to+1, c);
-	elements(myElements);
-	setSizeRaw(mySize);
+  int mySize = size();
+  checkRangeFromTo(from, to, mySize);
+  
+  long[] myElements = elements();
+  org.apache.mahout.matrix.Sorting.mergeSort(myElements, from, to+1, c);
+  elements(myElements);
+  setSizeRaw(mySize);
 }
 /**
  * Returns a new list of the part of the receiver between <code>from</code>, inclusive, and <code>to</code>, inclusive.
@@ -414,12 +414,12 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public AbstractLongList partFromTo(int from, int to) {
-	checkRangeFromTo(from, to, size);
+  checkRangeFromTo(from, to, size);
 
-	int length = to-from+1;
-	LongArrayList part = new LongArrayList(length);
-	part.addAllOfFromTo(this,from,to);
-	return part;
+  int length = to-from+1;
+  LongArrayList part = new LongArrayList(length);
+  part.addAllOfFromTo(this,from,to);
+  return part;
 }
 /**
  * Sorts the specified range of the receiver into
@@ -438,13 +438,13 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public void quickSortFromTo(int from, int to) {
-	int mySize = size();
-	checkRangeFromTo(from, to, mySize);
-	
-	long[] myElements = elements();
-	java.util.Arrays.sort(myElements, from, to+1);
-	elements(myElements);
-	setSizeRaw(mySize);
+  int mySize = size();
+  checkRangeFromTo(from, to, mySize);
+  
+  long[] myElements = elements();
+  java.util.Arrays.sort(myElements, from, to+1);
+  elements(myElements);
+  setSizeRaw(mySize);
 }
 /**
  * Sorts the receiver according
@@ -466,21 +466,21 @@
  * @param to the index of the last element (inclusive) to be sorted.
  * @param c the comparator to determine the order of the receiver.
  * @throws ClassCastException if the array contains elements that are not
- *	       <i>mutually comparable</i> using the specified comparator.
+ *         <i>mutually comparable</i> using the specified comparator.
  * @throws IllegalArgumentException if <tt>fromIndex &gt; toIndex</tt>
  * @throws ArrayIndexOutOfBoundsException if <tt>fromIndex &lt; 0</tt> or
- *	       <tt>toIndex &gt; a.length</tt>
+ *         <tt>toIndex &gt; a.length</tt>
  * @see Comparator
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public void quickSortFromTo(int from, int to, LongComparator c) {
-	int mySize = size();
-	checkRangeFromTo(from, to, mySize);
-	
-	long[] myElements = elements();
-	org.apache.mahout.matrix.Sorting.quickSort(myElements, from, to+1,c);
-	elements(myElements);
-	setSizeRaw(mySize);
+  int mySize = size();
+  checkRangeFromTo(from, to, mySize);
+  
+  long[] myElements = elements();
+  org.apache.mahout.matrix.Sorting.quickSort(myElements, from, to+1,c);
+  elements(myElements);
+  setSizeRaw(mySize);
 }
 /**
 * Removes from the receiver all elements that are contained in the specified list.
@@ -490,17 +490,17 @@
 * @return <code>true</code> if the receiver changed as a result of the call.
 */
 public boolean removeAll(AbstractLongList other) {
-	if (other.size()==0) return false; //nothing to do
-	int limit = other.size()-1;
-	int j=0;
+  if (other.size()==0) return false; //nothing to do
+  int limit = other.size()-1;
+  int j=0;
 
-	for (int i=0; i<size ; i++) {
-		if (other.indexOfFromTo(getQuick(i), 0, limit) < 0) setQuick(j++,getQuick(i));
-	}
+  for (int i=0; i<size ; i++) {
+    if (other.indexOfFromTo(getQuick(i), 0, limit) < 0) setQuick(j++,getQuick(i));
+  }
 
-	boolean modified = (j!=size);
-	setSize(j);
-	return modified;
+  boolean modified = (j!=size);
+  setSize(j);
+  return modified;
 }
 /**
  * Removes from the receiver all elements whose index is between
@@ -513,14 +513,14 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public void removeFromTo(int from, int to) {
-	checkRangeFromTo(from, to, size);
-	int numMoved = size - to - 1;
-	if (numMoved > 0) {
-		replaceFromToWithFrom(from, from-1+numMoved, this, to+1);
-		//fillFromToWith(from+numMoved, size-1, 0.0f); //delta
-	}
-	int width = to-from+1;
-	if (width>0) setSizeRaw(size-width);
+  checkRangeFromTo(from, to, size);
+  int numMoved = size - to - 1;
+  if (numMoved > 0) {
+    replaceFromToWithFrom(from, from-1+numMoved, this, to+1);
+    //fillFromToWith(from+numMoved, size-1, 0.0f); //delta
+  }
+  int width = to-from+1;
+  if (width>0) setSizeRaw(size-width);
 }
 /**
  * Replaces a number of elements in the receiver with the same number of elements of another list.
@@ -533,22 +533,22 @@
  * @param otherFrom position of first element within other list to be copied.
  */
 public void replaceFromToWithFrom(int from, int to, AbstractLongList other, int otherFrom) {
-	int length=to-from+1;
-	if (length>0) {
-		checkRangeFromTo(from, to, size());
-		checkRangeFromTo(otherFrom,otherFrom+length-1,other.size());
+  int length=to-from+1;
+  if (length>0) {
+    checkRangeFromTo(from, to, size());
+    checkRangeFromTo(otherFrom,otherFrom+length-1,other.size());
 
-		// unambiguous copy (it may hold other==this)
-		if (from<=otherFrom) {
-			for (; --length >= 0; ) setQuick(from++,other.getQuick(otherFrom++));
-		}
-		else {
-			int otherTo = otherFrom+length-1;
-			for (; --length >= 0; ) setQuick(to--,other.getQuick(otherTo--));
-		}
+    // unambiguous copy (it may hold other==this)
+    if (from<=otherFrom) {
+      for (; --length >= 0; ) setQuick(from++,other.getQuick(otherFrom++));
+    }
+    else {
+      int otherTo = otherFrom+length-1;
+      for (; --length >= 0; ) setQuick(to--,other.getQuick(otherTo--));
+    }
 
-			
-	}
+      
+  }
 }
 /**
 * Replaces the part between <code>from</code> (inclusive) and <code>to</code> (inclusive) with the other list's
@@ -594,36 +594,36 @@
 * </pre>
 */
 public void replaceFromToWithFromTo(int from, int to, AbstractLongList other, int otherFrom, int otherTo) {
-	if (otherFrom>otherTo) {
-		throw new IndexOutOfBoundsException("otherFrom: "+otherFrom+", otherTo: "+otherTo);
-	}
+  if (otherFrom>otherTo) {
+    throw new IndexOutOfBoundsException("otherFrom: "+otherFrom+", otherTo: "+otherTo);
+  }
 
-	if (this==other && to-from!=otherTo-otherFrom) { // avoid stumbling over my own feet
-		replaceFromToWithFromTo(from, to, partFromTo(otherFrom, otherTo), 0, otherTo-otherFrom);
-		return;
-	}
-	
-	int length=otherTo-otherFrom+1;
-	int diff=length;
-	int theLast=from-1;
+  if (this==other && to-from!=otherTo-otherFrom) { // avoid stumbling over my own feet
+    replaceFromToWithFromTo(from, to, partFromTo(otherFrom, otherTo), 0, otherTo-otherFrom);
+    return;
+  }
+  
+  int length=otherTo-otherFrom+1;
+  int diff=length;
+  int theLast=from-1;
 
-	if (to>=from) {
-		diff -= (to-from+1);
-		theLast=to;
-	}
-	
-	if (diff>0) {
-		beforeInsertDummies(theLast+1, diff);
-	}
-	else {
-		if (diff<0) {
-			removeFromTo(theLast+diff, theLast-1);
-		}
-	}
+  if (to>=from) {
+    diff -= (to-from+1);
+    theLast=to;
+  }
+  
+  if (diff>0) {
+    beforeInsertDummies(theLast+1, diff);
+  }
+  else {
+    if (diff<0) {
+      removeFromTo(theLast+diff, theLast-1);
+    }
+  }
 
-	if (length>0) {
-		replaceFromToWithFrom(from,from+length-1,other,otherFrom);
-	}
+  if (length>0) {
+    replaceFromToWithFrom(from,from+length-1,other,otherFrom);
+  }
 }
 /**
  * Replaces the part of the receiver starting at <code>from</code> (inclusive) with all the elements of the specified collection.
@@ -635,12 +635,12 @@
  * @exception IndexOutOfBoundsException index is out of range (index &lt; 0 || index &gt;= size()).
  */
 public void replaceFromWith(int from, java.util.Collection other) {
-	checkRange(from,size());
-	java.util.Iterator e = other.iterator();
-	int index=from;
-	int limit = Math.min(size()-from, other.size());
-	for (int i=0; i<limit; i++)
-	    set(index++,((Number) e.next()).longValue()); //delta
+  checkRange(from,size());
+  java.util.Iterator e = other.iterator();
+  int index=from;
+  int limit = Math.min(size()-from, other.size());
+  for (int i=0; i<limit; i++)
+      set(index++,((Number) e.next()).longValue()); //delta
 }
 /**
 * Retains (keeps) only the elements in the receiver that are contained in the specified other list.
@@ -650,36 +650,36 @@
 * @return <code>true</code> if the receiver changed as a result of the call.
 */
 public boolean retainAll(AbstractLongList other) {
-	if (other.size()==0) {
-		if (size==0) return false;
-		setSize(0);
-		return true;
-	}
-	
-	int limit = other.size()-1;
-	int j=0;
-	for (int i=0; i<size ; i++) {
-		if (other.indexOfFromTo(getQuick(i), 0, limit) >= 0) setQuick(j++, getQuick(i));
-	}
+  if (other.size()==0) {
+    if (size==0) return false;
+    setSize(0);
+    return true;
+  }
+  
+  int limit = other.size()-1;
+  int j=0;
+  for (int i=0; i<size ; i++) {
+    if (other.indexOfFromTo(getQuick(i), 0, limit) >= 0) setQuick(j++, getQuick(i));
+  }
 
-	boolean modified = (j!=size);
-	setSize(j);
-	return modified;
+  boolean modified = (j!=size);
+  setSize(j);
+  return modified;
 }
 /**
  * Reverses the elements of the receiver.
  * Last becomes first, second last becomes second first, and so on.
  */
 public void reverse() {
-	long tmp;
-	int limit=size()/2;
-	int j=size()-1;
+  long tmp;
+  int limit=size()/2;
+  int j=size()-1;
 
-	for (int i=0; i<limit;) { //swap
-		tmp=getQuick(i);
-		setQuick(i++,getQuick(j));
-		setQuick(j--,tmp);
-	}
+  for (int i=0; i<limit;) { //swap
+    tmp=getQuick(i);
+    setQuick(i++,getQuick(j));
+    setQuick(j--,tmp);
+  }
 }
 /**
  * Replaces the element at the specified position in the receiver with the specified element.
@@ -689,9 +689,9 @@
  * @throws IndexOutOfBoundsException if <tt>index &lt; 0 || index &gt;= size()</tt>.
  */
 public void set(int index, long element) {
-	if (index >= size || index < 0)
-		throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
-	setQuick(index,element);
+  if (index >= size || index < 0)
+    throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
+  setQuick(index,element);
 }
 /**
  * Replaces the element at the specified position in the receiver with the specified element; <b>WARNING:</b> Does not check preconditions.
@@ -722,7 +722,7 @@
  * }
  */
 protected void setSizeRaw(int newSize) {
-	size = newSize;
+  size = newSize;
 }
 /**
  * Randomly permutes the part of the receiver between <code>from</code> (inclusive) and <code>to</code> (inclusive). 
@@ -731,17 +731,17 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public void shuffleFromTo(int from, int to) {
-	checkRangeFromTo(from, to, size());
-	
-	org.apache.mahout.jet.random.Uniform gen = new org.apache.mahout.jet.random.Uniform(new org.apache.mahout.jet.random.engine.DRand(new java.util.Date()));
-	for (int i=from; i<to; i++) { 
-		int random = gen.nextIntFromTo(i, to);
+  checkRangeFromTo(from, to, size());
+  
+  org.apache.mahout.jet.random.Uniform gen = new org.apache.mahout.jet.random.Uniform(new org.apache.mahout.jet.random.engine.DRand(new java.util.Date()));
+  for (int i=from; i<to; i++) { 
+    int random = gen.nextIntFromTo(i, to);
 
-		//swap(i, random)
-		long tmpElement = getQuick(random);
-		setQuick(random,getQuick(i)); 
-		setQuick(i,tmpElement); 
-	}  
+    //swap(i, random)
+    long tmpElement = getQuick(random);
+    setQuick(random,getQuick(i)); 
+    setQuick(i,tmpElement); 
+  }  
 }
 /**
  * Returns the number of elements contained in the receiver.
@@ -749,33 +749,33 @@
  * @returns  the number of elements contained in the receiver.
  */
 public int size() {
-	return size;
+  return size;
 }
 /**
  * Returns a list which is a concatenation of <code>times</code> times the receiver.
  * @param times the number of times the receiver shall be copied.
  */
 public AbstractLongList times(int times) {
-	AbstractLongList newList = new LongArrayList(times*size());
-	for (int i=times; --i >= 0; ) {
-		newList.addAllOfFromTo(this,0,size()-1);
-	}
-	return newList;
+  AbstractLongList newList = new LongArrayList(times*size());
+  for (int i=times; --i >= 0; ) {
+    newList.addAllOfFromTo(this,0,size()-1);
+  }
+  return newList;
 }
 /**
  * Returns a <code>java.util.ArrayList</code> containing all the elements in the receiver.
  */
 public java.util.ArrayList toList() {
-	int mySize = size();
-	java.util.ArrayList list = new java.util.ArrayList(mySize);
-	for (int i=0; i < mySize; i++) list.add(new Long(get(i)));
-	return list;
+  int mySize = size();
+  java.util.ArrayList list = new java.util.ArrayList(mySize);
+  for (int i=0; i < mySize; i++) list.add(new Long(get(i)));
+  return list;
 }
 /**
 * Returns a string representation of the receiver, containing
 * the String representation of each element.
 */
 public String toString() {
-	return org.apache.mahout.matrix.Arrays.toString(partFromTo(0, size()-1).elements());
+  return org.apache.mahout.matrix.Arrays.toString(partFromTo(0, size()-1).elements());
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/list/AbstractShortList.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/list/AbstractShortList.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/list/AbstractShortList.java	(working copy)
@@ -19,13 +19,13 @@
  */
 @Deprecated
 public abstract class AbstractShortList extends AbstractList {
-	/**
-	 * The size of the list.
-	 * This is a READ_ONLY variable for all methods but setSizeRaw(int newSize) !!!
-	 * If you violate this principle in subclasses, you should exactly know what you are doing.
-	 * @serial
-	 */
-	protected int size;
+  /**
+   * The size of the list.
+   * This is a READ_ONLY variable for all methods but setSizeRaw(int newSize) !!!
+   * If you violate this principle in subclasses, you should exactly know what you are doing.
+   * @serial
+   */
+  protected int size;
 /**
  * Makes this class non instantiable, but still let's others inherit from it.
  */
@@ -36,7 +36,7 @@
  * @param element element to be appended to this list.
  */
 public void add(short element) {
-	beforeInsert(size,element);
+  beforeInsert(size,element);
 }
 /**
  * Appends the part of the specified list between <code>from</code> (inclusive) and <code>to</code> (inclusive) to the receiver.
@@ -47,7 +47,7 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>other.size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=other.size())</tt>).
  */
 public void addAllOfFromTo(AbstractShortList other, int from, int to) {
-	beforeInsertAllOfFromTo(size,other,from,to);
+  beforeInsertAllOfFromTo(size,other,from,to);
 }
 /**
  * Inserts the specified element before the specified position into the receiver. 
@@ -59,8 +59,8 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>index &lt; 0 || index &gt; size()</tt>).
  */
 public void beforeInsert(int index, short element) {
-	beforeInsertDummies(index,1);
-	set(index,element);
+  beforeInsertDummies(index,1);
+  set(index,element);
 }
 /**
  * Inserts the part of the specified list between <code>otherFrom</code> (inclusive) and <code>otherTo</code> (inclusive) before the specified position into the receiver. 
@@ -75,9 +75,9 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>index &lt; 0 || index &gt; size()</tt>).
  */
 public void beforeInsertAllOfFromTo(int index, AbstractShortList other, int from, int to) {
-	int length=to-from+1;
-	this.beforeInsertDummies(index, length);
-	this.replaceFromToWithFrom(index, index+length-1, other, from);
+  int length=to-from+1;
+  this.beforeInsertDummies(index, length);
+  this.replaceFromToWithFrom(index, index+length-1, other, from);
 }
 /**
  * Inserts <tt>length</tt> dummy elements before the specified position into the receiver. 
@@ -90,13 +90,13 @@
  * @throws IndexOutOfBoundsException if <tt>index &lt; 0 || index &gt; size()</tt>.
  */
 protected void beforeInsertDummies(int index, int length) {
-	if (index > size || index < 0) 
-		throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
-	if (length > 0) {
-		ensureCapacity(size + length);
-		setSizeRaw(size + length);
-		replaceFromToWithFrom(index+length,size-1,this,index);
-	}
+  if (index > size || index < 0) 
+    throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
+  if (length > 0) {
+    ensureCapacity(size + length);
+    setSizeRaw(size + length);
+    replaceFromToWithFrom(index+length,size-1,this,index);
+  }
 }
 /**
  * Searches the receiver for the specified value using
@@ -109,17 +109,17 @@
  *
  * @param key the value to be searched for.
  * @return index of the search key, if it is contained in the receiver;
- *	       otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
- *	       point</i> is defined as the the point at which the value would
- * 	       be inserted into the receiver: the index of the first
- *	       element greater than the key, or <tt>receiver.size()</tt>, if all
- *	       elements in the receiver are less than the specified key.  Note
- *	       that this guarantees that the return value will be &gt;= 0 if
- *	       and only if the key is found.
+ *         otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
+ *         point</i> is defined as the the point at which the value would
+ *          be inserted into the receiver: the index of the first
+ *         element greater than the key, or <tt>receiver.size()</tt>, if all
+ *         elements in the receiver are less than the specified key.  Note
+ *         that this guarantees that the return value will be &gt;= 0 if
+ *         and only if the key is found.
  * @see java.util.Arrays
  */
 public int binarySearch(short key) {
-	return this.binarySearchFromTo(key, 0, size-1);
+  return this.binarySearchFromTo(key, 0, size-1);
 }
 /**
  * Searches the receiver for the specified value using
@@ -134,27 +134,27 @@
  * @param from the leftmost search position, inclusive.
  * @param to the rightmost search position, inclusive.
  * @return index of the search key, if it is contained in the receiver;
- *	       otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
- *	       point</i> is defined as the the point at which the value would
- * 	       be inserted into the receiver: the index of the first
- *	       element greater than the key, or <tt>receiver.size()</tt>, if all
- *	       elements in the receiver are less than the specified key.  Note
- *	       that this guarantees that the return value will be &gt;= 0 if
- *	       and only if the key is found.
+ *         otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
+ *         point</i> is defined as the the point at which the value would
+ *          be inserted into the receiver: the index of the first
+ *         element greater than the key, or <tt>receiver.size()</tt>, if all
+ *         elements in the receiver are less than the specified key.  Note
+ *         that this guarantees that the return value will be &gt;= 0 if
+ *         and only if the key is found.
  * @see java.util.Arrays
  */
 public int binarySearchFromTo(short key, int from, int to) {
-	int low=from;
-	int high=to;
-	while (low <= high) {
-		int mid =(low + high)/2;
-		short midVal = get(mid);
+  int low=from;
+  int high=to;
+  while (low <= high) {
+    int mid =(low + high)/2;
+    short midVal = get(mid);
 
-		if (midVal < key) low = mid + 1;
-		else if (midVal > key) high = mid - 1;
-		else return mid; // key found
-	}
-	return -(low + 1);  // key not found.
+    if (midVal < key) low = mid + 1;
+    else if (midVal > key) high = mid - 1;
+    else return mid; // key found
+  }
+  return -(low + 1);  // key not found.
 }
 /**
  * Returns a deep copy of the receiver. 
@@ -162,7 +162,7 @@
  * @return  a deep copy of the receiver.
  */
 public Object clone() {
-	return partFromTo(0,size-1);
+  return partFromTo(0,size-1);
 }
 /**
  * Returns true if the receiver contains the specified element.
@@ -170,7 +170,7 @@
  * @param element element whose presence in the receiver is to be tested.
  */
 public boolean contains(short elem) {
-	return indexOfFromTo(elem,0,size-1) >=0;
+  return indexOfFromTo(elem,0,size-1) >=0;
 }
 /**
  * Deletes the first element from the receiver that is identical to the specified element.
@@ -179,8 +179,8 @@
  * @param element the element to be deleted.
  */
 public void delete(short element) {
-	int index = indexOfFromTo(element, 0, size-1);
-	if (index>=0) remove(index);
+  int index = indexOfFromTo(element, 0, size-1);
+  if (index>=0) remove(index);
 }
 /**
  * Returns the elements currently stored, possibly including invalid elements between size and capacity.
@@ -191,9 +191,9 @@
  * @return the elements currently stored.
  */
 public short[] elements() {
-	short[] myElements = new short[size];
-	for (int i=size; --i >= 0; ) myElements[i]=getQuick(i);
-	return myElements;
+  short[] myElements = new short[size];
+  for (int i=size; --i >= 0; ) myElements[i]=getQuick(i);
+  return myElements;
 }
 /**
  * Sets the receiver's elements to be the specified array.
@@ -205,9 +205,9 @@
  * @return the receiver itself.
  */
 public AbstractShortList elements(short[] elements) {
-	clear();
-	addAllOfFromTo(new ShortArrayList(elements),0,elements.length-1);
-	return this;
+  clear();
+  addAllOfFromTo(new ShortArrayList(elements),0,elements.length-1);
+  return this;
 }
 /**
  * Ensures that the receiver can hold at least the specified number of elements without needing to allocate new internal memory.
@@ -227,16 +227,16 @@
  * @return true if the specified Object is equal to the receiver.
  */
 public boolean equals(Object otherObj) { //delta
-	if (! (otherObj instanceof AbstractShortList)) {return false;}
-	if (this==otherObj) return true;
-	if (otherObj==null) return false;
-	AbstractShortList other = (AbstractShortList) otherObj;
-	if (size()!=other.size()) return false;
+  if (! (otherObj instanceof AbstractShortList)) {return false;}
+  if (this==otherObj) return true;
+  if (otherObj==null) return false;
+  AbstractShortList other = (AbstractShortList) otherObj;
+  if (size()!=other.size()) return false;
 
-	for (int i=size(); --i >= 0; ) {
-	    if (getQuick(i) != other.getQuick(i)) return false;
-	}
-	return true;
+  for (int i=size(); --i >= 0; ) {
+      if (getQuick(i) != other.getQuick(i)) return false;
+  }
+  return true;
 }
 /**
  * Sets the specified range of elements in the specified array to the specified value.
@@ -246,8 +246,8 @@
  * @param val the value to be stored in the specified elements of the receiver.
  */
 public void fillFromToWith(int from, int to, short val) {
-	checkRangeFromTo(from,to,this.size);
-	for (int i=from; i<=to;) setQuick(i++,val); 
+  checkRangeFromTo(from,to,this.size);
+  for (int i=from; i<=to;) setQuick(i++,val); 
 }
 /**
  * Applies a procedure to each element of the receiver, if any.
@@ -256,20 +256,20 @@
  * @return <tt>false</tt> if the procedure stopped before all elements where iterated over, <tt>true</tt> otherwise. 
  */
 public boolean forEach(ShortProcedure procedure) {
-	for (int i=0; i<size;) if (! procedure.apply(get(i++))) return false;
-	return true;
+  for (int i=0; i<size;) if (! procedure.apply(get(i++))) return false;
+  return true;
 }
 /**
  * Returns the element at the specified position in the receiver.
  *
  * @param index index of element to return.
  * @exception IndexOutOfBoundsException index is out of range (index
- * 		  &lt; 0 || index &gt;= size()).
+ *       &lt; 0 || index &gt;= size()).
  */
 public short get(int index) {
-	if (index >= size || index < 0)
-		throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
-	return getQuick(index);
+  if (index >= size || index < 0)
+    throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
+  return getQuick(index);
 }
 /**
  * Returns the element at the specified position in the receiver; <b>WARNING:</b> Does not check preconditions. 
@@ -291,7 +291,7 @@
  * @return  the index of the first occurrence of the element in the receiver; returns <code>-1</code> if the element is not found.
  */
 public int indexOf(short element) { //delta
-	return indexOfFromTo(element, 0, size-1);
+  return indexOfFromTo(element, 0, size-1);
 }
 /**
  * Returns the index of the first occurrence of the specified
@@ -306,12 +306,12 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public int indexOfFromTo(short element, int from, int to) {
-	checkRangeFromTo(from, to, size);
+  checkRangeFromTo(from, to, size);
 
-	for (int i = from ; i <= to; i++) {
-	    if (element==getQuick(i)) return i; //found
-	}
-	return -1; //not found
+  for (int i = from ; i <= to; i++) {
+      if (element==getQuick(i)) return i; //found
+  }
+  return -1; //not found
 }
 /**
  * Returns the index of the last occurrence of the specified
@@ -321,7 +321,7 @@
  * @return  the index of the last occurrence of the element in the receiver; returns <code>-1</code> if the element is not found.
  */
 public int lastIndexOf(short element) {
-	return lastIndexOfFromTo(element, 0, size-1);
+  return lastIndexOfFromTo(element, 0, size-1);
 }
 /**
  * Returns the index of the last occurrence of the specified
@@ -336,12 +336,12 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public int lastIndexOfFromTo(short element, int from, int to) {
-	checkRangeFromTo(from, to, size());
+  checkRangeFromTo(from, to, size());
 
-	for (int i = to ; i >= from; i--) {
-	    if (element==getQuick(i)) return i; //found
-	}
-	return -1; //not found
+  for (int i = to ; i >= from; i--) {
+      if (element==getQuick(i)) return i; //found
+  }
+  return -1; //not found
 }
 /**
  * Sorts the specified range of the receiver into ascending order. 
@@ -360,13 +360,13 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public void mergeSortFromTo(int from, int to) {
-	int mySize = size();
-	checkRangeFromTo(from, to, mySize);
-	
-	short[] myElements = elements();
-	org.apache.mahout.matrix.Sorting.mergeSort(myElements, from, to+1);
-	elements(myElements);
-	setSizeRaw(mySize);
+  int mySize = size();
+  checkRangeFromTo(from, to, mySize);
+  
+  short[] myElements = elements();
+  org.apache.mahout.matrix.Sorting.mergeSort(myElements, from, to+1);
+  elements(myElements);
+  setSizeRaw(mySize);
 }
 /**
  * Sorts the receiver according
@@ -390,21 +390,21 @@
  * @param to the index of the last element (inclusive) to be sorted.
  * @param c the comparator to determine the order of the receiver.
  * @throws ClassCastException if the array contains elements that are not
- *	       <i>mutually comparable</i> using the specified comparator.
+ *         <i>mutually comparable</i> using the specified comparator.
  * @throws IllegalArgumentException if <tt>fromIndex &gt; toIndex</tt>
  * @throws ArrayIndexOutOfBoundsException if <tt>fromIndex &lt; 0</tt> or
- *	       <tt>toIndex &gt; a.length</tt>
+ *         <tt>toIndex &gt; a.length</tt>
  * @see Comparator
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public void mergeSortFromTo(int from, int to, ShortComparator c) {
-	int mySize = size();
-	checkRangeFromTo(from, to, mySize);
-	
-	short[] myElements = elements();
-	org.apache.mahout.matrix.Sorting.mergeSort(myElements, from, to+1, c);
-	elements(myElements);
-	setSizeRaw(mySize);
+  int mySize = size();
+  checkRangeFromTo(from, to, mySize);
+  
+  short[] myElements = elements();
+  org.apache.mahout.matrix.Sorting.mergeSort(myElements, from, to+1, c);
+  elements(myElements);
+  setSizeRaw(mySize);
 }
 /**
  * Returns a new list of the part of the receiver between <code>from</code>, inclusive, and <code>to</code>, inclusive.
@@ -414,12 +414,12 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public AbstractShortList partFromTo(int from, int to) {
-	checkRangeFromTo(from, to, size);
+  checkRangeFromTo(from, to, size);
 
-	int length = to-from+1;
-	ShortArrayList part = new ShortArrayList(length);
-	part.addAllOfFromTo(this,from,to);
-	return part;
+  int length = to-from+1;
+  ShortArrayList part = new ShortArrayList(length);
+  part.addAllOfFromTo(this,from,to);
+  return part;
 }
 /**
  * Sorts the specified range of the receiver into
@@ -438,13 +438,13 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public void quickSortFromTo(int from, int to) {
-	int mySize = size();
-	checkRangeFromTo(from, to, mySize);
-	
-	short[] myElements = elements();
-	java.util.Arrays.sort(myElements, from, to+1);
-	elements(myElements);
-	setSizeRaw(mySize);
+  int mySize = size();
+  checkRangeFromTo(from, to, mySize);
+  
+  short[] myElements = elements();
+  java.util.Arrays.sort(myElements, from, to+1);
+  elements(myElements);
+  setSizeRaw(mySize);
 }
 /**
  * Sorts the receiver according
@@ -466,21 +466,21 @@
  * @param to the index of the last element (inclusive) to be sorted.
  * @param c the comparator to determine the order of the receiver.
  * @throws ClassCastException if the array contains elements that are not
- *	       <i>mutually comparable</i> using the specified comparator.
+ *         <i>mutually comparable</i> using the specified comparator.
  * @throws IllegalArgumentException if <tt>fromIndex &gt; toIndex</tt>
  * @throws ArrayIndexOutOfBoundsException if <tt>fromIndex &lt; 0</tt> or
- *	       <tt>toIndex &gt; a.length</tt>
+ *         <tt>toIndex &gt; a.length</tt>
  * @see Comparator
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public void quickSortFromTo(int from, int to, ShortComparator c) {
-	int mySize = size();
-	checkRangeFromTo(from, to, mySize);
-	
-	short[] myElements = elements();
-	org.apache.mahout.matrix.Sorting.quickSort(myElements, from, to+1,c);
-	elements(myElements);
-	setSizeRaw(mySize);
+  int mySize = size();
+  checkRangeFromTo(from, to, mySize);
+  
+  short[] myElements = elements();
+  org.apache.mahout.matrix.Sorting.quickSort(myElements, from, to+1,c);
+  elements(myElements);
+  setSizeRaw(mySize);
 }
 /**
 * Removes from the receiver all elements that are contained in the specified list.
@@ -490,17 +490,17 @@
 * @return <code>true</code> if the receiver changed as a result of the call.
 */
 public boolean removeAll(AbstractShortList other) {
-	if (other.size()==0) return false; //nothing to do
-	int limit = other.size()-1;
-	int j=0;
+  if (other.size()==0) return false; //nothing to do
+  int limit = other.size()-1;
+  int j=0;
 
-	for (int i=0; i<size ; i++) {
-		if (other.indexOfFromTo(getQuick(i), 0, limit) < 0) setQuick(j++,getQuick(i));
-	}
+  for (int i=0; i<size ; i++) {
+    if (other.indexOfFromTo(getQuick(i), 0, limit) < 0) setQuick(j++,getQuick(i));
+  }
 
-	boolean modified = (j!=size);
-	setSize(j);
-	return modified;
+  boolean modified = (j!=size);
+  setSize(j);
+  return modified;
 }
 /**
  * Removes from the receiver all elements whose index is between
@@ -513,14 +513,14 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public void removeFromTo(int from, int to) {
-	checkRangeFromTo(from, to, size);
-	int numMoved = size - to - 1;
-	if (numMoved > 0) {
-		replaceFromToWithFrom(from, from-1+numMoved, this, to+1);
-		//fillFromToWith(from+numMoved, size-1, 0.0f); //delta
-	}
-	int width = to-from+1;
-	if (width>0) setSizeRaw(size-width);
+  checkRangeFromTo(from, to, size);
+  int numMoved = size - to - 1;
+  if (numMoved > 0) {
+    replaceFromToWithFrom(from, from-1+numMoved, this, to+1);
+    //fillFromToWith(from+numMoved, size-1, 0.0f); //delta
+  }
+  int width = to-from+1;
+  if (width>0) setSizeRaw(size-width);
 }
 /**
  * Replaces a number of elements in the receiver with the same number of elements of another list.
@@ -533,22 +533,22 @@
  * @param otherFrom position of first element within other list to be copied.
  */
 public void replaceFromToWithFrom(int from, int to, AbstractShortList other, int otherFrom) {
-	int length=to-from+1;
-	if (length>0) {
-		checkRangeFromTo(from, to, size());
-		checkRangeFromTo(otherFrom,otherFrom+length-1,other.size());
+  int length=to-from+1;
+  if (length>0) {
+    checkRangeFromTo(from, to, size());
+    checkRangeFromTo(otherFrom,otherFrom+length-1,other.size());
 
-		// unambiguous copy (it may hold other==this)
-		if (from<=otherFrom) {
-			for (; --length >= 0; ) setQuick(from++,other.getQuick(otherFrom++));
-		}
-		else {
-			int otherTo = otherFrom+length-1;
-			for (; --length >= 0; ) setQuick(to--,other.getQuick(otherTo--));
-		}
+    // unambiguous copy (it may hold other==this)
+    if (from<=otherFrom) {
+      for (; --length >= 0; ) setQuick(from++,other.getQuick(otherFrom++));
+    }
+    else {
+      int otherTo = otherFrom+length-1;
+      for (; --length >= 0; ) setQuick(to--,other.getQuick(otherTo--));
+    }
 
-			
-	}
+      
+  }
 }
 /**
 * Replaces the part between <code>from</code> (inclusive) and <code>to</code> (inclusive) with the other list's
@@ -594,36 +594,36 @@
 * </pre>
 */
 public void replaceFromToWithFromTo(int from, int to, AbstractShortList other, int otherFrom, int otherTo) {
-	if (otherFrom>otherTo) {
-		throw new IndexOutOfBoundsException("otherFrom: "+otherFrom+", otherTo: "+otherTo);
-	}
+  if (otherFrom>otherTo) {
+    throw new IndexOutOfBoundsException("otherFrom: "+otherFrom+", otherTo: "+otherTo);
+  }
 
-	if (this==other && to-from!=otherTo-otherFrom) { // avoid stumbling over my own feet
-		replaceFromToWithFromTo(from, to, partFromTo(otherFrom, otherTo), 0, otherTo-otherFrom);
-		return;
-	}
-	
-	int length=otherTo-otherFrom+1;
-	int diff=length;
-	int theLast=from-1;
+  if (this==other && to-from!=otherTo-otherFrom) { // avoid stumbling over my own feet
+    replaceFromToWithFromTo(from, to, partFromTo(otherFrom, otherTo), 0, otherTo-otherFrom);
+    return;
+  }
+  
+  int length=otherTo-otherFrom+1;
+  int diff=length;
+  int theLast=from-1;
 
-	if (to>=from) {
-		diff -= (to-from+1);
-		theLast=to;
-	}
-	
-	if (diff>0) {
-		beforeInsertDummies(theLast+1, diff);
-	}
-	else {
-		if (diff<0) {
-			removeFromTo(theLast+diff, theLast-1);
-		}
-	}
+  if (to>=from) {
+    diff -= (to-from+1);
+    theLast=to;
+  }
+  
+  if (diff>0) {
+    beforeInsertDummies(theLast+1, diff);
+  }
+  else {
+    if (diff<0) {
+      removeFromTo(theLast+diff, theLast-1);
+    }
+  }
 
-	if (length>0) {
-		replaceFromToWithFrom(from,from+length-1,other,otherFrom);
-	}
+  if (length>0) {
+    replaceFromToWithFrom(from,from+length-1,other,otherFrom);
+  }
 }
 /**
  * Replaces the part of the receiver starting at <code>from</code> (inclusive) with all the elements of the specified collection.
@@ -635,12 +635,12 @@
  * @exception IndexOutOfBoundsException index is out of range (index &lt; 0 || index &gt;= size()).
  */
 public void replaceFromWith(int from, java.util.Collection other) {
-	checkRange(from,size());
-	java.util.Iterator e = other.iterator();
-	int index=from;
-	int limit = Math.min(size()-from, other.size());
-	for (int i=0; i<limit; i++)
-	    set(index++,((Number) e.next()).shortValue()); //delta
+  checkRange(from,size());
+  java.util.Iterator e = other.iterator();
+  int index=from;
+  int limit = Math.min(size()-from, other.size());
+  for (int i=0; i<limit; i++)
+      set(index++,((Number) e.next()).shortValue()); //delta
 }
 /**
 * Retains (keeps) only the elements in the receiver that are contained in the specified other list.
@@ -650,36 +650,36 @@
 * @return <code>true</code> if the receiver changed as a result of the call.
 */
 public boolean retainAll(AbstractShortList other) {
-	if (other.size()==0) {
-		if (size==0) return false;
-		setSize(0);
-		return true;
-	}
-	
-	int limit = other.size()-1;
-	int j=0;
-	for (int i=0; i<size ; i++) {
-		if (other.indexOfFromTo(getQuick(i), 0, limit) >= 0) setQuick(j++, getQuick(i));
-	}
+  if (other.size()==0) {
+    if (size==0) return false;
+    setSize(0);
+    return true;
+  }
+  
+  int limit = other.size()-1;
+  int j=0;
+  for (int i=0; i<size ; i++) {
+    if (other.indexOfFromTo(getQuick(i), 0, limit) >= 0) setQuick(j++, getQuick(i));
+  }
 
-	boolean modified = (j!=size);
-	setSize(j);
-	return modified;
+  boolean modified = (j!=size);
+  setSize(j);
+  return modified;
 }
 /**
  * Reverses the elements of the receiver.
  * Last becomes first, second last becomes second first, and so on.
  */
 public void reverse() {
-	short tmp;
-	int limit=size()/2;
-	int j=size()-1;
+  short tmp;
+  int limit=size()/2;
+  int j=size()-1;
 
-	for (int i=0; i<limit;) { //swap
-		tmp=getQuick(i);
-		setQuick(i++,getQuick(j));
-		setQuick(j--,tmp);
-	}
+  for (int i=0; i<limit;) { //swap
+    tmp=getQuick(i);
+    setQuick(i++,getQuick(j));
+    setQuick(j--,tmp);
+  }
 }
 /**
  * Replaces the element at the specified position in the receiver with the specified element.
@@ -689,9 +689,9 @@
  * @throws IndexOutOfBoundsException if <tt>index &lt; 0 || index &gt;= size()</tt>.
  */
 public void set(int index, short element) {
-	if (index >= size || index < 0)
-		throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
-	setQuick(index,element);
+  if (index >= size || index < 0)
+    throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
+  setQuick(index,element);
 }
 /**
  * Replaces the element at the specified position in the receiver with the specified element; <b>WARNING:</b> Does not check preconditions.
@@ -722,7 +722,7 @@
  * }
  */
 protected void setSizeRaw(int newSize) {
-	size = newSize;
+  size = newSize;
 }
 /**
  * Randomly permutes the part of the receiver between <code>from</code> (inclusive) and <code>to</code> (inclusive). 
@@ -731,17 +731,17 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public void shuffleFromTo(int from, int to) {
-	checkRangeFromTo(from, to, size());
-	
-	org.apache.mahout.jet.random.Uniform gen = new org.apache.mahout.jet.random.Uniform(new org.apache.mahout.jet.random.engine.DRand(new java.util.Date()));
-	for (int i=from; i<to; i++) { 
-		int random = gen.nextIntFromTo(i, to);
+  checkRangeFromTo(from, to, size());
+  
+  org.apache.mahout.jet.random.Uniform gen = new org.apache.mahout.jet.random.Uniform(new org.apache.mahout.jet.random.engine.DRand(new java.util.Date()));
+  for (int i=from; i<to; i++) { 
+    int random = gen.nextIntFromTo(i, to);
 
-		//swap(i, random)
-		short tmpElement = getQuick(random);
-		setQuick(random,getQuick(i)); 
-		setQuick(i,tmpElement); 
-	}  
+    //swap(i, random)
+    short tmpElement = getQuick(random);
+    setQuick(random,getQuick(i)); 
+    setQuick(i,tmpElement); 
+  }  
 }
 /**
  * Returns the number of elements contained in the receiver.
@@ -749,33 +749,33 @@
  * @returns  the number of elements contained in the receiver.
  */
 public int size() {
-	return size;
+  return size;
 }
 /**
  * Returns a list which is a concatenation of <code>times</code> times the receiver.
  * @param times the number of times the receiver shall be copied.
  */
 public AbstractShortList times(int times) {
-	AbstractShortList newList = new ShortArrayList(times*size());
-	for (int i=times; --i >= 0; ) {
-		newList.addAllOfFromTo(this,0,size()-1);
-	}
-	return newList;
+  AbstractShortList newList = new ShortArrayList(times*size());
+  for (int i=times; --i >= 0; ) {
+    newList.addAllOfFromTo(this,0,size()-1);
+  }
+  return newList;
 }
 /**
  * Returns a <code>java.util.ArrayList</code> containing all the elements in the receiver.
  */
 public java.util.ArrayList toList() {
-	int mySize = size();
-	java.util.ArrayList list = new java.util.ArrayList(mySize);
-	for (int i=0; i < mySize; i++) list.add(new Short(get(i)));
-	return list;
+  int mySize = size();
+  java.util.ArrayList list = new java.util.ArrayList(mySize);
+  for (int i=0; i < mySize; i++) list.add(new Short(get(i)));
+  return list;
 }
 /**
 * Returns a string representation of the receiver, containing
 * the String representation of each element.
 */
 public String toString() {
-	return org.apache.mahout.matrix.Arrays.toString(partFromTo(0, size()-1).elements());
+  return org.apache.mahout.matrix.Arrays.toString(partFromTo(0, size()-1).elements());
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/list/AbstractByteList.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/list/AbstractByteList.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/list/AbstractByteList.java	(working copy)
@@ -19,13 +19,13 @@
  */
 @Deprecated
 public abstract class AbstractByteList extends AbstractList {
-	/**
-	 * The size of the list.
-	 * This is a READ_ONLY variable for all methods but setSizeRaw(int newSize) !!!
-	 * If you violate this principle in subclasses, you should exactly know what you are doing.
-	 * @serial
-	 */
-	protected int size;
+  /**
+   * The size of the list.
+   * This is a READ_ONLY variable for all methods but setSizeRaw(int newSize) !!!
+   * If you violate this principle in subclasses, you should exactly know what you are doing.
+   * @serial
+   */
+  protected int size;
 /**
  * Makes this class non instantiable, but still let's others inherit from it.
  */
@@ -36,7 +36,7 @@
  * @param element element to be appended to this list.
  */
 public void add(byte element) {
-	beforeInsert(size,element);
+  beforeInsert(size,element);
 }
 /**
  * Appends the part of the specified list between <code>from</code> (inclusive) and <code>to</code> (inclusive) to the receiver.
@@ -47,7 +47,7 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>other.size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=other.size())</tt>).
  */
 public void addAllOfFromTo(AbstractByteList other, int from, int to) {
-	beforeInsertAllOfFromTo(size,other,from,to);
+  beforeInsertAllOfFromTo(size,other,from,to);
 }
 /**
  * Inserts the specified element before the specified position into the receiver. 
@@ -59,8 +59,8 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>index &lt; 0 || index &gt; size()</tt>).
  */
 public void beforeInsert(int index, byte element) {
-	beforeInsertDummies(index,1);
-	set(index,element);
+  beforeInsertDummies(index,1);
+  set(index,element);
 }
 /**
  * Inserts the part of the specified list between <code>otherFrom</code> (inclusive) and <code>otherTo</code> (inclusive) before the specified position into the receiver. 
@@ -75,9 +75,9 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>index &lt; 0 || index &gt; size()</tt>).
  */
 public void beforeInsertAllOfFromTo(int index, AbstractByteList other, int from, int to) {
-	int length=to-from+1;
-	this.beforeInsertDummies(index, length);
-	this.replaceFromToWithFrom(index, index+length-1, other, from);
+  int length=to-from+1;
+  this.beforeInsertDummies(index, length);
+  this.replaceFromToWithFrom(index, index+length-1, other, from);
 }
 /**
  * Inserts <tt>length</tt> dummy elements before the specified position into the receiver. 
@@ -90,13 +90,13 @@
  * @throws IndexOutOfBoundsException if <tt>index &lt; 0 || index &gt; size()</tt>.
  */
 protected void beforeInsertDummies(int index, int length) {
-	if (index > size || index < 0) 
-		throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
-	if (length > 0) {
-		ensureCapacity(size + length);
-		setSizeRaw(size + length);
-		replaceFromToWithFrom(index+length,size-1,this,index);
-	}
+  if (index > size || index < 0) 
+    throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
+  if (length > 0) {
+    ensureCapacity(size + length);
+    setSizeRaw(size + length);
+    replaceFromToWithFrom(index+length,size-1,this,index);
+  }
 }
 /**
  * Searches the receiver for the specified value using
@@ -109,17 +109,17 @@
  *
  * @param key the value to be searched for.
  * @return index of the search key, if it is contained in the receiver;
- *	       otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
- *	       point</i> is defined as the the point at which the value would
- * 	       be inserted into the receiver: the index of the first
- *	       element greater than the key, or <tt>receiver.size()</tt>, if all
- *	       elements in the receiver are less than the specified key.  Note
- *	       that this guarantees that the return value will be &gt;= 0 if
- *	       and only if the key is found.
+ *         otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
+ *         point</i> is defined as the the point at which the value would
+ *          be inserted into the receiver: the index of the first
+ *         element greater than the key, or <tt>receiver.size()</tt>, if all
+ *         elements in the receiver are less than the specified key.  Note
+ *         that this guarantees that the return value will be &gt;= 0 if
+ *         and only if the key is found.
  * @see java.util.Arrays
  */
 public int binarySearch(byte key) {
-	return this.binarySearchFromTo(key, 0, size-1);
+  return this.binarySearchFromTo(key, 0, size-1);
 }
 /**
  * Searches the receiver for the specified value using
@@ -134,27 +134,27 @@
  * @param from the leftmost search position, inclusive.
  * @param to the rightmost search position, inclusive.
  * @return index of the search key, if it is contained in the receiver;
- *	       otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
- *	       point</i> is defined as the the point at which the value would
- * 	       be inserted into the receiver: the index of the first
- *	       element greater than the key, or <tt>receiver.size()</tt>, if all
- *	       elements in the receiver are less than the specified key.  Note
- *	       that this guarantees that the return value will be &gt;= 0 if
- *	       and only if the key is found.
+ *         otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
+ *         point</i> is defined as the the point at which the value would
+ *          be inserted into the receiver: the index of the first
+ *         element greater than the key, or <tt>receiver.size()</tt>, if all
+ *         elements in the receiver are less than the specified key.  Note
+ *         that this guarantees that the return value will be &gt;= 0 if
+ *         and only if the key is found.
  * @see java.util.Arrays
  */
 public int binarySearchFromTo(byte key, int from, int to) {
-	int low=from;
-	int high=to;
-	while (low <= high) {
-		int mid =(low + high)/2;
-		byte midVal = get(mid);
+  int low=from;
+  int high=to;
+  while (low <= high) {
+    int mid =(low + high)/2;
+    byte midVal = get(mid);
 
-		if (midVal < key) low = mid + 1;
-		else if (midVal > key) high = mid - 1;
-		else return mid; // key found
-	}
-	return -(low + 1);  // key not found.
+    if (midVal < key) low = mid + 1;
+    else if (midVal > key) high = mid - 1;
+    else return mid; // key found
+  }
+  return -(low + 1);  // key not found.
 }
 /**
  * Returns a deep copy of the receiver. 
@@ -162,7 +162,7 @@
  * @return  a deep copy of the receiver.
  */
 public Object clone() {
-	return partFromTo(0,size-1);
+  return partFromTo(0,size-1);
 }
 /**
  * Returns true if the receiver contains the specified element.
@@ -170,7 +170,7 @@
  * @param element element whose presence in the receiver is to be tested.
  */
 public boolean contains(byte elem) {
-	return indexOfFromTo(elem,0,size-1) >=0;
+  return indexOfFromTo(elem,0,size-1) >=0;
 }
 /**
  * Deletes the first element from the receiver that is identical to the specified element.
@@ -179,8 +179,8 @@
  * @param element the element to be deleted.
  */
 public void delete(byte element) {
-	int index = indexOfFromTo(element, 0, size-1);
-	if (index>=0) remove(index);
+  int index = indexOfFromTo(element, 0, size-1);
+  if (index>=0) remove(index);
 }
 /**
  * Returns the elements currently stored, possibly including invalid elements between size and capacity.
@@ -191,9 +191,9 @@
  * @return the elements currently stored.
  */
 public byte[] elements() {
-	byte[] myElements = new byte[size];
-	for (int i=size; --i >= 0; ) myElements[i]=getQuick(i);
-	return myElements;
+  byte[] myElements = new byte[size];
+  for (int i=size; --i >= 0; ) myElements[i]=getQuick(i);
+  return myElements;
 }
 /**
  * Sets the receiver's elements to be the specified array.
@@ -205,9 +205,9 @@
  * @return the receiver itself.
  */
 public AbstractByteList elements(byte[] elements) {
-	clear();
-	addAllOfFromTo(new ByteArrayList(elements),0,elements.length-1);
-	return this;
+  clear();
+  addAllOfFromTo(new ByteArrayList(elements),0,elements.length-1);
+  return this;
 }
 /**
  * Ensures that the receiver can hold at least the specified number of elements without needing to allocate new internal memory.
@@ -227,16 +227,16 @@
  * @return true if the specified Object is equal to the receiver.
  */
 public boolean equals(Object otherObj) { //delta
-	if (! (otherObj instanceof AbstractByteList)) {return false;}
-	if (this==otherObj) return true;
-	if (otherObj==null) return false;
-	AbstractByteList other = (AbstractByteList) otherObj;
-	if (size()!=other.size()) return false;
+  if (! (otherObj instanceof AbstractByteList)) {return false;}
+  if (this==otherObj) return true;
+  if (otherObj==null) return false;
+  AbstractByteList other = (AbstractByteList) otherObj;
+  if (size()!=other.size()) return false;
 
-	for (int i=size(); --i >= 0; ) {
-	    if (getQuick(i) != other.getQuick(i)) return false;
-	}
-	return true;
+  for (int i=size(); --i >= 0; ) {
+      if (getQuick(i) != other.getQuick(i)) return false;
+  }
+  return true;
 }
 /**
  * Sets the specified range of elements in the specified array to the specified value.
@@ -246,8 +246,8 @@
  * @param val the value to be stored in the specified elements of the receiver.
  */
 public void fillFromToWith(int from, int to, byte val) {
-	checkRangeFromTo(from,to,this.size);
-	for (int i=from; i<=to;) setQuick(i++,val); 
+  checkRangeFromTo(from,to,this.size);
+  for (int i=from; i<=to;) setQuick(i++,val); 
 }
 /**
  * Applies a procedure to each element of the receiver, if any.
@@ -256,20 +256,20 @@
  * @return <tt>false</tt> if the procedure stopped before all elements where iterated over, <tt>true</tt> otherwise. 
  */
 public boolean forEach(ByteProcedure procedure) {
-	for (int i=0; i<size;) if (! procedure.apply(get(i++))) return false;
-	return true;
+  for (int i=0; i<size;) if (! procedure.apply(get(i++))) return false;
+  return true;
 }
 /**
  * Returns the element at the specified position in the receiver.
  *
  * @param index index of element to return.
  * @throws IndexOutOfBoundsException index is out of range (index
- * 		  &lt; 0 || index &gt;= size()).
+ *       &lt; 0 || index &gt;= size()).
  */
 public byte get(int index) {
-	if (index >= size || index < 0)
-		throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
-	return getQuick(index);
+  if (index >= size || index < 0)
+    throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
+  return getQuick(index);
 }
 /**
  * Returns the element at the specified position in the receiver; <b>WARNING:</b> Does not check preconditions. 
@@ -291,7 +291,7 @@
  * @return  the index of the first occurrence of the element in the receiver; returns <code>-1</code> if the element is not found.
  */
 public int indexOf(byte element) { //delta
-	return indexOfFromTo(element, 0, size-1);
+  return indexOfFromTo(element, 0, size-1);
 }
 /**
  * Returns the index of the first occurrence of the specified
@@ -306,12 +306,12 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public int indexOfFromTo(byte element, int from, int to) {
-	checkRangeFromTo(from, to, size);
+  checkRangeFromTo(from, to, size);
 
-	for (int i = from ; i <= to; i++) {
-	    if (element==getQuick(i)) return i; //found
-	}
-	return -1; //not found
+  for (int i = from ; i <= to; i++) {
+      if (element==getQuick(i)) return i; //found
+  }
+  return -1; //not found
 }
 /**
  * Returns the index of the last occurrence of the specified
@@ -321,7 +321,7 @@
  * @return  the index of the last occurrence of the element in the receiver; returns <code>-1</code> if the element is not found.
  */
 public int lastIndexOf(byte element) {
-	return lastIndexOfFromTo(element, 0, size-1);
+  return lastIndexOfFromTo(element, 0, size-1);
 }
 /**
  * Returns the index of the last occurrence of the specified
@@ -336,12 +336,12 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public int lastIndexOfFromTo(byte element, int from, int to) {
-	checkRangeFromTo(from, to, size());
+  checkRangeFromTo(from, to, size());
 
-	for (int i = to ; i >= from; i--) {
-	    if (element==getQuick(i)) return i; //found
-	}
-	return -1; //not found
+  for (int i = to ; i >= from; i--) {
+      if (element==getQuick(i)) return i; //found
+  }
+  return -1; //not found
 }
 /**
  * Sorts the specified range of the receiver into ascending order. 
@@ -360,13 +360,13 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public void mergeSortFromTo(int from, int to) {
-	int mySize = size();
-	checkRangeFromTo(from, to, mySize);
-	
-	byte[] myElements = elements();
-	org.apache.mahout.matrix.Sorting.mergeSort(myElements, from, to+1);
-	elements(myElements);
-	setSizeRaw(mySize);
+  int mySize = size();
+  checkRangeFromTo(from, to, mySize);
+  
+  byte[] myElements = elements();
+  org.apache.mahout.matrix.Sorting.mergeSort(myElements, from, to+1);
+  elements(myElements);
+  setSizeRaw(mySize);
 }
 /**
  * Sorts the receiver according
@@ -390,21 +390,21 @@
  * @param to the index of the last element (inclusive) to be sorted.
  * @param c the comparator to determine the order of the receiver.
  * @throws ClassCastException if the array contains elements that are not
- *	       <i>mutually comparable</i> using the specified comparator.
+ *         <i>mutually comparable</i> using the specified comparator.
  * @throws IllegalArgumentException if <tt>fromIndex &gt; toIndex</tt>
  * @throws ArrayIndexOutOfBoundsException if <tt>fromIndex &lt; 0</tt> or
- *	       <tt>toIndex &gt; a.length</tt>
+ *         <tt>toIndex &gt; a.length</tt>
  * @see Comparator
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public void mergeSortFromTo(int from, int to, ByteComparator c) {
-	int mySize = size();
-	checkRangeFromTo(from, to, mySize);
-	
-	byte[] myElements = elements();
-	org.apache.mahout.matrix.Sorting.mergeSort(myElements, from, to+1, c);
-	elements(myElements);
-	setSizeRaw(mySize);
+  int mySize = size();
+  checkRangeFromTo(from, to, mySize);
+  
+  byte[] myElements = elements();
+  org.apache.mahout.matrix.Sorting.mergeSort(myElements, from, to+1, c);
+  elements(myElements);
+  setSizeRaw(mySize);
 }
 /**
  * Returns a new list of the part of the receiver between <code>from</code>, inclusive, and <code>to</code>, inclusive.
@@ -414,12 +414,12 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public AbstractByteList partFromTo(int from, int to) {
-	checkRangeFromTo(from, to, size);
+  checkRangeFromTo(from, to, size);
 
-	int length = to-from+1;
-	ByteArrayList part = new ByteArrayList(length);
-	part.addAllOfFromTo(this,from,to);
-	return part;
+  int length = to-from+1;
+  ByteArrayList part = new ByteArrayList(length);
+  part.addAllOfFromTo(this,from,to);
+  return part;
 }
 /**
  * Sorts the specified range of the receiver into
@@ -438,13 +438,13 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public void quickSortFromTo(int from, int to) {
-	int mySize = size();
-	checkRangeFromTo(from, to, mySize);
-	
-	byte[] myElements = elements();
-	java.util.Arrays.sort(myElements, from, to+1);
-	elements(myElements);
-	setSizeRaw(mySize);
+  int mySize = size();
+  checkRangeFromTo(from, to, mySize);
+  
+  byte[] myElements = elements();
+  java.util.Arrays.sort(myElements, from, to+1);
+  elements(myElements);
+  setSizeRaw(mySize);
 }
 /**
  * Sorts the receiver according
@@ -466,21 +466,21 @@
  * @param to the index of the last element (inclusive) to be sorted.
  * @param c the comparator to determine the order of the receiver.
  * @throws ClassCastException if the array contains elements that are not
- *	       <i>mutually comparable</i> using the specified comparator.
+ *         <i>mutually comparable</i> using the specified comparator.
  * @throws IllegalArgumentException if <tt>fromIndex &gt; toIndex</tt>
  * @throws ArrayIndexOutOfBoundsException if <tt>fromIndex &lt; 0</tt> or
- *	       <tt>toIndex &gt; a.length</tt>
+ *         <tt>toIndex &gt; a.length</tt>
  * @see Comparator
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public void quickSortFromTo(int from, int to, ByteComparator c) {
-	int mySize = size();
-	checkRangeFromTo(from, to, mySize);
-	
-	byte[] myElements = elements();
-	org.apache.mahout.matrix.Sorting.quickSort(myElements, from, to+1,c);
-	elements(myElements);
-	setSizeRaw(mySize);
+  int mySize = size();
+  checkRangeFromTo(from, to, mySize);
+  
+  byte[] myElements = elements();
+  org.apache.mahout.matrix.Sorting.quickSort(myElements, from, to+1,c);
+  elements(myElements);
+  setSizeRaw(mySize);
 }
 /**
 * Removes from the receiver all elements that are contained in the specified list.
@@ -490,17 +490,17 @@
 * @return <code>true</code> if the receiver changed as a result of the call.
 */
 public boolean removeAll(AbstractByteList other) {
-	if (other.size()==0) return false; //nothing to do
-	int limit = other.size()-1;
-	int j=0;
+  if (other.size()==0) return false; //nothing to do
+  int limit = other.size()-1;
+  int j=0;
 
-	for (int i=0; i<size ; i++) {
-		if (other.indexOfFromTo(getQuick(i), 0, limit) < 0) setQuick(j++,getQuick(i));
-	}
+  for (int i=0; i<size ; i++) {
+    if (other.indexOfFromTo(getQuick(i), 0, limit) < 0) setQuick(j++,getQuick(i));
+  }
 
-	boolean modified = (j!=size);
-	setSize(j);
-	return modified;
+  boolean modified = (j!=size);
+  setSize(j);
+  return modified;
 }
 /**
  * Removes from the receiver all elements whose index is between
@@ -513,14 +513,14 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public void removeFromTo(int from, int to) {
-	checkRangeFromTo(from, to, size);
-	int numMoved = size - to - 1;
-	if (numMoved > 0) {
-		replaceFromToWithFrom(from, from-1+numMoved, this, to+1);
-		//fillFromToWith(from+numMoved, size-1, 0.0f); //delta
-	}
-	int width = to-from+1;
-	if (width>0) setSizeRaw(size-width);
+  checkRangeFromTo(from, to, size);
+  int numMoved = size - to - 1;
+  if (numMoved > 0) {
+    replaceFromToWithFrom(from, from-1+numMoved, this, to+1);
+    //fillFromToWith(from+numMoved, size-1, 0.0f); //delta
+  }
+  int width = to-from+1;
+  if (width>0) setSizeRaw(size-width);
 }
 /**
  * Replaces a number of elements in the receiver with the same number of elements of another list.
@@ -533,22 +533,22 @@
  * @param otherFrom position of first element within other list to be copied.
  */
 public void replaceFromToWithFrom(int from, int to, AbstractByteList other, int otherFrom) {
-	int length=to-from+1;
-	if (length>0) {
-		checkRangeFromTo(from, to, size());
-		checkRangeFromTo(otherFrom,otherFrom+length-1,other.size());
+  int length=to-from+1;
+  if (length>0) {
+    checkRangeFromTo(from, to, size());
+    checkRangeFromTo(otherFrom,otherFrom+length-1,other.size());
 
-		// unambiguous copy (it may hold other==this)
-		if (from<=otherFrom) {
-			for (; --length >= 0; ) setQuick(from++,other.getQuick(otherFrom++));
-		}
-		else {
-			int otherTo = otherFrom+length-1;
-			for (; --length >= 0; ) setQuick(to--,other.getQuick(otherTo--));
-		}
+    // unambiguous copy (it may hold other==this)
+    if (from<=otherFrom) {
+      for (; --length >= 0; ) setQuick(from++,other.getQuick(otherFrom++));
+    }
+    else {
+      int otherTo = otherFrom+length-1;
+      for (; --length >= 0; ) setQuick(to--,other.getQuick(otherTo--));
+    }
 
-			
-	}
+      
+  }
 }
 /**
 * Replaces the part between <code>from</code> (inclusive) and <code>to</code> (inclusive) with the other list's
@@ -594,36 +594,36 @@
 * </pre>
 */
 public void replaceFromToWithFromTo(int from, int to, AbstractByteList other, int otherFrom, int otherTo) {
-	if (otherFrom>otherTo) {
-		throw new IndexOutOfBoundsException("otherFrom: "+otherFrom+", otherTo: "+otherTo);
-	}
+  if (otherFrom>otherTo) {
+    throw new IndexOutOfBoundsException("otherFrom: "+otherFrom+", otherTo: "+otherTo);
+  }
 
-	if (this==other && to-from!=otherTo-otherFrom) { // avoid stumbling over my own feet
-		replaceFromToWithFromTo(from, to, partFromTo(otherFrom, otherTo), 0, otherTo-otherFrom);
-		return;
-	}
-	
-	int length=otherTo-otherFrom+1;
-	int diff=length;
-	int theLast=from-1;
+  if (this==other && to-from!=otherTo-otherFrom) { // avoid stumbling over my own feet
+    replaceFromToWithFromTo(from, to, partFromTo(otherFrom, otherTo), 0, otherTo-otherFrom);
+    return;
+  }
+  
+  int length=otherTo-otherFrom+1;
+  int diff=length;
+  int theLast=from-1;
 
-	if (to>=from) {
-		diff -= (to-from+1);
-		theLast=to;
-	}
-	
-	if (diff>0) {
-		beforeInsertDummies(theLast+1, diff);
-	}
-	else {
-		if (diff<0) {
-			removeFromTo(theLast+diff, theLast-1);
-		}
-	}
+  if (to>=from) {
+    diff -= (to-from+1);
+    theLast=to;
+  }
+  
+  if (diff>0) {
+    beforeInsertDummies(theLast+1, diff);
+  }
+  else {
+    if (diff<0) {
+      removeFromTo(theLast+diff, theLast-1);
+    }
+  }
 
-	if (length>0) {
-		replaceFromToWithFrom(from,from+length-1,other,otherFrom);
-	}
+  if (length>0) {
+    replaceFromToWithFrom(from,from+length-1,other,otherFrom);
+  }
 }
 /**
  * Replaces the part of the receiver starting at <code>from</code> (inclusive) with all the elements of the specified collection.
@@ -635,12 +635,12 @@
  * @exception IndexOutOfBoundsException index is out of range (index &lt; 0 || index &gt;= size()).
  */
 public void replaceFromWith(int from, java.util.Collection other) {
-	checkRange(from,size());
-	java.util.Iterator e = other.iterator();
-	int index=from;
-	int limit = Math.min(size()-from, other.size());
-	for (int i=0; i<limit; i++)
-	    set(index++,((Number) e.next()).byteValue()); //delta
+  checkRange(from,size());
+  java.util.Iterator e = other.iterator();
+  int index=from;
+  int limit = Math.min(size()-from, other.size());
+  for (int i=0; i<limit; i++)
+      set(index++,((Number) e.next()).byteValue()); //delta
 }
 /**
 * Retains (keeps) only the elements in the receiver that are contained in the specified other list.
@@ -650,36 +650,36 @@
 * @return <code>true</code> if the receiver changed as a result of the call.
 */
 public boolean retainAll(AbstractByteList other) {
-	if (other.size()==0) {
-		if (size==0) return false;
-		setSize(0);
-		return true;
-	}
-	
-	int limit = other.size()-1;
-	int j=0;
-	for (int i=0; i<size ; i++) {
-		if (other.indexOfFromTo(getQuick(i), 0, limit) >= 0) setQuick(j++, getQuick(i));
-	}
+  if (other.size()==0) {
+    if (size==0) return false;
+    setSize(0);
+    return true;
+  }
+  
+  int limit = other.size()-1;
+  int j=0;
+  for (int i=0; i<size ; i++) {
+    if (other.indexOfFromTo(getQuick(i), 0, limit) >= 0) setQuick(j++, getQuick(i));
+  }
 
-	boolean modified = (j!=size);
-	setSize(j);
-	return modified;
+  boolean modified = (j!=size);
+  setSize(j);
+  return modified;
 }
 /**
  * Reverses the elements of the receiver.
  * Last becomes first, second last becomes second first, and so on.
  */
 public void reverse() {
-	byte tmp;
-	int limit=size()/2;
-	int j=size()-1;
+  byte tmp;
+  int limit=size()/2;
+  int j=size()-1;
 
-	for (int i=0; i<limit;) { //swap
-		tmp=getQuick(i);
-		setQuick(i++,getQuick(j));
-		setQuick(j--,tmp);
-	}
+  for (int i=0; i<limit;) { //swap
+    tmp=getQuick(i);
+    setQuick(i++,getQuick(j));
+    setQuick(j--,tmp);
+  }
 }
 /**
  * Replaces the element at the specified position in the receiver with the specified element.
@@ -689,9 +689,9 @@
  * @exception IndexOutOfBoundsException if <tt>index &lt; 0 || index &gt;= size()</tt>.
  */
 public void set(int index, byte element) {
-	if (index >= size || index < 0)
-		throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
-	setQuick(index,element);
+  if (index >= size || index < 0)
+    throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
+  setQuick(index,element);
 }
 /**
  * Replaces the element at the specified position in the receiver with the specified element; <b>WARNING:</b> Does not check preconditions.
@@ -722,7 +722,7 @@
  * }
  */
 protected void setSizeRaw(int newSize) {
-	size = newSize;
+  size = newSize;
 }
 /**
  * Randomly permutes the part of the receiver between <code>from</code> (inclusive) and <code>to</code> (inclusive). 
@@ -731,17 +731,17 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public void shuffleFromTo(int from, int to) {
-	checkRangeFromTo(from, to, size());
-	
-	org.apache.mahout.jet.random.Uniform gen = new org.apache.mahout.jet.random.Uniform(new org.apache.mahout.jet.random.engine.DRand(new java.util.Date()));
-	for (int i=from; i<to; i++) { 
-		int random = gen.nextIntFromTo(i, to);
+  checkRangeFromTo(from, to, size());
+  
+  org.apache.mahout.jet.random.Uniform gen = new org.apache.mahout.jet.random.Uniform(new org.apache.mahout.jet.random.engine.DRand(new java.util.Date()));
+  for (int i=from; i<to; i++) { 
+    int random = gen.nextIntFromTo(i, to);
 
-		//swap(i, random)
-		byte tmpElement = getQuick(random);
-		setQuick(random,getQuick(i)); 
-		setQuick(i,tmpElement); 
-	}  
+    //swap(i, random)
+    byte tmpElement = getQuick(random);
+    setQuick(random,getQuick(i)); 
+    setQuick(i,tmpElement); 
+  }  
 }
 /**
  * Returns the number of elements contained in the receiver.
@@ -749,33 +749,33 @@
  * @returns  the number of elements contained in the receiver.
  */
 public int size() {
-	return size;
+  return size;
 }
 /**
  * Returns a list which is a concatenation of <code>times</code> times the receiver.
  * @param times the number of times the receiver shall be copied.
  */
 public AbstractByteList times(int times) {
-	AbstractByteList newList = new ByteArrayList(times*size());
-	for (int i=times; --i >= 0; ) {
-		newList.addAllOfFromTo(this,0,size()-1);
-	}
-	return newList;
+  AbstractByteList newList = new ByteArrayList(times*size());
+  for (int i=times; --i >= 0; ) {
+    newList.addAllOfFromTo(this,0,size()-1);
+  }
+  return newList;
 }
 /**
  * Returns a <code>java.util.ArrayList</code> containing all the elements in the receiver.
  */
 public java.util.ArrayList toList() {
-	int mySize = size();
-	java.util.ArrayList list = new java.util.ArrayList(mySize);
-	for (int i=0; i < mySize; i++) list.add(new Byte(get(i)));
-	return list;
+  int mySize = size();
+  java.util.ArrayList list = new java.util.ArrayList(mySize);
+  for (int i=0; i < mySize; i++) list.add(new Byte(get(i)));
+  return list;
 }
 /**
 * Returns a string representation of the receiver, containing
 * the String representation of each element.
 */
 public String toString() {
-	return org.apache.mahout.matrix.Arrays.toString(partFromTo(0, size()-1).elements());
+  return org.apache.mahout.matrix.Arrays.toString(partFromTo(0, size()-1).elements());
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/list/AbstractFloatList.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/list/AbstractFloatList.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/list/AbstractFloatList.java	(working copy)
@@ -19,13 +19,13 @@
  */
 @Deprecated
 public abstract class AbstractFloatList extends AbstractList {
-	/**
-	 * The size of the list.
-	 * This is a READ_ONLY variable for all methods but setSizeRaw(int newSize) !!!
-	 * If you violate this principle in subclasses, you should exactly know what you are doing.
-	 * @serial
-	 */
-	protected int size;
+  /**
+   * The size of the list.
+   * This is a READ_ONLY variable for all methods but setSizeRaw(int newSize) !!!
+   * If you violate this principle in subclasses, you should exactly know what you are doing.
+   * @serial
+   */
+  protected int size;
 /**
  * Makes this class non instantiable, but still let's others inherit from it.
  */
@@ -36,7 +36,7 @@
  * @param element element to be appended to this list.
  */
 public void add(float element) {
-	beforeInsert(size,element);
+  beforeInsert(size,element);
 }
 /**
  * Appends the part of the specified list between <code>from</code> (inclusive) and <code>to</code> (inclusive) to the receiver.
@@ -47,7 +47,7 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>other.size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=other.size())</tt>).
  */
 public void addAllOfFromTo(AbstractFloatList other, int from, int to) {
-	beforeInsertAllOfFromTo(size,other,from,to);
+  beforeInsertAllOfFromTo(size,other,from,to);
 }
 /**
  * Inserts the specified element before the specified position into the receiver. 
@@ -59,8 +59,8 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>index &lt; 0 || index &gt; size()</tt>).
  */
 public void beforeInsert(int index, float element) {
-	beforeInsertDummies(index,1);
-	set(index,element);
+  beforeInsertDummies(index,1);
+  set(index,element);
 }
 /**
  * Inserts the part of the specified list between <code>otherFrom</code> (inclusive) and <code>otherTo</code> (inclusive) before the specified position into the receiver. 
@@ -75,9 +75,9 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>index &lt; 0 || index &gt; size()</tt>).
  */
 public void beforeInsertAllOfFromTo(int index, AbstractFloatList other, int from, int to) {
-	int length=to-from+1;
-	this.beforeInsertDummies(index, length);
-	this.replaceFromToWithFrom(index, index+length-1, other, from);
+  int length=to-from+1;
+  this.beforeInsertDummies(index, length);
+  this.replaceFromToWithFrom(index, index+length-1, other, from);
 }
 /**
  * Inserts <tt>length</tt> dummy elements before the specified position into the receiver. 
@@ -90,13 +90,13 @@
  * @throws IndexOutOfBoundsException if <tt>index &lt; 0 || index &gt; size()</tt>.
  */
 protected void beforeInsertDummies(int index, int length) {
-	if (index > size || index < 0) 
-		throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
-	if (length > 0) {
-		ensureCapacity(size + length);
-		setSizeRaw(size + length);
-		replaceFromToWithFrom(index+length,size-1,this,index);
-	}
+  if (index > size || index < 0) 
+    throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
+  if (length > 0) {
+    ensureCapacity(size + length);
+    setSizeRaw(size + length);
+    replaceFromToWithFrom(index+length,size-1,this,index);
+  }
 }
 /**
  * Searches the receiver for the specified value using
@@ -109,17 +109,17 @@
  *
  * @param key the value to be searched for.
  * @return index of the search key, if it is contained in the receiver;
- *	       otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
- *	       point</i> is defined as the the point at which the value would
- * 	       be inserted into the receiver: the index of the first
- *	       element greater than the key, or <tt>receiver.size()</tt>, if all
- *	       elements in the receiver are less than the specified key.  Note
- *	       that this guarantees that the return value will be &gt;= 0 if
- *	       and only if the key is found.
+ *         otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
+ *         point</i> is defined as the the point at which the value would
+ *          be inserted into the receiver: the index of the first
+ *         element greater than the key, or <tt>receiver.size()</tt>, if all
+ *         elements in the receiver are less than the specified key.  Note
+ *         that this guarantees that the return value will be &gt;= 0 if
+ *         and only if the key is found.
  * @see java.util.Arrays
  */
 public int binarySearch(float key) {
-	return this.binarySearchFromTo(key, 0, size-1);
+  return this.binarySearchFromTo(key, 0, size-1);
 }
 /**
  * Searches the receiver for the specified value using
@@ -134,27 +134,27 @@
  * @param from the leftmost search position, inclusive.
  * @param to the rightmost search position, inclusive.
  * @return index of the search key, if it is contained in the receiver;
- *	       otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
- *	       point</i> is defined as the the point at which the value would
- * 	       be inserted into the receiver: the index of the first
- *	       element greater than the key, or <tt>receiver.size()</tt>, if all
- *	       elements in the receiver are less than the specified key.  Note
- *	       that this guarantees that the return value will be &gt;= 0 if
- *	       and only if the key is found.
+ *         otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
+ *         point</i> is defined as the the point at which the value would
+ *          be inserted into the receiver: the index of the first
+ *         element greater than the key, or <tt>receiver.size()</tt>, if all
+ *         elements in the receiver are less than the specified key.  Note
+ *         that this guarantees that the return value will be &gt;= 0 if
+ *         and only if the key is found.
  * @see java.util.Arrays
  */
 public int binarySearchFromTo(float key, int from, int to) {
-	int low=from;
-	int high=to;
-	while (low <= high) {
-		int mid =(low + high)/2;
-		float midVal = get(mid);
+  int low=from;
+  int high=to;
+  while (low <= high) {
+    int mid =(low + high)/2;
+    float midVal = get(mid);
 
-		if (midVal < key) low = mid + 1;
-		else if (midVal > key) high = mid - 1;
-		else return mid; // key found
-	}
-	return -(low + 1);  // key not found.
+    if (midVal < key) low = mid + 1;
+    else if (midVal > key) high = mid - 1;
+    else return mid; // key found
+  }
+  return -(low + 1);  // key not found.
 }
 /**
  * Returns a deep copy of the receiver. 
@@ -162,7 +162,7 @@
  * @return  a deep copy of the receiver.
  */
 public Object clone() {
-	return partFromTo(0,size-1);
+  return partFromTo(0,size-1);
 }
 /**
  * Returns true if the receiver contains the specified element.
@@ -170,7 +170,7 @@
  * @param element element whose presence in the receiver is to be tested.
  */
 public boolean contains(float elem) {
-	return indexOfFromTo(elem,0,size-1) >=0;
+  return indexOfFromTo(elem,0,size-1) >=0;
 }
 /**
  * Deletes the first element from the receiver that is identical to the specified element.
@@ -179,8 +179,8 @@
  * @param element the element to be deleted.
  */
 public void delete(float element) {
-	int index = indexOfFromTo(element, 0, size-1);
-	if (index>=0) remove(index);
+  int index = indexOfFromTo(element, 0, size-1);
+  if (index>=0) remove(index);
 }
 /**
  * Returns the elements currently stored, possibly including invalid elements between size and capacity.
@@ -191,9 +191,9 @@
  * @return the elements currently stored.
  */
 public float[] elements() {
-	float[] myElements = new float[size];
-	for (int i=size; --i >= 0; ) myElements[i]=getQuick(i);
-	return myElements;
+  float[] myElements = new float[size];
+  for (int i=size; --i >= 0; ) myElements[i]=getQuick(i);
+  return myElements;
 }
 /**
  * Sets the receiver's elements to be the specified array.
@@ -205,9 +205,9 @@
  * @return the receiver itself.
  */
 public AbstractFloatList elements(float[] elements) {
-	clear();
-	addAllOfFromTo(new FloatArrayList(elements),0,elements.length-1);
-	return this;
+  clear();
+  addAllOfFromTo(new FloatArrayList(elements),0,elements.length-1);
+  return this;
 }
 /**
  * Ensures that the receiver can hold at least the specified number of elements without needing to allocate new internal memory.
@@ -227,16 +227,16 @@
  * @return true if the specified Object is equal to the receiver.
  */
 public boolean equals(Object otherObj) { //delta
-	if (! (otherObj instanceof AbstractFloatList)) {return false;}
-	if (this==otherObj) return true;
-	if (otherObj==null) return false;
-	AbstractFloatList other = (AbstractFloatList) otherObj;
-	if (size()!=other.size()) return false;
+  if (! (otherObj instanceof AbstractFloatList)) {return false;}
+  if (this==otherObj) return true;
+  if (otherObj==null) return false;
+  AbstractFloatList other = (AbstractFloatList) otherObj;
+  if (size()!=other.size()) return false;
 
-	for (int i=size(); --i >= 0; ) {
-	    if (getQuick(i) != other.getQuick(i)) return false;
-	}
-	return true;
+  for (int i=size(); --i >= 0; ) {
+      if (getQuick(i) != other.getQuick(i)) return false;
+  }
+  return true;
 }
 /**
  * Sets the specified range of elements in the specified array to the specified value.
@@ -246,8 +246,8 @@
  * @param val the value to be stored in the specified elements of the receiver.
  */
 public void fillFromToWith(int from, int to, float val) {
-	checkRangeFromTo(from,to,this.size);
-	for (int i=from; i<=to;) setQuick(i++,val); 
+  checkRangeFromTo(from,to,this.size);
+  for (int i=from; i<=to;) setQuick(i++,val); 
 }
 /**
  * Applies a procedure to each element of the receiver, if any.
@@ -256,20 +256,20 @@
  * @return <tt>false</tt> if the procedure stopped before all elements where iterated over, <tt>true</tt> otherwise. 
  */
 public boolean forEach(FloatProcedure procedure) {
-	for (int i=0; i<size;) if (! procedure.apply(get(i++))) return false;
-	return true;
+  for (int i=0; i<size;) if (! procedure.apply(get(i++))) return false;
+  return true;
 }
 /**
  * Returns the element at the specified position in the receiver.
  *
  * @param index index of element to return.
  * @exception IndexOutOfBoundsException index is out of range (index
- * 		  &lt; 0 || index &gt;= size()).
+ *       &lt; 0 || index &gt;= size()).
  */
 public float get(int index) {
-	if (index >= size || index < 0)
-		throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
-	return getQuick(index);
+  if (index >= size || index < 0)
+    throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
+  return getQuick(index);
 }
 /**
  * Returns the element at the specified position in the receiver; <b>WARNING:</b> Does not check preconditions. 
@@ -291,7 +291,7 @@
  * @return  the index of the first occurrence of the element in the receiver; returns <code>-1</code> if the element is not found.
  */
 public int indexOf(float element) { //delta
-	return indexOfFromTo(element, 0, size-1);
+  return indexOfFromTo(element, 0, size-1);
 }
 /**
  * Returns the index of the first occurrence of the specified
@@ -306,12 +306,12 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public int indexOfFromTo(float element, int from, int to) {
-	checkRangeFromTo(from, to, size);
+  checkRangeFromTo(from, to, size);
 
-	for (int i = from ; i <= to; i++) {
-	    if (element==getQuick(i)) return i; //found
-	}
-	return -1; //not found
+  for (int i = from ; i <= to; i++) {
+      if (element==getQuick(i)) return i; //found
+  }
+  return -1; //not found
 }
 /**
  * Returns the index of the last occurrence of the specified
@@ -321,7 +321,7 @@
  * @return  the index of the last occurrence of the element in the receiver; returns <code>-1</code> if the element is not found.
  */
 public int lastIndexOf(float element) {
-	return lastIndexOfFromTo(element, 0, size-1);
+  return lastIndexOfFromTo(element, 0, size-1);
 }
 /**
  * Returns the index of the last occurrence of the specified
@@ -336,12 +336,12 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public int lastIndexOfFromTo(float element, int from, int to) {
-	checkRangeFromTo(from, to, size());
+  checkRangeFromTo(from, to, size());
 
-	for (int i = to ; i >= from; i--) {
-	    if (element==getQuick(i)) return i; //found
-	}
-	return -1; //not found
+  for (int i = to ; i >= from; i--) {
+      if (element==getQuick(i)) return i; //found
+  }
+  return -1; //not found
 }
 /**
  * Sorts the specified range of the receiver into ascending order. 
@@ -360,13 +360,13 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public void mergeSortFromTo(int from, int to) {
-	int mySize = size();
-	checkRangeFromTo(from, to, mySize);
-	
-	float[] myElements = elements();
-	org.apache.mahout.matrix.Sorting.mergeSort(myElements, from, to+1);
-	elements(myElements);
-	setSizeRaw(mySize);
+  int mySize = size();
+  checkRangeFromTo(from, to, mySize);
+  
+  float[] myElements = elements();
+  org.apache.mahout.matrix.Sorting.mergeSort(myElements, from, to+1);
+  elements(myElements);
+  setSizeRaw(mySize);
 }
 /**
  * Sorts the receiver according
@@ -390,21 +390,21 @@
  * @param to the index of the last element (inclusive) to be sorted.
  * @param c the comparator to determine the order of the receiver.
  * @throws ClassCastException if the array contains elements that are not
- *	       <i>mutually comparable</i> using the specified comparator.
+ *         <i>mutually comparable</i> using the specified comparator.
  * @throws IllegalArgumentException if <tt>fromIndex &gt; toIndex</tt>
  * @throws ArrayIndexOutOfBoundsException if <tt>fromIndex &lt; 0</tt> or
- *	       <tt>toIndex &gt; a.length</tt>
+ *         <tt>toIndex &gt; a.length</tt>
  * @see Comparator
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public void mergeSortFromTo(int from, int to, FloatComparator c) {
-	int mySize = size();
-	checkRangeFromTo(from, to, mySize);
-	
-	float[] myElements = elements();
-	org.apache.mahout.matrix.Sorting.mergeSort(myElements, from, to+1, c);
-	elements(myElements);
-	setSizeRaw(mySize);
+  int mySize = size();
+  checkRangeFromTo(from, to, mySize);
+  
+  float[] myElements = elements();
+  org.apache.mahout.matrix.Sorting.mergeSort(myElements, from, to+1, c);
+  elements(myElements);
+  setSizeRaw(mySize);
 }
 /**
  * Returns a new list of the part of the receiver between <code>from</code>, inclusive, and <code>to</code>, inclusive.
@@ -414,12 +414,12 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public AbstractFloatList partFromTo(int from, int to) {
-	checkRangeFromTo(from, to, size);
+  checkRangeFromTo(from, to, size);
 
-	int length = to-from+1;
-	FloatArrayList part = new FloatArrayList(length);
-	part.addAllOfFromTo(this,from,to);
-	return part;
+  int length = to-from+1;
+  FloatArrayList part = new FloatArrayList(length);
+  part.addAllOfFromTo(this,from,to);
+  return part;
 }
 /**
  * Sorts the specified range of the receiver into
@@ -438,13 +438,13 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public void quickSortFromTo(int from, int to) {
-	int mySize = size();
-	checkRangeFromTo(from, to, mySize);
-	
-	float[] myElements = elements();
-	java.util.Arrays.sort(myElements, from, to+1);
-	elements(myElements);
-	setSizeRaw(mySize);
+  int mySize = size();
+  checkRangeFromTo(from, to, mySize);
+  
+  float[] myElements = elements();
+  java.util.Arrays.sort(myElements, from, to+1);
+  elements(myElements);
+  setSizeRaw(mySize);
 }
 /**
  * Sorts the receiver according
@@ -466,21 +466,21 @@
  * @param to the index of the last element (inclusive) to be sorted.
  * @param c the comparator to determine the order of the receiver.
  * @throws ClassCastException if the array contains elements that are not
- *	       <i>mutually comparable</i> using the specified comparator.
+ *         <i>mutually comparable</i> using the specified comparator.
  * @throws IllegalArgumentException if <tt>fromIndex &gt; toIndex</tt>
  * @throws ArrayIndexOutOfBoundsException if <tt>fromIndex &lt; 0</tt> or
- *	       <tt>toIndex &gt; a.length</tt>
+ *         <tt>toIndex &gt; a.length</tt>
  * @see Comparator
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public void quickSortFromTo(int from, int to, FloatComparator c) {
-	int mySize = size();
-	checkRangeFromTo(from, to, mySize);
-	
-	float[] myElements = elements();
-	org.apache.mahout.matrix.Sorting.quickSort(myElements, from, to+1,c);
-	elements(myElements);
-	setSizeRaw(mySize);
+  int mySize = size();
+  checkRangeFromTo(from, to, mySize);
+  
+  float[] myElements = elements();
+  org.apache.mahout.matrix.Sorting.quickSort(myElements, from, to+1,c);
+  elements(myElements);
+  setSizeRaw(mySize);
 }
 /**
 * Removes from the receiver all elements that are contained in the specified list.
@@ -490,17 +490,17 @@
 * @return <code>true</code> if the receiver changed as a result of the call.
 */
 public boolean removeAll(AbstractFloatList other) {
-	if (other.size()==0) return false; //nothing to do
-	int limit = other.size()-1;
-	int j=0;
+  if (other.size()==0) return false; //nothing to do
+  int limit = other.size()-1;
+  int j=0;
 
-	for (int i=0; i<size ; i++) {
-		if (other.indexOfFromTo(getQuick(i), 0, limit) < 0) setQuick(j++,getQuick(i));
-	}
+  for (int i=0; i<size ; i++) {
+    if (other.indexOfFromTo(getQuick(i), 0, limit) < 0) setQuick(j++,getQuick(i));
+  }
 
-	boolean modified = (j!=size);
-	setSize(j);
-	return modified;
+  boolean modified = (j!=size);
+  setSize(j);
+  return modified;
 }
 /**
  * Removes from the receiver all elements whose index is between
@@ -513,14 +513,14 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public void removeFromTo(int from, int to) {
-	checkRangeFromTo(from, to, size);
-	int numMoved = size - to - 1;
-	if (numMoved > 0) {
-		replaceFromToWithFrom(from, from-1+numMoved, this, to+1);
-		//fillFromToWith(from+numMoved, size-1, 0.0f); //delta
-	}
-	int width = to-from+1;
-	if (width>0) setSizeRaw(size-width);
+  checkRangeFromTo(from, to, size);
+  int numMoved = size - to - 1;
+  if (numMoved > 0) {
+    replaceFromToWithFrom(from, from-1+numMoved, this, to+1);
+    //fillFromToWith(from+numMoved, size-1, 0.0f); //delta
+  }
+  int width = to-from+1;
+  if (width>0) setSizeRaw(size-width);
 }
 /**
  * Replaces a number of elements in the receiver with the same number of elements of another list.
@@ -533,22 +533,22 @@
  * @param otherFrom position of first element within other list to be copied.
  */
 public void replaceFromToWithFrom(int from, int to, AbstractFloatList other, int otherFrom) {
-	int length=to-from+1;
-	if (length>0) {
-		checkRangeFromTo(from, to, size());
-		checkRangeFromTo(otherFrom,otherFrom+length-1,other.size());
+  int length=to-from+1;
+  if (length>0) {
+    checkRangeFromTo(from, to, size());
+    checkRangeFromTo(otherFrom,otherFrom+length-1,other.size());
 
-		// unambiguous copy (it may hold other==this)
-		if (from<=otherFrom) {
-			for (; --length >= 0; ) setQuick(from++,other.getQuick(otherFrom++));
-		}
-		else {
-			int otherTo = otherFrom+length-1;
-			for (; --length >= 0; ) setQuick(to--,other.getQuick(otherTo--));
-		}
+    // unambiguous copy (it may hold other==this)
+    if (from<=otherFrom) {
+      for (; --length >= 0; ) setQuick(from++,other.getQuick(otherFrom++));
+    }
+    else {
+      int otherTo = otherFrom+length-1;
+      for (; --length >= 0; ) setQuick(to--,other.getQuick(otherTo--));
+    }
 
-			
-	}
+      
+  }
 }
 /**
 * Replaces the part between <code>from</code> (inclusive) and <code>to</code> (inclusive) with the other list's
@@ -594,36 +594,36 @@
 * </pre>
 */
 public void replaceFromToWithFromTo(int from, int to, AbstractFloatList other, int otherFrom, int otherTo) {
-	if (otherFrom>otherTo) {
-		throw new IndexOutOfBoundsException("otherFrom: "+otherFrom+", otherTo: "+otherTo);
-	}
+  if (otherFrom>otherTo) {
+    throw new IndexOutOfBoundsException("otherFrom: "+otherFrom+", otherTo: "+otherTo);
+  }
 
-	if (this==other && to-from!=otherTo-otherFrom) { // avoid stumbling over my own feet
-		replaceFromToWithFromTo(from, to, partFromTo(otherFrom, otherTo), 0, otherTo-otherFrom);
-		return;
-	}
-	
-	int length=otherTo-otherFrom+1;
-	int diff=length;
-	int theLast=from-1;
+  if (this==other && to-from!=otherTo-otherFrom) { // avoid stumbling over my own feet
+    replaceFromToWithFromTo(from, to, partFromTo(otherFrom, otherTo), 0, otherTo-otherFrom);
+    return;
+  }
+  
+  int length=otherTo-otherFrom+1;
+  int diff=length;
+  int theLast=from-1;
 
-	if (to>=from) {
-		diff -= (to-from+1);
-		theLast=to;
-	}
-	
-	if (diff>0) {
-		beforeInsertDummies(theLast+1, diff);
-	}
-	else {
-		if (diff<0) {
-			removeFromTo(theLast+diff, theLast-1);
-		}
-	}
+  if (to>=from) {
+    diff -= (to-from+1);
+    theLast=to;
+  }
+  
+  if (diff>0) {
+    beforeInsertDummies(theLast+1, diff);
+  }
+  else {
+    if (diff<0) {
+      removeFromTo(theLast+diff, theLast-1);
+    }
+  }
 
-	if (length>0) {
-		replaceFromToWithFrom(from,from+length-1,other,otherFrom);
-	}
+  if (length>0) {
+    replaceFromToWithFrom(from,from+length-1,other,otherFrom);
+  }
 }
 /**
  * Replaces the part of the receiver starting at <code>from</code> (inclusive) with all the elements of the specified collection.
@@ -635,12 +635,12 @@
  * @exception IndexOutOfBoundsException index is out of range (index &lt; 0 || index &gt;= size()).
  */
 public void replaceFromWith(int from, java.util.Collection other) {
-	checkRange(from,size());
-	java.util.Iterator e = other.iterator();
-	int index=from;
-	int limit = Math.min(size()-from, other.size());
-	for (int i=0; i<limit; i++)
-	    set(index++,((Number) e.next()).floatValue()); //delta
+  checkRange(from,size());
+  java.util.Iterator e = other.iterator();
+  int index=from;
+  int limit = Math.min(size()-from, other.size());
+  for (int i=0; i<limit; i++)
+      set(index++,((Number) e.next()).floatValue()); //delta
 }
 /**
 * Retains (keeps) only the elements in the receiver that are contained in the specified other list.
@@ -650,36 +650,36 @@
 * @return <code>true</code> if the receiver changed as a result of the call.
 */
 public boolean retainAll(AbstractFloatList other) {
-	if (other.size()==0) {
-		if (size==0) return false;
-		setSize(0);
-		return true;
-	}
-	
-	int limit = other.size()-1;
-	int j=0;
-	for (int i=0; i<size ; i++) {
-		if (other.indexOfFromTo(getQuick(i), 0, limit) >= 0) setQuick(j++, getQuick(i));
-	}
+  if (other.size()==0) {
+    if (size==0) return false;
+    setSize(0);
+    return true;
+  }
+  
+  int limit = other.size()-1;
+  int j=0;
+  for (int i=0; i<size ; i++) {
+    if (other.indexOfFromTo(getQuick(i), 0, limit) >= 0) setQuick(j++, getQuick(i));
+  }
 
-	boolean modified = (j!=size);
-	setSize(j);
-	return modified;
+  boolean modified = (j!=size);
+  setSize(j);
+  return modified;
 }
 /**
  * Reverses the elements of the receiver.
  * Last becomes first, second last becomes second first, and so on.
  */
 public void reverse() {
-	float tmp;
-	int limit=size()/2;
-	int j=size()-1;
+  float tmp;
+  int limit=size()/2;
+  int j=size()-1;
 
-	for (int i=0; i<limit;) { //swap
-		tmp=getQuick(i);
-		setQuick(i++,getQuick(j));
-		setQuick(j--,tmp);
-	}
+  for (int i=0; i<limit;) { //swap
+    tmp=getQuick(i);
+    setQuick(i++,getQuick(j));
+    setQuick(j--,tmp);
+  }
 }
 /**
  * Replaces the element at the specified position in the receiver with the specified element.
@@ -689,9 +689,9 @@
  * @throws IndexOutOfBoundsException if <tt>index &lt; 0 || index &gt;= size()</tt>.
  */
 public void set(int index, float element) {
-	if (index >= size || index < 0)
-		throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
-	setQuick(index,element);
+  if (index >= size || index < 0)
+    throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
+  setQuick(index,element);
 }
 /**
  * Replaces the element at the specified position in the receiver with the specified element; <b>WARNING:</b> Does not check preconditions.
@@ -722,7 +722,7 @@
  * }
  */
 protected void setSizeRaw(int newSize) {
-	size = newSize;
+  size = newSize;
 }
 /**
  * Randomly permutes the part of the receiver between <code>from</code> (inclusive) and <code>to</code> (inclusive). 
@@ -731,17 +731,17 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public void shuffleFromTo(int from, int to) {
-	checkRangeFromTo(from, to, size());
-	
-	org.apache.mahout.jet.random.Uniform gen = new org.apache.mahout.jet.random.Uniform(new org.apache.mahout.jet.random.engine.DRand(new java.util.Date()));
-	for (int i=from; i<to; i++) { 
-		int random = gen.nextIntFromTo(i, to);
+  checkRangeFromTo(from, to, size());
+  
+  org.apache.mahout.jet.random.Uniform gen = new org.apache.mahout.jet.random.Uniform(new org.apache.mahout.jet.random.engine.DRand(new java.util.Date()));
+  for (int i=from; i<to; i++) { 
+    int random = gen.nextIntFromTo(i, to);
 
-		//swap(i, random)
-		float tmpElement = getQuick(random);
-		setQuick(random,getQuick(i)); 
-		setQuick(i,tmpElement); 
-	}  
+    //swap(i, random)
+    float tmpElement = getQuick(random);
+    setQuick(random,getQuick(i)); 
+    setQuick(i,tmpElement); 
+  }  
 }
 /**
  * Returns the number of elements contained in the receiver.
@@ -749,33 +749,33 @@
  * @returns  the number of elements contained in the receiver.
  */
 public int size() {
-	return size;
+  return size;
 }
 /**
  * Returns a list which is a concatenation of <code>times</code> times the receiver.
  * @param times the number of times the receiver shall be copied.
  */
 public AbstractFloatList times(int times) {
-	AbstractFloatList newList = new FloatArrayList(times*size());
-	for (int i=times; --i >= 0; ) {
-		newList.addAllOfFromTo(this,0,size()-1);
-	}
-	return newList;
+  AbstractFloatList newList = new FloatArrayList(times*size());
+  for (int i=times; --i >= 0; ) {
+    newList.addAllOfFromTo(this,0,size()-1);
+  }
+  return newList;
 }
 /**
  * Returns a <code>java.util.ArrayList</code> containing all the elements in the receiver.
  */
 public java.util.ArrayList toList() {
-	int mySize = size();
-	java.util.ArrayList list = new java.util.ArrayList(mySize);
-	for (int i=0; i < mySize; i++) list.add(new Float(get(i)));
-	return list;
+  int mySize = size();
+  java.util.ArrayList list = new java.util.ArrayList(mySize);
+  for (int i=0; i < mySize; i++) list.add(new Float(get(i)));
+  return list;
 }
 /**
 * Returns a string representation of the receiver, containing
 * the String representation of each element.
 */
 public String toString() {
-	return org.apache.mahout.matrix.Arrays.toString(partFromTo(0, size()-1).elements());
+  return org.apache.mahout.matrix.Arrays.toString(partFromTo(0, size()-1).elements());
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/list/IntArrayList.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/list/IntArrayList.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/list/IntArrayList.java	(working copy)
@@ -18,17 +18,17 @@
  */
 @Deprecated
 public class IntArrayList extends AbstractIntList {
-	/**
-	 * The array buffer into which the elements of the list are stored.
-	 * The capacity of the list is the length of this array buffer.
-	 * @serial
-	 */
-	protected int[] elements;
+  /**
+   * The array buffer into which the elements of the list are stored.
+   * The capacity of the list is the length of this array buffer.
+   * @serial
+   */
+  protected int[] elements;
 /**
  * Constructs an empty list.
  */
 public IntArrayList() {
-	this(10);
+  this(10);
 }
 /**
  * Constructs a list containing the specified elements. 
@@ -40,7 +40,7 @@
  * @param elements the array to be backed by the the constructed list
  */
 public IntArrayList(int[] elements) {
-	elements(elements);
+  elements(elements);
 }
 /**
  * Constructs an empty list with the specified initial capacity.
@@ -48,8 +48,8 @@
  * @param   initialCapacity   the number of elements the receiver can hold without auto-expanding itself by allocating new internal memory.
  */
 public IntArrayList(int initialCapacity) {
-	this(new int[initialCapacity]);
-	setSizeRaw(0);
+  this(new int[initialCapacity]);
+  setSizeRaw(0);
 }
 /**
  * Appends the specified element to the end of this list.
@@ -57,11 +57,11 @@
  * @param element element to be appended to this list.
  */
 public void add(int element) {
-	// overridden for performance only.
-	if (size == elements.length) {
-		ensureCapacity(size + 1); 
-	}
-	elements[size++] = element;
+  // overridden for performance only.
+  if (size == elements.length) {
+    ensureCapacity(size + 1); 
+  }
+  elements[size++] = element;
 }
 /**
  * Inserts the specified element before the specified position into the receiver. 
@@ -73,17 +73,17 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>index &lt; 0 || index &gt; size()</tt>).
  */
 public void beforeInsert(int index, int element) {
-	// overridden for performance only.
-	if (size == index) {
-		add(element);
-		return;
-	}
-	if (index > size || index < 0) 
-		throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
-	ensureCapacity(size + 1);
-	System.arraycopy(elements, index, elements, index+1, size-index);
-	elements[index] = element;
-	size++;
+  // overridden for performance only.
+  if (size == index) {
+    add(element);
+    return;
+  }
+  if (index > size || index < 0) 
+    throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
+  ensureCapacity(size + 1);
+  System.arraycopy(elements, index, elements, index+1, size-index);
+  elements[index] = element;
+  size++;
 }
 /**
  * Searches the receiver for the specified value using
@@ -98,18 +98,18 @@
  * @param from the leftmost search position, inclusive.
  * @param to the rightmost search position, inclusive.
  * @return index of the search key, if it is contained in the receiver;
- *	       otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
- *	       point</i> is defined as the the point at which the value would
- * 	       be inserted into the receiver: the index of the first
- *	       element greater than the key, or <tt>receiver.size()</tt>, if all
- *	       elements in the receiver are less than the specified key.  Note
- *	       that this guarantees that the return value will be &gt;= 0 if
- *	       and only if the key is found.
+ *         otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
+ *         point</i> is defined as the the point at which the value would
+ *          be inserted into the receiver: the index of the first
+ *         element greater than the key, or <tt>receiver.size()</tt>, if all
+ *         elements in the receiver are less than the specified key.  Note
+ *         that this guarantees that the return value will be &gt;= 0 if
+ *         and only if the key is found.
  * @see org.apache.mahout.matrix.Sorting
  * @see java.util.Arrays
  */
 public int binarySearchFromTo(int key, int from, int to) {
-	return org.apache.mahout.matrix.Sorting.binarySearchFromTo(this.elements,key,from,to);
+  return org.apache.mahout.matrix.Sorting.binarySearchFromTo(this.elements,key,from,to);
 }
 /**
  * Returns a deep copy of the receiver. 
@@ -117,10 +117,10 @@
  * @return  a deep copy of the receiver.
  */
 public Object clone() {
-	// overridden for performance only.
-	IntArrayList clone = new IntArrayList((int[]) elements.clone());
-	clone.setSizeRaw(size);
-	return clone;
+  // overridden for performance only.
+  IntArrayList clone = new IntArrayList((int[]) elements.clone());
+  clone.setSizeRaw(size);
+  return clone;
 }
 /**
  * Returns a deep copy of the receiver; uses <code>clone()</code> and casts the result.
@@ -128,7 +128,7 @@
  * @return  a deep copy of the receiver.
  */
 public IntArrayList copy() {
-	return (IntArrayList) clone();
+  return (IntArrayList) clone();
 }
  /**
  * Sorts the specified range of the receiver into ascending numerical order. 
@@ -145,28 +145,28 @@
  * @param max the largest element contained in the range.
  */
 protected void countSortFromTo(int from, int to, int min, int max) {
-	if (size==0) return;
-	checkRangeFromTo(from, to, size);
+  if (size==0) return;
+  checkRangeFromTo(from, to, size);
 
-	final int width = (int) (max-min+1);
-	
-	int[] counts = new int[width];
-	int[] theElements = elements;	
-	for (int i=from; i<=to; ) counts[(int)(theElements[i++]-min)]++;
+  final int width = (int) (max-min+1);
+  
+  int[] counts = new int[width];
+  int[] theElements = elements;  
+  for (int i=from; i<=to; ) counts[(int)(theElements[i++]-min)]++;
 
-	int fromIndex = from;
-	int val = min;
-	for (int i=0; i<width; i++, val++) {
-		int c = counts[i];
-		if (c>0) {
-			if (c==1) theElements[fromIndex++]=val;
-			else {
-				int toIndex = fromIndex + c - 1;
-				fillFromToWith(fromIndex,toIndex,val);
-				fromIndex = toIndex + 1;
-			}
-		}
-	}
+  int fromIndex = from;
+  int val = min;
+  for (int i=0; i<width; i++, val++) {
+    int c = counts[i];
+    if (c>0) {
+      if (c==1) theElements[fromIndex++]=val;
+      else {
+        int toIndex = fromIndex + c - 1;
+        fillFromToWith(fromIndex,toIndex,val);
+        fromIndex = toIndex + 1;
+      }
+    }
+  }
 }
 /**
  * Returns the elements currently stored, including invalid elements between size and capacity, if any.
@@ -177,7 +177,7 @@
  * @return the elements currently stored.
  */
 public int[] elements() {
-	return elements;
+  return elements;
 }
 /**
  * Sets the receiver's elements to be the specified array (not a copy of it).
@@ -190,9 +190,9 @@
  * @return the receiver itself.
  */
 public AbstractIntList elements(int[] elements) {
-	this.elements=elements;
-	this.size=elements.length;
-	return this;
+  this.elements=elements;
+  this.size=elements.length;
+  return this;
 }
 /**
  * Ensures that the receiver can hold at least the specified number of elements without needing to allocate new internal memory.
@@ -201,7 +201,7 @@
  * @param   minCapacity   the desired minimum capacity.
  */
 public void ensureCapacity(int minCapacity) {
-	elements = org.apache.mahout.matrix.Arrays.ensureCapacity(elements,minCapacity);
+  elements = org.apache.mahout.matrix.Arrays.ensureCapacity(elements,minCapacity);
 }
 /**
  * Compares the specified Object with the receiver.  
@@ -214,19 +214,19 @@
  * @return true if the specified Object is equal to the receiver.
  */
 public boolean equals(Object otherObj) { //delta
-	// overridden for performance only.
-	if (! (otherObj instanceof IntArrayList)) return super.equals(otherObj);
-	if (this==otherObj) return true;
-	if (otherObj==null) return false;
-	IntArrayList other = (IntArrayList) otherObj;
-	if (size()!=other.size()) return false;
+  // overridden for performance only.
+  if (! (otherObj instanceof IntArrayList)) return super.equals(otherObj);
+  if (this==otherObj) return true;
+  if (otherObj==null) return false;
+  IntArrayList other = (IntArrayList) otherObj;
+  if (size()!=other.size()) return false;
 
-	int[] theElements = elements();
-	int[] otherElements = other.elements();
-	for (int i=size(); --i >= 0; ) {
-	    if (theElements[i] != otherElements[i]) return false;
-	}
-	return true;
+  int[] theElements = elements();
+  int[] otherElements = other.elements();
+  for (int i=size(); --i >= 0; ) {
+      if (theElements[i] != otherElements[i]) return false;
+  }
+  return true;
 }
 /**
  * Applies a procedure to each element of the receiver, if any.
@@ -235,25 +235,25 @@
  * @return <tt>false</tt> if the procedure stopped before all elements where iterated over, <tt>true</tt> otherwise. 
  */
 public boolean forEach(IntProcedure procedure) {
-	// overridden for performance only.
-	int[] theElements = elements;
-	int theSize = size;
-	
-	for (int i=0; i<theSize;) if (! procedure.apply(theElements[i++])) return false;
-	return true;
+  // overridden for performance only.
+  int[] theElements = elements;
+  int theSize = size;
+  
+  for (int i=0; i<theSize;) if (! procedure.apply(theElements[i++])) return false;
+  return true;
 }
 /**
  * Returns the element at the specified position in the receiver.
  *
  * @param index index of element to return.
  * @exception IndexOutOfBoundsException index is out of range (index
- * 		  &lt; 0 || index &gt;= size()).
+ *       &lt; 0 || index &gt;= size()).
  */
 public int get(int index) {
-	// overridden for performance only.
-	if (index >= size || index < 0)
-		throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
-	return elements[index];
+  // overridden for performance only.
+  if (index >= size || index < 0)
+    throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
+  return elements[index];
 }
 /**
  * Returns the element at the specified position in the receiver; <b>WARNING:</b> Does not check preconditions. 
@@ -264,7 +264,7 @@
  * @param index index of element to return.
  */
 public int getQuick(int index) {
-	return elements[index];
+  return elements[index];
 }
 /**
  * Returns the index of the first occurrence of the specified
@@ -279,15 +279,15 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public int indexOfFromTo(int element, int from, int to) {
-	// overridden for performance only.
-	if (size==0) return -1;
-	checkRangeFromTo(from, to, size);
+  // overridden for performance only.
+  if (size==0) return -1;
+  checkRangeFromTo(from, to, size);
 
-	int[] theElements = elements;
-	for (int i = from ; i <= to; i++) {
-	    if (element==theElements[i]) {return i;} //found
-	}
-	return -1; //not found
+  int[] theElements = elements;
+  for (int i = from ; i <= to; i++) {
+      if (element==theElements[i]) {return i;} //found
+  }
+  return -1; //not found
 }
 /**
  * Returns the index of the last occurrence of the specified
@@ -302,15 +302,15 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public int lastIndexOfFromTo(int element, int from, int to) {
-	// overridden for performance only.
-	if (size==0) return -1;
-	checkRangeFromTo(from, to, size);
+  // overridden for performance only.
+  if (size==0) return -1;
+  checkRangeFromTo(from, to, size);
 
-	int[] theElements = elements;
-	for (int i = to ; i >= from; i--) {
-	    if (element==theElements[i]) {return i;} //found
-	}
-	return -1; //not found
+  int[] theElements = elements;
+  for (int i = to ; i >= from; i--) {
+      if (element==theElements[i]) {return i;} //found
+  }
+  return -1; //not found
 }
 /**
  * Returns a new list of the part of the receiver between <code>from</code>, inclusive, and <code>to</code>, inclusive.
@@ -320,13 +320,13 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public AbstractIntList partFromTo(int from, int to) {
-	if (size==0) return new IntArrayList(0);
+  if (size==0) return new IntArrayList(0);
 
-	checkRangeFromTo(from, to, size);
+  checkRangeFromTo(from, to, size);
 
-	int[] part = new int[to-from+1];
-	System.arraycopy(elements, from, part, 0, to-from+1);
-	return new IntArrayList(part);
+  int[] part = new int[to-from+1];
+  System.arraycopy(elements, from, part, 0, to-from+1);
+  return new IntArrayList(part);
 }
 /**
 * Removes from the receiver all elements that are contained in the specified list.
@@ -336,46 +336,46 @@
 * @return <code>true</code> if the receiver changed as a result of the call.
 */
 public boolean removeAll(AbstractIntList other) {
-	// overridden for performance only.
-	if (! (other instanceof IntArrayList))	return super.removeAll(other);
-	
-	/* There are two possibilities to do the thing
-	   a) use other.indexOf(...)
-	   b) sort other, then use other.binarySearch(...)
-	   
-	   Let's try to figure out which one is faster. Let M=size, N=other.size, then
-	   a) takes O(M*N) steps
-	   b) takes O(N*logN + M*logN) steps (sorting is O(N*logN) and binarySearch is O(logN))
+  // overridden for performance only.
+  if (! (other instanceof IntArrayList))  return super.removeAll(other);
+  
+  /* There are two possibilities to do the thing
+     a) use other.indexOf(...)
+     b) sort other, then use other.binarySearch(...)
+     
+     Let's try to figure out which one is faster. Let M=size, N=other.size, then
+     a) takes O(M*N) steps
+     b) takes O(N*logN + M*logN) steps (sorting is O(N*logN) and binarySearch is O(logN))
  
-	   Hence, if N*logN + M*logN < M*N, we use b) otherwise we use a).
-	*/
-	if (other.size()==0) {return false;} //nothing to do
-	int limit = other.size()-1;
-	int j=0;
-	int[] theElements = elements;
-	int mySize = size();
+     Hence, if N*logN + M*logN < M*N, we use b) otherwise we use a).
+  */
+  if (other.size()==0) {return false;} //nothing to do
+  int limit = other.size()-1;
+  int j=0;
+  int[] theElements = elements;
+  int mySize = size();
 
-	double N=(double) other.size();
-	double M=(double) mySize;
-	if ( (N+M)* org.apache.mahout.jet.math.Arithmetic.log2(N) < M*N ) {
-		// it is faster to sort other before searching in it
-		IntArrayList sortedList = (IntArrayList) other.clone();
-		sortedList.quickSort();
+  double N=(double) other.size();
+  double M=(double) mySize;
+  if ( (N+M)* org.apache.mahout.jet.math.Arithmetic.log2(N) < M*N ) {
+    // it is faster to sort other before searching in it
+    IntArrayList sortedList = (IntArrayList) other.clone();
+    sortedList.quickSort();
 
-		for (int i=0; i<mySize ; i++) {
-			if (sortedList.binarySearchFromTo(theElements[i], 0, limit) < 0) theElements[j++]=theElements[i];
-		}
-	}
-	else {
-		// it is faster to search in other without sorting
-		for (int i=0; i<mySize ; i++) {
-			if (other.indexOfFromTo(theElements[i], 0, limit) < 0) theElements[j++]=theElements[i];
-		}
-	}
+    for (int i=0; i<mySize ; i++) {
+      if (sortedList.binarySearchFromTo(theElements[i], 0, limit) < 0) theElements[j++]=theElements[i];
+    }
+  }
+  else {
+    // it is faster to search in other without sorting
+    for (int i=0; i<mySize ; i++) {
+      if (other.indexOfFromTo(theElements[i], 0, limit) < 0) theElements[j++]=theElements[i];
+    }
+  }
 
-	boolean modified = (j!=mySize);
-	setSize(j);
-	return modified;
+  boolean modified = (j!=mySize);
+  setSize(j);
+  return modified;
 }
 /**
  * Replaces a number of elements in the receiver with the same number of elements of another list.
@@ -388,18 +388,18 @@
  * @param otherFrom position of first element within other list to be copied.
  */
 public void replaceFromToWithFrom(int from, int to, AbstractIntList other, int otherFrom) {
-	// overridden for performance only.
-	if (! (other instanceof IntArrayList)) {
-		// slower
-		super.replaceFromToWithFrom(from,to,other,otherFrom);
-		return;
-	}
-	int length=to-from+1;
-	if (length>0) {
-		checkRangeFromTo(from, to, size());
-		checkRangeFromTo(otherFrom,otherFrom+length-1,other.size());
-		System.arraycopy(((IntArrayList) other).elements, otherFrom, elements, from, length);
-	}
+  // overridden for performance only.
+  if (! (other instanceof IntArrayList)) {
+    // slower
+    super.replaceFromToWithFrom(from,to,other,otherFrom);
+    return;
+  }
+  int length=to-from+1;
+  if (length>0) {
+    checkRangeFromTo(from, to, size());
+    checkRangeFromTo(otherFrom,otherFrom+length-1,other.size());
+    System.arraycopy(((IntArrayList) other).elements, otherFrom, elements, from, length);
+  }
 }
 /**
 * Retains (keeps) only the elements in the receiver that are contained in the specified other list.
@@ -409,62 +409,62 @@
 * @return <code>true</code> if the receiver changed as a result of the call.
 */
 public boolean retainAll(AbstractIntList other) {
-	// overridden for performance only.
-	if (! (other instanceof IntArrayList))	return super.retainAll(other);
-	
-	/* There are two possibilities to do the thing
-	   a) use other.indexOf(...)
-	   b) sort other, then use other.binarySearch(...)
-	   
-	   Let's try to figure out which one is faster. Let M=size, N=other.size, then
-	   a) takes O(M*N) steps
-	   b) takes O(N*logN + M*logN) steps (sorting is O(N*logN) and binarySearch is O(logN))
+  // overridden for performance only.
+  if (! (other instanceof IntArrayList))  return super.retainAll(other);
+  
+  /* There are two possibilities to do the thing
+     a) use other.indexOf(...)
+     b) sort other, then use other.binarySearch(...)
+     
+     Let's try to figure out which one is faster. Let M=size, N=other.size, then
+     a) takes O(M*N) steps
+     b) takes O(N*logN + M*logN) steps (sorting is O(N*logN) and binarySearch is O(logN))
 
-	   Hence, if N*logN + M*logN < M*N, we use b) otherwise we use a).
-	*/
-	int limit = other.size()-1;
-	int j=0;
-	int[] theElements = elements;
-	int mySize = size();
+     Hence, if N*logN + M*logN < M*N, we use b) otherwise we use a).
+  */
+  int limit = other.size()-1;
+  int j=0;
+  int[] theElements = elements;
+  int mySize = size();
 
-	double N=(double) other.size();
-	double M=(double) mySize;
-	if ( (N+M)* org.apache.mahout.jet.math.Arithmetic.log2(N) < M*N ) {
-		// it is faster to sort other before searching in it
-		IntArrayList sortedList = (IntArrayList) other.clone();
-		sortedList.quickSort();
+  double N=(double) other.size();
+  double M=(double) mySize;
+  if ( (N+M)* org.apache.mahout.jet.math.Arithmetic.log2(N) < M*N ) {
+    // it is faster to sort other before searching in it
+    IntArrayList sortedList = (IntArrayList) other.clone();
+    sortedList.quickSort();
 
-		for (int i=0; i<mySize ; i++) {
-			if (sortedList.binarySearchFromTo(theElements[i], 0, limit) >= 0) theElements[j++]=theElements[i];
-		}
-	}
-	else {
-		// it is faster to search in other without sorting
-		for (int i=0; i<mySize ; i++) {
-			if (other.indexOfFromTo(theElements[i], 0, limit) >= 0) theElements[j++]=theElements[i];
-		}
-	}
+    for (int i=0; i<mySize ; i++) {
+      if (sortedList.binarySearchFromTo(theElements[i], 0, limit) >= 0) theElements[j++]=theElements[i];
+    }
+  }
+  else {
+    // it is faster to search in other without sorting
+    for (int i=0; i<mySize ; i++) {
+      if (other.indexOfFromTo(theElements[i], 0, limit) >= 0) theElements[j++]=theElements[i];
+    }
+  }
 
-	boolean modified = (j!=mySize);
-	setSize(j);
-	return modified;
+  boolean modified = (j!=mySize);
+  setSize(j);
+  return modified;
 }
 /**
  * Reverses the elements of the receiver.
  * Last becomes first, second last becomes second first, and so on.
  */
 public void reverse() {
-	// overridden for performance only.
-	int tmp;
-	int limit=size/2;
-	int j=size-1;
+  // overridden for performance only.
+  int tmp;
+  int limit=size/2;
+  int j=size-1;
 
-	int[] theElements = elements;
-	for (int i=0; i<limit;) { //swap
-		tmp=theElements[i];
-		theElements[i++]=theElements[j];
-		theElements[j--]=tmp;
-	}
+  int[] theElements = elements;
+  for (int i=0; i<limit;) { //swap
+    tmp=theElements[i];
+    theElements[i++]=theElements[j];
+    theElements[j--]=tmp;
+  }
 }
 /**
  * Replaces the element at the specified position in the receiver with the specified element.
@@ -472,13 +472,13 @@
  * @param index index of element to replace.
  * @param element element to be stored at the specified position.
  * @exception IndexOutOfBoundsException index is out of range (index
- * 		  &lt; 0 || index &gt;= size()).
+ *       &lt; 0 || index &gt;= size()).
  */
 public void set(int index, int element) {
-	// overridden for performance only.
-	if (index >= size || index < 0)
-		throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
-	elements[index] = element;
+  // overridden for performance only.
+  if (index >= size || index < 0)
+    throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
+  elements[index] = element;
 }
 /**
  * Replaces the element at the specified position in the receiver with the specified element; <b>WARNING:</b> Does not check preconditions.
@@ -490,7 +490,7 @@
  * @param element element to be stored at the specified position.
  */
 public void setQuick(int index, int element) {
-	elements[index] = element;
+  elements[index] = element;
 }
 /**
  * Randomly permutes the part of the receiver between <code>from</code> (inclusive) and <code>to</code> (inclusive). 
@@ -499,22 +499,22 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public void shuffleFromTo(int from, int to) {
-	// overridden for performance only.
-	if (size==0) {return;}
-	checkRangeFromTo(from, to, size);
-	
-	org.apache.mahout.jet.random.Uniform gen = new org.apache.mahout.jet.random.Uniform(new org.apache.mahout.jet.random.engine.DRand(new java.util.Date()));
-	int tmpElement;
-	int[] theElements = elements;
-	int random;
-	for (int i=from; i<to; i++) { 
-		random = gen.nextIntFromTo(i, to);
+  // overridden for performance only.
+  if (size==0) {return;}
+  checkRangeFromTo(from, to, size);
+  
+  org.apache.mahout.jet.random.Uniform gen = new org.apache.mahout.jet.random.Uniform(new org.apache.mahout.jet.random.engine.DRand(new java.util.Date()));
+  int tmpElement;
+  int[] theElements = elements;
+  int random;
+  for (int i=from; i<to; i++) { 
+    random = gen.nextIntFromTo(i, to);
 
-		//swap(i, random)
-		tmpElement = theElements[random];
-		theElements[random]=theElements[i]; 
-		theElements[i]=tmpElement; 
-	}  
+    //swap(i, random)
+    tmpElement = theElements[random];
+    theElements[random]=theElements[i]; 
+    theElements[i]=tmpElement; 
+  }  
 }
 /**
  * Sorts the specified range of the receiver into ascending order. 
@@ -533,39 +533,39 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public void sortFromTo(int from, int to) {
-	/* 
-	 * Computes min and max and decides on this basis.
-	 * In practice the additional overhead is very small compared to the potential gains.
-	 */
-	final int widthThreshold = 10000; // never consider options resulting in outrageous memory allocations.
-	
-	if (size==0) return;
-	checkRangeFromTo(from, to, size);
+  /* 
+   * Computes min and max and decides on this basis.
+   * In practice the additional overhead is very small compared to the potential gains.
+   */
+  final int widthThreshold = 10000; // never consider options resulting in outrageous memory allocations.
+  
+  if (size==0) return;
+  checkRangeFromTo(from, to, size);
 
-	// determine minimum and maximum.
-	int min=elements[from];
-	int max=elements[from];
+  // determine minimum and maximum.
+  int min=elements[from];
+  int max=elements[from];
 
-	int[] theElements = elements;
-	for (int i=from+1; i<=to; ) {
-		int elem = theElements[i++];
-		if (elem>max) max=elem;
-		else if (elem<min) min=elem;
-	}
+  int[] theElements = elements;
+  for (int i=from+1; i<=to; ) {
+    int elem = theElements[i++];
+    if (elem>max) max=elem;
+    else if (elem<min) min=elem;
+  }
 
-	// try to figure out which option is fastest.
-	double N = (double)to - (double)from + 1.0;
-	double quickSortEstimate = 	N * Math.log(N)/0.6931471805599453; // O(N*log(N,base=2)) ; ln(2)=0.6931471805599453
+  // try to figure out which option is fastest.
+  double N = (double)to - (double)from + 1.0;
+  double quickSortEstimate =   N * Math.log(N)/0.6931471805599453; // O(N*log(N,base=2)) ; ln(2)=0.6931471805599453
 
-	double width = (double)max - (double)min + 1.0;
-	double countSortEstimate = 	Math.max(width,N); // O(Max(width,N))
-	
-	if (width < widthThreshold && countSortEstimate < quickSortEstimate) {
-		countSortFromTo(from, to, min, max);
-	}
-	else {
-		quickSortFromTo(from, to);
-	}
+  double width = (double)max - (double)min + 1.0;
+  double countSortEstimate =   Math.max(width,N); // O(Max(width,N))
+  
+  if (width < widthThreshold && countSortEstimate < quickSortEstimate) {
+    countSortFromTo(from, to, min, max);
+  }
+  else {
+    quickSortFromTo(from, to);
+  }
 }
 /**
  * Trims the capacity of the receiver to be the receiver's current 
@@ -573,6 +573,6 @@
  * storage of the receiver.
  */
 public void trimToSize() {
-	elements = org.apache.mahout.matrix.Arrays.trimToCapacity(elements,size());
+  elements = org.apache.mahout.matrix.Arrays.trimToCapacity(elements,size());
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/list/DistinctNumberList.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/list/DistinctNumberList.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/list/DistinctNumberList.java	(working copy)
@@ -51,16 +51,14 @@
  * @see MinMaxNumberList
  * @see java.lang.Float
  * @see java.lang.Double
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 09/24/99
  */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
  */
 @Deprecated
 public class DistinctNumberList extends org.apache.mahout.matrix.list.AbstractLongList {
-	protected long[] distinctValues;
-	protected MinMaxNumberList elements;
+  protected long[] distinctValues;
+  protected MinMaxNumberList elements;
 /**
  * Constructs an empty list with the specified initial capacity and the specified distinct values allowed to be hold in this list.
  *
@@ -68,7 +66,7 @@
  * @param   initialCapacity   the number of elements the receiver can hold without auto-expanding itself by allocating new internal memory.
  */
 public DistinctNumberList(long[] distinctValues, int initialCapacity) {
-	setUp(distinctValues,initialCapacity);
+  setUp(distinctValues,initialCapacity);
 }
 /**
  * Appends the specified element to the end of this list.
@@ -76,17 +74,17 @@
  * @param element element to be appended to this list.
  */
 public void add(long element) {
-	//overridden for performance only.
-	elements.add(codeOf(element));
-	size++;
+  //overridden for performance only.
+  elements.add(codeOf(element));
+  size++;
 }
 /**
  * Returns the code that shall be stored for the given element.
  */
 protected int codeOf(long element) {
-	int index = java.util.Arrays.binarySearch(distinctValues,element);
-	if (index<0) throw new IllegalArgumentException("Element="+element+" not contained in distinct elements.");
-	return index;
+  int index = java.util.Arrays.binarySearch(distinctValues,element);
+  if (index<0) throw new IllegalArgumentException("Element="+element+" not contained in distinct elements.");
+  return index;
 }
 /**
  * Ensures that the receiver can hold at least the specified number of elements without needing to allocate new internal memory.
@@ -95,7 +93,7 @@
  * @param   minCapacity   the desired minimum capacity.
  */
 public void ensureCapacity(int minCapacity) {
-	elements.ensureCapacity(minCapacity);
+  elements.ensureCapacity(minCapacity);
 }
 /**
  * Returns the element at the specified position in the receiver; <b>WARNING:</b> Does not check preconditions. 
@@ -106,7 +104,7 @@
  * @param index index of element to return.
  */
 public long getQuick(int index) {
-	return distinctValues[(int)(elements.getQuick(index))];
+  return distinctValues[(int)(elements.getQuick(index))];
 }
 /**
  * Removes from the receiver all elements whose index is between
@@ -119,8 +117,8 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public void removeFromTo(int from, int to) {
-	elements.removeFromTo(from,to);
-	size -= to-from+1;
+  elements.removeFromTo(from,to);
+  size -= to-from+1;
 }
 /**
  * Replaces the element at the specified position in the receiver with the specified element; <b>WARNING:</b> Does not check preconditions. 
@@ -132,15 +130,15 @@
  * @param element element to be stored at the specified position.
  */
 public void setQuick(int index, long element) {
-	elements.setQuick(index,codeOf(element));
+  elements.setQuick(index,codeOf(element));
 }
 /**
  * Sets the size of the receiver without modifying it otherwise.
  * This method should not release or allocate new memory but simply set some instance variable like <tt>size</tt>.
  */
 protected void setSizeRaw(int newSize) {
-	super.setSizeRaw(newSize);
-	elements.setSizeRaw(newSize);
+  super.setSizeRaw(newSize);
+  elements.setSizeRaw(newSize);
 }
 /**
  * Sets the receiver to an empty list with the specified initial capacity and the specified distinct values allowed to be hold in this list.
@@ -149,9 +147,9 @@
  * @param   initialCapacity   the number of elements the receiver can hold without auto-expanding itself by allocating new internal memory.
  */
 protected void setUp(long[] distinctValues, int initialCapacity) {
-	this.distinctValues = distinctValues;
-	//java.util.Arrays.sort(this.distinctElements);
-	this.elements = new MinMaxNumberList(0,distinctValues.length-1,initialCapacity);
+  this.distinctValues = distinctValues;
+  //java.util.Arrays.sort(this.distinctElements);
+  this.elements = new MinMaxNumberList(0,distinctValues.length-1,initialCapacity);
 }
 /**
  * Trims the capacity of the receiver to be the receiver's current 
@@ -159,6 +157,6 @@
  * storage of the receiver. 
  */
 public void trimToSize() {
-	elements.trimToSize();
+  elements.trimToSize();
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/list/AbstractDoubleList.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/list/AbstractDoubleList.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/list/AbstractDoubleList.java	(working copy)
@@ -19,14 +19,14 @@
  */
 @Deprecated
 public abstract class AbstractDoubleList extends AbstractList implements org.apache.mahout.matrix.buffer.DoubleBufferConsumer {
-	/**
-	 * The size of the list.
-	 * This is a READ_ONLY variable for all methods but setSizeRaw(int newSize) !!!
-	 * If you violate this principle in subclasses, you should exactly know what you are doing.
-	 * @serial
-	 *
-	 */
-	protected int size;
+  /**
+   * The size of the list.
+   * This is a READ_ONLY variable for all methods but setSizeRaw(int newSize) !!!
+   * If you violate this principle in subclasses, you should exactly know what you are doing.
+   * @serial
+   *
+   */
+  protected int size;
 /**
  * Makes this class non instantiable, but still let's others inherit from it.
  */
@@ -37,14 +37,14 @@
  * @param element element to be appended to this list.
  */
 public void add(double element) {
-	beforeInsert(size,element);
+  beforeInsert(size,element);
 }
 /**
  * Appends all elements of the specified list to the receiver.
  * @param list the list of which all elements shall be appended.
  */
 public void addAllOf(DoubleArrayList other) {
-	addAllOfFromTo(other,0,other.size()-1); 
+  addAllOfFromTo(other,0,other.size()-1); 
 }
 /**
  * Appends the part of the specified list between <code>from</code> (inclusive) and <code>to</code> (inclusive) to the receiver.
@@ -55,7 +55,7 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>other.size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=other.size())</tt>).
  */
 public void addAllOfFromTo(AbstractDoubleList other, int from, int to) {
-	beforeInsertAllOfFromTo(size,other,from,to); 
+  beforeInsertAllOfFromTo(size,other,from,to); 
 }
 /**
  * Inserts the specified element before the specified position into the receiver. 
@@ -67,8 +67,8 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>index &lt; 0 || index &gt; size()</tt>).
  */
 public void beforeInsert(int index, double element) {
-	beforeInsertDummies(index,1);
-	set(index,element);
+  beforeInsertDummies(index,1);
+  set(index,element);
 }
 /**
  * Inserts the part of the specified list between <code>otherFrom</code> (inclusive) and <code>otherTo</code> (inclusive) before the specified position into the receiver. 
@@ -83,9 +83,9 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>index &lt; 0 || index &gt; size()</tt>).
  */
 public void beforeInsertAllOfFromTo(int index, AbstractDoubleList other, int from, int to) {
-	int length=to-from+1;
-	this.beforeInsertDummies(index, length);
-	this.replaceFromToWithFrom(index, index+length-1, other, from);
+  int length=to-from+1;
+  this.beforeInsertDummies(index, length);
+  this.replaceFromToWithFrom(index, index+length-1, other, from);
 }
 /**
  * Inserts <tt>length</tt> dummy elements before the specified position into the receiver. 
@@ -98,13 +98,13 @@
  * @throws IndexOutOfBoundsException if <tt>index &lt; 0 || index &gt; size()</tt>.
  */
 protected void beforeInsertDummies(int index, int length) {
-	if (index > size || index < 0) 
-		throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
-	if (length > 0) {
-		ensureCapacity(size + length);
-		setSizeRaw(size + length);
-		replaceFromToWithFrom(index+length,size-1,this,index);
-	}
+  if (index > size || index < 0) 
+    throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
+  if (length > 0) {
+    ensureCapacity(size + length);
+    setSizeRaw(size + length);
+    replaceFromToWithFrom(index+length,size-1,this,index);
+  }
 }
 /**
  * Searches the receiver for the specified value using
@@ -117,17 +117,17 @@
  *
  * @param key the value to be searched for.
  * @return index of the search key, if it is contained in the receiver;
- *	       otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
- *	       point</i> is defined as the the point at which the value would
- * 	       be inserted into the receiver: the index of the first
- *	       element greater than the key, or <tt>receiver.size()</tt>, if all
- *	       elements in the receiver are less than the specified key.  Note
- *	       that this guarantees that the return value will be &gt;= 0 if
- *	       and only if the key is found.
+ *         otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
+ *         point</i> is defined as the the point at which the value would
+ *          be inserted into the receiver: the index of the first
+ *         element greater than the key, or <tt>receiver.size()</tt>, if all
+ *         elements in the receiver are less than the specified key.  Note
+ *         that this guarantees that the return value will be &gt;= 0 if
+ *         and only if the key is found.
  * @see java.util.Arrays
  */
 public int binarySearch(double key) {
-	return this.binarySearchFromTo(key, 0, size-1);
+  return this.binarySearchFromTo(key, 0, size-1);
 }
 /**
  * Searches the receiver for the specified value using
@@ -142,27 +142,27 @@
  * @param from the leftmost search position, inclusive.
  * @param to the rightmost search position, inclusive.
  * @return index of the search key, if it is contained in the receiver;
- *	       otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
- *	       point</i> is defined as the the point at which the value would
- * 	       be inserted into the receiver: the index of the first
- *	       element greater than the key, or <tt>receiver.size()</tt>, if all
- *	       elements in the receiver are less than the specified key.  Note
- *	       that this guarantees that the return value will be &gt;= 0 if
- *	       and only if the key is found.
+ *         otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
+ *         point</i> is defined as the the point at which the value would
+ *          be inserted into the receiver: the index of the first
+ *         element greater than the key, or <tt>receiver.size()</tt>, if all
+ *         elements in the receiver are less than the specified key.  Note
+ *         that this guarantees that the return value will be &gt;= 0 if
+ *         and only if the key is found.
  * @see java.util.Arrays
  */
 public int binarySearchFromTo(double key, int from, int to) {
-	int low=from;
-	int high=to;
-	while (low <= high) {
-		int mid =(low + high)/2;
-		double midVal = get(mid);
+  int low=from;
+  int high=to;
+  while (low <= high) {
+    int mid =(low + high)/2;
+    double midVal = get(mid);
 
-		if (midVal < key) low = mid + 1;
-		else if (midVal > key) high = mid - 1;
-		else return mid; // key found
-	}
-	return -(low + 1);  // key not found.
+    if (midVal < key) low = mid + 1;
+    else if (midVal > key) high = mid - 1;
+    else return mid; // key found
+  }
+  return -(low + 1);  // key not found.
 }
 /**
  * Returns a deep copy of the receiver. 
@@ -170,7 +170,7 @@
  * @return  a deep copy of the receiver.
  */
 public Object clone() {
-	return partFromTo(0,size-1);
+  return partFromTo(0,size-1);
 }
 /**
  * Returns true if the receiver contains the specified element.
@@ -178,7 +178,7 @@
  * @param element element whose presence in the receiver is to be tested.
  */
 public boolean contains(double elem) {
-	return indexOfFromTo(elem,0,size-1) >=0;
+  return indexOfFromTo(elem,0,size-1) >=0;
 }
 /**
  * Deletes the first element from the receiver that is identical to the specified element.
@@ -187,8 +187,8 @@
  * @param element the element to be deleted.
  */
 public void delete(double element) {
-	int index = indexOfFromTo(element, 0, size-1);
-	if (index>=0) remove(index);
+  int index = indexOfFromTo(element, 0, size-1);
+  if (index>=0) remove(index);
 }
 /**
  * Returns the elements currently stored, possibly including invalid elements between size and capacity.
@@ -199,9 +199,9 @@
  * @return the elements currently stored.
  */
 public double[] elements() {
-	double[] myElements = new double[size];
-	for (int i=size; --i >= 0; ) myElements[i]=getQuick(i);
-	return myElements;
+  double[] myElements = new double[size];
+  for (int i=size; --i >= 0; ) myElements[i]=getQuick(i);
+  return myElements;
 }
 /**
  * Sets the receiver's elements to be the specified array.
@@ -213,9 +213,9 @@
  * @return the receiver itself.
  */
 public AbstractDoubleList elements(double[] elements) {
-	clear();
-	addAllOfFromTo(new DoubleArrayList(elements),0,elements.length-1);
-	return this;
+  clear();
+  addAllOfFromTo(new DoubleArrayList(elements),0,elements.length-1);
+  return this;
 }
 /**
  * Ensures that the receiver can hold at least the specified number of elements without needing to allocate new internal memory.
@@ -235,16 +235,16 @@
  * @return true if the specified Object is equal to the receiver.
  */
 public boolean equals(Object otherObj) { //delta
-	if (! (otherObj instanceof AbstractDoubleList)) {return false;}
-	if (this==otherObj) return true;
-	if (otherObj==null) return false;
-	AbstractDoubleList other = (AbstractDoubleList) otherObj;
-	if (size()!=other.size()) return false;
+  if (! (otherObj instanceof AbstractDoubleList)) {return false;}
+  if (this==otherObj) return true;
+  if (otherObj==null) return false;
+  AbstractDoubleList other = (AbstractDoubleList) otherObj;
+  if (size()!=other.size()) return false;
 
-	for (int i=size(); --i >= 0; ) {
-	    if (getQuick(i) != other.getQuick(i)) return false;
-	}
-	return true;
+  for (int i=size(); --i >= 0; ) {
+      if (getQuick(i) != other.getQuick(i)) return false;
+  }
+  return true;
 }
 /**
  * Sets the specified range of elements in the specified array to the specified value.
@@ -254,8 +254,8 @@
  * @param val the value to be stored in the specified elements of the receiver.
  */
 public void fillFromToWith(int from, int to, double val) {
-	checkRangeFromTo(from,to,this.size);
-	for (int i=from; i<=to;) setQuick(i++,val); 
+  checkRangeFromTo(from,to,this.size);
+  for (int i=from; i<=to;) setQuick(i++,val); 
 }
 /**
  * Applies a procedure to each element of the receiver, if any.
@@ -264,20 +264,20 @@
  * @return <tt>false</tt> if the procedure stopped before all elements where iterated over, <tt>true</tt> otherwise. 
  */
 public boolean forEach(DoubleProcedure procedure) {
-	for (int i=0; i<size;) if (! procedure.apply(get(i++))) return false;
-	return true;
+  for (int i=0; i<size;) if (! procedure.apply(get(i++))) return false;
+  return true;
 }
 /**
  * Returns the element at the specified position in the receiver.
  *
  * @param index index of element to return.
  * @exception IndexOutOfBoundsException index is out of range (index
- * 		  &lt; 0 || index &gt;= size()).
+ *       &lt; 0 || index &gt;= size()).
  */
 public double get(int index) {
-	if (index >= size || index < 0)
-		throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
-	return getQuick(index);
+  if (index >= size || index < 0)
+    throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
+  return getQuick(index);
 }
 /**
  * Returns the element at the specified position in the receiver; <b>WARNING:</b> Does not check preconditions. 
@@ -299,7 +299,7 @@
  * @return  the index of the first occurrence of the element in the receiver; returns <code>-1</code> if the element is not found.
  */
 public int indexOf(double element) { //delta
-	return indexOfFromTo(element, 0, size-1);
+  return indexOfFromTo(element, 0, size-1);
 }
 /**
  * Returns the index of the first occurrence of the specified
@@ -314,12 +314,12 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public int indexOfFromTo(double element, int from, int to) {
-	checkRangeFromTo(from, to, size);
+  checkRangeFromTo(from, to, size);
 
-	for (int i = from ; i <= to; i++) {
-	    if (element==getQuick(i)) return i; //found
-	}
-	return -1; //not found
+  for (int i = from ; i <= to; i++) {
+      if (element==getQuick(i)) return i; //found
+  }
+  return -1; //not found
 }
 /**
  * Returns the index of the last occurrence of the specified
@@ -329,7 +329,7 @@
  * @return  the index of the last occurrence of the element in the receiver; returns <code>-1</code> if the element is not found.
  */
 public int lastIndexOf(double element) {
-	return lastIndexOfFromTo(element, 0, size-1);
+  return lastIndexOfFromTo(element, 0, size-1);
 }
 /**
  * Returns the index of the last occurrence of the specified
@@ -344,12 +344,12 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public int lastIndexOfFromTo(double element, int from, int to) {
-	checkRangeFromTo(from, to, size());
+  checkRangeFromTo(from, to, size());
 
-	for (int i = to ; i >= from; i--) {
-	    if (element==getQuick(i)) return i; //found
-	}
-	return -1; //not found
+  for (int i = to ; i >= from; i--) {
+      if (element==getQuick(i)) return i; //found
+  }
+  return -1; //not found
 }
 /**
  * Sorts the specified range of the receiver into ascending order. 
@@ -368,13 +368,13 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public void mergeSortFromTo(int from, int to) {
-	int mySize = size();
-	checkRangeFromTo(from, to, mySize);
-	
-	double[] myElements = elements();
-	org.apache.mahout.matrix.Sorting.mergeSort(myElements, from, to+1);
-	elements(myElements);
-	setSizeRaw(mySize);
+  int mySize = size();
+  checkRangeFromTo(from, to, mySize);
+  
+  double[] myElements = elements();
+  org.apache.mahout.matrix.Sorting.mergeSort(myElements, from, to+1);
+  elements(myElements);
+  setSizeRaw(mySize);
 }
 /**
  * Sorts the receiver according
@@ -398,21 +398,21 @@
  * @param to the index of the last element (inclusive) to be sorted.
  * @param c the comparator to determine the order of the receiver.
  * @throws ClassCastException if the array contains elements that are not
- *	       <i>mutually comparable</i> using the specified comparator.
+ *         <i>mutually comparable</i> using the specified comparator.
  * @throws IllegalArgumentException if <tt>fromIndex &gt; toIndex</tt>
  * @throws ArrayIndexOutOfBoundsException if <tt>fromIndex &lt; 0</tt> or
- *	       <tt>toIndex &gt; a.length</tt>
+ *         <tt>toIndex &gt; a.length</tt>
  * @see Comparator
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public void mergeSortFromTo(int from, int to, DoubleComparator c) {
-	int mySize = size();
-	checkRangeFromTo(from, to, mySize);
-	
-	double[] myElements = elements();
-	org.apache.mahout.matrix.Sorting.mergeSort(myElements, from, to+1, c);
-	elements(myElements);
-	setSizeRaw(mySize);
+  int mySize = size();
+  checkRangeFromTo(from, to, mySize);
+  
+  double[] myElements = elements();
+  org.apache.mahout.matrix.Sorting.mergeSort(myElements, from, to+1, c);
+  elements(myElements);
+  setSizeRaw(mySize);
 }
 /**
  * Returns a new list of the part of the receiver between <code>from</code>, inclusive, and <code>to</code>, inclusive.
@@ -422,12 +422,12 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public AbstractDoubleList partFromTo(int from, int to) {
-	checkRangeFromTo(from, to, size);
+  checkRangeFromTo(from, to, size);
 
-	int length = to-from+1;
-	DoubleArrayList part = new DoubleArrayList(length);
-	part.addAllOfFromTo(this,from,to);
-	return part;
+  int length = to-from+1;
+  DoubleArrayList part = new DoubleArrayList(length);
+  part.addAllOfFromTo(this,from,to);
+  return part;
 }
 /**
  * Sorts the specified range of the receiver into
@@ -446,15 +446,15 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public void quickSortFromTo(int from, int to) {
-	int mySize = size();
-	checkRangeFromTo(from, to, mySize);
-	
-	double[] myElements = elements();
-	java.util.Arrays.sort(myElements, from, to+1);
-	//org.apache.mahout.matrix.Sorting.mergeSort(myElements, from, to+1); // TODO just for debugging
-	
-	elements(myElements);
-	setSizeRaw(mySize);
+  int mySize = size();
+  checkRangeFromTo(from, to, mySize);
+  
+  double[] myElements = elements();
+  java.util.Arrays.sort(myElements, from, to+1);
+  //org.apache.mahout.matrix.Sorting.mergeSort(myElements, from, to+1); // TODO just for debugging
+  
+  elements(myElements);
+  setSizeRaw(mySize);
 }
 /**
  * Sorts the receiver according
@@ -476,21 +476,21 @@
  * @param to the index of the last element (inclusive) to be sorted.
  * @param c the comparator to determine the order of the receiver.
  * @throws ClassCastException if the array contains elements that are not
- *	       <i>mutually comparable</i> using the specified comparator.
+ *         <i>mutually comparable</i> using the specified comparator.
  * @throws IllegalArgumentException if <tt>fromIndex &gt; toIndex</tt>
  * @throws ArrayIndexOutOfBoundsException if <tt>fromIndex &lt; 0</tt> or
- *	       <tt>toIndex &gt; a.length</tt>
+ *         <tt>toIndex &gt; a.length</tt>
  * @see Comparator
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public void quickSortFromTo(int from, int to, DoubleComparator c) {
-	int mySize = size();
-	checkRangeFromTo(from, to, mySize);
-	
-	double[] myElements = elements();
-	org.apache.mahout.matrix.Sorting.quickSort(myElements, from, to+1,c);
-	elements(myElements);
-	setSizeRaw(mySize);
+  int mySize = size();
+  checkRangeFromTo(from, to, mySize);
+  
+  double[] myElements = elements();
+  org.apache.mahout.matrix.Sorting.quickSort(myElements, from, to+1,c);
+  elements(myElements);
+  setSizeRaw(mySize);
 }
 /**
 * Removes from the receiver all elements that are contained in the specified list.
@@ -500,17 +500,17 @@
 * @return <code>true</code> if the receiver changed as a result of the call.
 */
 public boolean removeAll(AbstractDoubleList other) {
-	if (other.size()==0) return false; //nothing to do
-	int limit = other.size()-1;
-	int j=0;
+  if (other.size()==0) return false; //nothing to do
+  int limit = other.size()-1;
+  int j=0;
 
-	for (int i=0; i<size ; i++) {
-		if (other.indexOfFromTo(getQuick(i), 0, limit) < 0) setQuick(j++,getQuick(i));
-	}
+  for (int i=0; i<size ; i++) {
+    if (other.indexOfFromTo(getQuick(i), 0, limit) < 0) setQuick(j++,getQuick(i));
+  }
 
-	boolean modified = (j!=size);
-	setSize(j);
-	return modified;
+  boolean modified = (j!=size);
+  setSize(j);
+  return modified;
 }
 /**
  * Removes from the receiver all elements whose index is between
@@ -523,14 +523,14 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public void removeFromTo(int from, int to) {
-	checkRangeFromTo(from, to, size);
-	int numMoved = size - to - 1;
-	if (numMoved > 0) {
-		replaceFromToWithFrom(from, from-1+numMoved, this, to+1);
-		//fillFromToWith(from+numMoved, size-1, 0.0f); //delta
-	}
-	int width = to-from+1;
-	if (width>0) setSizeRaw(size-width);
+  checkRangeFromTo(from, to, size);
+  int numMoved = size - to - 1;
+  if (numMoved > 0) {
+    replaceFromToWithFrom(from, from-1+numMoved, this, to+1);
+    //fillFromToWith(from+numMoved, size-1, 0.0f); //delta
+  }
+  int width = to-from+1;
+  if (width>0) setSizeRaw(size-width);
 }
 /**
  * Replaces a number of elements in the receiver with the same number of elements of another list.
@@ -543,22 +543,22 @@
  * @param otherFrom position of first element within other list to be copied.
  */
 public void replaceFromToWithFrom(int from, int to, AbstractDoubleList other, int otherFrom) {
-	int length=to-from+1;
-	if (length>0) {
-		checkRangeFromTo(from, to, size());
-		checkRangeFromTo(otherFrom,otherFrom+length-1,other.size());
+  int length=to-from+1;
+  if (length>0) {
+    checkRangeFromTo(from, to, size());
+    checkRangeFromTo(otherFrom,otherFrom+length-1,other.size());
 
-		// unambiguous copy (it may hold other==this)
-		if (from<=otherFrom) {
-			for (; --length >= 0; ) setQuick(from++,other.getQuick(otherFrom++));
-		}
-		else {
-			int otherTo = otherFrom+length-1;
-			for (; --length >= 0; ) setQuick(to--,other.getQuick(otherTo--));
-		}
+    // unambiguous copy (it may hold other==this)
+    if (from<=otherFrom) {
+      for (; --length >= 0; ) setQuick(from++,other.getQuick(otherFrom++));
+    }
+    else {
+      int otherTo = otherFrom+length-1;
+      for (; --length >= 0; ) setQuick(to--,other.getQuick(otherTo--));
+    }
 
-			
-	}
+      
+  }
 }
 /**
 * Replaces the part between <code>from</code> (inclusive) and <code>to</code> (inclusive) with the other list's
@@ -604,36 +604,36 @@
 * </pre>
 */
 public void replaceFromToWithFromTo(int from, int to, AbstractDoubleList other, int otherFrom, int otherTo) {
-	if (otherFrom>otherTo) {
-		throw new IndexOutOfBoundsException("otherFrom: "+otherFrom+", otherTo: "+otherTo);
-	}
+  if (otherFrom>otherTo) {
+    throw new IndexOutOfBoundsException("otherFrom: "+otherFrom+", otherTo: "+otherTo);
+  }
 
-	if (this==other && to-from!=otherTo-otherFrom) { // avoid stumbling over my own feet
-		replaceFromToWithFromTo(from, to, partFromTo(otherFrom, otherTo), 0, otherTo-otherFrom);
-		return;
-	}
-	
-	int length=otherTo-otherFrom+1;
-	int diff=length;
-	int theLast=from-1;
+  if (this==other && to-from!=otherTo-otherFrom) { // avoid stumbling over my own feet
+    replaceFromToWithFromTo(from, to, partFromTo(otherFrom, otherTo), 0, otherTo-otherFrom);
+    return;
+  }
+  
+  int length=otherTo-otherFrom+1;
+  int diff=length;
+  int theLast=from-1;
 
-	if (to>=from) {
-		diff -= (to-from+1);
-		theLast=to;
-	}
-	
-	if (diff>0) {
-		beforeInsertDummies(theLast+1, diff);
-	}
-	else {
-		if (diff<0) {
-			removeFromTo(theLast+diff, theLast-1);
-		}
-	}
+  if (to>=from) {
+    diff -= (to-from+1);
+    theLast=to;
+  }
+  
+  if (diff>0) {
+    beforeInsertDummies(theLast+1, diff);
+  }
+  else {
+    if (diff<0) {
+      removeFromTo(theLast+diff, theLast-1);
+    }
+  }
 
-	if (length>0) {
-		replaceFromToWithFrom(from,from+length-1,other,otherFrom);
-	}
+  if (length>0) {
+    replaceFromToWithFrom(from,from+length-1,other,otherFrom);
+  }
 }
 /**
  * Replaces the part of the receiver starting at <code>from</code> (inclusive) with all the elements of the specified collection.
@@ -645,12 +645,12 @@
  * @exception IndexOutOfBoundsException index is out of range (index &lt; 0 || index &gt;= size()).
  */
 public void replaceFromWith(int from, java.util.Collection other) {
-	checkRange(from,size());
-	java.util.Iterator e = other.iterator();
-	int index=from;
-	int limit = Math.min(size()-from, other.size());
-	for (int i=0; i<limit; i++)
-	    set(index++,((Number) e.next()).doubleValue()); //delta
+  checkRange(from,size());
+  java.util.Iterator e = other.iterator();
+  int index=from;
+  int limit = Math.min(size()-from, other.size());
+  for (int i=0; i<limit; i++)
+      set(index++,((Number) e.next()).doubleValue()); //delta
 }
 /**
 * Retains (keeps) only the elements in the receiver that are contained in the specified other list.
@@ -660,36 +660,36 @@
 * @return <code>true</code> if the receiver changed as a result of the call.
 */
 public boolean retainAll(AbstractDoubleList other) {
-	if (other.size()==0) {
-		if (size==0) return false;
-		setSize(0);
-		return true;
-	}
-	
-	int limit = other.size()-1;
-	int j=0;
-	for (int i=0; i<size ; i++) {
-		if (other.indexOfFromTo(getQuick(i), 0, limit) >= 0) setQuick(j++, getQuick(i));
-	}
+  if (other.size()==0) {
+    if (size==0) return false;
+    setSize(0);
+    return true;
+  }
+  
+  int limit = other.size()-1;
+  int j=0;
+  for (int i=0; i<size ; i++) {
+    if (other.indexOfFromTo(getQuick(i), 0, limit) >= 0) setQuick(j++, getQuick(i));
+  }
 
-	boolean modified = (j!=size);
-	setSize(j);
-	return modified;
+  boolean modified = (j!=size);
+  setSize(j);
+  return modified;
 }
 /**
  * Reverses the elements of the receiver.
  * Last becomes first, second last becomes second first, and so on.
  */
 public void reverse() {
-	double tmp;
-	int limit=size()/2;
-	int j=size()-1;
+  double tmp;
+  int limit=size()/2;
+  int j=size()-1;
 
-	for (int i=0; i<limit;) { //swap
-		tmp=getQuick(i);
-		setQuick(i++,getQuick(j));
-		setQuick(j--,tmp);
-	}
+  for (int i=0; i<limit;) { //swap
+    tmp=getQuick(i);
+    setQuick(i++,getQuick(j));
+    setQuick(j--,tmp);
+  }
 }
 /**
  * Replaces the element at the specified position in the receiver with the specified element.
@@ -699,9 +699,9 @@
  * @throws IndexOutOfBoundsException if <tt>index &lt; 0 || index &gt;= size()</tt>.
  */
 public void set(int index, double element) {
-	if (index >= size || index < 0)
-		throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
-	setQuick(index,element);
+  if (index >= size || index < 0)
+    throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
+  setQuick(index,element);
 }
 /**
  * Replaces the element at the specified position in the receiver with the specified element; <b>WARNING:</b> Does not check preconditions.
@@ -732,7 +732,7 @@
  * }
  */
 protected void setSizeRaw(int newSize) {
-	size = newSize;
+  size = newSize;
 }
 /**
  * Randomly permutes the part of the receiver between <code>from</code> (inclusive) and <code>to</code> (inclusive). 
@@ -741,17 +741,17 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public void shuffleFromTo(int from, int to) {
-	checkRangeFromTo(from, to, size());
-	
-	org.apache.mahout.jet.random.Uniform gen = new org.apache.mahout.jet.random.Uniform(org.apache.mahout.jet.random.Uniform.makeDefaultGenerator());
-	for (int i=from; i<to; i++) { 
-		int random = gen.nextIntFromTo(i, to);
+  checkRangeFromTo(from, to, size());
+  
+  org.apache.mahout.jet.random.Uniform gen = new org.apache.mahout.jet.random.Uniform(org.apache.mahout.jet.random.Uniform.makeDefaultGenerator());
+  for (int i=from; i<to; i++) { 
+    int random = gen.nextIntFromTo(i, to);
 
-		//swap(i, random)
-		double tmpElement = getQuick(random);
-		setQuick(random,getQuick(i)); 
-		setQuick(i,tmpElement); 
-	}  
+    //swap(i, random)
+    double tmpElement = getQuick(random);
+    setQuick(random,getQuick(i)); 
+    setQuick(i,tmpElement); 
+  }  
 }
 /**
  * Returns the number of elements contained in the receiver.
@@ -759,33 +759,33 @@
  * @returns  the number of elements contained in the receiver.
  */
 public int size() {
-	return size;
+  return size;
 }
 /**
  * Returns a list which is a concatenation of <code>times</code> times the receiver.
  * @param times the number of times the receiver shall be copied.
  */
 public AbstractDoubleList times(int times) {
-	AbstractDoubleList newList = new DoubleArrayList(times*size());
-	for (int i=times; --i >= 0; ) {
-		newList.addAllOfFromTo(this,0,size()-1);
-	}
-	return newList;
+  AbstractDoubleList newList = new DoubleArrayList(times*size());
+  for (int i=times; --i >= 0; ) {
+    newList.addAllOfFromTo(this,0,size()-1);
+  }
+  return newList;
 }
 /**
  * Returns a <code>java.util.ArrayList</code> containing all the elements in the receiver.
  */
 public java.util.ArrayList toList() {
-	int mySize = size();
-	java.util.ArrayList list = new java.util.ArrayList(mySize);
-	for (int i=0; i < mySize; i++) list.add(new Double(get(i)));
-	return list;
+  int mySize = size();
+  java.util.ArrayList list = new java.util.ArrayList(mySize);
+  for (int i=0; i < mySize; i++) list.add(new Double(get(i)));
+  return list;
 }
 /**
 * Returns a string representation of the receiver, containing
 * the String representation of each element.
 */
 public String toString() {
-	return org.apache.mahout.matrix.Arrays.toString(partFromTo(0, size()-1).elements());
+  return org.apache.mahout.matrix.Arrays.toString(partFromTo(0, size()-1).elements());
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/list/LongArrayList.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/list/LongArrayList.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/list/LongArrayList.java	(working copy)
@@ -18,17 +18,17 @@
  */
 @Deprecated
 public class LongArrayList extends AbstractLongList {
-	/**
-	 * The array buffer into which the elements of the list are stored.
-	 * The capacity of the list is the length of this array buffer.
-	 * @serial
-	 */
-	protected long[] elements;
+  /**
+   * The array buffer into which the elements of the list are stored.
+   * The capacity of the list is the length of this array buffer.
+   * @serial
+   */
+  protected long[] elements;
 /**
  * Constructs an empty list.
  */
 public LongArrayList() {
-	this(10);
+  this(10);
 }
 /**
  * Constructs a list containing the specified elements. 
@@ -40,7 +40,7 @@
  * @param elements the array to be backed by the the constructed list
  */
 public LongArrayList(long[] elements) {
-	elements(elements);
+  elements(elements);
 }
 /**
  * Constructs an empty list with the specified initial capacity.
@@ -48,8 +48,8 @@
  * @param   initialCapacity   the number of elements the receiver can hold without auto-expanding itself by allocating new internal memory.
  */
 public LongArrayList(int initialCapacity) {
-	this(new long[initialCapacity]);
-	setSizeRaw(0);
+  this(new long[initialCapacity]);
+  setSizeRaw(0);
 }
 /**
  * Appends the specified element to the end of this list.
@@ -57,9 +57,9 @@
  * @param element element to be appended to this list.
  */
 public void add(long element) {
-	// overridden for performance only.
-	if (size == elements.length) ensureCapacity(size + 1); 
-	elements[size++] = element;
+  // overridden for performance only.
+  if (size == elements.length) ensureCapacity(size + 1); 
+  elements[size++] = element;
 }
 /**
  * Inserts the specified element before the specified position into the receiver. 
@@ -71,13 +71,13 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>index &lt; 0 || index &gt; size()</tt>).
  */
 public void beforeInsert(int index, long element) {
-	// overridden for performance only.
-	if (index > size || index < 0) 
-		throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
-	ensureCapacity(size + 1);
-	System.arraycopy(elements, index, elements, index+1, size-index);
-	elements[index] = element;
-	size++;
+  // overridden for performance only.
+  if (index > size || index < 0) 
+    throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
+  ensureCapacity(size + 1);
+  System.arraycopy(elements, index, elements, index+1, size-index);
+  elements[index] = element;
+  size++;
 }
 /**
  * Searches the receiver for the specified value using
@@ -92,18 +92,18 @@
  * @param from the leftmost search position, inclusive.
  * @param to the rightmost search position, inclusive.
  * @return index of the search key, if it is contained in the receiver;
- *	       otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
- *	       point</i> is defined as the the point at which the value would
- * 	       be inserted into the receiver: the index of the first
- *	       element greater than the key, or <tt>receiver.size()</tt>, if all
- *	       elements in the receiver are less than the specified key.  Note
- *	       that this guarantees that the return value will be &gt;= 0 if
- *	       and only if the key is found.
+ *         otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
+ *         point</i> is defined as the the point at which the value would
+ *          be inserted into the receiver: the index of the first
+ *         element greater than the key, or <tt>receiver.size()</tt>, if all
+ *         elements in the receiver are less than the specified key.  Note
+ *         that this guarantees that the return value will be &gt;= 0 if
+ *         and only if the key is found.
  * @see org.apache.mahout.matrix.Sorting
  * @see java.util.Arrays
  */
 public int binarySearchFromTo(long key, int from, int to) {
-	return org.apache.mahout.matrix.Sorting.binarySearchFromTo(this.elements,key,from,to);
+  return org.apache.mahout.matrix.Sorting.binarySearchFromTo(this.elements,key,from,to);
 }
 /**
  * Returns a deep copy of the receiver. 
@@ -111,10 +111,10 @@
  * @return  a deep copy of the receiver.
  */
 public Object clone() {
-	// overridden for performance only.
-	LongArrayList clone = new LongArrayList((long[]) elements.clone());
-	clone.setSizeRaw(size);
-	return clone;
+  // overridden for performance only.
+  LongArrayList clone = new LongArrayList((long[]) elements.clone());
+  clone.setSizeRaw(size);
+  return clone;
 }
 /**
  * Returns a deep copy of the receiver; uses <code>clone()</code> and casts the result.
@@ -122,7 +122,7 @@
  * @return  a deep copy of the receiver.
  */
 public LongArrayList copy() {
-	return (LongArrayList) clone();
+  return (LongArrayList) clone();
 }
  /**
  * Sorts the specified range of the receiver into ascending numerical order. 
@@ -139,28 +139,28 @@
  * @param max the largest element contained in the range.
  */
 protected void countSortFromTo(int from, int to, long min, long max) {
-	if (size==0) return;
-	checkRangeFromTo(from, to, size);
+  if (size==0) return;
+  checkRangeFromTo(from, to, size);
 
-	final int width = (int) (max-min+1);
-	
-	int[] counts = new int[width];
-	long[] theElements = elements;	
-	for (int i=from; i<=to; ) counts[(int)(theElements[i++]-min)]++;
+  final int width = (int) (max-min+1);
+  
+  int[] counts = new int[width];
+  long[] theElements = elements;  
+  for (int i=from; i<=to; ) counts[(int)(theElements[i++]-min)]++;
 
-	int fromIndex = from;
-	long val = min;
-	for (int i=0; i<width; i++, val++) {
-		int c = counts[i];
-		if (c>0) {
-			if (c==1) theElements[fromIndex++]=val;
-			else {
-				int toIndex = fromIndex + c - 1;
-				fillFromToWith(fromIndex,toIndex,val);
-				fromIndex = toIndex + 1;
-			}
-		}
-	}
+  int fromIndex = from;
+  long val = min;
+  for (int i=0; i<width; i++, val++) {
+    int c = counts[i];
+    if (c>0) {
+      if (c==1) theElements[fromIndex++]=val;
+      else {
+        int toIndex = fromIndex + c - 1;
+        fillFromToWith(fromIndex,toIndex,val);
+        fromIndex = toIndex + 1;
+      }
+    }
+  }
 }
 /**
  * Returns the elements currently stored, including invalid elements between size and capacity, if any.
@@ -171,7 +171,7 @@
  * @return the elements currently stored.
  */
 public long[] elements() {
-	return elements;
+  return elements;
 }
 /**
  * Sets the receiver's elements to be the specified array (not a copy of it).
@@ -184,9 +184,9 @@
  * @return the receiver itself.
  */
 public AbstractLongList elements(long[] elements) {
-	this.elements=elements;
-	this.size=elements.length;
-	return this;
+  this.elements=elements;
+  this.size=elements.length;
+  return this;
 }
 /**
  * Ensures that the receiver can hold at least the specified number of elements without needing to allocate new internal memory.
@@ -195,7 +195,7 @@
  * @param   minCapacity   the desired minimum capacity.
  */
 public void ensureCapacity(int minCapacity) {
-	elements = org.apache.mahout.matrix.Arrays.ensureCapacity(elements,minCapacity);
+  elements = org.apache.mahout.matrix.Arrays.ensureCapacity(elements,minCapacity);
 }
 /**
  * Compares the specified Object with the receiver.  
@@ -208,19 +208,19 @@
  * @return true if the specified Object is equal to the receiver.
  */
 public boolean equals(Object otherObj) { //delta
-	// overridden for performance only.
-	if (! (otherObj instanceof LongArrayList)) return super.equals(otherObj);
-	if (this==otherObj) return true;
-	if (otherObj==null) return false;
-	LongArrayList other = (LongArrayList) otherObj;
-	if (size()!=other.size()) return false;
+  // overridden for performance only.
+  if (! (otherObj instanceof LongArrayList)) return super.equals(otherObj);
+  if (this==otherObj) return true;
+  if (otherObj==null) return false;
+  LongArrayList other = (LongArrayList) otherObj;
+  if (size()!=other.size()) return false;
 
-	long[] theElements = elements();
-	long[] otherElements = other.elements();
-	for (int i=size(); --i >= 0; ) {
-	    if (theElements[i] != otherElements[i]) return false;
-	}
-	return true;
+  long[] theElements = elements();
+  long[] otherElements = other.elements();
+  for (int i=size(); --i >= 0; ) {
+      if (theElements[i] != otherElements[i]) return false;
+  }
+  return true;
 }
 /**
  * Applies a procedure to each element of the receiver, if any.
@@ -229,25 +229,25 @@
  * @return <tt>false</tt> if the procedure stopped before all elements where iterated over, <tt>true</tt> otherwise. 
  */
 public boolean forEach(LongProcedure procedure) {
-	// overridden for performance only.
-	long[] theElements = elements;
-	int theSize = size;
-	
-	for (int i=0; i<theSize;) if (! procedure.apply(theElements[i++])) return false;
-	return true;
+  // overridden for performance only.
+  long[] theElements = elements;
+  int theSize = size;
+  
+  for (int i=0; i<theSize;) if (! procedure.apply(theElements[i++])) return false;
+  return true;
 }
 /**
  * Returns the element at the specified position in the receiver.
  *
  * @param index index of element to return.
  * @exception IndexOutOfBoundsException index is out of range (index
- * 		  &lt; 0 || index &gt;= size()).
+ *       &lt; 0 || index &gt;= size()).
  */
 public long get(int index) {
-	// overridden for performance only.
-	if (index >= size || index < 0)
-		throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
-	return elements[index];
+  // overridden for performance only.
+  if (index >= size || index < 0)
+    throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
+  return elements[index];
 }
 /**
  * Returns the element at the specified position in the receiver; <b>WARNING:</b> Does not check preconditions. 
@@ -258,7 +258,7 @@
  * @param index index of element to return.
  */
 public long getQuick(int index) {
-	return elements[index];
+  return elements[index];
 }
 /**
  * Returns the index of the first occurrence of the specified
@@ -273,15 +273,15 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public int indexOfFromTo(long element, int from, int to) {
-	// overridden for performance only.
-	if (size==0) return -1;
-	checkRangeFromTo(from, to, size);
+  // overridden for performance only.
+  if (size==0) return -1;
+  checkRangeFromTo(from, to, size);
 
-	long[] theElements = elements;
-	for (int i = from ; i <= to; i++) {
-	    if (element==theElements[i]) {return i;} //found
-	}
-	return -1; //not found
+  long[] theElements = elements;
+  for (int i = from ; i <= to; i++) {
+      if (element==theElements[i]) {return i;} //found
+  }
+  return -1; //not found
 }
 /**
  * Returns the index of the last occurrence of the specified
@@ -296,15 +296,15 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public int lastIndexOfFromTo(long element, int from, int to) {
-	// overridden for performance only.
-	if (size==0) return -1;
-	checkRangeFromTo(from, to, size);
+  // overridden for performance only.
+  if (size==0) return -1;
+  checkRangeFromTo(from, to, size);
 
-	long[] theElements = elements;
-	for (int i = to ; i >= from; i--) {
-	    if (element==theElements[i]) {return i;} //found
-	}
-	return -1; //not found
+  long[] theElements = elements;
+  for (int i = to ; i >= from; i--) {
+      if (element==theElements[i]) {return i;} //found
+  }
+  return -1; //not found
 }
 /**
  * Returns a new list of the part of the receiver between <code>from</code>, inclusive, and <code>to</code>, inclusive.
@@ -314,13 +314,13 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public AbstractLongList partFromTo(int from, int to) {
-	if (size==0) return new LongArrayList(0);
+  if (size==0) return new LongArrayList(0);
 
-	checkRangeFromTo(from, to, size);
+  checkRangeFromTo(from, to, size);
 
-	long[] part = new long[to-from+1];
-	System.arraycopy(elements, from, part, 0, to-from+1);
-	return new LongArrayList(part);
+  long[] part = new long[to-from+1];
+  System.arraycopy(elements, from, part, 0, to-from+1);
+  return new LongArrayList(part);
 }
 /**
 * Removes from the receiver all elements that are contained in the specified list.
@@ -330,46 +330,46 @@
 * @return <code>true</code> if the receiver changed as a result of the call.
 */
 public boolean removeAll(AbstractLongList other) {
-	// overridden for performance only.
-	if (! (other instanceof LongArrayList))	return super.removeAll(other);
-	
-	/* There are two possibilities to do the thing
-	   a) use other.indexOf(...)
-	   b) sort other, then use other.binarySearch(...)
-	   
-	   Let's try to figure out which one is faster. Let M=size, N=other.size, then
-	   a) takes O(M*N) steps
-	   b) takes O(N*logN + M*logN) steps (sorting is O(N*logN) and binarySearch is O(logN))
+  // overridden for performance only.
+  if (! (other instanceof LongArrayList))  return super.removeAll(other);
+  
+  /* There are two possibilities to do the thing
+     a) use other.indexOf(...)
+     b) sort other, then use other.binarySearch(...)
+     
+     Let's try to figure out which one is faster. Let M=size, N=other.size, then
+     a) takes O(M*N) steps
+     b) takes O(N*logN + M*logN) steps (sorting is O(N*logN) and binarySearch is O(logN))
  
-	   Hence, if N*logN + M*logN < M*N, we use b) otherwise we use a).
-	*/
-	if (other.size()==0) {return false;} //nothing to do
-	int limit = other.size()-1;
-	int j=0;
-	long[] theElements = elements;
-	int mySize = size();
+     Hence, if N*logN + M*logN < M*N, we use b) otherwise we use a).
+  */
+  if (other.size()==0) {return false;} //nothing to do
+  int limit = other.size()-1;
+  int j=0;
+  long[] theElements = elements;
+  int mySize = size();
 
-	double N=(double) other.size();
-	double M=(double) mySize;
-	if ( (N+M)* org.apache.mahout.jet.math.Arithmetic.log2(N) < M*N ) {
-		// it is faster to sort other before searching in it
-		LongArrayList sortedList = (LongArrayList) other.clone();
-		sortedList.quickSort();
+  double N=(double) other.size();
+  double M=(double) mySize;
+  if ( (N+M)* org.apache.mahout.jet.math.Arithmetic.log2(N) < M*N ) {
+    // it is faster to sort other before searching in it
+    LongArrayList sortedList = (LongArrayList) other.clone();
+    sortedList.quickSort();
 
-		for (int i=0; i<mySize ; i++) {
-			if (sortedList.binarySearchFromTo(theElements[i], 0, limit) < 0) theElements[j++]=theElements[i];
-		}
-	}
-	else {
-		// it is faster to search in other without sorting
-		for (int i=0; i<mySize ; i++) {
-			if (other.indexOfFromTo(theElements[i], 0, limit) < 0) theElements[j++]=theElements[i];
-		}
-	}
+    for (int i=0; i<mySize ; i++) {
+      if (sortedList.binarySearchFromTo(theElements[i], 0, limit) < 0) theElements[j++]=theElements[i];
+    }
+  }
+  else {
+    // it is faster to search in other without sorting
+    for (int i=0; i<mySize ; i++) {
+      if (other.indexOfFromTo(theElements[i], 0, limit) < 0) theElements[j++]=theElements[i];
+    }
+  }
 
-	boolean modified = (j!=mySize);
-	setSize(j);
-	return modified;
+  boolean modified = (j!=mySize);
+  setSize(j);
+  return modified;
 }
 /**
  * Replaces a number of elements in the receiver with the same number of elements of another list.
@@ -382,18 +382,18 @@
  * @param otherFrom position of first element within other list to be copied.
  */
 public void replaceFromToWithFrom(int from, int to, AbstractLongList other, int otherFrom) {
-	// overridden for performance only.
-	if (! (other instanceof LongArrayList)) {
-		// slower
-		super.replaceFromToWithFrom(from,to,other,otherFrom);
-		return;
-	}
-	int length=to-from+1;
-	if (length>0) {
-		checkRangeFromTo(from, to, size());
-		checkRangeFromTo(otherFrom,otherFrom+length-1,other.size());
-		System.arraycopy(((LongArrayList) other).elements, otherFrom, elements, from, length);
-	}
+  // overridden for performance only.
+  if (! (other instanceof LongArrayList)) {
+    // slower
+    super.replaceFromToWithFrom(from,to,other,otherFrom);
+    return;
+  }
+  int length=to-from+1;
+  if (length>0) {
+    checkRangeFromTo(from, to, size());
+    checkRangeFromTo(otherFrom,otherFrom+length-1,other.size());
+    System.arraycopy(((LongArrayList) other).elements, otherFrom, elements, from, length);
+  }
 }
 /**
 * Retains (keeps) only the elements in the receiver that are contained in the specified other list.
@@ -403,62 +403,62 @@
 * @return <code>true</code> if the receiver changed as a result of the call.
 */
 public boolean retainAll(AbstractLongList other) {
-	// overridden for performance only.
-	if (! (other instanceof LongArrayList))	return super.retainAll(other);
-	
-	/* There are two possibilities to do the thing
-	   a) use other.indexOf(...)
-	   b) sort other, then use other.binarySearch(...)
-	   
-	   Let's try to figure out which one is faster. Let M=size, N=other.size, then
-	   a) takes O(M*N) steps
-	   b) takes O(N*logN + M*logN) steps (sorting is O(N*logN) and binarySearch is O(logN))
+  // overridden for performance only.
+  if (! (other instanceof LongArrayList))  return super.retainAll(other);
+  
+  /* There are two possibilities to do the thing
+     a) use other.indexOf(...)
+     b) sort other, then use other.binarySearch(...)
+     
+     Let's try to figure out which one is faster. Let M=size, N=other.size, then
+     a) takes O(M*N) steps
+     b) takes O(N*logN + M*logN) steps (sorting is O(N*logN) and binarySearch is O(logN))
 
-	   Hence, if N*logN + M*logN < M*N, we use b) otherwise we use a).
-	*/
-	int limit = other.size()-1;
-	int j=0;
-	long[] theElements = elements;
-	int mySize = size();
+     Hence, if N*logN + M*logN < M*N, we use b) otherwise we use a).
+  */
+  int limit = other.size()-1;
+  int j=0;
+  long[] theElements = elements;
+  int mySize = size();
 
-	double N=(double) other.size();
-	double M=(double) mySize;
-	if ( (N+M)* org.apache.mahout.jet.math.Arithmetic.log2(N) < M*N ) {
-		// it is faster to sort other before searching in it
-		LongArrayList sortedList = (LongArrayList) other.clone();
-		sortedList.quickSort();
+  double N=(double) other.size();
+  double M=(double) mySize;
+  if ( (N+M)* org.apache.mahout.jet.math.Arithmetic.log2(N) < M*N ) {
+    // it is faster to sort other before searching in it
+    LongArrayList sortedList = (LongArrayList) other.clone();
+    sortedList.quickSort();
 
-		for (int i=0; i<mySize ; i++) {
-			if (sortedList.binarySearchFromTo(theElements[i], 0, limit) >= 0) theElements[j++]=theElements[i];
-		}
-	}
-	else {
-		// it is faster to search in other without sorting
-		for (int i=0; i<mySize ; i++) {
-			if (other.indexOfFromTo(theElements[i], 0, limit) >= 0) theElements[j++]=theElements[i];
-		}
-	}
+    for (int i=0; i<mySize ; i++) {
+      if (sortedList.binarySearchFromTo(theElements[i], 0, limit) >= 0) theElements[j++]=theElements[i];
+    }
+  }
+  else {
+    // it is faster to search in other without sorting
+    for (int i=0; i<mySize ; i++) {
+      if (other.indexOfFromTo(theElements[i], 0, limit) >= 0) theElements[j++]=theElements[i];
+    }
+  }
 
-	boolean modified = (j!=mySize);
-	setSize(j);
-	return modified;
+  boolean modified = (j!=mySize);
+  setSize(j);
+  return modified;
 }
 /**
  * Reverses the elements of the receiver.
  * Last becomes first, second last becomes second first, and so on.
  */
 public void reverse() {
-	// overridden for performance only.
-	long tmp;
-	int limit=size/2;
-	int j=size-1;
+  // overridden for performance only.
+  long tmp;
+  int limit=size/2;
+  int j=size-1;
 
-	long[] theElements = elements;
-	for (int i=0; i<limit;) { //swap
-		tmp=theElements[i];
-		theElements[i++]=theElements[j];
-		theElements[j--]=tmp;
-	}
+  long[] theElements = elements;
+  for (int i=0; i<limit;) { //swap
+    tmp=theElements[i];
+    theElements[i++]=theElements[j];
+    theElements[j--]=tmp;
+  }
 }
 /**
  * Replaces the element at the specified position in the receiver with the specified element.
@@ -466,13 +466,13 @@
  * @param index index of element to replace.
  * @param element element to be stored at the specified position.
  * @exception IndexOutOfBoundsException index is out of range (index
- * 		  &lt; 0 || index &gt;= size()).
+ *       &lt; 0 || index &gt;= size()).
  */
 public void set(int index, long element) {
-	// overridden for performance only.
-	if (index >= size || index < 0)
-		throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
-	elements[index] = element;
+  // overridden for performance only.
+  if (index >= size || index < 0)
+    throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
+  elements[index] = element;
 }
 /**
  * Replaces the element at the specified position in the receiver with the specified element; <b>WARNING:</b> Does not check preconditions.
@@ -484,7 +484,7 @@
  * @param element element to be stored at the specified position.
  */
 public void setQuick(int index, long element) {
-	elements[index] = element;
+  elements[index] = element;
 }
 /**
  * Randomly permutes the part of the receiver between <code>from</code> (inclusive) and <code>to</code> (inclusive). 
@@ -493,22 +493,22 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public void shuffleFromTo(int from, int to) {
-	// overridden for performance only.
-	if (size==0) return;
-	checkRangeFromTo(from, to, size);
-	
-	org.apache.mahout.jet.random.Uniform gen = new org.apache.mahout.jet.random.Uniform(new org.apache.mahout.jet.random.engine.DRand(new java.util.Date()));
-	long tmpElement;
-	long[] theElements = elements;
-	int random;
-	for (int i=from; i<to; i++) { 
-		random = gen.nextIntFromTo(i, to);
+  // overridden for performance only.
+  if (size==0) return;
+  checkRangeFromTo(from, to, size);
+  
+  org.apache.mahout.jet.random.Uniform gen = new org.apache.mahout.jet.random.Uniform(new org.apache.mahout.jet.random.engine.DRand(new java.util.Date()));
+  long tmpElement;
+  long[] theElements = elements;
+  int random;
+  for (int i=from; i<to; i++) { 
+    random = gen.nextIntFromTo(i, to);
 
-		//swap(i, random)
-		tmpElement = theElements[random];
-		theElements[random]=theElements[i]; 
-		theElements[i]=tmpElement; 
-	}  
+    //swap(i, random)
+    tmpElement = theElements[random];
+    theElements[random]=theElements[i]; 
+    theElements[i]=tmpElement; 
+  }  
 }
 /**
  * Sorts the specified range of the receiver into ascending order. 
@@ -527,39 +527,39 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public void sortFromTo(int from, int to) {
-	/* 
-	 * Computes min and max and decides on this basis.
-	 * In practice the additional overhead is very small compared to the potential gains.
-	 */
-	final int widthThreshold = 10000; // never consider options resulting in outrageous memory allocations.
-	
-	if (size==0) return;
-	checkRangeFromTo(from, to, size);
+  /* 
+   * Computes min and max and decides on this basis.
+   * In practice the additional overhead is very small compared to the potential gains.
+   */
+  final int widthThreshold = 10000; // never consider options resulting in outrageous memory allocations.
+  
+  if (size==0) return;
+  checkRangeFromTo(from, to, size);
 
-	// determine minimum and maximum.
-	long min=elements[from];
-	long max=elements[from];
+  // determine minimum and maximum.
+  long min=elements[from];
+  long max=elements[from];
 
-	long[] theElements = elements;
-	for (int i=from+1; i<=to; ) {
-		long elem = theElements[i++];
-		if (elem>max) max=elem;
-		else if (elem<min) min=elem;
-	}
+  long[] theElements = elements;
+  for (int i=from+1; i<=to; ) {
+    long elem = theElements[i++];
+    if (elem>max) max=elem;
+    else if (elem<min) min=elem;
+  }
 
-	// try to figure out which option is fastest.
-	double N = (double)to - (double)from + 1.0;
-	double quickSortEstimate = 	N * Math.log(N)/0.6931471805599453; // O(N*log(N,base=2)) ; ln(2)=0.6931471805599453
+  // try to figure out which option is fastest.
+  double N = (double)to - (double)from + 1.0;
+  double quickSortEstimate =   N * Math.log(N)/0.6931471805599453; // O(N*log(N,base=2)) ; ln(2)=0.6931471805599453
 
-	double width = (double)max - (double)min + 1.0;
-	double countSortEstimate = 	Math.max(width,N); // O(Max(width,N))
-	
-	if (width < widthThreshold && countSortEstimate < quickSortEstimate) {
-		countSortFromTo(from, to, min, max);
-	}
-	else {
-		quickSortFromTo(from, to);
-	}
+  double width = (double)max - (double)min + 1.0;
+  double countSortEstimate =   Math.max(width,N); // O(Max(width,N))
+  
+  if (width < widthThreshold && countSortEstimate < quickSortEstimate) {
+    countSortFromTo(from, to, min, max);
+  }
+  else {
+    quickSortFromTo(from, to);
+  }
 }
 /**
  * Trims the capacity of the receiver to be the receiver's current 
@@ -567,6 +567,6 @@
  * storage of the receiver.
  */
 public void trimToSize() {
-	elements = org.apache.mahout.matrix.Arrays.trimToCapacity(elements,size());
+  elements = org.apache.mahout.matrix.Arrays.trimToCapacity(elements,size());
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/list/ShortArrayList.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/list/ShortArrayList.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/list/ShortArrayList.java	(working copy)
@@ -18,17 +18,17 @@
  */
 @Deprecated
 public class ShortArrayList extends AbstractShortList {
-	/**
-	 * The array buffer into which the elements of the list are stored.
-	 * The capacity of the list is the length of this array buffer.
-	 * @serial
-	 */
-	protected short[] elements;
+  /**
+   * The array buffer into which the elements of the list are stored.
+   * The capacity of the list is the length of this array buffer.
+   * @serial
+   */
+  protected short[] elements;
 /**
  * Constructs an empty list.
  */
 public ShortArrayList() {
-	this(10);
+  this(10);
 }
 /**
  * Constructs a list containing the specified elements. 
@@ -40,7 +40,7 @@
  * @param elements the array to be backed by the the constructed list
  */
 public ShortArrayList(short[] elements) {
-	elements(elements);
+  elements(elements);
 }
 /**
  * Constructs an empty list with the specified initial capacity.
@@ -48,8 +48,8 @@
  * @param   initialCapacity   the number of elements the receiver can hold without auto-expanding itself by allocating new internal memory.
  */
 public ShortArrayList(int initialCapacity) {
-	this(new short[initialCapacity]);
-	setSizeRaw(0);
+  this(new short[initialCapacity]);
+  setSizeRaw(0);
 }
 /**
  * Appends the specified element to the end of this list.
@@ -57,11 +57,11 @@
  * @param element element to be appended to this list.
  */
 public void add(short element) {
-	// overridden for performance only.
-	if (size == elements.length) {
-		ensureCapacity(size + 1); 
-	}
-	elements[size++] = element;
+  // overridden for performance only.
+  if (size == elements.length) {
+    ensureCapacity(size + 1); 
+  }
+  elements[size++] = element;
 }
 /**
  * Inserts the specified element before the specified position into the receiver. 
@@ -73,13 +73,13 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>index &lt; 0 || index &gt; size()</tt>).
  */
 public void beforeInsert(int index, short element) {
-	// overridden for performance only.
-	if (index > size || index < 0) 
-		throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
-	ensureCapacity(size + 1);
-	System.arraycopy(elements, index, elements, index+1, size-index);
-	elements[index] = element;
-	size++;
+  // overridden for performance only.
+  if (index > size || index < 0) 
+    throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
+  ensureCapacity(size + 1);
+  System.arraycopy(elements, index, elements, index+1, size-index);
+  elements[index] = element;
+  size++;
 }
 /**
  * Searches the receiver for the specified value using
@@ -94,18 +94,18 @@
  * @param from the leftmost search position, inclusive.
  * @param to the rightmost search position, inclusive.
  * @return index of the search key, if it is contained in the receiver;
- *	       otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
- *	       point</i> is defined as the the point at which the value would
- * 	       be inserted into the receiver: the index of the first
- *	       element greater than the key, or <tt>receiver.size()</tt>, if all
- *	       elements in the receiver are less than the specified key.  Note
- *	       that this guarantees that the return value will be &gt;= 0 if
- *	       and only if the key is found.
+ *         otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
+ *         point</i> is defined as the the point at which the value would
+ *          be inserted into the receiver: the index of the first
+ *         element greater than the key, or <tt>receiver.size()</tt>, if all
+ *         elements in the receiver are less than the specified key.  Note
+ *         that this guarantees that the return value will be &gt;= 0 if
+ *         and only if the key is found.
  * @see org.apache.mahout.matrix.Sorting
  * @see java.util.Arrays
  */
 public int binarySearchFromTo(short key, int from, int to) {
-	return org.apache.mahout.matrix.Sorting.binarySearchFromTo(this.elements,key,from,to);
+  return org.apache.mahout.matrix.Sorting.binarySearchFromTo(this.elements,key,from,to);
 }
 /**
  * Returns a deep copy of the receiver. 
@@ -113,10 +113,10 @@
  * @return  a deep copy of the receiver.
  */
 public Object clone() {
-	// overridden for performance only.
-	ShortArrayList clone = new ShortArrayList((short[]) elements.clone());
-	clone.setSizeRaw(size);
-	return clone;
+  // overridden for performance only.
+  ShortArrayList clone = new ShortArrayList((short[]) elements.clone());
+  clone.setSizeRaw(size);
+  return clone;
 }
 /**
  * Returns a deep copy of the receiver; uses <code>clone()</code> and casts the result.
@@ -124,7 +124,7 @@
  * @return  a deep copy of the receiver.
  */
 public ShortArrayList copy() {
-	return (ShortArrayList) clone();
+  return (ShortArrayList) clone();
 }
  /**
  * Sorts the specified range of the receiver into ascending numerical order. 
@@ -141,28 +141,28 @@
  * @param max the largest element contained in the range.
  */
 protected void countSortFromTo(int from, int to, short min, short max) {
-	if (size==0) return;
-	checkRangeFromTo(from, to, size);
+  if (size==0) return;
+  checkRangeFromTo(from, to, size);
 
-	final int width = (int) (max-min+1);
-	
-	int[] counts = new int[width];
-	short[] theElements = elements;	
-	for (int i=from; i<=to; ) counts[(int)(theElements[i++]-min)]++;
+  final int width = (int) (max-min+1);
+  
+  int[] counts = new int[width];
+  short[] theElements = elements;  
+  for (int i=from; i<=to; ) counts[(int)(theElements[i++]-min)]++;
 
-	int fromIndex = from;
-	short val = min;
-	for (int i=0; i<width; i++, val++) {
-		int c = counts[i];
-		if (c>0) {
-			if (c==1) theElements[fromIndex++]=val;
-			else {
-				int toIndex = fromIndex + c - 1;
-				fillFromToWith(fromIndex,toIndex,val);
-				fromIndex = toIndex + 1;
-			}
-		}
-	}
+  int fromIndex = from;
+  short val = min;
+  for (int i=0; i<width; i++, val++) {
+    int c = counts[i];
+    if (c>0) {
+      if (c==1) theElements[fromIndex++]=val;
+      else {
+        int toIndex = fromIndex + c - 1;
+        fillFromToWith(fromIndex,toIndex,val);
+        fromIndex = toIndex + 1;
+      }
+    }
+  }
 }
 /**
  * Returns the elements currently stored, including invalid elements between size and capacity, if any.
@@ -173,7 +173,7 @@
  * @return the elements currently stored.
  */
 public short[] elements() {
-	return elements;
+  return elements;
 }
 /**
  * Sets the receiver's elements to be the specified array (not a copy of it).
@@ -186,9 +186,9 @@
  * @return the receiver itself.
  */
 public AbstractShortList elements(short[] elements) {
-	this.elements=elements;
-	this.size=elements.length;
-	return this;
+  this.elements=elements;
+  this.size=elements.length;
+  return this;
 }
 /**
  * Ensures that the receiver can hold at least the specified number of elements without needing to allocate new internal memory.
@@ -197,7 +197,7 @@
  * @param   minCapacity   the desired minimum capacity.
  */
 public void ensureCapacity(int minCapacity) {
-	elements = org.apache.mahout.matrix.Arrays.ensureCapacity(elements,minCapacity);
+  elements = org.apache.mahout.matrix.Arrays.ensureCapacity(elements,minCapacity);
 }
 /**
  * Compares the specified Object with the receiver.  
@@ -210,19 +210,19 @@
  * @return true if the specified Object is equal to the receiver.
  */
 public boolean equals(Object otherObj) { //delta
-	// overridden for performance only.
-	if (! (otherObj instanceof ShortArrayList)) return super.equals(otherObj);
-	if (this==otherObj) return true;
-	if (otherObj==null) return false;
-	ShortArrayList other = (ShortArrayList) otherObj;
-	if (size()!=other.size()) return false;
+  // overridden for performance only.
+  if (! (otherObj instanceof ShortArrayList)) return super.equals(otherObj);
+  if (this==otherObj) return true;
+  if (otherObj==null) return false;
+  ShortArrayList other = (ShortArrayList) otherObj;
+  if (size()!=other.size()) return false;
 
-	short[] theElements = elements();
-	short[] otherElements = other.elements();
-	for (int i=size(); --i >= 0; ) {
-	    if (theElements[i] != otherElements[i]) return false;
-	}
-	return true;
+  short[] theElements = elements();
+  short[] otherElements = other.elements();
+  for (int i=size(); --i >= 0; ) {
+      if (theElements[i] != otherElements[i]) return false;
+  }
+  return true;
 }
 /**
  * Applies a procedure to each element of the receiver, if any.
@@ -231,25 +231,25 @@
  * @return <tt>false</tt> if the procedure stopped before all elements where iterated over, <tt>true</tt> otherwise. 
  */
 public boolean forEach(ShortProcedure procedure) {
-	// overridden for performance only.
-	short[] theElements = elements;
-	int theSize = size;
-	
-	for (int i=0; i<theSize;) if (! procedure.apply(theElements[i++])) return false;
-	return true;
+  // overridden for performance only.
+  short[] theElements = elements;
+  int theSize = size;
+  
+  for (int i=0; i<theSize;) if (! procedure.apply(theElements[i++])) return false;
+  return true;
 }
 /**
  * Returns the element at the specified position in the receiver.
  *
  * @param index index of element to return.
  * @exception IndexOutOfBoundsException index is out of range (index
- * 		  &lt; 0 || index &gt;= size()).
+ *       &lt; 0 || index &gt;= size()).
  */
 public short get(int index) {
-	// overridden for performance only.
-	if (index >= size || index < 0)
-		throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
-	return elements[index];
+  // overridden for performance only.
+  if (index >= size || index < 0)
+    throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
+  return elements[index];
 }
 /**
  * Returns the element at the specified position in the receiver; <b>WARNING:</b> Does not check preconditions. 
@@ -260,7 +260,7 @@
  * @param index index of element to return.
  */
 public short getQuick(int index) {
-	return elements[index];
+  return elements[index];
 }
 /**
  * Returns the index of the first occurrence of the specified
@@ -275,15 +275,15 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public int indexOfFromTo(short element, int from, int to) {
-	// overridden for performance only.
-	if (size==0) return -1;
-	checkRangeFromTo(from, to, size);
+  // overridden for performance only.
+  if (size==0) return -1;
+  checkRangeFromTo(from, to, size);
 
-	short[] theElements = elements;
-	for (int i = from ; i <= to; i++) {
-	    if (element==theElements[i]) {return i;} //found
-	}
-	return -1; //not found
+  short[] theElements = elements;
+  for (int i = from ; i <= to; i++) {
+      if (element==theElements[i]) {return i;} //found
+  }
+  return -1; //not found
 }
 /**
  * Returns the index of the last occurrence of the specified
@@ -298,15 +298,15 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public int lastIndexOfFromTo(short element, int from, int to) {
-	// overridden for performance only.
-	if (size==0) return -1;
-	checkRangeFromTo(from, to, size);
+  // overridden for performance only.
+  if (size==0) return -1;
+  checkRangeFromTo(from, to, size);
 
-	short[] theElements = elements;
-	for (int i = to ; i >= from; i--) {
-	    if (element==theElements[i]) {return i;} //found
-	}
-	return -1; //not found
+  short[] theElements = elements;
+  for (int i = to ; i >= from; i--) {
+      if (element==theElements[i]) {return i;} //found
+  }
+  return -1; //not found
 }
 /**
  * Returns a new list of the part of the receiver between <code>from</code>, inclusive, and <code>to</code>, inclusive.
@@ -316,13 +316,13 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public AbstractShortList partFromTo(int from, int to) {
-	if (size==0) return new ShortArrayList(0);
+  if (size==0) return new ShortArrayList(0);
 
-	checkRangeFromTo(from, to, size);
+  checkRangeFromTo(from, to, size);
 
-	short[] part = new short[to-from+1];
-	System.arraycopy(elements, from, part, 0, to-from+1);
-	return new ShortArrayList(part);
+  short[] part = new short[to-from+1];
+  System.arraycopy(elements, from, part, 0, to-from+1);
+  return new ShortArrayList(part);
 }
 /**
 * Removes from the receiver all elements that are contained in the specified list.
@@ -332,46 +332,46 @@
 * @return <code>true</code> if the receiver changed as a result of the call.
 */
 public boolean removeAll(AbstractShortList other) {
-	// overridden for performance only.
-	if (! (other instanceof ShortArrayList))	return super.removeAll(other);
-	
-	/* There are two possibilities to do the thing
-	   a) use other.indexOf(...)
-	   b) sort other, then use other.binarySearch(...)
-	   
-	   Let's try to figure out which one is faster. Let M=size, N=other.size, then
-	   a) takes O(M*N) steps
-	   b) takes O(N*logN + M*logN) steps (sorting is O(N*logN) and binarySearch is O(logN))
+  // overridden for performance only.
+  if (! (other instanceof ShortArrayList))  return super.removeAll(other);
+  
+  /* There are two possibilities to do the thing
+     a) use other.indexOf(...)
+     b) sort other, then use other.binarySearch(...)
+     
+     Let's try to figure out which one is faster. Let M=size, N=other.size, then
+     a) takes O(M*N) steps
+     b) takes O(N*logN + M*logN) steps (sorting is O(N*logN) and binarySearch is O(logN))
  
-	   Hence, if N*logN + M*logN < M*N, we use b) otherwise we use a).
-	*/
-	if (other.size()==0) {return false;} //nothing to do
-	int limit = other.size()-1;
-	int j=0;
-	short[] theElements = elements;
-	int mySize = size();
+     Hence, if N*logN + M*logN < M*N, we use b) otherwise we use a).
+  */
+  if (other.size()==0) {return false;} //nothing to do
+  int limit = other.size()-1;
+  int j=0;
+  short[] theElements = elements;
+  int mySize = size();
 
-	double N=(double) other.size();
-	double M=(double) mySize;
-	if ( (N+M)* org.apache.mahout.jet.math.Arithmetic.log2(N) < M*N ) {
-		// it is faster to sort other before searching in it
-		ShortArrayList sortedList = (ShortArrayList) other.clone();
-		sortedList.quickSort();
+  double N=(double) other.size();
+  double M=(double) mySize;
+  if ( (N+M)* org.apache.mahout.jet.math.Arithmetic.log2(N) < M*N ) {
+    // it is faster to sort other before searching in it
+    ShortArrayList sortedList = (ShortArrayList) other.clone();
+    sortedList.quickSort();
 
-		for (int i=0; i<mySize ; i++) {
-			if (sortedList.binarySearchFromTo(theElements[i], 0, limit) < 0) theElements[j++]=theElements[i];
-		}
-	}
-	else {
-		// it is faster to search in other without sorting
-		for (int i=0; i<mySize ; i++) {
-			if (other.indexOfFromTo(theElements[i], 0, limit) < 0) theElements[j++]=theElements[i];
-		}
-	}
+    for (int i=0; i<mySize ; i++) {
+      if (sortedList.binarySearchFromTo(theElements[i], 0, limit) < 0) theElements[j++]=theElements[i];
+    }
+  }
+  else {
+    // it is faster to search in other without sorting
+    for (int i=0; i<mySize ; i++) {
+      if (other.indexOfFromTo(theElements[i], 0, limit) < 0) theElements[j++]=theElements[i];
+    }
+  }
 
-	boolean modified = (j!=mySize);
-	setSize(j);
-	return modified;
+  boolean modified = (j!=mySize);
+  setSize(j);
+  return modified;
 }
 /**
  * Replaces a number of elements in the receiver with the same number of elements of another list.
@@ -384,18 +384,18 @@
  * @param otherFrom position of first element within other list to be copied.
  */
 public void replaceFromToWithFrom(int from, int to, AbstractShortList other, int otherFrom) {
-	// overridden for performance only.
-	if (! (other instanceof ShortArrayList)) {
-		// slower
-		super.replaceFromToWithFrom(from,to,other,otherFrom);
-		return;
-	}
-	int length=to-from+1;
-	if (length>0) {
-		checkRangeFromTo(from, to, size());
-		checkRangeFromTo(otherFrom,otherFrom+length-1,other.size());
-		System.arraycopy(((ShortArrayList) other).elements, otherFrom, elements, from, length);
-	}
+  // overridden for performance only.
+  if (! (other instanceof ShortArrayList)) {
+    // slower
+    super.replaceFromToWithFrom(from,to,other,otherFrom);
+    return;
+  }
+  int length=to-from+1;
+  if (length>0) {
+    checkRangeFromTo(from, to, size());
+    checkRangeFromTo(otherFrom,otherFrom+length-1,other.size());
+    System.arraycopy(((ShortArrayList) other).elements, otherFrom, elements, from, length);
+  }
 }
 /**
 * Retains (keeps) only the elements in the receiver that are contained in the specified other list.
@@ -405,62 +405,62 @@
 * @return <code>true</code> if the receiver changed as a result of the call.
 */
 public boolean retainAll(AbstractShortList other) {
-	// overridden for performance only.
-	if (! (other instanceof ShortArrayList))	return super.retainAll(other);
-	
-	/* There are two possibilities to do the thing
-	   a) use other.indexOf(...)
-	   b) sort other, then use other.binarySearch(...)
-	   
-	   Let's try to figure out which one is faster. Let M=size, N=other.size, then
-	   a) takes O(M*N) steps
-	   b) takes O(N*logN + M*logN) steps (sorting is O(N*logN) and binarySearch is O(logN))
+  // overridden for performance only.
+  if (! (other instanceof ShortArrayList))  return super.retainAll(other);
+  
+  /* There are two possibilities to do the thing
+     a) use other.indexOf(...)
+     b) sort other, then use other.binarySearch(...)
+     
+     Let's try to figure out which one is faster. Let M=size, N=other.size, then
+     a) takes O(M*N) steps
+     b) takes O(N*logN + M*logN) steps (sorting is O(N*logN) and binarySearch is O(logN))
 
-	   Hence, if N*logN + M*logN < M*N, we use b) otherwise we use a).
-	*/
-	int limit = other.size()-1;
-	int j=0;
-	short[] theElements = elements;
-	int mySize = size();
+     Hence, if N*logN + M*logN < M*N, we use b) otherwise we use a).
+  */
+  int limit = other.size()-1;
+  int j=0;
+  short[] theElements = elements;
+  int mySize = size();
 
-	double N=(double) other.size();
-	double M=(double) mySize;
-	if ( (N+M)* org.apache.mahout.jet.math.Arithmetic.log2(N) < M*N ) {
-		// it is faster to sort other before searching in it
-		ShortArrayList sortedList = (ShortArrayList) other.clone();
-		sortedList.quickSort();
+  double N=(double) other.size();
+  double M=(double) mySize;
+  if ( (N+M)* org.apache.mahout.jet.math.Arithmetic.log2(N) < M*N ) {
+    // it is faster to sort other before searching in it
+    ShortArrayList sortedList = (ShortArrayList) other.clone();
+    sortedList.quickSort();
 
-		for (int i=0; i<mySize ; i++) {
-			if (sortedList.binarySearchFromTo(theElements[i], 0, limit) >= 0) theElements[j++]=theElements[i];
-		}
-	}
-	else {
-		// it is faster to search in other without sorting
-		for (int i=0; i<mySize ; i++) {
-			if (other.indexOfFromTo(theElements[i], 0, limit) >= 0) theElements[j++]=theElements[i];
-		}
-	}
+    for (int i=0; i<mySize ; i++) {
+      if (sortedList.binarySearchFromTo(theElements[i], 0, limit) >= 0) theElements[j++]=theElements[i];
+    }
+  }
+  else {
+    // it is faster to search in other without sorting
+    for (int i=0; i<mySize ; i++) {
+      if (other.indexOfFromTo(theElements[i], 0, limit) >= 0) theElements[j++]=theElements[i];
+    }
+  }
 
-	boolean modified = (j!=mySize);
-	setSize(j);
-	return modified;
+  boolean modified = (j!=mySize);
+  setSize(j);
+  return modified;
 }
 /**
  * Reverses the elements of the receiver.
  * Last becomes first, second last becomes second first, and so on.
  */
 public void reverse() {
-	// overridden for performance only.
-	short tmp;
-	int limit=size/2;
-	int j=size-1;
+  // overridden for performance only.
+  short tmp;
+  int limit=size/2;
+  int j=size-1;
 
-	short[] theElements = elements;
-	for (int i=0; i<limit;) { //swap
-		tmp=theElements[i];
-		theElements[i++]=theElements[j];
-		theElements[j--]=tmp;
-	}
+  short[] theElements = elements;
+  for (int i=0; i<limit;) { //swap
+    tmp=theElements[i];
+    theElements[i++]=theElements[j];
+    theElements[j--]=tmp;
+  }
 }
 /**
  * Replaces the element at the specified position in the receiver with the specified element.
@@ -468,13 +468,13 @@
  * @param index index of element to replace.
  * @param element element to be stored at the specified position.
  * @exception IndexOutOfBoundsException index is out of range (index
- * 		  &lt; 0 || index &gt;= size()).
+ *       &lt; 0 || index &gt;= size()).
  */
 public void set(int index, short element) {
-	// overridden for performance only.
-	if (index >= size || index < 0)
-		throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
-	elements[index] = element;
+  // overridden for performance only.
+  if (index >= size || index < 0)
+    throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
+  elements[index] = element;
 }
 /**
  * Replaces the element at the specified position in the receiver with the specified element; <b>WARNING:</b> Does not check preconditions.
@@ -486,7 +486,7 @@
  * @param element element to be stored at the specified position.
  */
 public void setQuick(int index, short element) {
-	elements[index] = element;
+  elements[index] = element;
 }
 /**
  * Randomly permutes the part of the receiver between <code>from</code> (inclusive) and <code>to</code> (inclusive). 
@@ -495,22 +495,22 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public void shuffleFromTo(int from, int to) {
-	// overridden for performance only.
-	if (size==0) {return;}
-	checkRangeFromTo(from, to, size);
-	
-	org.apache.mahout.jet.random.Uniform gen = new org.apache.mahout.jet.random.Uniform(new org.apache.mahout.jet.random.engine.DRand(new java.util.Date()));
-	short tmpElement;
-	short[] theElements = elements;
-	int random;
-	for (int i=from; i<to; i++) { 
-		random = gen.nextIntFromTo(i, to);
+  // overridden for performance only.
+  if (size==0) {return;}
+  checkRangeFromTo(from, to, size);
+  
+  org.apache.mahout.jet.random.Uniform gen = new org.apache.mahout.jet.random.Uniform(new org.apache.mahout.jet.random.engine.DRand(new java.util.Date()));
+  short tmpElement;
+  short[] theElements = elements;
+  int random;
+  for (int i=from; i<to; i++) { 
+    random = gen.nextIntFromTo(i, to);
 
-		//swap(i, random)
-		tmpElement = theElements[random];
-		theElements[random]=theElements[i]; 
-		theElements[i]=tmpElement; 
-	}  
+    //swap(i, random)
+    tmpElement = theElements[random];
+    theElements[random]=theElements[i]; 
+    theElements[i]=tmpElement; 
+  }  
 }
 /**
  * Sorts the specified range of the receiver into ascending order. 
@@ -529,39 +529,39 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public void sortFromTo(int from, int to) {
-	/* 
-	 * Computes min and max and decides on this basis.
-	 * In practice the additional overhead is very small compared to the potential gains.
-	 */
-	final int widthThreshold = 10000; // never consider options resulting in outrageous memory allocations.
-	
-	if (size==0) return;
-	checkRangeFromTo(from, to, size);
+  /* 
+   * Computes min and max and decides on this basis.
+   * In practice the additional overhead is very small compared to the potential gains.
+   */
+  final int widthThreshold = 10000; // never consider options resulting in outrageous memory allocations.
+  
+  if (size==0) return;
+  checkRangeFromTo(from, to, size);
 
-	// determine minimum and maximum.
-	short min=elements[from];
-	short max=elements[from];
+  // determine minimum and maximum.
+  short min=elements[from];
+  short max=elements[from];
 
-	short[] theElements = elements;
-	for (int i=from+1; i<=to; ) {
-		short elem = theElements[i++];
-		if (elem>max) max=elem;
-		else if (elem<min) min=elem;
-	}
+  short[] theElements = elements;
+  for (int i=from+1; i<=to; ) {
+    short elem = theElements[i++];
+    if (elem>max) max=elem;
+    else if (elem<min) min=elem;
+  }
 
-	// try to figure out which option is fastest.
-	double N = (double)to - (double)from + 1.0;
-	double quickSortEstimate = 	N * Math.log(N)/0.6931471805599453; // O(N*log(N,base=2)) ; ln(2)=0.6931471805599453
+  // try to figure out which option is fastest.
+  double N = (double)to - (double)from + 1.0;
+  double quickSortEstimate =   N * Math.log(N)/0.6931471805599453; // O(N*log(N,base=2)) ; ln(2)=0.6931471805599453
 
-	double width = (double)max - (double)min + 1.0;
-	double countSortEstimate = 	Math.max(width,N); // O(Max(width,N))
-	
-	if (width < widthThreshold && countSortEstimate < quickSortEstimate) {
-		countSortFromTo(from, to, min, max);
-	}
-	else {
-		quickSortFromTo(from, to);
-	}
+  double width = (double)max - (double)min + 1.0;
+  double countSortEstimate =   Math.max(width,N); // O(Max(width,N))
+  
+  if (width < widthThreshold && countSortEstimate < quickSortEstimate) {
+    countSortFromTo(from, to, min, max);
+  }
+  else {
+    quickSortFromTo(from, to);
+  }
 }
 /**
  * Trims the capacity of the receiver to be the receiver's current 
@@ -569,6 +569,6 @@
  * storage of the receiver.
  */
 public void trimToSize() {
-	elements = org.apache.mahout.matrix.Arrays.trimToCapacity(elements,size());
+  elements = org.apache.mahout.matrix.Arrays.trimToCapacity(elements,size());
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/list/AbstractCharList.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/list/AbstractCharList.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/list/AbstractCharList.java	(working copy)
@@ -19,13 +19,13 @@
  */
 @Deprecated
 public abstract class AbstractCharList extends AbstractList {
-	/**
-	 * The size of the list.
-	 * This is a READ_ONLY variable for all methods but setSizeRaw(int newSize) !!!
-	 * If you violate this principle in subclasses, you should exactly know what you are doing.
-	 * @serial
-	 */
-	protected int size;
+  /**
+   * The size of the list.
+   * This is a READ_ONLY variable for all methods but setSizeRaw(int newSize) !!!
+   * If you violate this principle in subclasses, you should exactly know what you are doing.
+   * @serial
+   */
+  protected int size;
 /**
  * Makes this class non instantiable, but still let's others inherit from it.
  */
@@ -36,7 +36,7 @@
  * @param element element to be appended to this list.
  */
 public void add(char element) {
-	beforeInsert(size,element);
+  beforeInsert(size,element);
 }
 /**
  * Appends the part of the specified list between <code>from</code> (inclusive) and <code>to</code> (inclusive) to the receiver.
@@ -47,7 +47,7 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>other.size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=other.size())</tt>).
  */
 public void addAllOfFromTo(AbstractCharList other, int from, int to) {
-	beforeInsertAllOfFromTo(size,other,from,to);
+  beforeInsertAllOfFromTo(size,other,from,to);
 }
 /**
  * Inserts the specified element before the specified position into the receiver. 
@@ -59,8 +59,8 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>index &lt; 0 || index &gt; size()</tt>).
  */
 public void beforeInsert(int index, char element) {
-	beforeInsertDummies(index,1);
-	set(index,element);
+  beforeInsertDummies(index,1);
+  set(index,element);
 }
 /**
  * Inserts the part of the specified list between <code>otherFrom</code> (inclusive) and <code>otherTo</code> (inclusive) before the specified position into the receiver. 
@@ -75,9 +75,9 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>index &lt; 0 || index &gt; size()</tt>).
  */
 public void beforeInsertAllOfFromTo(int index, AbstractCharList other, int from, int to) {
-	int length=to-from+1;
-	this.beforeInsertDummies(index, length);
-	this.replaceFromToWithFrom(index, index+length-1, other, from);
+  int length=to-from+1;
+  this.beforeInsertDummies(index, length);
+  this.replaceFromToWithFrom(index, index+length-1, other, from);
 }
 /**
  * Inserts <tt>length</tt> dummy elements before the specified position into the receiver. 
@@ -90,13 +90,13 @@
  * @throws IndexOutOfBoundsException if <tt>index &lt; 0 || index &gt; size()</tt>.
  */
 protected void beforeInsertDummies(int index, int length) {
-	if (index > size || index < 0) 
-		throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
-	if (length > 0) {
-		ensureCapacity(size + length);
-		setSizeRaw(size + length);
-		replaceFromToWithFrom(index+length,size-1,this,index);
-	}
+  if (index > size || index < 0) 
+    throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
+  if (length > 0) {
+    ensureCapacity(size + length);
+    setSizeRaw(size + length);
+    replaceFromToWithFrom(index+length,size-1,this,index);
+  }
 }
 /**
  * Searches the receiver for the specified value using
@@ -109,17 +109,17 @@
  *
  * @param key the value to be searched for.
  * @return index of the search key, if it is contained in the receiver;
- *	       otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
- *	       point</i> is defined as the the point at which the value would
- * 	       be inserted into the receiver: the index of the first
- *	       element greater than the key, or <tt>receiver.size()</tt>, if all
- *	       elements in the receiver are less than the specified key.  Note
- *	       that this guarantees that the return value will be &gt;= 0 if
- *	       and only if the key is found.
+ *         otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
+ *         point</i> is defined as the the point at which the value would
+ *          be inserted into the receiver: the index of the first
+ *         element greater than the key, or <tt>receiver.size()</tt>, if all
+ *         elements in the receiver are less than the specified key.  Note
+ *         that this guarantees that the return value will be &gt;= 0 if
+ *         and only if the key is found.
  * @see java.util.Arrays
  */
 public int binarySearch(char key) {
-	return this.binarySearchFromTo(key, 0, size-1);
+  return this.binarySearchFromTo(key, 0, size-1);
 }
 /**
  * Searches the receiver for the specified value using
@@ -134,27 +134,27 @@
  * @param from the leftmost search position, inclusive.
  * @param to the rightmost search position, inclusive.
  * @return index of the search key, if it is contained in the receiver;
- *	       otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
- *	       point</i> is defined as the the point at which the value would
- * 	       be inserted into the receiver: the index of the first
- *	       element greater than the key, or <tt>receiver.size()</tt>, if all
- *	       elements in the receiver are less than the specified key.  Note
- *	       that this guarantees that the return value will be &gt;= 0 if
- *	       and only if the key is found.
+ *         otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
+ *         point</i> is defined as the the point at which the value would
+ *          be inserted into the receiver: the index of the first
+ *         element greater than the key, or <tt>receiver.size()</tt>, if all
+ *         elements in the receiver are less than the specified key.  Note
+ *         that this guarantees that the return value will be &gt;= 0 if
+ *         and only if the key is found.
  * @see java.util.Arrays
  */
 public int binarySearchFromTo(char key, int from, int to) {
-	int low=from;
-	int high=to;
-	while (low <= high) {
-		int mid =(low + high)/2;
-		char midVal = get(mid);
+  int low=from;
+  int high=to;
+  while (low <= high) {
+    int mid =(low + high)/2;
+    char midVal = get(mid);
 
-		if (midVal < key) low = mid + 1;
-		else if (midVal > key) high = mid - 1;
-		else return mid; // key found
-	}
-	return -(low + 1);  // key not found.
+    if (midVal < key) low = mid + 1;
+    else if (midVal > key) high = mid - 1;
+    else return mid; // key found
+  }
+  return -(low + 1);  // key not found.
 }
 /**
  * Returns a deep copy of the receiver. 
@@ -162,7 +162,7 @@
  * @return  a deep copy of the receiver.
  */
 public Object clone() {
-	return partFromTo(0,size-1);
+  return partFromTo(0,size-1);
 }
 /**
  * Returns true if the receiver contains the specified element.
@@ -170,7 +170,7 @@
  * @param element element whose presence in the receiver is to be tested.
  */
 public boolean contains(char elem) {
-	return indexOfFromTo(elem,0,size-1) >=0;
+  return indexOfFromTo(elem,0,size-1) >=0;
 }
 /**
  * Deletes the first element from the receiver that is identical to the specified element.
@@ -179,8 +179,8 @@
  * @param element the element to be deleted.
  */
 public void delete(char element) {
-	int index = indexOfFromTo(element, 0, size-1);
-	if (index>=0) remove(index);
+  int index = indexOfFromTo(element, 0, size-1);
+  if (index>=0) remove(index);
 }
 /**
  * Returns the elements currently stored, possibly including invalid elements between size and capacity.
@@ -191,9 +191,9 @@
  * @return the elements currently stored.
  */
 public char[] elements() {
-	char[] myElements = new char[size];
-	for (int i=size; --i >= 0; ) myElements[i]=getQuick(i);
-	return myElements;
+  char[] myElements = new char[size];
+  for (int i=size; --i >= 0; ) myElements[i]=getQuick(i);
+  return myElements;
 }
 /**
  * Sets the receiver's elements to be the specified array.
@@ -205,9 +205,9 @@
  * @return the receiver itself.
  */
 public AbstractCharList elements(char[] elements) {
-	clear();
-	addAllOfFromTo(new CharArrayList(elements),0,elements.length-1);
-	return this;
+  clear();
+  addAllOfFromTo(new CharArrayList(elements),0,elements.length-1);
+  return this;
 }
 /**
  * Ensures that the receiver can hold at least the specified number of elements without needing to allocate new internal memory.
@@ -227,16 +227,16 @@
  * @return true if the specified Object is equal to the receiver.
  */
 public boolean equals(Object otherObj) { //delta
-	if (! (otherObj instanceof AbstractCharList)) {return false;}
-	if (this==otherObj) return true;
-	if (otherObj==null) return false;
-	AbstractCharList other = (AbstractCharList) otherObj;
-	if (size()!=other.size()) return false;
+  if (! (otherObj instanceof AbstractCharList)) {return false;}
+  if (this==otherObj) return true;
+  if (otherObj==null) return false;
+  AbstractCharList other = (AbstractCharList) otherObj;
+  if (size()!=other.size()) return false;
 
-	for (int i=size(); --i >= 0; ) {
-	    if (getQuick(i) != other.getQuick(i)) return false;
-	}
-	return true;
+  for (int i=size(); --i >= 0; ) {
+      if (getQuick(i) != other.getQuick(i)) return false;
+  }
+  return true;
 }
 /**
  * Sets the specified range of elements in the specified array to the specified value.
@@ -246,8 +246,8 @@
  * @param val the value to be stored in the specified elements of the receiver.
  */
 public void fillFromToWith(int from, int to, char val) {
-	checkRangeFromTo(from,to,this.size);
-	for (int i=from; i<=to;) setQuick(i++,val); 
+  checkRangeFromTo(from,to,this.size);
+  for (int i=from; i<=to;) setQuick(i++,val); 
 }
 /**
  * Applies a procedure to each element of the receiver, if any.
@@ -256,20 +256,20 @@
  * @return <tt>false</tt> if the procedure stopped before all elements where iterated over, <tt>true</tt> otherwise. 
  */
 public boolean forEach(CharProcedure procedure) {
-	for (int i=0; i<size;) if (! procedure.apply(get(i++))) return false;
-	return true;
+  for (int i=0; i<size;) if (! procedure.apply(get(i++))) return false;
+  return true;
 }
 /**
  * Returns the element at the specified position in the receiver.
  *
  * @param index index of element to return.
  * @exception IndexOutOfBoundsException index is out of range (index
- * 		  &lt; 0 || index &gt;= size()).
+ *       &lt; 0 || index &gt;= size()).
  */
 public char get(int index) {
-	if (index >= size || index < 0)
-		throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
-	return getQuick(index);
+  if (index >= size || index < 0)
+    throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
+  return getQuick(index);
 }
 /**
  * Returns the element at the specified position in the receiver; <b>WARNING:</b> Does not check preconditions. 
@@ -291,7 +291,7 @@
  * @return  the index of the first occurrence of the element in the receiver; returns <code>-1</code> if the element is not found.
  */
 public int indexOf(char element) { //delta
-	return indexOfFromTo(element, 0, size-1);
+  return indexOfFromTo(element, 0, size-1);
 }
 /**
  * Returns the index of the first occurrence of the specified
@@ -306,12 +306,12 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public int indexOfFromTo(char element, int from, int to) {
-	checkRangeFromTo(from, to, size);
+  checkRangeFromTo(from, to, size);
 
-	for (int i = from ; i <= to; i++) {
-	    if (element==getQuick(i)) return i; //found
-	}
-	return -1; //not found
+  for (int i = from ; i <= to; i++) {
+      if (element==getQuick(i)) return i; //found
+  }
+  return -1; //not found
 }
 /**
  * Returns the index of the last occurrence of the specified
@@ -321,7 +321,7 @@
  * @return  the index of the last occurrence of the element in the receiver; returns <code>-1</code> if the element is not found.
  */
 public int lastIndexOf(char element) {
-	return lastIndexOfFromTo(element, 0, size-1);
+  return lastIndexOfFromTo(element, 0, size-1);
 }
 /**
  * Returns the index of the last occurrence of the specified
@@ -336,12 +336,12 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public int lastIndexOfFromTo(char element, int from, int to) {
-	checkRangeFromTo(from, to, size());
+  checkRangeFromTo(from, to, size());
 
-	for (int i = to ; i >= from; i--) {
-	    if (element==getQuick(i)) return i; //found
-	}
-	return -1; //not found
+  for (int i = to ; i >= from; i--) {
+      if (element==getQuick(i)) return i; //found
+  }
+  return -1; //not found
 }
 /**
  * Sorts the specified range of the receiver into ascending order. 
@@ -360,13 +360,13 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public void mergeSortFromTo(int from, int to) {
-	int mySize = size();
-	checkRangeFromTo(from, to, mySize);
-	
-	char[] myElements = elements();
-	org.apache.mahout.matrix.Sorting.mergeSort(myElements, from, to+1);
-	elements(myElements);
-	setSizeRaw(mySize);
+  int mySize = size();
+  checkRangeFromTo(from, to, mySize);
+  
+  char[] myElements = elements();
+  org.apache.mahout.matrix.Sorting.mergeSort(myElements, from, to+1);
+  elements(myElements);
+  setSizeRaw(mySize);
 }
 /**
  * Sorts the receiver according
@@ -390,21 +390,21 @@
  * @param to the index of the last element (inclusive) to be sorted.
  * @param c the comparator to determine the order of the receiver.
  * @throws ClassCastException if the array contains elements that are not
- *	       <i>mutually comparable</i> using the specified comparator.
+ *         <i>mutually comparable</i> using the specified comparator.
  * @throws IllegalArgumentException if <tt>fromIndex &gt; toIndex</tt>
  * @throws ArrayIndexOutOfBoundsException if <tt>fromIndex &lt; 0</tt> or
- *	       <tt>toIndex &gt; a.length</tt>
+ *         <tt>toIndex &gt; a.length</tt>
  * @see Comparator
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public void mergeSortFromTo(int from, int to, CharComparator c) {
-	int mySize = size();
-	checkRangeFromTo(from, to, mySize);
-	
-	char[] myElements = elements();
-	org.apache.mahout.matrix.Sorting.mergeSort(myElements, from, to+1, c);
-	elements(myElements);
-	setSizeRaw(mySize);
+  int mySize = size();
+  checkRangeFromTo(from, to, mySize);
+  
+  char[] myElements = elements();
+  org.apache.mahout.matrix.Sorting.mergeSort(myElements, from, to+1, c);
+  elements(myElements);
+  setSizeRaw(mySize);
 }
 /**
  * Returns a new list of the part of the receiver between <code>from</code>, inclusive, and <code>to</code>, inclusive.
@@ -414,12 +414,12 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public AbstractCharList partFromTo(int from, int to) {
-	checkRangeFromTo(from, to, size);
+  checkRangeFromTo(from, to, size);
 
-	int length = to-from+1;
-	CharArrayList part = new CharArrayList(length);
-	part.addAllOfFromTo(this,from,to);
-	return part;
+  int length = to-from+1;
+  CharArrayList part = new CharArrayList(length);
+  part.addAllOfFromTo(this,from,to);
+  return part;
 }
 /**
  * Sorts the specified range of the receiver into
@@ -438,13 +438,13 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public void quickSortFromTo(int from, int to) {
-	int mySize = size();
-	checkRangeFromTo(from, to, mySize);
-	
-	char[] myElements = elements();
-	java.util.Arrays.sort(myElements, from, to+1);
-	elements(myElements);
-	setSizeRaw(mySize);
+  int mySize = size();
+  checkRangeFromTo(from, to, mySize);
+  
+  char[] myElements = elements();
+  java.util.Arrays.sort(myElements, from, to+1);
+  elements(myElements);
+  setSizeRaw(mySize);
 }
 /**
  * Sorts the receiver according
@@ -466,21 +466,21 @@
  * @param to the index of the last element (inclusive) to be sorted.
  * @param c the comparator to determine the order of the receiver.
  * @throws ClassCastException if the array contains elements that are not
- *	       <i>mutually comparable</i> using the specified comparator.
+ *         <i>mutually comparable</i> using the specified comparator.
  * @throws IllegalArgumentException if <tt>fromIndex &gt; toIndex</tt>
  * @throws ArrayIndexOutOfBoundsException if <tt>fromIndex &lt; 0</tt> or
- *	       <tt>toIndex &gt; a.length</tt>
+ *         <tt>toIndex &gt; a.length</tt>
  * @see Comparator
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public void quickSortFromTo(int from, int to, CharComparator c) {
-	int mySize = size();
-	checkRangeFromTo(from, to, mySize);
-	
-	char[] myElements = elements();
-	org.apache.mahout.matrix.Sorting.quickSort(myElements, from, to+1,c);
-	elements(myElements);
-	setSizeRaw(mySize);
+  int mySize = size();
+  checkRangeFromTo(from, to, mySize);
+  
+  char[] myElements = elements();
+  org.apache.mahout.matrix.Sorting.quickSort(myElements, from, to+1,c);
+  elements(myElements);
+  setSizeRaw(mySize);
 }
 /**
 * Removes from the receiver all elements that are contained in the specified list.
@@ -490,17 +490,17 @@
 * @return <code>true</code> if the receiver changed as a result of the call.
 */
 public boolean removeAll(AbstractCharList other) {
-	if (other.size()==0) return false; //nothing to do
-	int limit = other.size()-1;
-	int j=0;
+  if (other.size()==0) return false; //nothing to do
+  int limit = other.size()-1;
+  int j=0;
 
-	for (int i=0; i<size ; i++) {
-		if (other.indexOfFromTo(getQuick(i), 0, limit) < 0) setQuick(j++,getQuick(i));
-	}
+  for (int i=0; i<size ; i++) {
+    if (other.indexOfFromTo(getQuick(i), 0, limit) < 0) setQuick(j++,getQuick(i));
+  }
 
-	boolean modified = (j!=size);
-	setSize(j);
-	return modified;
+  boolean modified = (j!=size);
+  setSize(j);
+  return modified;
 }
 /**
  * Removes from the receiver all elements whose index is between
@@ -513,14 +513,14 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public void removeFromTo(int from, int to) {
-	checkRangeFromTo(from, to, size);
-	int numMoved = size - to - 1;
-	if (numMoved > 0) {
-		replaceFromToWithFrom(from, from-1+numMoved, this, to+1);
-		//fillFromToWith(from+numMoved, size-1, 0.0f); //delta
-	}
-	int width = to-from+1;
-	if (width>0) setSizeRaw(size-width);
+  checkRangeFromTo(from, to, size);
+  int numMoved = size - to - 1;
+  if (numMoved > 0) {
+    replaceFromToWithFrom(from, from-1+numMoved, this, to+1);
+    //fillFromToWith(from+numMoved, size-1, 0.0f); //delta
+  }
+  int width = to-from+1;
+  if (width>0) setSizeRaw(size-width);
 }
 /**
  * Replaces a number of elements in the receiver with the same number of elements of another list.
@@ -533,22 +533,22 @@
  * @param otherFrom position of first element within other list to be copied.
  */
 public void replaceFromToWithFrom(int from, int to, AbstractCharList other, int otherFrom) {
-	int length=to-from+1;
-	if (length>0) {
-		checkRangeFromTo(from, to, size());
-		checkRangeFromTo(otherFrom,otherFrom+length-1,other.size());
+  int length=to-from+1;
+  if (length>0) {
+    checkRangeFromTo(from, to, size());
+    checkRangeFromTo(otherFrom,otherFrom+length-1,other.size());
 
-		// unambiguous copy (it may hold other==this)
-		if (from<=otherFrom) {
-			for (; --length >= 0; ) setQuick(from++,other.getQuick(otherFrom++));
-		}
-		else {
-			int otherTo = otherFrom+length-1;
-			for (; --length >= 0; ) setQuick(to--,other.getQuick(otherTo--));
-		}
+    // unambiguous copy (it may hold other==this)
+    if (from<=otherFrom) {
+      for (; --length >= 0; ) setQuick(from++,other.getQuick(otherFrom++));
+    }
+    else {
+      int otherTo = otherFrom+length-1;
+      for (; --length >= 0; ) setQuick(to--,other.getQuick(otherTo--));
+    }
 
-			
-	}
+      
+  }
 }
 /**
 * Replaces the part between <code>from</code> (inclusive) and <code>to</code> (inclusive) with the other list's
@@ -594,36 +594,36 @@
 * </pre>
 */
 public void replaceFromToWithFromTo(int from, int to, AbstractCharList other, int otherFrom, int otherTo) {
-	if (otherFrom>otherTo) {
-		throw new IndexOutOfBoundsException("otherFrom: "+otherFrom+", otherTo: "+otherTo);
-	}
+  if (otherFrom>otherTo) {
+    throw new IndexOutOfBoundsException("otherFrom: "+otherFrom+", otherTo: "+otherTo);
+  }
 
-	if (this==other && to-from!=otherTo-otherFrom) { // avoid stumbling over my own feet
-		replaceFromToWithFromTo(from, to, partFromTo(otherFrom, otherTo), 0, otherTo-otherFrom);
-		return;
-	}
-	
-	int length=otherTo-otherFrom+1;
-	int diff=length;
-	int theLast=from-1;
+  if (this==other && to-from!=otherTo-otherFrom) { // avoid stumbling over my own feet
+    replaceFromToWithFromTo(from, to, partFromTo(otherFrom, otherTo), 0, otherTo-otherFrom);
+    return;
+  }
+  
+  int length=otherTo-otherFrom+1;
+  int diff=length;
+  int theLast=from-1;
 
-	if (to>=from) {
-		diff -= (to-from+1);
-		theLast=to;
-	}
-	
-	if (diff>0) {
-		beforeInsertDummies(theLast+1, diff);
-	}
-	else {
-		if (diff<0) {
-			removeFromTo(theLast+diff, theLast-1);
-		}
-	}
+  if (to>=from) {
+    diff -= (to-from+1);
+    theLast=to;
+  }
+  
+  if (diff>0) {
+    beforeInsertDummies(theLast+1, diff);
+  }
+  else {
+    if (diff<0) {
+      removeFromTo(theLast+diff, theLast-1);
+    }
+  }
 
-	if (length>0) {
-		replaceFromToWithFrom(from,from+length-1,other,otherFrom);
-	}
+  if (length>0) {
+    replaceFromToWithFrom(from,from+length-1,other,otherFrom);
+  }
 }
 /**
  * Replaces the part of the receiver starting at <code>from</code> (inclusive) with all the elements of the specified collection.
@@ -635,12 +635,12 @@
  * @exception IndexOutOfBoundsException index is out of range (index &lt; 0 || index &gt;= size()).
  */
 public void replaceFromWith(int from, java.util.Collection other) {
-	checkRange(from,size());
-	java.util.Iterator e = other.iterator();
-	int index=from;
-	int limit = Math.min(size()-from, other.size());
-	for (int i=0; i<limit; i++)
-	    set(index++,((Character) e.next()).charValue()); //delta
+  checkRange(from,size());
+  java.util.Iterator e = other.iterator();
+  int index=from;
+  int limit = Math.min(size()-from, other.size());
+  for (int i=0; i<limit; i++)
+      set(index++,((Character) e.next()).charValue()); //delta
 }
 /**
 * Retains (keeps) only the elements in the receiver that are contained in the specified other list.
@@ -650,36 +650,36 @@
 * @return <code>true</code> if the receiver changed as a result of the call.
 */
 public boolean retainAll(AbstractCharList other) {
-	if (other.size()==0) {
-		if (size==0) return false;
-		setSize(0);
-		return true;
-	}
-	
-	int limit = other.size()-1;
-	int j=0;
-	for (int i=0; i<size ; i++) {
-		if (other.indexOfFromTo(getQuick(i), 0, limit) >= 0) setQuick(j++, getQuick(i));
-	}
+  if (other.size()==0) {
+    if (size==0) return false;
+    setSize(0);
+    return true;
+  }
+  
+  int limit = other.size()-1;
+  int j=0;
+  for (int i=0; i<size ; i++) {
+    if (other.indexOfFromTo(getQuick(i), 0, limit) >= 0) setQuick(j++, getQuick(i));
+  }
 
-	boolean modified = (j!=size);
-	setSize(j);
-	return modified;
+  boolean modified = (j!=size);
+  setSize(j);
+  return modified;
 }
 /**
  * Reverses the elements of the receiver.
  * Last becomes first, second last becomes second first, and so on.
  */
 public void reverse() {
-	char tmp;
-	int limit=size()/2;
-	int j=size()-1;
+  char tmp;
+  int limit=size()/2;
+  int j=size()-1;
 
-	for (int i=0; i<limit;) { //swap
-		tmp=getQuick(i);
-		setQuick(i++,getQuick(j));
-		setQuick(j--,tmp);
-	}
+  for (int i=0; i<limit;) { //swap
+    tmp=getQuick(i);
+    setQuick(i++,getQuick(j));
+    setQuick(j--,tmp);
+  }
 }
 /**
  * Replaces the element at the specified position in the receiver with the specified element.
@@ -689,9 +689,9 @@
  * @throws IndexOutOfBoundsException if <tt>index &lt; 0 || index &gt;= size()</tt>.
  */
 public void set(int index, char element) {
-	if (index >= size || index < 0)
-		throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
-	setQuick(index,element);
+  if (index >= size || index < 0)
+    throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
+  setQuick(index,element);
 }
 /**
  * Replaces the element at the specified position in the receiver with the specified element; <b>WARNING:</b> Does not check preconditions.
@@ -722,7 +722,7 @@
  * }
  */
 protected void setSizeRaw(int newSize) {
-	size = newSize;
+  size = newSize;
 }
 /**
  * Randomly permutes the part of the receiver between <code>from</code> (inclusive) and <code>to</code> (inclusive). 
@@ -731,17 +731,17 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public void shuffleFromTo(int from, int to) {
-	checkRangeFromTo(from, to, size());
-	
-	org.apache.mahout.jet.random.Uniform gen = new org.apache.mahout.jet.random.Uniform(new org.apache.mahout.jet.random.engine.DRand(new java.util.Date()));
-	for (int i=from; i<to; i++) { 
-		int random = gen.nextIntFromTo(i, to);
+  checkRangeFromTo(from, to, size());
+  
+  org.apache.mahout.jet.random.Uniform gen = new org.apache.mahout.jet.random.Uniform(new org.apache.mahout.jet.random.engine.DRand(new java.util.Date()));
+  for (int i=from; i<to; i++) { 
+    int random = gen.nextIntFromTo(i, to);
 
-		//swap(i, random)
-		char tmpElement = getQuick(random);
-		setQuick(random,getQuick(i)); 
-		setQuick(i,tmpElement); 
-	}  
+    //swap(i, random)
+    char tmpElement = getQuick(random);
+    setQuick(random,getQuick(i)); 
+    setQuick(i,tmpElement); 
+  }  
 }
 /**
  * Returns the number of elements contained in the receiver.
@@ -749,33 +749,33 @@
  * @returns  the number of elements contained in the receiver.
  */
 public int size() {
-	return size;
+  return size;
 }
 /**
  * Returns a list which is a concatenation of <code>times</code> times the receiver.
  * @param times the number of times the receiver shall be copied.
  */
 public AbstractCharList times(int times) {
-	AbstractCharList newList = new CharArrayList(times*size());
-	for (int i=times; --i >= 0; ) {
-		newList.addAllOfFromTo(this,0,size()-1);
-	}
-	return newList;
+  AbstractCharList newList = new CharArrayList(times*size());
+  for (int i=times; --i >= 0; ) {
+    newList.addAllOfFromTo(this,0,size()-1);
+  }
+  return newList;
 }
 /**
  * Returns a <code>java.util.ArrayList</code> containing all the elements in the receiver.
  */
 public java.util.ArrayList toList() {
-	int mySize = size();
-	java.util.ArrayList list = new java.util.ArrayList(mySize);
-	for (int i=0; i < mySize; i++) list.add(new Character(get(i)));
-	return list;
+  int mySize = size();
+  java.util.ArrayList list = new java.util.ArrayList(mySize);
+  for (int i=0; i < mySize; i++) list.add(new Character(get(i)));
+  return list;
 }
 /**
 * Returns a string representation of the receiver, containing
 * the String representation of each element.
 */
 public String toString() {
-	return org.apache.mahout.matrix.Arrays.toString(partFromTo(0, size()-1).elements());
+  return org.apache.mahout.matrix.Arrays.toString(partFromTo(0, size()-1).elements());
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/list/ByteArrayList.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/list/ByteArrayList.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/list/ByteArrayList.java	(working copy)
@@ -18,17 +18,17 @@
  */
 @Deprecated
 public class ByteArrayList extends AbstractByteList {
-	/**
-	 * The array buffer into which the elements of the list are stored.
-	 * The capacity of the list is the length of this array buffer.
-	 * @serial
-	 */
-	protected byte[] elements;
+  /**
+   * The array buffer into which the elements of the list are stored.
+   * The capacity of the list is the length of this array buffer.
+   * @serial
+   */
+  protected byte[] elements;
 /**
  * Constructs an empty list.
  */
 public ByteArrayList() {
-	this(10);
+  this(10);
 }
 /**
  * Constructs a list containing the specified elements. 
@@ -40,7 +40,7 @@
  * @param elements the array to be backed by the the constructed list
  */
 public ByteArrayList(byte[] elements) {
-	elements(elements);
+  elements(elements);
 }
 /**
  * Constructs an empty list with the specified initial capacity.
@@ -48,8 +48,8 @@
  * @param   initialCapacity   the number of elements the receiver can hold without auto-expanding itself by allocating new internal memory.
  */
 public ByteArrayList(int initialCapacity) {
-	this(new byte[initialCapacity]);
-	setSizeRaw(0);
+  this(new byte[initialCapacity]);
+  setSizeRaw(0);
 }
 /**
  * Appends the specified element to the end of this list.
@@ -57,11 +57,11 @@
  * @param element element to be appended to this list.
  */
 public void add(byte element) {
-	// overridden for performance only.
-	if (size == elements.length) {
-		ensureCapacity(size + 1); 
-	}
-	elements[size++] = element;
+  // overridden for performance only.
+  if (size == elements.length) {
+    ensureCapacity(size + 1); 
+  }
+  elements[size++] = element;
 }
 /**
  * Inserts the specified element before the specified position into the receiver. 
@@ -73,13 +73,13 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>index &lt; 0 || index &gt; size()</tt>).
  */
 public void beforeInsert(int index, byte element) {
-	// overridden for performance only.
-	if (index > size || index < 0) 
-		throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
-	ensureCapacity(size + 1);
-	System.arraycopy(elements, index, elements, index+1, size-index);
-	elements[index] = element;
-	size++;
+  // overridden for performance only.
+  if (index > size || index < 0) 
+    throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
+  ensureCapacity(size + 1);
+  System.arraycopy(elements, index, elements, index+1, size-index);
+  elements[index] = element;
+  size++;
 }
 /**
  * Searches the receiver for the specified value using
@@ -94,18 +94,18 @@
  * @param from the leftmost search position, inclusive.
  * @param to the rightmost search position, inclusive.
  * @return index of the search key, if it is contained in the receiver;
- *	       otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
- *	       point</i> is defined as the the point at which the value would
- * 	       be inserted into the receiver: the index of the first
- *	       element greater than the key, or <tt>receiver.size()</tt>, if all
- *	       elements in the receiver are less than the specified key.  Note
- *	       that this guarantees that the return value will be &gt;= 0 if
- *	       and only if the key is found.
+ *         otherwise, <tt>(-(<i>insertion point</i>) - 1)</tt>.  The <i>insertion
+ *         point</i> is defined as the the point at which the value would
+ *          be inserted into the receiver: the index of the first
+ *         element greater than the key, or <tt>receiver.size()</tt>, if all
+ *         elements in the receiver are less than the specified key.  Note
+ *         that this guarantees that the return value will be &gt;= 0 if
+ *         and only if the key is found.
  * @see org.apache.mahout.matrix.Sorting
  * @see java.util.Arrays
  */
 public int binarySearchFromTo(byte key, int from, int to) {
-	return org.apache.mahout.matrix.Sorting.binarySearchFromTo(this.elements,key,from,to);
+  return org.apache.mahout.matrix.Sorting.binarySearchFromTo(this.elements,key,from,to);
 }
 /**
  * Returns a deep copy of the receiver. 
@@ -113,10 +113,10 @@
  * @return  a deep copy of the receiver.
  */
 public Object clone() {
-	// overridden for performance only.
-	ByteArrayList clone = new ByteArrayList((byte[]) elements.clone());
-	clone.setSizeRaw(size);
-	return clone;
+  // overridden for performance only.
+  ByteArrayList clone = new ByteArrayList((byte[]) elements.clone());
+  clone.setSizeRaw(size);
+  return clone;
 }
 /**
  * Returns a deep copy of the receiver; uses <code>clone()</code> and casts the result.
@@ -124,7 +124,7 @@
  * @return  a deep copy of the receiver.
  */
 public ByteArrayList copy() {
-	return (ByteArrayList) clone();
+  return (ByteArrayList) clone();
 }
 /**
  * Sorts the specified range of the receiver into ascending numerical order. 
@@ -136,29 +136,29 @@
  * @param to the index of the last element (inclusive) to be sorted.
  */
 public void countSortFromTo(int from, int to) {
-	if (size==0) return;
-	checkRangeFromTo(from, to, size);
+  if (size==0) return;
+  checkRangeFromTo(from, to, size);
 
-	final int min = - (int)Byte.MIN_VALUE;
-	final int range = min + Byte.MAX_VALUE + 1;
-	byte[] theElements = elements;
-	int[] counts = new int[range];
-	
-	for (int i=from; i<=to; i++) counts[theElements[i]+min]++;
+  final int min = - (int)Byte.MIN_VALUE;
+  final int range = min + Byte.MAX_VALUE + 1;
+  byte[] theElements = elements;
+  int[] counts = new int[range];
+  
+  for (int i=from; i<=to; i++) counts[theElements[i]+min]++;
 
-	int fromIndex = from;
-	byte val = Byte.MIN_VALUE;
-	for (int i=0; i<range; i++, val++) {
-		int c=counts[i];
-		if (c>0) {
-			if (c==1) theElements[fromIndex++]=val;
-			else {
-				int toIndex = fromIndex+c-1;
-				fillFromToWith(fromIndex,toIndex,val);
-				fromIndex = toIndex+1;
-			}
-		}
-	}
+  int fromIndex = from;
+  byte val = Byte.MIN_VALUE;
+  for (int i=0; i<range; i++, val++) {
+    int c=counts[i];
+    if (c>0) {
+      if (c==1) theElements[fromIndex++]=val;
+      else {
+        int toIndex = fromIndex+c-1;
+        fillFromToWith(fromIndex,toIndex,val);
+        fromIndex = toIndex+1;
+      }
+    }
+  }
 }
  /**
  * Sorts the specified range of the receiver into ascending numerical order. 
@@ -175,28 +175,28 @@
  * @param max the largest element contained in the range.
  */
 protected void countSortFromTo(int from, int to, byte min, byte max) {
-	if (size==0) return;
-	checkRangeFromTo(from, to, size);
+  if (size==0) return;
+  checkRangeFromTo(from, to, size);
 
-	final int width = (int) (max-min+1);
-	
-	int[] counts = new int[width];
-	byte[] theElements = elements;	
-	for (int i=from; i<=to; ) counts[(int)(theElements[i++]-min)]++;
+  final int width = (int) (max-min+1);
+  
+  int[] counts = new int[width];
+  byte[] theElements = elements;  
+  for (int i=from; i<=to; ) counts[(int)(theElements[i++]-min)]++;
 
-	int fromIndex = from;
-	byte val = min;
-	for (int i=0; i<width; i++, val++) {
-		int c = counts[i];
-		if (c>0) {
-			if (c==1) theElements[fromIndex++]=val;
-			else {
-				int toIndex = fromIndex + c - 1;
-				fillFromToWith(fromIndex,toIndex,val);
-				fromIndex = toIndex + 1;
-			}
-		}
-	}
+  int fromIndex = from;
+  byte val = min;
+  for (int i=0; i<width; i++, val++) {
+    int c = counts[i];
+    if (c>0) {
+      if (c==1) theElements[fromIndex++]=val;
+      else {
+        int toIndex = fromIndex + c - 1;
+        fillFromToWith(fromIndex,toIndex,val);
+        fromIndex = toIndex + 1;
+      }
+    }
+  }
 }
 /**
  * Returns the elements currently stored, including invalid elements between size and capacity, if any.
@@ -207,7 +207,7 @@
  * @return the elements currently stored.
  */
 public byte[] elements() {
-	return elements;
+  return elements;
 }
 /**
  * Sets the receiver's elements to be the specified array (not a copy of it).
@@ -220,9 +220,9 @@
  * @return the receiver itself.
  */
 public AbstractByteList elements(byte[] elements) {
-	this.elements=elements;
-	this.size=elements.length;
-	return this;
+  this.elements=elements;
+  this.size=elements.length;
+  return this;
 }
 /**
  * Ensures that the receiver can hold at least the specified number of elements without needing to allocate new internal memory.
@@ -231,7 +231,7 @@
  * @param   minCapacity   the desired minimum capacity.
  */
 public void ensureCapacity(int minCapacity) {
-	elements = org.apache.mahout.matrix.Arrays.ensureCapacity(elements,minCapacity);
+  elements = org.apache.mahout.matrix.Arrays.ensureCapacity(elements,minCapacity);
 }
 /**
  * Compares the specified Object with the receiver.  
@@ -244,19 +244,19 @@
  * @return true if the specified Object is equal to the receiver.
  */
 public boolean equals(Object otherObj) { //delta
-	// overridden for performance only.
-	if (! (otherObj instanceof ByteArrayList)) return super.equals(otherObj);
-	if (this==otherObj) return true;
-	if (otherObj==null) return false;
-	ByteArrayList other = (ByteArrayList) otherObj;
-	if (size()!=other.size()) return false;
+  // overridden for performance only.
+  if (! (otherObj instanceof ByteArrayList)) return super.equals(otherObj);
+  if (this==otherObj) return true;
+  if (otherObj==null) return false;
+  ByteArrayList other = (ByteArrayList) otherObj;
+  if (size()!=other.size()) return false;
 
-	byte[] theElements = elements();
-	byte[] otherElements = other.elements();
-	for (int i=size(); --i >= 0; ) {
-	    if (theElements[i] != otherElements[i]) return false;
-	}
-	return true;
+  byte[] theElements = elements();
+  byte[] otherElements = other.elements();
+  for (int i=size(); --i >= 0; ) {
+      if (theElements[i] != otherElements[i]) return false;
+  }
+  return true;
 }
 /**
  * Applies a procedure to each element of the receiver, if any.
@@ -265,25 +265,25 @@
  * @return <tt>false</tt> if the procedure stopped before all elements where iterated over, <tt>true</tt> otherwise. 
  */
 public boolean forEach(ByteProcedure procedure) {
-	// overridden for performance only.
-	byte[] theElements = elements;
-	int theSize = size;
-	
-	for (int i=0; i<theSize;) if (! procedure.apply(theElements[i++])) return false;
-	return true;
+  // overridden for performance only.
+  byte[] theElements = elements;
+  int theSize = size;
+  
+  for (int i=0; i<theSize;) if (! procedure.apply(theElements[i++])) return false;
+  return true;
 }
 /**
  * Returns the element at the specified position in the receiver.
  *
  * @param index index of element to return.
  * @exception IndexOutOfBoundsException index is out of range (index
- * 		  &lt; 0 || index &gt;= size()).
+ *       &lt; 0 || index &gt;= size()).
  */
 public byte get(int index) {
-	// overridden for performance only.
-	if (index >= size || index < 0)
-		throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
-	return elements[index];
+  // overridden for performance only.
+  if (index >= size || index < 0)
+    throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
+  return elements[index];
 }
 /**
  * Returns the element at the specified position in the receiver; <b>WARNING:</b> Does not check preconditions. 
@@ -294,7 +294,7 @@
  * @param index index of element to return.
  */
 public byte getQuick(int index) {
-	return elements[index];
+  return elements[index];
 }
 /**
  * Returns the index of the first occurrence of the specified
@@ -309,15 +309,15 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public int indexOfFromTo(byte element, int from, int to) {
-	// overridden for performance only.
-	if (size==0) return -1;
-	checkRangeFromTo(from, to, size);
+  // overridden for performance only.
+  if (size==0) return -1;
+  checkRangeFromTo(from, to, size);
 
-	byte[] theElements = elements;
-	for (int i = from ; i <= to; i++) {
-	    if (element==theElements[i]) {return i;} //found
-	}
-	return -1; //not found
+  byte[] theElements = elements;
+  for (int i = from ; i <= to; i++) {
+      if (element==theElements[i]) {return i;} //found
+  }
+  return -1; //not found
 }
 /**
  * Returns the index of the last occurrence of the specified
@@ -332,15 +332,15 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public int lastIndexOfFromTo(byte element, int from, int to) {
-	// overridden for performance only.
-	if (size==0) return -1;
-	checkRangeFromTo(from, to, size);
+  // overridden for performance only.
+  if (size==0) return -1;
+  checkRangeFromTo(from, to, size);
 
-	byte[] theElements = elements;
-	for (int i = to ; i >= from; i--) {
-	    if (element==theElements[i]) {return i;} //found
-	}
-	return -1; //not found
+  byte[] theElements = elements;
+  for (int i = to ; i >= from; i--) {
+      if (element==theElements[i]) {return i;} //found
+  }
+  return -1; //not found
 }
 /**
  * Returns a new list of the part of the receiver between <code>from</code>, inclusive, and <code>to</code>, inclusive.
@@ -350,13 +350,13 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public AbstractByteList partFromTo(int from, int to) {
-	if (size==0) return new ByteArrayList(0);
+  if (size==0) return new ByteArrayList(0);
 
-	checkRangeFromTo(from, to, size);
+  checkRangeFromTo(from, to, size);
 
-	byte[] part = new byte[to-from+1];
-	System.arraycopy(elements, from, part, 0, to-from+1);
-	return new ByteArrayList(part);
+  byte[] part = new byte[to-from+1];
+  System.arraycopy(elements, from, part, 0, to-from+1);
+  return new ByteArrayList(part);
 }
 /**
 * Removes from the receiver all elements that are contained in the specified list.
@@ -366,46 +366,46 @@
 * @return <code>true</code> if the receiver changed as a result of the call.
 */
 public boolean removeAll(AbstractByteList other) {
-	// overridden for performance only.
-	if (! (other instanceof ByteArrayList))	return super.removeAll(other);
-	
-	/* There are two possibilities to do the thing
-	   a) use other.indexOf(...)
-	   b) sort other, then use other.binarySearch(...)
-	   
-	   Let's try to figure out which one is faster. Let M=size, N=other.size, then
-	   a) takes O(M*N) steps
-	   b) takes O(N*logN + M*logN) steps (sorting is O(N*logN) and binarySearch is O(logN))
+  // overridden for performance only.
+  if (! (other instanceof ByteArrayList))  return super.removeAll(other);
+  
+  /* There are two possibilities to do the thing
+     a) use other.indexOf(...)
+     b) sort other, then use other.binarySearch(...)
+     
+     Let's try to figure out which one is faster. Let M=size, N=other.size, then
+     a) takes O(M*N) steps
+     b) takes O(N*logN + M*logN) steps (sorting is O(N*logN) and binarySearch is O(logN))
  
-	   Hence, if N*logN + M*logN < M*N, we use b) otherwise we use a).
-	*/
-	if (other.size()==0) {return false;} //nothing to do
-	int limit = other.size()-1;
-	int j=0;
-	byte[] theElements = elements;
-	int mySize = size();
+     Hence, if N*logN + M*logN < M*N, we use b) otherwise we use a).
+  */
+  if (other.size()==0) {return false;} //nothing to do
+  int limit = other.size()-1;
+  int j=0;
+  byte[] theElements = elements;
+  int mySize = size();
 
-	double N=(double) other.size();
-	double M=(double) mySize;
-	if ( (N+M)* org.apache.mahout.jet.math.Arithmetic.log2(N) < M*N ) {
-		// it is faster to sort other before searching in it
-		ByteArrayList sortedList = (ByteArrayList) other.clone();
-		sortedList.quickSort();
+  double N=(double) other.size();
+  double M=(double) mySize;
+  if ( (N+M)* org.apache.mahout.jet.math.Arithmetic.log2(N) < M*N ) {
+    // it is faster to sort other before searching in it
+    ByteArrayList sortedList = (ByteArrayList) other.clone();
+    sortedList.quickSort();
 
-		for (int i=0; i<mySize ; i++) {
-			if (sortedList.binarySearchFromTo(theElements[i], 0, limit) < 0) theElements[j++]=theElements[i];
-		}
-	}
-	else {
-		// it is faster to search in other without sorting
-		for (int i=0; i<mySize ; i++) {
-			if (other.indexOfFromTo(theElements[i], 0, limit) < 0) theElements[j++]=theElements[i];
-		}
-	}
+    for (int i=0; i<mySize ; i++) {
+      if (sortedList.binarySearchFromTo(theElements[i], 0, limit) < 0) theElements[j++]=theElements[i];
+    }
+  }
+  else {
+    // it is faster to search in other without sorting
+    for (int i=0; i<mySize ; i++) {
+      if (other.indexOfFromTo(theElements[i], 0, limit) < 0) theElements[j++]=theElements[i];
+    }
+  }
 
-	boolean modified = (j!=mySize);
-	setSize(j);
-	return modified;
+  boolean modified = (j!=mySize);
+  setSize(j);
+  return modified;
 }
 /**
  * Replaces a number of elements in the receiver with the same number of elements of another list.
@@ -418,18 +418,18 @@
  * @param otherFrom position of first element within other list to be copied.
  */
 public void replaceFromToWithFrom(int from, int to, AbstractByteList other, int otherFrom) {
-	// overridden for performance only.
-	if (! (other instanceof ByteArrayList)) {
-		// slower
-		super.replaceFromToWithFrom(from,to,other,otherFrom);
-		return;
-	}
-	int length=to-from+1;
-	if (length>0) {
-		checkRangeFromTo(from, to, size());
-		checkRangeFromTo(otherFrom,otherFrom+length-1,other.size());
-		System.arraycopy(((ByteArrayList) other).elements, otherFrom, elements, from, length);
-	}
+  // overridden for performance only.
+  if (! (other instanceof ByteArrayList)) {
+    // slower
+    super.replaceFromToWithFrom(from,to,other,otherFrom);
+    return;
+  }
+  int length=to-from+1;
+  if (length>0) {
+    checkRangeFromTo(from, to, size());
+    checkRangeFromTo(otherFrom,otherFrom+length-1,other.size());
+    System.arraycopy(((ByteArrayList) other).elements, otherFrom, elements, from, length);
+  }
 }
 /**
 * Retains (keeps) only the elements in the receiver that are contained in the specified other list.
@@ -439,62 +439,62 @@
 * @return <code>true</code> if the receiver changed as a result of the call.
 */
 public boolean retainAll(AbstractByteList other) {
-	// overridden for performance only.
-	if (! (other instanceof ByteArrayList))	return super.retainAll(other);
-	
-	/* There are two possibilities to do the thing
-	   a) use other.indexOf(...)
-	   b) sort other, then use other.binarySearch(...)
-	   
-	   Let's try to figure out which one is faster. Let M=size, N=other.size, then
-	   a) takes O(M*N) steps
-	   b) takes O(N*logN + M*logN) steps (sorting is O(N*logN) and binarySearch is O(logN))
+  // overridden for performance only.
+  if (! (other instanceof ByteArrayList))  return super.retainAll(other);
+  
+  /* There are two possibilities to do the thing
+     a) use other.indexOf(...)
+     b) sort other, then use other.binarySearch(...)
+     
+     Let's try to figure out which one is faster. Let M=size, N=other.size, then
+     a) takes O(M*N) steps
+     b) takes O(N*logN + M*logN) steps (sorting is O(N*logN) and binarySearch is O(logN))
 
-	   Hence, if N*logN + M*logN < M*N, we use b) otherwise we use a).
-	*/
-	int limit = other.size()-1;
-	int j=0;
-	byte[] theElements = elements;
-	int mySize = size();
+     Hence, if N*logN + M*logN < M*N, we use b) otherwise we use a).
+  */
+  int limit = other.size()-1;
+  int j=0;
+  byte[] theElements = elements;
+  int mySize = size();
 
-	double N=(double) other.size();
-	double M=(double) mySize;
-	if ( (N+M)* org.apache.mahout.jet.math.Arithmetic.log2(N) < M*N ) {
-		// it is faster to sort other before searching in it
-		ByteArrayList sortedList = (ByteArrayList) other.clone();
-		sortedList.quickSort();
+  double N=(double) other.size();
+  double M=(double) mySize;
+  if ( (N+M)* org.apache.mahout.jet.math.Arithmetic.log2(N) < M*N ) {
+    // it is faster to sort other before searching in it
+    ByteArrayList sortedList = (ByteArrayList) other.clone();
+    sortedList.quickSort();
 
-		for (int i=0; i<mySize ; i++) {
-			if (sortedList.binarySearchFromTo(theElements[i], 0, limit) >= 0) theElements[j++]=theElements[i];
-		}
-	}
-	else {
-		// it is faster to search in other without sorting
-		for (int i=0; i<mySize ; i++) {
-			if (other.indexOfFromTo(theElements[i], 0, limit) >= 0) theElements[j++]=theElements[i];
-		}
-	}
+    for (int i=0; i<mySize ; i++) {
+      if (sortedList.binarySearchFromTo(theElements[i], 0, limit) >= 0) theElements[j++]=theElements[i];
+    }
+  }
+  else {
+    // it is faster to search in other without sorting
+    for (int i=0; i<mySize ; i++) {
+      if (other.indexOfFromTo(theElements[i], 0, limit) >= 0) theElements[j++]=theElements[i];
+    }
+  }
 
-	boolean modified = (j!=mySize);
-	setSize(j);
-	return modified;
+  boolean modified = (j!=mySize);
+  setSize(j);
+  return modified;
 }
 /**
  * Reverses the elements of the receiver.
  * Last becomes first, second last becomes second first, and so on.
  */
 public void reverse() {
-	// overridden for performance only.
-	byte tmp;
-	int limit=size/2;
-	int j=size-1;
+  // overridden for performance only.
+  byte tmp;
+  int limit=size/2;
+  int j=size-1;
 
-	byte[] theElements = elements;
-	for (int i=0; i<limit;) { //swap
-		tmp=theElements[i];
-		theElements[i++]=theElements[j];
-		theElements[j--]=tmp;
-	}
+  byte[] theElements = elements;
+  for (int i=0; i<limit;) { //swap
+    tmp=theElements[i];
+    theElements[i++]=theElements[j];
+    theElements[j--]=tmp;
+  }
 }
 /**
  * Replaces the element at the specified position in the receiver with the specified element.
@@ -502,13 +502,13 @@
  * @param index index of element to replace.
  * @param element element to be stored at the specified position.
  * @exception IndexOutOfBoundsException index is out of range (index
- * 		  &lt; 0 || index &gt;= size()).
+ *       &lt; 0 || index &gt;= size()).
  */
 public void set(int index, byte element) {
-	// overridden for performance only.
-	if (index >= size || index < 0)
-		throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
-	elements[index] = element;
+  // overridden for performance only.
+  if (index >= size || index < 0)
+    throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size);
+  elements[index] = element;
 }
 /**
  * Replaces the element at the specified position in the receiver with the specified element; <b>WARNING:</b> Does not check preconditions.
@@ -520,7 +520,7 @@
  * @param element element to be stored at the specified position.
  */
 public void setQuick(int index, byte element) {
-	elements[index] = element;
+  elements[index] = element;
 }
 /**
  * Randomly permutes the part of the receiver between <code>from</code> (inclusive) and <code>to</code> (inclusive). 
@@ -529,22 +529,22 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public void shuffleFromTo(int from, int to) {
-	// overridden for performance only.
-	if (size==0) {return;}
-	checkRangeFromTo(from, to, size);
-	
-	org.apache.mahout.jet.random.Uniform gen = new org.apache.mahout.jet.random.Uniform(new org.apache.mahout.jet.random.engine.DRand(new java.util.Date()));
-	byte tmpElement;
-	byte[] theElements = elements;
-	int random;
-	for (int i=from; i<to; i++) { 
-		random = gen.nextIntFromTo(i, to);
+  // overridden for performance only.
+  if (size==0) {return;}
+  checkRangeFromTo(from, to, size);
+  
+  org.apache.mahout.jet.random.Uniform gen = new org.apache.mahout.jet.random.Uniform(new org.apache.mahout.jet.random.engine.DRand(new java.util.Date()));
+  byte tmpElement;
+  byte[] theElements = elements;
+  int random;
+  for (int i=from; i<to; i++) { 
+    random = gen.nextIntFromTo(i, to);
 
-		//swap(i, random)
-		tmpElement = theElements[random];
-		theElements[random]=theElements[i]; 
-		theElements[i]=tmpElement; 
-	}  
+    //swap(i, random)
+    tmpElement = theElements[random];
+    theElements[random]=theElements[i]; 
+    theElements[i]=tmpElement; 
+  }  
 }
 /**
  * Sorts the specified range of the receiver into ascending order. 
@@ -556,19 +556,19 @@
  * @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public void sortFromTo(int from, int to) {
-	// try to figure out which option is fastest.
-	double N = to - from + 1;
-	double quickSortEstimate = 	N * Math.log(N)/0.6931471805599453; // O(N*log(N,base=2)) ; ln(2)=0.6931471805599453
+  // try to figure out which option is fastest.
+  double N = to - from + 1;
+  double quickSortEstimate =   N * Math.log(N)/0.6931471805599453; // O(N*log(N,base=2)) ; ln(2)=0.6931471805599453
 
-	double width = 256;
-	double countSortEstimate = 	Math.max(width,N); // O(Max(width,N))
-	
-	if (countSortEstimate < quickSortEstimate) {
-		countSortFromTo(from, to);
-	}
-	else {
-		quickSortFromTo(from, to);
-	}
+  double width = 256;
+  double countSortEstimate =   Math.max(width,N); // O(Max(width,N))
+  
+  if (countSortEstimate < quickSortEstimate) {
+    countSortFromTo(from, to);
+  }
+  else {
+    quickSortFromTo(from, to);
+  }
 }
 /**
  * Trims the capacity of the receiver to be the receiver's current 
@@ -576,6 +576,6 @@
  * storage of the receiver.
  */
 public void trimToSize() {
-	elements = org.apache.mahout.matrix.Arrays.trimToCapacity(elements,size());
+  elements = org.apache.mahout.matrix.Arrays.trimToCapacity(elements,size());
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/list/MinMaxNumberList.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/list/MinMaxNumberList.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/list/MinMaxNumberList.java	(working copy)
@@ -62,18 +62,16 @@
  * @see DistinctNumberList
  * @see java.lang.Float
  * @see java.lang.Double
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 09/24/99
  */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
  */
 @Deprecated
 public class MinMaxNumberList extends org.apache.mahout.matrix.list.AbstractLongList {
-	protected long minValue;
-	protected int bitsPerElement;
-	protected long[] bits;
-	protected int capacity;
+  protected long minValue;
+  protected int bitsPerElement;
+  protected long[] bits;
+  protected int capacity;
 /**
  * Constructs an empty list with the specified initial capacity and the specified range of values allowed to be hold in this list.
  * Legal values are in the range [minimum,maximum], all inclusive.
@@ -82,7 +80,7 @@
  * @param   initialCapacity   the number of elements the receiver can hold without auto-expanding itself by allocating new internal memory.
  */
 public MinMaxNumberList(long minimum, long maximum, int initialCapacity) {
-	this.setUp(minimum, maximum, initialCapacity);
+  this.setUp(minimum, maximum, initialCapacity);
 }
 /**
  * Appends the specified element to the end of this list.
@@ -90,13 +88,13 @@
  * @param element element to be appended to this list.
  */
 public void add(long element) {
-	// overridden for performance only.
-	if (size == capacity) {
-		ensureCapacity(size + 1); 
-	}
-	int i=size*this.bitsPerElement;
-	QuickBitVector.putLongFromTo(this.bits, element-this.minValue,i,i+this.bitsPerElement-1);
-	size++;
+  // overridden for performance only.
+  if (size == capacity) {
+    ensureCapacity(size + 1); 
+  }
+  int i=size*this.bitsPerElement;
+  QuickBitVector.putLongFromTo(this.bits, element-this.minValue,i,i+this.bitsPerElement-1);
+  size++;
 }
 /**
  * Appends the elements <tt>elements[from]</tt> (inclusive), ..., <tt>elements[to]</tt> (inclusive) to the receiver.
@@ -105,44 +103,44 @@
  * @param to the index of the last element to be appended (inclusive)
  */
 public void addAllOfFromTo(long[] elements, int from, int to) {
-	// cache some vars for speed.
-	int bitsPerElem = this.bitsPerElement;
-	int bitsPerElemMinusOne = bitsPerElem-1;
-	long min = this.minValue;
-	long[] theBits = this.bits;
+  // cache some vars for speed.
+  int bitsPerElem = this.bitsPerElement;
+  int bitsPerElemMinusOne = bitsPerElem-1;
+  long min = this.minValue;
+  long[] theBits = this.bits;
 
-	// now let's go.
-	ensureCapacity(this.size+to-from+1);
-	int firstBit = this.size*bitsPerElem;
-	int i=from;
-	for (int times=to-from+1; --times >=0; ) {
-		QuickBitVector.putLongFromTo(theBits, elements[i++]-min, firstBit, firstBit+bitsPerElemMinusOne);
-		firstBit += bitsPerElem;
-	}
-	this.size += (to-from+1); //*bitsPerElem;
+  // now let's go.
+  ensureCapacity(this.size+to-from+1);
+  int firstBit = this.size*bitsPerElem;
+  int i=from;
+  for (int times=to-from+1; --times >=0; ) {
+    QuickBitVector.putLongFromTo(theBits, elements[i++]-min, firstBit, firstBit+bitsPerElemMinusOne);
+    firstBit += bitsPerElem;
+  }
+  this.size += (to-from+1); //*bitsPerElem;
 }
 /**
  * Returns the number of bits necessary to store a single element.
  */
 public int bitsPerElement() {
-	return this.bitsPerElement;
+  return this.bitsPerElement;
 }
 /**
  * Returns the number of bits necessary to store values in the range <tt>[minimum,maximum]</tt>.
  */
 public static int bitsPerElement(long minimum, long maximum) {
-	int bits;
-	if (1+maximum-minimum > 0) {
-		bits=(int) Math.round(Math.ceil(org.apache.mahout.jet.math.Arithmetic.log(2,1+maximum-minimum)));
-	}
-	else {	
-		// overflow or underflow in calculating "1+maximum-minimum"
-		// happens if signed long representation is too short for doing unsigned calculations
-		// e.g. if minimum==LONG.MIN_VALUE, maximum==LONG.MAX_VALUE
-		// --> in such cases store all bits of values without any compression.
-		bits=64;
-	}
-	return bits;
+  int bits;
+  if (1+maximum-minimum > 0) {
+    bits=(int) Math.round(Math.ceil(org.apache.mahout.jet.math.Arithmetic.log(2,1+maximum-minimum)));
+  }
+  else {  
+    // overflow or underflow in calculating "1+maximum-minimum"
+    // happens if signed long representation is too short for doing unsigned calculations
+    // e.g. if minimum==LONG.MIN_VALUE, maximum==LONG.MAX_VALUE
+    // --> in such cases store all bits of values without any compression.
+    bits=64;
+  }
+  return bits;
 }
 /**
  * Ensures that the receiver can hold at least the specified number of elements without needing to allocate new internal memory.
@@ -151,15 +149,15 @@
  * @param   minCapacity   the desired minimum capacity.
  */
 public void ensureCapacity(int minCapacity) {
-	int oldCapacity = capacity;
-	if (minCapacity > oldCapacity) {
-	    int newCapacity = (oldCapacity * 3)/2 + 1;
-		if (newCapacity < minCapacity)	newCapacity = minCapacity;
-		BitVector vector = toBitVector();
-		vector.setSize(newCapacity*bitsPerElement);
-		this.bits = vector.elements();
-		this.capacity = newCapacity;
-	}
+  int oldCapacity = capacity;
+  if (minCapacity > oldCapacity) {
+      int newCapacity = (oldCapacity * 3)/2 + 1;
+    if (newCapacity < minCapacity)  newCapacity = minCapacity;
+    BitVector vector = toBitVector();
+    vector.setSize(newCapacity*bitsPerElement);
+    this.bits = vector.elements();
+    this.capacity = newCapacity;
+  }
 }
 /**
  * Returns the element at the specified position in the receiver; <b>WARNING:</b> Does not check preconditions. 
@@ -170,8 +168,8 @@
  * @param index index of element to return.
  */
 public long getQuick(int index) {
-	int i=index*this.bitsPerElement;
-	return this.minValue + QuickBitVector.getLongFromTo(this.bits, i,i+this.bitsPerElement-1);
+  int i=index*this.bitsPerElement;
+  return this.minValue + QuickBitVector.getLongFromTo(this.bits, i,i+this.bitsPerElement-1);
 }
 /**
  * Copies all elements between index <tt>from</tt> (inclusive) and <tt>to</tt> (inclusive) into <tt>part</tt>, starting at index <tt>partFrom</tt> within <tt>part</tt>.
@@ -185,29 +183,29 @@
  * </pre>
  */
 public void partFromTo(final int from, final int to, final BitVector qualificants, final int qualificantsFrom, long[] part, final int partFrom) {
-	int width = to-from+1;
-	if (from<0 || from>to || to>=size || qualificantsFrom<0 || (qualificants!=null && qualificantsFrom+width>qualificants.size())) {
-		throw new IndexOutOfBoundsException();
-	}
-	if (partFrom<0 || partFrom+width>part.length) {
-		throw new IndexOutOfBoundsException();
-	}
-	
-	long minVal = this.minValue;
-	int bitsPerElem = this.bitsPerElement;
-	long[] theBits = this.bits;
-	
-	int q = qualificantsFrom;
-	int p = partFrom;
-	int j=from*bitsPerElem;
+  int width = to-from+1;
+  if (from<0 || from>to || to>=size || qualificantsFrom<0 || (qualificants!=null && qualificantsFrom+width>qualificants.size())) {
+    throw new IndexOutOfBoundsException();
+  }
+  if (partFrom<0 || partFrom+width>part.length) {
+    throw new IndexOutOfBoundsException();
+  }
+  
+  long minVal = this.minValue;
+  int bitsPerElem = this.bitsPerElement;
+  long[] theBits = this.bits;
+  
+  int q = qualificantsFrom;
+  int p = partFrom;
+  int j=from*bitsPerElem;
 
-	//BitVector tmpBitVector = new BitVector(this.bits, this.size*bitsPerElem);
-	for (int i=from; i<=to; i++, q++, p++, j += bitsPerElem) {
-		if (qualificants==null || qualificants.get(q)) {
-			//part[p] = minVal + tmpBitVector.getLongFromTo(j, j+bitsPerElem-1);
-			part[p] = minVal + QuickBitVector.getLongFromTo(theBits, j, j+bitsPerElem-1);
-		}
-	}
+  //BitVector tmpBitVector = new BitVector(this.bits, this.size*bitsPerElem);
+  for (int i=from; i<=to; i++, q++, p++, j += bitsPerElem) {
+    if (qualificants==null || qualificants.get(q)) {
+      //part[p] = minVal + tmpBitVector.getLongFromTo(j, j+bitsPerElem-1);
+      part[p] = minVal + QuickBitVector.getLongFromTo(theBits, j, j+bitsPerElem-1);
+    }
+  }
 }
 /**
  * Replaces the element at the specified position in the receiver with the specified element; <b>WARNING:</b> Does not check preconditions. 
@@ -219,15 +217,15 @@
  * @param element element to be stored at the specified position.
  */
 public void setQuick(int index, long element) {
-	int i=index*this.bitsPerElement;
-	QuickBitVector.putLongFromTo(this.bits, element-this.minValue,i,i+this.bitsPerElement-1);
+  int i=index*this.bitsPerElement;
+  QuickBitVector.putLongFromTo(this.bits, element-this.minValue,i,i+this.bitsPerElement-1);
 }
 /**
  * Sets the size of the receiver without modifying it otherwise.
  * This method should not release or allocate new memory but simply set some instance variable like <tt>size</tt>.
  */
 protected void setSizeRaw(int newSize) {
-	super.setSizeRaw(newSize);
+  super.setSizeRaw(newSize);
 }
 /**
  * Sets the receiver to an empty list with the specified initial capacity and the specified range of values allowed to be hold in this list.
@@ -237,12 +235,12 @@
  * @param   initialCapacity   the number of elements the receiver can hold without auto-expanding itself by allocating new internal memory.
  */
 protected void setUp(long minimum, long maximum, int initialCapacity) {
-	setUpBitsPerEntry(minimum, maximum);
+  setUpBitsPerEntry(minimum, maximum);
 
-	//this.capacity=initialCapacity;
-	this.bits = QuickBitVector.makeBitVector(initialCapacity,this.bitsPerElement);
-	this.capacity = initialCapacity;
-	this.size=0;	
+  //this.capacity=initialCapacity;
+  this.bits = QuickBitVector.makeBitVector(initialCapacity,this.bitsPerElement);
+  this.capacity = initialCapacity;
+  this.size=0;  
 }
 /**
  * This method was created in VisualAge.
@@ -251,24 +249,24 @@
  * @param initialCapacity int
  */
 protected void setUpBitsPerEntry(long minimum, long maximum) {
-	this.bitsPerElement=this.bitsPerElement(minimum, maximum);
-	if (this.bitsPerElement!=64) { 
-		this.minValue=minimum;	
-			// overflow or underflow in calculating "1+maxValue-minValue"
-			// happens if signed long representation is too short for doing unsigned calculations
-			// e.g. if minValue==LONG.MIN_VALUE, maxValue=LONG.MAX_VALUE
-			// --> in such cases store all bits of values without any en/decoding
-	}
-	else {
-		this.minValue=0;
-	};
+  this.bitsPerElement=this.bitsPerElement(minimum, maximum);
+  if (this.bitsPerElement!=64) { 
+    this.minValue=minimum;  
+      // overflow or underflow in calculating "1+maxValue-minValue"
+      // happens if signed long representation is too short for doing unsigned calculations
+      // e.g. if minValue==LONG.MIN_VALUE, maxValue=LONG.MAX_VALUE
+      // --> in such cases store all bits of values without any en/decoding
+  }
+  else {
+    this.minValue=0;
+  };
 }
 /**
  * Returns the receiver seen as bitvector.
  * WARNING: The bitvector and the receiver share the backing bits. Modifying one of them will affect the other.
  */
 public BitVector toBitVector() {
-	return new BitVector(this.bits, this.capacity*bitsPerElement);
+  return new BitVector(this.bits, this.capacity*bitsPerElement);
 }
 /**
  * Trims the capacity of the receiver to be the receiver's current 
@@ -276,13 +274,13 @@
  * storage of the receiver. 
  */
 public void trimToSize() {
-	int oldCapacity = capacity;
-	if (size < oldCapacity) {
-		BitVector vector = toBitVector();
-		vector.setSize(size);
-		this.bits = vector.elements();
-		this.capacity = size;
-	}
+  int oldCapacity = capacity;
+  if (size < oldCapacity) {
+    BitVector vector = toBitVector();
+    vector.setSize(size);
+    this.bits = vector.elements();
+    this.capacity = size;
+  }
 }
 /**
  * deprecated
@@ -291,6 +289,6 @@
  * @deprecated
  */
 public long xminimum() {
-	return this.minValue;
+  return this.minValue;
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/map/AbstractMap.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/map/AbstractMap.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/map/AbstractMap.java	(working copy)
@@ -16,43 +16,43 @@
 
 @author wolfgang.hoschek@cern.ch
 @version 1.0, 09/24/99
-@see	    java.util.HashMap
+@see      java.util.HashMap
 */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
  */
 @Deprecated
 public abstract class AbstractMap extends org.apache.mahout.matrix.PersistentObject {
-	//public static boolean debug = false; // debug only
-	
-	/**
-	 * The number of distinct associations in the map; its "size()".
-	 */
-	protected int distinct;
+  //public static boolean debug = false; // debug only
+  
+  /**
+   * The number of distinct associations in the map; its "size()".
+   */
+  protected int distinct;
 
-	/**
-	 * The table capacity c=table.length always satisfies the invariant
-	 * <tt>c * minLoadFactor <= s <= c * maxLoadFactor</tt>, where s=size() is the number of associations currently contained.
-	 * The term "c * minLoadFactor" is called the "lowWaterMark", "c * maxLoadFactor" is called the "highWaterMark".
-	 * In other words, the table capacity (and proportionally the memory used by this class) oscillates within these constraints.
-	 * The terms are precomputed and cached to avoid recalculating them each time put(..) or removeKey(...) is called.
-	 */
-	protected int lowWaterMark;
-	protected int highWaterMark;
+  /**
+   * The table capacity c=table.length always satisfies the invariant
+   * <tt>c * minLoadFactor <= s <= c * maxLoadFactor</tt>, where s=size() is the number of associations currently contained.
+   * The term "c * minLoadFactor" is called the "lowWaterMark", "c * maxLoadFactor" is called the "highWaterMark".
+   * In other words, the table capacity (and proportionally the memory used by this class) oscillates within these constraints.
+   * The terms are precomputed and cached to avoid recalculating them each time put(..) or removeKey(...) is called.
+   */
+  protected int lowWaterMark;
+  protected int highWaterMark;
 
-	/**
-	 * The minimum load factor for the hashtable.
-	 */
-	protected double minLoadFactor;
+  /**
+   * The minimum load factor for the hashtable.
+   */
+  protected double minLoadFactor;
 
-	/**
-	 * The maximum load factor for the hashtable.
-	 */
-	protected double maxLoadFactor;
+  /**
+   * The maximum load factor for the hashtable.
+   */
+  protected double maxLoadFactor;
 
-	protected static final int defaultCapacity = 277;
-	protected static final double defaultMinLoadFactor = 0.2;
-	protected static final double defaultMaxLoadFactor = 0.5;
+  protected static final int defaultCapacity = 277;
+  protected static final double defaultMinLoadFactor = 0.2;
+  protected static final double defaultMaxLoadFactor = 0.5;
 /**
  * Makes this class non instantiable, but still let's others inherit from it.
  */
@@ -63,21 +63,21 @@
  * and has at least one FREE slot for the given size.
  */
 protected int chooseGrowCapacity(int size, double minLoad, double maxLoad) {
-	return nextPrime(Math.max(size+1, (int) ((4*size / (3*minLoad+maxLoad)))));
+  return nextPrime(Math.max(size+1, (int) ((4*size / (3*minLoad+maxLoad)))));
 }
 /**
  * Returns new high water mark threshold based on current capacity and maxLoadFactor.
  * @return int the new threshold.
  */
 protected int chooseHighWaterMark(int capacity, double maxLoad) {
-	return Math.min(capacity-2, (int) (capacity * maxLoad)); //makes sure there is always at least one FREE slot
+  return Math.min(capacity-2, (int) (capacity * maxLoad)); //makes sure there is always at least one FREE slot
 }
 /**
  * Returns new low water mark threshold based on current capacity and minLoadFactor.
  * @return int the new threshold.
  */
 protected int chooseLowWaterMark(int capacity, double minLoad) {
-	return (int) (capacity * minLoad);
+  return (int) (capacity * minLoad);
 }
 /**
  * Chooses a new prime table capacity neither favoring shrinking nor growing,
@@ -86,7 +86,7 @@
  * and has at least one FREE slot for the given size.
  */
 protected int chooseMeanCapacity(int size, double minLoad, double maxLoad) {
-	return nextPrime(Math.max(size+1, (int) ((2*size / (minLoad+maxLoad)))));
+  return nextPrime(Math.max(size+1, (int) ((2*size / (minLoad+maxLoad)))));
 }
 /**
  * Chooses a new prime table capacity optimized for shrinking that (approximately) satisfies the invariant
@@ -94,7 +94,7 @@
  * and has at least one FREE slot for the given size.
  */
 protected int chooseShrinkCapacity(int size, double minLoad, double maxLoad) {
-	return nextPrime(Math.max(size+1, (int) ((4*size / (minLoad+3*maxLoad)))));
+  return nextPrime(Math.max(size+1, (int) ((4*size / (minLoad+3*maxLoad)))));
 }
 /**
  * Removes all (key,value) associations from the receiver.
@@ -119,7 +119,7 @@
  * @return <tt>true</tt> if the receiver contains no (key,value) associations.
  */
 public boolean isEmpty() {
-	return distinct == 0;
+  return distinct == 0;
 }
 /**
  * Returns a prime number which is <code>&gt;= desiredCapacity</code> and very close to <code>desiredCapacity</code> (within 11% if <code>desiredCapacity &gt;= 1000</code>).
@@ -127,7 +127,7 @@
  * @return the capacity which should be used for a hashtable.
  */
 protected int nextPrime(int desiredCapacity) {
-	return PrimeFinder.nextPrime(desiredCapacity);
+  return PrimeFinder.nextPrime(desiredCapacity);
 }
 /**
  * Initializes the receiver.
@@ -136,17 +136,17 @@
  * @param      initialCapacity   the initial capacity of the receiver.
  * @param      minLoadFactor     the minLoadFactor of the receiver.
  * @param      maxLoadFactor     the maxLoadFactor of the receiver.
- * @throws	IllegalArgumentException if <tt>initialCapacity < 0 || (minLoadFactor < 0.0 || minLoadFactor >= 1.0) || (maxLoadFactor <= 0.0 || maxLoadFactor >= 1.0) || (minLoadFactor >= maxLoadFactor)</tt>.
+ * @throws  IllegalArgumentException if <tt>initialCapacity < 0 || (minLoadFactor < 0.0 || minLoadFactor >= 1.0) || (maxLoadFactor <= 0.0 || maxLoadFactor >= 1.0) || (minLoadFactor >= maxLoadFactor)</tt>.
  */
 protected void setUp(int initialCapacity, double minLoadFactor, double maxLoadFactor) {
-	if (initialCapacity < 0)
-	    throw new IllegalArgumentException("Initial Capacity must not be less than zero: "+ initialCapacity);
-	if (minLoadFactor < 0.0 || minLoadFactor >= 1.0)
-		throw new IllegalArgumentException("Illegal minLoadFactor: "+ minLoadFactor);
-	if (maxLoadFactor <= 0.0 || maxLoadFactor >= 1.0)
-		throw new IllegalArgumentException("Illegal maxLoadFactor: "+ maxLoadFactor);
-	if (minLoadFactor >= maxLoadFactor)
-		throw new IllegalArgumentException("Illegal minLoadFactor: "+ minLoadFactor+" and maxLoadFactor: "+ maxLoadFactor);
+  if (initialCapacity < 0)
+      throw new IllegalArgumentException("Initial Capacity must not be less than zero: "+ initialCapacity);
+  if (minLoadFactor < 0.0 || minLoadFactor >= 1.0)
+    throw new IllegalArgumentException("Illegal minLoadFactor: "+ minLoadFactor);
+  if (maxLoadFactor <= 0.0 || maxLoadFactor >= 1.0)
+    throw new IllegalArgumentException("Illegal maxLoadFactor: "+ maxLoadFactor);
+  if (minLoadFactor >= maxLoadFactor)
+    throw new IllegalArgumentException("Illegal minLoadFactor: "+ minLoadFactor+" and maxLoadFactor: "+ maxLoadFactor);
 }
 /**
  * Returns the number of (key,value) associations currently contained.
@@ -154,7 +154,7 @@
  * @return the number of (key,value) associations currently contained.
  */
 public int size() {
-	return distinct;
+  return distinct;
 }
 /**
  * Trims the capacity of the receiver to be the receiver's current 
Index: matrix/src/main/java/org/apache/mahout/matrix/map/AbstractIntObjectMap.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/map/AbstractIntObjectMap.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/map/AbstractIntObjectMap.java	(working copy)
@@ -23,14 +23,14 @@
 
 @author wolfgang.hoschek@cern.ch
 @version 1.0, 09/24/99
-@see	    java.util.HashMap
+@see      java.util.HashMap
 */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
  */
 @Deprecated
 public abstract class AbstractIntObjectMap extends AbstractMap {
-	//public static int hashCollisions = 0; // for debug only
+  //public static int hashCollisions = 0; // for debug only
 /**
  * Makes this class non instantiable, but still let's others inherit from it.
  */
@@ -41,13 +41,13 @@
  * @return <tt>true</tt> if the receiver contains the specified key.
  */
 public boolean containsKey(final int key) {
-	return ! forEachKey(
-		new IntProcedure() {
-			public boolean apply(int iterKey) {
-				return (key != iterKey);
-			}
-		}
-	);
+  return ! forEachKey(
+    new IntProcedure() {
+      public boolean apply(int iterKey) {
+        return (key != iterKey);
+      }
+    }
+  );
 }
 /**
  * Returns <tt>true</tt> if the receiver contains the specified value.
@@ -56,13 +56,13 @@
  * @return <tt>true</tt> if the receiver contains the specified value.
  */
 public boolean containsValue(final Object value) {
-	return ! forEachPair( 
-		new IntObjectProcedure() {
-			public boolean apply(int iterKey, Object iterValue) {
-				return (value != iterValue);
-			}
-		}
-	);
+  return ! forEachPair( 
+    new IntObjectProcedure() {
+      public boolean apply(int iterKey, Object iterValue) {
+        return (value != iterValue);
+      }
+    }
+  );
 }
 /**
  * Returns a deep copy of the receiver; uses <code>clone()</code> and casts the result.
@@ -70,7 +70,7 @@
  * @return  a deep copy of the receiver.
  */
 public AbstractIntObjectMap copy() {
-	return (AbstractIntObjectMap) clone();
+  return (AbstractIntObjectMap) clone();
 }
 /**
  * Compares the specified object with this map for equality.  Returns
@@ -79,20 +79,20 @@
  * <tt>m2</tt> represent the same mappings iff
  * <pre>
  * m1.forEachPair(
- *		new IntObjectProcedure() {
- *			public boolean apply(int key, Object value) {
- *				return m2.containsKey(key) && m2.get(key) == value;
- *			}
- *		}
- *	)
+ *    new IntObjectProcedure() {
+ *      public boolean apply(int key, Object value) {
+ *        return m2.containsKey(key) && m2.get(key) == value;
+ *      }
+ *    }
+ *  )
  * &&
  * m2.forEachPair(
- *		new IntObjectProcedure() {
- *			public boolean apply(int key, Object value) {
- *				return m1.containsKey(key) && m1.get(key) == value;
- *			}
- *		}
- *	);
+ *    new IntObjectProcedure() {
+ *      public boolean apply(int key, Object value) {
+ *        return m1.containsKey(key) && m1.get(key) == value;
+ *      }
+ *    }
+ *  );
  * </pre>
  *
  * This implementation first checks if the specified object is this map;
@@ -104,28 +104,28 @@
  * @return <tt>true</tt> if the specified object is equal to this map.
  */
 public boolean equals(Object obj) {
-	if (obj == this) return true;
+  if (obj == this) return true;
 
-	if (!(obj instanceof AbstractIntObjectMap)) return false;
-	final AbstractIntObjectMap other = (AbstractIntObjectMap) obj;
-	if (other.size() != size()) return false;
+  if (!(obj instanceof AbstractIntObjectMap)) return false;
+  final AbstractIntObjectMap other = (AbstractIntObjectMap) obj;
+  if (other.size() != size()) return false;
 
-	return 
-		forEachPair(
-			new IntObjectProcedure() {
-				public boolean apply(int key, Object value) {
-					return other.containsKey(key) && other.get(key) == value;
-				}
-			}
-		)
-		&&
-		other.forEachPair(
-			new IntObjectProcedure() {
-				public boolean apply(int key, Object value) {
-					return containsKey(key) && get(key) == value;
-				}
-			}
-		);
+  return 
+    forEachPair(
+      new IntObjectProcedure() {
+        public boolean apply(int key, Object value) {
+          return other.containsKey(key) && other.get(key) == value;
+        }
+      }
+    )
+    &&
+    other.forEachPair(
+      new IntObjectProcedure() {
+        public boolean apply(int key, Object value) {
+          return containsKey(key) && get(key) == value;
+        }
+      }
+    );
 }
 /**
  * Applies a procedure to each key of the receiver, if any.
@@ -146,13 +146,13 @@
  * @return <tt>false</tt> if the procedure stopped before all keys where iterated over, <tt>true</tt> otherwise. 
  */
 public boolean forEachPair(final IntObjectProcedure procedure) {
-	return forEachKey(
-		new IntProcedure() {
-			public boolean apply(int key) {
-				return procedure.apply(key,get(key));
-			}
-		}
-	);
+  return forEachKey(
+    new IntProcedure() {
+      public boolean apply(int key) {
+        return procedure.apply(key,get(key));
+      }
+    }
+  );
 }
 /**
  * Returns the value associated with the specified key.
@@ -169,21 +169,21 @@
  *
  * @param value the value to search for.
  * @return the first key for which holds <tt>get(key) == value</tt>; 
- *		   returns <tt>Integer.MIN_VALUE</tt> if no such key exists.
+ *       returns <tt>Integer.MIN_VALUE</tt> if no such key exists.
  */
 public int keyOf(final Object value) {
-	final int[] foundKey = new int[1];
-	boolean notFound = forEachPair(
-		new IntObjectProcedure() {
-			public boolean apply(int iterKey, Object iterValue) {
-				boolean found = value == iterValue;
-				if (found) foundKey[0] = iterKey;
-				return !found;
-			}
-		}
-	);
-	if (notFound) return Integer.MIN_VALUE;
-	return foundKey[0];
+  final int[] foundKey = new int[1];
+  boolean notFound = forEachPair(
+    new IntObjectProcedure() {
+      public boolean apply(int iterKey, Object iterValue) {
+        boolean found = value == iterValue;
+        if (found) foundKey[0] = iterKey;
+        return !found;
+      }
+    }
+  );
+  if (notFound) return Integer.MIN_VALUE;
+  return foundKey[0];
 }
 /**
  * Returns a list filled with all keys contained in the receiver.
@@ -195,9 +195,9 @@
  * @return the keys.
  */
 public IntArrayList keys() {
-	IntArrayList list = new IntArrayList(size());
-	keys(list);
-	return list;
+  IntArrayList list = new IntArrayList(size());
+  keys(list);
+  return list;
 }
 /**
  * Fills all keys contained in the receiver into the specified list.
@@ -210,15 +210,15 @@
  * @param list the list to be filled, can have any size.
  */
 public void keys(final IntArrayList list) {
-	list.clear();
-	forEachKey(
-		new IntProcedure() {
-			public boolean apply(int key) {
-				list.add(key);
-				return true;
-			}
-		}
-	);
+  list.clear();
+  forEachKey(
+    new IntProcedure() {
+      public boolean apply(int key) {
+        list.add(key);
+        return true;
+      }
+    }
+  );
 }
 /**
  * Fills all keys <i>sorted ascending by their associated value</i> into the specified list.
@@ -234,7 +234,7 @@
  * @param keyList the list to be filled, can have any size.
  */
 public void keysSortedByValue(final IntArrayList keyList) {
-	pairsSortedByValue(keyList, new ObjectArrayList(size()));
+  pairsSortedByValue(keyList, new ObjectArrayList(size()));
 }
 /**
 Fills all pairs satisfying a given condition into the specified lists.
@@ -246,7 +246,7 @@
 <br>
 <pre>
 IntObjectProcedure condition = new IntObjectProcedure() { // match even keys only
-	public boolean apply(int key, Object value) { return key%2==0; }
+  public boolean apply(int key, Object value) { return key%2==0; }
 }
 keys = (8,7,6), values = (1,2,2) --> keyList = (6,8), valueList = (2,1)</tt>
 </pre>
@@ -256,20 +256,20 @@
 @param valueList the list to be filled with values, can have any size.
 */
 public void pairsMatching(final IntObjectProcedure condition, final IntArrayList keyList, final ObjectArrayList valueList) {
-	keyList.clear();
-	valueList.clear();
-	
-	forEachPair(
-		new IntObjectProcedure() {
-			public boolean apply(int key, Object value) {
-				if (condition.apply(key,value)) {
-					keyList.add(key);
-					valueList.add(value);
-				}
-				return true;
-			}
-		}
-	);
+  keyList.clear();
+  valueList.clear();
+  
+  forEachPair(
+    new IntObjectProcedure() {
+      public boolean apply(int key, Object value) {
+        if (condition.apply(key,value)) {
+          keyList.add(key);
+          valueList.add(value);
+        }
+        return true;
+      }
+    }
+  );
 }
 /**
  * Fills all keys and values <i>sorted ascending by key</i> into the specified lists.
@@ -284,12 +284,12 @@
  * @param valueList the list to be filled with values, can have any size.
  */
 public void pairsSortedByKey(final IntArrayList keyList, final ObjectArrayList valueList) {
-	keys(keyList);
-	keyList.sort();
-	valueList.setSize(keyList.size());
-	for (int i=keyList.size(); --i >= 0; ) {
-		valueList.setQuick(i,get(keyList.getQuick(i)));
-	}
+  keys(keyList);
+  keyList.sort();
+  valueList.setSize(keyList.size());
+  for (int i=keyList.size(); --i >= 0; ) {
+    valueList.setQuick(i,get(keyList.getQuick(i)));
+  }
 }
 /**
  * Fills all keys and values <i>sorted ascending by value according to natural ordering</i> into the specified lists.
@@ -306,28 +306,28 @@
  * @param valueList the list to be filled with values, can have any size.
  */
 public void pairsSortedByValue(final IntArrayList keyList, final ObjectArrayList valueList) {
-	keys(keyList);
-	values(valueList);
-	
-	final int[] k = keyList.elements();
-	final Object[] v = valueList.elements();
-	org.apache.mahout.matrix.Swapper swapper = new org.apache.mahout.matrix.Swapper() {
-		public void swap(int a, int b) {
-			int t2;	Object t1;
-			t1 = v[a]; v[a] = v[b]; v[b] = t1;
-			t2 = k[a]; k[a] = k[b];	k[b] = t2;
-		}
-	}; 
+  keys(keyList);
+  values(valueList);
+  
+  final int[] k = keyList.elements();
+  final Object[] v = valueList.elements();
+  org.apache.mahout.matrix.Swapper swapper = new org.apache.mahout.matrix.Swapper() {
+    public void swap(int a, int b) {
+      int t2;  Object t1;
+      t1 = v[a]; v[a] = v[b]; v[b] = t1;
+      t2 = k[a]; k[a] = k[b];  k[b] = t2;
+    }
+  }; 
 
-	org.apache.mahout.matrix.function.IntComparator comp = new org.apache.mahout.matrix.function.IntComparator() {
-		public int compare(int a, int b) {
-			int ab = ((Comparable)v[a]).compareTo((Comparable)v[b]);
-			return ab<0 ? -1 : ab>0 ? 1 : (k[a]<k[b] ? -1 : (k[a]==k[b] ? 0 : 1));
-			//return v[a]<v[b] ? -1 : v[a]>v[b] ? 1 : (k[a]<k[b] ? -1 : (k[a]==k[b] ? 0 : 1));
-		}
-	};
+  org.apache.mahout.matrix.function.IntComparator comp = new org.apache.mahout.matrix.function.IntComparator() {
+    public int compare(int a, int b) {
+      int ab = ((Comparable)v[a]).compareTo((Comparable)v[b]);
+      return ab<0 ? -1 : ab>0 ? 1 : (k[a]<k[b] ? -1 : (k[a]==k[b] ? 0 : 1));
+      //return v[a]<v[b] ? -1 : v[a]>v[b] ? 1 : (k[a]<k[b] ? -1 : (k[a]==k[b] ? 0 : 1));
+    }
+  };
 
-	org.apache.mahout.matrix.GenericSorting.quickSort(0,keyList.size(),comp,swapper);
+  org.apache.mahout.matrix.GenericSorting.quickSort(0,keyList.size(),comp,swapper);
 }
 /**
  * Associates the given key with the given value.
@@ -351,42 +351,42 @@
  * the String representation of each key-value pair, sorted ascending by key.
  */
 public String toString() {
-	IntArrayList theKeys = keys();
-	theKeys.sort();
+  IntArrayList theKeys = keys();
+  theKeys.sort();
 
-	StringBuffer buf = new StringBuffer();
-	buf.append("[");
-	int maxIndex = theKeys.size() - 1;
-	for (int i = 0; i <= maxIndex; i++) {
-		int key = theKeys.get(i);
-	    buf.append(String.valueOf(key));
-		buf.append("->");
-	    buf.append(String.valueOf(get(key)));
-		if (i < maxIndex) buf.append(", ");
-	}
-	buf.append("]");
-	return buf.toString();
+  StringBuffer buf = new StringBuffer();
+  buf.append("[");
+  int maxIndex = theKeys.size() - 1;
+  for (int i = 0; i <= maxIndex; i++) {
+    int key = theKeys.get(i);
+      buf.append(String.valueOf(key));
+    buf.append("->");
+      buf.append(String.valueOf(get(key)));
+    if (i < maxIndex) buf.append(", ");
+  }
+  buf.append("]");
+  return buf.toString();
 }
 /**
  * Returns a string representation of the receiver, containing
  * the String representation of each key-value pair, sorted ascending by value, according to natural ordering.
  */
 public String toStringByValue() {
-	IntArrayList theKeys = new IntArrayList();
-	keysSortedByValue(theKeys);
+  IntArrayList theKeys = new IntArrayList();
+  keysSortedByValue(theKeys);
 
-	StringBuffer buf = new StringBuffer();
-	buf.append("[");
-	int maxIndex = theKeys.size() - 1;
-	for (int i = 0; i <= maxIndex; i++) {
-		int key = theKeys.get(i);
-	    buf.append(String.valueOf(key));
-		buf.append("->");
-	    buf.append(String.valueOf(get(key)));
-		if (i < maxIndex) buf.append(", ");
-	}
-	buf.append("]");
-	return buf.toString();
+  StringBuffer buf = new StringBuffer();
+  buf.append("[");
+  int maxIndex = theKeys.size() - 1;
+  for (int i = 0; i <= maxIndex; i++) {
+    int key = theKeys.get(i);
+      buf.append(String.valueOf(key));
+    buf.append("->");
+      buf.append(String.valueOf(get(key)));
+    if (i < maxIndex) buf.append(", ");
+  }
+  buf.append("]");
+  return buf.toString();
 }
 /**
  * Returns a list filled with all values contained in the receiver.
@@ -398,9 +398,9 @@
  * @return the values.
  */
 public ObjectArrayList values() {
-	ObjectArrayList list = new ObjectArrayList(size());
-	values(list);
-	return list;
+  ObjectArrayList list = new ObjectArrayList(size());
+  values(list);
+  return list;
 }
 /**
  * Fills all values contained in the receiver into the specified list.
@@ -413,14 +413,14 @@
  * @param list the list to be filled, can have any size.
  */
 public void values(final ObjectArrayList list) {
-	list.clear();
-	forEachKey(
-		new IntProcedure() {
-			public boolean apply(int key) {
-				list.add(get(key));
-				return true;
-			}
-		}
-	);
+  list.clear();
+  forEachKey(
+    new IntProcedure() {
+      public boolean apply(int key) {
+        list.add(get(key));
+        return true;
+      }
+    }
+  );
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/map/PrimeFinder.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/map/PrimeFinder.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/map/PrimeFinder.java	(working copy)
@@ -13,126 +13,124 @@
  * <p>Choosing a prime is <tt>O(log 300)</tt> (binary search in a list of 300 int's).
  * Memory requirements: 1 KB static memory.
  *
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 09/24/99
  */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
  */
 @Deprecated
 public class PrimeFinder extends Object {
-	/**
-	 * The largest prime this class can generate; currently equal to <tt>Integer.MAX_VALUE</tt>.
-	 */
-	public static final int largestPrime = Integer.MAX_VALUE; //yes, it is prime.
+  /**
+   * The largest prime this class can generate; currently equal to <tt>Integer.MAX_VALUE</tt>.
+   */
+  public static final int largestPrime = Integer.MAX_VALUE; //yes, it is prime.
 
-	/**
-	 * The prime number list consists of 11 chunks.
-	 * Each chunk contains prime numbers.
-	 * A chunk starts with a prime P1. The next element is a prime P2. P2 is the smallest prime for which holds: P2 >= 2*P1.
-	 * The next element is P3, for which the same holds with respect to P2, and so on.
-	 *
-	 * Chunks are chosen such that for any desired capacity >= 1000 
-	 * the list includes a prime number <= desired capacity * 1.11 (11%).
-	 * For any desired capacity >= 200 
-	 * the list includes a prime number <= desired capacity * 1.16 (16%).
-	 * For any desired capacity >= 16
-	 * the list includes a prime number <= desired capacity * 1.21 (21%).
-	 * 
-	 * Therefore, primes can be retrieved which are quite close to any desired capacity,
-	 * which in turn avoids wasting memory.
-	 * For example, the list includes 1039,1117,1201,1277,1361,1439,1523,1597,1759,1907,2081.
-	 * So if you need a prime >= 1040, you will find a prime <= 1040*1.11=1154.
-	 *	
-	 * Chunks are chosen such that they are optimized for a hashtable growthfactor of 2.0;
-	 * If your hashtable has such a growthfactor then,  
-	 * after initially "rounding to a prime" upon hashtable construction, 
-	 * it will later expand to prime capacities such that there exist no better primes.
-	 *
-	 * In total these are about 32*10=320 numbers -> 1 KB of static memory needed.
-	 * If you are stingy, then delete every second or fourth chunk.
-	 */
-	
-	private static final int[] primeCapacities = {
-		//chunk #0
-		largestPrime,
-		
-		//chunk #1
-		5,11,23,47,97,197,397,797,1597,3203,6421,12853,25717,51437,102877,205759,
-		  411527,823117,1646237,3292489,6584983,13169977,26339969,52679969,105359939,
-		  210719881,421439783,842879579,1685759167,
-		  
-		//chunk #2
-		433,877,1759,3527,7057,14143,28289,56591,113189,226379,452759,905551,1811107,
-		  3622219,7244441,14488931,28977863,57955739,115911563,231823147,463646329,927292699,
-		  1854585413,
-		  
-		//chunk #3
-		953,1907,3821,7643,15287,30577,61169,122347,244703,489407,978821,1957651,3915341,
-		  7830701,15661423,31322867,62645741,125291483,250582987,501165979,1002331963,
-		  2004663929,
-		  
-		//chunk #4
-		1039,2081,4177,8363,16729,33461,66923,133853,267713,535481,1070981,2141977,4283963,
-		  8567929,17135863,34271747,68543509,137087021,274174111,548348231,1096696463,
-		  
-		//chunk #5
-		31,67,137,277,557,1117,2237,4481,8963,17929,35863,71741,143483,286973,573953,
-		  1147921,2295859,4591721,9183457,18366923,36733847,73467739,146935499,293871013,
-		  587742049,1175484103,
-		  
-		//chunk #6
-		599,1201,2411,4831,9677,19373,38747,77509,155027,310081,620171,1240361,2480729,
-		  4961459,9922933,19845871,39691759,79383533,158767069,317534141,635068283,1270136683,
-		  
-		//chunk #7
-		311,631,1277,2557,5119,10243,20507,41017,82037,164089,328213,656429,1312867,
-		  2625761,5251529,10503061,21006137,42012281,84024581,168049163,336098327,672196673,
-		  1344393353,
-		  
-		//chunk #8
-		3,7,17,37,79,163,331,673,1361,2729,5471,10949,21911,43853,87719,175447,350899,
-		  701819,1403641,2807303,5614657,11229331,22458671,44917381,89834777,179669557,
-		  359339171,718678369,1437356741,
-		  
-		//chunk #9
-		43,89,179,359,719,1439,2879,5779,11579,23159,46327,92657,185323,370661,741337,
-		  1482707,2965421,5930887,11861791,23723597,47447201,94894427,189788857,379577741,
-		  759155483,1518310967,
-		  
-		//chunk #10
-		379,761,1523,3049,6101,12203,24407,48817,97649,195311,390647,781301,1562611,
-		  3125257,6250537,12501169,25002389,50004791,100009607,200019221,400038451,800076929,
-		  1600153859
-		/*
-		// some more chunks for the low range [3..1000]
-		//chunk #11
-		13,29,59,127,257,521,1049,2099,4201,8419,16843,33703,67409,134837,269683,
-		539389,1078787,2157587,4315183,8630387,17260781,34521589,69043189,138086407,
-		276172823,552345671,1104691373,
-		
-		//chunk #12
-		19,41,83,167,337,677,
-		//1361,2729,5471,10949,21911,43853,87719,175447,350899,
-		//701819,1403641,2807303,5614657,11229331,22458671,44917381,89834777,179669557,
-		//359339171,718678369,1437356741,
-		
-		//chunk #13
-		53,107,223,449,907,1823,3659,7321,14653,29311,58631,117269,
-		234539,469099,938207,1876417,3752839,7505681,15011389,30022781,
-		60045577,120091177,240182359,480364727,960729461,1921458943
-		*/
-		};
-		
+  /**
+   * The prime number list consists of 11 chunks.
+   * Each chunk contains prime numbers.
+   * A chunk starts with a prime P1. The next element is a prime P2. P2 is the smallest prime for which holds: P2 >= 2*P1.
+   * The next element is P3, for which the same holds with respect to P2, and so on.
+   *
+   * Chunks are chosen such that for any desired capacity >= 1000 
+   * the list includes a prime number <= desired capacity * 1.11 (11%).
+   * For any desired capacity >= 200 
+   * the list includes a prime number <= desired capacity * 1.16 (16%).
+   * For any desired capacity >= 16
+   * the list includes a prime number <= desired capacity * 1.21 (21%).
+   * 
+   * Therefore, primes can be retrieved which are quite close to any desired capacity,
+   * which in turn avoids wasting memory.
+   * For example, the list includes 1039,1117,1201,1277,1361,1439,1523,1597,1759,1907,2081.
+   * So if you need a prime >= 1040, you will find a prime <= 1040*1.11=1154.
+   *  
+   * Chunks are chosen such that they are optimized for a hashtable growthfactor of 2.0;
+   * If your hashtable has such a growthfactor then,  
+   * after initially "rounding to a prime" upon hashtable construction, 
+   * it will later expand to prime capacities such that there exist no better primes.
+   *
+   * In total these are about 32*10=320 numbers -> 1 KB of static memory needed.
+   * If you are stingy, then delete every second or fourth chunk.
+   */
+  
+  private static final int[] primeCapacities = {
+    //chunk #0
+    largestPrime,
+    
+    //chunk #1
+    5,11,23,47,97,197,397,797,1597,3203,6421,12853,25717,51437,102877,205759,
+      411527,823117,1646237,3292489,6584983,13169977,26339969,52679969,105359939,
+      210719881,421439783,842879579,1685759167,
+      
+    //chunk #2
+    433,877,1759,3527,7057,14143,28289,56591,113189,226379,452759,905551,1811107,
+      3622219,7244441,14488931,28977863,57955739,115911563,231823147,463646329,927292699,
+      1854585413,
+      
+    //chunk #3
+    953,1907,3821,7643,15287,30577,61169,122347,244703,489407,978821,1957651,3915341,
+      7830701,15661423,31322867,62645741,125291483,250582987,501165979,1002331963,
+      2004663929,
+      
+    //chunk #4
+    1039,2081,4177,8363,16729,33461,66923,133853,267713,535481,1070981,2141977,4283963,
+      8567929,17135863,34271747,68543509,137087021,274174111,548348231,1096696463,
+      
+    //chunk #5
+    31,67,137,277,557,1117,2237,4481,8963,17929,35863,71741,143483,286973,573953,
+      1147921,2295859,4591721,9183457,18366923,36733847,73467739,146935499,293871013,
+      587742049,1175484103,
+      
+    //chunk #6
+    599,1201,2411,4831,9677,19373,38747,77509,155027,310081,620171,1240361,2480729,
+      4961459,9922933,19845871,39691759,79383533,158767069,317534141,635068283,1270136683,
+      
+    //chunk #7
+    311,631,1277,2557,5119,10243,20507,41017,82037,164089,328213,656429,1312867,
+      2625761,5251529,10503061,21006137,42012281,84024581,168049163,336098327,672196673,
+      1344393353,
+      
+    //chunk #8
+    3,7,17,37,79,163,331,673,1361,2729,5471,10949,21911,43853,87719,175447,350899,
+      701819,1403641,2807303,5614657,11229331,22458671,44917381,89834777,179669557,
+      359339171,718678369,1437356741,
+      
+    //chunk #9
+    43,89,179,359,719,1439,2879,5779,11579,23159,46327,92657,185323,370661,741337,
+      1482707,2965421,5930887,11861791,23723597,47447201,94894427,189788857,379577741,
+      759155483,1518310967,
+      
+    //chunk #10
+    379,761,1523,3049,6101,12203,24407,48817,97649,195311,390647,781301,1562611,
+      3125257,6250537,12501169,25002389,50004791,100009607,200019221,400038451,800076929,
+      1600153859
+    /*
+    // some more chunks for the low range [3..1000]
+    //chunk #11
+    13,29,59,127,257,521,1049,2099,4201,8419,16843,33703,67409,134837,269683,
+    539389,1078787,2157587,4315183,8630387,17260781,34521589,69043189,138086407,
+    276172823,552345671,1104691373,
+    
+    //chunk #12
+    19,41,83,167,337,677,
+    //1361,2729,5471,10949,21911,43853,87719,175447,350899,
+    //701819,1403641,2807303,5614657,11229331,22458671,44917381,89834777,179669557,
+    //359339171,718678369,1437356741,
+    
+    //chunk #13
+    53,107,223,449,907,1823,3659,7321,14653,29311,58631,117269,
+    234539,469099,938207,1876417,3752839,7505681,15011389,30022781,
+    60045577,120091177,240182359,480364727,960729461,1921458943
+    */
+    };
+    
 
-	static { //initializer
-		// The above prime numbers are formatted for human readability.
-		// To find numbers fast, we sort them once and for all.
-		
-		java.util.Arrays.sort(primeCapacities);
-		//new org.apache.mahout.matrix.list.IntArrayList(primeCapacities).mergeSort(); // for debug only, TODO
-	}
-	
+  static { //initializer
+    // The above prime numbers are formatted for human readability.
+    // To find numbers fast, we sort them once and for all.
+    
+    java.util.Arrays.sort(primeCapacities);
+    //new org.apache.mahout.matrix.list.IntArrayList(primeCapacities).mergeSort(); // for debug only, TODO
+  }
+  
 /**
  * Makes this class non instantiable, but still let's others inherit from it.
  */
@@ -145,10 +143,10 @@
  * from=1000, to=Integer.MAX_VALUE
  */
 protected static void main(String args[]) {
-	int from = Integer.parseInt(args[0]);	
-	int to = Integer.parseInt(args[1]);
-	
-	statistics(from,to);
+  int from = Integer.parseInt(args[0]);  
+  int to = Integer.parseInt(args[1]);
+  
+  statistics(from,to);
 }
 /**
  * Returns a prime number which is <code>&gt;= desiredCapacity</code> and very close to <code>desiredCapacity</code> (within 11% if <code>desiredCapacity &gt;= 1000</code>).
@@ -156,43 +154,43 @@
  * @return the capacity which should be used for a hashtable.
  */
 public static int nextPrime(int desiredCapacity) {
-	int i = java.util.Arrays.binarySearch(primeCapacities, desiredCapacity);
-	//int i = new org.apache.mahout.matrix.list.IntArrayList(primeCapacities).binarySearch(desiredCapacity); // for debug only TODO
-	if (i<0) {
-		// desired capacity not found, choose next prime greater than desired capacity
-		i = -i -1; // remember the semantics of binarySearch...
-	}
-	return primeCapacities[i];
+  int i = java.util.Arrays.binarySearch(primeCapacities, desiredCapacity);
+  //int i = new org.apache.mahout.matrix.list.IntArrayList(primeCapacities).binarySearch(desiredCapacity); // for debug only TODO
+  if (i<0) {
+    // desired capacity not found, choose next prime greater than desired capacity
+    i = -i -1; // remember the semantics of binarySearch...
+  }
+  return primeCapacities[i];
 }
 /**
  * Tests correctness.
  */
 protected static void statistics(int from, int to) {
-	// check that primes contain no accidental errors
-	for (int i=0; i<primeCapacities.length-1; i++) {
-		if (primeCapacities[i] >= primeCapacities[i+1]) throw new RuntimeException("primes are unsorted or contain duplicates; detected at "+i+"@"+primeCapacities[i]);
-	}
-	
-	double accDeviation = 0.0;
-	double maxDeviation = - 1.0;
+  // check that primes contain no accidental errors
+  for (int i=0; i<primeCapacities.length-1; i++) {
+    if (primeCapacities[i] >= primeCapacities[i+1]) throw new RuntimeException("primes are unsorted or contain duplicates; detected at "+i+"@"+primeCapacities[i]);
+  }
+  
+  double accDeviation = 0.0;
+  double maxDeviation = - 1.0;
 
-	for (int i=from; i<=to; i++) {
-		int primeCapacity = nextPrime(i);
-		//System.out.println(primeCapacity);
-		double deviation = (primeCapacity - i) / (double)i;
-		
-		if (deviation > maxDeviation) {
-			maxDeviation = deviation;
-			System.out.println("new maxdev @"+i+"@dev="+maxDeviation);
-		}
+  for (int i=from; i<=to; i++) {
+    int primeCapacity = nextPrime(i);
+    //System.out.println(primeCapacity);
+    double deviation = (primeCapacity - i) / (double)i;
+    
+    if (deviation > maxDeviation) {
+      maxDeviation = deviation;
+      System.out.println("new maxdev @"+i+"@dev="+maxDeviation);
+    }
 
-		accDeviation += deviation;
-	}
-	long width = 1 + (long)to - (long)from;
-	
-	double meanDeviation = accDeviation/width;
-	System.out.println("Statistics for ["+ from + ","+to+"] are as follows");
-	System.out.println("meanDeviation = "+(float)meanDeviation*100+" %");
-	System.out.println("maxDeviation = "+(float)maxDeviation*100+" %");
+    accDeviation += deviation;
+  }
+  long width = 1 + (long)to - (long)from;
+  
+  double meanDeviation = accDeviation/width;
+  System.out.println("Statistics for ["+ from + ","+to+"] are as follows");
+  System.out.println("meanDeviation = "+(float)meanDeviation*100+" %");
+  System.out.println("maxDeviation = "+(float)maxDeviation*100+" %");
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/map/OpenIntObjectHashMap.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/map/OpenIntObjectHashMap.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/map/OpenIntObjectHashMap.java	(working copy)
@@ -21,47 +21,47 @@
 
 @author wolfgang.hoschek@cern.ch
 @version 1.0, 09/24/99
-@see	    java.util.HashMap
+@see      java.util.HashMap
 */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
  */
 @Deprecated
 public class OpenIntObjectHashMap extends AbstractIntObjectMap {
-	 /**
-	 * The hash table keys.
-	 * @serial
-	 */
-	protected int table[];
+   /**
+   * The hash table keys.
+   * @serial
+   */
+  protected int table[];
 
-	 /**
-	 * The hash table values.
-	 * @serial
-	 */
-	protected Object values[];
+   /**
+   * The hash table values.
+   * @serial
+   */
+  protected Object values[];
 
-	/**
-	 * The state of each hash table entry (FREE, FULL, REMOVED).
-	 * @serial
-	 */
-	protected byte state[];
-	
-	/**
-	 * The number of table entries in state==FREE.
-	 * @serial
-	 */
-	protected int freeEntries;
+  /**
+   * The state of each hash table entry (FREE, FULL, REMOVED).
+   * @serial
+   */
+  protected byte state[];
+  
+  /**
+   * The number of table entries in state==FREE.
+   * @serial
+   */
+  protected int freeEntries;
 
-	
-	protected static final byte FREE = 0;
-	protected static final byte FULL = 1;
-	protected static final byte REMOVED = 2;
+  
+  protected static final byte FREE = 0;
+  protected static final byte FULL = 1;
+  protected static final byte REMOVED = 2;
 
 /**
  * Constructs an empty map with default capacity and default load factors.
  */
 public OpenIntObjectHashMap() {
-	this(defaultCapacity);
+  this(defaultCapacity);
 }
 /**
  * Constructs an empty map with the specified initial capacity and default load factors.
@@ -71,7 +71,7 @@
  *             than zero.
  */
 public OpenIntObjectHashMap(int initialCapacity) {
-	this(initialCapacity, defaultMinLoadFactor, defaultMaxLoadFactor);
+  this(initialCapacity, defaultMinLoadFactor, defaultMaxLoadFactor);
 }
 /**
  * Constructs an empty map with
@@ -80,22 +80,22 @@
  * @param      initialCapacity   the initial capacity.
  * @param      minLoadFactor        the minimum load factor.
  * @param      maxLoadFactor        the maximum load factor.
- * @throws	IllegalArgumentException if <tt>initialCapacity < 0 || (minLoadFactor < 0.0 || minLoadFactor >= 1.0) || (maxLoadFactor <= 0.0 || maxLoadFactor >= 1.0) || (minLoadFactor >= maxLoadFactor)</tt>.
+ * @throws  IllegalArgumentException if <tt>initialCapacity < 0 || (minLoadFactor < 0.0 || minLoadFactor >= 1.0) || (maxLoadFactor <= 0.0 || maxLoadFactor >= 1.0) || (minLoadFactor >= maxLoadFactor)</tt>.
  */
 public OpenIntObjectHashMap(int initialCapacity, double minLoadFactor, double maxLoadFactor) {
-	setUp(initialCapacity,minLoadFactor,maxLoadFactor);
+  setUp(initialCapacity,minLoadFactor,maxLoadFactor);
 }
 /**
  * Removes all (key,value) associations from the receiver.
  * Implicitly calls <tt>trimToSize()</tt>.
  */
 public void clear() {
-	new ByteArrayList(this.state).fillFromToWith(0, this.state.length-1, FREE);
-   	new ObjectArrayList(values).fillFromToWith(0, state.length-1, null); // delta
+  new ByteArrayList(this.state).fillFromToWith(0, this.state.length-1, FREE);
+     new ObjectArrayList(values).fillFromToWith(0, state.length-1, null); // delta
 
-	this.distinct = 0;
-	this.freeEntries = table.length; // delta
-	trimToSize();
+  this.distinct = 0;
+  this.freeEntries = table.length; // delta
+  trimToSize();
 }
 /**
  * Returns a deep copy of the receiver.
@@ -103,11 +103,11 @@
  * @return  a deep copy of the receiver.
  */
 public Object clone() {
-	OpenIntObjectHashMap copy = (OpenIntObjectHashMap) super.clone();
-	copy.table = (int[]) copy.table.clone();
-	copy.values = (Object[]) copy.values.clone();
-	copy.state = (byte[]) copy.state.clone();
-	return copy;
+  OpenIntObjectHashMap copy = (OpenIntObjectHashMap) super.clone();
+  copy.table = (int[]) copy.table.clone();
+  copy.values = (Object[]) copy.values.clone();
+  copy.state = (byte[]) copy.state.clone();
+  return copy;
 }
 /**
  * Returns <tt>true</tt> if the receiver contains the specified key.
@@ -115,7 +115,7 @@
  * @return <tt>true</tt> if the receiver contains the specified key.
  */
 public boolean containsKey(int key) {
-	return indexOfKey(key) >= 0;
+  return indexOfKey(key) >= 0;
 }
 /**
  * Returns <tt>true</tt> if the receiver contains the specified value.
@@ -123,7 +123,7 @@
  * @return <tt>true</tt> if the receiver contains the specified value.
  */
 public boolean containsValue(Object value) {
-	return indexOfValue(value) >= 0;
+  return indexOfValue(value) >= 0;
 }
 /**
  * Ensures that the receiver can hold at least the specified number of associations without needing to allocate new internal memory.
@@ -136,10 +136,10 @@
  * @param   minCapacity   the desired minimum capacity.
  */
 public void ensureCapacity(int minCapacity) {
-	if (table.length < minCapacity) {
-		int newCapacity = nextPrime(minCapacity);
-		rehash(newCapacity);
-	}
+  if (table.length < minCapacity) {
+    int newCapacity = nextPrime(minCapacity);
+    rehash(newCapacity);
+  }
 }
 /**
  * Applies a procedure to each key of the receiver, if any.
@@ -152,10 +152,10 @@
  * @return <tt>false</tt> if the procedure stopped before all keys where iterated over, <tt>true</tt> otherwise. 
  */
 public boolean forEachKey(IntProcedure procedure) {
-	for (int i = table.length ; i-- > 0 ;) {
-		if (state[i]==FULL) if (! procedure.apply(table[i])) return false;
-	}
-	return true;
+  for (int i = table.length ; i-- > 0 ;) {
+    if (state[i]==FULL) if (! procedure.apply(table[i])) return false;
+  }
+  return true;
 }
 /**
  * Applies a procedure to each (key,value) pair of the receiver, if any.
@@ -165,10 +165,10 @@
  * @return <tt>false</tt> if the procedure stopped before all keys where iterated over, <tt>true</tt> otherwise. 
  */
 public boolean forEachPair(final IntObjectProcedure procedure) {
-	for (int i = table.length ; i-- > 0 ;) {
-		if (state[i]==FULL) if (! procedure.apply(table[i],values[i])) return false;
-	}
-	return true;
+  for (int i = table.length ; i-- > 0 ;) {
+    if (state[i]==FULL) if (! procedure.apply(table[i],values[i])) return false;
+  }
+  return true;
 }
 /**
  * Returns the value associated with the specified key.
@@ -178,9 +178,9 @@
  * @return the value associated with the specified key; <tt>null</tt> if no such key is present.
  */
 public Object get(int key) {
-	int i = indexOfKey(key);
-	if (i<0) return null; //not contained
-	return values[i];
+  int i = indexOfKey(key);
+  if (i<0) return null; //not contained
+  return values[i];
 }
 /**
  * @param key the key to be added to the receiver.
@@ -190,86 +190,86 @@
  * If the returned index >= 0, then it is NOT already contained and should be inserted at slot index.
  */
 protected int indexOfInsertion(int key) {
-	final int tab[] = table;
-	final byte stat[] = state;
-	final int length = tab.length;
+  final int tab[] = table;
+  final byte stat[] = state;
+  final int length = tab.length;
 
-	final int hash = HashFunctions.hash(key) & 0x7FFFFFFF;
-	int i = hash % length;
-	int decrement = hash % (length-2); // double hashing, see http://www.eece.unm.edu/faculty/heileman/hash/node4.html
-	//int decrement = (hash / length) % length;
-	if (decrement == 0) decrement = 1;
+  final int hash = HashFunctions.hash(key) & 0x7FFFFFFF;
+  int i = hash % length;
+  int decrement = hash % (length-2); // double hashing, see http://www.eece.unm.edu/faculty/heileman/hash/node4.html
+  //int decrement = (hash / length) % length;
+  if (decrement == 0) decrement = 1;
 
-	// stop if we find a removed or free slot, or if we find the key itself
-	// do NOT skip over removed slots (yes, open addressing is like that...)
-	while (stat[i] == FULL && tab[i] != key) {
-		i -= decrement;
-		//hashCollisions++;
-		if (i<0) i+=length;
-	}
-	
-	if (stat[i] == REMOVED) {
-		// stop if we find a free slot, or if we find the key itself.
-		// do skip over removed slots (yes, open addressing is like that...)
-		// assertion: there is at least one FREE slot.
-		int j = i;
-		while (stat[i] != FREE && (stat[i] == REMOVED || tab[i] != key)) {
-			i -= decrement;
-			//hashCollisions++;
-			if (i<0) i+=length;
-		}
-		if (stat[i] == FREE) i = j;
-	}
-	
-	
-	if (stat[i] == FULL) {
-		// key already contained at slot i.
-		// return a negative number identifying the slot.
-		return -i-1;
-	}
-	// not already contained, should be inserted at slot i.
-	// return a number >= 0 identifying the slot.
-	return i; 
+  // stop if we find a removed or free slot, or if we find the key itself
+  // do NOT skip over removed slots (yes, open addressing is like that...)
+  while (stat[i] == FULL && tab[i] != key) {
+    i -= decrement;
+    //hashCollisions++;
+    if (i<0) i+=length;
+  }
+  
+  if (stat[i] == REMOVED) {
+    // stop if we find a free slot, or if we find the key itself.
+    // do skip over removed slots (yes, open addressing is like that...)
+    // assertion: there is at least one FREE slot.
+    int j = i;
+    while (stat[i] != FREE && (stat[i] == REMOVED || tab[i] != key)) {
+      i -= decrement;
+      //hashCollisions++;
+      if (i<0) i+=length;
+    }
+    if (stat[i] == FREE) i = j;
+  }
+  
+  
+  if (stat[i] == FULL) {
+    // key already contained at slot i.
+    // return a negative number identifying the slot.
+    return -i-1;
+  }
+  // not already contained, should be inserted at slot i.
+  // return a number >= 0 identifying the slot.
+  return i; 
 }
 /**
  * @param key the key to be searched in the receiver.
  * @return the index where the key is contained in the receiver, returns -1 if the key was not found.
  */
 protected int indexOfKey(int key) {
-	final int tab[] = table;
-	final byte stat[] = state;
-	final int length = tab.length;
+  final int tab[] = table;
+  final byte stat[] = state;
+  final int length = tab.length;
 
-	final int hash = HashFunctions.hash(key) & 0x7FFFFFFF;
-	int i = hash % length;
-	int decrement = hash % (length-2); // double hashing, see http://www.eece.unm.edu/faculty/heileman/hash/node4.html
-	//int decrement = (hash / length) % length;
-	if (decrement == 0) decrement = 1;
+  final int hash = HashFunctions.hash(key) & 0x7FFFFFFF;
+  int i = hash % length;
+  int decrement = hash % (length-2); // double hashing, see http://www.eece.unm.edu/faculty/heileman/hash/node4.html
+  //int decrement = (hash / length) % length;
+  if (decrement == 0) decrement = 1;
 
-	// stop if we find a free slot, or if we find the key itself.
-	// do skip over removed slots (yes, open addressing is like that...)
-	while (stat[i] != FREE && (stat[i] == REMOVED || tab[i] != key)) {
-		i -= decrement;
-		//hashCollisions++;
-		if (i<0) i+=length;
-	}
-	
-	if (stat[i] == FREE) return -1; // not found
-	return i; //found, return index where key is contained
+  // stop if we find a free slot, or if we find the key itself.
+  // do skip over removed slots (yes, open addressing is like that...)
+  while (stat[i] != FREE && (stat[i] == REMOVED || tab[i] != key)) {
+    i -= decrement;
+    //hashCollisions++;
+    if (i<0) i+=length;
+  }
+  
+  if (stat[i] == FREE) return -1; // not found
+  return i; //found, return index where key is contained
 }
 /**
  * @param value the value to be searched in the receiver.
  * @return the index where the value is contained in the receiver, returns -1 if the value was not found.
  */
 protected int indexOfValue(Object value) {
-	final Object val[] = values;
-	final byte stat[] = state;
+  final Object val[] = values;
+  final byte stat[] = state;
 
-	for (int i=stat.length; --i >= 0;) {
-		if (stat[i]==FULL && val[i]==value) return i;
-	}
+  for (int i=stat.length; --i >= 0;) {
+    if (stat[i]==FULL && val[i]==value) return i;
+  }
 
-	return -1; // not found
+  return -1; // not found
 }
 /**
  * Returns the first key the given value is associated with.
@@ -278,13 +278,13 @@
  *
  * @param value the value to search for.
  * @return the first key for which holds <tt>get(key) == value</tt>; 
- *		   returns <tt>Integer.MIN_VALUE</tt> if no such key exists.
+ *       returns <tt>Integer.MIN_VALUE</tt> if no such key exists.
  */
 public int keyOf(Object value) {
-	//returns the first key found; there may be more matching keys, however.
-	int i = indexOfValue(value);
-	if (i<0) return Integer.MIN_VALUE;
-	return table[i];
+  //returns the first key found; there may be more matching keys, however.
+  int i = indexOfValue(value);
+  if (i<0) return Integer.MIN_VALUE;
+  return table[i];
 }
 /**
  * Fills all keys contained in the receiver into the specified list.
@@ -297,16 +297,16 @@
  * @param list the list to be filled, can have any size.
  */
 public void keys(IntArrayList list) {
-	list.setSize(distinct);
-	int[] elements = list.elements();
-	
-	int[] tab = table;
-	byte[] stat = state;
-	
-	int j=0;
-	for (int i = tab.length ; i-- > 0 ;) {
-		if (stat[i]==FULL) elements[j++]=tab[i];
-	}
+  list.setSize(distinct);
+  int[] elements = list.elements();
+  
+  int[] tab = table;
+  byte[] stat = state;
+  
+  int j=0;
+  for (int i = tab.length ; i-- > 0 ;) {
+    if (stat[i]==FULL) elements[j++]=tab[i];
+  }
 }
 /**
 Fills all pairs satisfying a given condition into the specified lists.
@@ -318,7 +318,7 @@
 <br>
 <pre>
 IntObjectProcedure condition = new IntObjectProcedure() { // match even keys only
-	public boolean apply(int key, Object value) { return key%2==0; }
+  public boolean apply(int key, Object value) { return key%2==0; }
 }
 keys = (8,7,6), values = (1,2,2) --> keyList = (6,8), valueList = (2,1)</tt>
 </pre>
@@ -328,15 +328,15 @@
 @param valueList the list to be filled with values, can have any size.
 */
 public void pairsMatching(final IntObjectProcedure condition, final IntArrayList keyList, final ObjectArrayList valueList) {
-	keyList.clear();
-	valueList.clear();
-	
-	for (int i = table.length ; i-- > 0 ;) {
-		if (state[i]==FULL && condition.apply(table[i],values[i])) {
-			keyList.add(table[i]);
-			valueList.add(values[i]);
-		}
-	}
+  keyList.clear();
+  valueList.clear();
+  
+  for (int i = table.length ; i-- > 0 ;) {
+    if (state[i]==FULL && condition.apply(table[i],values[i])) {
+      keyList.add(table[i]);
+      valueList.add(values[i]);
+    }
+  }
 }
 /**
  * Associates the given key with the given value.
@@ -348,31 +348,31 @@
  *         <tt>false</tt> if the receiver did already contain such a key - the new value has now replaced the formerly associated value.
  */
 public boolean put(int key, Object value) {
-	int i = indexOfInsertion(key);	
-	if (i<0) { //already contained
-		i = -i -1;
-		this.values[i]=value;
-		return false;
-	}
+  int i = indexOfInsertion(key);  
+  if (i<0) { //already contained
+    i = -i -1;
+    this.values[i]=value;
+    return false;
+  }
 
-	if (this.distinct > this.highWaterMark) {
-		int newCapacity = chooseGrowCapacity(this.distinct+1,this.minLoadFactor, this.maxLoadFactor);
-		rehash(newCapacity);
-		return put(key, value);
-	}
+  if (this.distinct > this.highWaterMark) {
+    int newCapacity = chooseGrowCapacity(this.distinct+1,this.minLoadFactor, this.maxLoadFactor);
+    rehash(newCapacity);
+    return put(key, value);
+  }
 
-	this.table[i]=key;
-	this.values[i]=value;
-	if (this.state[i]==FREE) this.freeEntries--;
-	this.state[i]=FULL;
-	this.distinct++;
+  this.table[i]=key;
+  this.values[i]=value;
+  if (this.state[i]==FREE) this.freeEntries--;
+  this.state[i]=FULL;
+  this.distinct++;
 
-	if (this.freeEntries < 1) { //delta
-		int newCapacity = chooseGrowCapacity(this.distinct+1,this.minLoadFactor, this.maxLoadFactor);
-		rehash(newCapacity);
-	}
+  if (this.freeEntries < 1) { //delta
+    int newCapacity = chooseGrowCapacity(this.distinct+1,this.minLoadFactor, this.maxLoadFactor);
+    rehash(newCapacity);
+  }
 
-	return true;
+  return true;
 }
 /**
  * Rehashes the contents of the receiver into a new table
@@ -381,34 +381,34 @@
  * number of keys in the receiver exceeds the high water mark or falls below the low water mark.
  */
 protected void rehash(int newCapacity) {
-	int oldCapacity = table.length;
-	//if (oldCapacity == newCapacity) return;
-	
-	int oldTable[] = table;
-	Object oldValues[] = values;
-	byte oldState[] = state;
+  int oldCapacity = table.length;
+  //if (oldCapacity == newCapacity) return;
+  
+  int oldTable[] = table;
+  Object oldValues[] = values;
+  byte oldState[] = state;
 
-	int newTable[] = new int[newCapacity];
-	Object newValues[] = new Object[newCapacity];
-	byte newState[] = new byte[newCapacity];
+  int newTable[] = new int[newCapacity];
+  Object newValues[] = new Object[newCapacity];
+  byte newState[] = new byte[newCapacity];
 
-	this.lowWaterMark  = chooseLowWaterMark(newCapacity,this.minLoadFactor);
-	this.highWaterMark = chooseHighWaterMark(newCapacity,this.maxLoadFactor);
+  this.lowWaterMark  = chooseLowWaterMark(newCapacity,this.minLoadFactor);
+  this.highWaterMark = chooseHighWaterMark(newCapacity,this.maxLoadFactor);
 
-	this.table = newTable;
-	this.values = newValues;
-	this.state = newState;
-	this.freeEntries = newCapacity-this.distinct; // delta
-	
-	for (int i = oldCapacity ; i-- > 0 ;) {
-		if (oldState[i]==FULL) {
-			int element = oldTable[i];
-			int index = indexOfInsertion(element);
-			newTable[index]=element;
-			newValues[index]=oldValues[i];
-			newState[index]=FULL;
-		}
-	}
+  this.table = newTable;
+  this.values = newValues;
+  this.state = newState;
+  this.freeEntries = newCapacity-this.distinct; // delta
+  
+  for (int i = oldCapacity ; i-- > 0 ;) {
+    if (oldState[i]==FULL) {
+      int element = oldTable[i];
+      int index = indexOfInsertion(element);
+      newTable[index]=element;
+      newValues[index]=oldValues[i];
+      newState[index]=FULL;
+    }
+  }
 }
 /**
  * Removes the given key with its associated element from the receiver, if present.
@@ -417,19 +417,19 @@
  * @return <tt>true</tt> if the receiver contained the specified key, <tt>false</tt> otherwise.
  */
 public boolean removeKey(int key) {
-	int i = indexOfKey(key);
-	if (i<0) return false; // key not contained
+  int i = indexOfKey(key);
+  if (i<0) return false; // key not contained
 
-	this.state[i]=REMOVED;
-	this.values[i]=null; // delta
-	this.distinct--;
+  this.state[i]=REMOVED;
+  this.values[i]=null; // delta
+  this.distinct--;
 
-	if (this.distinct < this.lowWaterMark) {
-		int newCapacity = chooseShrinkCapacity(this.distinct,this.minLoadFactor, this.maxLoadFactor);
-		rehash(newCapacity);
-	}
-	
-	return true;	
+  if (this.distinct < this.lowWaterMark) {
+    int newCapacity = chooseShrinkCapacity(this.distinct,this.minLoadFactor, this.maxLoadFactor);
+    rehash(newCapacity);
+  }
+  
+  return true;  
 }
 /**
  * Initializes the receiver.
@@ -437,32 +437,32 @@
  * @param      initialCapacity   the initial capacity of the receiver.
  * @param      minLoadFactor        the minLoadFactor of the receiver.
  * @param      maxLoadFactor        the maxLoadFactor of the receiver.
- * @throws	IllegalArgumentException if <tt>initialCapacity < 0 || (minLoadFactor < 0.0 || minLoadFactor >= 1.0) || (maxLoadFactor <= 0.0 || maxLoadFactor >= 1.0) || (minLoadFactor >= maxLoadFactor)</tt>.
+ * @throws  IllegalArgumentException if <tt>initialCapacity < 0 || (minLoadFactor < 0.0 || minLoadFactor >= 1.0) || (maxLoadFactor <= 0.0 || maxLoadFactor >= 1.0) || (minLoadFactor >= maxLoadFactor)</tt>.
  */
 protected void setUp(int initialCapacity, double minLoadFactor, double maxLoadFactor) {
-	int capacity = initialCapacity;
-	super.setUp(capacity, minLoadFactor, maxLoadFactor);
-	capacity = nextPrime(capacity);
-	if (capacity==0) capacity=1; // open addressing needs at least one FREE slot at any time.
-	
-	this.table = new int[capacity];
-	this.values = new Object[capacity];
-	this.state = new byte[capacity];
+  int capacity = initialCapacity;
+  super.setUp(capacity, minLoadFactor, maxLoadFactor);
+  capacity = nextPrime(capacity);
+  if (capacity==0) capacity=1; // open addressing needs at least one FREE slot at any time.
+  
+  this.table = new int[capacity];
+  this.values = new Object[capacity];
+  this.state = new byte[capacity];
 
-	// memory will be exhausted long before this pathological case happens, anyway.
-	this.minLoadFactor = minLoadFactor;
-	if (capacity == PrimeFinder.largestPrime) this.maxLoadFactor = 1.0;
-	else this.maxLoadFactor = maxLoadFactor;
+  // memory will be exhausted long before this pathological case happens, anyway.
+  this.minLoadFactor = minLoadFactor;
+  if (capacity == PrimeFinder.largestPrime) this.maxLoadFactor = 1.0;
+  else this.maxLoadFactor = maxLoadFactor;
 
-	this.distinct = 0;
-	this.freeEntries = capacity; // delta
-	
-	// lowWaterMark will be established upon first expansion.
-	// establishing it now (upon instance construction) would immediately make the table shrink upon first put(...).
-	// After all the idea of an "initialCapacity" implies violating lowWaterMarks when an object is young.
-	// See ensureCapacity(...)
-	this.lowWaterMark = 0; 
-	this.highWaterMark = chooseHighWaterMark(capacity, this.maxLoadFactor);
+  this.distinct = 0;
+  this.freeEntries = capacity; // delta
+  
+  // lowWaterMark will be established upon first expansion.
+  // establishing it now (upon instance construction) would immediately make the table shrink upon first put(...).
+  // After all the idea of an "initialCapacity" implies violating lowWaterMarks when an object is young.
+  // See ensureCapacity(...)
+  this.lowWaterMark = 0; 
+  this.highWaterMark = chooseHighWaterMark(capacity, this.maxLoadFactor);
 }
 /**
  * Trims the capacity of the receiver to be the receiver's current 
@@ -470,12 +470,12 @@
  * storage of the receiver.
  */
 public void trimToSize() {
-	// * 1.2 because open addressing's performance exponentially degrades beyond that point
-	// so that even rehashing the table can take very long
-	int newCapacity = nextPrime((int)(1 + 1.2*size()));
-	if (table.length > newCapacity) {
-		rehash(newCapacity);
-	}
+  // * 1.2 because open addressing's performance exponentially degrades beyond that point
+  // so that even rehashing the table can take very long
+  int newCapacity = nextPrime((int)(1 + 1.2*size()));
+  if (table.length > newCapacity) {
+    rehash(newCapacity);
+  }
 }
 /**
  * Fills all values contained in the receiver into the specified list.
@@ -488,15 +488,15 @@
  * @param list the list to be filled, can have any size.
  */
 public void values(ObjectArrayList list) {
-	list.setSize(distinct);
-	Object[] elements = list.elements();
-	
-	Object[] val = values;
-	byte[] stat = state;
-	
-	int j=0;
-	for (int i = stat.length ; i-- > 0 ;) {
-		if (stat[i]==FULL) elements[j++]=val[i];
-	}
+  list.setSize(distinct);
+  Object[] elements = list.elements();
+  
+  Object[] val = values;
+  byte[] stat = state;
+  
+  int j=0;
+  for (int i = stat.length ; i-- > 0 ;) {
+    if (stat[i]==FULL) elements[j++]=val[i];
+  }
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/map/AbstractDoubleIntMap.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/map/AbstractDoubleIntMap.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/map/AbstractDoubleIntMap.java	(working copy)
@@ -23,14 +23,14 @@
 
 @author wolfgang.hoschek@cern.ch
 @version 1.0, 09/24/99
-@see	    java.util.HashMap
+@see      java.util.HashMap
 */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
  */
 @Deprecated
 public abstract class AbstractDoubleIntMap extends AbstractMap {
-	//public static int hashCollisions = 0; // for debug only
+  //public static int hashCollisions = 0; // for debug only
 /**
  * Makes this class non instantiable, but still let's others inherit from it.
  */
@@ -41,13 +41,13 @@
  * @return <tt>true</tt> if the receiver contains the specified key.
  */
 public boolean containsKey(final double key) {
-	return ! forEachKey(
-		new DoubleProcedure() {
-			public boolean apply(double iterKey) {
-				return (key != iterKey);
-			}
-		}
-	);
+  return ! forEachKey(
+    new DoubleProcedure() {
+      public boolean apply(double iterKey) {
+        return (key != iterKey);
+      }
+    }
+  );
 }
 /**
  * Returns <tt>true</tt> if the receiver contains the specified value.
@@ -55,13 +55,13 @@
  * @return <tt>true</tt> if the receiver contains the specified value.
  */
 public boolean containsValue(final int value) {
-	return ! forEachPair( 
-		new DoubleIntProcedure() {
-			public boolean apply(double iterKey, int iterValue) {
-				return (value != iterValue);
-			}
-		}
-	);
+  return ! forEachPair( 
+    new DoubleIntProcedure() {
+      public boolean apply(double iterKey, int iterValue) {
+        return (value != iterValue);
+      }
+    }
+  );
 }
 /**
  * Returns a deep copy of the receiver; uses <code>clone()</code> and casts the result.
@@ -69,7 +69,7 @@
  * @return  a deep copy of the receiver.
  */
 public AbstractDoubleIntMap copy() {
-	return (AbstractDoubleIntMap) clone();
+  return (AbstractDoubleIntMap) clone();
 }
 /**
  * Compares the specified object with this map for equality.  Returns
@@ -78,20 +78,20 @@
  * <tt>m2</tt> represent the same mappings iff
  * <pre>
  * m1.forEachPair(
- *		new DoubleIntProcedure() {
- *			public boolean apply(double key, int value) {
- *				return m2.containsKey(key) && m2.get(key) == value;
- *			}
- *		}
- *	)
+ *    new DoubleIntProcedure() {
+ *      public boolean apply(double key, int value) {
+ *        return m2.containsKey(key) && m2.get(key) == value;
+ *      }
+ *    }
+ *  )
  * &&
  * m2.forEachPair(
- *		new DoubleIntProcedure() {
- *			public boolean apply(double key, int value) {
- *				return m1.containsKey(key) && m1.get(key) == value;
- *			}
- *		}
- *	);
+ *    new DoubleIntProcedure() {
+ *      public boolean apply(double key, int value) {
+ *        return m1.containsKey(key) && m1.get(key) == value;
+ *      }
+ *    }
+ *  );
  * </pre>
  *
  * This implementation first checks if the specified object is this map;
@@ -103,28 +103,28 @@
  * @return <tt>true</tt> if the specified object is equal to this map.
  */
 public boolean equals(Object obj) {
-	if (obj == this) return true;
+  if (obj == this) return true;
 
-	if (!(obj instanceof AbstractDoubleIntMap)) return false;
-	final AbstractDoubleIntMap other = (AbstractDoubleIntMap) obj;
-	if (other.size() != size()) return false;
+  if (!(obj instanceof AbstractDoubleIntMap)) return false;
+  final AbstractDoubleIntMap other = (AbstractDoubleIntMap) obj;
+  if (other.size() != size()) return false;
 
-	return 
-		forEachPair(
-			new DoubleIntProcedure() {
-				public boolean apply(double key, int value) {
-					return other.containsKey(key) && other.get(key) == value;
-				}
-			}
-		)
-		&&
-		other.forEachPair(
-			new DoubleIntProcedure() {
-				public boolean apply(double key, int value) {
-					return containsKey(key) && get(key) == value;
-				}
-			}
-		);
+  return 
+    forEachPair(
+      new DoubleIntProcedure() {
+        public boolean apply(double key, int value) {
+          return other.containsKey(key) && other.get(key) == value;
+        }
+      }
+    )
+    &&
+    other.forEachPair(
+      new DoubleIntProcedure() {
+        public boolean apply(double key, int value) {
+          return containsKey(key) && get(key) == value;
+        }
+      }
+    );
 }
 /**
  * Applies a procedure to each key of the receiver, if any.
@@ -145,13 +145,13 @@
  * @return <tt>false</tt> if the procedure stopped before all keys where iterated over, <tt>true</tt> otherwise. 
  */
 public boolean forEachPair(final DoubleIntProcedure procedure) {
-	return forEachKey(
-		new DoubleProcedure() {
-			public boolean apply(double key) {
-				return procedure.apply(key,get(key));
-			}
-		}
-	);
+  return forEachKey(
+    new DoubleProcedure() {
+      public boolean apply(double key) {
+        return procedure.apply(key,get(key));
+      }
+    }
+  );
 }
 /**
  * Returns the value associated with the specified key.
@@ -168,21 +168,21 @@
  *
  * @param value the value to search for.
  * @return the first key for which holds <tt>get(key) == value</tt>; 
- *		   returns <tt>Double.NaN</tt> if no such key exists.
+ *       returns <tt>Double.NaN</tt> if no such key exists.
  */
 public double keyOf(final int value) {
-	final double[] foundKey = new double[1];
-	boolean notFound = forEachPair(
-		new DoubleIntProcedure() {
-			public boolean apply(double iterKey, int iterValue) {
-				boolean found = value == iterValue;
-				if (found) foundKey[0] = iterKey;
-				return !found;
-			}
-		}
-	);
-	if (notFound) return Double.NaN;
-	return foundKey[0];
+  final double[] foundKey = new double[1];
+  boolean notFound = forEachPair(
+    new DoubleIntProcedure() {
+      public boolean apply(double iterKey, int iterValue) {
+        boolean found = value == iterValue;
+        if (found) foundKey[0] = iterKey;
+        return !found;
+      }
+    }
+  );
+  if (notFound) return Double.NaN;
+  return foundKey[0];
 }
 /**
  * Returns a list filled with all keys contained in the receiver.
@@ -195,9 +195,9 @@
  * @return the keys.
  */
 public DoubleArrayList keys() {
-	DoubleArrayList list = new DoubleArrayList(size());
-	keys(list);
-	return list;
+  DoubleArrayList list = new DoubleArrayList(size());
+  keys(list);
+  return list;
 }
 /**
  * Fills all keys contained in the receiver into the specified list.
@@ -210,15 +210,15 @@
  * @param list the list to be filled, can have any size.
  */
 public void keys(final DoubleArrayList list) {
-	list.clear();
-	forEachKey(
-		new DoubleProcedure() {
-			public boolean apply(double key) {
-				list.add(key);
-				return true;
-			}
-		}
-	);
+  list.clear();
+  forEachKey(
+    new DoubleProcedure() {
+      public boolean apply(double key) {
+        list.add(key);
+        return true;
+      }
+    }
+  );
 }
 /**
  * Fills all keys <i>sorted ascending by their associated value</i> into the specified list.
@@ -234,7 +234,7 @@
  * @param keyList the list to be filled, can have any size.
  */
 public void keysSortedByValue(final DoubleArrayList keyList) {
-	pairsSortedByValue(keyList, new IntArrayList(size()));
+  pairsSortedByValue(keyList, new IntArrayList(size()));
 }
 /**
 Fills all pairs satisfying a given condition into the specified lists.
@@ -246,7 +246,7 @@
 <br>
 <pre>
 DoubleIntProcedure condition = new DoubleIntProcedure() { // match even values only
-	public boolean apply(double key, int value) { return value%2==0; }
+  public boolean apply(double key, int value) { return value%2==0; }
 }
 keys = (8,7,6), values = (1,2,2) --> keyList = (6,8), valueList = (2,1)</tt>
 </pre>
@@ -256,20 +256,20 @@
 @param valueList the list to be filled with values, can have any size.
 */
 public void pairsMatching(final DoubleIntProcedure condition, final DoubleArrayList keyList, final IntArrayList valueList) {
-	keyList.clear();
-	valueList.clear();
-	
-	forEachPair(
-		new DoubleIntProcedure() {
-			public boolean apply(double key, int value) {
-				if (condition.apply(key,value)) {
-					keyList.add(key);
-					valueList.add(value);
-				}
-				return true;
-			}
-		}
-	);
+  keyList.clear();
+  valueList.clear();
+  
+  forEachPair(
+    new DoubleIntProcedure() {
+      public boolean apply(double key, int value) {
+        if (condition.apply(key,value)) {
+          keyList.add(key);
+          valueList.add(value);
+        }
+        return true;
+      }
+    }
+  );
 }
 /**
  * Fills all keys and values <i>sorted ascending by key</i> into the specified lists.
@@ -284,41 +284,41 @@
  * @param valueList the list to be filled with values, can have any size.
  */
 public void pairsSortedByKey(final DoubleArrayList keyList, final IntArrayList valueList) {
-	/*
-	keys(keyList); 
-	values(valueList);
-	
-	final double[] k = keyList.elements();
-	final int[] v = valueList.elements();
-	org.apache.mahout.matrix.Swapper swapper = new org.apache.mahout.matrix.Swapper() {
-		public void swap(int a, int b) {
-			int t1;	double t2;
-			t1 = v[a]; v[a] = v[b]; v[b] = t1;
-			t2 = k[a]; k[a] = k[b];	k[b] = t2;
-		}
-	}; 
+  /*
+  keys(keyList); 
+  values(valueList);
+  
+  final double[] k = keyList.elements();
+  final int[] v = valueList.elements();
+  org.apache.mahout.matrix.Swapper swapper = new org.apache.mahout.matrix.Swapper() {
+    public void swap(int a, int b) {
+      int t1;  double t2;
+      t1 = v[a]; v[a] = v[b]; v[b] = t1;
+      t2 = k[a]; k[a] = k[b];  k[b] = t2;
+    }
+  }; 
 
-	org.apache.mahout.matrix.function.IntComparator comp = new org.apache.mahout.matrix.function.IntComparator() {
-		public int compare(int a, int b) {
-			return k[a]<k[b] ? -1 : k[a]==k[b] ? 0 : 1;
-		}
-	};
-	org.apache.mahout.matrix.MultiSorting.sort(0,keyList.size(),comp,swapper);
-	*/	
-	
+  org.apache.mahout.matrix.function.IntComparator comp = new org.apache.mahout.matrix.function.IntComparator() {
+    public int compare(int a, int b) {
+      return k[a]<k[b] ? -1 : k[a]==k[b] ? 0 : 1;
+    }
+  };
+  org.apache.mahout.matrix.MultiSorting.sort(0,keyList.size(),comp,swapper);
+  */  
+  
 
-	
-	// this variant may be quicker
-	//org.apache.mahout.matrix.map.OpenDoubleIntHashMap.hashCollisions = 0;
-	//System.out.println("collisions="+org.apache.mahout.matrix.map.OpenDoubleIntHashMap.hashCollisions);
-	keys(keyList);
-	keyList.sort();
-	valueList.setSize(keyList.size());
-	for (int i=keyList.size(); --i >= 0; ) {
-		valueList.setQuick(i,get(keyList.getQuick(i)));
-	}
-	//System.out.println("collisions="+org.apache.mahout.matrix.map.OpenDoubleIntHashMap.hashCollisions);
-	
+  
+  // this variant may be quicker
+  //org.apache.mahout.matrix.map.OpenDoubleIntHashMap.hashCollisions = 0;
+  //System.out.println("collisions="+org.apache.mahout.matrix.map.OpenDoubleIntHashMap.hashCollisions);
+  keys(keyList);
+  keyList.sort();
+  valueList.setSize(keyList.size());
+  for (int i=keyList.size(); --i >= 0; ) {
+    valueList.setQuick(i,get(keyList.getQuick(i)));
+  }
+  //System.out.println("collisions="+org.apache.mahout.matrix.map.OpenDoubleIntHashMap.hashCollisions);
+  
 }
 /**
  * Fills all keys and values <i>sorted ascending by value</i> into the specified lists.
@@ -335,28 +335,28 @@
  * @param valueList the list to be filled with values, can have any size.
  */
 public void pairsSortedByValue(final DoubleArrayList keyList, final IntArrayList valueList) {
-	keys(keyList);
-	values(valueList);
-	
-	final double[] k = keyList.elements();
-	final int[] v = valueList.elements();
-	org.apache.mahout.matrix.Swapper swapper = new org.apache.mahout.matrix.Swapper() {
-		public void swap(int a, int b) {
-			int t1;	double t2;
-			t1 = v[a]; v[a] = v[b]; v[b] = t1;
-			t2 = k[a]; k[a] = k[b];	k[b] = t2;
-		}
-	}; 
+  keys(keyList);
+  values(valueList);
+  
+  final double[] k = keyList.elements();
+  final int[] v = valueList.elements();
+  org.apache.mahout.matrix.Swapper swapper = new org.apache.mahout.matrix.Swapper() {
+    public void swap(int a, int b) {
+      int t1;  double t2;
+      t1 = v[a]; v[a] = v[b]; v[b] = t1;
+      t2 = k[a]; k[a] = k[b];  k[b] = t2;
+    }
+  }; 
 
-	org.apache.mahout.matrix.function.IntComparator comp = new org.apache.mahout.matrix.function.IntComparator() {
-		public int compare(int a, int b) {
-			return v[a]<v[b] ? -1 : v[a]>v[b] ? 1 : (k[a]<k[b] ? -1 : (k[a]==k[b] ? 0 : 1));
-		}
-	};
+  org.apache.mahout.matrix.function.IntComparator comp = new org.apache.mahout.matrix.function.IntComparator() {
+    public int compare(int a, int b) {
+      return v[a]<v[b] ? -1 : v[a]>v[b] ? 1 : (k[a]<k[b] ? -1 : (k[a]==k[b] ? 0 : 1));
+    }
+  };
 
-	//org.apache.mahout.matrix.map.OpenDoubleIntHashMap.hashCollisions = 0;
-	org.apache.mahout.matrix.GenericSorting.quickSort(0,keyList.size(),comp,swapper);
-	//System.out.println("collisions="+org.apache.mahout.matrix.map.OpenDoubleIntHashMap.hashCollisions);
+  //org.apache.mahout.matrix.map.OpenDoubleIntHashMap.hashCollisions = 0;
+  org.apache.mahout.matrix.GenericSorting.quickSort(0,keyList.size(),comp,swapper);
+  //System.out.println("collisions="+org.apache.mahout.matrix.map.OpenDoubleIntHashMap.hashCollisions);
 }
 /**
  * Associates the given key with the given value.
@@ -380,42 +380,42 @@
  * the String representation of each key-value pair, sorted ascending by key.
  */
 public String toString() {
-	DoubleArrayList theKeys = keys();
-	theKeys.sort();
+  DoubleArrayList theKeys = keys();
+  theKeys.sort();
 
-	StringBuffer buf = new StringBuffer();
-	buf.append("[");
-	int maxIndex = theKeys.size() - 1;
-	for (int i = 0; i <= maxIndex; i++) {
-		double key = theKeys.get(i);
-	    buf.append(String.valueOf(key));
-		buf.append("->");
-	    buf.append(String.valueOf(get(key)));
-		if (i < maxIndex) buf.append(", ");
-	}
-	buf.append("]");
-	return buf.toString();
+  StringBuffer buf = new StringBuffer();
+  buf.append("[");
+  int maxIndex = theKeys.size() - 1;
+  for (int i = 0; i <= maxIndex; i++) {
+    double key = theKeys.get(i);
+      buf.append(String.valueOf(key));
+    buf.append("->");
+      buf.append(String.valueOf(get(key)));
+    if (i < maxIndex) buf.append(", ");
+  }
+  buf.append("]");
+  return buf.toString();
 }
 /**
  * Returns a string representation of the receiver, containing
  * the String representation of each key-value pair, sorted ascending by value.
  */
 public String toStringByValue() {
-	DoubleArrayList theKeys = new DoubleArrayList();
-	keysSortedByValue(theKeys);
+  DoubleArrayList theKeys = new DoubleArrayList();
+  keysSortedByValue(theKeys);
 
-	StringBuffer buf = new StringBuffer();
-	buf.append("[");
-	int maxIndex = theKeys.size() - 1;
-	for (int i = 0; i <= maxIndex; i++) {
-		double key = theKeys.get(i);
-	    buf.append(String.valueOf(key));
-		buf.append("->");
-	    buf.append(String.valueOf(get(key)));
-		if (i < maxIndex) buf.append(", ");
-	}
-	buf.append("]");
-	return buf.toString();
+  StringBuffer buf = new StringBuffer();
+  buf.append("[");
+  int maxIndex = theKeys.size() - 1;
+  for (int i = 0; i <= maxIndex; i++) {
+    double key = theKeys.get(i);
+      buf.append(String.valueOf(key));
+    buf.append("->");
+      buf.append(String.valueOf(get(key)));
+    if (i < maxIndex) buf.append(", ");
+  }
+  buf.append("]");
+  return buf.toString();
 }
 /**
  * Returns a list filled with all values contained in the receiver.
@@ -427,9 +427,9 @@
  * @return the values.
  */
 public IntArrayList values() {
-	IntArrayList list = new IntArrayList(size());
-	values(list);
-	return list;
+  IntArrayList list = new IntArrayList(size());
+  values(list);
+  return list;
 }
 /**
  * Fills all values contained in the receiver into the specified list.
@@ -442,14 +442,14 @@
  * @param list the list to be filled, can have any size.
  */
 public void values(final IntArrayList list) {
-	list.clear();
-	forEachKey(
-		new DoubleProcedure() {
-			public boolean apply(double key) {
-				list.add(get(key));
-				return true;
-			}
-		}
-	);
+  list.clear();
+  forEachKey(
+    new DoubleProcedure() {
+      public boolean apply(double key) {
+        list.add(get(key));
+        return true;
+      }
+    }
+  );
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/map/AbstractIntDoubleMap.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/map/AbstractIntDoubleMap.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/map/AbstractIntDoubleMap.java	(working copy)
@@ -23,14 +23,14 @@
 
 @author wolfgang.hoschek@cern.ch
 @version 1.0, 09/24/99
-@see	    java.util.HashMap
+@see      java.util.HashMap
 */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
  */
 @Deprecated
 public abstract class AbstractIntDoubleMap extends AbstractMap {
-	//public static int hashCollisions = 0; // for debug only
+  //public static int hashCollisions = 0; // for debug only
 /**
  * Makes this class non instantiable, but still let's others inherit from it.
  */
@@ -41,14 +41,14 @@
 @param function a function object taking as argument the current association's value.
 */
 public void assign(final org.apache.mahout.matrix.function.DoubleFunction function) {
-	copy().forEachPair(
-		new org.apache.mahout.matrix.function.IntDoubleProcedure() {
-			public boolean apply(int key, double value) {
-				put(key,function.apply(value));
-				return true;
-			}
-		}
-	);
+  copy().forEachPair(
+    new org.apache.mahout.matrix.function.IntDoubleProcedure() {
+      public boolean apply(int key, double value) {
+        put(key,function.apply(value));
+        return true;
+      }
+    }
+  );
 }
 /**
  * Clears the receiver, then adds all (key,value) pairs of <tt>other</tt>values to it.
@@ -56,15 +56,15 @@
  * @param other the other map to be copied into the receiver.
  */
 public void assign(AbstractIntDoubleMap other) {
-	clear();
-	other.forEachPair(
-		new IntDoubleProcedure() {
-			public boolean apply(int key, double value) {
-				put(key,value);
-				return true;
-			}
-		}
-	);
+  clear();
+  other.forEachPair(
+    new IntDoubleProcedure() {
+      public boolean apply(int key, double value) {
+        put(key,value);
+        return true;
+      }
+    }
+  );
 }
 /**
  * Returns <tt>true</tt> if the receiver contains the specified key.
@@ -72,13 +72,13 @@
  * @return <tt>true</tt> if the receiver contains the specified key.
  */
 public boolean containsKey(final int key) {
-	return ! forEachKey(
-		new IntProcedure() {
-			public boolean apply(int iterKey) {
-				return (key != iterKey);
-			}
-		}
-	);
+  return ! forEachKey(
+    new IntProcedure() {
+      public boolean apply(int iterKey) {
+        return (key != iterKey);
+      }
+    }
+  );
 }
 /**
  * Returns <tt>true</tt> if the receiver contains the specified value.
@@ -86,13 +86,13 @@
  * @return <tt>true</tt> if the receiver contains the specified value.
  */
 public boolean containsValue(final double value) {
-	return ! forEachPair( 
-		new IntDoubleProcedure() {
-			public boolean apply(int iterKey, double iterValue) {
-				return (value != iterValue);
-			}
-		}
-	);
+  return ! forEachPair( 
+    new IntDoubleProcedure() {
+      public boolean apply(int iterKey, double iterValue) {
+        return (value != iterValue);
+      }
+    }
+  );
 }
 /**
  * Returns a deep copy of the receiver; uses <code>clone()</code> and casts the result.
@@ -100,7 +100,7 @@
  * @return  a deep copy of the receiver.
  */
 public AbstractIntDoubleMap copy() {
-	return (AbstractIntDoubleMap) clone();
+  return (AbstractIntDoubleMap) clone();
 }
 /**
  * Compares the specified object with this map for equality.  Returns
@@ -109,20 +109,20 @@
  * <tt>m2</tt> represent the same mappings iff
  * <pre>
  * m1.forEachPair(
- *		new IntDoubleProcedure() {
- *			public boolean apply(int key, double value) {
- *				return m2.containsKey(key) && m2.get(key) == value;
- *			}
- *		}
- *	)
+ *    new IntDoubleProcedure() {
+ *      public boolean apply(int key, double value) {
+ *        return m2.containsKey(key) && m2.get(key) == value;
+ *      }
+ *    }
+ *  )
  * &&
  * m2.forEachPair(
- *		new IntDoubleProcedure() {
- *			public boolean apply(int key, double value) {
- *				return m1.containsKey(key) && m1.get(key) == value;
- *			}
- *		}
- *	);
+ *    new IntDoubleProcedure() {
+ *      public boolean apply(int key, double value) {
+ *        return m1.containsKey(key) && m1.get(key) == value;
+ *      }
+ *    }
+ *  );
  * </pre>
  *
  * This implementation first checks if the specified object is this map;
@@ -134,28 +134,28 @@
  * @return <tt>true</tt> if the specified object is equal to this map.
  */
 public boolean equals(Object obj) {
-	if (obj == this) return true;
+  if (obj == this) return true;
 
-	if (!(obj instanceof AbstractIntDoubleMap)) return false;
-	final AbstractIntDoubleMap other = (AbstractIntDoubleMap) obj;
-	if (other.size() != size()) return false;
+  if (!(obj instanceof AbstractIntDoubleMap)) return false;
+  final AbstractIntDoubleMap other = (AbstractIntDoubleMap) obj;
+  if (other.size() != size()) return false;
 
-	return 
-		forEachPair(
-			new IntDoubleProcedure() {
-				public boolean apply(int key, double value) {
-					return other.containsKey(key) && other.get(key) == value;
-				}
-			}
-		)
-		&&
-		other.forEachPair(
-			new IntDoubleProcedure() {
-				public boolean apply(int key, double value) {
-					return containsKey(key) && get(key) == value;
-				}
-			}
-		);
+  return 
+    forEachPair(
+      new IntDoubleProcedure() {
+        public boolean apply(int key, double value) {
+          return other.containsKey(key) && other.get(key) == value;
+        }
+      }
+    )
+    &&
+    other.forEachPair(
+      new IntDoubleProcedure() {
+        public boolean apply(int key, double value) {
+          return containsKey(key) && get(key) == value;
+        }
+      }
+    );
 }
 /**
  * Applies a procedure to each key of the receiver, if any.
@@ -176,13 +176,13 @@
  * @return <tt>false</tt> if the procedure stopped before all keys where iterated over, <tt>true</tt> otherwise. 
  */
 public boolean forEachPair(final IntDoubleProcedure procedure) {
-	return forEachKey(
-		new IntProcedure() {
-			public boolean apply(int key) {
-				return procedure.apply(key,get(key));
-			}
-		}
-	);
+  return forEachKey(
+    new IntProcedure() {
+      public boolean apply(int key) {
+        return procedure.apply(key,get(key));
+      }
+    }
+  );
 }
 /**
  * Returns the value associated with the specified key.
@@ -199,21 +199,21 @@
  *
  * @param value the value to search for.
  * @return the first key for which holds <tt>get(key) == value</tt>; 
- *		   returns <tt>Integer.MIN_VALUE</tt> if no such key exists.
+ *       returns <tt>Integer.MIN_VALUE</tt> if no such key exists.
  */
 public int keyOf(final double value) {
-	final int[] foundKey = new int[1];
-	boolean notFound = forEachPair(
-		new IntDoubleProcedure() {
-			public boolean apply(int iterKey, double iterValue) {
-				boolean found = value == iterValue;
-				if (found) foundKey[0] = iterKey;
-				return !found;
-			}
-		}
-	);
-	if (notFound) return Integer.MIN_VALUE;
-	return foundKey[0];
+  final int[] foundKey = new int[1];
+  boolean notFound = forEachPair(
+    new IntDoubleProcedure() {
+      public boolean apply(int iterKey, double iterValue) {
+        boolean found = value == iterValue;
+        if (found) foundKey[0] = iterKey;
+        return !found;
+      }
+    }
+  );
+  if (notFound) return Integer.MIN_VALUE;
+  return foundKey[0];
 }
 /**
  * Returns a list filled with all keys contained in the receiver.
@@ -225,9 +225,9 @@
  * @return the keys.
  */
 public IntArrayList keys() {
-	IntArrayList list = new IntArrayList(size());
-	keys(list);
-	return list;
+  IntArrayList list = new IntArrayList(size());
+  keys(list);
+  return list;
 }
 /**
  * Fills all keys contained in the receiver into the specified list.
@@ -240,15 +240,15 @@
  * @param list the list to be filled, can have any size.
  */
 public void keys(final IntArrayList list) {
-	list.clear();
-	forEachKey(
-		new IntProcedure() {
-			public boolean apply(int key) {
-				list.add(key);
-				return true;
-			}
-		}
-	);
+  list.clear();
+  forEachKey(
+    new IntProcedure() {
+      public boolean apply(int key) {
+        list.add(key);
+        return true;
+      }
+    }
+  );
 }
 /**
  * Fills all keys <i>sorted ascending by their associated value</i> into the specified list.
@@ -264,7 +264,7 @@
  * @param keyList the list to be filled, can have any size.
  */
 public void keysSortedByValue(final IntArrayList keyList) {
-	pairsSortedByValue(keyList, new DoubleArrayList(size()));
+  pairsSortedByValue(keyList, new DoubleArrayList(size()));
 }
 /**
 Fills all pairs satisfying a given condition into the specified lists.
@@ -276,7 +276,7 @@
 <br>
 <pre>
 IntDoubleProcedure condition = new IntDoubleProcedure() { // match even keys only
-	public boolean apply(int key, double value) { return key%2==0; }
+  public boolean apply(int key, double value) { return key%2==0; }
 }
 keys = (8,7,6), values = (1,2,2) --> keyList = (6,8), valueList = (2,1)</tt>
 </pre>
@@ -286,20 +286,20 @@
 @param valueList the list to be filled with values, can have any size.
 */
 public void pairsMatching(final IntDoubleProcedure condition, final IntArrayList keyList, final DoubleArrayList valueList) {
-	keyList.clear();
-	valueList.clear();
-	
-	forEachPair(
-		new IntDoubleProcedure() {
-			public boolean apply(int key, double value) {
-				if (condition.apply(key,value)) {
-					keyList.add(key);
-					valueList.add(value);
-				}
-				return true;
-			}
-		}
-	);
+  keyList.clear();
+  valueList.clear();
+  
+  forEachPair(
+    new IntDoubleProcedure() {
+      public boolean apply(int key, double value) {
+        if (condition.apply(key,value)) {
+          keyList.add(key);
+          valueList.add(value);
+        }
+        return true;
+      }
+    }
+  );
 }
 /**
  * Fills all keys and values <i>sorted ascending by key</i> into the specified lists.
@@ -314,12 +314,12 @@
  * @param valueList the list to be filled with values, can have any size.
  */
 public void pairsSortedByKey(final IntArrayList keyList, final DoubleArrayList valueList) {
-	keys(keyList);
-	keyList.sort();
-	valueList.setSize(keyList.size());
-	for (int i=keyList.size(); --i >= 0; ) {
-		valueList.setQuick(i,get(keyList.getQuick(i)));
-	}
+  keys(keyList);
+  keyList.sort();
+  valueList.setSize(keyList.size());
+  for (int i=keyList.size(); --i >= 0; ) {
+    valueList.setQuick(i,get(keyList.getQuick(i)));
+  }
 }
 /**
  * Fills all keys and values <i>sorted ascending by value</i> into the specified lists.
@@ -336,26 +336,26 @@
  * @param valueList the list to be filled with values, can have any size.
  */
 public void pairsSortedByValue(final IntArrayList keyList, final DoubleArrayList valueList) {
-	keys(keyList);
-	values(valueList);
-	
-	final int[] k = keyList.elements();
-	final double[] v = valueList.elements();
-	org.apache.mahout.matrix.Swapper swapper = new org.apache.mahout.matrix.Swapper() {
-		public void swap(int a, int b) {
-			int t2;	double t1;
-			t1 = v[a]; v[a] = v[b]; v[b] = t1;
-			t2 = k[a]; k[a] = k[b];	k[b] = t2;
-		}
-	}; 
+  keys(keyList);
+  values(valueList);
+  
+  final int[] k = keyList.elements();
+  final double[] v = valueList.elements();
+  org.apache.mahout.matrix.Swapper swapper = new org.apache.mahout.matrix.Swapper() {
+    public void swap(int a, int b) {
+      int t2;  double t1;
+      t1 = v[a]; v[a] = v[b]; v[b] = t1;
+      t2 = k[a]; k[a] = k[b];  k[b] = t2;
+    }
+  }; 
 
-	org.apache.mahout.matrix.function.IntComparator comp = new org.apache.mahout.matrix.function.IntComparator() {
-		public int compare(int a, int b) {
-			return v[a]<v[b] ? -1 : v[a]>v[b] ? 1 : (k[a]<k[b] ? -1 : (k[a]==k[b] ? 0 : 1));
-		}
-	};
+  org.apache.mahout.matrix.function.IntComparator comp = new org.apache.mahout.matrix.function.IntComparator() {
+    public int compare(int a, int b) {
+      return v[a]<v[b] ? -1 : v[a]>v[b] ? 1 : (k[a]<k[b] ? -1 : (k[a]==k[b] ? 0 : 1));
+    }
+  };
 
-	org.apache.mahout.matrix.GenericSorting.quickSort(0,keyList.size(),comp,swapper);
+  org.apache.mahout.matrix.GenericSorting.quickSort(0,keyList.size(),comp,swapper);
 }
 /**
  * Associates the given key with the given value.
@@ -379,44 +379,44 @@
  * the String representation of each key-value pair, sorted ascending by key.
  */
 public String toString() {
-	IntArrayList theKeys = keys();
-	String tmp = theKeys.toString() + "\n";
-	theKeys.sort();
+  IntArrayList theKeys = keys();
+  String tmp = theKeys.toString() + "\n";
+  theKeys.sort();
 
-	StringBuffer buf = new StringBuffer(tmp);
-	//StringBuffer buf = new StringBuffer();
-	buf.append("[");
-	int maxIndex = theKeys.size() - 1;
-	for (int i = 0; i <= maxIndex; i++) {
-		int key = theKeys.get(i);
-	    buf.append(String.valueOf(key));
-		buf.append("->");
-	    buf.append(String.valueOf(get(key)));
-		if (i < maxIndex) buf.append(", ");
-	}
-	buf.append("]");
-	return buf.toString();
+  StringBuffer buf = new StringBuffer(tmp);
+  //StringBuffer buf = new StringBuffer();
+  buf.append("[");
+  int maxIndex = theKeys.size() - 1;
+  for (int i = 0; i <= maxIndex; i++) {
+    int key = theKeys.get(i);
+      buf.append(String.valueOf(key));
+    buf.append("->");
+      buf.append(String.valueOf(get(key)));
+    if (i < maxIndex) buf.append(", ");
+  }
+  buf.append("]");
+  return buf.toString();
 }
 /**
  * Returns a string representation of the receiver, containing
  * the String representation of each key-value pair, sorted ascending by value.
  */
 public String toStringByValue() {
-	IntArrayList theKeys = new IntArrayList();
-	keysSortedByValue(theKeys);
+  IntArrayList theKeys = new IntArrayList();
+  keysSortedByValue(theKeys);
 
-	StringBuffer buf = new StringBuffer();
-	buf.append("[");
-	int maxIndex = theKeys.size() - 1;
-	for (int i = 0; i <= maxIndex; i++) {
-		int key = theKeys.get(i);
-	    buf.append(String.valueOf(key));
-		buf.append("->");
-	    buf.append(String.valueOf(get(key)));
-		if (i < maxIndex) buf.append(", ");
-	}
-	buf.append("]");
-	return buf.toString();
+  StringBuffer buf = new StringBuffer();
+  buf.append("[");
+  int maxIndex = theKeys.size() - 1;
+  for (int i = 0; i <= maxIndex; i++) {
+    int key = theKeys.get(i);
+      buf.append(String.valueOf(key));
+    buf.append("->");
+      buf.append(String.valueOf(get(key)));
+    if (i < maxIndex) buf.append(", ");
+  }
+  buf.append("]");
+  return buf.toString();
 }
 /**
  * Returns a list filled with all values contained in the receiver.
@@ -428,9 +428,9 @@
  * @return the values.
  */
 public DoubleArrayList values() {
-	DoubleArrayList list = new DoubleArrayList(size());
-	values(list);
-	return list;
+  DoubleArrayList list = new DoubleArrayList(size());
+  values(list);
+  return list;
 }
 /**
  * Fills all values contained in the receiver into the specified list.
@@ -443,14 +443,14 @@
  * @param list the list to be filled, can have any size.
  */
 public void values(final DoubleArrayList list) {
-	list.clear();
-	forEachKey(
-		new IntProcedure() {
-			public boolean apply(int key) {
-				list.add(get(key));
-				return true;
-			}
-		}
-	);
+  list.clear();
+  forEachKey(
+    new IntProcedure() {
+      public boolean apply(int key) {
+        list.add(get(key));
+        return true;
+      }
+    }
+  );
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/map/AbstractLongObjectMap.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/map/AbstractLongObjectMap.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/map/AbstractLongObjectMap.java	(working copy)
@@ -23,14 +23,14 @@
 
 @author wolfgang.hoschek@cern.ch
 @version 1.0, 09/24/99
-@see	    java.util.HashMap
+@see      java.util.HashMap
 */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
  */
 @Deprecated
 public abstract class AbstractLongObjectMap extends AbstractMap {
-	//public static int hashCollisions = 0; // for debug only
+  //public static int hashCollisions = 0; // for debug only
 /**
  * Makes this class non instantiable, but still let's others inherit from it.
  */
@@ -41,13 +41,13 @@
  * @return <tt>true</tt> if the receiver contains the specified key.
  */
 public boolean containsKey(final long key) {
-	return ! forEachKey(
-		new LongProcedure() {
-			public boolean apply(long iterKey) {
-				return (key != iterKey);
-			}
-		}
-	);
+  return ! forEachKey(
+    new LongProcedure() {
+      public boolean apply(long iterKey) {
+        return (key != iterKey);
+      }
+    }
+  );
 }
 /**
  * Returns <tt>true</tt> if the receiver contains the specified value.
@@ -56,13 +56,13 @@
  * @return <tt>true</tt> if the receiver contains the specified value.
  */
 public boolean containsValue(final Object value) {
-	return ! forEachPair( 
-		new LongObjectProcedure() {
-			public boolean apply(long iterKey, Object iterValue) {
-				return (value != iterValue);
-			}
-		}
-	);
+  return ! forEachPair( 
+    new LongObjectProcedure() {
+      public boolean apply(long iterKey, Object iterValue) {
+        return (value != iterValue);
+      }
+    }
+  );
 }
 /**
  * Returns a deep copy of the receiver; uses <code>clone()</code> and casts the result.
@@ -70,7 +70,7 @@
  * @return  a deep copy of the receiver.
  */
 public AbstractLongObjectMap copy() {
-	return (AbstractLongObjectMap) clone();
+  return (AbstractLongObjectMap) clone();
 }
 /**
  * Compares the specified object with this map for equality.  Returns
@@ -79,20 +79,20 @@
  * <tt>m2</tt> represent the same mappings iff
  * <pre>
  * m1.forEachPair(
- *		new LongObjectProcedure() {
- *			public boolean apply(long key, Object value) {
- *				return m2.containsKey(key) && m2.get(key) == value;
- *			}
- *		}
- *	)
+ *    new LongObjectProcedure() {
+ *      public boolean apply(long key, Object value) {
+ *        return m2.containsKey(key) && m2.get(key) == value;
+ *      }
+ *    }
+ *  )
  * &&
  * m2.forEachPair(
- *		new LongObjectProcedure() {
- *			public boolean apply(long key, Object value) {
- *				return m1.containsKey(key) && m1.get(key) == value;
- *			}
- *		}
- *	);
+ *    new LongObjectProcedure() {
+ *      public boolean apply(long key, Object value) {
+ *        return m1.containsKey(key) && m1.get(key) == value;
+ *      }
+ *    }
+ *  );
  * </pre>
  *
  * This implementation first checks if the specified object is this map;
@@ -104,28 +104,28 @@
  * @return <tt>true</tt> if the specified object is equal to this map.
  */
 public boolean equals(Object obj) {
-	if (obj == this) return true;
+  if (obj == this) return true;
 
-	if (!(obj instanceof AbstractLongObjectMap)) return false;
-	final AbstractLongObjectMap other = (AbstractLongObjectMap) obj;
-	if (other.size() != size()) return false;
+  if (!(obj instanceof AbstractLongObjectMap)) return false;
+  final AbstractLongObjectMap other = (AbstractLongObjectMap) obj;
+  if (other.size() != size()) return false;
 
-	return 
-		forEachPair(
-			new LongObjectProcedure() {
-				public boolean apply(long key, Object value) {
-					return other.containsKey(key) && other.get(key) == value;
-				}
-			}
-		)
-		&&
-		other.forEachPair(
-			new LongObjectProcedure() {
-				public boolean apply(long key, Object value) {
-					return containsKey(key) && get(key) == value;
-				}
-			}
-		);
+  return 
+    forEachPair(
+      new LongObjectProcedure() {
+        public boolean apply(long key, Object value) {
+          return other.containsKey(key) && other.get(key) == value;
+        }
+      }
+    )
+    &&
+    other.forEachPair(
+      new LongObjectProcedure() {
+        public boolean apply(long key, Object value) {
+          return containsKey(key) && get(key) == value;
+        }
+      }
+    );
 }
 /**
  * Applies a procedure to each key of the receiver, if any.
@@ -146,13 +146,13 @@
  * @return <tt>false</tt> if the procedure stopped before all keys where iterated over, <tt>true</tt> otherwise. 
  */
 public boolean forEachPair(final LongObjectProcedure procedure) {
-	return forEachKey(
-		new LongProcedure() {
-			public boolean apply(long key) {
-				return procedure.apply(key,get(key));
-			}
-		}
-	);
+  return forEachKey(
+    new LongProcedure() {
+      public boolean apply(long key) {
+        return procedure.apply(key,get(key));
+      }
+    }
+  );
 }
 /**
  * Returns the value associated with the specified key.
@@ -169,21 +169,21 @@
  *
  * @param value the value to search for.
  * @return the first key for which holds <tt>get(key) == value</tt>; 
- *		   returns <tt>Long.MIN_VALUE</tt> if no such key exists.
+ *       returns <tt>Long.MIN_VALUE</tt> if no such key exists.
  */
 public long keyOf(final Object value) {
-	final long[] foundKey = new long[1];
-	boolean notFound = forEachPair(
-		new LongObjectProcedure() {
-			public boolean apply(long iterKey, Object iterValue) {
-				boolean found = value == iterValue;
-				if (found) foundKey[0] = iterKey;
-				return !found;
-			}
-		}
-	);
-	if (notFound) return Long.MIN_VALUE;
-	return foundKey[0];
+  final long[] foundKey = new long[1];
+  boolean notFound = forEachPair(
+    new LongObjectProcedure() {
+      public boolean apply(long iterKey, Object iterValue) {
+        boolean found = value == iterValue;
+        if (found) foundKey[0] = iterKey;
+        return !found;
+      }
+    }
+  );
+  if (notFound) return Long.MIN_VALUE;
+  return foundKey[0];
 }
 /**
  * Returns a list filled with all keys contained in the receiver.
@@ -195,9 +195,9 @@
  * @return the keys.
  */
 public LongArrayList keys() {
-	LongArrayList list = new LongArrayList(size());
-	keys(list);
-	return list;
+  LongArrayList list = new LongArrayList(size());
+  keys(list);
+  return list;
 }
 /**
  * Fills all keys contained in the receiver into the specified list.
@@ -210,15 +210,15 @@
  * @param list the list to be filled, can have any size.
  */
 public void keys(final LongArrayList list) {
-	list.clear();
-	forEachKey(
-		new LongProcedure() {
-			public boolean apply(long key) {
-				list.add(key);
-				return true;
-			}
-		}
-	);
+  list.clear();
+  forEachKey(
+    new LongProcedure() {
+      public boolean apply(long key) {
+        list.add(key);
+        return true;
+      }
+    }
+  );
 }
 /**
  * Fills all keys <i>sorted ascending by their associated value</i> into the specified list.
@@ -234,7 +234,7 @@
  * @param keyList the list to be filled, can have any size.
  */
 public void keysSortedByValue(final LongArrayList keyList) {
-	pairsSortedByValue(keyList, new ObjectArrayList(size()));
+  pairsSortedByValue(keyList, new ObjectArrayList(size()));
 }
 /**
 Fills all pairs satisfying a given condition into the specified lists.
@@ -246,7 +246,7 @@
 <br>
 <pre>
 LongObjectProcedure condition = new LongObjectProcedure() { // match even keys only
-	public boolean apply(long key, Object value) { return key%2==0; }
+  public boolean apply(long key, Object value) { return key%2==0; }
 }
 keys = (8,7,6), values = (1,2,2) --> keyList = (6,8), valueList = (2,1)</tt>
 </pre>
@@ -256,20 +256,20 @@
 @param valueList the list to be filled with values, can have any size.
 */
 public void pairsMatching(final LongObjectProcedure condition, final LongArrayList keyList, final ObjectArrayList valueList) {
-	keyList.clear();
-	valueList.clear();
-	
-	forEachPair(
-		new LongObjectProcedure() {
-			public boolean apply(long key, Object value) {
-				if (condition.apply(key,value)) {
-					keyList.add(key);
-					valueList.add(value);
-				}
-				return true;
-			}
-		}
-	);
+  keyList.clear();
+  valueList.clear();
+  
+  forEachPair(
+    new LongObjectProcedure() {
+      public boolean apply(long key, Object value) {
+        if (condition.apply(key,value)) {
+          keyList.add(key);
+          valueList.add(value);
+        }
+        return true;
+      }
+    }
+  );
 }
 /**
  * Fills all keys and values <i>sorted ascending by key</i> into the specified lists.
@@ -284,12 +284,12 @@
  * @param valueList the list to be filled with values, can have any size.
  */
 public void pairsSortedByKey(final LongArrayList keyList, final ObjectArrayList valueList) {
-	keys(keyList);
-	keyList.sort();
-	valueList.setSize(keyList.size());
-	for (int i=keyList.size(); --i >= 0; ) {
-		valueList.setQuick(i,get(keyList.getQuick(i)));
-	}
+  keys(keyList);
+  keyList.sort();
+  valueList.setSize(keyList.size());
+  for (int i=keyList.size(); --i >= 0; ) {
+    valueList.setQuick(i,get(keyList.getQuick(i)));
+  }
 }
 /**
  * Fills all keys and values <i>sorted ascending by value according to natural ordering</i> into the specified lists.
@@ -306,28 +306,28 @@
  * @param valueList the list to be filled with values, can have any size.
  */
 public void pairsSortedByValue(final LongArrayList keyList, final ObjectArrayList valueList) {
-	keys(keyList);
-	values(valueList);
-	
-	final long[] k = keyList.elements();
-	final Object[] v = valueList.elements();
-	org.apache.mahout.matrix.Swapper swapper = new org.apache.mahout.matrix.Swapper() {
-		public void swap(int a, int b) {
-			long t2;	Object t1;
-			t1 = v[a]; v[a] = v[b]; v[b] = t1;
-			t2 = k[a]; k[a] = k[b];	k[b] = t2;
-		}
-	}; 
+  keys(keyList);
+  values(valueList);
+  
+  final long[] k = keyList.elements();
+  final Object[] v = valueList.elements();
+  org.apache.mahout.matrix.Swapper swapper = new org.apache.mahout.matrix.Swapper() {
+    public void swap(int a, int b) {
+      long t2;  Object t1;
+      t1 = v[a]; v[a] = v[b]; v[b] = t1;
+      t2 = k[a]; k[a] = k[b];  k[b] = t2;
+    }
+  }; 
 
-	org.apache.mahout.matrix.function.IntComparator comp = new org.apache.mahout.matrix.function.IntComparator() {
-		public int compare(int a, int b) {
-			int ab = ((Comparable)v[a]).compareTo((Comparable)v[b]);
-			return ab<0 ? -1 : ab>0 ? 1 : (k[a]<k[b] ? -1 : (k[a]==k[b] ? 0 : 1));
-			//return v[a]<v[b] ? -1 : v[a]>v[b] ? 1 : (k[a]<k[b] ? -1 : (k[a]==k[b] ? 0 : 1));
-		}
-	};
+  org.apache.mahout.matrix.function.IntComparator comp = new org.apache.mahout.matrix.function.IntComparator() {
+    public int compare(int a, int b) {
+      int ab = ((Comparable)v[a]).compareTo((Comparable)v[b]);
+      return ab<0 ? -1 : ab>0 ? 1 : (k[a]<k[b] ? -1 : (k[a]==k[b] ? 0 : 1));
+      //return v[a]<v[b] ? -1 : v[a]>v[b] ? 1 : (k[a]<k[b] ? -1 : (k[a]==k[b] ? 0 : 1));
+    }
+  };
 
-	org.apache.mahout.matrix.GenericSorting.quickSort(0,keyList.size(),comp,swapper);
+  org.apache.mahout.matrix.GenericSorting.quickSort(0,keyList.size(),comp,swapper);
 }
 /**
  * Associates the given key with the given value.
@@ -351,42 +351,42 @@
  * the String representation of each key-value pair, sorted ascending by key.
  */
 public String toString() {
-	LongArrayList theKeys = keys();
-	theKeys.sort();
+  LongArrayList theKeys = keys();
+  theKeys.sort();
 
-	StringBuffer buf = new StringBuffer();
-	buf.append("[");
-	int maxIndex = theKeys.size() - 1;
-	for (int i = 0; i <= maxIndex; i++) {
-		long key = theKeys.get(i);
-	    buf.append(String.valueOf(key));
-		buf.append("->");
-	    buf.append(String.valueOf(get(key)));
-		if (i < maxIndex) buf.append(", ");
-	}
-	buf.append("]");
-	return buf.toString();
+  StringBuffer buf = new StringBuffer();
+  buf.append("[");
+  int maxIndex = theKeys.size() - 1;
+  for (int i = 0; i <= maxIndex; i++) {
+    long key = theKeys.get(i);
+      buf.append(String.valueOf(key));
+    buf.append("->");
+      buf.append(String.valueOf(get(key)));
+    if (i < maxIndex) buf.append(", ");
+  }
+  buf.append("]");
+  return buf.toString();
 }
 /**
  * Returns a string representation of the receiver, containing
  * the String representation of each key-value pair, sorted ascending by value, according to natural ordering.
  */
 public String toStringByValue() {
-	LongArrayList theKeys = new LongArrayList();
-	keysSortedByValue(theKeys);
+  LongArrayList theKeys = new LongArrayList();
+  keysSortedByValue(theKeys);
 
-	StringBuffer buf = new StringBuffer();
-	buf.append("[");
-	int maxIndex = theKeys.size() - 1;
-	for (int i = 0; i <= maxIndex; i++) {
-		long key = theKeys.get(i);
-	    buf.append(String.valueOf(key));
-		buf.append("->");
-	    buf.append(String.valueOf(get(key)));
-		if (i < maxIndex) buf.append(", ");
-	}
-	buf.append("]");
-	return buf.toString();
+  StringBuffer buf = new StringBuffer();
+  buf.append("[");
+  int maxIndex = theKeys.size() - 1;
+  for (int i = 0; i <= maxIndex; i++) {
+    long key = theKeys.get(i);
+      buf.append(String.valueOf(key));
+    buf.append("->");
+      buf.append(String.valueOf(get(key)));
+    if (i < maxIndex) buf.append(", ");
+  }
+  buf.append("]");
+  return buf.toString();
 }
 /**
  * Returns a list filled with all values contained in the receiver.
@@ -398,9 +398,9 @@
  * @return the values.
  */
 public ObjectArrayList values() {
-	ObjectArrayList list = new ObjectArrayList(size());
-	values(list);
-	return list;
+  ObjectArrayList list = new ObjectArrayList(size());
+  values(list);
+  return list;
 }
 /**
  * Fills all values contained in the receiver into the specified list.
@@ -413,14 +413,14 @@
  * @param list the list to be filled, can have any size.
  */
 public void values(final ObjectArrayList list) {
-	list.clear();
-	forEachKey(
-		new LongProcedure() {
-			public boolean apply(long key) {
-				list.add(get(key));
-				return true;
-			}
-		}
-	);
+  list.clear();
+  forEachKey(
+    new LongProcedure() {
+      public boolean apply(long key) {
+        list.add(get(key));
+        return true;
+      }
+    }
+  );
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/map/OpenDoubleIntHashMap.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/map/OpenDoubleIntHashMap.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/map/OpenDoubleIntHashMap.java	(working copy)
@@ -21,47 +21,47 @@
 
 @author wolfgang.hoschek@cern.ch
 @version 1.0, 09/24/99
-@see	    java.util.HashMap
+@see      java.util.HashMap
 */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
  */
 @Deprecated
 public class OpenDoubleIntHashMap extends AbstractDoubleIntMap {
-	 /**
-	 * The hash table keys.
-	 * @serial
-	 */
-	protected double table[];
+   /**
+   * The hash table keys.
+   * @serial
+   */
+  protected double table[];
 
-	 /**
-	 * The hash table values.
-	 * @serial
-	 */
-	protected int values[];
+   /**
+   * The hash table values.
+   * @serial
+   */
+  protected int values[];
 
-	/**
-	 * The state of each hash table entry (FREE, FULL, REMOVED).
-	 * @serial
-	 */
-	protected byte state[];
+  /**
+   * The state of each hash table entry (FREE, FULL, REMOVED).
+   * @serial
+   */
+  protected byte state[];
 
-	/**
-	 * The number of table entries in state==FREE.
-	 * @serial
-	 */
-	protected int freeEntries;
+  /**
+   * The number of table entries in state==FREE.
+   * @serial
+   */
+  protected int freeEntries;
 
-	
-	protected static final byte FREE = 0;
-	protected static final byte FULL = 1;
-	protected static final byte REMOVED = 2;
+  
+  protected static final byte FREE = 0;
+  protected static final byte FULL = 1;
+  protected static final byte REMOVED = 2;
 
 /**
  * Constructs an empty map with default capacity and default load factors.
  */
 public OpenDoubleIntHashMap() {
-	this(defaultCapacity);
+  this(defaultCapacity);
 }
 /**
  * Constructs an empty map with the specified initial capacity and default load factors.
@@ -71,7 +71,7 @@
  *             than zero.
  */
 public OpenDoubleIntHashMap(int initialCapacity) {
-	this(initialCapacity, defaultMinLoadFactor, defaultMaxLoadFactor);
+  this(initialCapacity, defaultMinLoadFactor, defaultMaxLoadFactor);
 }
 /**
  * Constructs an empty map with
@@ -80,22 +80,22 @@
  * @param      initialCapacity   the initial capacity.
  * @param      minLoadFactor        the minimum load factor.
  * @param      maxLoadFactor        the maximum load factor.
- * @throws	IllegalArgumentException if <tt>initialCapacity < 0 || (minLoadFactor < 0.0 || minLoadFactor >= 1.0) || (maxLoadFactor <= 0.0 || maxLoadFactor >= 1.0) || (minLoadFactor >= maxLoadFactor)</tt>.
+ * @throws  IllegalArgumentException if <tt>initialCapacity < 0 || (minLoadFactor < 0.0 || minLoadFactor >= 1.0) || (maxLoadFactor <= 0.0 || maxLoadFactor >= 1.0) || (minLoadFactor >= maxLoadFactor)</tt>.
  */
 public OpenDoubleIntHashMap(int initialCapacity, double minLoadFactor, double maxLoadFactor) {
-	setUp(initialCapacity,minLoadFactor,maxLoadFactor);
+  setUp(initialCapacity,minLoadFactor,maxLoadFactor);
 }
 /**
  * Removes all (key,value) associations from the receiver.
  * Implicitly calls <tt>trimToSize()</tt>.
  */
 public void clear() {
-	new ByteArrayList(this.state).fillFromToWith(0, this.state.length-1, FREE);
-   	//new DoubleArrayList(values).fillFromToWith(0, state.length-1, 0); // delta
+  new ByteArrayList(this.state).fillFromToWith(0, this.state.length-1, FREE);
+     //new DoubleArrayList(values).fillFromToWith(0, state.length-1, 0); // delta
 
-	this.distinct = 0;
-	this.freeEntries = table.length; // delta
-	trimToSize();
+  this.distinct = 0;
+  this.freeEntries = table.length; // delta
+  trimToSize();
 }
 /**
  * Returns a deep copy of the receiver.
@@ -103,11 +103,11 @@
  * @return  a deep copy of the receiver.
  */
 public Object clone() {
-	OpenDoubleIntHashMap copy = (OpenDoubleIntHashMap) super.clone();
-	copy.table = (double[]) copy.table.clone();
-	copy.values = (int[]) copy.values.clone();
-	copy.state = (byte[]) copy.state.clone();
-	return copy;
+  OpenDoubleIntHashMap copy = (OpenDoubleIntHashMap) super.clone();
+  copy.table = (double[]) copy.table.clone();
+  copy.values = (int[]) copy.values.clone();
+  copy.state = (byte[]) copy.state.clone();
+  return copy;
 }
 /**
  * Returns <tt>true</tt> if the receiver contains the specified key.
@@ -115,7 +115,7 @@
  * @return <tt>true</tt> if the receiver contains the specified key.
  */
 public boolean containsKey(double key) {
-	return indexOfKey(key) >= 0;
+  return indexOfKey(key) >= 0;
 }
 /**
  * Returns <tt>true</tt> if the receiver contains the specified value.
@@ -123,7 +123,7 @@
  * @return <tt>true</tt> if the receiver contains the specified value.
  */
 public boolean containsValue(int value) {
-	return indexOfValue(value) >= 0;
+  return indexOfValue(value) >= 0;
 }
 /**
  * Ensures that the receiver can hold at least the specified number of associations without needing to allocate new internal memory.
@@ -136,10 +136,10 @@
  * @param   minCapacity   the desired minimum capacity.
  */
 public void ensureCapacity(int minCapacity) {
-	if (table.length < minCapacity) {
-		int newCapacity = nextPrime(minCapacity);
-		rehash(newCapacity);
-	}
+  if (table.length < minCapacity) {
+    int newCapacity = nextPrime(minCapacity);
+    rehash(newCapacity);
+  }
 }
 /**
  * Applies a procedure to each key of the receiver, if any.
@@ -152,10 +152,10 @@
  * @return <tt>false</tt> if the procedure stopped before all keys where iterated over, <tt>true</tt> otherwise. 
  */
 public boolean forEachKey(DoubleProcedure procedure) {
-	for (int i = table.length ; i-- > 0 ;) {
-		if (state[i]==FULL) if (! procedure.apply(table[i])) return false;
-	}
-	return true;
+  for (int i = table.length ; i-- > 0 ;) {
+    if (state[i]==FULL) if (! procedure.apply(table[i])) return false;
+  }
+  return true;
 }
 /**
  * Applies a procedure to each (key,value) pair of the receiver, if any.
@@ -165,10 +165,10 @@
  * @return <tt>false</tt> if the procedure stopped before all keys where iterated over, <tt>true</tt> otherwise. 
  */
 public boolean forEachPair(final DoubleIntProcedure procedure) {
-	for (int i = table.length ; i-- > 0 ;) {
-		if (state[i]==FULL) if (! procedure.apply(table[i],values[i])) return false;
-	}
-	return true;
+  for (int i = table.length ; i-- > 0 ;) {
+    if (state[i]==FULL) if (! procedure.apply(table[i],values[i])) return false;
+  }
+  return true;
 }
 /**
  * Returns the value associated with the specified key.
@@ -178,9 +178,9 @@
  * @return the value associated with the specified key; <tt>0</tt> if no such key is present.
  */
 public int get(double key) {
-	int i = indexOfKey(key);
-	if (i<0) return 0; //not contained
-	return values[i];
+  int i = indexOfKey(key);
+  if (i<0) return 0; //not contained
+  return values[i];
 }
 /**
  * @param key the key to be added to the receiver.
@@ -190,86 +190,86 @@
  * If the returned index >= 0, then it is NOT already contained and should be inserted at slot index.
  */
 protected int indexOfInsertion(double key) {
-	final double tab[] = table;
-	final byte stat[] = state;
-	final int length = tab.length;
+  final double tab[] = table;
+  final byte stat[] = state;
+  final int length = tab.length;
 
-	final int hash = HashFunctions.hash(key) & 0x7FFFFFFF;
-	int i = hash % length;
-	int decrement = hash % (length-2); // double hashing, see http://www.eece.unm.edu/faculty/heileman/hash/node4.html
-	//int decrement = (hash / length) % length;
-	if (decrement == 0) decrement = 1;
+  final int hash = HashFunctions.hash(key) & 0x7FFFFFFF;
+  int i = hash % length;
+  int decrement = hash % (length-2); // double hashing, see http://www.eece.unm.edu/faculty/heileman/hash/node4.html
+  //int decrement = (hash / length) % length;
+  if (decrement == 0) decrement = 1;
 
-	// stop if we find a removed or free slot, or if we find the key itself
-	// do NOT skip over removed slots (yes, open addressing is like that...)
-	while (stat[i] == FULL && tab[i] != key) {
-		i -= decrement;
-		//hashCollisions++;
-		if (i<0) i+=length;
-	}
-	
-	if (stat[i] == REMOVED) {
-		// stop if we find a free slot, or if we find the key itself.
-		// do skip over removed slots (yes, open addressing is like that...)
-		// assertion: there is at least one FREE slot.
-		int j = i;
-		while (stat[i] != FREE && (stat[i] == REMOVED || tab[i] != key)) {
-			i -= decrement;
-			//hashCollisions++;
-			if (i<0) i+=length;
-		}
-		if (stat[i] == FREE) i = j;
-	}
-	
-	
-	if (stat[i] == FULL) {
-		// key already contained at slot i.
-		// return a negative number identifying the slot.
-		return -i-1;
-	}
-	// not already contained, should be inserted at slot i.
-	// return a number >= 0 identifying the slot.
-	return i; 
+  // stop if we find a removed or free slot, or if we find the key itself
+  // do NOT skip over removed slots (yes, open addressing is like that...)
+  while (stat[i] == FULL && tab[i] != key) {
+    i -= decrement;
+    //hashCollisions++;
+    if (i<0) i+=length;
+  }
+  
+  if (stat[i] == REMOVED) {
+    // stop if we find a free slot, or if we find the key itself.
+    // do skip over removed slots (yes, open addressing is like that...)
+    // assertion: there is at least one FREE slot.
+    int j = i;
+    while (stat[i] != FREE && (stat[i] == REMOVED || tab[i] != key)) {
+      i -= decrement;
+      //hashCollisions++;
+      if (i<0) i+=length;
+    }
+    if (stat[i] == FREE) i = j;
+  }
+  
+  
+  if (stat[i] == FULL) {
+    // key already contained at slot i.
+    // return a negative number identifying the slot.
+    return -i-1;
+  }
+  // not already contained, should be inserted at slot i.
+  // return a number >= 0 identifying the slot.
+  return i; 
 }
 /**
  * @param key the key to be searched in the receiver.
  * @return the index where the key is contained in the receiver, returns -1 if the key was not found.
  */
 protected int indexOfKey(double key) {
-	final double tab[] = table;
-	final byte stat[] = state;
-	final int length = tab.length;
+  final double tab[] = table;
+  final byte stat[] = state;
+  final int length = tab.length;
 
-	final int hash = HashFunctions.hash(key) & 0x7FFFFFFF;
-	int i = hash % length;
-	int decrement = hash % (length-2); // double hashing, see http://www.eece.unm.edu/faculty/heileman/hash/node4.html
-	//int decrement = (hash / length) % length;
-	if (decrement == 0) decrement = 1;
+  final int hash = HashFunctions.hash(key) & 0x7FFFFFFF;
+  int i = hash % length;
+  int decrement = hash % (length-2); // double hashing, see http://www.eece.unm.edu/faculty/heileman/hash/node4.html
+  //int decrement = (hash / length) % length;
+  if (decrement == 0) decrement = 1;
 
-	// stop if we find a free slot, or if we find the key itself.
-	// do skip over removed slots (yes, open addressing is like that...)
-	while (stat[i] != FREE && (stat[i] == REMOVED || tab[i] != key)) {
-		i -= decrement;
-		//hashCollisions++;
-		if (i<0) i+=length;
-	}
-	
-	if (stat[i] == FREE) return -1; // not found
-	return i; //found, return index where key is contained
+  // stop if we find a free slot, or if we find the key itself.
+  // do skip over removed slots (yes, open addressing is like that...)
+  while (stat[i] != FREE && (stat[i] == REMOVED || tab[i] != key)) {
+    i -= decrement;
+    //hashCollisions++;
+    if (i<0) i+=length;
+  }
+  
+  if (stat[i] == FREE) return -1; // not found
+  return i; //found, return index where key is contained
 }
 /**
  * @param value the value to be searched in the receiver.
  * @return the index where the value is contained in the receiver, returns -1 if the value was not found.
  */
 protected int indexOfValue(int value) {
-	final int val[] = values;
-	final byte stat[] = state;
+  final int val[] = values;
+  final byte stat[] = state;
 
-	for (int i=stat.length; --i >= 0;) {
-		if (stat[i]==FULL && val[i]==value) return i;
-	}
+  for (int i=stat.length; --i >= 0;) {
+    if (stat[i]==FULL && val[i]==value) return i;
+  }
 
-	return -1; // not found
+  return -1; // not found
 }
 /**
  * Returns the first key the given value is associated with.
@@ -278,13 +278,13 @@
  *
  * @param value the value to search for.
  * @return the first key for which holds <tt>get(key) == value</tt>; 
- *		   returns <tt>Double.NaN</tt> if no such key exists.
+ *       returns <tt>Double.NaN</tt> if no such key exists.
  */
 public double keyOf(int value) {
-	//returns the first key found; there may be more matching keys, however.
-	int i = indexOfValue(value);
-	if (i<0) return Double.NaN;
-	return table[i];
+  //returns the first key found; there may be more matching keys, however.
+  int i = indexOfValue(value);
+  if (i<0) return Double.NaN;
+  return table[i];
 }
 /**
  * Fills all keys contained in the receiver into the specified list.
@@ -297,16 +297,16 @@
  * @param list the list to be filled, can have any size.
  */
 public void keys(DoubleArrayList list) {
-	list.setSize(distinct);
-	double[] elements = list.elements();
-	
-	double[] tab = table;
-	byte[] stat = state;
-	
-	int j=0;
-	for (int i = tab.length ; i-- > 0 ;) {
-		if (stat[i]==FULL) elements[j++]=tab[i];
-	}
+  list.setSize(distinct);
+  double[] elements = list.elements();
+  
+  double[] tab = table;
+  byte[] stat = state;
+  
+  int j=0;
+  for (int i = tab.length ; i-- > 0 ;) {
+    if (stat[i]==FULL) elements[j++]=tab[i];
+  }
 }
 /**
 Fills all pairs satisfying a given condition into the specified lists.
@@ -318,7 +318,7 @@
 <br>
 <pre>
 DoubleIntProcedure condition = new DoubleIntProcedure() { // match even values only
-	public boolean apply(double key, int value) { return value%2==0; }
+  public boolean apply(double key, int value) { return value%2==0; }
 }
 keys = (8,7,6), values = (1,2,2) --> keyList = (6,8), valueList = (2,1)</tt>
 </pre>
@@ -328,15 +328,15 @@
 @param valueList the list to be filled with values, can have any size.
 */
 public void pairsMatching(final DoubleIntProcedure condition, final DoubleArrayList keyList, final IntArrayList valueList) {
-	keyList.clear();
-	valueList.clear();
-	
-	for (int i = table.length ; i-- > 0 ;) {
-		if (state[i]==FULL && condition.apply(table[i],values[i])) {
-			keyList.add(table[i]);
-			valueList.add(values[i]);
-		}
-	}
+  keyList.clear();
+  valueList.clear();
+  
+  for (int i = table.length ; i-- > 0 ;) {
+    if (state[i]==FULL && condition.apply(table[i],values[i])) {
+      keyList.add(table[i]);
+      valueList.add(values[i]);
+    }
+  }
 }
 /**
  * Associates the given key with the given value.
@@ -348,35 +348,35 @@
  *         <tt>false</tt> if the receiver did already contain such a key - the new value has now replaced the formerly associated value.
  */
 public boolean put(double key, int value) {
-	int i = indexOfInsertion(key);	
-	if (i<0) { //already contained
-		i = -i -1;
-		this.values[i]=value;
-		return false;
-	}
+  int i = indexOfInsertion(key);  
+  if (i<0) { //already contained
+    i = -i -1;
+    this.values[i]=value;
+    return false;
+  }
 
-	if (this.distinct > this.highWaterMark) {
-		int newCapacity = chooseGrowCapacity(this.distinct+1,this.minLoadFactor, this.maxLoadFactor);
-		/*
-		System.out.print("grow rehashing ");
-		System.out.println("at distinct="+distinct+", capacity="+table.length+" to newCapacity="+newCapacity+" ...");
-		*/
-		rehash(newCapacity);
-		return put(key, value);
-	}
+  if (this.distinct > this.highWaterMark) {
+    int newCapacity = chooseGrowCapacity(this.distinct+1,this.minLoadFactor, this.maxLoadFactor);
+    /*
+    System.out.print("grow rehashing ");
+    System.out.println("at distinct="+distinct+", capacity="+table.length+" to newCapacity="+newCapacity+" ...");
+    */
+    rehash(newCapacity);
+    return put(key, value);
+  }
 
-	this.table[i]=key;
-	this.values[i]=value;
-	if (this.state[i]==FREE) this.freeEntries--;
-	this.state[i]=FULL;
-	this.distinct++;
+  this.table[i]=key;
+  this.values[i]=value;
+  if (this.state[i]==FREE) this.freeEntries--;
+  this.state[i]=FULL;
+  this.distinct++;
 
-	if (this.freeEntries < 1) { //delta
-		int newCapacity = chooseGrowCapacity(this.distinct+1,this.minLoadFactor, this.maxLoadFactor);
-		rehash(newCapacity);
-	}
+  if (this.freeEntries < 1) { //delta
+    int newCapacity = chooseGrowCapacity(this.distinct+1,this.minLoadFactor, this.maxLoadFactor);
+    rehash(newCapacity);
+  }
 
-	return true;
+  return true;
 }
 /**
  * Rehashes the contents of the receiver into a new table
@@ -385,34 +385,34 @@
  * number of keys in the receiver exceeds the high water mark or falls below the low water mark.
  */
 protected void rehash(int newCapacity) {
-	int oldCapacity = table.length;
-	//if (oldCapacity == newCapacity) return;
-	
-	double oldTable[] = table;
-	int oldValues[] = values;
-	byte oldState[] = state;
+  int oldCapacity = table.length;
+  //if (oldCapacity == newCapacity) return;
+  
+  double oldTable[] = table;
+  int oldValues[] = values;
+  byte oldState[] = state;
 
-	double newTable[] = new double[newCapacity];
-	int newValues[] = new int[newCapacity];
-	byte newState[] = new byte[newCapacity];
+  double newTable[] = new double[newCapacity];
+  int newValues[] = new int[newCapacity];
+  byte newState[] = new byte[newCapacity];
 
-	this.lowWaterMark  = chooseLowWaterMark(newCapacity,this.minLoadFactor);
-	this.highWaterMark = chooseHighWaterMark(newCapacity,this.maxLoadFactor);
+  this.lowWaterMark  = chooseLowWaterMark(newCapacity,this.minLoadFactor);
+  this.highWaterMark = chooseHighWaterMark(newCapacity,this.maxLoadFactor);
 
-	this.table = newTable;
-	this.values = newValues;
-	this.state = newState;
-	this.freeEntries = newCapacity-this.distinct; // delta
-	
-	for (int i = oldCapacity ; i-- > 0 ;) {
-		if (oldState[i]==FULL) {
-			double element = oldTable[i];
-			int index = indexOfInsertion(element);
-			newTable[index]=element;
-			newValues[index]=oldValues[i];
-			newState[index]=FULL;
-		}
-	}
+  this.table = newTable;
+  this.values = newValues;
+  this.state = newState;
+  this.freeEntries = newCapacity-this.distinct; // delta
+  
+  for (int i = oldCapacity ; i-- > 0 ;) {
+    if (oldState[i]==FULL) {
+      double element = oldTable[i];
+      int index = indexOfInsertion(element);
+      newTable[index]=element;
+      newValues[index]=oldValues[i];
+      newState[index]=FULL;
+    }
+  }
 }
 /**
  * Removes the given key with its associated element from the receiver, if present.
@@ -421,25 +421,25 @@
  * @return <tt>true</tt> if the receiver contained the specified key, <tt>false</tt> otherwise.
  */
 public boolean removeKey(double key) {
-	int i = indexOfKey(key);
-	if (i<0) return false; // key not contained
+  int i = indexOfKey(key);
+  if (i<0) return false; // key not contained
 
-	this.state[i]=REMOVED;
-	//this.values[i]=0; // delta
-	this.distinct--;
+  this.state[i]=REMOVED;
+  //this.values[i]=0; // delta
+  this.distinct--;
 
-	if (this.distinct < this.lowWaterMark) {
-		int newCapacity = chooseShrinkCapacity(this.distinct,this.minLoadFactor, this.maxLoadFactor);
-		/*
-		if (table.length != newCapacity) {
-			System.out.print("shrink rehashing ");
-			System.out.println("at distinct="+distinct+", capacity="+table.length+" to newCapacity="+newCapacity+" ...");
-		}
-		*/
-		rehash(newCapacity);
-	}
-	
-	return true;	
+  if (this.distinct < this.lowWaterMark) {
+    int newCapacity = chooseShrinkCapacity(this.distinct,this.minLoadFactor, this.maxLoadFactor);
+    /*
+    if (table.length != newCapacity) {
+      System.out.print("shrink rehashing ");
+      System.out.println("at distinct="+distinct+", capacity="+table.length+" to newCapacity="+newCapacity+" ...");
+    }
+    */
+    rehash(newCapacity);
+  }
+  
+  return true;  
 }
 /**
  * Initializes the receiver.
@@ -447,32 +447,32 @@
  * @param      initialCapacity   the initial capacity of the receiver.
  * @param      minLoadFactor        the minLoadFactor of the receiver.
  * @param      maxLoadFactor        the maxLoadFactor of the receiver.
- * @throws	IllegalArgumentException if <tt>initialCapacity < 0 || (minLoadFactor < 0.0 || minLoadFactor >= 1.0) || (maxLoadFactor <= 0.0 || maxLoadFactor >= 1.0) || (minLoadFactor >= maxLoadFactor)</tt>.
+ * @throws  IllegalArgumentException if <tt>initialCapacity < 0 || (minLoadFactor < 0.0 || minLoadFactor >= 1.0) || (maxLoadFactor <= 0.0 || maxLoadFactor >= 1.0) || (minLoadFactor >= maxLoadFactor)</tt>.
  */
 protected void setUp(int initialCapacity, double minLoadFactor, double maxLoadFactor) {
-	int capacity = initialCapacity;
-	super.setUp(capacity, minLoadFactor, maxLoadFactor);
-	capacity = nextPrime(capacity);
-	if (capacity==0) capacity=1; // open addressing needs at least one FREE slot at any time.
-	
-	this.table = new double[capacity];
-	this.values = new int[capacity];
-	this.state = new byte[capacity];
+  int capacity = initialCapacity;
+  super.setUp(capacity, minLoadFactor, maxLoadFactor);
+  capacity = nextPrime(capacity);
+  if (capacity==0) capacity=1; // open addressing needs at least one FREE slot at any time.
+  
+  this.table = new double[capacity];
+  this.values = new int[capacity];
+  this.state = new byte[capacity];
 
-	// memory will be exhausted long before this pathological case happens, anyway.
-	this.minLoadFactor = minLoadFactor;
-	if (capacity == PrimeFinder.largestPrime) this.maxLoadFactor = 1.0;
-	else this.maxLoadFactor = maxLoadFactor;
+  // memory will be exhausted long before this pathological case happens, anyway.
+  this.minLoadFactor = minLoadFactor;
+  if (capacity == PrimeFinder.largestPrime) this.maxLoadFactor = 1.0;
+  else this.maxLoadFactor = maxLoadFactor;
 
-	this.distinct = 0;
-	this.freeEntries = capacity; // delta
-	
-	// lowWaterMark will be established upon first expansion.
-	// establishing it now (upon instance construction) would immediately make the table shrink upon first put(...).
-	// After all the idea of an "initialCapacity" implies violating lowWaterMarks when an object is young.
-	// See ensureCapacity(...)
-	this.lowWaterMark = 0; 
-	this.highWaterMark = chooseHighWaterMark(capacity, this.maxLoadFactor);
+  this.distinct = 0;
+  this.freeEntries = capacity; // delta
+  
+  // lowWaterMark will be established upon first expansion.
+  // establishing it now (upon instance construction) would immediately make the table shrink upon first put(...).
+  // After all the idea of an "initialCapacity" implies violating lowWaterMarks when an object is young.
+  // See ensureCapacity(...)
+  this.lowWaterMark = 0; 
+  this.highWaterMark = chooseHighWaterMark(capacity, this.maxLoadFactor);
 }
 /**
  * Trims the capacity of the receiver to be the receiver's current 
@@ -480,12 +480,12 @@
  * storage of the receiver.
  */
 public void trimToSize() {
-	// * 1.2 because open addressing's performance exponentially degrades beyond that point
-	// so that even rehashing the table can take very long
-	int newCapacity = nextPrime((int)(1 + 1.2*size()));
-	if (table.length > newCapacity) {
-		rehash(newCapacity);
-	}
+  // * 1.2 because open addressing's performance exponentially degrades beyond that point
+  // so that even rehashing the table can take very long
+  int newCapacity = nextPrime((int)(1 + 1.2*size()));
+  if (table.length > newCapacity) {
+    rehash(newCapacity);
+  }
 }
 /**
  * Fills all values contained in the receiver into the specified list.
@@ -498,15 +498,15 @@
  * @param list the list to be filled, can have any size.
  */
 public void values(IntArrayList list) {
-	list.setSize(distinct);
-	int[] elements = list.elements();
-	
-	int[] val = values;
-	byte[] stat = state;
-	
-	int j=0;
-	for (int i = stat.length ; i-- > 0 ;) {
-		if (stat[i]==FULL) elements[j++]=val[i];
-	}
+  list.setSize(distinct);
+  int[] elements = list.elements();
+  
+  int[] val = values;
+  byte[] stat = state;
+  
+  int j=0;
+  for (int i = stat.length ; i-- > 0 ;) {
+    if (stat[i]==FULL) elements[j++]=val[i];
+  }
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/map/OpenIntDoubleHashMap.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/map/OpenIntDoubleHashMap.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/map/OpenIntDoubleHashMap.java	(working copy)
@@ -21,48 +21,48 @@
 
 @author wolfgang.hoschek@cern.ch
 @version 1.0, 09/24/99
-@see	    java.util.HashMap
+@see      java.util.HashMap
 */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
  */
 @Deprecated
 public class OpenIntDoubleHashMap extends AbstractIntDoubleMap {
-	//public static int hashCollisions = 0;
-	/**
-	 * The hash table keys.
-	 * @serial
-	 */
-	protected int table[];
+  //public static int hashCollisions = 0;
+  /**
+   * The hash table keys.
+   * @serial
+   */
+  protected int table[];
 
-	 /**
-	 * The hash table values.
-	 * @serial
-	 */
-	protected double values[];
+   /**
+   * The hash table values.
+   * @serial
+   */
+  protected double values[];
 
-	/**
-	 * The state of each hash table entry (FREE, FULL, REMOVED).
-	 * @serial
-	 */
-	protected byte state[];
-	
-	/**
-	 * The number of table entries in state==FREE.
-	 * @serial
-	 */
-	protected int freeEntries;
+  /**
+   * The state of each hash table entry (FREE, FULL, REMOVED).
+   * @serial
+   */
+  protected byte state[];
+  
+  /**
+   * The number of table entries in state==FREE.
+   * @serial
+   */
+  protected int freeEntries;
 
-	
-	protected static final byte FREE = 0;
-	protected static final byte FULL = 1;
-	protected static final byte REMOVED = 2;
+  
+  protected static final byte FREE = 0;
+  protected static final byte FULL = 1;
+  protected static final byte REMOVED = 2;
 
 /**
  * Constructs an empty map with default capacity and default load factors.
  */
 public OpenIntDoubleHashMap() {
-	this(defaultCapacity);
+  this(defaultCapacity);
 }
 /**
  * Constructs an empty map with the specified initial capacity and default load factors.
@@ -72,7 +72,7 @@
  *             than zero.
  */
 public OpenIntDoubleHashMap(int initialCapacity) {
-	this(initialCapacity, defaultMinLoadFactor, defaultMaxLoadFactor);
+  this(initialCapacity, defaultMinLoadFactor, defaultMaxLoadFactor);
 }
 /**
  * Constructs an empty map with
@@ -81,10 +81,10 @@
  * @param      initialCapacity   the initial capacity.
  * @param      minLoadFactor        the minimum load factor.
  * @param      maxLoadFactor        the maximum load factor.
- * @throws	IllegalArgumentException if <tt>initialCapacity < 0 || (minLoadFactor < 0.0 || minLoadFactor >= 1.0) || (maxLoadFactor <= 0.0 || maxLoadFactor >= 1.0) || (minLoadFactor >= maxLoadFactor)</tt>.
+ * @throws  IllegalArgumentException if <tt>initialCapacity < 0 || (minLoadFactor < 0.0 || minLoadFactor >= 1.0) || (maxLoadFactor <= 0.0 || maxLoadFactor >= 1.0) || (minLoadFactor >= maxLoadFactor)</tt>.
  */
 public OpenIntDoubleHashMap(int initialCapacity, double minLoadFactor, double maxLoadFactor) {
-	setUp(initialCapacity,minLoadFactor,maxLoadFactor);
+  setUp(initialCapacity,minLoadFactor,maxLoadFactor);
 }
 /**
 Assigns the result of a function to each value; <tt>v[i] = function(v[i])</tt>.
@@ -92,23 +92,23 @@
 @param function a function object taking as argument the current association's value.
 */
 public void assign(org.apache.mahout.matrix.function.DoubleFunction function) {
-	// specialization for speed
-	if (function instanceof org.apache.mahout.jet.math.Mult) { // x[i] = mult*x[i]
-		double multiplicator = ((org.apache.mahout.jet.math.Mult)function).multiplicator;
-		if (multiplicator==1) return;
-		if (multiplicator==0) {
-			clear();
-			return;
-		}
-		for (int i = table.length ; i-- > 0 ;) {
-			if (state[i]==FULL) values[i] *= multiplicator;
-		}
-	}
-	else { // the general case x[i] = f(x[i])
-		for (int i = table.length ; i-- > 0 ;) {
-			if (state[i]==FULL) values[i] = function.apply(values[i]);
-		}
-	}
+  // specialization for speed
+  if (function instanceof org.apache.mahout.jet.math.Mult) { // x[i] = mult*x[i]
+    double multiplicator = ((org.apache.mahout.jet.math.Mult)function).multiplicator;
+    if (multiplicator==1) return;
+    if (multiplicator==0) {
+      clear();
+      return;
+    }
+    for (int i = table.length ; i-- > 0 ;) {
+      if (state[i]==FULL) values[i] *= multiplicator;
+    }
+  }
+  else { // the general case x[i] = f(x[i])
+    for (int i = table.length ; i-- > 0 ;) {
+      if (state[i]==FULL) values[i] = function.apply(values[i]);
+    }
+  }
 }
 /**
  * Clears the receiver, then adds all (key,value) pairs of <tt>other</tt>values to it.
@@ -116,43 +116,43 @@
  * @param other the other map to be copied into the receiver.
  */
 public void assign(AbstractIntDoubleMap other) {
-	if (!(other instanceof OpenIntDoubleHashMap)) {
-		super.assign(other);
-		return;
-	}
-	OpenIntDoubleHashMap source = (OpenIntDoubleHashMap) other;
-	OpenIntDoubleHashMap copy = (OpenIntDoubleHashMap) source.copy();
-	this.values = copy.values;
-	this.table = copy.table;
-	this.state = copy.state;
-	this.freeEntries = copy.freeEntries;
-	this.distinct = copy.distinct;
-	this.lowWaterMark = copy.lowWaterMark;
-	this.highWaterMark = copy.highWaterMark;
-	this.minLoadFactor = copy.minLoadFactor;
-	this.maxLoadFactor = copy.maxLoadFactor;
+  if (!(other instanceof OpenIntDoubleHashMap)) {
+    super.assign(other);
+    return;
+  }
+  OpenIntDoubleHashMap source = (OpenIntDoubleHashMap) other;
+  OpenIntDoubleHashMap copy = (OpenIntDoubleHashMap) source.copy();
+  this.values = copy.values;
+  this.table = copy.table;
+  this.state = copy.state;
+  this.freeEntries = copy.freeEntries;
+  this.distinct = copy.distinct;
+  this.lowWaterMark = copy.lowWaterMark;
+  this.highWaterMark = copy.highWaterMark;
+  this.minLoadFactor = copy.minLoadFactor;
+  this.maxLoadFactor = copy.maxLoadFactor;
 }
 /**
  * Removes all (key,value) associations from the receiver.
  * Implicitly calls <tt>trimToSize()</tt>.
  */
 public void clear() {
-	new ByteArrayList(this.state).fillFromToWith(0, this.state.length-1, FREE);
-	//new DoubleArrayList(values).fillFromToWith(0, state.length-1, 0); // delta
-	
-	/*
-	if (debug) {
-		for (int i=table.length; --i >= 0; ) {
-		    state[i] = FREE;
-		    table[i]= Integer.MAX_VALUE;
-		    values[i]= Double.NaN;
-		}
-	}
-	*/
-	
-	this.distinct = 0;
-	this.freeEntries = table.length; // delta
-	trimToSize();
+  new ByteArrayList(this.state).fillFromToWith(0, this.state.length-1, FREE);
+  //new DoubleArrayList(values).fillFromToWith(0, state.length-1, 0); // delta
+  
+  /*
+  if (debug) {
+    for (int i=table.length; --i >= 0; ) {
+        state[i] = FREE;
+        table[i]= Integer.MAX_VALUE;
+        values[i]= Double.NaN;
+    }
+  }
+  */
+  
+  this.distinct = 0;
+  this.freeEntries = table.length; // delta
+  trimToSize();
 }
 /**
  * Returns a deep copy of the receiver.
@@ -160,11 +160,11 @@
  * @return  a deep copy of the receiver.
  */
 public Object clone() {
-	OpenIntDoubleHashMap copy = (OpenIntDoubleHashMap) super.clone();
-	copy.table = (int[]) copy.table.clone();
-	copy.values = (double[]) copy.values.clone();
-	copy.state = (byte[]) copy.state.clone();
-	return copy;
+  OpenIntDoubleHashMap copy = (OpenIntDoubleHashMap) super.clone();
+  copy.table = (int[]) copy.table.clone();
+  copy.values = (double[]) copy.values.clone();
+  copy.state = (byte[]) copy.state.clone();
+  return copy;
 }
 /**
  * Returns <tt>true</tt> if the receiver contains the specified key.
@@ -172,7 +172,7 @@
  * @return <tt>true</tt> if the receiver contains the specified key.
  */
 public boolean containsKey(int key) {
-	return indexOfKey(key) >= 0;
+  return indexOfKey(key) >= 0;
 }
 /**
  * Returns <tt>true</tt> if the receiver contains the specified value.
@@ -180,7 +180,7 @@
  * @return <tt>true</tt> if the receiver contains the specified value.
  */
 public boolean containsValue(double value) {
-	return indexOfValue(value) >= 0;
+  return indexOfValue(value) >= 0;
 }
 /**
  * Ensures that the receiver can hold at least the specified number of associations without needing to allocate new internal memory.
@@ -193,10 +193,10 @@
  * @param   minCapacity   the desired minimum capacity.
  */
 public void ensureCapacity(int minCapacity) {
-	if (table.length < minCapacity) {
-		int newCapacity = nextPrime(minCapacity);
-		rehash(newCapacity);
-	}
+  if (table.length < minCapacity) {
+    int newCapacity = nextPrime(minCapacity);
+    rehash(newCapacity);
+  }
 }
 /**
  * Applies a procedure to each key of the receiver, if any.
@@ -209,10 +209,10 @@
  * @return <tt>false</tt> if the procedure stopped before all keys where iterated over, <tt>true</tt> otherwise. 
  */
 public boolean forEachKey(IntProcedure procedure) {
-	for (int i = table.length ; i-- > 0 ;) {
-		if (state[i]==FULL) if (! procedure.apply(table[i])) return false;
-	}
-	return true;
+  for (int i = table.length ; i-- > 0 ;) {
+    if (state[i]==FULL) if (! procedure.apply(table[i])) return false;
+  }
+  return true;
 }
 /**
  * Applies a procedure to each (key,value) pair of the receiver, if any.
@@ -222,10 +222,10 @@
  * @return <tt>false</tt> if the procedure stopped before all keys where iterated over, <tt>true</tt> otherwise. 
  */
 public boolean forEachPair(final IntDoubleProcedure procedure) {
-	for (int i = table.length ; i-- > 0 ;) {
-		if (state[i]==FULL) if (! procedure.apply(table[i],values[i])) return false;
-	}
-	return true;
+  for (int i = table.length ; i-- > 0 ;) {
+    if (state[i]==FULL) if (! procedure.apply(table[i],values[i])) return false;
+  }
+  return true;
 }
 /**
  * Returns the value associated with the specified key.
@@ -235,9 +235,9 @@
  * @return the value associated with the specified key; <tt>0</tt> if no such key is present.
  */
 public double get(int key) {
-	int i = indexOfKey(key);
-	if (i<0) return 0; //not contained
-	return values[i];
+  int i = indexOfKey(key);
+  if (i<0) return 0; //not contained
+  return values[i];
 }
 /**
  * @param key the key to be added to the receiver.
@@ -247,87 +247,87 @@
  * If the returned index >= 0, then it is NOT already contained and should be inserted at slot index.
  */
 protected int indexOfInsertion(int key) {
-	final int tab[] = table;
-	final byte stat[] = state;
-	final int length = tab.length;
+  final int tab[] = table;
+  final byte stat[] = state;
+  final int length = tab.length;
 
-	final int hash = HashFunctions.hash(key) & 0x7FFFFFFF;
-	int i = hash % length;
-	int decrement = hash % (length-2); // double hashing, see http://www.eece.unm.edu/faculty/heileman/hash/node4.html
-	//int decrement = (hash / length) % length;
-	if (decrement == 0) decrement = 1;
+  final int hash = HashFunctions.hash(key) & 0x7FFFFFFF;
+  int i = hash % length;
+  int decrement = hash % (length-2); // double hashing, see http://www.eece.unm.edu/faculty/heileman/hash/node4.html
+  //int decrement = (hash / length) % length;
+  if (decrement == 0) decrement = 1;
 
-	// stop if we find a removed or free slot, or if we find the key itself
-	// do NOT skip over removed slots (yes, open addressing is like that...)
-	while (stat[i] == FULL && tab[i] != key) {
-		i -= decrement;
-		//hashCollisions++;
-		if (i<0) i+=length;
-	}
-	
-	if (stat[i] == REMOVED) {
-		// stop if we find a free slot, or if we find the key itself.
-		// do skip over removed slots (yes, open addressing is like that...)
-		// assertion: there is at least one FREE slot.
-		int j = i;
-		while (stat[i] != FREE && (stat[i] == REMOVED || tab[i] != key)) {
-			i -= decrement;
-			//hashCollisions++;
-			if (i<0) i+=length;
-		}
-		if (stat[i] == FREE) i = j;
-	}
-	
-	
-	if (stat[i] == FULL) {
-		// key already contained at slot i.
-		// return a negative number identifying the slot.
-		return -i-1;
-	}
-	// not already contained, should be inserted at slot i.
-	// return a number >= 0 identifying the slot.
-	return i; 
+  // stop if we find a removed or free slot, or if we find the key itself
+  // do NOT skip over removed slots (yes, open addressing is like that...)
+  while (stat[i] == FULL && tab[i] != key) {
+    i -= decrement;
+    //hashCollisions++;
+    if (i<0) i+=length;
+  }
+  
+  if (stat[i] == REMOVED) {
+    // stop if we find a free slot, or if we find the key itself.
+    // do skip over removed slots (yes, open addressing is like that...)
+    // assertion: there is at least one FREE slot.
+    int j = i;
+    while (stat[i] != FREE && (stat[i] == REMOVED || tab[i] != key)) {
+      i -= decrement;
+      //hashCollisions++;
+      if (i<0) i+=length;
+    }
+    if (stat[i] == FREE) i = j;
+  }
+  
+  
+  if (stat[i] == FULL) {
+    // key already contained at slot i.
+    // return a negative number identifying the slot.
+    return -i-1;
+  }
+  // not already contained, should be inserted at slot i.
+  // return a number >= 0 identifying the slot.
+  return i; 
 }
 /**
  * @param key the key to be searched in the receiver.
  * @return the index where the key is contained in the receiver, else returns -1.
  */
 protected int indexOfKey(int key) {
-	final int tab[] = table;
-	final byte stat[] = state;
-	final int length = tab.length;
+  final int tab[] = table;
+  final byte stat[] = state;
+  final int length = tab.length;
 
-	final int hash = HashFunctions.hash(key) & 0x7FFFFFFF;
-	int i = hash % length;
-	int decrement = hash % (length-2); // double hashing, see http://www.eece.unm.edu/faculty/heileman/hash/node4.html
-	//int decrement = (hash / length) % length;
-	if (decrement == 0) decrement = 1;
+  final int hash = HashFunctions.hash(key) & 0x7FFFFFFF;
+  int i = hash % length;
+  int decrement = hash % (length-2); // double hashing, see http://www.eece.unm.edu/faculty/heileman/hash/node4.html
+  //int decrement = (hash / length) % length;
+  if (decrement == 0) decrement = 1;
 
-	// stop if we find a free slot, or if we find the key itself.
-	// do skip over removed slots (yes, open addressing is like that...)
-	// assertion: there is at least one FREE slot.
-	while (stat[i] != FREE && (stat[i] == REMOVED || tab[i] != key)) {
-		i -= decrement;
-		//hashCollisions++;
-		if (i<0) i+=length;
-	}
-	
-	if (stat[i] == FREE) return -1; // not found
-	return i; //found, return index where key is contained
+  // stop if we find a free slot, or if we find the key itself.
+  // do skip over removed slots (yes, open addressing is like that...)
+  // assertion: there is at least one FREE slot.
+  while (stat[i] != FREE && (stat[i] == REMOVED || tab[i] != key)) {
+    i -= decrement;
+    //hashCollisions++;
+    if (i<0) i+=length;
+  }
+  
+  if (stat[i] == FREE) return -1; // not found
+  return i; //found, return index where key is contained
 }
 /**
  * @param value the value to be searched in the receiver.
  * @return the index where the value is contained in the receiver, returns -1 if the value was not found.
  */
 protected int indexOfValue(double value) {
-	final double val[] = values;
-	final byte stat[] = state;
+  final double val[] = values;
+  final byte stat[] = state;
 
-	for (int i=stat.length; --i >= 0;) {
-		if (stat[i]==FULL && val[i]==value) return i;
-	}
+  for (int i=stat.length; --i >= 0;) {
+    if (stat[i]==FULL && val[i]==value) return i;
+  }
 
-	return -1; // not found
+  return -1; // not found
 }
 /**
  * Returns the first key the given value is associated with.
@@ -336,13 +336,13 @@
  *
  * @param value the value to search for.
  * @return the first key for which holds <tt>get(key) == value</tt>; 
- *		   returns <tt>Integer.MIN_VALUE</tt> if no such key exists.
+ *       returns <tt>Integer.MIN_VALUE</tt> if no such key exists.
  */
 public int keyOf(double value) {
-	//returns the first key found; there may be more matching keys, however.
-	int i = indexOfValue(value);
-	if (i<0) return Integer.MIN_VALUE;
-	return table[i];
+  //returns the first key found; there may be more matching keys, however.
+  int i = indexOfValue(value);
+  if (i<0) return Integer.MIN_VALUE;
+  return table[i];
 }
 /**
  * Fills all keys contained in the receiver into the specified list.
@@ -355,16 +355,16 @@
  * @param list the list to be filled, can have any size.
  */
 public void keys(IntArrayList list) {
-	list.setSize(distinct);
-	int[] elements = list.elements();
-	
-	int[] tab = table;
-	byte[] stat = state;
-	
-	int j=0;
-	for (int i = tab.length ; i-- > 0 ;) {
-		if (stat[i]==FULL) elements[j++]=tab[i];
-	}
+  list.setSize(distinct);
+  int[] elements = list.elements();
+  
+  int[] tab = table;
+  byte[] stat = state;
+  
+  int j=0;
+  for (int i = tab.length ; i-- > 0 ;) {
+    if (stat[i]==FULL) elements[j++]=tab[i];
+  }
 }
 /**
 Fills all pairs satisfying a given condition into the specified lists.
@@ -376,7 +376,7 @@
 <br>
 <pre>
 IntDoubleProcedure condition = new IntDoubleProcedure() { // match even keys only
-	public boolean apply(int key, double value) { return key%2==0; }
+  public boolean apply(int key, double value) { return key%2==0; }
 }
 keys = (8,7,6), values = (1,2,2) --> keyList = (6,8), valueList = (2,1)</tt>
 </pre>
@@ -386,15 +386,15 @@
 @param valueList the list to be filled with values, can have any size.
 */
 public void pairsMatching(final IntDoubleProcedure condition, final IntArrayList keyList, final DoubleArrayList valueList) {
-	keyList.clear();
-	valueList.clear();
-	
-	for (int i = table.length ; i-- > 0 ;) {
-		if (state[i]==FULL && condition.apply(table[i],values[i])) {
-			keyList.add(table[i]);
-			valueList.add(values[i]);
-		}
-	}
+  keyList.clear();
+  valueList.clear();
+  
+  for (int i = table.length ; i-- > 0 ;) {
+    if (state[i]==FULL && condition.apply(table[i],values[i])) {
+      keyList.add(table[i]);
+      valueList.add(values[i]);
+    }
+  }
 }
 /**
  * Associates the given key with the given value.
@@ -406,37 +406,37 @@
  *         <tt>false</tt> if the receiver did already contain such a key - the new value has now replaced the formerly associated value.
  */
 public boolean put(int key, double value) {
-	int i = indexOfInsertion(key);	
-	if (i<0) { //already contained
-		i = -i -1;
-		//if (debug) if (this.state[i] != FULL) throw new InternalError();
-		//if (debug) if (this.table[i] != key) throw new InternalError();
-		this.values[i]=value;
-		return false;
-	}
+  int i = indexOfInsertion(key);  
+  if (i<0) { //already contained
+    i = -i -1;
+    //if (debug) if (this.state[i] != FULL) throw new InternalError();
+    //if (debug) if (this.table[i] != key) throw new InternalError();
+    this.values[i]=value;
+    return false;
+  }
 
-	if (this.distinct > this.highWaterMark) {
-		int newCapacity = chooseGrowCapacity(this.distinct+1,this.minLoadFactor, this.maxLoadFactor);
-		/*
-		System.out.print("grow rehashing ");
-		System.out.println("at distinct="+distinct+", capacity="+table.length+" to newCapacity="+newCapacity+" ...");
-		*/
-		rehash(newCapacity);
-		return put(key, value);
-	}
+  if (this.distinct > this.highWaterMark) {
+    int newCapacity = chooseGrowCapacity(this.distinct+1,this.minLoadFactor, this.maxLoadFactor);
+    /*
+    System.out.print("grow rehashing ");
+    System.out.println("at distinct="+distinct+", capacity="+table.length+" to newCapacity="+newCapacity+" ...");
+    */
+    rehash(newCapacity);
+    return put(key, value);
+  }
 
-	this.table[i]=key;
-	this.values[i]=value;
-	if (this.state[i]==FREE) this.freeEntries--;
-	this.state[i]=FULL;
-	this.distinct++;
+  this.table[i]=key;
+  this.values[i]=value;
+  if (this.state[i]==FREE) this.freeEntries--;
+  this.state[i]=FULL;
+  this.distinct++;
 
-	if (this.freeEntries < 1) { //delta
-		int newCapacity = chooseGrowCapacity(this.distinct+1,this.minLoadFactor, this.maxLoadFactor);
-		rehash(newCapacity);
-	}
-	
-	return true;
+  if (this.freeEntries < 1) { //delta
+    int newCapacity = chooseGrowCapacity(this.distinct+1,this.minLoadFactor, this.maxLoadFactor);
+    rehash(newCapacity);
+  }
+  
+  return true;
 }
 /**
  * Rehashes the contents of the receiver into a new table
@@ -445,40 +445,40 @@
  * number of keys in the receiver exceeds the high water mark or falls below the low water mark.
  */
 protected void rehash(int newCapacity) {
-	int oldCapacity = table.length;
-	//if (oldCapacity == newCapacity) return;
+  int oldCapacity = table.length;
+  //if (oldCapacity == newCapacity) return;
 
-	if (newCapacity<=this.distinct) throw new InternalError();	
-	//if (debug) check();
+  if (newCapacity<=this.distinct) throw new InternalError();  
+  //if (debug) check();
 
-	int oldTable[] = table;
-	double oldValues[] = values;
-	byte oldState[] = state;
+  int oldTable[] = table;
+  double oldValues[] = values;
+  byte oldState[] = state;
 
-	int newTable[] = new int[newCapacity];
-	double newValues[] = new double[newCapacity];
-	byte newState[] = new byte[newCapacity];
+  int newTable[] = new int[newCapacity];
+  double newValues[] = new double[newCapacity];
+  byte newState[] = new byte[newCapacity];
 
-	this.lowWaterMark  = chooseLowWaterMark(newCapacity,this.minLoadFactor);
-	this.highWaterMark = chooseHighWaterMark(newCapacity,this.maxLoadFactor);
+  this.lowWaterMark  = chooseLowWaterMark(newCapacity,this.minLoadFactor);
+  this.highWaterMark = chooseHighWaterMark(newCapacity,this.maxLoadFactor);
 
-	this.table = newTable;
-	this.values = newValues;
-	this.state = newState;
-	this.freeEntries = newCapacity-this.distinct; // delta
-	
-	for (int i = oldCapacity ; i-- > 0 ;) {
-		if (oldState[i]==FULL) {			
-			int element = oldTable[i];
-			int index = indexOfInsertion(element);
-			newTable[index]=element;
-			newValues[index]=oldValues[i];
-			newState[index]=FULL;
-			
-		}
-	}
+  this.table = newTable;
+  this.values = newValues;
+  this.state = newState;
+  this.freeEntries = newCapacity-this.distinct; // delta
+  
+  for (int i = oldCapacity ; i-- > 0 ;) {
+    if (oldState[i]==FULL) {      
+      int element = oldTable[i];
+      int index = indexOfInsertion(element);
+      newTable[index]=element;
+      newValues[index]=oldValues[i];
+      newState[index]=FULL;
+      
+    }
+  }
 
-	//if (debug) check();
+  //if (debug) check();
 }
 /**
  * Removes the given key with its associated element from the receiver, if present.
@@ -487,30 +487,30 @@
  * @return <tt>true</tt> if the receiver contained the specified key, <tt>false</tt> otherwise.
  */
 public boolean removeKey(int key) {
-	int i = indexOfKey(key);
-	if (i<0) return false; // key not contained
+  int i = indexOfKey(key);
+  if (i<0) return false; // key not contained
 
-	//if (debug) if (this.state[i] == FREE) throw new InternalError();
-	//if (debug) if (this.state[i] == REMOVED) throw new InternalError();
-	this.state[i]=REMOVED;
-	//this.values[i]=0; // delta
-	
-	//if (debug) this.table[i]=Integer.MAX_VALUE; // delta
-	//if (debug) this.values[i]=Double.NaN; // delta
-	this.distinct--;
+  //if (debug) if (this.state[i] == FREE) throw new InternalError();
+  //if (debug) if (this.state[i] == REMOVED) throw new InternalError();
+  this.state[i]=REMOVED;
+  //this.values[i]=0; // delta
+  
+  //if (debug) this.table[i]=Integer.MAX_VALUE; // delta
+  //if (debug) this.values[i]=Double.NaN; // delta
+  this.distinct--;
 
-	if (this.distinct < this.lowWaterMark) {
-		int newCapacity = chooseShrinkCapacity(this.distinct,this.minLoadFactor, this.maxLoadFactor);
-		/*
-		if (table.length != newCapacity) {
-			System.out.print("shrink rehashing ");
-			System.out.println("at distinct="+distinct+", capacity="+table.length+" to newCapacity="+newCapacity+" ...");
-		}
-		*/
-		rehash(newCapacity);
-	}
-	
-	return true;	
+  if (this.distinct < this.lowWaterMark) {
+    int newCapacity = chooseShrinkCapacity(this.distinct,this.minLoadFactor, this.maxLoadFactor);
+    /*
+    if (table.length != newCapacity) {
+      System.out.print("shrink rehashing ");
+      System.out.println("at distinct="+distinct+", capacity="+table.length+" to newCapacity="+newCapacity+" ...");
+    }
+    */
+    rehash(newCapacity);
+  }
+  
+  return true;  
 }
 /**
  * Initializes the receiver.
@@ -518,32 +518,32 @@
  * @param      initialCapacity   the initial capacity of the receiver.
  * @param      minLoadFactor        the minLoadFactor of the receiver.
  * @param      maxLoadFactor        the maxLoadFactor of the receiver.
- * @throws	IllegalArgumentException if <tt>initialCapacity < 0 || (minLoadFactor < 0.0 || minLoadFactor >= 1.0) || (maxLoadFactor <= 0.0 || maxLoadFactor >= 1.0) || (minLoadFactor >= maxLoadFactor)</tt>.
+ * @throws  IllegalArgumentException if <tt>initialCapacity < 0 || (minLoadFactor < 0.0 || minLoadFactor >= 1.0) || (maxLoadFactor <= 0.0 || maxLoadFactor >= 1.0) || (minLoadFactor >= maxLoadFactor)</tt>.
  */
 protected void setUp(int initialCapacity, double minLoadFactor, double maxLoadFactor) {
-	int capacity = initialCapacity;
-	super.setUp(capacity, minLoadFactor, maxLoadFactor);
-	capacity = nextPrime(capacity);
-	if (capacity==0) capacity=1; // open addressing needs at least one FREE slot at any time.
-	
-	this.table = new int[capacity];
-	this.values = new double[capacity];
-	this.state = new byte[capacity];
+  int capacity = initialCapacity;
+  super.setUp(capacity, minLoadFactor, maxLoadFactor);
+  capacity = nextPrime(capacity);
+  if (capacity==0) capacity=1; // open addressing needs at least one FREE slot at any time.
+  
+  this.table = new int[capacity];
+  this.values = new double[capacity];
+  this.state = new byte[capacity];
 
-	// memory will be exhausted long before this pathological case happens, anyway.
-	this.minLoadFactor = minLoadFactor;
-	if (capacity == PrimeFinder.largestPrime) this.maxLoadFactor = 1.0;
-	else this.maxLoadFactor = maxLoadFactor;
+  // memory will be exhausted long before this pathological case happens, anyway.
+  this.minLoadFactor = minLoadFactor;
+  if (capacity == PrimeFinder.largestPrime) this.maxLoadFactor = 1.0;
+  else this.maxLoadFactor = maxLoadFactor;
 
-	this.distinct = 0;
-	this.freeEntries = capacity; // delta
-	
-	// lowWaterMark will be established upon first expansion.
-	// establishing it now (upon instance construction) would immediately make the table shrink upon first put(...).
-	// After all the idea of an "initialCapacity" implies violating lowWaterMarks when an object is young.
-	// See ensureCapacity(...)
-	this.lowWaterMark = 0; 
-	this.highWaterMark = chooseHighWaterMark(capacity, this.maxLoadFactor);
+  this.distinct = 0;
+  this.freeEntries = capacity; // delta
+  
+  // lowWaterMark will be established upon first expansion.
+  // establishing it now (upon instance construction) would immediately make the table shrink upon first put(...).
+  // After all the idea of an "initialCapacity" implies violating lowWaterMarks when an object is young.
+  // See ensureCapacity(...)
+  this.lowWaterMark = 0; 
+  this.highWaterMark = chooseHighWaterMark(capacity, this.maxLoadFactor);
 }
 /**
  * Trims the capacity of the receiver to be the receiver's current 
@@ -551,12 +551,12 @@
  * storage of the receiver.
  */
 public void trimToSize() {
-	// * 1.2 because open addressing's performance exponentially degrades beyond that point
-	// so that even rehashing the table can take very long
-	int newCapacity = nextPrime((int)(1 + 1.2*size()));
-	if (table.length > newCapacity) {
-		rehash(newCapacity);
-	}
+  // * 1.2 because open addressing's performance exponentially degrades beyond that point
+  // so that even rehashing the table can take very long
+  int newCapacity = nextPrime((int)(1 + 1.2*size()));
+  if (table.length > newCapacity) {
+    rehash(newCapacity);
+  }
 }
 /**
  * Fills all values contained in the receiver into the specified list.
@@ -569,15 +569,15 @@
  * @param list the list to be filled, can have any size.
  */
 public void values(DoubleArrayList list) {
-	list.setSize(distinct);
-	double[] elements = list.elements();
-	
-	double[] val = values;
-	byte[] stat = state;
-	
-	int j=0;
-	for (int i = stat.length ; i-- > 0 ;) {
-		if (stat[i]==FULL) elements[j++]=val[i];
-	}
+  list.setSize(distinct);
+  double[] elements = list.elements();
+  
+  double[] val = values;
+  byte[] stat = state;
+  
+  int j=0;
+  for (int i = stat.length ; i-- > 0 ;) {
+    if (stat[i]==FULL) elements[j++]=val[i];
+  }
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/map/OpenLongObjectHashMap.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/map/OpenLongObjectHashMap.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/map/OpenLongObjectHashMap.java	(working copy)
@@ -21,47 +21,47 @@
 
 @author wolfgang.hoschek@cern.ch
 @version 1.0, 09/24/99
-@see	    java.util.HashMap
+@see      java.util.HashMap
 */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
  */
 @Deprecated
 public class OpenLongObjectHashMap extends AbstractLongObjectMap {
-	 /**
-	 * The hash table keys.
-	 * @serial
-	 */
-	protected long table[];
+   /**
+   * The hash table keys.
+   * @serial
+   */
+  protected long table[];
 
-	 /**
-	 * The hash table values.
-	 * @serial
-	 */
-	protected Object values[];
+   /**
+   * The hash table values.
+   * @serial
+   */
+  protected Object values[];
 
-	/**
-	 * The state of each hash table entry (FREE, FULL, REMOVED).
-	 * @serial
-	 */
-	protected byte state[];
+  /**
+   * The state of each hash table entry (FREE, FULL, REMOVED).
+   * @serial
+   */
+  protected byte state[];
 
-	/**
-	 * The number of table entries in state==FREE.
-	 * @serial
-	 */
-	protected int freeEntries;
-	
-	
-	protected static final byte FREE = 0;
-	protected static final byte FULL = 1;
-	protected static final byte REMOVED = 2;
+  /**
+   * The number of table entries in state==FREE.
+   * @serial
+   */
+  protected int freeEntries;
+  
+  
+  protected static final byte FREE = 0;
+  protected static final byte FULL = 1;
+  protected static final byte REMOVED = 2;
 
 /**
  * Constructs an empty map with default capacity and default load factors.
  */
 public OpenLongObjectHashMap() {
-	this(defaultCapacity);
+  this(defaultCapacity);
 }
 /**
  * Constructs an empty map with the specified initial capacity and default load factors.
@@ -71,7 +71,7 @@
  *             than zero.
  */
 public OpenLongObjectHashMap(int initialCapacity) {
-	this(initialCapacity, defaultMinLoadFactor, defaultMaxLoadFactor);
+  this(initialCapacity, defaultMinLoadFactor, defaultMaxLoadFactor);
 }
 /**
  * Constructs an empty map with
@@ -80,22 +80,22 @@
  * @param      initialCapacity   the initial capacity.
  * @param      minLoadFactor        the minimum load factor.
  * @param      maxLoadFactor        the maximum load factor.
- * @throws	IllegalArgumentException if <tt>initialCapacity < 0 || (minLoadFactor < 0.0 || minLoadFactor >= 1.0) || (maxLoadFactor <= 0.0 || maxLoadFactor >= 1.0) || (minLoadFactor >= maxLoadFactor)</tt>.
+ * @throws  IllegalArgumentException if <tt>initialCapacity < 0 || (minLoadFactor < 0.0 || minLoadFactor >= 1.0) || (maxLoadFactor <= 0.0 || maxLoadFactor >= 1.0) || (minLoadFactor >= maxLoadFactor)</tt>.
  */
 public OpenLongObjectHashMap(int initialCapacity, double minLoadFactor, double maxLoadFactor) {
-	setUp(initialCapacity,minLoadFactor,maxLoadFactor);
+  setUp(initialCapacity,minLoadFactor,maxLoadFactor);
 }
 /**
  * Removes all (key,value) associations from the receiver.
  * Implicitly calls <tt>trimToSize()</tt>.
  */
 public void clear() {
-	new ByteArrayList(this.state).fillFromToWith(0, this.state.length-1, FREE);
-   	new ObjectArrayList(values).fillFromToWith(0, state.length-1, null); // delta
+  new ByteArrayList(this.state).fillFromToWith(0, this.state.length-1, FREE);
+     new ObjectArrayList(values).fillFromToWith(0, state.length-1, null); // delta
 
-	this.distinct = 0;
-	this.freeEntries = table.length; // delta
-	trimToSize();
+  this.distinct = 0;
+  this.freeEntries = table.length; // delta
+  trimToSize();
 }
 /**
  * Returns a deep copy of the receiver.
@@ -103,11 +103,11 @@
  * @return  a deep copy of the receiver.
  */
 public Object clone() {
-	OpenLongObjectHashMap copy = (OpenLongObjectHashMap) super.clone();
-	copy.table = (long[]) copy.table.clone();
-	copy.values = (Object[]) copy.values.clone();
-	copy.state = (byte[]) copy.state.clone();
-	return copy;
+  OpenLongObjectHashMap copy = (OpenLongObjectHashMap) super.clone();
+  copy.table = (long[]) copy.table.clone();
+  copy.values = (Object[]) copy.values.clone();
+  copy.state = (byte[]) copy.state.clone();
+  return copy;
 }
 /**
  * Returns <tt>true</tt> if the receiver contains the specified key.
@@ -115,7 +115,7 @@
  * @return <tt>true</tt> if the receiver contains the specified key.
  */
 public boolean containsKey(long key) {
-	return indexOfKey(key) >= 0;
+  return indexOfKey(key) >= 0;
 }
 /**
  * Returns <tt>true</tt> if the receiver contains the specified value.
@@ -123,7 +123,7 @@
  * @return <tt>true</tt> if the receiver contains the specified value.
  */
 public boolean containsValue(Object value) {
-	return indexOfValue(value) >= 0;
+  return indexOfValue(value) >= 0;
 }
 /**
  * Ensures that the receiver can hold at least the specified number of associations without needing to allocate new internal memory.
@@ -136,10 +136,10 @@
  * @param   minCapacity   the desired minimum capacity.
  */
 public void ensureCapacity(int minCapacity) {
-	if (table.length < minCapacity) {
-		int newCapacity = nextPrime(minCapacity);
-		rehash(newCapacity);
-	}
+  if (table.length < minCapacity) {
+    int newCapacity = nextPrime(minCapacity);
+    rehash(newCapacity);
+  }
 }
 /**
  * Applies a procedure to each key of the receiver, if any.
@@ -152,10 +152,10 @@
  * @return <tt>false</tt> if the procedure stopped before all keys where iterated over, <tt>true</tt> otherwise. 
  */
 public boolean forEachKey(LongProcedure procedure) {
-	for (int i = table.length ; i-- > 0 ;) {
-		if (state[i]==FULL) if (! procedure.apply(table[i])) return false;
-	}
-	return true;
+  for (int i = table.length ; i-- > 0 ;) {
+    if (state[i]==FULL) if (! procedure.apply(table[i])) return false;
+  }
+  return true;
 }
 /**
  * Applies a procedure to each (key,value) pair of the receiver, if any.
@@ -165,10 +165,10 @@
  * @return <tt>false</tt> if the procedure stopped before all keys where iterated over, <tt>true</tt> otherwise. 
  */
 public boolean forEachPair(final LongObjectProcedure procedure) {
-	for (int i = table.length ; i-- > 0 ;) {
-		if (state[i]==FULL) if (! procedure.apply(table[i],values[i])) return false;
-	}
-	return true;
+  for (int i = table.length ; i-- > 0 ;) {
+    if (state[i]==FULL) if (! procedure.apply(table[i],values[i])) return false;
+  }
+  return true;
 }
 /**
  * Returns the value associated with the specified key.
@@ -178,9 +178,9 @@
  * @return the value associated with the specified key; <tt>null</tt> if no such key is present.
  */
 public Object get(long key) {
-	int i = indexOfKey(key);
-	if (i<0) return null; //not contained
-	return values[i];
+  int i = indexOfKey(key);
+  if (i<0) return null; //not contained
+  return values[i];
 }
 /**
  * @param key the key to be added to the receiver.
@@ -190,86 +190,86 @@
  * If the returned index >= 0, then it is NOT already contained and should be inserted at slot index.
  */
 protected int indexOfInsertion(long key) {
-	final long tab[] = table;
-	final byte stat[] = state;
-	final int length = tab.length;
+  final long tab[] = table;
+  final byte stat[] = state;
+  final int length = tab.length;
 
-	final int hash = HashFunctions.hash(key) & 0x7FFFFFFF;
-	int i = hash % length;
-	int decrement = hash % (length-2); // double hashing, see http://www.eece.unm.edu/faculty/heileman/hash/node4.html
-	//int decrement = (hash / length) % length;
-	if (decrement == 0) decrement = 1;
+  final int hash = HashFunctions.hash(key) & 0x7FFFFFFF;
+  int i = hash % length;
+  int decrement = hash % (length-2); // double hashing, see http://www.eece.unm.edu/faculty/heileman/hash/node4.html
+  //int decrement = (hash / length) % length;
+  if (decrement == 0) decrement = 1;
 
-	// stop if we find a removed or free slot, or if we find the key itself
-	// do NOT skip over removed slots (yes, open addressing is like that...)
-	while (stat[i] == FULL && tab[i] != key) {
-		i -= decrement;
-		//hashCollisions++;
-		if (i<0) i+=length;
-	}
-	
-	if (stat[i] == REMOVED) {
-		// stop if we find a free slot, or if we find the key itself.
-		// do skip over removed slots (yes, open addressing is like that...)
-		// assertion: there is at least one FREE slot.
-		int j = i;
-		while (stat[i] != FREE && (stat[i] == REMOVED || tab[i] != key)) {
-			i -= decrement;
-			//hashCollisions++;
-			if (i<0) i+=length;
-		}
-		if (stat[i] == FREE) i = j;
-	}
-	
-	
-	if (stat[i] == FULL) {
-		// key already contained at slot i.
-		// return a negative number identifying the slot.
-		return -i-1;
-	}
-	// not already contained, should be inserted at slot i.
-	// return a number >= 0 identifying the slot.
-	return i; 
+  // stop if we find a removed or free slot, or if we find the key itself
+  // do NOT skip over removed slots (yes, open addressing is like that...)
+  while (stat[i] == FULL && tab[i] != key) {
+    i -= decrement;
+    //hashCollisions++;
+    if (i<0) i+=length;
+  }
+  
+  if (stat[i] == REMOVED) {
+    // stop if we find a free slot, or if we find the key itself.
+    // do skip over removed slots (yes, open addressing is like that...)
+    // assertion: there is at least one FREE slot.
+    int j = i;
+    while (stat[i] != FREE && (stat[i] == REMOVED || tab[i] != key)) {
+      i -= decrement;
+      //hashCollisions++;
+      if (i<0) i+=length;
+    }
+    if (stat[i] == FREE) i = j;
+  }
+  
+  
+  if (stat[i] == FULL) {
+    // key already contained at slot i.
+    // return a negative number identifying the slot.
+    return -i-1;
+  }
+  // not already contained, should be inserted at slot i.
+  // return a number >= 0 identifying the slot.
+  return i; 
 }
 /**
  * @param key the key to be searched in the receiver.
  * @return the index where the key is contained in the receiver, returns -1 if the key was not found.
  */
 protected int indexOfKey(long key) {
-	final long tab[] = table;
-	final byte stat[] = state;
-	final int length = tab.length;
+  final long tab[] = table;
+  final byte stat[] = state;
+  final int length = tab.length;
 
-	final int hash = HashFunctions.hash(key) & 0x7FFFFFFF;
-	int i = hash % length;
-	int decrement = hash % (length-2); // double hashing, see http://www.eece.unm.edu/faculty/heileman/hash/node4.html
-	//int decrement = (hash / length) % length;
-	if (decrement == 0) decrement = 1;
+  final int hash = HashFunctions.hash(key) & 0x7FFFFFFF;
+  int i = hash % length;
+  int decrement = hash % (length-2); // double hashing, see http://www.eece.unm.edu/faculty/heileman/hash/node4.html
+  //int decrement = (hash / length) % length;
+  if (decrement == 0) decrement = 1;
 
-	// stop if we find a free slot, or if we find the key itself.
-	// do skip over removed slots (yes, open addressing is like that...)
-	while (stat[i] != FREE && (stat[i] == REMOVED || tab[i] != key)) {
-		i -= decrement;
-		//hashCollisions++;
-		if (i<0) i+=length;
-	}
-	
-	if (stat[i] == FREE) return -1; // not found
-	return i; //found, return index where key is contained
+  // stop if we find a free slot, or if we find the key itself.
+  // do skip over removed slots (yes, open addressing is like that...)
+  while (stat[i] != FREE && (stat[i] == REMOVED || tab[i] != key)) {
+    i -= decrement;
+    //hashCollisions++;
+    if (i<0) i+=length;
+  }
+  
+  if (stat[i] == FREE) return -1; // not found
+  return i; //found, return index where key is contained
 }
 /**
  * @param value the value to be searched in the receiver.
  * @return the index where the value is contained in the receiver, returns -1 if the value was not found.
  */
 protected int indexOfValue(Object value) {
-	final Object val[] = values;
-	final byte stat[] = state;
+  final Object val[] = values;
+  final byte stat[] = state;
 
-	for (int i=stat.length; --i >= 0;) {
-		if (stat[i]==FULL && val[i]==value) return i;
-	}
+  for (int i=stat.length; --i >= 0;) {
+    if (stat[i]==FULL && val[i]==value) return i;
+  }
 
-	return -1; // not found
+  return -1; // not found
 }
 /**
  * Returns the first key the given value is associated with.
@@ -278,13 +278,13 @@
  *
  * @param value the value to search for.
  * @return the first key for which holds <tt>get(key) == value</tt>; 
- *		   returns <tt>Long.MIN_VALUE</tt> if no such key exists.
+ *       returns <tt>Long.MIN_VALUE</tt> if no such key exists.
  */
 public long keyOf(Object value) {
-	//returns the first key found; there may be more matching keys, however.
-	int i = indexOfValue(value);
-	if (i<0) return Long.MIN_VALUE;
-	return table[i];
+  //returns the first key found; there may be more matching keys, however.
+  int i = indexOfValue(value);
+  if (i<0) return Long.MIN_VALUE;
+  return table[i];
 }
 /**
  * Fills all keys contained in the receiver into the specified list.
@@ -297,16 +297,16 @@
  * @param list the list to be filled, can have any size.
  */
 public void keys(LongArrayList list) {
-	list.setSize(distinct);
-	long[] elements = list.elements();
-	
-	long[] tab = table;
-	byte[] stat = state;
-	
-	int j=0;
-	for (int i = tab.length ; i-- > 0 ;) {
-		if (stat[i]==FULL) elements[j++]=tab[i];
-	}
+  list.setSize(distinct);
+  long[] elements = list.elements();
+  
+  long[] tab = table;
+  byte[] stat = state;
+  
+  int j=0;
+  for (int i = tab.length ; i-- > 0 ;) {
+    if (stat[i]==FULL) elements[j++]=tab[i];
+  }
 }
 /**
 Fills all pairs satisfying a given condition into the specified lists.
@@ -318,7 +318,7 @@
 <br>
 <pre>
 LongObjectProcedure condition = new LongObjectProcedure() { // match even keys only
-	public boolean apply(long key, Object value) { return key%2==0; }
+  public boolean apply(long key, Object value) { return key%2==0; }
 }
 keys = (8,7,6), values = (1,2,2) --> keyList = (6,8), valueList = (2,1)</tt>
 </pre>
@@ -328,15 +328,15 @@
 @param valueList the list to be filled with values, can have any size.
 */
 public void pairsMatching(final LongObjectProcedure condition, final LongArrayList keyList, final ObjectArrayList valueList) {
-	keyList.clear();
-	valueList.clear();
-	
-	for (int i = table.length ; i-- > 0 ;) {
-		if (state[i]==FULL && condition.apply(table[i],values[i])) {
-			keyList.add(table[i]);
-			valueList.add(values[i]);
-		}
-	}
+  keyList.clear();
+  valueList.clear();
+  
+  for (int i = table.length ; i-- > 0 ;) {
+    if (state[i]==FULL && condition.apply(table[i],values[i])) {
+      keyList.add(table[i]);
+      valueList.add(values[i]);
+    }
+  }
 }
 /**
  * Associates the given key with the given value.
@@ -348,31 +348,31 @@
  *         <tt>false</tt> if the receiver did already contain such a key - the new value has now replaced the formerly associated value.
  */
 public boolean put(long key, Object value) {
-	int i = indexOfInsertion(key);	
-	if (i<0) { //already contained
-		i = -i -1;
-		this.values[i]=value;
-		return false;
-	}
+  int i = indexOfInsertion(key);  
+  if (i<0) { //already contained
+    i = -i -1;
+    this.values[i]=value;
+    return false;
+  }
 
-	if (this.distinct > this.highWaterMark) {
-		int newCapacity = chooseGrowCapacity(this.distinct+1,this.minLoadFactor, this.maxLoadFactor);
-		rehash(newCapacity);
-		return put(key, value);
-	}
+  if (this.distinct > this.highWaterMark) {
+    int newCapacity = chooseGrowCapacity(this.distinct+1,this.minLoadFactor, this.maxLoadFactor);
+    rehash(newCapacity);
+    return put(key, value);
+  }
 
-	this.table[i]=key;
-	this.values[i]=value;
-	if (this.state[i]==FREE) this.freeEntries--;
-	this.state[i]=FULL;
-	this.distinct++;
+  this.table[i]=key;
+  this.values[i]=value;
+  if (this.state[i]==FREE) this.freeEntries--;
+  this.state[i]=FULL;
+  this.distinct++;
 
-	if (this.freeEntries < 1) { //delta
-		int newCapacity = chooseGrowCapacity(this.distinct+1,this.minLoadFactor, this.maxLoadFactor);
-		rehash(newCapacity);
-	}
+  if (this.freeEntries < 1) { //delta
+    int newCapacity = chooseGrowCapacity(this.distinct+1,this.minLoadFactor, this.maxLoadFactor);
+    rehash(newCapacity);
+  }
 
-	return true;
+  return true;
 }
 /**
  * Rehashes the contents of the receiver into a new table
@@ -381,34 +381,34 @@
  * number of keys in the receiver exceeds the high water mark or falls below the low water mark.
  */
 protected void rehash(int newCapacity) {
-	int oldCapacity = table.length;
-	//if (oldCapacity == newCapacity) return;
-	
-	long oldTable[] = table;
-	Object oldValues[] = values;
-	byte oldState[] = state;
+  int oldCapacity = table.length;
+  //if (oldCapacity == newCapacity) return;
+  
+  long oldTable[] = table;
+  Object oldValues[] = values;
+  byte oldState[] = state;
 
-	long newTable[] = new long[newCapacity];
-	Object newValues[] = new Object[newCapacity];
-	byte newState[] = new byte[newCapacity];
+  long newTable[] = new long[newCapacity];
+  Object newValues[] = new Object[newCapacity];
+  byte newState[] = new byte[newCapacity];
 
-	this.lowWaterMark  = chooseLowWaterMark(newCapacity,this.minLoadFactor);
-	this.highWaterMark = chooseHighWaterMark(newCapacity,this.maxLoadFactor);
+  this.lowWaterMark  = chooseLowWaterMark(newCapacity,this.minLoadFactor);
+  this.highWaterMark = chooseHighWaterMark(newCapacity,this.maxLoadFactor);
 
-	this.table = newTable;
-	this.values = newValues;
-	this.state = newState;
-	this.freeEntries = newCapacity-this.distinct; // delta
-	
-	for (int i = oldCapacity ; i-- > 0 ;) {
-		if (oldState[i]==FULL) {
-			long element = oldTable[i];
-			int index = indexOfInsertion(element);
-			newTable[index]=element;
-			newValues[index]=oldValues[i];
-			newState[index]=FULL;
-		}
-	}
+  this.table = newTable;
+  this.values = newValues;
+  this.state = newState;
+  this.freeEntries = newCapacity-this.distinct; // delta
+  
+  for (int i = oldCapacity ; i-- > 0 ;) {
+    if (oldState[i]==FULL) {
+      long element = oldTable[i];
+      int index = indexOfInsertion(element);
+      newTable[index]=element;
+      newValues[index]=oldValues[i];
+      newState[index]=FULL;
+    }
+  }
 }
 /**
  * Removes the given key with its associated element from the receiver, if present.
@@ -417,19 +417,19 @@
  * @return <tt>true</tt> if the receiver contained the specified key, <tt>false</tt> otherwise.
  */
 public boolean removeKey(long key) {
-	int i = indexOfKey(key);
-	if (i<0) return false; // key not contained
+  int i = indexOfKey(key);
+  if (i<0) return false; // key not contained
 
-	this.state[i]=REMOVED;
-	this.values[i]=null; // delta
-	this.distinct--;
+  this.state[i]=REMOVED;
+  this.values[i]=null; // delta
+  this.distinct--;
 
-	if (this.distinct < this.lowWaterMark) {
-		int newCapacity = chooseShrinkCapacity(this.distinct,this.minLoadFactor, this.maxLoadFactor);
-		rehash(newCapacity);
-	}
-	
-	return true;	
+  if (this.distinct < this.lowWaterMark) {
+    int newCapacity = chooseShrinkCapacity(this.distinct,this.minLoadFactor, this.maxLoadFactor);
+    rehash(newCapacity);
+  }
+  
+  return true;  
 }
 /**
  * Initializes the receiver.
@@ -437,32 +437,32 @@
  * @param      initialCapacity   the initial capacity of the receiver.
  * @param      minLoadFactor        the minLoadFactor of the receiver.
  * @param      maxLoadFactor        the maxLoadFactor of the receiver.
- * @throws	IllegalArgumentException if <tt>initialCapacity < 0 || (minLoadFactor < 0.0 || minLoadFactor >= 1.0) || (maxLoadFactor <= 0.0 || maxLoadFactor >= 1.0) || (minLoadFactor >= maxLoadFactor)</tt>.
+ * @throws  IllegalArgumentException if <tt>initialCapacity < 0 || (minLoadFactor < 0.0 || minLoadFactor >= 1.0) || (maxLoadFactor <= 0.0 || maxLoadFactor >= 1.0) || (minLoadFactor >= maxLoadFactor)</tt>.
  */
 protected void setUp(int initialCapacity, double minLoadFactor, double maxLoadFactor) {
-	int capacity = initialCapacity;
-	super.setUp(capacity, minLoadFactor, maxLoadFactor);
-	capacity = nextPrime(capacity);
-	if (capacity==0) capacity=1; // open addressing needs at least one FREE slot at any time.
-	
-	this.table = new long[capacity];
-	this.values = new Object[capacity];
-	this.state = new byte[capacity];
+  int capacity = initialCapacity;
+  super.setUp(capacity, minLoadFactor, maxLoadFactor);
+  capacity = nextPrime(capacity);
+  if (capacity==0) capacity=1; // open addressing needs at least one FREE slot at any time.
+  
+  this.table = new long[capacity];
+  this.values = new Object[capacity];
+  this.state = new byte[capacity];
 
-	// memory will be exhausted long before this pathological case happens, anyway.
-	this.minLoadFactor = minLoadFactor;
-	if (capacity == PrimeFinder.largestPrime) this.maxLoadFactor = 1.0;
-	else this.maxLoadFactor = maxLoadFactor;
+  // memory will be exhausted long before this pathological case happens, anyway.
+  this.minLoadFactor = minLoadFactor;
+  if (capacity == PrimeFinder.largestPrime) this.maxLoadFactor = 1.0;
+  else this.maxLoadFactor = maxLoadFactor;
 
-	this.distinct = 0;
-	this.freeEntries = capacity; // delta
-	
-	// lowWaterMark will be established upon first expansion.
-	// establishing it now (upon instance construction) would immediately make the table shrink upon first put(...).
-	// After all the idea of an "initialCapacity" implies violating lowWaterMarks when an object is young.
-	// See ensureCapacity(...)
-	this.lowWaterMark = 0; 
-	this.highWaterMark = chooseHighWaterMark(capacity, this.maxLoadFactor);
+  this.distinct = 0;
+  this.freeEntries = capacity; // delta
+  
+  // lowWaterMark will be established upon first expansion.
+  // establishing it now (upon instance construction) would immediately make the table shrink upon first put(...).
+  // After all the idea of an "initialCapacity" implies violating lowWaterMarks when an object is young.
+  // See ensureCapacity(...)
+  this.lowWaterMark = 0; 
+  this.highWaterMark = chooseHighWaterMark(capacity, this.maxLoadFactor);
 }
 /**
  * Trims the capacity of the receiver to be the receiver's current 
@@ -470,12 +470,12 @@
  * storage of the receiver.
  */
 public void trimToSize() {
-	// * 1.2 because open addressing's performance exponentially degrades beyond that point
-	// so that even rehashing the table can take very long
-	int newCapacity = nextPrime((int)(1 + 1.2*size()));
-	if (table.length > newCapacity) {
-		rehash(newCapacity);
-	}
+  // * 1.2 because open addressing's performance exponentially degrades beyond that point
+  // so that even rehashing the table can take very long
+  int newCapacity = nextPrime((int)(1 + 1.2*size()));
+  if (table.length > newCapacity) {
+    rehash(newCapacity);
+  }
 }
 /**
  * Fills all values contained in the receiver into the specified list.
@@ -488,15 +488,15 @@
  * @param list the list to be filled, can have any size.
  */
 public void values(ObjectArrayList list) {
-	list.setSize(distinct);
-	Object[] elements = list.elements();
-	
-	Object[] val = values;
-	byte[] stat = state;
-	
-	int j=0;
-	for (int i = stat.length ; i-- > 0 ;) {
-		if (stat[i]==FULL) elements[j++]=val[i];
-	}
+  list.setSize(distinct);
+  Object[] elements = list.elements();
+  
+  Object[] val = values;
+  byte[] stat = state;
+  
+  int j=0;
+  for (int i = stat.length ; i-- > 0 ;) {
+    if (stat[i]==FULL) elements[j++]=val[i];
+  }
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/map/HashFunctions.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/map/HashFunctions.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/map/HashFunctions.java	(working copy)
@@ -11,8 +11,6 @@
 /**
  * Provides various hash functions.
  *
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 09/24/99
  */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
@@ -29,7 +27,7 @@
  * @return  a hash code value for the specified value. 
  */
 public static int hash(char value) {
-	return (int)value;
+  return (int)value;
 }
 /**
  * Returns a hashcode for the specified value.
@@ -37,11 +35,11 @@
  * @return  a hash code value for the specified value. 
  */
 public static int hash(double value) {
-	long bits = Double.doubleToLongBits(value);
-	return (int)(bits ^ (bits >>> 32));
-	
-	//return (int) Double.doubleToLongBits(value*663608941.737);
-	// this avoids excessive hashCollisions in the case values are of the form (1.0, 2.0, 3.0, ...)
+  long bits = Double.doubleToLongBits(value);
+  return (int)(bits ^ (bits >>> 32));
+  
+  //return (int) Double.doubleToLongBits(value*663608941.737);
+  // this avoids excessive hashCollisions in the case values are of the form (1.0, 2.0, 3.0, ...)
 }
 /**
  * Returns a hashcode for the specified value.
@@ -49,8 +47,8 @@
  * @return  a hash code value for the specified value. 
  */
 public static int hash(float value) {
-	return Float.floatToIntBits(value*663608941.737f);
-	// this avoids excessive hashCollisions in the case values are of the form (1.0, 2.0, 3.0, ...)
+  return Float.floatToIntBits(value*663608941.737f);
+  // this avoids excessive hashCollisions in the case values are of the form (1.0, 2.0, 3.0, ...)
 }
 /**
  * Returns a hashcode for the specified value.
@@ -58,18 +56,18 @@
  * @return  a hash code value for the specified value. 
  */
 public static int hash(int value) {
-	return value;
-	
-	//return value * 0x278DDE6D; // see org.apache.mahout.jet.random.engine.DRand
-	
-	/*
-	value &= 0x7FFFFFFF; // make it >=0
-	int hashCode = 0;
-	do hashCode = 31*hashCode + value%10;
-	while ((value /= 10) > 0);
+  return value;
+  
+  //return value * 0x278DDE6D; // see org.apache.mahout.jet.random.engine.DRand
+  
+  /*
+  value &= 0x7FFFFFFF; // make it >=0
+  int hashCode = 0;
+  do hashCode = 31*hashCode + value%10;
+  while ((value /= 10) > 0);
 
-	return 28629151*hashCode; // spread even further; h*31^5
-	*/
+  return 28629151*hashCode; // spread even further; h*31^5
+  */
 }
 /**
  * Returns a hashcode for the specified value. 
@@ -77,15 +75,15 @@
  * @return  a hash code value for the specified value. 
  */
 public static int hash(long value) {
-	return (int)(value ^ (value >> 32));
-	/* 
-	value &= 0x7FFFFFFFFFFFFFFFL; // make it >=0 (0x7FFFFFFFFFFFFFFFL==Long.MAX_VALUE)
-	int hashCode = 0;
-	do hashCode = 31*hashCode + (int) (value%10);
-	while ((value /= 10) > 0);
+  return (int)(value ^ (value >> 32));
+  /* 
+  value &= 0x7FFFFFFFFFFFFFFFL; // make it >=0 (0x7FFFFFFFFFFFFFFFL==Long.MAX_VALUE)
+  int hashCode = 0;
+  do hashCode = 31*hashCode + (int) (value%10);
+  while ((value /= 10) > 0);
 
-	return 28629151*hashCode; // spread even further; h*31^5
-	*/
+  return 28629151*hashCode; // spread even further; h*31^5
+  */
 }
 /**
  * Returns a hashcode for the specified object.
@@ -93,7 +91,7 @@
  * @return  a hash code value for the specified object. 
  */
 public static int hash(Object object) {
-	return object==null ? 0 : object.hashCode();
+  return object==null ? 0 : object.hashCode();
 }
 /**
  * Returns a hashcode for the specified value.
@@ -101,7 +99,7 @@
  * @return  a hash code value for the specified value. 
  */
 public static int hash(short value) {
-	return (int)value;
+  return (int)value;
 }
 /**
  * Returns a hashcode for the specified value.
@@ -109,6 +107,6 @@
  * @return  a hash code value for the specified value. 
  */
 public static int hash(boolean value) {
-	return value ? 1231 : 1237;
+  return value ? 1231 : 1237;
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/map/package.html
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/map/package.html	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/map/package.html	(working copy)
@@ -88,17 +88,17 @@
   <li><b>Open</b> uses extendible open addressing with double hashing.
 </ul>
 <p>Class naming follows the schema <tt>&lt;Implementation&gt;&lt;KeyType&gt;&lt;ValueType&gt;HashMap</tt>.
-  For example, a {@link cern.colt.map.OpenIntDoubleHashMap} holds <tt>(int-->double)</tt>
-  associations and is implemented with open addressing. A {@link cern.colt.map.OpenIntObjectHashMap}
+  For example, a {@link org.apache.mahout.matrix.map.OpenIntDoubleHashMap} holds <tt>(int-->double)</tt>
+  associations and is implemented with open addressing. A {@link org.apache.mahout.matrix.map.OpenIntObjectHashMap}
   holds <tt>(int-->Object)</tt> associations and is implemented with open addressing.
 </p>
 
 <p>The classes for maps of a given (key,value) type are derived from a common
   abstract base class tagged <tt>Abstract&lt;KeyType&gt;&lt;ValueType&gt;</tt><tt>Map</tt>.
   For example, all maps operating on <tt>(int-->double)</tt> associations are
-  derived from {@link cern.colt.map.AbstractIntDoubleMap}, which in turn is derived
+  derived from {@link org.apache.mahout.matrix.map.AbstractIntDoubleMap}, which in turn is derived
   from an abstract base class tying together all maps regardless of assocation
-  type, {@link cern.colt.map.AbstractMap}. The abstract base classes provide skeleton
+  type, {@link org.apache.mahout.matrix.map.AbstractMap}. The abstract base classes provide skeleton
   implementations for all but few methods. Experimental layouts (such as chaining,
   open addressing, extensible hashing, red-black-trees, etc.) can easily be implemented
   and inherit a rich set of functionality. Have a look at the javadoc <a href="package-tree.html">tree
Index: matrix/src/main/java/org/apache/mahout/matrix/map/QuickOpenIntIntHashMap.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/map/QuickOpenIntIntHashMap.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/map/QuickOpenIntIntHashMap.java	(working copy)
@@ -19,15 +19,15 @@
  
 @author wolfgang.hoschek@cern.ch
 @version 1.0, 09/24/99
-@see	    java.util.HashMap
+@see      java.util.HashMap
 */
 class QuickOpenIntIntHashMap extends OpenIntIntHashMap {
-	public int totalProbesSaved = 0; // benchmark only
+  public int totalProbesSaved = 0; // benchmark only
 /**
  * Constructs an empty map with default capacity and default load factors.
  */
 public QuickOpenIntIntHashMap() {
-	this(defaultCapacity);
+  this(defaultCapacity);
 }
 /**
  * Constructs an empty map with the specified initial capacity and default load factors.
@@ -37,7 +37,7 @@
  *             than zero.
  */
 public QuickOpenIntIntHashMap(int initialCapacity) {
-	this(initialCapacity, defaultMinLoadFactor, defaultMaxLoadFactor);
+  this(initialCapacity, defaultMinLoadFactor, defaultMaxLoadFactor);
 }
 /**
  * Constructs an empty map with
@@ -46,10 +46,10 @@
  * @param      initialCapacity   the initial capacity.
  * @param      minLoadFactor        the minimum load factor.
  * @param      maxLoadFactor        the maximum load factor.
- * @throws	IllegalArgumentException if <tt>initialCapacity < 0 || (minLoadFactor < 0.0 || minLoadFactor >= 1.0) || (maxLoadFactor <= 0.0 || maxLoadFactor >= 1.0) || (minLoadFactor >= maxLoadFactor)</tt>.
+ * @throws  IllegalArgumentException if <tt>initialCapacity < 0 || (minLoadFactor < 0.0 || minLoadFactor >= 1.0) || (maxLoadFactor <= 0.0 || maxLoadFactor >= 1.0) || (minLoadFactor >= maxLoadFactor)</tt>.
  */
 public QuickOpenIntIntHashMap(int initialCapacity, double minLoadFactor, double maxLoadFactor) {
-	setUp(initialCapacity,minLoadFactor,maxLoadFactor);
+  setUp(initialCapacity,minLoadFactor,maxLoadFactor);
 }
 /**
  * Associates the given key with the given value.
@@ -61,109 +61,109 @@
  *         <tt>false</tt> if the receiver did already contain such a key - the new value has now replaced the formerly associated value.
  */
 public boolean put(int key, int value) {
-	/* 
-	   This is open addressing with double hashing, using "Brent's variation".
-	   Brent's variation slows insertions a bit down (not much) but reduces probes (collisions) for successful searches, in particular for large load factors.
-	   (It does not improve unsuccessful searches.)
-	   See D. Knuth, Searching and Sorting, 3rd ed., p.533-545
-	
-	   h1(key) = hash % M
-	   h2(key) = decrement = Max(1, hash/M % M)
-	   M is prime = capacity = table.length
-	   probing positions are table[(h1-j*h2) % M] for j=0,1,...
-	   (M and h2 could also be chosen differently, but h2 is required to be relative prime to M.)
-	*/
-	
-	int key0;
-	final int tab[] = table;
-	final byte stat[] = state;
-	final int length = tab.length;
+  /* 
+     This is open addressing with double hashing, using "Brent's variation".
+     Brent's variation slows insertions a bit down (not much) but reduces probes (collisions) for successful searches, in particular for large load factors.
+     (It does not improve unsuccessful searches.)
+     See D. Knuth, Searching and Sorting, 3rd ed., p.533-545
+  
+     h1(key) = hash % M
+     h2(key) = decrement = Max(1, hash/M % M)
+     M is prime = capacity = table.length
+     probing positions are table[(h1-j*h2) % M] for j=0,1,...
+     (M and h2 could also be chosen differently, but h2 is required to be relative prime to M.)
+  */
+  
+  int key0;
+  final int tab[] = table;
+  final byte stat[] = state;
+  final int length = tab.length;
 
-	int hash = HashFunctions.hash(key) & 0x7FFFFFFF;
-	int i = hash % length;
-	int decrement = (hash / length) % length;
-	if (decrement == 0) decrement = 1;
-	//System.out.println("insert search for (key,value)=("+key+","+value+") at i="+i+", dec="+decrement);
+  int hash = HashFunctions.hash(key) & 0x7FFFFFFF;
+  int i = hash % length;
+  int decrement = (hash / length) % length;
+  if (decrement == 0) decrement = 1;
+  //System.out.println("insert search for (key,value)=("+key+","+value+") at i="+i+", dec="+decrement);
 
-	// stop if we find a removed or free slot, or if we find the key itself
-	// do NOT skip over removed slots (yes, open addressing is like that...)
-	//int comp = comparisons;
-	int t = 0;  // the number of probes
-	int p0 = i; // the first position to probe
-	while (stat[i] == FULL && tab[i] != key) {
-		t++;
-		i -= decrement;
-		//hashCollisions++;
-		if (i<0) i+=length;		
-	}
-	//if (comparisons-comp>0) System.out.println("probed "+(comparisons-comp)+" slots.");
-	if (stat[i] == FULL) {
-		// key already contained at slot i.
-		this.values[i]=value;
-		return false;
-	}
-	// not already contained, should be inserted at slot i.
-	
-	if (this.distinct > this.highWaterMark) {
-		int newCapacity = chooseGrowCapacity(this.distinct+1,this.minLoadFactor, this.maxLoadFactor);
-		
-		//System.out.print("grow rehashing ");
-		//System.out.println("at distinct="+distinct+", capacity="+table.length+" to newCapacity="+newCapacity+" ...");
-		
-		rehash(newCapacity);
-		return put(key, value);
-	}
+  // stop if we find a removed or free slot, or if we find the key itself
+  // do NOT skip over removed slots (yes, open addressing is like that...)
+  //int comp = comparisons;
+  int t = 0;  // the number of probes
+  int p0 = i; // the first position to probe
+  while (stat[i] == FULL && tab[i] != key) {
+    t++;
+    i -= decrement;
+    //hashCollisions++;
+    if (i<0) i+=length;    
+  }
+  //if (comparisons-comp>0) System.out.println("probed "+(comparisons-comp)+" slots.");
+  if (stat[i] == FULL) {
+    // key already contained at slot i.
+    this.values[i]=value;
+    return false;
+  }
+  // not already contained, should be inserted at slot i.
+  
+  if (this.distinct > this.highWaterMark) {
+    int newCapacity = chooseGrowCapacity(this.distinct+1,this.minLoadFactor, this.maxLoadFactor);
+    
+    //System.out.print("grow rehashing ");
+    //System.out.println("at distinct="+distinct+", capacity="+table.length+" to newCapacity="+newCapacity+" ...");
+    
+    rehash(newCapacity);
+    return put(key, value);
+  }
 
-	/*
-	Brent's variation does a local reorganization to reduce probes. It essentially means:
-	We test whether it is possible to move the association we probed first (table[p0]) out of the way.
-	If this is possible, it will reduce probes for the key to be inserted, since it takes its place; it gets hit earlier.
-	However, future probes for the key that we move out of the way will increase.
-	Thus we only move it out of the way, if we have a net gain, that is, if we save more probes than we loose.
-	For the first probe we safe more than we loose if the number of probes we needed was >=2 (t>=2).
-	If the first probe cannot be moved out of the way, we try the next probe (p1).
-	Now we safe more than we loose if t>=3.
-	We repeat this until we find that we cannot gain or that we can indeed move p(x) out of the way.
+  /*
+  Brent's variation does a local reorganization to reduce probes. It essentially means:
+  We test whether it is possible to move the association we probed first (table[p0]) out of the way.
+  If this is possible, it will reduce probes for the key to be inserted, since it takes its place; it gets hit earlier.
+  However, future probes for the key that we move out of the way will increase.
+  Thus we only move it out of the way, if we have a net gain, that is, if we save more probes than we loose.
+  For the first probe we safe more than we loose if the number of probes we needed was >=2 (t>=2).
+  If the first probe cannot be moved out of the way, we try the next probe (p1).
+  Now we safe more than we loose if t>=3.
+  We repeat this until we find that we cannot gain or that we can indeed move p(x) out of the way.
 
-	Note: Under the great majority of insertions t<=1, so the loop is entered very infrequently.
-	*/
-	while (t>1) {
-		//System.out.println("t="+t);
-		key0 = tab[p0];
-		hash = HashFunctions.hash(key0) & 0x7FFFFFFF;
-		decrement = (hash / length) % length;
-		if (decrement == 0) decrement = 1;
-		int pc = p0-decrement; // pc = (p0-j*decrement) % M, j=1,2,..
-		if (pc<0) pc += length;
-		
-		if (stat[pc] != FREE) { // not a free slot, continue searching for free slot to move to, or break.
-			p0 = pc;
-			t--;
-		}
-		else { // free or removed slot found, now move...
-			//System.out.println("copying p0="+p0+" to pc="+pc+", (key,val)=("+tab[p0]+","+values[p0]+"), saving "+(t-1)+" probes.");
-			this.totalProbesSaved += (t-1);
-			tab[pc] = key0;
-			stat[pc] = FULL;
-			values[pc] = values[p0];
-			i = p0; // prepare to insert: table[p0]=key
-			t = 0; // break loop 
-		}
-	}
+  Note: Under the great majority of insertions t<=1, so the loop is entered very infrequently.
+  */
+  while (t>1) {
+    //System.out.println("t="+t);
+    key0 = tab[p0];
+    hash = HashFunctions.hash(key0) & 0x7FFFFFFF;
+    decrement = (hash / length) % length;
+    if (decrement == 0) decrement = 1;
+    int pc = p0-decrement; // pc = (p0-j*decrement) % M, j=1,2,..
+    if (pc<0) pc += length;
+    
+    if (stat[pc] != FREE) { // not a free slot, continue searching for free slot to move to, or break.
+      p0 = pc;
+      t--;
+    }
+    else { // free or removed slot found, now move...
+      //System.out.println("copying p0="+p0+" to pc="+pc+", (key,val)=("+tab[p0]+","+values[p0]+"), saving "+(t-1)+" probes.");
+      this.totalProbesSaved += (t-1);
+      tab[pc] = key0;
+      stat[pc] = FULL;
+      values[pc] = values[p0];
+      i = p0; // prepare to insert: table[p0]=key
+      t = 0; // break loop 
+    }
+  }
 
-	//System.out.println("inserting at i="+i);
-	this.table[i]=key;
-	this.values[i]=value;
-	if (this.state[i]==FREE) this.freeEntries--;
-	this.state[i]=FULL;
-	this.distinct++;
+  //System.out.println("inserting at i="+i);
+  this.table[i]=key;
+  this.values[i]=value;
+  if (this.state[i]==FREE) this.freeEntries--;
+  this.state[i]=FULL;
+  this.distinct++;
 
-	if (this.freeEntries < 1) { //delta
-		int newCapacity = chooseGrowCapacity(this.distinct+1,this.minLoadFactor, this.maxLoadFactor);
-		rehash(newCapacity);
-	}
+  if (this.freeEntries < 1) { //delta
+    int newCapacity = chooseGrowCapacity(this.distinct+1,this.minLoadFactor, this.maxLoadFactor);
+    rehash(newCapacity);
+  }
 
-	return true;
+  return true;
 }
 /**
  * Rehashes the contents of the receiver into a new table
@@ -172,39 +172,39 @@
  * number of keys in the receiver exceeds the high water mark or falls below the low water mark.
  */
 protected void rehash(int newCapacity) {
-	int oldCapacity = table.length;
-	//if (oldCapacity == newCapacity) return;
-	
-	int oldTable[] = table;
-	int oldValues[] = values;
-	byte oldState[] = state;
+  int oldCapacity = table.length;
+  //if (oldCapacity == newCapacity) return;
+  
+  int oldTable[] = table;
+  int oldValues[] = values;
+  byte oldState[] = state;
 
-	int newTable[] = new int[newCapacity];
-	int newValues[] = new int[newCapacity];
-	byte newState[] = new byte[newCapacity];
+  int newTable[] = new int[newCapacity];
+  int newValues[] = new int[newCapacity];
+  byte newState[] = new byte[newCapacity];
 
-	this.lowWaterMark  = chooseLowWaterMark(newCapacity,this.minLoadFactor);
-	this.highWaterMark = chooseHighWaterMark(newCapacity,this.maxLoadFactor);
+  this.lowWaterMark  = chooseLowWaterMark(newCapacity,this.minLoadFactor);
+  this.highWaterMark = chooseHighWaterMark(newCapacity,this.maxLoadFactor);
 
-	this.table = newTable;
-	this.values = newValues;
-	this.state = newState;
-	this.freeEntries = newCapacity-this.distinct; // delta
+  this.table = newTable;
+  this.values = newValues;
+  this.state = newState;
+  this.freeEntries = newCapacity-this.distinct; // delta
 
-	int tmp = this.distinct;
-	this.distinct = Integer.MIN_VALUE; // switch of watermarks
-	for (int i = oldCapacity ; i-- > 0 ;) {
-		if (oldState[i]==FULL) {
-			put(oldTable[i], oldValues[i]);
-			/*
-			int element = oldTable[i];
-			int index = indexOfInsertion(element);
-			newTable[index]=element;
-			newValues[index]=oldValues[i];
-			newState[index]=FULL;
-			*/
-		}
-	}
-	this.distinct = tmp;
+  int tmp = this.distinct;
+  this.distinct = Integer.MIN_VALUE; // switch of watermarks
+  for (int i = oldCapacity ; i-- > 0 ;) {
+    if (oldState[i]==FULL) {
+      put(oldTable[i], oldValues[i]);
+      /*
+      int element = oldTable[i];
+      int index = indexOfInsertion(element);
+      newTable[index]=element;
+      newValues[index]=oldValues[i];
+      newState[index]=FULL;
+      */
+    }
+  }
+  this.distinct = tmp;
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/map/AbstractIntIntMap.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/map/AbstractIntIntMap.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/map/AbstractIntIntMap.java	(working copy)
@@ -22,14 +22,14 @@
 
 @author wolfgang.hoschek@cern.ch
 @version 1.0, 09/24/99
-@see	    java.util.HashMap
+@see      java.util.HashMap
 */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
  */
 @Deprecated
 public abstract class AbstractIntIntMap extends AbstractMap {
-	//public static int hashCollisions = 0; // for debug only
+  //public static int hashCollisions = 0; // for debug only
 /**
  * Makes this class non instantiable, but still let's others inherit from it.
  */
@@ -40,13 +40,13 @@
  * @return <tt>true</tt> if the receiver contains the specified key.
  */
 public boolean containsKey(final int key) {
-	return ! forEachKey(
-		new IntProcedure() {
-			public boolean apply(int iterKey) {
-				return (key != iterKey);
-			}
-		}
-	);
+  return ! forEachKey(
+    new IntProcedure() {
+      public boolean apply(int iterKey) {
+        return (key != iterKey);
+      }
+    }
+  );
 }
 /**
  * Returns <tt>true</tt> if the receiver contains the specified value.
@@ -54,13 +54,13 @@
  * @return <tt>true</tt> if the receiver contains the specified value.
  */
 public boolean containsValue(final int value) {
-	return ! forEachPair(
-		new IntIntProcedure() {
-			public boolean apply(int iterKey, int iterValue) {
-				return (value != iterValue);
-			}
-		}
-	);
+  return ! forEachPair(
+    new IntIntProcedure() {
+      public boolean apply(int iterKey, int iterValue) {
+        return (value != iterValue);
+      }
+    }
+  );
 }
 /**
  * Returns a deep copy of the receiver; uses <code>clone()</code> and casts the result.
@@ -68,7 +68,7 @@
  * @return  a deep copy of the receiver.
  */
 public AbstractIntIntMap copy() {
-	return (AbstractIntIntMap) clone();
+  return (AbstractIntIntMap) clone();
 }
 /**
  * Compares the specified object with this map for equality.  Returns
@@ -77,20 +77,20 @@
  * <tt>m2</tt> represent the same mappings iff
  * <pre>
  * m1.forEachPair(
- *		new IntIntProcedure() {
- *			public boolean apply(int key, int value) {
- *				return m2.containsKey(key) && m2.get(key) == value;
- *			}
- *		}
- *	)
+ *    new IntIntProcedure() {
+ *      public boolean apply(int key, int value) {
+ *        return m2.containsKey(key) && m2.get(key) == value;
+ *      }
+ *    }
+ *  )
  * &&
  * m2.forEachPair(
- *		new IntIntProcedure() {
- *			public boolean apply(int key, int value) {
- *				return m1.containsKey(key) && m1.get(key) == value;
- *			}
- *		}
- *	);
+ *    new IntIntProcedure() {
+ *      public boolean apply(int key, int value) {
+ *        return m1.containsKey(key) && m1.get(key) == value;
+ *      }
+ *    }
+ *  );
  * </pre>
  *
  * This implementation first checks if the specified object is this map;
@@ -102,28 +102,28 @@
  * @return <tt>true</tt> if the specified object is equal to this map.
  */
 public boolean equals(Object obj) {
-	if (obj == this) return true;
+  if (obj == this) return true;
 
-	if (!(obj instanceof AbstractIntIntMap)) return false;
-	final AbstractIntIntMap other = (AbstractIntIntMap) obj;
-	if (other.size() != size()) return false;
+  if (!(obj instanceof AbstractIntIntMap)) return false;
+  final AbstractIntIntMap other = (AbstractIntIntMap) obj;
+  if (other.size() != size()) return false;
 
-	return 
-		forEachPair(
-			new IntIntProcedure() {
-				public boolean apply(int key, int value) {
-					return other.containsKey(key) && other.get(key) == value;
-				}
-			}
-		)
-		&&
-		other.forEachPair(
-			new IntIntProcedure() {
-				public boolean apply(int key, int value) {
-					return containsKey(key) && get(key) == value;
-				}
-			}
-		);
+  return 
+    forEachPair(
+      new IntIntProcedure() {
+        public boolean apply(int key, int value) {
+          return other.containsKey(key) && other.get(key) == value;
+        }
+      }
+    )
+    &&
+    other.forEachPair(
+      new IntIntProcedure() {
+        public boolean apply(int key, int value) {
+          return containsKey(key) && get(key) == value;
+        }
+      }
+    );
 }
 /**
  * Applies a procedure to each key of the receiver, if any.
@@ -144,13 +144,13 @@
  * @return <tt>false</tt> if the procedure stopped before all keys where iterated over, <tt>true</tt> otherwise. 
  */
 public boolean forEachPair(final IntIntProcedure procedure) {
-	return forEachKey(
-		new IntProcedure() {
-			public boolean apply(int key) {
-				return procedure.apply(key,get(key));
-			}
-		}
-	);
+  return forEachKey(
+    new IntProcedure() {
+      public boolean apply(int key) {
+        return procedure.apply(key,get(key));
+      }
+    }
+  );
 }
 /**
  * Returns the value associated with the specified key.
@@ -167,21 +167,21 @@
  *
  * @param value the value to search for.
  * @return the first key for which holds <tt>get(key) == value</tt>; 
- *		   returns <tt>Integer.MIN_VALUE</tt> if no such key exists.
+ *       returns <tt>Integer.MIN_VALUE</tt> if no such key exists.
  */
 public int keyOf(final int value) {
-	final int[] foundKey = new int[1];
-	boolean notFound = forEachPair(
-		new IntIntProcedure() {
-			public boolean apply(int iterKey, int iterValue) {
-				boolean found = value == iterValue;
-				if (found) foundKey[0] = iterKey;
-				return !found;
-			}
-		}
-	);
-	if (notFound) return Integer.MIN_VALUE;
-	return foundKey[0];
+  final int[] foundKey = new int[1];
+  boolean notFound = forEachPair(
+    new IntIntProcedure() {
+      public boolean apply(int iterKey, int iterValue) {
+        boolean found = value == iterValue;
+        if (found) foundKey[0] = iterKey;
+        return !found;
+      }
+    }
+  );
+  if (notFound) return Integer.MIN_VALUE;
+  return foundKey[0];
 }
 /**
  * Returns a list filled with all keys contained in the receiver.
@@ -193,9 +193,9 @@
  * @return the keys.
  */
 public IntArrayList keys() {
-	IntArrayList list = new IntArrayList(size());
-	keys(list);
-	return list;
+  IntArrayList list = new IntArrayList(size());
+  keys(list);
+  return list;
 }
 /**
  * Fills all keys contained in the receiver into the specified list.
@@ -208,15 +208,15 @@
  * @param list the list to be filled, can have any size.
  */
 public void keys(final IntArrayList list) {
-	list.clear();
-	forEachKey(
-		new IntProcedure() {
-			public boolean apply(int key) {
-				list.add(key);
-				return true;
-			}
-		}
-	);
+  list.clear();
+  forEachKey(
+    new IntProcedure() {
+      public boolean apply(int key) {
+        list.add(key);
+        return true;
+      }
+    }
+  );
 }
 /**
  * Fills all keys <i>sorted ascending by their associated value</i> into the specified list.
@@ -232,7 +232,7 @@
  * @param keyList the list to be filled, can have any size.
  */
 public void keysSortedByValue(final IntArrayList keyList) {
-	pairsSortedByValue(keyList, new IntArrayList(size()));
+  pairsSortedByValue(keyList, new IntArrayList(size()));
 }
 /**
 Fills all pairs satisfying a given condition into the specified lists.
@@ -244,7 +244,7 @@
 <br>
 <pre>
 IntIntProcedure condition = new IntIntProcedure() { // match even keys only
-	public boolean apply(int key, int value) { return key%2==0; }
+  public boolean apply(int key, int value) { return key%2==0; }
 }
 keys = (8,7,6), values = (1,2,2) --> keyList = (6,8), valueList = (2,1)</tt>
 </pre>
@@ -254,20 +254,20 @@
 @param valueList the list to be filled with values, can have any size.
 */
 public void pairsMatching(final IntIntProcedure condition, final IntArrayList keyList, final IntArrayList valueList) {
-	keyList.clear();
-	valueList.clear();
-	
-	forEachPair(
-		new IntIntProcedure() {
-			public boolean apply(int key, int value) {
-				if (condition.apply(key,value)) {
-					keyList.add(key);
-					valueList.add(value);
-				}
-				return true;
-			}
-		}
-	);
+  keyList.clear();
+  valueList.clear();
+  
+  forEachPair(
+    new IntIntProcedure() {
+      public boolean apply(int key, int value) {
+        if (condition.apply(key,value)) {
+          keyList.add(key);
+          valueList.add(value);
+        }
+        return true;
+      }
+    }
+  );
 }
 /**
  * Fills all keys and values <i>sorted ascending by key</i> into the specified lists.
@@ -282,12 +282,12 @@
  * @param valueList the list to be filled with values, can have any size.
  */
 public void pairsSortedByKey(final IntArrayList keyList, final IntArrayList valueList) {
-	keys(keyList);
-	keyList.sort();
-	valueList.setSize(keyList.size());
-	for (int i=keyList.size(); --i >= 0; ) {
-		valueList.setQuick(i,get(keyList.getQuick(i)));
-	}
+  keys(keyList);
+  keyList.sort();
+  valueList.setSize(keyList.size());
+  for (int i=keyList.size(); --i >= 0; ) {
+    valueList.setQuick(i,get(keyList.getQuick(i)));
+  }
 }
 /**
  * Fills all keys and values <i>sorted ascending by value</i> into the specified lists.
@@ -304,26 +304,26 @@
  * @param valueList the list to be filled with values, can have any size.
  */
 public void pairsSortedByValue(final IntArrayList keyList, final IntArrayList valueList) {
-	keys(keyList);
-	values(valueList);
-	
-	final int[] k = keyList.elements();
-	final int[] v = valueList.elements();
-	org.apache.mahout.matrix.Swapper swapper = new org.apache.mahout.matrix.Swapper() {
-		public void swap(int a, int b) {
-			int t2;	int t1;
-			t1 = v[a]; v[a] = v[b]; v[b] = t1;
-			t2 = k[a]; k[a] = k[b];	k[b] = t2;
-		}
-	}; 
+  keys(keyList);
+  values(valueList);
+  
+  final int[] k = keyList.elements();
+  final int[] v = valueList.elements();
+  org.apache.mahout.matrix.Swapper swapper = new org.apache.mahout.matrix.Swapper() {
+    public void swap(int a, int b) {
+      int t2;  int t1;
+      t1 = v[a]; v[a] = v[b]; v[b] = t1;
+      t2 = k[a]; k[a] = k[b];  k[b] = t2;
+    }
+  }; 
 
-	org.apache.mahout.matrix.function.IntComparator comp = new org.apache.mahout.matrix.function.IntComparator() {
-		public int compare(int a, int b) {
-			return v[a]<v[b] ? -1 : v[a]>v[b] ? 1 : (k[a]<k[b] ? -1 : (k[a]==k[b] ? 0 : 1));
-		}
-	};
+  org.apache.mahout.matrix.function.IntComparator comp = new org.apache.mahout.matrix.function.IntComparator() {
+    public int compare(int a, int b) {
+      return v[a]<v[b] ? -1 : v[a]>v[b] ? 1 : (k[a]<k[b] ? -1 : (k[a]==k[b] ? 0 : 1));
+    }
+  };
 
-	org.apache.mahout.matrix.GenericSorting.quickSort(0,keyList.size(),comp,swapper);
+  org.apache.mahout.matrix.GenericSorting.quickSort(0,keyList.size(),comp,swapper);
 }
 /**
  * Associates the given key with the given value.
@@ -347,42 +347,42 @@
  * the String representation of each key-value pair, sorted ascending by key.
  */
 public String toString() {
-	IntArrayList theKeys = keys();
-	//theKeys.sort(); 
+  IntArrayList theKeys = keys();
+  //theKeys.sort(); 
 
-	StringBuffer buf = new StringBuffer();
-	buf.append("[");
-	int maxIndex = theKeys.size() - 1;
-	for (int i = 0; i <= maxIndex; i++) {
-		int key = theKeys.get(i);
-	    buf.append(String.valueOf(key));
-		buf.append("->");
-	    buf.append(String.valueOf(get(key)));
-		if (i < maxIndex) buf.append(", ");
-	}
-	buf.append("]");
-	return buf.toString();
+  StringBuffer buf = new StringBuffer();
+  buf.append("[");
+  int maxIndex = theKeys.size() - 1;
+  for (int i = 0; i <= maxIndex; i++) {
+    int key = theKeys.get(i);
+      buf.append(String.valueOf(key));
+    buf.append("->");
+      buf.append(String.valueOf(get(key)));
+    if (i < maxIndex) buf.append(", ");
+  }
+  buf.append("]");
+  return buf.toString();
 }
 /**
  * Returns a string representation of the receiver, containing
  * the String representation of each key-value pair, sorted ascending by value.
  */
 public String toStringByValue() {
-	IntArrayList theKeys = new IntArrayList();
-	keysSortedByValue(theKeys);
+  IntArrayList theKeys = new IntArrayList();
+  keysSortedByValue(theKeys);
 
-	StringBuffer buf = new StringBuffer();
-	buf.append("[");
-	int maxIndex = theKeys.size() - 1;
-	for (int i = 0; i <= maxIndex; i++) {
-		int key = theKeys.get(i);
-	    buf.append(String.valueOf(key));
-		buf.append("->");
-	    buf.append(String.valueOf(get(key)));
-		if (i < maxIndex) buf.append(", ");
-	}
-	buf.append("]");
-	return buf.toString();
+  StringBuffer buf = new StringBuffer();
+  buf.append("[");
+  int maxIndex = theKeys.size() - 1;
+  for (int i = 0; i <= maxIndex; i++) {
+    int key = theKeys.get(i);
+      buf.append(String.valueOf(key));
+    buf.append("->");
+      buf.append(String.valueOf(get(key)));
+    if (i < maxIndex) buf.append(", ");
+  }
+  buf.append("]");
+  return buf.toString();
 }
 /**
  * Returns a list filled with all values contained in the receiver.
@@ -394,9 +394,9 @@
  * @return the values.
  */
 public IntArrayList values() {
-	IntArrayList list = new IntArrayList(size());
-	values(list);
-	return list;
+  IntArrayList list = new IntArrayList(size());
+  values(list);
+  return list;
 }
 /**
  * Fills all values contained in the receiver into the specified list.
@@ -409,14 +409,14 @@
  * @param list the list to be filled, can have any size.
  */
 public void values(final IntArrayList list) {
-	list.clear();
-	forEachKey(
-		new IntProcedure() {
-			public boolean apply(int key) {
-				list.add(get(key));
-				return true;
-			}
-		}
-	);
+  list.clear();
+  forEachKey(
+    new IntProcedure() {
+      public boolean apply(int key) {
+        list.add(get(key));
+        return true;
+      }
+    }
+  );
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/map/OpenIntIntHashMap.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/map/OpenIntIntHashMap.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/map/OpenIntIntHashMap.java	(working copy)
@@ -20,47 +20,47 @@
  
 @author wolfgang.hoschek@cern.ch
 @version 1.0, 09/24/99
-@see	    java.util.HashMap
+@see      java.util.HashMap
 */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
  */
 @Deprecated
 public class OpenIntIntHashMap extends org.apache.mahout.matrix.map.AbstractIntIntMap {
-	 /**
-	 * The hash table keys.
-	 * @serial
-	 */
-	protected int table[];
+   /**
+   * The hash table keys.
+   * @serial
+   */
+  protected int table[];
 
-	 /**
-	 * The hash table values.
-	 * @serial
-	 */
-	protected int values[];
+   /**
+   * The hash table values.
+   * @serial
+   */
+  protected int values[];
 
-	/**
-	 * The state of each hash table entry (FREE, FULL, REMOVED).
-	 * @serial
-	 */
-	protected byte state[];
+  /**
+   * The state of each hash table entry (FREE, FULL, REMOVED).
+   * @serial
+   */
+  protected byte state[];
 
-	/**
-	 * The number of table entries in state==FREE.
-	 * @serial
-	 */
-	protected int freeEntries;
+  /**
+   * The number of table entries in state==FREE.
+   * @serial
+   */
+  protected int freeEntries;
 
-	
-	protected static final byte FREE = 0;
-	protected static final byte FULL = 1;
-	protected static final byte REMOVED = 2;
+  
+  protected static final byte FREE = 0;
+  protected static final byte FULL = 1;
+  protected static final byte REMOVED = 2;
 
 /**
  * Constructs an empty map with default capacity and default load factors.
  */
 public OpenIntIntHashMap() {
-	this(defaultCapacity);
+  this(defaultCapacity);
 }
 /**
  * Constructs an empty map with the specified initial capacity and default load factors.
@@ -70,7 +70,7 @@
  *             than zero.
  */
 public OpenIntIntHashMap(int initialCapacity) {
-	this(initialCapacity, defaultMinLoadFactor, defaultMaxLoadFactor);
+  this(initialCapacity, defaultMinLoadFactor, defaultMaxLoadFactor);
 }
 /**
  * Constructs an empty map with
@@ -79,22 +79,22 @@
  * @param      initialCapacity   the initial capacity.
  * @param      minLoadFactor        the minimum load factor.
  * @param      maxLoadFactor        the maximum load factor.
- * @throws	IllegalArgumentException if <tt>initialCapacity < 0 || (minLoadFactor < 0.0 || minLoadFactor >= 1.0) || (maxLoadFactor <= 0.0 || maxLoadFactor >= 1.0) || (minLoadFactor >= maxLoadFactor)</tt>.
+ * @throws  IllegalArgumentException if <tt>initialCapacity < 0 || (minLoadFactor < 0.0 || minLoadFactor >= 1.0) || (maxLoadFactor <= 0.0 || maxLoadFactor >= 1.0) || (minLoadFactor >= maxLoadFactor)</tt>.
  */
 public OpenIntIntHashMap(int initialCapacity, double minLoadFactor, double maxLoadFactor) {
-	setUp(initialCapacity,minLoadFactor,maxLoadFactor);
+  setUp(initialCapacity,minLoadFactor,maxLoadFactor);
 }
 /**
  * Removes all (key,value) associations from the receiver.
  * Implicitly calls <tt>trimToSize()</tt>.
  */
 public void clear() {
-	new ByteArrayList(this.state).fillFromToWith(0, this.state.length-1, FREE);
-   	//new IntArrayList(values).fillFromToWith(0, state.length-1, 0); // delta
+  new ByteArrayList(this.state).fillFromToWith(0, this.state.length-1, FREE);
+     //new IntArrayList(values).fillFromToWith(0, state.length-1, 0); // delta
 
-	this.distinct = 0;
-	this.freeEntries = table.length; // delta
-	trimToSize();
+  this.distinct = 0;
+  this.freeEntries = table.length; // delta
+  trimToSize();
 }
 /**
  * Returns a deep copy of the receiver.
@@ -102,11 +102,11 @@
  * @return  a deep copy of the receiver.
  */
 public Object clone() {
-	OpenIntIntHashMap copy = (OpenIntIntHashMap) super.clone();
-	copy.table = (int[]) copy.table.clone();
-	copy.values = (int[]) copy.values.clone();
-	copy.state = (byte[]) copy.state.clone();
-	return copy;
+  OpenIntIntHashMap copy = (OpenIntIntHashMap) super.clone();
+  copy.table = (int[]) copy.table.clone();
+  copy.values = (int[]) copy.values.clone();
+  copy.state = (byte[]) copy.state.clone();
+  return copy;
 }
 /**
  * Returns <tt>true</tt> if the receiver contains the specified key.
@@ -114,7 +114,7 @@
  * @return <tt>true</tt> if the receiver contains the specified key.
  */
 public boolean containsKey(int key) {
-	return indexOfKey(key) >= 0;
+  return indexOfKey(key) >= 0;
 }
 /**
  * Returns <tt>true</tt> if the receiver contains the specified value.
@@ -122,7 +122,7 @@
  * @return <tt>true</tt> if the receiver contains the specified value.
  */
 public boolean containsValue(int value) {
-	return indexOfValue(value) >= 0;
+  return indexOfValue(value) >= 0;
 }
 /**
  * Ensures that the receiver can hold at least the specified number of associations without needing to allocate new internal memory.
@@ -135,10 +135,10 @@
  * @param   minCapacity   the desired minimum capacity.
  */
 public void ensureCapacity(int minCapacity) {
-	if (table.length < minCapacity) {
-		int newCapacity = nextPrime(minCapacity);
-		rehash(newCapacity);
-	}
+  if (table.length < minCapacity) {
+    int newCapacity = nextPrime(minCapacity);
+    rehash(newCapacity);
+  }
 }
 /**
  * Applies a procedure to each key of the receiver, if any.
@@ -151,10 +151,10 @@
  * @return <tt>false</tt> if the procedure stopped before all keys where iterated over, <tt>true</tt> otherwise. 
  */
 public boolean forEachKey(IntProcedure procedure) {
-	for (int i = table.length ; i-- > 0 ;) {
-		if (state[i]==FULL) if (! procedure.apply(table[i])) return false;
-	}
-	return true;
+  for (int i = table.length ; i-- > 0 ;) {
+    if (state[i]==FULL) if (! procedure.apply(table[i])) return false;
+  }
+  return true;
 }
 /**
  * Applies a procedure to each (key,value) pair of the receiver, if any.
@@ -164,10 +164,10 @@
  * @return <tt>false</tt> if the procedure stopped before all keys where iterated over, <tt>true</tt> otherwise. 
  */
 public boolean forEachPair(final IntIntProcedure procedure) {
-	for (int i = table.length ; i-- > 0 ;) {
-		if (state[i]==FULL) if (! procedure.apply(table[i],values[i])) return false;
-	}
-	return true;
+  for (int i = table.length ; i-- > 0 ;) {
+    if (state[i]==FULL) if (! procedure.apply(table[i],values[i])) return false;
+  }
+  return true;
 }
 /**
  * Returns the value associated with the specified key.
@@ -177,9 +177,9 @@
  * @return the value associated with the specified key; <tt>0</tt> if no such key is present.
  */
 public int get(int key) {
-	int i = indexOfKey(key);
-	if (i<0) return 0; //not contained
-	return values[i];
+  int i = indexOfKey(key);
+  if (i<0) return 0; //not contained
+  return values[i];
 }
 /**
  * @param key the key to be added to the receiver.
@@ -189,87 +189,87 @@
  * If the returned index >= 0, then it is NOT already contained and should be inserted at slot index.
  */
 protected int indexOfInsertion(int key) {
-	//System.out.println("key="+key);
-	final int tab[] = table;
-	final byte stat[] = state;
-	final int length = tab.length;
+  //System.out.println("key="+key);
+  final int tab[] = table;
+  final byte stat[] = state;
+  final int length = tab.length;
 
-	final int hash = HashFunctions.hash(key) & 0x7FFFFFFF;
-	int i = hash % length;
-	int decrement = hash % (length-2); // double hashing, see http://www.eece.unm.edu/faculty/heileman/hash/node4.html
-	//int decrement = (hash / length) % length;
-	if (decrement == 0) decrement = 1;
+  final int hash = HashFunctions.hash(key) & 0x7FFFFFFF;
+  int i = hash % length;
+  int decrement = hash % (length-2); // double hashing, see http://www.eece.unm.edu/faculty/heileman/hash/node4.html
+  //int decrement = (hash / length) % length;
+  if (decrement == 0) decrement = 1;
 
-	// stop if we find a removed or free slot, or if we find the key itself
-	// do NOT skip over removed slots (yes, open addressing is like that...)
-	while (stat[i] == FULL && tab[i] != key) {
-		i -= decrement;
-		//hashCollisions++;
-		if (i<0) i+=length;
-	}
-	
-	if (stat[i] == REMOVED) {
-		// stop if we find a free slot, or if we find the key itself.
-		// do skip over removed slots (yes, open addressing is like that...)
-		// assertion: there is at least one FREE slot.
-		int j = i;
-		while (stat[i] != FREE && (stat[i] == REMOVED || tab[i] != key)) {
-			i -= decrement;
-			//hashCollisions++;
-			if (i<0) i+=length;
-		}
-		if (stat[i] == FREE) i = j;
-	}
-	
-	
-	if (stat[i] == FULL) {
-		// key already contained at slot i.
-		// return a negative number identifying the slot.
-		return -i-1;
-	}
-	// not already contained, should be inserted at slot i.
-	// return a number >= 0 identifying the slot.
-	return i; 
+  // stop if we find a removed or free slot, or if we find the key itself
+  // do NOT skip over removed slots (yes, open addressing is like that...)
+  while (stat[i] == FULL && tab[i] != key) {
+    i -= decrement;
+    //hashCollisions++;
+    if (i<0) i+=length;
+  }
+  
+  if (stat[i] == REMOVED) {
+    // stop if we find a free slot, or if we find the key itself.
+    // do skip over removed slots (yes, open addressing is like that...)
+    // assertion: there is at least one FREE slot.
+    int j = i;
+    while (stat[i] != FREE && (stat[i] == REMOVED || tab[i] != key)) {
+      i -= decrement;
+      //hashCollisions++;
+      if (i<0) i+=length;
+    }
+    if (stat[i] == FREE) i = j;
+  }
+  
+  
+  if (stat[i] == FULL) {
+    // key already contained at slot i.
+    // return a negative number identifying the slot.
+    return -i-1;
+  }
+  // not already contained, should be inserted at slot i.
+  // return a number >= 0 identifying the slot.
+  return i; 
 }
 /**
  * @param key the key to be searched in the receiver.
  * @return the index where the key is contained in the receiver, returns -1 if the key was not found.
  */
 protected int indexOfKey(int key) {
-	final int tab[] = table;
-	final byte stat[] = state;
-	final int length = tab.length;
+  final int tab[] = table;
+  final byte stat[] = state;
+  final int length = tab.length;
 
-	final int hash = HashFunctions.hash(key) & 0x7FFFFFFF;
-	int i = hash % length;
-	int decrement = hash % (length-2); // double hashing, see http://www.eece.unm.edu/faculty/heileman/hash/node4.html
-	//int decrement = (hash / length) % length;
-	if (decrement == 0) decrement = 1;
+  final int hash = HashFunctions.hash(key) & 0x7FFFFFFF;
+  int i = hash % length;
+  int decrement = hash % (length-2); // double hashing, see http://www.eece.unm.edu/faculty/heileman/hash/node4.html
+  //int decrement = (hash / length) % length;
+  if (decrement == 0) decrement = 1;
 
-	// stop if we find a free slot, or if we find the key itself.
-	// do skip over removed slots (yes, open addressing is like that...)
-	while (stat[i] != FREE && (stat[i] == REMOVED || tab[i] != key)) {
-		i -= decrement;
-		//hashCollisions++;
-		if (i<0) i+=length;
-	}
-	
-	if (stat[i] == FREE) return -1; // not found
-	return i; //found, return index where key is contained
+  // stop if we find a free slot, or if we find the key itself.
+  // do skip over removed slots (yes, open addressing is like that...)
+  while (stat[i] != FREE && (stat[i] == REMOVED || tab[i] != key)) {
+    i -= decrement;
+    //hashCollisions++;
+    if (i<0) i+=length;
+  }
+  
+  if (stat[i] == FREE) return -1; // not found
+  return i; //found, return index where key is contained
 }
 /**
  * @param value the value to be searched in the receiver.
  * @return the index where the value is contained in the receiver, returns -1 if the value was not found.
  */
 protected int indexOfValue(int value) {
-	final int val[] = values;
-	final byte stat[] = state;
+  final int val[] = values;
+  final byte stat[] = state;
 
-	for (int i=stat.length; --i >= 0;) {
-		if (stat[i]==FULL && val[i]==value) return i;
-	}
+  for (int i=stat.length; --i >= 0;) {
+    if (stat[i]==FULL && val[i]==value) return i;
+  }
 
-	return -1; // not found
+  return -1; // not found
 }
 /**
  * Returns the first key the given value is associated with.
@@ -278,13 +278,13 @@
  *
  * @param value the value to search for.
  * @return the first key for which holds <tt>get(key) == value</tt>; 
- *		   returns <tt>Integer.MIN_VALUE</tt> if no such key exists.
+ *       returns <tt>Integer.MIN_VALUE</tt> if no such key exists.
  */
 public int keyOf(int value) {
-	//returns the first key found; there may be more matching keys, however.
-	int i = indexOfValue(value);
-	if (i<0) return Integer.MIN_VALUE;
-	return table[i];
+  //returns the first key found; there may be more matching keys, however.
+  int i = indexOfValue(value);
+  if (i<0) return Integer.MIN_VALUE;
+  return table[i];
 }
 /**
  * Fills all keys contained in the receiver into the specified list.
@@ -297,16 +297,16 @@
  * @param list the list to be filled, can have any size.
  */
 public void keys(IntArrayList list) {
-	list.setSize(distinct);
-	int[] elements = list.elements();
-	
-	int[] tab = table;
-	byte[] stat = state;
-	
-	int j=0;
-	for (int i = tab.length ; i-- > 0 ;) {
-		if (stat[i]==FULL) elements[j++]=tab[i];
-	}
+  list.setSize(distinct);
+  int[] elements = list.elements();
+  
+  int[] tab = table;
+  byte[] stat = state;
+  
+  int j=0;
+  for (int i = tab.length ; i-- > 0 ;) {
+    if (stat[i]==FULL) elements[j++]=tab[i];
+  }
 }
 /**
 Fills all pairs satisfying a given condition into the specified lists.
@@ -318,7 +318,7 @@
 <br>
 <pre>
 IntIntProcedure condition = new IntIntProcedure() { // match even keys only
-	public boolean apply(int key, int value) { return key%2==0; }
+  public boolean apply(int key, int value) { return key%2==0; }
 }
 keys = (8,7,6), values = (1,2,2) --> keyList = (6,8), valueList = (2,1)</tt>
 </pre>
@@ -328,15 +328,15 @@
 @param valueList the list to be filled with values, can have any size.
 */
 public void pairsMatching(final IntIntProcedure condition, final IntArrayList keyList, final IntArrayList valueList) {
-	keyList.clear();
-	valueList.clear();
-	
-	for (int i = table.length ; i-- > 0 ;) {
-		if (state[i]==FULL && condition.apply(table[i],values[i])) {
-			keyList.add(table[i]);
-			valueList.add(values[i]);
-		}
-	}
+  keyList.clear();
+  valueList.clear();
+  
+  for (int i = table.length ; i-- > 0 ;) {
+    if (state[i]==FULL && condition.apply(table[i],values[i])) {
+      keyList.add(table[i]);
+      valueList.add(values[i]);
+    }
+  }
 }
 /**
  * Associates the given key with the given value.
@@ -348,35 +348,35 @@
  *         <tt>false</tt> if the receiver did already contain such a key - the new value has now replaced the formerly associated value.
  */
 public boolean put(int key, int value) {
-	int i = indexOfInsertion(key);	
-	if (i<0) { //already contained
-		i = -i -1;
-		this.values[i]=value;
-		return false;
-	}
+  int i = indexOfInsertion(key);  
+  if (i<0) { //already contained
+    i = -i -1;
+    this.values[i]=value;
+    return false;
+  }
 
-	if (this.distinct > this.highWaterMark) {
-		int newCapacity = chooseGrowCapacity(this.distinct+1,this.minLoadFactor, this.maxLoadFactor);
-		
-		//System.out.print("grow rehashing ");
-		//System.out.println("at distinct="+distinct+", capacity="+table.length+" to newCapacity="+newCapacity+" ...");
-		
-		rehash(newCapacity);
-		return put(key, value);
-	}
+  if (this.distinct > this.highWaterMark) {
+    int newCapacity = chooseGrowCapacity(this.distinct+1,this.minLoadFactor, this.maxLoadFactor);
+    
+    //System.out.print("grow rehashing ");
+    //System.out.println("at distinct="+distinct+", capacity="+table.length+" to newCapacity="+newCapacity+" ...");
+    
+    rehash(newCapacity);
+    return put(key, value);
+  }
 
-	this.table[i]=key;
-	this.values[i]=value;
-	if (this.state[i]==FREE) this.freeEntries--;
-	this.state[i]=FULL;
-	this.distinct++;
+  this.table[i]=key;
+  this.values[i]=value;
+  if (this.state[i]==FREE) this.freeEntries--;
+  this.state[i]=FULL;
+  this.distinct++;
 
-	if (this.freeEntries < 1) { //delta
-		int newCapacity = chooseGrowCapacity(this.distinct+1,this.minLoadFactor, this.maxLoadFactor);
-		rehash(newCapacity);
-	}
+  if (this.freeEntries < 1) { //delta
+    int newCapacity = chooseGrowCapacity(this.distinct+1,this.minLoadFactor, this.maxLoadFactor);
+    rehash(newCapacity);
+  }
 
-	return true;
+  return true;
 }
 /**
  * Rehashes the contents of the receiver into a new table
@@ -385,34 +385,34 @@
  * number of keys in the receiver exceeds the high water mark or falls below the low water mark.
  */
 protected void rehash(int newCapacity) {
-	int oldCapacity = table.length;
-	//if (oldCapacity == newCapacity) return;
-	
-	int oldTable[] = table;
-	int oldValues[] = values;
-	byte oldState[] = state;
+  int oldCapacity = table.length;
+  //if (oldCapacity == newCapacity) return;
+  
+  int oldTable[] = table;
+  int oldValues[] = values;
+  byte oldState[] = state;
 
-	int newTable[] = new int[newCapacity];
-	int newValues[] = new int[newCapacity];
-	byte newState[] = new byte[newCapacity];
+  int newTable[] = new int[newCapacity];
+  int newValues[] = new int[newCapacity];
+  byte newState[] = new byte[newCapacity];
 
-	this.lowWaterMark  = chooseLowWaterMark(newCapacity,this.minLoadFactor);
-	this.highWaterMark = chooseHighWaterMark(newCapacity,this.maxLoadFactor);
+  this.lowWaterMark  = chooseLowWaterMark(newCapacity,this.minLoadFactor);
+  this.highWaterMark = chooseHighWaterMark(newCapacity,this.maxLoadFactor);
 
-	this.table = newTable;
-	this.values = newValues;
-	this.state = newState;
-	this.freeEntries = newCapacity-this.distinct; // delta
-	
-	for (int i = oldCapacity ; i-- > 0 ;) {
-		if (oldState[i]==FULL) {
-			int element = oldTable[i];
-			int index = indexOfInsertion(element);
-			newTable[index]=element;
-			newValues[index]=oldValues[i];
-			newState[index]=FULL;
-		}
-	}
+  this.table = newTable;
+  this.values = newValues;
+  this.state = newState;
+  this.freeEntries = newCapacity-this.distinct; // delta
+  
+  for (int i = oldCapacity ; i-- > 0 ;) {
+    if (oldState[i]==FULL) {
+      int element = oldTable[i];
+      int index = indexOfInsertion(element);
+      newTable[index]=element;
+      newValues[index]=oldValues[i];
+      newState[index]=FULL;
+    }
+  }
 }
 /**
  * Removes the given key with its associated element from the receiver, if present.
@@ -421,25 +421,25 @@
  * @return <tt>true</tt> if the receiver contained the specified key, <tt>false</tt> otherwise.
  */
 public boolean removeKey(int key) {
-	int i = indexOfKey(key);
-	if (i<0) return false; // key not contained
+  int i = indexOfKey(key);
+  if (i<0) return false; // key not contained
 
-	this.state[i]=REMOVED;
-	//this.values[i]=0; // delta
-	this.distinct--;
+  this.state[i]=REMOVED;
+  //this.values[i]=0; // delta
+  this.distinct--;
 
-	if (this.distinct < this.lowWaterMark) {
-		int newCapacity = chooseShrinkCapacity(this.distinct,this.minLoadFactor, this.maxLoadFactor);
-		/*
-		if (table.length != newCapacity) {
-			System.out.print("shrink rehashing ");
-			System.out.println("at distinct="+distinct+", capacity="+table.length+" to newCapacity="+newCapacity+" ...");
-		}
-		*/
-		rehash(newCapacity);
-	}
-	
-	return true;	
+  if (this.distinct < this.lowWaterMark) {
+    int newCapacity = chooseShrinkCapacity(this.distinct,this.minLoadFactor, this.maxLoadFactor);
+    /*
+    if (table.length != newCapacity) {
+      System.out.print("shrink rehashing ");
+      System.out.println("at distinct="+distinct+", capacity="+table.length+" to newCapacity="+newCapacity+" ...");
+    }
+    */
+    rehash(newCapacity);
+  }
+  
+  return true;  
 }
 /**
  * Initializes the receiver.
@@ -447,32 +447,32 @@
  * @param      initialCapacity   the initial capacity of the receiver.
  * @param      minLoadFactor        the minLoadFactor of the receiver.
  * @param      maxLoadFactor        the maxLoadFactor of the receiver.
- * @throws	IllegalArgumentException if <tt>initialCapacity < 0 || (minLoadFactor < 0.0 || minLoadFactor >= 1.0) || (maxLoadFactor <= 0.0 || maxLoadFactor >= 1.0) || (minLoadFactor >= maxLoadFactor)</tt>.
+ * @throws  IllegalArgumentException if <tt>initialCapacity < 0 || (minLoadFactor < 0.0 || minLoadFactor >= 1.0) || (maxLoadFactor <= 0.0 || maxLoadFactor >= 1.0) || (minLoadFactor >= maxLoadFactor)</tt>.
  */
 protected void setUp(int initialCapacity, double minLoadFactor, double maxLoadFactor) {
-	int capacity = initialCapacity;
-	super.setUp(capacity, minLoadFactor, maxLoadFactor);
-	capacity = nextPrime(capacity);
-	if (capacity==0) capacity=1; // open addressing needs at least one FREE slot at any time.
-	
-	this.table = new int[capacity];
-	this.values = new int[capacity];
-	this.state = new byte[capacity];
+  int capacity = initialCapacity;
+  super.setUp(capacity, minLoadFactor, maxLoadFactor);
+  capacity = nextPrime(capacity);
+  if (capacity==0) capacity=1; // open addressing needs at least one FREE slot at any time.
+  
+  this.table = new int[capacity];
+  this.values = new int[capacity];
+  this.state = new byte[capacity];
 
-	// memory will be exhausted long before this pathological case happens, anyway.
-	this.minLoadFactor = minLoadFactor;
-	if (capacity == PrimeFinder.largestPrime) this.maxLoadFactor = 1.0;
-	else this.maxLoadFactor = maxLoadFactor;
+  // memory will be exhausted long before this pathological case happens, anyway.
+  this.minLoadFactor = minLoadFactor;
+  if (capacity == PrimeFinder.largestPrime) this.maxLoadFactor = 1.0;
+  else this.maxLoadFactor = maxLoadFactor;
 
-	this.distinct = 0;
-	this.freeEntries = capacity; // delta
-	
-	// lowWaterMark will be established upon first expansion.
-	// establishing it now (upon instance construction) would immediately make the table shrink upon first put(...).
-	// After all the idea of an "initialCapacity" implies violating lowWaterMarks when an object is young.
-	// See ensureCapacity(...)
-	this.lowWaterMark = 0; 
-	this.highWaterMark = chooseHighWaterMark(capacity, this.maxLoadFactor);
+  this.distinct = 0;
+  this.freeEntries = capacity; // delta
+  
+  // lowWaterMark will be established upon first expansion.
+  // establishing it now (upon instance construction) would immediately make the table shrink upon first put(...).
+  // After all the idea of an "initialCapacity" implies violating lowWaterMarks when an object is young.
+  // See ensureCapacity(...)
+  this.lowWaterMark = 0; 
+  this.highWaterMark = chooseHighWaterMark(capacity, this.maxLoadFactor);
 }
 /**
  * Trims the capacity of the receiver to be the receiver's current 
@@ -480,12 +480,12 @@
  * storage of the receiver.
  */
 public void trimToSize() {
-	// * 1.2 because open addressing's performance exponentially degrades beyond that point
-	// so that even rehashing the table can take very long
-	int newCapacity = nextPrime((int)(1 + 1.2*size()));
-	if (table.length > newCapacity) {
-		rehash(newCapacity);
-	}
+  // * 1.2 because open addressing's performance exponentially degrades beyond that point
+  // so that even rehashing the table can take very long
+  int newCapacity = nextPrime((int)(1 + 1.2*size()));
+  if (table.length > newCapacity) {
+    rehash(newCapacity);
+  }
 }
 /**
  * Fills all values contained in the receiver into the specified list.
@@ -498,15 +498,15 @@
  * @param list the list to be filled, can have any size.
  */
 public void values(IntArrayList list) {
-	list.setSize(distinct);
-	int[] elements = list.elements();
-	
-	int[] val = values;
-	byte[] stat = state;
-	
-	int j=0;
-	for (int i = stat.length ; i-- > 0 ;) {
-		if (stat[i]==FULL) elements[j++]=val[i];
-	}
+  list.setSize(distinct);
+  int[] elements = list.elements();
+  
+  int[] val = values;
+  byte[] stat = state;
+  
+  int j=0;
+  for (int i = stat.length ; i-- > 0 ;) {
+    if (stat[i]==FULL) elements[j++]=val[i];
+  }
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/map/Benchmark.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/map/Benchmark.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/map/Benchmark.java	(working copy)
@@ -12,8 +12,6 @@
 /**
  * Benchmarks the classes of this package.
  *
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 09/24/99
  */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
@@ -27,69 +25,69 @@
 /**
  */
 public static void benchmark(int runs, int size, String kind) {
-	QuickOpenIntIntHashMap map;
+  QuickOpenIntIntHashMap map;
 
-	System.out.println("initializing...");
-	map = new QuickOpenIntIntHashMap();
-	
-	//for (int i=size; --i >=0; ) {
-	for (int i=0; i < size; i++) {
-		map.put(i,i);
-	}
-	Runtime.getRuntime().gc();
-	try { Thread.currentThread().sleep(1000); } catch (InterruptedException exc) {};
-	
+  System.out.println("initializing...");
+  map = new QuickOpenIntIntHashMap();
+  
+  //for (int i=size; --i >=0; ) {
+  for (int i=0; i < size; i++) {
+    map.put(i,i);
+  }
+  Runtime.getRuntime().gc();
+  try { Thread.currentThread().sleep(1000); } catch (InterruptedException exc) {};
+  
 
-	System.out.println("Now benchmarking...");
-	int s=0;
-	Timer timer0 = new Timer();
-	Timer timer1 = new Timer();
-	Timer timer2 = new Timer();
-	//map.hashCollisions = 0;
-	for (int run=runs; --run >=0; ) {
-		if (kind.equals("add")) {
-			map.clear();
-			//map.ensureCapacity(size*3);
-			timer0.start();
-			for (int i=size; --i >=0; ) {
-				map.put(i,i);
-			}
-			timer0.stop();
-		}
-		if (kind.equals("get")) {
-			timer0.start();
-			for (int i=size; --i >=0; ) {
-				s += map.get(i);
-			}
-			timer0.stop();
-		}
-		else {
-			timer1.start();
-			map.rehash(PrimeFinder.nextPrime(size*2));
-			timer1.stop();
+  System.out.println("Now benchmarking...");
+  int s=0;
+  Timer timer0 = new Timer();
+  Timer timer1 = new Timer();
+  Timer timer2 = new Timer();
+  //map.hashCollisions = 0;
+  for (int run=runs; --run >=0; ) {
+    if (kind.equals("add")) {
+      map.clear();
+      //map.ensureCapacity(size*3);
+      timer0.start();
+      for (int i=size; --i >=0; ) {
+        map.put(i,i);
+      }
+      timer0.stop();
+    }
+    if (kind.equals("get")) {
+      timer0.start();
+      for (int i=size; --i >=0; ) {
+        s += map.get(i);
+      }
+      timer0.stop();
+    }
+    else {
+      timer1.start();
+      map.rehash(PrimeFinder.nextPrime(size*2));
+      timer1.stop();
 
-			timer2.start();
-			map.rehash(PrimeFinder.nextPrime((int) (size*1.5)));
-			timer2.stop();
-		}
-	}
+      timer2.start();
+      map.rehash(PrimeFinder.nextPrime((int) (size*1.5)));
+      timer2.stop();
+    }
+  }
 
-	System.out.println("adding: "+timer0);
-	System.out.println("growing: "+timer1);
-	System.out.println("shrinking: "+timer2);
-	System.out.println("total: "+(timer1.plus(timer2)));
-	//System.out.println("collisions="+map.hashCollisions);
-	System.out.print(s);
+  System.out.println("adding: "+timer0);
+  System.out.println("growing: "+timer1);
+  System.out.println("shrinking: "+timer2);
+  System.out.println("total: "+(timer1.plus(timer2)));
+  //System.out.println("collisions="+map.hashCollisions);
+  System.out.print(s);
 }
 /**
  * Tests various methods of this class.
  */
 public static void main(String args[]) {
-	int runs = Integer.parseInt(args[0]);
-	int size = Integer.parseInt(args[1]);
-	//boolean add = args[2].equals("add");
-	String kind = args[2];
-	benchmark(runs,size,kind);	 
+  int runs = Integer.parseInt(args[0]);
+  int size = Integer.parseInt(args[1]);
+  //boolean add = args[2].equals("add");
+  String kind = args[2];
+  benchmark(runs,size,kind);   
 }
 /**
  */
@@ -102,7 +100,7 @@
 int[]    keys   = new int[length];
 int to = 10000000;
 for (int i=0; i<length; i++) { 
-	keys[i] = uniform.nextIntFromTo(0,to);
+  keys[i] = uniform.nextIntFromTo(0,to);
 }
 int[] values = (int[]) keys.clone();
 
@@ -111,8 +109,8 @@
 AbstractIntIntMap map = new OpenIntIntHashMap();
 
 for (int i=0; i<keys.length; i++) {
-	map.put(keys[i], (int)values[i]);
-	//System.out.println(map);
+  map.put(keys[i], (int)values[i]);
+  //System.out.println(map);
 }
 
 /*
@@ -131,7 +129,7 @@
 //System.out.println(map.values());
 /*
 if (map instanceof QuickOpenIntIntHashMap) {
-	System.out.println("totalProbesSaved="+((QuickOpenIntIntHashMap)map).totalProbesSaved);
+  System.out.println("totalProbesSaved="+((QuickOpenIntIntHashMap)map).totalProbesSaved);
 }
 System.out.println("probes="+map.hashCollisions);
 
@@ -139,8 +137,8 @@
 */
 int sum=0;
 for (int i=0; i<keys.length; i++) {
-	sum += map.get(keys[i]);
-	//System.out.println(map);
+  sum += map.get(keys[i]);
+  //System.out.println(map);
 }
 //System.out.println("probes="+map.hashCollisions);
 
Index: matrix/src/main/java/org/apache/mahout/matrix/Timer.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/Timer.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/Timer.java	(working copy)
@@ -18,39 +18,39 @@
  */
 @Deprecated
 public class Timer extends PersistentObject {
-	private long baseTime;
-	private long elapsedTime;
+  private long baseTime;
+  private long elapsedTime;
 
-	private static final long UNIT = 1000;
+  private static final long UNIT = 1000;
 /**
  * Constructs a new timer, initially not started. Use start() to start the timer.
  */
 public Timer() {
-	this.reset();
+  this.reset();
 }
 /**
  * Prints the elapsed time on System.out
  * @return <tt>this</tt> (for convenience only).
  */
 public Timer display() {
-	System.out.println(this);
-	return this;
+  System.out.println(this);
+  return this;
 }
 /**
  * Same as <tt>seconds()</tt>.
  */
 public float elapsedTime() {
-	return seconds();
+  return seconds();
 }
 /**
  * Returns the elapsed time in milli seconds; does not stop the timer, if started.
  */
 public long millis() {
-	long elapsed = elapsedTime;
-	if (baseTime!=0) { // we are started
-		elapsed += System.currentTimeMillis() - baseTime;
-	}
-	return elapsed;
+  long elapsed = elapsedTime;
+  if (baseTime!=0) { // we are started
+    elapsed += System.currentTimeMillis() - baseTime;
+  }
+  return elapsed;
 }
 /**
  * <tt>T = this - other</tt>; Constructs and returns a new timer which is the difference of the receiver and the other timer.
@@ -59,15 +59,15 @@
  * @return a new timer.
  */
 public Timer minus(Timer other) {
-	Timer copy = new Timer();
-	copy.elapsedTime = millis() - other.millis();
-	return copy;
+  Timer copy = new Timer();
+  copy.elapsedTime = millis() - other.millis();
+  return copy;
 }
 /**
  * Returns the elapsed time in minutes; does not stop the timer, if started.
  */
 public float minutes() {
-	return seconds() / 60;
+  return seconds() / 60;
 }
 /**
  * <tt>T = this + other</tt>; Constructs and returns a new timer which is the sum of the receiver and the other timer.
@@ -76,91 +76,91 @@
  * @return a new timer.
  */
 public Timer plus(Timer other) {
-	Timer copy = new Timer();
-	copy.elapsedTime = millis() + other.millis();
-	return copy;
+  Timer copy = new Timer();
+  copy.elapsedTime = millis() + other.millis();
+  return copy;
 }
 /**
  * Resets the timer.
  * @return <tt>this</tt> (for convenience only).
  */
 public Timer reset() {
-	elapsedTime = 0;
-	baseTime=0;
-	return this;
+  elapsedTime = 0;
+  baseTime=0;
+  return this;
 }
 /**
  * Returns the elapsed time in seconds; does not stop the timer, if started.
  */
 public float seconds() {
-	return ((float) millis()) / UNIT;
+  return ((float) millis()) / UNIT;
 }
 /**
  * Starts the timer.
  * @return <tt>this</tt> (for convenience only).
  */
 public Timer start() {
-	baseTime = System.currentTimeMillis();
-	return this;
+  baseTime = System.currentTimeMillis();
+  return this;
 }
 /**
  * Stops the timer. You can start it again later, if necessary.
  * @return <tt>this</tt> (for convenience only).
  */
 public Timer stop() {
-	if (baseTime!=0) {
-		elapsedTime = elapsedTime + (System.currentTimeMillis() - baseTime);
-	}
-	baseTime = 0;
-	return this;
+  if (baseTime!=0) {
+    elapsedTime = elapsedTime + (System.currentTimeMillis() - baseTime);
+  }
+  baseTime = 0;
+  return this;
 }
 /**
  * Shows how to use a timer in convenient ways.
  */
 public static void test(int size) {
-	//benchmark this piece
-	Timer t = new Timer().start(); 
-	int j=0;
-	for (int i=0; i<size; i++) {
-		j++;
-	}
-	t.stop();
-	t.display();
-	System.out.println("I finished the test using "+t);
+  //benchmark this piece
+  Timer t = new Timer().start(); 
+  int j=0;
+  for (int i=0; i<size; i++) {
+    j++;
+  }
+  t.stop();
+  t.display();
+  System.out.println("I finished the test using "+t);
 
-	
+  
 
-	//do something we do not want to benchmark
-	j=0;
-	for (int i=0; i<size; i++) {
-		j++;
-	}
+  //do something we do not want to benchmark
+  j=0;
+  for (int i=0; i<size; i++) {
+    j++;
+  }
 
 
-	
-	//benchmark another piece and add to last benchmark
-	t.start();
-	j=0;
-	for (int i=0; i<size; i++) {
-		j++;
-	}
-	t.stop().display();
+  
+  //benchmark another piece and add to last benchmark
+  t.start();
+  j=0;
+  for (int i=0; i<size; i++) {
+    j++;
+  }
+  t.stop().display();
 
-	
+  
 
-	//benchmark yet another piece independently
-	t.reset(); //set timer to zero
-	t.start();
-	j=0;
-	for (int i=0; i<size; i++) {
-		j++;
-	}
-	t.stop().display();
+  //benchmark yet another piece independently
+  t.reset(); //set timer to zero
+  t.start();
+  j=0;
+  for (int i=0; i<size; i++) {
+    j++;
+  }
+  t.stop().display();
 }
 /**
  * Returns a String representation of the receiver.
  */
 public String toString() {
-	return "Time=" + Float.toString(this.elapsedTime()) + " secs";
+  return "Time=" + Float.toString(this.elapsedTime()) + " secs";
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/bitvector/BitVector.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/bitvector/BitVector.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/bitvector/BitVector.java	(working copy)
@@ -42,8 +42,6 @@
  * <p>
  * <b>Note</b> that this implementation is not synchronized.
  *
- * @author wolfgang.hoschek@cern.ch
- * @version 1.01, 11/10/99
  * @see     QuickBitVector
  * @see     BitMatrix
  * @see     java.util.BitSet
@@ -53,31 +51,31 @@
  */
 @Deprecated
 public class BitVector extends org.apache.mahout.matrix.PersistentObject {
-	/*
-	 * Bits are packed into arrays of "units."  Currently a unit is a long,
-	 * which consists of 64 bits, requiring 6 address bits.  The choice of unit
-	 * is determined purely by performance concerns.
-	 */
+  /*
+   * Bits are packed into arrays of "units."  Currently a unit is a long,
+   * which consists of 64 bits, requiring 6 address bits.  The choice of unit
+   * is determined purely by performance concerns.
+   */
 
-	/**
-	 * The bits of this object.  The ith bit is stored in bits[i/64] at
-	 * bit position i % 64 (where bit position 0 refers to the least
-	 * significant bit and 63 refers to the most significant bit).
-	 *
-	 * @serial
-	 */
-	protected long bits[];
+  /**
+   * The bits of this object.  The ith bit is stored in bits[i/64] at
+   * bit position i % 64 (where bit position 0 refers to the least
+   * significant bit and 63 refers to the most significant bit).
+   *
+   * @serial
+   */
+  protected long bits[];
 
-	protected int nbits; //the size
+  protected int nbits; //the size
 
-	// IntProcedure for method indexOfFromTo(...)
-	private class IndexProcedure implements org.apache.mahout.matrix.function.IntProcedure {
-			private int foundPos = -1;
-			public boolean apply(int index) {
-				foundPos = index;
-				return false;
-			}
-		}
+  // IntProcedure for method indexOfFromTo(...)
+  private class IndexProcedure implements org.apache.mahout.matrix.function.IntProcedure {
+      private int foundPos = -1;
+      public boolean apply(int index) {
+        foundPos = index;
+        return false;
+      }
+    }
 
 /**
  * You normally need not use this method. Use this method only if performance is critical.
@@ -94,7 +92,7 @@
  * @throws IllegalArgumentException if <tt>size &lt; 0 || size &gt; bits.length*64</tt>.
  */
 public BitVector (long[] bits, int size) {
-	elements(bits,size);
+  elements(bits,size);
 }
 /**
  * Constructs a bit vector that holds <tt>size</tt> bits. All bits are initially <tt>false</tt>.
@@ -103,7 +101,7 @@
  * @throws IllegalArgumentException if <tt>size &lt; 0</tt>.
  */
 public BitVector(int size) {
-	this(QuickBitVector.makeBitVector(size,1),size);
+  this(QuickBitVector.makeBitVector(size,1),size);
 }
 /**
  * Performs a logical <b>AND</b> of the receiver with another bit vector (A = A & B).
@@ -116,11 +114,11 @@
  * @throws IllegalArgumentException if <tt>size() &gt; other.size()</tt>.
  */
 public void and(BitVector other) {
-	if (this == other) return;
-	checkSize(other);
-	final long[] theBits = this.bits; // cached for speed.
-	final long[] otherBits = other.bits; //cached for speed.
-	for(int i=theBits.length; --i >= 0;) theBits[i] &= otherBits[i];
+  if (this == other) return;
+  checkSize(other);
+  final long[] theBits = this.bits; // cached for speed.
+  final long[] otherBits = other.bits; //cached for speed.
+  for(int i=theBits.length; --i >= 0;) theBits[i] &= otherBits[i];
 }
 /**
  * Clears all of the bits in receiver whose corresponding
@@ -131,72 +129,72 @@
  * @throws IllegalArgumentException if <tt>size() &gt; other.size()</tt>.
  */
 public void andNot(BitVector other) {
-	checkSize(other);
-	final long[] theBits = this.bits; // cached for speed.
-	final long[] otherBits = other.bits; //cached for speed.
-	for(int i=theBits.length; --i >= 0;) theBits[i] &= ~otherBits[i];
+  checkSize(other);
+  final long[] theBits = this.bits; // cached for speed.
+  final long[] otherBits = other.bits; //cached for speed.
+  for(int i=theBits.length; --i >= 0;) theBits[i] &= ~otherBits[i];
 }
 /**
  * Returns the number of bits currently in the <tt>true</tt> state.
  * Optimized for speed. Particularly quick if the receiver is either sparse or dense.
  */
 public int cardinality() {
-	int cardinality=0;
-	int fullUnits = numberOfFullUnits();
-	final int bitsPerUnit = QuickBitVector.BITS_PER_UNIT;
+  int cardinality=0;
+  int fullUnits = numberOfFullUnits();
+  final int bitsPerUnit = QuickBitVector.BITS_PER_UNIT;
 
-	// determine cardinality on full units
-	final long[] theBits=bits;
-	for(int i=fullUnits; --i >= 0;) {
-		long val = theBits[i];
-		if (val == -1L) { // all bits set?
-			cardinality += bitsPerUnit;
-		}
-		else if (val != 0L) { // more than one bit set?
-			for (int j=bitsPerUnit; --j >= 0; ) {
-				if ((val & (1L << j)) != 0) cardinality++;
-			}
-		}
-	}
+  // determine cardinality on full units
+  final long[] theBits=bits;
+  for(int i=fullUnits; --i >= 0;) {
+    long val = theBits[i];
+    if (val == -1L) { // all bits set?
+      cardinality += bitsPerUnit;
+    }
+    else if (val != 0L) { // more than one bit set?
+      for (int j=bitsPerUnit; --j >= 0; ) {
+        if ((val & (1L << j)) != 0) cardinality++;
+      }
+    }
+  }
 
-	// determine cardinality on remaining partial unit, if any.
-	for (int j=numberOfBitsInPartialUnit(); --j >= 0; ) {
-		if ((theBits[fullUnits] & (1L << j)) != 0) cardinality++;
-	}
+  // determine cardinality on remaining partial unit, if any.
+  for (int j=numberOfBitsInPartialUnit(); --j >= 0; ) {
+    if ((theBits[fullUnits] & (1L << j)) != 0) cardinality++;
+  }
 
-	return cardinality;
+  return cardinality;
 }
 /**
  * Checks if the given range is within the contained array's bounds.
  */
 protected static void checkRangeFromTo(int from, int to, int theSize) {
-	if (from<0 || from>to || to>=theSize)
-		throw new IndexOutOfBoundsException("from: "+from+", to: "+to+", size="+theSize);
+  if (from<0 || from>to || to>=theSize)
+    throw new IndexOutOfBoundsException("from: "+from+", to: "+to+", size="+theSize);
 }
 /**
  * Sanity check for operations requiring another bitvector with at least the same size.
  */
 protected void checkSize(BitVector other) {
-	if (nbits > other.size()) throw new IllegalArgumentException("Incompatible sizes: size="+nbits+", other.size()="+other.size());
+  if (nbits > other.size()) throw new IllegalArgumentException("Incompatible sizes: size="+nbits+", other.size()="+other.size());
 }
 /**
  * Clears all bits of the receiver.
  */
 public void clear() {
-	final long[] theBits = this.bits;
-	for (int i = theBits.length; --i >= 0 ;) theBits[i] = 0L;
+  final long[] theBits = this.bits;
+  for (int i = theBits.length; --i >= 0 ;) theBits[i] = 0L;
 
-	//new LongArrayList(bits).fillFromToWith(0,size()-1,0L);
+  //new LongArrayList(bits).fillFromToWith(0,size()-1,0L);
 }
 /**
  * Changes the bit with index <tt>bitIndex</tt> to the "clear" (<tt>false</tt>) state.
  *
  * @param     bitIndex   the index of the bit to be cleared.
- * @throws	IndexOutOfBoundsException if <tt>bitIndex&lt;0 || bitIndex&gt;=size()</tt>
+ * @throws  IndexOutOfBoundsException if <tt>bitIndex&lt;0 || bitIndex&gt;=size()</tt>
  */
 public void clear(int bitIndex) {
-	if (bitIndex<0 || bitIndex>=nbits) throw new IndexOutOfBoundsException(String.valueOf(bitIndex));
-	QuickBitVector.clear(bits, bitIndex);
+  if (bitIndex<0 || bitIndex>=nbits) throw new IndexOutOfBoundsException(String.valueOf(bitIndex));
+  QuickBitVector.clear(bits, bitIndex);
 }
 /**
  * Cloning this <code>BitVector</code> produces a new <code>BitVector</code>
@@ -208,9 +206,9 @@
  * @return  a deep copy of this bit vector.
  */
 public Object clone() {
-	BitVector clone = (BitVector) super.clone();
-	if (this.bits != null) clone.bits = (long[]) this.bits.clone();
-	return clone;
+  BitVector clone = (BitVector) super.clone();
+  if (this.bits != null) clone.bits = (long[]) this.bits.clone();
+  return clone;
 }
 /**
  * Returns a deep copy of the receiver; calls <code>clone()</code> and casts the result.
@@ -218,7 +216,7 @@
  * @return  a deep copy of the receiver.
  */
 public BitVector copy() {
-	return (BitVector) clone();
+  return (BitVector) clone();
 }
 /**
  * You normally need not use this method. Use this method only if performance is critical.
@@ -233,7 +231,7 @@
  * significant bit and 63 refers to the most significant bit).
  */
 public long[] elements() {
-	return bits;
+  return bits;
 }
 /**
  * You normally need not use this method. Use this method only if performance is critical.
@@ -252,9 +250,9 @@
  * @throws IllegalArgumentException if <tt>size &lt; 0 || size &gt; bits.length*64</tt>.
  */
 public void elements(long[] bits, int size) {
-	if (size<0 || size>bits.length*QuickBitVector.BITS_PER_UNIT) throw new IllegalArgumentException();
-	this.bits = bits;
-	this.nbits = size;
+  if (size<0 || size>bits.length*QuickBitVector.BITS_PER_UNIT) throw new IllegalArgumentException();
+  this.bits = bits;
+  this.nbits = size;
 }
 /**
  * Compares this object against the specified object.
@@ -271,27 +269,27 @@
  *          <code>false</code> otherwise.
  */
 public boolean equals(Object obj) {
-	if (obj == null || !(obj instanceof BitVector))
-		return false;
-	if (this == obj)
-		return true;
+  if (obj == null || !(obj instanceof BitVector))
+    return false;
+  if (this == obj)
+    return true;
 
-	BitVector other = (BitVector) obj;
-	if (size()!=other.size()) return false;
+  BitVector other = (BitVector) obj;
+  if (size()!=other.size()) return false;
 
-	int fullUnits = numberOfFullUnits();
-	// perform logical comparison on full units
-	for(int i=fullUnits; --i >= 0;)
-		if (bits[i] != other.bits[i]) return false;
+  int fullUnits = numberOfFullUnits();
+  // perform logical comparison on full units
+  for(int i=fullUnits; --i >= 0;)
+    if (bits[i] != other.bits[i]) return false;
 
-	// perform logical comparison on remaining bits
-	int i=fullUnits*QuickBitVector.BITS_PER_UNIT;
-	for (int times=numberOfBitsInPartialUnit(); --times >=0;) {
-		if (get(i) != other.get(i)) return false;
-		i++;
-	}
+  // perform logical comparison on remaining bits
+  int i=fullUnits*QuickBitVector.BITS_PER_UNIT;
+  for (int times=numberOfBitsInPartialUnit(); --times >=0;) {
+    if (get(i) != other.get(i)) return false;
+    i++;
+  }
 
-	return true;
+  return true;
 }
 /**
  * Applies a procedure to each bit index within the specified range that holds a bit in the given state.
@@ -312,115 +310,115 @@
  * @throws IndexOutOfBoundsException if (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public boolean forEachIndexFromToInState(int from, int to, boolean state, org.apache.mahout.matrix.function.IntProcedure procedure) {
-	/*
-	// this version is equivalent to the low level version below, but about 100 times slower for large ranges.
-	if (nbits==0) return true;
-	checkRangeFromTo(from, to, nbits);
-	final long[] theBits = this.bits; // cached for speed
-	int length=to-from+1;
-	for (int i=from; --length >= 0; i++) {
-		if (QuickBitVector.get(theBits,i)==state) {
-			if (!function.apply(i)) return false;
-		}
-	}
-	return true;
-	*/
-	
+  /*
+  // this version is equivalent to the low level version below, but about 100 times slower for large ranges.
+  if (nbits==0) return true;
+  checkRangeFromTo(from, to, nbits);
+  final long[] theBits = this.bits; // cached for speed
+  int length=to-from+1;
+  for (int i=from; --length >= 0; i++) {
+    if (QuickBitVector.get(theBits,i)==state) {
+      if (!function.apply(i)) return false;
+    }
+  }
+  return true;
+  */
+  
 
-	/*
-	 * This low level implementation exploits the fact that for any full unit one can determine in O(1)
-	 * whether it contains at least one true bit,
-	 * and whether it contains at least one false bit.
-	 * Thus, 64 bits can often be skipped with one simple comparison if the vector is either sparse or dense.
-	 *
-	 * However, careful coding must be done for leading and/or trailing units which are not entirely contained in the query range.
-	 */
-	 
-	if (nbits==0) return true;
-	checkRangeFromTo(from, to, nbits);		
-	//System.out.println("\n");
-	//System.out.println(this);
-	//System.out.println("from="+from+", to="+to+", bit="+state);
+  /*
+   * This low level implementation exploits the fact that for any full unit one can determine in O(1)
+   * whether it contains at least one true bit,
+   * and whether it contains at least one false bit.
+   * Thus, 64 bits can often be skipped with one simple comparison if the vector is either sparse or dense.
+   *
+   * However, careful coding must be done for leading and/or trailing units which are not entirely contained in the query range.
+   */
+   
+  if (nbits==0) return true;
+  checkRangeFromTo(from, to, nbits);    
+  //System.out.println("\n");
+  //System.out.println(this);
+  //System.out.println("from="+from+", to="+to+", bit="+state);
 
-	// Cache some vars for speed.
-	final long[] theBits = this.bits; 
-	final int bitsPerUnit = QuickBitVector.BITS_PER_UNIT;
+  // Cache some vars for speed.
+  final long[] theBits = this.bits; 
+  final int bitsPerUnit = QuickBitVector.BITS_PER_UNIT;
 
-	// Prepare
-	int fromUnit = QuickBitVector.unit(from);
-	int toUnit = QuickBitVector.unit(to);
-	int i = from; // current bitvector index
+  // Prepare
+  int fromUnit = QuickBitVector.unit(from);
+  int toUnit = QuickBitVector.unit(to);
+  int i = from; // current bitvector index
 
-	// Iterate over the leading partial unit, if any.
-	int bitIndex = QuickBitVector.offset(from);
-	int partialWidth;
-	if (bitIndex>0) { // There exists a leading partial unit.
-		partialWidth = Math.min(to-from+1, bitsPerUnit - bitIndex);
-		//System.out.println("partialWidth1="+partialWidth);
-		for (; --partialWidth >= 0; i++) {
-			if (QuickBitVector.get(theBits,i)==state) {
-				if (!procedure.apply(i)) return false;
-			}
-		}
-		fromUnit++; // leading partial unit is done.
-	}
+  // Iterate over the leading partial unit, if any.
+  int bitIndex = QuickBitVector.offset(from);
+  int partialWidth;
+  if (bitIndex>0) { // There exists a leading partial unit.
+    partialWidth = Math.min(to-from+1, bitsPerUnit - bitIndex);
+    //System.out.println("partialWidth1="+partialWidth);
+    for (; --partialWidth >= 0; i++) {
+      if (QuickBitVector.get(theBits,i)==state) {
+        if (!procedure.apply(i)) return false;
+      }
+    }
+    fromUnit++; // leading partial unit is done.
+  }
 
-	if (i>to) return true; // done
-	
-	// If there is a trailing partial unit, then there is one full unit less to test.
-	bitIndex = QuickBitVector.offset(to);
-	if (bitIndex < bitsPerUnit-1) {
-		toUnit--; // trailing partial unit needs to be tested extra.
-		partialWidth = bitIndex + 1;
-	}
-	else {
-		partialWidth = 0;
-	}
-	//System.out.println("partialWidth2="+partialWidth);
+  if (i>to) return true; // done
+  
+  // If there is a trailing partial unit, then there is one full unit less to test.
+  bitIndex = QuickBitVector.offset(to);
+  if (bitIndex < bitsPerUnit-1) {
+    toUnit--; // trailing partial unit needs to be tested extra.
+    partialWidth = bitIndex + 1;
+  }
+  else {
+    partialWidth = 0;
+  }
+  //System.out.println("partialWidth2="+partialWidth);
 
-	// Iterate over all full units, if any.
-	// (It does not matter that iterating over partial units is a little bit slow,
-	// the only thing that matters is that iterating over full units is quick.)
-	long comparator;
-	if (state) comparator = 0L;
-	else comparator = ~0L; // all 64 bits set
-	
-	//System.out.println("fromUnit="+fromUnit+", toUnit="+toUnit);
-	for (int unit=fromUnit; unit<=toUnit; unit++) {
-		long val = theBits[unit];
-		if (val != comparator) { 
-			// at least one element within current unit matches.
-			// iterate over all bits within current unit.
-			if (state) {
-				for (int j=0, k=bitsPerUnit; --k >= 0; i++) { 
-					if ((val & (1L << j++)) != 0L) { // is bit set?
-						if (!procedure.apply(i)) return false;
-					}
-				}
-			}
-			else {
-				for (int j=0, k=bitsPerUnit; --k >= 0; i++) { 
-					if ((val & (1L << j++)) == 0L) { // is bit cleared?
-						if (!procedure.apply(i)) return false;
-					}
-				}
-			}
-		}
-		else {
-			i += bitsPerUnit;
-		}
-	}
+  // Iterate over all full units, if any.
+  // (It does not matter that iterating over partial units is a little bit slow,
+  // the only thing that matters is that iterating over full units is quick.)
+  long comparator;
+  if (state) comparator = 0L;
+  else comparator = ~0L; // all 64 bits set
+  
+  //System.out.println("fromUnit="+fromUnit+", toUnit="+toUnit);
+  for (int unit=fromUnit; unit<=toUnit; unit++) {
+    long val = theBits[unit];
+    if (val != comparator) { 
+      // at least one element within current unit matches.
+      // iterate over all bits within current unit.
+      if (state) {
+        for (int j=0, k=bitsPerUnit; --k >= 0; i++) { 
+          if ((val & (1L << j++)) != 0L) { // is bit set?
+            if (!procedure.apply(i)) return false;
+          }
+        }
+      }
+      else {
+        for (int j=0, k=bitsPerUnit; --k >= 0; i++) { 
+          if ((val & (1L << j++)) == 0L) { // is bit cleared?
+            if (!procedure.apply(i)) return false;
+          }
+        }
+      }
+    }
+    else {
+      i += bitsPerUnit;
+    }
+  }
 
-	//System.out.println("trail with i="+i);	
+  //System.out.println("trail with i="+i);  
 
-	// Iterate over trailing partial unit, if any.
-	for (; --partialWidth >= 0; i++) {
-		if (QuickBitVector.get(theBits,i)==state) {
-			if (!procedure.apply(i)) return false;
-		}
-	}
-		
-	return true;	
+  // Iterate over trailing partial unit, if any.
+  for (; --partialWidth >= 0; i++) {
+    if (QuickBitVector.get(theBits,i)==state) {
+      if (!procedure.apply(i)) return false;
+    }
+  }
+    
+  return true;  
 }
 /**
  * Returns from the bitvector the value of the bit with the specified index.
@@ -429,11 +427,11 @@
  *
  * @param     bitIndex   the bit index.
  * @return    the value of the bit with the specified index.
- * @throws	IndexOutOfBoundsException if <tt>bitIndex&lt;0 || bitIndex&gt;=size()</tt>
+ * @throws  IndexOutOfBoundsException if <tt>bitIndex&lt;0 || bitIndex&gt;=size()</tt>
  */
 public boolean get(int bitIndex) {
-	if (bitIndex<0 || bitIndex>=nbits) throw new IndexOutOfBoundsException(String.valueOf(bitIndex));
-	return QuickBitVector.get(bits, bitIndex);
+  if (bitIndex<0 || bitIndex>=nbits) throw new IndexOutOfBoundsException(String.valueOf(bitIndex));
+  return QuickBitVector.get(bits, bitIndex);
 }
 /**
  * Returns a long value representing bits of the receiver from index <tt>from</tt> to index <tt>to</tt>.
@@ -443,13 +441,13 @@
  * @param from index of start bit (inclusive).
  * @param to index of end bit (inclusive).
  * @return the specified bits as long value.
- * @throws	IndexOutOfBoundsException if <tt>from&lt;0 || from&gt;=size() || to&lt;0 || to&gt;=size() || to-from+1<0 || to-from+1>64</tt>
+ * @throws  IndexOutOfBoundsException if <tt>from&lt;0 || from&gt;=size() || to&lt;0 || to&gt;=size() || to-from+1<0 || to-from+1>64</tt>
  */
 public long getLongFromTo(int from, int to) {
-	int width = to-from+1;
-	if (width==0) return 0L;
-	if (from<0 || from>=nbits || to<0 || to>=nbits || width<0 || width>QuickBitVector.BITS_PER_UNIT) throw new IndexOutOfBoundsException("from:"+from+", to:"+to);
-	return QuickBitVector.getLongFromTo(bits, from, to);
+  int width = to-from+1;
+  if (width==0) return 0L;
+  if (from<0 || from>=nbits || to<0 || to>=nbits || width<0 || width>QuickBitVector.BITS_PER_UNIT) throw new IndexOutOfBoundsException("from:"+from+", to:"+to);
+  return QuickBitVector.getLongFromTo(bits, from, to);
 }
 /**
  * Returns from the bitvector the value of the bit with the specified index; <b>WARNING:</b> Does not check preconditions.
@@ -464,7 +462,7 @@
  * @return    the value of the bit with the specified index.
  */
 public boolean getQuick(int bitIndex) {
-	return QuickBitVector.get(bits, bitIndex);
+  return QuickBitVector.get(bits, bitIndex);
 }
 /**
  * Returns a hash code value for the receiver. The hash code 
@@ -492,10 +490,10 @@
  * @return  a hash code value for the receiver.
  */
 public int hashCode() {
-	long h = 1234;
-	for (int i = bits.length; --i >= 0; ) h ^= bits[i] * (i + 1);
+  long h = 1234;
+  for (int i = bits.length; --i >= 0; ) h ^= bits[i] * (i + 1);
 
-	return (int)((h >> 32) ^ h);
+  return (int)((h >> 32) ^ h);
 }
 /**
  * Returns the index of the first occurrence of the specified
@@ -511,29 +509,29 @@
  * @exception IndexOutOfBoundsException if (<tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>).
  */
 public int indexOfFromTo(int from, int to, boolean state) {
-	IndexProcedure indexProcedure = new IndexProcedure();
-	forEachIndexFromToInState(from,to,state,indexProcedure);
-	return indexProcedure.foundPos; 
+  IndexProcedure indexProcedure = new IndexProcedure();
+  forEachIndexFromToInState(from,to,state,indexProcedure);
+  return indexProcedure.foundPos; 
 }
 /**
  * Performs a logical <b>NOT</b> on the bits of the receiver (A = ~A).
  */
 public void not() {
-	final long[] theBits = this.bits;
-	for (int i = theBits.length; --i >= 0 ;) theBits[i] = ~theBits[i];
+  final long[] theBits = this.bits;
+  for (int i = theBits.length; --i >= 0 ;) theBits[i] = ~theBits[i];
 }
 /**
  * Returns the number of bits used in the trailing PARTIAL unit.
  * Returns zero if there is no such trailing partial unit.
  */
 protected int numberOfBitsInPartialUnit() {
-	return QuickBitVector.offset(nbits);
+  return QuickBitVector.offset(nbits);
 }
 /**
  * Returns the number of units that are FULL (not PARTIAL).
  */
 protected int numberOfFullUnits() {
-	return QuickBitVector.unit(nbits);
+  return QuickBitVector.unit(nbits);
 }
 /**
  * Performs a logical <b>OR</b> of the receiver with another bit vector (A = A | B).
@@ -546,11 +544,11 @@
  * @throws IllegalArgumentException if <tt>size() &gt; other.size()</tt>.
  */
 public void or(BitVector other) {
-	if (this == other) return;
-	checkSize(other);
-	final long[] theBits = this.bits; // cached for speed.
-	final long[] otherBits = other.bits; //cached for speed.
-	for(int i=theBits.length; --i >= 0;) theBits[i] |= otherBits[i];
+  if (this == other) return;
+  checkSize(other);
+  final long[] theBits = this.bits; // cached for speed.
+  final long[] otherBits = other.bits; //cached for speed.
+  for(int i=theBits.length; --i >= 0;) theBits[i] |= otherBits[i];
 }
 /**
  * Constructs and returns a new bit vector which is a copy of the given range.
@@ -561,27 +559,27 @@
  * @throws IndexOutOfBoundsException if <tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size()))</tt>.
  */
 public BitVector partFromTo(int from, int to) {
-	if (nbits==0 || to==from-1) return new BitVector(0);
-	checkRangeFromTo(from, to, nbits);
+  if (nbits==0 || to==from-1) return new BitVector(0);
+  checkRangeFromTo(from, to, nbits);
 
-	int width = to-from+1;
-	BitVector part = new BitVector(width);
-	part.replaceFromToWith(0,width-1,this,from);
-	return part;
+  int width = to-from+1;
+  BitVector part = new BitVector(width);
+  part.replaceFromToWith(0,width-1,this,from);
+  return part;
 }
 /**
  * Sets the bit with index <tt>bitIndex</tt> to the state specified by <tt>value</tt>.
  *
  * @param     bitIndex   the index of the bit to be changed.
  * @param     value   the value to be stored in the bit.
- * @throws	IndexOutOfBoundsException if <tt>bitIndex&lt;0 || bitIndex&gt;=size()</tt>
+ * @throws  IndexOutOfBoundsException if <tt>bitIndex&lt;0 || bitIndex&gt;=size()</tt>
  */
-public void put(int bitIndex, boolean value) {	
-	if (bitIndex<0 || bitIndex>=nbits) throw new IndexOutOfBoundsException(String.valueOf(bitIndex));
-	if (value) 
-		QuickBitVector.set(bits, bitIndex);
-	else 
-		QuickBitVector.clear(bits, bitIndex);
+public void put(int bitIndex, boolean value) {  
+  if (bitIndex<0 || bitIndex>=nbits) throw new IndexOutOfBoundsException(String.valueOf(bitIndex));
+  if (value) 
+    QuickBitVector.set(bits, bitIndex);
+  else 
+    QuickBitVector.clear(bits, bitIndex);
 }
 /**
  * Sets bits of the receiver from index <code>from</code> to index <code>to</code> to the bits of <code>value</code>.
@@ -591,13 +589,13 @@
  * @param value the value to be copied into the receiver.
  * @param from index of start bit (inclusive).
  * @param to index of end bit (inclusive).
- * @throws	IndexOutOfBoundsException if <tt>from&lt;0 || from&gt;=size() || to&lt;0 || to&gt;=size() || to-from+1<0 || to-from+1>64</tt>.
+ * @throws  IndexOutOfBoundsException if <tt>from&lt;0 || from&gt;=size() || to&lt;0 || to&gt;=size() || to-from+1<0 || to-from+1>64</tt>.
  */
 public void putLongFromTo(long value, int from, int to) {
-	int width = to-from+1;
-	if (width==0) return;
-	if (from<0 || from>=nbits || to<0 || to>=nbits || width<0 || width>QuickBitVector.BITS_PER_UNIT) throw new IndexOutOfBoundsException("from:"+from+", to:"+to);
-	QuickBitVector.putLongFromTo(bits, value, from, to);
+  int width = to-from+1;
+  if (width==0) return;
+  if (from<0 || from>=nbits || to<0 || to>=nbits || width<0 || width>QuickBitVector.BITS_PER_UNIT) throw new IndexOutOfBoundsException("from:"+from+", to:"+to);
+  QuickBitVector.putLongFromTo(bits, value, from, to);
 }
 /**
  * Sets the bit with index <tt>bitIndex</tt> to the state specified by <tt>value</tt>; <b>WARNING:</b> Does not check preconditions.
@@ -609,11 +607,11 @@
  * @param     bitIndex   the index of the bit to be changed.
  * @param     value   the value to be stored in the bit.
  */
-public void putQuick(int bitIndex, boolean value) {	
-	if (value) 
-		QuickBitVector.set(bits, bitIndex);
-	else 
-		QuickBitVector.clear(bits, bitIndex);
+public void putQuick(int bitIndex, boolean value) {  
+  if (value) 
+    QuickBitVector.set(bits, bitIndex);
+  else 
+    QuickBitVector.clear(bits, bitIndex);
 }
 /**
  * Replaces the bits of the receiver in the given range with the bits of another bit vector.
@@ -629,46 +627,46 @@
  * @throws IndexOutOfBoundsException if <tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size() || sourceFrom<0 || sourceFrom+to-from+1>source.size()))</tt>.
  */
 public void replaceFromToWith(int from, int to, BitVector source, int sourceFrom) {
-	if (nbits==0 || to==from-1) return;
-	checkRangeFromTo(from, to, nbits);
-	int length=to-from+1;
-	if (sourceFrom<0 || sourceFrom+length>source.size()) {
-		throw new IndexOutOfBoundsException();
-	}
+  if (nbits==0 || to==from-1) return;
+  checkRangeFromTo(from, to, nbits);
+  int length=to-from+1;
+  if (sourceFrom<0 || sourceFrom+length>source.size()) {
+    throw new IndexOutOfBoundsException();
+  }
 
-	if (source.bits==this.bits && from<=sourceFrom && sourceFrom<=to) { // dangerous intersection
-		source = source.copy();
-	}
-		
-	final long[] theBits = this.bits; // cached for speed.
-	final long[] sourceBits = source.bits; // cached for speed.
+  if (source.bits==this.bits && from<=sourceFrom && sourceFrom<=to) { // dangerous intersection
+    source = source.copy();
+  }
+    
+  final long[] theBits = this.bits; // cached for speed.
+  final long[] sourceBits = source.bits; // cached for speed.
 
-	/* 
-	This version is equivalent to the version below but 20 times slower...
-	for (int i=from; --length >= 0; i++, sourceFrom++) {
-		QuickBitVector.put(theBits,i,QuickBitVector.get(sourceBits,sourceFrom));
-	}
-	*/
+  /* 
+  This version is equivalent to the version below but 20 times slower...
+  for (int i=from; --length >= 0; i++, sourceFrom++) {
+    QuickBitVector.put(theBits,i,QuickBitVector.get(sourceBits,sourceFrom));
+  }
+  */
 
-	// Low level implementation for speed.
-	// This could be done even faster by implementing on even lower levels. But then the code would probably become a "don't touch" piece.
-	final int width = to-from+1;
-	final int blocks = QuickBitVector.unit(width); // width/64
-	final int bitsPerUnit = QuickBitVector.BITS_PER_UNIT;
-	final int bitsPerUnitMinusOne = bitsPerUnit-1;
+  // Low level implementation for speed.
+  // This could be done even faster by implementing on even lower levels. But then the code would probably become a "don't touch" piece.
+  final int width = to-from+1;
+  final int blocks = QuickBitVector.unit(width); // width/64
+  final int bitsPerUnit = QuickBitVector.BITS_PER_UNIT;
+  final int bitsPerUnitMinusOne = bitsPerUnit-1;
 
-	// copy entire 64 bit blocks, if any.
-	for (int i=blocks; --i >=0; ) {
-		long val = QuickBitVector.getLongFromTo(sourceBits,sourceFrom,sourceFrom+bitsPerUnitMinusOne);
-		QuickBitVector.putLongFromTo(theBits,val,from,from+bitsPerUnitMinusOne);
-		sourceFrom += bitsPerUnit;
-		from += bitsPerUnit;
-	}
+  // copy entire 64 bit blocks, if any.
+  for (int i=blocks; --i >=0; ) {
+    long val = QuickBitVector.getLongFromTo(sourceBits,sourceFrom,sourceFrom+bitsPerUnitMinusOne);
+    QuickBitVector.putLongFromTo(theBits,val,from,from+bitsPerUnitMinusOne);
+    sourceFrom += bitsPerUnit;
+    from += bitsPerUnit;
+  }
 
-	// copy trailing bits, if any.
-	int offset = QuickBitVector.offset(width); //width%64
-	long val = QuickBitVector.getLongFromTo(sourceBits,sourceFrom,sourceFrom+offset-1);
-	QuickBitVector.putLongFromTo(theBits,val,from,from+offset-1);	
+  // copy trailing bits, if any.
+  int offset = QuickBitVector.offset(width); //width%64
+  long val = QuickBitVector.getLongFromTo(sourceBits,sourceFrom,sourceFrom+offset-1);
+  QuickBitVector.putLongFromTo(theBits,val,from,from+offset-1);  
 }
 /**
  * Sets the bits in the given range to the state specified by <tt>value</tt>.
@@ -681,61 +679,61 @@
  * @throws IndexOutOfBoundsException if <tt>size()&gt;0 && (from&lt;0 || from&gt;to || to&gt;=size())</tt>.
  */
 public void replaceFromToWith(int from, int to, boolean value) {
-	if (nbits==0 || to==from-1) return;
-	checkRangeFromTo(from, to, nbits);
-	final long[] theBits = this.bits; // cached for speed
-	
-	int fromUnit = QuickBitVector.unit(from);
-	int fromOffset = QuickBitVector.offset(from);
-	int toUnit = QuickBitVector.unit(to);
-	int toOffset = QuickBitVector.offset(to);
-	int bitsPerUnit = QuickBitVector.BITS_PER_UNIT;
+  if (nbits==0 || to==from-1) return;
+  checkRangeFromTo(from, to, nbits);
+  final long[] theBits = this.bits; // cached for speed
+  
+  int fromUnit = QuickBitVector.unit(from);
+  int fromOffset = QuickBitVector.offset(from);
+  int toUnit = QuickBitVector.unit(to);
+  int toOffset = QuickBitVector.offset(to);
+  int bitsPerUnit = QuickBitVector.BITS_PER_UNIT;
 
-	long filler;
-	if (value) filler = ~0L; 
-	else filler = 0L;
+  long filler;
+  if (value) filler = ~0L; 
+  else filler = 0L;
 
-	int bitIndex=from;
-	if (fromUnit==toUnit) { // only one unit to do
-		QuickBitVector.putLongFromTo(theBits,filler,bitIndex,bitIndex+to-from);
-		//slower: for (; bitIndex<=to; ) QuickBitVector.put(theBits,bitIndex++,value);
-		return;
-	}
+  int bitIndex=from;
+  if (fromUnit==toUnit) { // only one unit to do
+    QuickBitVector.putLongFromTo(theBits,filler,bitIndex,bitIndex+to-from);
+    //slower: for (; bitIndex<=to; ) QuickBitVector.put(theBits,bitIndex++,value);
+    return;
+  }
 
-	// treat leading partial unit, if any.
-	if (fromOffset > 0) { // fix by Olivier Janssens
-		QuickBitVector.putLongFromTo(theBits,filler,bitIndex,bitIndex+bitsPerUnit-fromOffset);
-		bitIndex += bitsPerUnit-fromOffset+1;
-		/* slower:
-		for (int i=bitsPerUnit-fromOffset; --i >= 0; ) {
-			QuickBitVector.put(theBits,bitIndex++,value);
-		}*/	
-		fromUnit++;
-	}	
-	if (toOffset<bitsPerUnit-1) toUnit--; // there is a trailing partial unit
-	
-	// treat full units, if any.
-	for (int i=fromUnit; i<=toUnit; ) theBits[i++] = filler;
-	if (fromUnit<=toUnit) bitIndex += (toUnit-fromUnit+1)*bitsPerUnit;
+  // treat leading partial unit, if any.
+  if (fromOffset > 0) { // fix by Olivier Janssens
+    QuickBitVector.putLongFromTo(theBits,filler,bitIndex,bitIndex+bitsPerUnit-fromOffset);
+    bitIndex += bitsPerUnit-fromOffset+1;
+    /* slower:
+    for (int i=bitsPerUnit-fromOffset; --i >= 0; ) {
+      QuickBitVector.put(theBits,bitIndex++,value);
+    }*/  
+    fromUnit++;
+  }  
+  if (toOffset<bitsPerUnit-1) toUnit--; // there is a trailing partial unit
+  
+  // treat full units, if any.
+  for (int i=fromUnit; i<=toUnit; ) theBits[i++] = filler;
+  if (fromUnit<=toUnit) bitIndex += (toUnit-fromUnit+1)*bitsPerUnit;
 
-	// treat trailing partial unit, if any.
-	if (toOffset<bitsPerUnit-1) {
-		QuickBitVector.putLongFromTo(theBits,filler,bitIndex,to);
-		/* slower:
-		for (int i=toOffset+1; --i >= 0; ) {
-			QuickBitVector.put(theBits,bitIndex++,value);
-		}*/
-	}	
+  // treat trailing partial unit, if any.
+  if (toOffset<bitsPerUnit-1) {
+    QuickBitVector.putLongFromTo(theBits,filler,bitIndex,to);
+    /* slower:
+    for (int i=toOffset+1; --i >= 0; ) {
+      QuickBitVector.put(theBits,bitIndex++,value);
+    }*/
+  }  
 }
 /**
  * Changes the bit with index <tt>bitIndex</tt> to the "set" (<tt>true</tt>) state.
  *
  * @param     bitIndex   the index of the bit to be set.
- * @throws	IndexOutOfBoundsException if <tt>bitIndex&lt;0 || bitIndex&gt;=size()</tt>
+ * @throws  IndexOutOfBoundsException if <tt>bitIndex&lt;0 || bitIndex&gt;=size()</tt>
  */
 public void set(int bitIndex) {
-	if (bitIndex<0 || bitIndex>=nbits) throw new IndexOutOfBoundsException(String.valueOf(bitIndex));
-	QuickBitVector.set(bits, bitIndex);
+  if (bitIndex<0 || bitIndex>=nbits) throw new IndexOutOfBoundsException(String.valueOf(bitIndex));
+  QuickBitVector.set(bits, bitIndex);
 }
 /**
  * Shrinks or expands the receiver so that it holds <tt>newSize</tt> bits.
@@ -747,17 +745,17 @@
  * @throws IllegalArgumentException if <tt>size &lt; 0</tt>.
  */
 public void setSize(int newSize) {
-	if (newSize!=size()) {
-		BitVector newVector = new BitVector(newSize);
-		newVector.replaceFromToWith(0,Math.min(size(),newSize)-1,this,0);
-		elements(newVector.elements(),newSize);
-	}
+  if (newSize!=size()) {
+    BitVector newVector = new BitVector(newSize);
+    newVector.replaceFromToWith(0,Math.min(size(),newSize)-1,this,0);
+    elements(newVector.elements(),newSize);
+  }
 }
 /**
  * Returns the size of the receiver.
  */
 public int size() {
-	return nbits;
+  return nbits;
 }
 /**
  * Returns a string representation of the receiver. For every index 
@@ -770,20 +768,20 @@
  * @return  a string representation of this bit vector.
  */
 public String toString() {
-	StringBuffer buffer = new StringBuffer(nbits);
-	String separator = "";
-	buffer.append('{');
+  StringBuffer buffer = new StringBuffer(nbits);
+  String separator = "";
+  buffer.append('{');
 
-	for (int i = 0 ; i < nbits; i++) {
-	    if (get(i)) {
-			buffer.append(separator);
-			separator = ", ";
-			buffer.append(i);
-	    }
-	}
+  for (int i = 0 ; i < nbits; i++) {
+      if (get(i)) {
+      buffer.append(separator);
+      separator = ", ";
+      buffer.append(i);
+      }
+  }
 
-	buffer.append('}');
-	return buffer.toString();
+  buffer.append('}');
+  return buffer.toString();
 }
 /**
  * Performs a logical <b>XOR</b> of the receiver with another bit vector (A = A ^ B).
@@ -800,9 +798,9 @@
  * @throws IllegalArgumentException if <tt>size() &gt; other.size()</tt>.
  */
 public void xor(BitVector other) {
-	checkSize(other);
-	final long[] theBits = this.bits; // cached for speed.
-	final long[] otherBits = other.bits; //cached for speed.
-	for(int i=theBits.length; --i >= 0;) theBits[i] ^= otherBits[i];
+  checkSize(other);
+  final long[] theBits = this.bits; // cached for speed.
+  final long[] otherBits = other.bits; //cached for speed.
+  for(int i=theBits.length; --i >= 0;) theBits[i] ^= otherBits[i];
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/bitvector/BitMatrix.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/bitvector/BitMatrix.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/bitvector/BitMatrix.java	(working copy)
@@ -30,8 +30,6 @@
  * <p>
  * <b>Note</b> that this implementation is not synchronized.
  *
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 09/24/99
  * @see     BitVector
  * @see     QuickBitVector
  * @see     java.util.BitSet
@@ -42,17 +40,17 @@
  */
 @Deprecated
 public class BitMatrix extends PersistentObject {
-	protected int columns;
-	protected int rows;
+  protected int columns;
+  protected int rows;
 
-	/*
-	 * The bits of this matrix.
-	 * bits are stored in row major, i.e.
-	 * bitIndex==row*columns + column
-	 * columnOf(bitIndex)==bitIndex%columns
-	 * rowOf(bitIndex)==bitIndex/columns
-	 */
-	protected long bits[]; 
+  /*
+   * The bits of this matrix.
+   * bits are stored in row major, i.e.
+   * bitIndex==row*columns + column
+   * columnOf(bitIndex)==bitIndex%columns
+   * rowOf(bitIndex)==bitIndex/columns
+   */
+  protected long bits[]; 
 /**
  * Constructs a bit matrix with a given number of columns and rows. All bits are initially <tt>false</tt>.
  * @param columns the number of columns the matrix shall have.
@@ -60,7 +58,7 @@
  * @throws IllegalArgumentException if <tt>columns &lt; 0 || rows &lt; 0</tt>.
  */
 public BitMatrix(int columns, int rows) {
-	elements(QuickBitVector.makeBitVector(columns*rows,1),columns,rows);
+  elements(QuickBitVector.makeBitVector(columns*rows,1),columns,rows);
 }
 /**
  * Performs a logical <b>AND</b> of the receiver with another bit matrix.
@@ -73,8 +71,8 @@
  * @throws IllegalArgumentException if <tt>columns() != other.columns() || rows() != other.rows()</tt>.
  */
 public void and(BitMatrix other) {
-	checkDimensionCompatibility(other);
-	toBitVector().and(other.toBitVector());
+  checkDimensionCompatibility(other);
+  toBitVector().and(other.toBitVector());
 }
 /**
  * Clears all of the bits in receiver whose corresponding
@@ -85,27 +83,27 @@
  * @throws IllegalArgumentException if <tt>columns() != other.columns() || rows() != other.rows()</tt>.
  */
 public void andNot(BitMatrix other) {
-	checkDimensionCompatibility(other);
-	toBitVector().andNot(other.toBitVector());
+  checkDimensionCompatibility(other);
+  toBitVector().andNot(other.toBitVector());
 }
 /**
  * Returns the number of bits currently in the <tt>true</tt> state.
  * Optimized for speed. Particularly quick if the receiver is either sparse or dense.
  */
 public int cardinality() {
-	return toBitVector().cardinality();
+  return toBitVector().cardinality();
 }
 /**
  * Sanity check for operations requiring matrices with the same number of columns and rows.
  */
 protected void checkDimensionCompatibility(BitMatrix other) {
-	if (columns != other.columns() || rows != other.rows()) throw new IllegalArgumentException("Incompatible dimensions: (columns,rows)=("+columns+","+rows+"), (other.columns,other.rows)=("+other.columns()+","+other.rows()+")");
+  if (columns != other.columns() || rows != other.rows()) throw new IllegalArgumentException("Incompatible dimensions: (columns,rows)=("+columns+","+rows+"), (other.columns,other.rows)=("+other.columns()+","+other.rows()+")");
 }
 /**
  * Clears all bits of the receiver.
  */
 public void clear() {
-	toBitVector().clear();
+  toBitVector().clear();
 }
 /**
  * Cloning this <code>BitMatrix</code> produces a new <code>BitMatrix</code> 
@@ -117,21 +115,21 @@
  * @return  a clone of this bit matrix.
  */
 public Object clone() {
-	BitMatrix clone = (BitMatrix) super.clone();
-	if (this.bits != null) clone.bits = (long[]) this.bits.clone();
-	return clone;
+  BitMatrix clone = (BitMatrix) super.clone();
+  if (this.bits != null) clone.bits = (long[]) this.bits.clone();
+  return clone;
 }
 /**
  * Returns the number of columns of the receiver.
  */
 public int columns() {
-	return columns;
+  return columns;
 }
 /**
  * Checks whether the receiver contains the given box.
  */
 protected void containsBox(int column, int row, int width, int height) {
-	if (column<0 || column+width>columns || row<0 || row+height>rows) throw new IndexOutOfBoundsException("column:"+column+", row:"+row+" ,width:"+width+", height:"+height);
+  if (column<0 || column+width>columns || row<0 || row+height>rows) throw new IndexOutOfBoundsException("column:"+column+", row:"+row+" ,width:"+width+", height:"+height);
 }
 /**
  * Returns a shallow clone of the receiver; calls <code>clone()</code> and casts the result.
@@ -139,10 +137,10 @@
  * @return  a shallow clone of the receiver.
  */
 public BitMatrix copy() {
-	return (BitMatrix) clone();
+  return (BitMatrix) clone();
 }
 protected long[] elements() {
-	return bits;
+  return bits;
 }
 /**
  * You normally need not use this method. Use this method only if performance is critical. 
@@ -152,10 +150,10 @@
  * @throws IllegalArgumentException if <tt>columns &lt; 0 || rows &lt; 0 || columns*rows &gt; bits.length*64</tt>
  */
 protected void elements(long[] bits, int columns, int rows) {
-	if (columns<0 || columns<0 || columns*rows>bits.length*QuickBitVector.BITS_PER_UNIT) throw new IllegalArgumentException();
-	this.bits = bits;
-	this.columns = columns;
-	this.rows = rows;
+  if (columns<0 || columns<0 || columns*rows>bits.length*QuickBitVector.BITS_PER_UNIT) throw new IllegalArgumentException();
+  this.bits = bits;
+  this.columns = columns;
+  this.rows = rows;
 }
 /**
  * Compares this object against the specified object.
@@ -168,15 +166,15 @@
  *          <code>false</code> otherwise.
  */
 public boolean equals(Object obj) {
-	if (obj == null || !(obj instanceof BitMatrix))
-		return false;
-	if (this == obj)
-		return true;
+  if (obj == null || !(obj instanceof BitMatrix))
+    return false;
+  if (this == obj)
+    return true;
 
-	BitMatrix other = (BitMatrix) obj;
-	if (columns != other.columns() || rows != other.rows()) return false;
+  BitMatrix other = (BitMatrix) obj;
+  if (columns != other.columns() || rows != other.rows()) return false;
 
-	return toBitVector().equals(other.toBitVector());
+  return toBitVector().equals(other.toBitVector());
 }
 /**
  * Applies a procedure to each coordinate that holds a bit in the given state.
@@ -193,95 +191,95 @@
  * @return <tt>false</tt> if the procedure stopped before all elements where iterated over, <tt>true</tt> otherwise. 
  */
 public boolean forEachCoordinateInState(boolean state, final org.apache.mahout.matrix.function.IntIntProcedure procedure) {
-	/*
-	this is equivalent to the low level version below, apart from that it iterates in the reverse oder and is slower.
-	if (size()==0) return true;
-	BitVector vector = toBitVector();
-	return vector.forEachIndexFromToInState(0,size()-1,state,
-		new org.apache.mahout.matrix.function.IntFunction() {
-			public boolean apply(int index) {
-				return function.apply(index%columns, index/columns);
-			}
-		}
-	);
-	*/
+  /*
+  this is equivalent to the low level version below, apart from that it iterates in the reverse oder and is slower.
+  if (size()==0) return true;
+  BitVector vector = toBitVector();
+  return vector.forEachIndexFromToInState(0,size()-1,state,
+    new org.apache.mahout.matrix.function.IntFunction() {
+      public boolean apply(int index) {
+        return function.apply(index%columns, index/columns);
+      }
+    }
+  );
+  */
 
-	//low level implementation for speed.
-	if (size()==0) return true;
-	BitVector vector = new BitVector(bits,size());
+  //low level implementation for speed.
+  if (size()==0) return true;
+  BitVector vector = new BitVector(bits,size());
 
-	long[] theBits=bits;
+  long[] theBits=bits;
 
-	int column=columns-1;
-	int row=rows-1;
+  int column=columns-1;
+  int row=rows-1;
 
-	// for each coordinate of bits of partial unit
-	long val = theBits[bits.length-1];
-	for (int j=vector.numberOfBitsInPartialUnit(); --j >= 0; ) {
-		long mask = val & (1L << j);
-		if ((state && (mask!=0L)) || ((!state) && (mask==0L))) {
-			if (!procedure.apply(column,row)) return false;
-		}
-		if (--column < 0) {
-			column=columns-1;
-			--row;
-		}
-	}
-		
+  // for each coordinate of bits of partial unit
+  long val = theBits[bits.length-1];
+  for (int j=vector.numberOfBitsInPartialUnit(); --j >= 0; ) {
+    long mask = val & (1L << j);
+    if ((state && (mask!=0L)) || ((!state) && (mask==0L))) {
+      if (!procedure.apply(column,row)) return false;
+    }
+    if (--column < 0) {
+      column=columns-1;
+      --row;
+    }
+  }
+    
 
-	// for each coordinate of bits of full units
-	final int bitsPerUnit = QuickBitVector.BITS_PER_UNIT;
-	long comparator;
-	if (state) comparator = 0L;
-	else comparator = ~0L; // all 64 bits set
+  // for each coordinate of bits of full units
+  final int bitsPerUnit = QuickBitVector.BITS_PER_UNIT;
+  long comparator;
+  if (state) comparator = 0L;
+  else comparator = ~0L; // all 64 bits set
 
-	for(int i=vector.numberOfFullUnits(); --i >= 0;) {
-		val = theBits[i];
-		if (val != comparator) { 
-			// at least one element within current unit matches.
-			// iterate over all bits within current unit.
-			if (state) {
-				for (int j=bitsPerUnit; --j >= 0; ) {
-					if (((val & (1L << j))) != 0L) {
-						if (!procedure.apply(column,row)) return false;
-					}
-					if (--column < 0) {
-						column=columns-1;
-						--row;
-					}
-				}
-			}
-			else { // unrolled comparison for speed.
-				for (int j=bitsPerUnit; --j >= 0; ) {
-					if (((val & (1L << j))) == 0L) {
-						if (!procedure.apply(column,row)) return false;
-					}
-					if (--column < 0) {
-						column=columns-1;
-						--row;
-					}
-				}
-			}
-		
-		}
-		else { // no element within current unit matches --> skip unit
-			column -= bitsPerUnit;
-			if (column < 0) {
-				// avoid implementation with *, /, %
-				column += bitsPerUnit;
-				for (int j=bitsPerUnit; --j >= 0; ) {
-					if (--column < 0) {
-						column=columns-1;
-						--row;
-					}
-				}
-			}
-		}
-		
-	}
+  for(int i=vector.numberOfFullUnits(); --i >= 0;) {
+    val = theBits[i];
+    if (val != comparator) { 
+      // at least one element within current unit matches.
+      // iterate over all bits within current unit.
+      if (state) {
+        for (int j=bitsPerUnit; --j >= 0; ) {
+          if (((val & (1L << j))) != 0L) {
+            if (!procedure.apply(column,row)) return false;
+          }
+          if (--column < 0) {
+            column=columns-1;
+            --row;
+          }
+        }
+      }
+      else { // unrolled comparison for speed.
+        for (int j=bitsPerUnit; --j >= 0; ) {
+          if (((val & (1L << j))) == 0L) {
+            if (!procedure.apply(column,row)) return false;
+          }
+          if (--column < 0) {
+            column=columns-1;
+            --row;
+          }
+        }
+      }
+    
+    }
+    else { // no element within current unit matches --> skip unit
+      column -= bitsPerUnit;
+      if (column < 0) {
+        // avoid implementation with *, /, %
+        column += bitsPerUnit;
+        for (int j=bitsPerUnit; --j >= 0; ) {
+          if (--column < 0) {
+            column=columns-1;
+            --row;
+          }
+        }
+      }
+    }
+    
+  }
 
-	return true;
-	
+  return true;
+  
 }
 /**
  * Returns from the receiver the value of the bit at the specified coordinate.
@@ -290,11 +288,11 @@
  * @param     column   the index of the column-coordinate.
  * @param     row   the index of the row-coordinate.
  * @return    the value of the bit at the specified coordinate.
- * @throws	IndexOutOfBoundsException if <tt>column&lt;0 || column&gt;=columns() || row&lt;0 || row&gt;=rows()</tt>
+ * @throws  IndexOutOfBoundsException if <tt>column&lt;0 || column&gt;=columns() || row&lt;0 || row&gt;=rows()</tt>
  */
 public boolean get(int column, int row) {
-	if (column<0 || column>=columns || row<0 || row>=rows) throw new IndexOutOfBoundsException("column:"+column+", row:"+row);
-	return QuickBitVector.get(bits, row*columns + column);
+  if (column<0 || column>=columns || row<0 || row>=rows) throw new IndexOutOfBoundsException("column:"+column+", row:"+row);
+  return QuickBitVector.get(bits, row*columns + column);
 }
 /**
  * Returns from the receiver the value of the bit at the specified coordinate; <b>WARNING:</b> Does not check preconditions.
@@ -309,19 +307,19 @@
  * @return    the value of the bit at the specified coordinate.
  */
 public boolean getQuick(int column, int row) {
-	return QuickBitVector.get(bits, row*columns + column);
+  return QuickBitVector.get(bits, row*columns + column);
 }
 /**
  * Returns a hash code value for the receiver. 
  */
 public int hashCode() {
-	return toBitVector().hashCode();
+  return toBitVector().hashCode();
 }
 /**
  * Performs a logical <b>NOT</b> on the bits of the receiver.
  */
 public void not() {
-	toBitVector().not();
+  toBitVector().not();
 }
 /**
  * Performs a logical <b>OR</b> of the receiver with another bit matrix.
@@ -334,8 +332,8 @@
  * @throws IllegalArgumentException if <tt>columns() != other.columns() || rows() != other.rows()</tt>.
  */
 public void or(BitMatrix other) {
-	checkDimensionCompatibility(other);
-	toBitVector().or(other.toBitVector());
+  checkDimensionCompatibility(other);
+  toBitVector().or(other.toBitVector());
 }
 /**
  * Constructs and returns a new matrix with <tt>width</tt> columns and <tt>height</tt> rows which is a copy of the contents of the given box.
@@ -344,15 +342,15 @@
  * @param     row   the index of the row-coordinate.
  * @param     width   the width of the box.
  * @param     height   the height of the box.
- * @throws	IndexOutOfBoundsException if <tt>column&lt;0 || column+width&gt;columns() || row&lt;0 || row+height&gt;rows()</tt>
+ * @throws  IndexOutOfBoundsException if <tt>column&lt;0 || column+width&gt;columns() || row&lt;0 || row+height&gt;rows()</tt>
  */
 public BitMatrix part(int column, int row, int width, int height) {
-	if (column<0 || column+width>columns || row<0 || row+height>rows) throw new IndexOutOfBoundsException("column:"+column+", row:"+row+" ,width:"+width+", height:"+height);
-	if (width<=0 || height<=0) return new BitMatrix(0,0);
+  if (column<0 || column+width>columns || row<0 || row+height>rows) throw new IndexOutOfBoundsException("column:"+column+", row:"+row+" ,width:"+width+", height:"+height);
+  if (width<=0 || height<=0) return new BitMatrix(0,0);
 
-	BitMatrix subMatrix = new BitMatrix(width,height);
-	subMatrix.replaceBoxWith(0,0,width,height,this,column,row);
-	return subMatrix;
+  BitMatrix subMatrix = new BitMatrix(width,height);
+  subMatrix.replaceBoxWith(0,0,width,height,this,column,row);
+  return subMatrix;
 }
 /**
  * Sets the bit at the specified coordinate to the state specified by <tt>value</tt>.
@@ -360,11 +358,11 @@
  * @param     column   the index of the column-coordinate.
  * @param     row   the index of the row-coordinate.
  * @param    value the value of the bit to be copied into the specified coordinate.
- * @throws	IndexOutOfBoundsException if <tt>column&lt;0 || column&gt;=columns() || row&lt;0 || row&gt;=rows()</tt>
+ * @throws  IndexOutOfBoundsException if <tt>column&lt;0 || column&gt;=columns() || row&lt;0 || row&gt;=rows()</tt>
  */
 public void put(int column, int row, boolean value) {
-	if (column<0 || column>=columns || row<0 || row>=rows) throw new IndexOutOfBoundsException("column:"+column+", row:"+row);
-	QuickBitVector.put(bits, row*columns + column, value);
+  if (column<0 || column>=columns || row<0 || row>=rows) throw new IndexOutOfBoundsException("column:"+column+", row:"+row);
+  QuickBitVector.put(bits, row*columns + column, value);
 }
 /**
  * Sets the bit at the specified coordinate to the state specified by <tt>value</tt>; <b>WARNING:</b> Does not check preconditions.
@@ -378,7 +376,7 @@
  * @param    value the value of the bit to be copied into the specified coordinate.
  */
 public void putQuick(int column, int row, boolean value) {
-	QuickBitVector.put(bits, row*columns + column, value);
+  QuickBitVector.put(bits, row*columns + column, value);
 }
 /**
  * Replaces a box of the receiver with the contents of another matrix's box.
@@ -394,30 +392,30 @@
  * @param     source   the source matrix to copy from(may be identical to the receiver).
  * @param     sourceColumn   the index of the source column-coordinate.
  * @param     sourceRow   the index of the source row-coordinate.
- * @throws	IndexOutOfBoundsException if <tt>column&lt;0 || column+width&gt;columns() || row&lt;0 || row+height&gt;rows()</tt>
- * @throws	IndexOutOfBoundsException if <tt>sourceColumn&lt;0 || sourceColumn+width&gt;source.columns() || sourceRow&lt;0 || sourceRow+height&gt;source.rows()</tt>
+ * @throws  IndexOutOfBoundsException if <tt>column&lt;0 || column+width&gt;columns() || row&lt;0 || row+height&gt;rows()</tt>
+ * @throws  IndexOutOfBoundsException if <tt>sourceColumn&lt;0 || sourceColumn+width&gt;source.columns() || sourceRow&lt;0 || sourceRow+height&gt;source.rows()</tt>
  */
 public void replaceBoxWith(int column, int row, int width, int height, BitMatrix source, int sourceColumn, int sourceRow) {
-	this.containsBox(column,row,width,height);
-	source.containsBox(sourceColumn,sourceRow,width,height);
-	if (width<=0 || height<=0) return;
+  this.containsBox(column,row,width,height);
+  source.containsBox(sourceColumn,sourceRow,width,height);
+  if (width<=0 || height<=0) return;
 
-	if (source==this) {
-		Rectangle destRect = new Rectangle(column,row,width,height);
-		Rectangle sourceRect = new Rectangle(sourceColumn,sourceRow,width,height);
-		if (destRect.intersects(sourceRect)) { // dangerous intersection
-			source = source.copy();
-		}
-	}
+  if (source==this) {
+    Rectangle destRect = new Rectangle(column,row,width,height);
+    Rectangle sourceRect = new Rectangle(sourceColumn,sourceRow,width,height);
+    if (destRect.intersects(sourceRect)) { // dangerous intersection
+      source = source.copy();
+    }
+  }
 
-	BitVector sourceVector = source.toBitVector();
-	BitVector destVector = this.toBitVector();
-	int sourceColumns = source.columns();
-	for (; --height >=0; row++, sourceRow++) {
-		int offset = row*columns + column;
-		int sourceOffset = sourceRow*sourceColumns + sourceColumn;
-		destVector.replaceFromToWith(offset,offset+width-1,sourceVector,sourceOffset);
-	}
+  BitVector sourceVector = source.toBitVector();
+  BitVector destVector = this.toBitVector();
+  int sourceColumns = source.columns();
+  for (; --height >=0; row++, sourceRow++) {
+    int offset = row*columns + column;
+    int sourceOffset = sourceRow*sourceColumns + sourceColumn;
+    destVector.replaceFromToWith(offset,offset+width-1,sourceVector,sourceOffset);
+  }
 }
 /**
  * Sets the bits in the given box to the state specified by <tt>value</tt>.
@@ -428,29 +426,29 @@
  * @param     width   the width of the box.
  * @param     height   the height of the box.
  * @param    value the value of the bit to be copied into the bits of the specified box.
- * @throws	IndexOutOfBoundsException if <tt>column&lt;0 || column+width&gt;columns() || row&lt;0 || row+height&gt;rows()</tt>
+ * @throws  IndexOutOfBoundsException if <tt>column&lt;0 || column+width&gt;columns() || row&lt;0 || row+height&gt;rows()</tt>
  */
 public void replaceBoxWith(int column, int row, int width, int height, boolean value) {
-	containsBox(column,row,width,height);
-	if (width<=0 || height<=0) return;
-	
-	BitVector destVector = this.toBitVector();
-	for (; --height >= 0; row++) {
-		int offset = row*columns + column;
-		destVector.replaceFromToWith(offset, offset+width-1,value);
-	}
+  containsBox(column,row,width,height);
+  if (width<=0 || height<=0) return;
+  
+  BitVector destVector = this.toBitVector();
+  for (; --height >= 0; row++) {
+    int offset = row*columns + column;
+    destVector.replaceFromToWith(offset, offset+width-1,value);
+  }
 }
 /**
  * Returns the number of rows of the receiver.
  */
 public int rows() {
-	return rows;
+  return rows;
 }
 /**
  * Returns the size of the receiver which is <tt>columns()*rows()</tt>.
  */
 public int size() {
-	return columns*rows;
+  return columns*rows;
 }
 /**
  * Converts the receiver to a bitvector. 
@@ -460,13 +458,13 @@
  * If this behaviour is not what you want, you should first use <tt>copy()</tt> to make sure both objects use separate internal storage.
  */
 public BitVector toBitVector() {
-	return new BitVector(bits,size());
+  return new BitVector(bits,size());
 }
 /**
  * Returns a (very crude) string representation of the receiver.
  */
 public String toString() {
-	return toBitVector().toString();
+  return toBitVector().toString();
 }
 /**
  * Performs a logical <b>XOR</b> of the receiver with another bit matrix.
@@ -483,7 +481,7 @@
  * @throws IllegalArgumentException if <tt>columns() != other.columns() || rows() != other.rows()</tt>.
  */
 public void xor(BitMatrix other) {
-	checkDimensionCompatibility(other);
-	toBitVector().xor(other.toBitVector());
+  checkDimensionCompatibility(other);
+  toBitVector().xor(other.toBitVector());
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/bitvector/QuickBitVector.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/bitvector/QuickBitVector.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/bitvector/QuickBitVector.java	(working copy)
@@ -15,15 +15,13 @@
  * <b>WARNING: Methods of this class do not check preconditions.</b>
  * Provided with invalid parameters these method may return (or set) invalid values without throwing any exception.
  * <b>You should only use this class when performance is critical and you are absolutely sure that indexes are within bounds.</b>
- * <p>	 
+ * <p>   
  * A bitvector is modelled as a long array, i.e. <tt>long[] bits</tt> holds bits of a bitvector.
  * Each long value holds 64 bits.
  * The i-th bit is stored in bits[i/64] at
  * bit position i % 64 (where bit position 0 refers to the least
  * significant bit and 63 refers to the most significant bit).
  *
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 09/24/99
  * @see     BitVector
  * @see     BitMatrix
  * @see     java.util.BitSet
@@ -33,11 +31,11 @@
  */
 @Deprecated
 public class QuickBitVector extends Object {
-	protected final static int ADDRESS_BITS_PER_UNIT = 6; // 64=2^6
-	protected final static int BITS_PER_UNIT = 64; // = 1 << ADDRESS_BITS_PER_UNIT
-	protected final static int BIT_INDEX_MASK = 63; // = BITS_PER_UNIT - 1;
-	
-	private static final long[] pows = precomputePows(); //precompute bitmasks for speed
+  protected final static int ADDRESS_BITS_PER_UNIT = 6; // 64=2^6
+  protected final static int BITS_PER_UNIT = 64; // = 1 << ADDRESS_BITS_PER_UNIT
+  protected final static int BIT_INDEX_MASK = 63; // = BITS_PER_UNIT - 1;
+  
+  private static final long[] pows = precomputePows(); //precompute bitmasks for speed
 /**
  * Makes this class non instantiable, but still inheritable.
  */
@@ -54,12 +52,12 @@
  * @return the bit mask having all bits between <tt>from</tt> and <tt>to</tt> set to 1.
  */
 public static final long bitMaskWithBitsSetFromTo(int from, int to) {
-	return pows[to-from+1] << from;
+  return pows[to-from+1] << from;
 
-	// This turned out to be slower:
-	// 0xffffffffffffffffL == ~0L == -1L == all 64 bits set.
-	// int width;
-	// return (width=to-from+1) == 0 ? 0L : (0xffffffffffffffffL >>> (BITS_PER_UNIT-width)) << from;
+  // This turned out to be slower:
+  // 0xffffffffffffffffL == ~0L == -1L == all 64 bits set.
+  // int width;
+  // return (width=to-from+1) == 0 ? 0L : (0xffffffffffffffffL >>> (BITS_PER_UNIT-width)) << from;
 }
 /**
  * Changes the bit with index <tt>bitIndex</tt> in the bitvector <tt>bits</tt> to the "clear" (<tt>false</tt>) state.
@@ -68,7 +66,7 @@
  * @param     bitIndex   the index of the bit to be cleared.
  */
 public static void clear(long[] bits, int bitIndex) {
-	bits[bitIndex >> ADDRESS_BITS_PER_UNIT] &= ~(1L << (bitIndex & BIT_INDEX_MASK));
+  bits[bitIndex >> ADDRESS_BITS_PER_UNIT] &= ~(1L << (bitIndex & BIT_INDEX_MASK));
 }
 /**
  * Returns from the bitvector the value of the bit with the specified index.
@@ -80,7 +78,7 @@
  * @return    the value of the bit with the specified index.
  */
 public static boolean get(long[] bits, int bitIndex) {
-	return ((bits[bitIndex >> ADDRESS_BITS_PER_UNIT] & (1L << (bitIndex & BIT_INDEX_MASK))) != 0);
+  return ((bits[bitIndex >> ADDRESS_BITS_PER_UNIT] & (1L << (bitIndex & BIT_INDEX_MASK))) != 0);
 }
 /**
  * Returns a long value representing bits of a bitvector from index <tt>from</tt> to index <tt>to</tt>.
@@ -94,37 +92,37 @@
  * @return the specified bits as long value.
  */
 public static long getLongFromTo(long[] bits, int from, int to) {
-	if (from>to) return 0L;
-	
-	final int fromIndex = from >> ADDRESS_BITS_PER_UNIT; //equivalent to from/64
-	final int toIndex = to >> ADDRESS_BITS_PER_UNIT;
-	final int fromOffset = from & BIT_INDEX_MASK; //equivalent to from%64
-	final int toOffset = to & BIT_INDEX_MASK;
-	//this is equivalent to the above, but slower:
-	//final int fromIndex=from/BITS_PER_UNIT;
-	//final int toIndex=to/BITS_PER_UNIT;
-	//final int fromOffset=from%BITS_PER_UNIT;
-	//final int toOffset=to%BITS_PER_UNIT;
+  if (from>to) return 0L;
+  
+  final int fromIndex = from >> ADDRESS_BITS_PER_UNIT; //equivalent to from/64
+  final int toIndex = to >> ADDRESS_BITS_PER_UNIT;
+  final int fromOffset = from & BIT_INDEX_MASK; //equivalent to from%64
+  final int toOffset = to & BIT_INDEX_MASK;
+  //this is equivalent to the above, but slower:
+  //final int fromIndex=from/BITS_PER_UNIT;
+  //final int toIndex=to/BITS_PER_UNIT;
+  //final int fromOffset=from%BITS_PER_UNIT;
+  //final int toOffset=to%BITS_PER_UNIT;
 
 
-	long mask;
-	if (fromIndex==toIndex) { //range does not cross unit boundaries; value to retrieve is contained in one single long value.
-		mask=bitMaskWithBitsSetFromTo(fromOffset, toOffset);
-		return (bits[fromIndex]	& mask) >>> fromOffset;
-		
-	}
+  long mask;
+  if (fromIndex==toIndex) { //range does not cross unit boundaries; value to retrieve is contained in one single long value.
+    mask=bitMaskWithBitsSetFromTo(fromOffset, toOffset);
+    return (bits[fromIndex]  & mask) >>> fromOffset;
+    
+  }
 
-	//range crosses unit boundaries; value to retrieve is spread over two long values.
-	//get part from first long value
-	mask=bitMaskWithBitsSetFromTo(fromOffset, BIT_INDEX_MASK);
-	final long x1=(bits[fromIndex] & mask) >>> fromOffset;
-	
-	//get part from second long value
-	mask=bitMaskWithBitsSetFromTo(0, toOffset);
-	final long x2=(bits[toIndex] & mask) << (BITS_PER_UNIT-fromOffset);
-	
-	//combine
-	return x1|x2;
+  //range crosses unit boundaries; value to retrieve is spread over two long values.
+  //get part from first long value
+  mask=bitMaskWithBitsSetFromTo(fromOffset, BIT_INDEX_MASK);
+  final long x1=(bits[fromIndex] & mask) >>> fromOffset;
+  
+  //get part from second long value
+  mask=bitMaskWithBitsSetFromTo(0, toOffset);
+  final long x2=(bits[toIndex] & mask) << (BITS_PER_UNIT-fromOffset);
+  
+  //combine
+  return x1|x2;
 }
 /**
 Returns the index of the least significant bit in state "true".
@@ -138,9 +136,9 @@
 </pre>
 */
 static public int leastSignificantBit(int value) {
-	int i=-1;
-	while (++i < 32 && (((1<<i) & value)) == 0);
-	return i;
+  int i=-1;
+  while (++i < 32 && (((1<<i) & value)) == 0);
+  return i;
 }
 /**
  * Constructs a low level bitvector that holds <tt>size</tt> elements, with each element taking <tt>bitsPerElement</tt> bits.
@@ -150,10 +148,10 @@
  * @return    a low level bitvector.
  */
 public static long[] makeBitVector(int size, int bitsPerElement) {
-	int nBits = size*bitsPerElement;
-	int unitIndex = (nBits-1) >> ADDRESS_BITS_PER_UNIT;
-	long[] bitVector = new long[unitIndex + 1];
-	return bitVector;
+  int nBits = size*bitsPerElement;
+  int unitIndex = (nBits-1) >> ADDRESS_BITS_PER_UNIT;
+  long[] bitVector = new long[unitIndex + 1];
+  return bitVector;
 }
 /**
 Returns the index of the most significant bit in state "true".
@@ -167,16 +165,16 @@
 </pre>
 */
 static public int mostSignificantBit(int value) {
-	int i=32;
-	while (--i >=0 && (((1<<i) & value)) == 0);
-	return i;
+  int i=32;
+  while (--i >=0 && (((1<<i) & value)) == 0);
+  return i;
 }
 /**
  * Returns the index within the unit that contains the given bitIndex.
  */
 protected static int offset(int bitIndex) {
-	return bitIndex & BIT_INDEX_MASK;
-	//equivalent to bitIndex%64
+  return bitIndex & BIT_INDEX_MASK;
+  //equivalent to bitIndex%64
 }
 /**
  * Initializes a table with numbers having 1,2,3,...,64 bits set.
@@ -185,35 +183,35 @@
  * to speedup calculations in subsequent methods.
  */
 private static long[] precomputePows() {
-	long[] pows=new long[BITS_PER_UNIT+1];
-	long value = ~0L;
-	for (int i=BITS_PER_UNIT+1; --i >= 1; ) {
-		pows[i]=value >>> (BITS_PER_UNIT-i);
-		//System.out.println((i)+":"+pows[i]);
-	}
-	pows[0]=0L;
-	//System.out.println((0)+":"+pows[0]);
-	return pows;
+  long[] pows=new long[BITS_PER_UNIT+1];
+  long value = ~0L;
+  for (int i=BITS_PER_UNIT+1; --i >= 1; ) {
+    pows[i]=value >>> (BITS_PER_UNIT-i);
+    //System.out.println((i)+":"+pows[i]);
+  }
+  pows[0]=0L;
+  //System.out.println((0)+":"+pows[0]);
+  return pows;
 
-	//OLD STUFF
-	/*
-	for (int i=BITS_PER_UNIT+1; --i >= 0; ) {
-		pows[i]=value;
-		value = value >>> 1;
-		System.out.println((i)+":"+pows[i]);
-	}
-	*/
-	
-	/*
-	long[] pows=new long[BITS_PER_UNIT];
-	for (int i=0; i<BITS_PER_UNIT-1; i++) {
-		pows[i]=Math.round(Math.pow(2.0,i+1))-1;
-		System.out.println((i)+":"+pows[i]);
-	}
-	pows[BITS_PER_UNIT-1] = ~0L;
-	System.out.println((BITS_PER_UNIT-1)+":"+pows[BITS_PER_UNIT-1]);
-	return pows;
-	*/
+  //OLD STUFF
+  /*
+  for (int i=BITS_PER_UNIT+1; --i >= 0; ) {
+    pows[i]=value;
+    value = value >>> 1;
+    System.out.println((i)+":"+pows[i]);
+  }
+  */
+  
+  /*
+  long[] pows=new long[BITS_PER_UNIT];
+  for (int i=0; i<BITS_PER_UNIT-1; i++) {
+    pows[i]=Math.round(Math.pow(2.0,i+1))-1;
+    System.out.println((i)+":"+pows[i]);
+  }
+  pows[BITS_PER_UNIT-1] = ~0L;
+  System.out.println((BITS_PER_UNIT-1)+":"+pows[BITS_PER_UNIT-1]);
+  return pows;
+  */
 }
 /**
  * Sets the bit with index <tt>bitIndex</tt> in the bitvector <tt>bits</tt> to the state specified by <tt>value</tt>.
@@ -222,11 +220,11 @@
  * @param     bitIndex   the index of the bit to be changed.
  * @param     value   the value to be stored in the bit.
  */
-public static void put(long[] bits, int bitIndex, boolean value) {	
-	if (value) 
-		set(bits, bitIndex);
-	else 
-		clear(bits, bitIndex);
+public static void put(long[] bits, int bitIndex, boolean value) {  
+  if (value) 
+    set(bits, bitIndex);
+  else 
+    clear(bits, bitIndex);
 }
 /**
  * Sets bits of a bitvector from index <code>from</code> to index <code>to</code> to the bits of <code>value</code>.
@@ -241,45 +239,45 @@
  * @param to index of end bit (inclusive).
  */
 public static void putLongFromTo(long[] bits, long value, int from, int to) {
-	if (from>to) return;
-	
-	final int fromIndex=from >> ADDRESS_BITS_PER_UNIT; //equivalent to from/64
-	final int toIndex=to >> ADDRESS_BITS_PER_UNIT;
-	final int fromOffset=from & BIT_INDEX_MASK; //equivalent to from%64
-	final int toOffset=to & BIT_INDEX_MASK;
-	/*
-	this is equivalent to the above, but slower:
-	int fromIndex=from/BITS_PER_UNIT;
-	int toIndex=to/BITS_PER_UNIT;
-	int fromOffset=from%BITS_PER_UNIT;	
-	int toOffset=to%BITS_PER_UNIT;
-	*/
-	
-	//make sure all unused bits to the left are cleared.
-	long mask;
-	mask=bitMaskWithBitsSetFromTo(to-from+1, BIT_INDEX_MASK);
-	long cleanValue=value & (~mask);
+  if (from>to) return;
+  
+  final int fromIndex=from >> ADDRESS_BITS_PER_UNIT; //equivalent to from/64
+  final int toIndex=to >> ADDRESS_BITS_PER_UNIT;
+  final int fromOffset=from & BIT_INDEX_MASK; //equivalent to from%64
+  final int toOffset=to & BIT_INDEX_MASK;
+  /*
+  this is equivalent to the above, but slower:
+  int fromIndex=from/BITS_PER_UNIT;
+  int toIndex=to/BITS_PER_UNIT;
+  int fromOffset=from%BITS_PER_UNIT;  
+  int toOffset=to%BITS_PER_UNIT;
+  */
+  
+  //make sure all unused bits to the left are cleared.
+  long mask;
+  mask=bitMaskWithBitsSetFromTo(to-from+1, BIT_INDEX_MASK);
+  long cleanValue=value & (~mask);
 
-	long shiftedValue;
-	
-	if (fromIndex==toIndex) { //range does not cross unit boundaries; should go into one single long value.
-		shiftedValue=cleanValue << fromOffset;
-		mask=bitMaskWithBitsSetFromTo(fromOffset, toOffset);
-		bits[fromIndex] = (bits[fromIndex] & (~mask)) | shiftedValue;
-		return;
-		
-	}
+  long shiftedValue;
+  
+  if (fromIndex==toIndex) { //range does not cross unit boundaries; should go into one single long value.
+    shiftedValue=cleanValue << fromOffset;
+    mask=bitMaskWithBitsSetFromTo(fromOffset, toOffset);
+    bits[fromIndex] = (bits[fromIndex] & (~mask)) | shiftedValue;
+    return;
+    
+  }
 
-	//range crosses unit boundaries; value should go into two long values.
-	//copy into first long value.
-	shiftedValue=cleanValue << fromOffset;
-	mask=bitMaskWithBitsSetFromTo(fromOffset, BIT_INDEX_MASK);
-	bits[fromIndex] = (bits[fromIndex] & (~mask)) | shiftedValue;
-	
-	//copy into second long value.
-	shiftedValue=cleanValue >>> (BITS_PER_UNIT - fromOffset);
-	mask=bitMaskWithBitsSetFromTo(0, toOffset);
-	bits[toIndex] = (bits[toIndex] & (~mask)) | shiftedValue;
+  //range crosses unit boundaries; value should go into two long values.
+  //copy into first long value.
+  shiftedValue=cleanValue << fromOffset;
+  mask=bitMaskWithBitsSetFromTo(fromOffset, BIT_INDEX_MASK);
+  bits[fromIndex] = (bits[fromIndex] & (~mask)) | shiftedValue;
+  
+  //copy into second long value.
+  shiftedValue=cleanValue >>> (BITS_PER_UNIT - fromOffset);
+  mask=bitMaskWithBitsSetFromTo(0, toOffset);
+  bits[toIndex] = (bits[toIndex] & (~mask)) | shiftedValue;
 }
 /**
  * Changes the bit with index <tt>bitIndex</tt> in the bitvector <tt>bits</tt> to the "set" (<tt>true</tt>) state.
@@ -288,13 +286,13 @@
  * @param     bitIndex   the index of the bit to be set.
  */
 public static void set(long[] bits, int bitIndex) {
-	bits[bitIndex >> ADDRESS_BITS_PER_UNIT] |= 1L << (bitIndex & BIT_INDEX_MASK);           
+  bits[bitIndex >> ADDRESS_BITS_PER_UNIT] |= 1L << (bitIndex & BIT_INDEX_MASK);           
 }
 /**
  * Returns the index of the unit that contains the given bitIndex.
  */
 protected static int unit(int bitIndex) {
-	return bitIndex >> ADDRESS_BITS_PER_UNIT;
-	//equivalent to bitIndex/64
+  return bitIndex >> ADDRESS_BITS_PER_UNIT;
+  //equivalent to bitIndex/64
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/Swapper.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/Swapper.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/Swapper.java	(working copy)
@@ -13,8 +13,6 @@
  *
  * @see org.apache.mahout.matrix.GenericSorting
  *
- * @author wolfgang.hoschek@cern.ch
- * @version 1.0, 03-Jul-99
  */
 /** 
  * @deprecated until unit tests are in place.  Until this time, this class/interface is unsupported.
Index: matrix/src/main/java/org/apache/mahout/matrix/GenericSortingTest.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/GenericSortingTest.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/GenericSortingTest.java	(working copy)
@@ -24,134 +24,134 @@
  * Just a demo.
  */
 public static void demo1() {
-	final int[] x;
-	final double[] y;
-	final double[] z;
+  final int[] x;
+  final double[] y;
+  final double[] z;
 
-	x = new int[]    {3,   2,   1  };
-	y = new double[] {3.0, 2.0, 1.0};
-	z = new double[] {6.0, 7.0, 8.0};
+  x = new int[]    {3,   2,   1  };
+  y = new double[] {3.0, 2.0, 1.0};
+  z = new double[] {6.0, 7.0, 8.0};
 
-	Swapper swapper = new Swapper() {
-		public void swap(int a, int b) {
-			int t1;	double t2, t3;
-			t1 = x[a]; x[a] = x[b];	x[b] = t1;
-			t2 = y[a]; y[a] = y[b]; y[b] = t2;
-			t3 = z[a]; z[a] = z[b];	z[b] = t3;
-		}
-	}; 
+  Swapper swapper = new Swapper() {
+    public void swap(int a, int b) {
+      int t1;  double t2, t3;
+      t1 = x[a]; x[a] = x[b];  x[b] = t1;
+      t2 = y[a]; y[a] = y[b]; y[b] = t2;
+      t3 = z[a]; z[a] = z[b];  z[b] = t3;
+    }
+  }; 
 
-	IntComparator comp = new IntComparator() {
-		public int compare(int a, int b) {
-			return x[a]==x[b] ? 0 : (x[a]<x[b] ? -1 : 1);
-		}
-	};
+  IntComparator comp = new IntComparator() {
+    public int compare(int a, int b) {
+      return x[a]==x[b] ? 0 : (x[a]<x[b] ? -1 : 1);
+    }
+  };
 
-	System.out.println("before:");
-	System.out.println("X="+Arrays.toString(x));
-	System.out.println("Y="+Arrays.toString(y));
-	System.out.println("Z="+Arrays.toString(z));
+  System.out.println("before:");
+  System.out.println("X="+Arrays.toString(x));
+  System.out.println("Y="+Arrays.toString(y));
+  System.out.println("Z="+Arrays.toString(z));
 
-			
-	int from = 0;
-	int to = x.length;
-	GenericSorting.quickSort(from, to, comp, swapper);
+      
+  int from = 0;
+  int to = x.length;
+  GenericSorting.quickSort(from, to, comp, swapper);
 
-	System.out.println("after:");
-	System.out.println("X="+Arrays.toString(x));
-	System.out.println("Y="+Arrays.toString(y));
-	System.out.println("Z="+Arrays.toString(z));
-	System.out.println("\n\n");
+  System.out.println("after:");
+  System.out.println("X="+Arrays.toString(x));
+  System.out.println("Y="+Arrays.toString(y));
+  System.out.println("Z="+Arrays.toString(z));
+  System.out.println("\n\n");
 }
 /**
  * Just a demo.
  */
 public static void demo2() {
-	final int[] x;
-	final double[] y;
-	final double[] z;
+  final int[] x;
+  final double[] y;
+  final double[] z;
 
-	x = new int[]    {6,   7,   8,   9  };
-	y = new double[] {3.0, 2.0, 1.0, 3.0};
-	z = new double[] {5.0, 4.0, 4.0, 1.0};
+  x = new int[]    {6,   7,   8,   9  };
+  y = new double[] {3.0, 2.0, 1.0, 3.0};
+  z = new double[] {5.0, 4.0, 4.0, 1.0};
 
-	Swapper swapper = new Swapper() {
-		public void swap(int a, int b) {
-			int t1;	double t2, t3;
-			t1 = x[a]; x[a] = x[b];	x[b] = t1;
-			t2 = y[a]; y[a] = y[b]; y[b] = t2;
-			t3 = z[a]; z[a] = z[b];	z[b] = t3;
-		}
-	}; 
-	
-	IntComparator comp = new IntComparator() {
-		public int compare(int a, int b) {
-			if (y[a]==y[b]) return z[a]==z[b] ? 0 : (z[a]<z[b] ? -1 : 1);
-			return y[a]<y[b] ? -1 : 1;
-		}
-	};
-	
+  Swapper swapper = new Swapper() {
+    public void swap(int a, int b) {
+      int t1;  double t2, t3;
+      t1 = x[a]; x[a] = x[b];  x[b] = t1;
+      t2 = y[a]; y[a] = y[b]; y[b] = t2;
+      t3 = z[a]; z[a] = z[b];  z[b] = t3;
+    }
+  }; 
+  
+  IntComparator comp = new IntComparator() {
+    public int compare(int a, int b) {
+      if (y[a]==y[b]) return z[a]==z[b] ? 0 : (z[a]<z[b] ? -1 : 1);
+      return y[a]<y[b] ? -1 : 1;
+    }
+  };
+  
 
-	System.out.println("before:");
-	System.out.println("X="+Arrays.toString(x));
-	System.out.println("Y="+Arrays.toString(y));
-	System.out.println("Z="+Arrays.toString(z));
+  System.out.println("before:");
+  System.out.println("X="+Arrays.toString(x));
+  System.out.println("Y="+Arrays.toString(y));
+  System.out.println("Z="+Arrays.toString(z));
 
-			
-	int from = 0;
-	int to = x.length;
-	GenericSorting.quickSort(from, to, comp, swapper);
+      
+  int from = 0;
+  int to = x.length;
+  GenericSorting.quickSort(from, to, comp, swapper);
 
-	System.out.println("after:");
-	System.out.println("X="+Arrays.toString(x));
-	System.out.println("Y="+Arrays.toString(y));
-	System.out.println("Z="+Arrays.toString(z));
-	System.out.println("\n\n");
+  System.out.println("after:");
+  System.out.println("X="+Arrays.toString(x));
+  System.out.println("Y="+Arrays.toString(y));
+  System.out.println("Z="+Arrays.toString(z));
+  System.out.println("\n\n");
 }
 /**
  * Checks the correctness of the partition method by generating random input parameters and checking whether results are correct.
  */
 public static void testRandomly(int runs) {
-	org.apache.mahout.jet.random.engine.RandomEngine engine = new org.apache.mahout.jet.random.engine.MersenneTwister();
-	org.apache.mahout.jet.random.Uniform gen = new org.apache.mahout.jet.random.Uniform(engine);
-	
-	for (int run=0; run<runs; run++) {
-		int maxSize = 50;
-		int maxSplittersSize = 2*maxSize;
-		
-		
-		int size = gen.nextIntFromTo(1,maxSize);
-		int from, to;
-		if (size==0) { 
-			from=0; to=-1;
-		}
-		else {
-			from = gen.nextIntFromTo(0,size-1);
-			to = gen.nextIntFromTo(Math.min(from,size-1),size-1);
-		}
+  org.apache.mahout.jet.random.engine.RandomEngine engine = new org.apache.mahout.jet.random.engine.MersenneTwister();
+  org.apache.mahout.jet.random.Uniform gen = new org.apache.mahout.jet.random.Uniform(engine);
+  
+  for (int run=0; run<runs; run++) {
+    int maxSize = 50;
+    int maxSplittersSize = 2*maxSize;
+    
+    
+    int size = gen.nextIntFromTo(1,maxSize);
+    int from, to;
+    if (size==0) { 
+      from=0; to=-1;
+    }
+    else {
+      from = gen.nextIntFromTo(0,size-1);
+      to = gen.nextIntFromTo(Math.min(from,size-1),size-1);
+    }
 
-		org.apache.mahout.matrix.matrix.DoubleMatrix2D A1 = new org.apache.mahout.matrix.matrix.impl.DenseDoubleMatrix2D(size,size);
-		org.apache.mahout.matrix.matrix.DoubleMatrix2D P1 = A1.viewPart(from,from,size-to,size-to);
+    org.apache.mahout.matrix.matrix.DoubleMatrix2D A1 = new org.apache.mahout.matrix.matrix.impl.DenseDoubleMatrix2D(size,size);
+    org.apache.mahout.matrix.matrix.DoubleMatrix2D P1 = A1.viewPart(from,from,size-to,size-to);
 
-		int intervalFrom = gen.nextIntFromTo(size/2,2*size);
-		int intervalTo = gen.nextIntFromTo(intervalFrom,2*size);
+    int intervalFrom = gen.nextIntFromTo(size/2,2*size);
+    int intervalTo = gen.nextIntFromTo(intervalFrom,2*size);
 
-		for (int i=0; i<size; i++) {
-			for (int j=0; j<size; j++) {
-				A1.set(i,j,gen.nextIntFromTo(intervalFrom,intervalTo));
-			}
-		}
+    for (int i=0; i<size; i++) {
+      for (int j=0; j<size; j++) {
+        A1.set(i,j,gen.nextIntFromTo(intervalFrom,intervalTo));
+      }
+    }
 
-		org.apache.mahout.matrix.matrix.DoubleMatrix2D A2 = A1.copy();
-		org.apache.mahout.matrix.matrix.DoubleMatrix2D P2 = A2.viewPart(from,from,size-to,size-to);
+    org.apache.mahout.matrix.matrix.DoubleMatrix2D A2 = A1.copy();
+    org.apache.mahout.matrix.matrix.DoubleMatrix2D P2 = A2.viewPart(from,from,size-to,size-to);
 
-		int c = 0;
-		org.apache.mahout.matrix.matrix.DoubleMatrix2D S1 = org.apache.mahout.matrix.matrix.doublealgo.Sorting.quickSort.sort(P1,c);
-		org.apache.mahout.matrix.matrix.DoubleMatrix2D S2 = org.apache.mahout.matrix.matrix.doublealgo.Sorting.mergeSort.sort(P2,c);
+    int c = 0;
+    org.apache.mahout.matrix.matrix.DoubleMatrix2D S1 = org.apache.mahout.matrix.matrix.doublealgo.Sorting.quickSort.sort(P1,c);
+    org.apache.mahout.matrix.matrix.DoubleMatrix2D S2 = org.apache.mahout.matrix.matrix.doublealgo.Sorting.mergeSort.sort(P2,c);
 
-		if (!(S1.viewColumn(c).equals(S2.viewColumn(c)))) throw new InternalError();
-	}
+    if (!(S1.viewColumn(c).equals(S2.viewColumn(c)))) throw new InternalError();
+  }
 
-	System.out.println("All tests passed. No bug detected.");
+  System.out.println("All tests passed. No bug detected.");
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/GenericSorting.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/GenericSorting.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/GenericSorting.java	(working copy)
@@ -15,7 +15,7 @@
 <ul>
   <li><i>Sorting multiple arrays in sync</i> 
   <li><i>Sorting by multiple sorting criteria</i> (primary, secondary, tertiary, 
-	...) 
+  ...) 
 </ul>
 <h4>Sorting multiple arrays in sync</h4>
 <p>
@@ -27,15 +27,15 @@
 <p>How can we achive this? Here are several alternatives. We could ... </p>
 <ol>
   <li> make a list of Point3D objects, sort the list as desired using a comparison 
-	function, then copy the results back into X, Y and Z. The classic object-oriented 
-	way. </li>
+  function, then copy the results back into X, Y and Z. The classic object-oriented 
+  way. </li>
   <li>make an index list [0,1,2,...,N-1], sort the index list using a comparison function, 
-	then reorder the elements of X,Y,Z as defined by the index list. Reordering 
-	cannot be done in-place, so we need to copy X to some temporary array, then 
-	copy in the right order back from the temporary into X. Same for Y and Z. 
+  then reorder the elements of X,Y,Z as defined by the index list. Reordering 
+  cannot be done in-place, so we need to copy X to some temporary array, then 
+  copy in the right order back from the temporary into X. Same for Y and Z. 
   </li>
   <li> use a generic quicksort or mergesort which, whenever two elements in X are swapped, 
-	also swaps the corresponding elements in Y and Z. </li>
+  also swaps the corresponding elements in Y and Z. </li>
 </ol>
 Alternatives 1 and 2 involve quite a lot of copying and allocate significant amounts 
 of temporary memory. Alternative 3 involves more swapping, more polymorphic message dispatches, no copying and does not need any temporary memory. 
@@ -66,10 +66,10 @@
 // this one knows how to swap two indexes (a,b)
 Swapper swapper = new Swapper() {
 &nbsp;&nbsp;&nbsp;public void swap(int a, int b) {
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;int t1;	double t2, t3;
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;t1 = x[a]; x[a] = x[b];	x[b] = t1;
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;int t1;  double t2, t3;
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;t1 = x[a]; x[a] = x[b];  x[b] = t1;
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;t2 = y[a]; y[a] = y[b]; y[b] = t2;
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;t3 = z[a]; z[a] = z[b];	z[b] = t3;
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;t3 = z[a]; z[a] = z[b];  z[b] = t3;
 &nbsp;&nbsp;&nbsp;}
 };
 // simple comparison: compare by X and ignore Y,Z<br>
@@ -149,8 +149,8 @@
  */
 @Deprecated
 public class GenericSorting extends Object {
-	private static final int SMALL = 7;
-	private static final int MEDIUM = 40;
+  private static final int SMALL = 7;
+  private static final int MEDIUM = 40;
 /**
  * Makes this class non instantiable, but still let's others inherit from it.
  */
@@ -164,43 +164,43 @@
  * second.
  */
 private static void inplace_merge(int first, int middle, int last, IntComparator comp, Swapper swapper) {
-	if (first >= middle || middle >= last)
-		return;
-	if (last - first == 2) {
-		if (comp.compare(middle, first)<0) {
-			swapper.swap(first,middle);
-		}
-		return;
-	}
-	int firstCut;
-	int secondCut;
-	if (middle - first > last - middle) {
-		firstCut = first + (middle - first) / 2;
-		secondCut = lower_bound(middle, last, firstCut, comp);
-	} 
-	else {
-		secondCut = middle + (last - middle) / 2;
-		firstCut = upper_bound(first, middle, secondCut, comp);
-	}
+  if (first >= middle || middle >= last)
+    return;
+  if (last - first == 2) {
+    if (comp.compare(middle, first)<0) {
+      swapper.swap(first,middle);
+    }
+    return;
+  }
+  int firstCut;
+  int secondCut;
+  if (middle - first > last - middle) {
+    firstCut = first + (middle - first) / 2;
+    secondCut = lower_bound(middle, last, firstCut, comp);
+  } 
+  else {
+    secondCut = middle + (last - middle) / 2;
+    firstCut = upper_bound(first, middle, secondCut, comp);
+  }
 
-	// rotate(firstCut, middle, secondCut, swapper);
-	// is manually inlined for speed (jitter inlining seems to work only for small call depths, even if methods are "static private")
-	// speedup = 1.7
-	// begin inline
-	int first2 = firstCut; int middle2 = middle; int last2 = secondCut;
-	if (middle2 != first2 && middle2 != last2) {
-		int first1 = first2; int last1 = middle2;
-		while (first1 < --last1) swapper.swap(first1++,last1);
-		first1 = middle2; last1 = last2;
-		while (first1 < --last1) swapper.swap(first1++,last1);
-		first1 = first2; last1 = last2;
-		while (first1 < --last1) swapper.swap(first1++,last1);
-	}
-	// end inline
+  // rotate(firstCut, middle, secondCut, swapper);
+  // is manually inlined for speed (jitter inlining seems to work only for small call depths, even if methods are "static private")
+  // speedup = 1.7
+  // begin inline
+  int first2 = firstCut; int middle2 = middle; int last2 = secondCut;
+  if (middle2 != first2 && middle2 != last2) {
+    int first1 = first2; int last1 = middle2;
+    while (first1 < --last1) swapper.swap(first1++,last1);
+    first1 = middle2; last1 = last2;
+    while (first1 < --last1) swapper.swap(first1++,last1);
+    first1 = first2; last1 = last2;
+    while (first1 < --last1) swapper.swap(first1++,last1);
+  }
+  // end inline
 
-	middle = firstCut + (secondCut - middle);
-	inplace_merge(first, firstCut, middle, comp, swapper);
-	inplace_merge(middle, secondCut, last, comp, swapper);
+  middle = firstCut + (secondCut - middle);
+  inplace_merge(first, firstCut, middle, comp, swapper);
+  inplace_merge(middle, secondCut, last, comp, swapper);
 }
 /**
  * Performs a binary search on an already-sorted range: finds the first
@@ -220,31 +220,31 @@
  * @see Sorting#binary_search
  */
 private static int lower_bound(int first, int last, int x, IntComparator comp) {
-	//if (comp==null) throw new NullPointerException();
-	int len = last - first;
-	while (len > 0) {
-		int half = len / 2;
-		int middle = first + half;
-		if (comp.compare(middle, x)<0) {
-			first = middle + 1;
-			len -= half + 1;
-		} 
-		else {
-			len = half;
-		}
-	}
-	return first;
+  //if (comp==null) throw new NullPointerException();
+  int len = last - first;
+  while (len > 0) {
+    int half = len / 2;
+    int middle = first + half;
+    if (comp.compare(middle, x)<0) {
+      first = middle + 1;
+      len -= half + 1;
+    } 
+    else {
+      len = half;
+    }
+  }
+  return first;
 }
 /**
  * Returns the index of the median of the three indexed chars.
  */
 private static int med3(int a, int b, int c, IntComparator comp) {
-	int ab = comp.compare(a,b);
-	int ac = comp.compare(a,c);
-	int bc = comp.compare(b,c);
-	return (ab<0 ?
-		(bc<0 ? b : ac<0 ? c : a) :
-		(bc>0 ? b : ac>0 ? c : a));
+  int ab = comp.compare(a,b);
+  int ac = comp.compare(a,c);
+  int bc = comp.compare(b,c);
+  return (ab<0 ?
+    (bc<0 ? b : ac<0 ? c : a) :
+    (bc>0 ? b : ac>0 ? c : a));
 }
 /**
  * Sorts the specified range of elements according
@@ -272,35 +272,35 @@
  * @see Swapper
  */
 public static void mergeSort(int fromIndex, int toIndex, IntComparator c, Swapper swapper) {
-	/*
-		We retain the same method signature as quickSort.
-		Given only a comparator and swapper we do not know how to copy and move elements from/to temporary arrays.
-		Hence, in contrast to the JDK mergesorts this is an "in-place" mergesort, i.e. does not allocate any temporary arrays.
-		A non-inplace mergesort would perhaps be faster in most cases, but would require non-intuitive delegate objects...
-	*/
-	int length = toIndex - fromIndex;
+  /*
+    We retain the same method signature as quickSort.
+    Given only a comparator and swapper we do not know how to copy and move elements from/to temporary arrays.
+    Hence, in contrast to the JDK mergesorts this is an "in-place" mergesort, i.e. does not allocate any temporary arrays.
+    A non-inplace mergesort would perhaps be faster in most cases, but would require non-intuitive delegate objects...
+  */
+  int length = toIndex - fromIndex;
 
-	// Insertion sort on smallest arrays
-	if (length < SMALL) {
-		for (int i = fromIndex; i < toIndex; i++) {
-			for (int j = i; j > fromIndex && (c.compare(j - 1, j) > 0); j--) {
-				swapper.swap(j, j - 1);
-			}
-		}
-		return;
-	}
+  // Insertion sort on smallest arrays
+  if (length < SMALL) {
+    for (int i = fromIndex; i < toIndex; i++) {
+      for (int j = i; j > fromIndex && (c.compare(j - 1, j) > 0); j--) {
+        swapper.swap(j, j - 1);
+      }
+    }
+    return;
+  }
 
-	// Recursively sort halves
-	int mid = (fromIndex + toIndex) / 2;
-	mergeSort(fromIndex, mid, c, swapper);
-	mergeSort(mid, toIndex, c, swapper);
+  // Recursively sort halves
+  int mid = (fromIndex + toIndex) / 2;
+  mergeSort(fromIndex, mid, c, swapper);
+  mergeSort(mid, toIndex, c, swapper);
 
-	// If list is already sorted, nothing left to do.  This is an
-	// optimization that results in faster sorts for nearly ordered lists.
-	if (c.compare(mid - 1, mid) <= 0) return;
+  // If list is already sorted, nothing left to do.  This is an
+  // optimization that results in faster sorts for nearly ordered lists.
+  if (c.compare(mid - 1, mid) <= 0) return;
 
-	// Merge sorted halves 
-	inplace_merge(fromIndex, mid, toIndex, c, swapper);
+  // Merge sorted halves 
+  inplace_merge(fromIndex, mid, toIndex, c, swapper);
 }
 /**
  * Sorts the specified range of elements according
@@ -326,72 +326,72 @@
  * @see Swapper
  */
 public static void quickSort(int fromIndex, int toIndex, IntComparator c, Swapper swapper) {
-	quickSort1(fromIndex, toIndex-fromIndex, c, swapper);
+  quickSort1(fromIndex, toIndex-fromIndex, c, swapper);
 }
 /**
  * Sorts the specified sub-array into ascending order.
  */
 private static void quickSort1(int off, int len, IntComparator comp, Swapper swapper) {
-	// Insertion sort on smallest arrays
-	if (len < SMALL) {
-		for (int i=off; i<len+off; i++)
-		for (int j=i; j>off && (comp.compare(j-1,j)>0); j--) {
-		    swapper.swap(j, j-1);
-		}
-		return;
-	}
+  // Insertion sort on smallest arrays
+  if (len < SMALL) {
+    for (int i=off; i<len+off; i++)
+    for (int j=i; j>off && (comp.compare(j-1,j)>0); j--) {
+        swapper.swap(j, j-1);
+    }
+    return;
+  }
 
-	// Choose a partition element, v
-	int m = off + len/2;       // Small arrays, middle element
-	if (len > SMALL) {
-		int l = off;
-		int n = off + len - 1;
-		if (len > MEDIUM) {        // Big arrays, pseudomedian of 9
-			int s = len/8;
-			l = med3(l,     l+s, l+2*s, comp);
-			m = med3(m-s,   m,   m+s, comp);
-			n = med3(n-2*s, n-s, n, comp);
-		}
-		m = med3(l, m, n, comp); // Mid-size, med of 3
-	}
-	//long v = x[m];
-	
-	// Establish Invariant: v* (<v)* (>v)* v*
-	int a = off, b = a, c = off + len - 1, d = c;
-	while(true) {
-		int comparison;
-		while (b <= c && ((comparison=comp.compare(b,m))<=0)) {
-			if (comparison == 0) {
-				if (a==m) m = b; // moving target; DELTA to JDK !!!
-				else if (b==m) m = a; // moving target; DELTA to JDK !!!
-			    swapper.swap(a++, b);
-			}
-			b++;
-		}
-		while (c >= b && ((comparison=comp.compare(c,m))>=0)) {
-			if (comparison == 0) {
-				if (c==m) m = d; // moving target; DELTA to JDK !!!
-				else if (d==m) m = c; // moving target; DELTA to JDK !!!
-			    swapper.swap(c, d--);
-			}
-			c--;
-		}
-		if (b > c) break;
-		if (b==m) m = d; // moving target; DELTA to JDK !!!
-		else if (c==m) m = c; // moving target; DELTA to JDK !!!
-		swapper.swap(b++, c--);
-	}
+  // Choose a partition element, v
+  int m = off + len/2;       // Small arrays, middle element
+  if (len > SMALL) {
+    int l = off;
+    int n = off + len - 1;
+    if (len > MEDIUM) {        // Big arrays, pseudomedian of 9
+      int s = len/8;
+      l = med3(l,     l+s, l+2*s, comp);
+      m = med3(m-s,   m,   m+s, comp);
+      n = med3(n-2*s, n-s, n, comp);
+    }
+    m = med3(l, m, n, comp); // Mid-size, med of 3
+  }
+  //long v = x[m];
+  
+  // Establish Invariant: v* (<v)* (>v)* v*
+  int a = off, b = a, c = off + len - 1, d = c;
+  while(true) {
+    int comparison;
+    while (b <= c && ((comparison=comp.compare(b,m))<=0)) {
+      if (comparison == 0) {
+        if (a==m) m = b; // moving target; DELTA to JDK !!!
+        else if (b==m) m = a; // moving target; DELTA to JDK !!!
+          swapper.swap(a++, b);
+      }
+      b++;
+    }
+    while (c >= b && ((comparison=comp.compare(c,m))>=0)) {
+      if (comparison == 0) {
+        if (c==m) m = d; // moving target; DELTA to JDK !!!
+        else if (d==m) m = c; // moving target; DELTA to JDK !!!
+          swapper.swap(c, d--);
+      }
+      c--;
+    }
+    if (b > c) break;
+    if (b==m) m = d; // moving target; DELTA to JDK !!!
+    else if (c==m) m = c; // moving target; DELTA to JDK !!!
+    swapper.swap(b++, c--);
+  }
 
-	// Swap partition elements back to middle
-	int s, n = off + len;
-	s = Math.min(a-off, b-a  );  vecswap(swapper, off, b-s, s);
-	s = Math.min(d-c,   n-d-1);  vecswap(swapper, b,   n-s, s);
+  // Swap partition elements back to middle
+  int s, n = off + len;
+  s = Math.min(a-off, b-a  );  vecswap(swapper, off, b-s, s);
+  s = Math.min(d-c,   n-d-1);  vecswap(swapper, b,   n-s, s);
 
-	// Recursively sort non-partition-elements
-	if ((s = b-a) > 1) 
-		quickSort1(off, s, comp, swapper);
-	if ((s = d-c) > 1) 
-		quickSort1(n-s, s, comp, swapper);
+  // Recursively sort non-partition-elements
+  if ((s = b-a) > 1) 
+    quickSort1(off, s, comp, swapper);
+  if ((s = d-c) > 1) 
+    quickSort1(n-s, s, comp, swapper);
 }
 /** 
  * Reverses a sequence of elements.
@@ -402,10 +402,10 @@
  *                   is invalid.
  */
 private static void reverse(int first, int last, Swapper swapper) {
-	// no more needed since manually inlined
-	while (first < --last) {
-		swapper.swap(first++,last);
-	}
+  // no more needed since manually inlined
+  while (first < --last) {
+    swapper.swap(first++,last);
+  }
 }
 /**
  * Rotate a range in place: <code>array[middle]</code> is put in
@@ -420,12 +420,12 @@
  * @param last     One past the end of the range
  */
 private static void rotate(int first, int middle, int last, Swapper swapper) {
-	// no more needed since manually inlined
-	if (middle != first && middle != last) {
-		reverse(first, middle, swapper);
-		reverse(middle, last, swapper);
-		reverse(first, last, swapper);
-	}
+  // no more needed since manually inlined
+  if (middle != first && middle != last) {
+    reverse(first, middle, swapper);
+    reverse(middle, last, swapper);
+    reverse(first, last, swapper);
+  }
 }
 /**
  * Performs a binary search on an already-sorted range: finds the last
@@ -445,25 +445,25 @@
  * @see Sorting#binary_search
  */
 private static int upper_bound(int first, int last, int x, IntComparator comp) {
-	//if (comp==null) throw new NullPointerException();
-	int len = last - first;
-	while (len > 0) {
-		int half = len / 2;
-		int middle = first + half;
-		if (comp.compare(x, middle)<0) {
-			len = half;
-		}
-		else {
-			first = middle + 1;
-			len -= half + 1;
-		}
-	}
-	return first;
+  //if (comp==null) throw new NullPointerException();
+  int len = last - first;
+  while (len > 0) {
+    int half = len / 2;
+    int middle = first + half;
+    if (comp.compare(x, middle)<0) {
+      len = half;
+    }
+    else {
+      first = middle + 1;
+      len -= half + 1;
+    }
+  }
+  return first;
 }
 /**
  * Swaps x[a .. (a+n-1)] with x[b .. (b+n-1)].
  */
 private static void vecswap(Swapper swapper, int a, int b, int n) {
-	for (int i=0; i<n; i++, a++, b++) swapper.swap(a, b);
+  for (int i=0; i<n; i++, a++, b++) swapper.swap(a, b);
 }
 }
Index: matrix/src/main/java/org/apache/mahout/matrix/PersistentObject.java
===================================================================
--- matrix/src/main/java/org/apache/mahout/matrix/PersistentObject.java	(revision 883446)
+++ matrix/src/main/java/org/apache/mahout/matrix/PersistentObject.java	(working copy)
@@ -19,7 +19,7 @@
  */
 @Deprecated
 public abstract class PersistentObject extends Object implements java.io.Serializable, Cloneable {
-	public static final long serialVersionUID = 1020L;
+  public static final long serialVersionUID = 1020L;
 /**
  * Not yet commented.
  */
@@ -32,10 +32,10 @@
  * @return a copy of the receiver.
  */
 public Object clone() {
-	try {
-		return super.clone();
-	} catch (CloneNotSupportedException exc) {
-		throw new InternalError(); //should never happen since we are cloneable
-	}
+  try {
+    return super.clone();
+  } catch (CloneNotSupportedException exc) {
+    throw new InternalError(); //should never happen since we are cloneable
+  }
 }
 }
Index: core/src/test/java/org/apache/mahout/clustering/kmeans/TestRandomSeedGenerator.java
===================================================================
--- core/src/test/java/org/apache/mahout/clustering/kmeans/TestRandomSeedGenerator.java	(revision 0)
+++ core/src/test/java/org/apache/mahout/clustering/kmeans/TestRandomSeedGenerator.java	(revision 0)
@@ -0,0 +1,101 @@
+package org.apache.mahout.clustering.kmeans;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import junit.framework.TestCase;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.io.SequenceFile;
+import org.apache.hadoop.io.Writable;
+import org.apache.hadoop.mapred.JobConf;
+import org.apache.mahout.clustering.ClusteringTestUtils;
+import org.apache.mahout.matrix.SparseVector;
+import org.apache.mahout.matrix.Vector;
+
+public class TestRandomSeedGenerator extends TestCase {
+  
+  static final double[][] raw = {{1, 1}, {2, 1}, {1, 2}, {2, 2},
+    {3, 3}, {4, 4}, {5, 4}, {4, 5}, {5, 5}};
+  
+  FileSystem fs;
+  
+  private static List<Vector> getPoints(double[][] raw) {
+    List<Vector> points = new ArrayList<Vector>();
+    int i = 0;
+    for (double[] fr : raw) {
+      Vector vec = new SparseVector(String.valueOf(i++), fr.length);
+      vec.assign(fr);
+      points.add(vec);
+    }
+    return points;
+  }
+  
+  private static void rmr(String path) throws Exception {
+    File f = new File(path);
+    if (f.exists()) {
+      if (f.isDirectory()) {
+        String[] contents = f.list();
+        for (String content : contents) {
+          rmr(f.toString() + File.separator + content);
+        }
+      }
+      f.delete();
+    }
+  }
+  
+  public void setUp() throws Exception {
+    super.setUp();
+    rmr("testdata");
+    Configuration conf = new Configuration();
+    fs = FileSystem.get(conf);
+  }
+  
+  /** Story: test random seed generation generates 4 clusters with proper ids and data */
+  public void testRandomSeedGenerator() throws Exception {
+    List<Vector> points = getPoints(raw);
+    File testData = new File("testdata");
+    if (!testData.exists()) {
+      testData.mkdir();
+    }
+    
+    File randomOutput = new File("testdata/random-output");
+    if (!randomOutput.exists()) {
+      randomOutput.mkdir();
+    }
+    
+    JobConf job = new JobConf(RandomSeedGenerator.class);
+    ClusteringTestUtils.writePointsToFile(points, "testdata/random-input", fs, job);
+    
+    RandomSeedGenerator.buildRandom("testdata/random-input", "testdata/random-output", 4);
+    
+    SequenceFile.Reader reader = new SequenceFile.Reader(fs, new Path("testdata/random-output/part-randomSeed"), job);
+    Writable key = (Writable) reader.getKeyClass().newInstance();
+    Cluster value = (Cluster) reader.getValueClass().newInstance();
+    
+    int clusterCount = 0;
+    Set<Integer> set = new HashSet<Integer>();
+    while (reader.next(key, value)) {
+      clusterCount++;
+      int id = value.getId();
+      TestCase.assertTrue(set.add(id)); // validate unique id's
+      
+      Vector v = value.getCenter();
+      assertVectorEquals(raw[id], v); // validate values match
+    }
+    
+    TestCase.assertEquals(4, clusterCount); // validate sample count
+  }
+  
+  public void assertVectorEquals(double[] raw, Vector v) {
+    TestCase.assertEquals(raw.length, v.size());
+    for (int i=0; i < raw.length; i++) {
+      TestCase.assertEquals(raw[i], v.getQuick(i));
+    }
+  }
+}
Index: core/src/test/java/org/apache/mahout/clustering/kmeans/TestKmeansClustering.java
===================================================================
--- core/src/test/java/org/apache/mahout/clustering/kmeans/TestKmeansClustering.java	(revision 883446)
+++ core/src/test/java/org/apache/mahout/clustering/kmeans/TestKmeansClustering.java	(working copy)
@@ -85,13 +85,14 @@
    * @param clusters the initial List<Cluster> of clusters
    * @param measure  the DistanceMeasure to use
    * @param maxIter  the maximum number of iterations
+   * @param convergenceDelta threshold until cluster is considered stable
    */
   private static void referenceKmeans(List<Vector> points, List<Cluster> clusters,
-                               DistanceMeasure measure, int maxIter) {
+                               DistanceMeasure measure, int maxIter, double convergenceDelta) {
     boolean converged = false;
     int iteration = 0;
     while (!converged && iteration++ < maxIter) {
-      converged = iterateReference(points, clusters, measure);
+      converged = iterateReference(points, clusters, measure, convergenceDelta);
     }
   }
 
@@ -102,9 +103,10 @@
    * @param points   the List<Vector> having the input points
    * @param clusters the List<Cluster> clusters
    * @param measure  a DistanceMeasure to use
+   * @param convergenceDelta threshold until cluster is considered stable
    */
   private static boolean iterateReference(List<Vector> points, List<Cluster> clusters,
-                                   DistanceMeasure measure) {
+                                   DistanceMeasure measure, double convergenceDelta) {
     // iterate through all points, assigning each to the nearest cluster
     for (Vector point : points) {
       Cluster closestCluster = null;
@@ -121,7 +123,7 @@
     // test for convergence
     boolean converged = true;
     for (Cluster cluster : clusters) {
-      if (!cluster.computeConvergence()) {
+      if (!cluster.computeConvergence(measure, convergenceDelta)) {
         converged = false;
       }
     }
@@ -149,7 +151,6 @@
   public void testReferenceImplementation() throws Exception {
     List<Vector> points = getPoints(reference);
     DistanceMeasure measure = new EuclideanDistanceMeasure();
-    Cluster.config(measure, 0.001);
     // try all possible values of k
     for (int k = 0; k < points.size(); k++) {
       System.out.println("Test k=" + (k + 1) + ':');
@@ -161,7 +162,7 @@
       }
       // iterate clusters until they converge
       int maxIter = 10;
-      referenceKmeans(points, clusters, measure, maxIter);
+      referenceKmeans(points, clusters, measure, maxIter, 0.001);
       for (int c = 0; c < clusters.size(); c++) {
         Cluster cluster = clusters.get(c);
         System.out.println(cluster.toString());
@@ -183,8 +184,11 @@
   /** Story: test that the mapper will map input points to the nearest cluster */
   public void testKMeansMapper() throws Exception {
     KMeansMapper mapper = new KMeansMapper();
-    EuclideanDistanceMeasure euclideanDistanceMeasure = new EuclideanDistanceMeasure();
-    Cluster.config(euclideanDistanceMeasure, 0.001);
+    JobConf conf = new JobConf();
+    conf.set(KMeansConfigKeys.DISTANCE_MEASURE_KEY, "org.apache.mahout.common.distance.EuclideanDistanceMeasure");
+    conf.set(KMeansConfigKeys.CLUSTER_CONVERGENCE_KEY, "0.001");
+    conf.set(KMeansConfigKeys.CLUSTER_PATH_KEY, "");
+    mapper.configure(conf);
     List<Vector> points = getPoints(reference);
     for (int k = 0; k < points.size(); k++) {
       // pick k initial cluster centers at random
@@ -192,21 +196,21 @@
       List<Cluster> clusters = new ArrayList<Cluster>();
 
       for (int i = 0; i < k + 1; i++) {
-        Cluster cluster = new Cluster(points.get(i));
+        Cluster cluster = new Cluster(points.get(i), i);
         // add the center so the centroid will be correct upon output
         cluster.addPoint(cluster.getCenter());
         clusters.add(cluster);
       }
+      mapper.config(clusters);
 
-      Map<String, Cluster> clusterMap = loadClusterMap(clusters);
-      mapper.config(clusters);
       // map the data
       for (Vector point : points) {
-        mapper.map(new Text(), point, collector,
-            null);
+        mapper.map(new Text(), point, collector, null);
       }
       assertEquals("Number of map results", k + 1, collector.getData().size());
       // now verify that all points are correctly allocated
+      EuclideanDistanceMeasure euclideanDistanceMeasure = new EuclideanDistanceMeasure();
+      Map<String, Cluster> clusterMap = loadClusterMap(clusters);
       for (String key : collector.getKeys()) {
         Cluster cluster = clusterMap.get(key);
         List<KMeansInfo> values = collector.getValue(key);
@@ -225,8 +229,11 @@
   /** Story: test that the combiner will produce partial cluster totals for all of the clusters and points that it sees */
   public void testKMeansCombiner() throws Exception {
     KMeansMapper mapper = new KMeansMapper();
-    EuclideanDistanceMeasure euclideanDistanceMeasure = new EuclideanDistanceMeasure();
-    Cluster.config(euclideanDistanceMeasure, 0.001);
+    JobConf conf = new JobConf();
+    conf.set(KMeansConfigKeys.DISTANCE_MEASURE_KEY, "org.apache.mahout.common.distance.EuclideanDistanceMeasure");
+    conf.set(KMeansConfigKeys.CLUSTER_CONVERGENCE_KEY, "0.001");
+    conf.set(KMeansConfigKeys.CLUSTER_PATH_KEY, "");
+    mapper.configure(conf);
     List<Vector> points = getPoints(reference);
     for (int k = 0; k < points.size(); k++) {
       // pick k initial cluster centers at random
@@ -235,7 +242,7 @@
       for (int i = 0; i < k + 1; i++) {
         Vector vec = points.get(i);
 
-        Cluster cluster = new Cluster(vec);
+        Cluster cluster = new Cluster(vec, i);
         // add the center so the centroid will be correct upon output
         cluster.addPoint(cluster.getCenter());
         clusters.add(cluster);
@@ -277,7 +284,11 @@
   public void testKMeansReducer() throws Exception {
     KMeansMapper mapper = new KMeansMapper();
     EuclideanDistanceMeasure euclideanDistanceMeasure = new EuclideanDistanceMeasure();
-    Cluster.config(euclideanDistanceMeasure, 0.001);
+    JobConf conf = new JobConf();
+    conf.set(KMeansConfigKeys.DISTANCE_MEASURE_KEY, "org.apache.mahout.common.distance.EuclideanDistanceMeasure");
+    conf.set(KMeansConfigKeys.CLUSTER_CONVERGENCE_KEY, "0.001");
+    conf.set(KMeansConfigKeys.CLUSTER_PATH_KEY, "");
+    mapper.configure(conf);
     List<Vector> points = getPoints(reference);
     for (int k = 0; k < points.size(); k++) {
       System.out.println("K = " + k);
@@ -307,6 +318,7 @@
 
       // now reduce the data
       KMeansReducer reducer = new KMeansReducer();
+      reducer.configure(conf);
       reducer.config(clusters);
       DummyOutputCollector<Text, Cluster> collector3 = new DummyOutputCollector<Text, Cluster>();
       for (String key : collector2.getKeys()) {
@@ -323,7 +335,7 @@
         reference.add(new Cluster(vec, i));
       }
       boolean converged = iterateReference(points, reference,
-          euclideanDistanceMeasure);
+          euclideanDistanceMeasure, 0.001);
       if (k == 8) {
         assertTrue("not converged? " + k, converged);
       } else {
Index: core/src/main/java/org/apache/mahout/clustering/kmeans/KMeansConfigKeys.java
===================================================================
--- core/src/main/java/org/apache/mahout/clustering/kmeans/KMeansConfigKeys.java	(revision 0)
+++ core/src/main/java/org/apache/mahout/clustering/kmeans/KMeansConfigKeys.java	(revision 0)
@@ -0,0 +1,16 @@
+package org.apache.mahout.clustering.kmeans;
+
+/**
+ * This class holds all config keys that are relevant to be used in the KMeans MapReduce JobConf.
+ * */
+public class KMeansConfigKeys {
+  /** Configuration key for distance measure to use. */
+  public static final String DISTANCE_MEASURE_KEY = "org.apache.mahout.clustering.kmeans.measure";
+  /** Configuration key for convergence threshold. */
+  public static final String CLUSTER_CONVERGENCE_KEY = "org.apache.mahout.clustering.kmeans.convergence";
+  /** Configuration key for ?? */
+  public static final String CLUSTER_PATH_KEY = "org.apache.mahout.clustering.kmeans.path";
+  /** The number of iterations that have taken place */
+  public static final String ITERATION_NUMBER = "org.apache.mahout.clustering.kmeans.iteration";
+  
+}
Index: core/src/main/java/org/apache/mahout/clustering/kmeans/Cluster.java
===================================================================
--- core/src/main/java/org/apache/mahout/clustering/kmeans/Cluster.java	(revision 883446)
+++ core/src/main/java/org/apache/mahout/clustering/kmeans/Cluster.java	(working copy)
@@ -16,9 +16,6 @@
  */
 package org.apache.mahout.clustering.kmeans;
 
-import org.apache.hadoop.io.Text;
-import org.apache.hadoop.mapred.JobConf;
-import org.apache.hadoop.mapred.OutputCollector;
 import org.apache.mahout.clustering.ClusterBase;
 import org.apache.mahout.matrix.AbstractVector;
 import org.apache.mahout.matrix.SquareRootFunction;
@@ -28,42 +25,26 @@
 import java.io.DataInput;
 import java.io.DataOutput;
 import java.io.IOException;
-import java.util.List;
 
 public class Cluster extends ClusterBase {
 
-  private static final String ERROR_UNKNOWN_CLUSTER_FORMAT="Unknown cluster format:\n";
-    
-  public static final String DISTANCE_MEASURE_KEY = "org.apache.mahout.clustering.kmeans.measure";
+  /** Error message for unknown cluster format in output. */
+  private static final String ERROR_UNKNOWN_CLUSTER_FORMAT = "Unknown cluster format:\n";
 
-  public static final String CLUSTER_PATH_KEY = "org.apache.mahout.clustering.kmeans.path";
-
-  public static final String CLUSTER_CONVERGENCE_KEY = "org.apache.mahout.clustering.kmeans.convergence";
-
-  /** The number of iterations that have taken place */
-  public static final String ITERATION_NUMBER = "org.apache.mahout.clustering.kmeans.iteration";
-  /** Boolean value indicating whether the initial input is from Canopy clustering */
-  public static final String CANOPY_INPUT = "org.apache.mahout.clustering.kmeans.canopyInput";
-
-  private static int nextClusterId = 0;
-
-
-  // the current centroid is lazy evaluated and may be null
+  /** The current centroid is lazy evaluated and may be null */
   private Vector centroid = null;
 
-
-  // the total of all the points squared, used for std computation
+  /** The total of all the points squared, used for std computation */
   private Vector pointSquaredTotal = null;
 
-  // has the centroid converged with the center?
+  /** Has the centroid converged with the center? */
   private boolean converged = false;
-  private static DistanceMeasure measure;
-  private static double convergenceDelta = 0;
 
   /**
    * Format the cluster for output
-   *
-   * @param cluster the Cluster
+   * 
+   * @param cluster
+   *          the Cluster
    * @return the String representation of the Cluster
    */
   public static String formatCluster(Cluster cluster) {
@@ -77,16 +58,19 @@
   }
 
   /**
-   * Decodes and returns a Cluster from the formattedString
-   *
-   * @param formattedString a String produced by formatCluster
+   * Decodes and returns a Cluster from the formattedString.
+   * 
+   * @param formattedString
+   *          a String produced by formatCluster
    * @return a decoded Cluster, not null
-   * @throws IllegalArgumentException when the string is wrongly formatted
+   * @throws IllegalArgumentException
+   *           when the string is wrongly formatted
    */
   public static Cluster decodeCluster(String formattedString) {
     final int beginIndex = formattedString.indexOf('{');
     if (beginIndex <= 0) {
-      throw new IllegalArgumentException(ERROR_UNKNOWN_CLUSTER_FORMAT + formattedString);
+      throw new IllegalArgumentException(ERROR_UNKNOWN_CLUSTER_FORMAT
+          + formattedString);
     }
     final String id = formattedString.substring(0, beginIndex);
     final String center = formattedString.substring(beginIndex);
@@ -95,17 +79,17 @@
     final Cluster cluster;
     if (firstChar == 'C' || startsWithV) {
       final int clusterId = Integer.parseInt(formattedString.substring(1,
-        beginIndex - 2));
+          beginIndex - 2));
       final Vector clusterCenter = AbstractVector.decodeVector(center);
       cluster = new Cluster(clusterCenter, clusterId);
       cluster.setConverged(startsWithV);
     } else {
-     throw new IllegalArgumentException(ERROR_UNKNOWN_CLUSTER_FORMAT + formattedString);
+      throw new IllegalArgumentException(ERROR_UNKNOWN_CLUSTER_FORMAT
+          + formattedString);
     }
     return cluster;
   }
 
-
   @Override
   public void write(DataOutput out) throws IOException {
     super.write(out);
@@ -124,84 +108,8 @@
   }
 
   /**
-   * Configure the distance measure from the job
-   *
-   * @param job the JobConf for the job
-   */
-  public static void configure(JobConf job) {
-    try {
-      ClassLoader ccl = Thread.currentThread().getContextClassLoader();
-      Class<?> cl = ccl.loadClass(job.get(DISTANCE_MEASURE_KEY));
-      measure = (DistanceMeasure) cl.newInstance();
-      measure.configure(job);
-      convergenceDelta = Double.parseDouble(job.get(CLUSTER_CONVERGENCE_KEY));
-      nextClusterId = 0;
-    } catch (ClassNotFoundException e) {
-      throw new IllegalStateException(e);
-    } catch (IllegalAccessException e) {
-      throw new IllegalStateException(e);
-    } catch (InstantiationException e) {
-      throw new IllegalStateException(e);
-    }
-  }
-
-  /**
-   * Configure the distance measure directly. Used by unit tests.
-   *
-   * @param aMeasure          the DistanceMeasure
-   * @param aConvergenceDelta the delta value used to define convergence
-   */
-  public static void config(DistanceMeasure aMeasure, double aConvergenceDelta) {
-    measure = aMeasure;
-    convergenceDelta = aConvergenceDelta;
-    nextClusterId = 0;
-  }
-
-  /**
-   * Emit the point to the nearest cluster center
-   *
-   * @param point    a point
-   * @param clusters a List<Cluster> to test
-   * @param output   the OutputCollector to emit into
-   */
-  public static void emitPointToNearestCluster(Vector point,
-                                               List<Cluster> clusters, OutputCollector<Text, KMeansInfo> output)
-      throws IOException {
-    Cluster nearestCluster = null;
-    double nearestDistance = Double.MAX_VALUE;
-    for (Cluster cluster : clusters) {
-      Vector clusterCenter = cluster.getCenter();
-      double distance = measure.distance(clusterCenter.getLengthSquared(), clusterCenter, point);
-      if (distance < nearestDistance || nearestCluster == null ) {
-        nearestCluster = cluster;
-        nearestDistance = distance;
-      }
-    }
-    // emit only clusterID
-    output.collect(new Text(nearestCluster.getIdentifier()), new KMeansInfo(1, point));
-  }
-
-  public static void outputPointWithClusterInfo(Vector point,
-                                                List<Cluster> clusters, OutputCollector<Text, Text> output)
-      throws IOException {
-    Cluster nearestCluster = null;
-    double nearestDistance = Double.MAX_VALUE;
-    for (Cluster cluster : clusters) {
-      Vector clusterCenter = cluster.getCenter();
-      double distance = measure.distance(clusterCenter.getLengthSquared(), clusterCenter, point);
-      if (distance < nearestDistance || nearestCluster == null) {
-        nearestCluster = cluster;
-        nearestDistance = distance;
-      }
-    }
-    //TODO: this is ugly
-    String name = point.getName();
-    output.collect(new Text(name != null && name.length() != 0 ? name : point.asFormatString()), new Text(String.valueOf(nearestCluster.getId())));
-  }
-
-  /**
    * Compute the centroid by averaging the pointTotals
-   *
+   * 
    * @return the new centroid
    */
   private Vector computeCentroid() {
@@ -216,12 +124,12 @@
 
   /**
    * Construct a new cluster with the given point as its center
-   *
-   * @param center the center point
+   * 
+   * @param center
+   *          the center point
    */
   public Cluster(Vector center) {
     super();
-    this.setId(nextClusterId++);
     this.setCenter(center);
     this.setNumPoints(0);
     this.setPointTotal(center.like());
@@ -234,8 +142,9 @@
 
   /**
    * Construct a new cluster with the given point as its center
-   *
-   * @param center the center point
+   * 
+   * @param center
+   *          the center point
    */
   public Cluster(Vector center, int clusterId) {
     super();
@@ -269,8 +178,9 @@
 
   /**
    * Add the point to the cluster
-   *
-   * @param point a point to add
+   * 
+   * @param point
+   *          a point to add
    */
   public void addPoint(Vector point) {
     addPoints(1, point);
@@ -278,9 +188,11 @@
 
   /**
    * Add the point to the cluster
-   *
-   * @param count the number of points in the delta
-   * @param delta a point to add
+   * 
+   * @param count
+   *          the number of points in the delta
+   * @param delta
+   *          a point to add
    */
   public void addPoints(int count, Vector delta) {
     centroid = null;
@@ -294,7 +206,6 @@
     }
   }
 
-
   /** Compute the centroid and set the center to it. */
   public void recomputeCenter() {
     setCenter(computeCentroid());
@@ -304,16 +215,21 @@
 
   /**
    * Return if the cluster is converged by comparing its center and centroid.
-   *
+   * 
+   * @param measure
+   *          The distance measure to use for cluster-point comparisons.
+   * @param convergenceDelta
+   *          the convergence delta to use for stopping.
    * @return if the cluster is converged
    */
-  public boolean computeConvergence() {
+  public boolean computeConvergence(final DistanceMeasure measure,
+      final double convergenceDelta) {
     Vector centroid = computeCentroid();
-    converged = measure.distance(centroid.getLengthSquared(), centroid, getCenter()) <= convergenceDelta;
+    converged = measure.distance(centroid.getLengthSquared(), centroid,
+        getCenter()) <= convergenceDelta;
     return converged;
   }
 
-
   public boolean isConverged() {
     return converged;
   }
@@ -325,8 +241,8 @@
   /** @return the std */
   public double getStd() {
     Vector stds = pointSquaredTotal.times(getNumPoints()).minus(
-          getPointTotal().times(getPointTotal())).assign(new SquareRootFunction())
-          .divide(getNumPoints());
+        getPointTotal().times(getPointTotal()))
+        .assign(new SquareRootFunction()).divide(getNumPoints());
     return stds.zSum() / 2;
   }
 
Index: core/src/main/java/org/apache/mahout/clustering/kmeans/KMeansMapper.java
===================================================================
--- core/src/main/java/org/apache/mahout/clustering/kmeans/KMeansMapper.java	(revision 883446)
+++ core/src/main/java/org/apache/mahout/clustering/kmeans/KMeansMapper.java	(working copy)
@@ -23,43 +23,64 @@
 import org.apache.hadoop.mapred.Mapper;
 import org.apache.hadoop.mapred.OutputCollector;
 import org.apache.hadoop.mapred.Reporter;
+import org.apache.mahout.common.distance.DistanceMeasure;
 import org.apache.mahout.matrix.Vector;
 
 import java.io.IOException;
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
 
 public class KMeansMapper extends MapReduceBase implements
     Mapper<WritableComparable<?>, Vector, Text, KMeansInfo> {
 
-  private List<Cluster> clusters;
+  private KMeansClusterer clusterer;
+  private final List<Cluster> clusters = new ArrayList<Cluster>();
 
   @Override
   public void map(WritableComparable<?> key, Vector point,
-                  OutputCollector<Text, KMeansInfo> output, Reporter reporter) throws IOException {
-    Cluster.emitPointToNearestCluster(point, clusters, output);
+      OutputCollector<Text, KMeansInfo> output, Reporter reporter)
+      throws IOException {
+   this.clusterer.emitPointToNearestCluster(point, this.clusters, output);
   }
 
   /**
    * Configure the mapper by providing its clusters. Used by unit tests.
-   *
-   * @param clusters a List<Cluster>
+   * 
+   * @param clusters
+   *          a List<Cluster>
    */
   void config(List<Cluster> clusters) {
-    this.clusters = clusters;
+    this.clusters.clear();
+    this.clusters.addAll(clusters);
   }
 
   @Override
   public void configure(JobConf job) {
     super.configure(job);
-    Cluster.configure(job);
+    try {
+      ClassLoader ccl = Thread.currentThread().getContextClassLoader();
+      Class<?> cl = ccl.loadClass(job
+          .get(KMeansConfigKeys.DISTANCE_MEASURE_KEY));
+      DistanceMeasure measure = (DistanceMeasure) cl.newInstance();
+      measure.configure(job);
 
-    clusters = new ArrayList<Cluster>();
-    KMeansUtil.configureWithClusterInfo(job.get(Cluster.CLUSTER_PATH_KEY),
-        clusters);
+      this.clusterer = new KMeansClusterer(measure);
 
-    if (clusters.isEmpty()) {
-      throw new NullPointerException("Cluster is empty!!!");
+      String clusterPath = job.get(KMeansConfigKeys.CLUSTER_PATH_KEY);
+      if (clusterPath != null && clusterPath.length() > 0) {
+        KMeansUtil.configureWithClusterInfo(clusterPath, clusters);
+        if (clusters.isEmpty()) {
+          throw new NullPointerException("Cluster is empty!");
+        }
+      }
+
+    } catch (ClassNotFoundException e) {
+      throw new IllegalStateException(e);
+    } catch (IllegalAccessException e) {
+      throw new IllegalStateException(e);
+    } catch (InstantiationException e) {
+      throw new IllegalStateException(e);
     }
   }
 }
Index: core/src/main/java/org/apache/mahout/clustering/kmeans/KMeansClusterMapper.java
===================================================================
--- core/src/main/java/org/apache/mahout/clustering/kmeans/KMeansClusterMapper.java	(revision 883446)
+++ core/src/main/java/org/apache/mahout/clustering/kmeans/KMeansClusterMapper.java	(working copy)
@@ -24,6 +24,7 @@
 import org.apache.hadoop.mapred.Mapper;
 import org.apache.hadoop.mapred.OutputCollector;
 import org.apache.hadoop.mapred.Reporter;
+import org.apache.mahout.common.distance.DistanceMeasure;
 import org.apache.mahout.matrix.Vector;
 
 import java.io.IOException;
@@ -33,34 +34,51 @@
 public class KMeansClusterMapper extends MapReduceBase implements
     Mapper<WritableComparable<?>, Vector, Text, Text> {
 
-  private List<Cluster> clusters;
+  private final List<Cluster> clusters = new ArrayList<Cluster>();
+  private KMeansClusterer clusterer;
 
   @Override
-  public void map(WritableComparable<?> key, Vector point, OutputCollector<Text, Text> output, Reporter reporter) throws IOException {
-    Cluster.outputPointWithClusterInfo(point, clusters, output);
+  public void map(WritableComparable<?> key, Vector point,
+      OutputCollector<Text, Text> output, Reporter reporter) throws IOException {
+    this.clusterer.outputPointWithClusterInfo(point, clusters, output);
   }
 
   /**
    * Configure the mapper by providing its clusters. Used by unit tests.
-   *
-   * @param clusters a List<Cluster>
+   * 
+   * @param clusters
+   *          a List<Cluster>
    */
   void config(List<Cluster> clusters) {
-    this.clusters = clusters;
+    this.clusters.clear();
+    this.clusters.addAll(clusters);
   }
 
   @Override
   public void configure(JobConf job) {
     super.configure(job);
-    Cluster.configure(job);
 
-    clusters = new ArrayList<Cluster>();
+    try {
+      ClassLoader ccl = Thread.currentThread().getContextClassLoader();
+      Class<?> cl = ccl.loadClass(job
+          .get(KMeansConfigKeys.DISTANCE_MEASURE_KEY));
+      DistanceMeasure measure = (DistanceMeasure) cl.newInstance();
+      measure.configure(job);
 
-    KMeansUtil.configureWithClusterInfo(job.get(Cluster.CLUSTER_PATH_KEY),
-        clusters);
+      KMeansUtil.configureWithClusterInfo(job.get(KMeansConfigKeys.CLUSTER_PATH_KEY),
+          clusters);
 
+      this.clusterer = new KMeansClusterer(measure);
+    } catch (ClassNotFoundException e) {
+      throw new IllegalStateException(e);
+    } catch (IllegalAccessException e) {
+      throw new IllegalStateException(e);
+    } catch (InstantiationException e) {
+      throw new IllegalStateException(e);
+    }
+
     if (clusters.isEmpty()) {
-      throw new NullPointerException("Cluster is empty!!!");
+      throw new NullPointerException("Cluster is empty!");
     }
   }
 
Index: core/src/main/java/org/apache/mahout/clustering/kmeans/KMeansClusterer.java
===================================================================
--- core/src/main/java/org/apache/mahout/clustering/kmeans/KMeansClusterer.java	(revision 0)
+++ core/src/main/java/org/apache/mahout/clustering/kmeans/KMeansClusterer.java	(revision 0)
@@ -0,0 +1,98 @@
+/* Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.mahout.clustering.kmeans;
+
+import java.io.IOException;
+import java.util.List;
+
+import org.apache.hadoop.io.Text;
+import org.apache.hadoop.mapred.OutputCollector;
+import org.apache.mahout.common.distance.DistanceMeasure;
+import org.apache.mahout.matrix.Vector;
+
+/**
+ * This class implements the k-means clustering algorithm. It uses
+ * {@link Cluster} as a cluster representation. The class can be used as part of
+ * a clustering job to be started as map/reduce job.
+ * */
+public class KMeansClusterer {
+
+  /** Distance to use for point to cluster comparison. */
+  private final DistanceMeasure measure;
+
+  /**
+   * Init the k-means clusterer with the distance measure to use for comparison.
+   * 
+   * @param measure
+   *          The distance measure to use for comparing clusters against points.
+   * @param convergenceDelta
+   *          When do we define a cluster to have converged?
+   * 
+   * */
+  public KMeansClusterer(final DistanceMeasure measure) {
+    this.measure = measure;
+
+  }
+
+  /**
+   * Iterates over all clusters and identifies the one closes to the given
+   * point. Distance measure used is configured at creation time of
+   * {@link KMeansClusterer}.
+   * 
+   * @param point
+   *          a point to find a cluster for.
+   * @param clusters
+   *          a List<Cluster> to test.
+   */
+  public void emitPointToNearestCluster(Vector point,
+      List<Cluster> clusters, OutputCollector<Text, KMeansInfo> output) throws IOException {
+    Cluster nearestCluster = null;
+    double nearestDistance = Double.MAX_VALUE;
+    for (Cluster cluster : clusters) {
+      Vector clusterCenter = cluster.getCenter();
+      double distance = this.measure.distance(clusterCenter.getLengthSquared(),
+          clusterCenter, point);
+      System.out.println(distance + " Cluster: " + cluster.getId());
+      if (distance < nearestDistance || nearestCluster == null) {
+        nearestCluster = cluster;
+        nearestDistance = distance;
+      }
+    }
+    // emit only clusterID
+    output.collect(new Text(nearestCluster.getIdentifier()), new KMeansInfo(1, point));
+  }
+
+  public void outputPointWithClusterInfo(Vector point,
+      List<Cluster> clusters, OutputCollector<Text, Text> output) throws IOException {
+    Cluster nearestCluster = null;
+    double nearestDistance = Double.MAX_VALUE;
+    for (Cluster cluster : clusters) {
+      Vector clusterCenter = cluster.getCenter();
+      double distance = measure.distance(clusterCenter.getLengthSquared(),
+          clusterCenter, point);
+      if (distance < nearestDistance || nearestCluster == null) {
+        nearestCluster = cluster;
+        nearestDistance = distance;
+      }
+    }
+    
+    String name = point.getName();
+    String key = new String(name != null && name.length() != 0 ? name : point
+        .asFormatString());
+    output.collect(new Text(key), new Text(String.valueOf(nearestCluster.getId())));
+  }
+}
Index: core/src/main/java/org/apache/mahout/clustering/kmeans/KMeansReducer.java
===================================================================
--- core/src/main/java/org/apache/mahout/clustering/kmeans/KMeansReducer.java	(revision 883446)
+++ core/src/main/java/org/apache/mahout/clustering/kmeans/KMeansReducer.java	(working copy)
@@ -22,6 +22,7 @@
 import org.apache.hadoop.mapred.OutputCollector;
 import org.apache.hadoop.mapred.Reducer;
 import org.apache.hadoop.mapred.Reporter;
+import org.apache.mahout.common.distance.DistanceMeasure;
 
 import java.io.IOException;
 import java.util.ArrayList;
@@ -34,6 +35,8 @@
     Reducer<Text, KMeansInfo, Text, Cluster> {
 
   private Map<String, Cluster> clusterMap;
+  private double convergenceDelta;
+  private DistanceMeasure measure;
 
   @Override
   public void reduce(Text key, Iterator<KMeansInfo> values,
@@ -45,7 +48,7 @@
       cluster.addPoints(delta.getPoints(), delta.getPointTotal());
     }
     // force convergence calculation
-    cluster.computeConvergence();
+    cluster.computeConvergence(this.measure, this.convergenceDelta);
     output.collect(new Text(cluster.getIdentifier()), cluster);
   }
 
@@ -53,16 +56,33 @@
   public void configure(JobConf job) {
 
     super.configure(job);
-    Cluster.configure(job);
-    clusterMap = new HashMap<String, Cluster>();
+    try {
+      ClassLoader ccl = Thread.currentThread().getContextClassLoader();
+      Class<?> cl = ccl.loadClass(job
+          .get(KMeansConfigKeys.DISTANCE_MEASURE_KEY));
+      this.measure = (DistanceMeasure) cl.newInstance();
+      this.measure.configure(job);
 
-    List<Cluster> clusters = new ArrayList<Cluster>();
-    KMeansUtil.configureWithClusterInfo(job.get(Cluster.CLUSTER_PATH_KEY),
-        clusters);
-    setClusterMap(clusters);
+      this.convergenceDelta = Double.parseDouble(job
+          .get(KMeansConfigKeys.CLUSTER_CONVERGENCE_KEY));
 
-    if (clusterMap.isEmpty()) {
-      throw new NullPointerException("Cluster is empty!!!");
+      this.clusterMap = new HashMap<String, Cluster>();
+
+      String path = job.get(KMeansConfigKeys.CLUSTER_PATH_KEY);
+      if (job != null && path.length() > 0) {
+        List<Cluster> clusters = new ArrayList<Cluster>();
+        KMeansUtil.configureWithClusterInfo(path, clusters);
+        setClusterMap(clusters);
+        if (clusterMap.isEmpty()) {
+          throw new NullPointerException("Cluster is empty!");
+        }
+      }
+    } catch (ClassNotFoundException e) {
+      throw new IllegalStateException(e);
+    } catch (IllegalAccessException e) {
+      throw new IllegalStateException(e);
+    } catch (InstantiationException e) {
+      throw new IllegalStateException(e);
     }
   }
 
Index: core/src/main/java/org/apache/mahout/clustering/kmeans/RandomSeedGenerator.java
===================================================================
--- core/src/main/java/org/apache/mahout/clustering/kmeans/RandomSeedGenerator.java	(revision 883446)
+++ core/src/main/java/org/apache/mahout/clustering/kmeans/RandomSeedGenerator.java	(working copy)
@@ -73,8 +73,9 @@
 
       List<Text> chosenTexts = new ArrayList<Text>(k);
       List<Cluster> chosenClusters = new ArrayList<Cluster>(k);
+      int nextClusterId = 0;
       while (reader.next(key, value)) {
-        Cluster newCluster = new Cluster(value);
+        Cluster newCluster = new Cluster(value, nextClusterId++);
         newCluster.addPoint(value);
         Text newText = new Text(key.toString());
         int currentSize = chosenTexts.size();
Index: core/src/main/java/org/apache/mahout/clustering/kmeans/KMeansDriver.java
===================================================================
--- core/src/main/java/org/apache/mahout/clustering/kmeans/KMeansDriver.java	(revision 883446)
+++ core/src/main/java/org/apache/mahout/clustering/kmeans/KMeansDriver.java	(working copy)
@@ -230,11 +230,11 @@
     conf.setCombinerClass(KMeansCombiner.class);
     conf.setReducerClass(KMeansReducer.class);
     conf.setNumReduceTasks(numReduceTasks);
-    conf.set(Cluster.CLUSTER_PATH_KEY, clustersIn);
-    conf.set(Cluster.DISTANCE_MEASURE_KEY, measureClass);
-    conf.set(Cluster.CLUSTER_CONVERGENCE_KEY, convergenceDelta);
-    conf.setInt(Cluster.ITERATION_NUMBER, iteration);
-
+    conf.set(KMeansConfigKeys.CLUSTER_PATH_KEY, clustersIn);
+    conf.set(KMeansConfigKeys.DISTANCE_MEASURE_KEY, measureClass);
+    conf.set(KMeansConfigKeys.CLUSTER_CONVERGENCE_KEY, convergenceDelta);
+    conf.set(KMeansConfigKeys.ITERATION_NUMBER, String.valueOf(iteration));
+    
     try {
       JobClient.runJob(conf);
       FileSystem fs = FileSystem.get(outPath.toUri(), conf);
@@ -277,9 +277,9 @@
 
     conf.setMapperClass(KMeansClusterMapper.class);
     conf.setNumReduceTasks(0);
-    conf.set(Cluster.CLUSTER_PATH_KEY, clustersIn);
-    conf.set(Cluster.DISTANCE_MEASURE_KEY, measureClass);
-    conf.set(Cluster.CLUSTER_CONVERGENCE_KEY, convergenceDelta);
+    conf.set(KMeansConfigKeys.CLUSTER_PATH_KEY, clustersIn);
+    conf.set(KMeansConfigKeys.DISTANCE_MEASURE_KEY, measureClass);
+    conf.set(KMeansConfigKeys.CLUSTER_CONVERGENCE_KEY, convergenceDelta);
 
     try {
       JobClient.runJob(conf);
Index: core/src/main/java/org/apache/mahout/clustering/kmeans/KMeansCombiner.java
===================================================================
--- core/src/main/java/org/apache/mahout/clustering/kmeans/KMeansCombiner.java	(revision 883446)
+++ core/src/main/java/org/apache/mahout/clustering/kmeans/KMeansCombiner.java	(working copy)
@@ -44,7 +44,6 @@
   @Override
   public void configure(JobConf job) {
     super.configure(job);
-    Cluster.configure(job);
   }
 
 }
Index: core/src/main/java/org/apache/mahout/clustering/kmeans/package.html
===================================================================
--- core/src/main/java/org/apache/mahout/clustering/kmeans/package.html	(revision 0)
+++ core/src/main/java/org/apache/mahout/clustering/kmeans/package.html	(revision 0)
@@ -0,0 +1,29 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+<head>
+<!--
+
+  @(#)package.html
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+ 
+      http://www.apache.org/licenses/LICENSE-2.0
+ 
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+ 
+-->
+</head>
+<body bgcolor="white"> 
+This package provides an implementation of the <a href="http://en.wikipedia.org/wiki/Kmeans">k-means</a> clustering
+algorithm.
+</body>
+</html>
\ No newline at end of file
Index: core/src/main/java/org/apache/mahout/clustering/package.html
===================================================================
--- core/src/main/java/org/apache/mahout/clustering/package.html	(revision 0)
+++ core/src/main/java/org/apache/mahout/clustering/package.html	(revision 0)
@@ -0,0 +1,37 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+<head>
+<!--
+
+  @(#)package.html
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+ 
+      http://www.apache.org/licenses/LICENSE-2.0
+ 
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+ 
+-->
+</head>
+<body bgcolor="white"> 
+This package provides several clustering algorithm implementations. Clustering usually groups a set of objects into groups
+of similar items. The definition of similarity usually is up to you - for text documents, cosine-distance/-similarity is
+recommended. Mahout also features other types of distance measure like Euclidean distance.
+<br>
+Input of each clustering algorithm is a set of vectors representing your items. For texts in general these are
+<a href="http://en.wikipedia.org/wiki/TFIDF">TFIDF</a> or <a href="http://en.wikipedia.org/wiki/Bag_of_words">Bag of words</a>
+representations of the documents.
+<br>
+Output of each clustering algorithm is either a hard or soft assigment of items to clusters.
+
+</body>
+</html>
\ No newline at end of file
Index: examples/src/main/java/org/apache/mahout/clustering/fuzzykmeans/DisplayFuzzyKMeans.java
===================================================================
--- examples/src/main/java/org/apache/mahout/clustering/fuzzykmeans/DisplayFuzzyKMeans.java	(revision 883446)
+++ examples/src/main/java/org/apache/mahout/clustering/fuzzykmeans/DisplayFuzzyKMeans.java	(working copy)
@@ -170,7 +170,6 @@
     points.addAll(sampleData);
     List<Canopy> canopies = populateCanopies(new ManhattanDistanceMeasure(), points, t1, t2);
     DistanceMeasure measure = new ManhattanDistanceMeasure();
-    Cluster.config(measure, 0.001);
     clusters = new ArrayList<List<SoftCluster>>();
     clusters.add(new ArrayList<SoftCluster>());
     for (Canopy canopy : canopies)
Index: examples/src/main/java/org/apache/mahout/clustering/kmeans/DisplayKMeans.java
===================================================================
--- examples/src/main/java/org/apache/mahout/clustering/kmeans/DisplayKMeans.java	(revision 883446)
+++ examples/src/main/java/org/apache/mahout/clustering/kmeans/DisplayKMeans.java	(working copy)
@@ -113,7 +113,7 @@
     // test for convergence
     boolean converged = true;
     for (Cluster cluster : clusters) {
-      if (!cluster.computeConvergence())
+      if (!cluster.computeConvergence(measure, 0.001))
         converged = false;
     }
     // update the cluster centers
@@ -177,7 +177,6 @@
     points.addAll(sampleData);
     List<Canopy> canopies = populateCanopies(new ManhattanDistanceMeasure(), points, t1, t2);
     DistanceMeasure measure = new ManhattanDistanceMeasure();
-    Cluster.config(measure, 0.001);
     clusters = new ArrayList<List<Cluster>>();
     clusters.add(new ArrayList<Cluster>());
     for (Canopy canopy : canopies)
