Author: dlyubimov
Date: Mon Mar 7 07:09:58 2011
New Revision: 1078699
URL: http://svn.apache.org/viewvc?rev=1078699&view=rev
Log:
MAHOUT-593 fixing style problems in EigenSolverWrapper (somehow slipped thru in
my previous patch).
Modified:
mahout/trunk/math/src/main/java/org/apache/mahout/math/ssvd/EigenSolverWrapper.java
Modified:
mahout/trunk/math/src/main/java/org/apache/mahout/math/ssvd/EigenSolverWrapper.java
URL:
http://svn.apache.org/viewvc/mahout/trunk/math/src/main/java/org/apache/mahout/math/ssvd/EigenSolverWrapper.java?rev=1078699&r1=1078698&r2=1078699&view=diff
==============================================================================
---
mahout/trunk/math/src/main/java/org/apache/mahout/math/ssvd/EigenSolverWrapper.java
(original)
+++
mahout/trunk/math/src/main/java/org/apache/mahout/math/ssvd/EigenSolverWrapper.java
Mon Mar 7 07:09:58 2011
@@ -21,41 +21,44 @@ import org.apache.commons.math.linear.Ei
import org.apache.commons.math.linear.RealMatrix;
/**
- * wraps appropriate eigen solver for BBt matrix.
- * Can be either colt or apache commons math. <P>
+ * wraps appropriate eigen solver for BBt matrix. Can be either colt or apache
+ * commons math.
+ * <P>
*
- * At the moment it is apache commons math which
- * is only in mahout-math dependencies. <P>
+ * At the moment it is apache commons math which is only in mahout-math
+ * dependencies.
+ * <P>
*
- * I will be happy to switch this to Colt eigensolver
- * if it is proven reliable (i experience internal errors
- * and unsorted singular values at some point).
+ * I will be happy to switch this to Colt eigensolver if it is proven reliable
+ * (i experience internal errors and unsorted singular values at some point).
*
* But for now commons-math seems to be more reliable.
*
*
- * @author Dmitriy
- *
*/
public class EigenSolverWrapper {
-
- private double[] m_eigenvalues;
- private double[][] m_uHat;
-
- public EigenSolverWrapper(double[][] bbt ) {
- super();
- int dim=bbt.length;
- EigenDecompositionImpl evd2=new EigenDecompositionImpl(new
Array2DRowRealMatrix(bbt),0);
- m_eigenvalues=evd2.getRealEigenvalues();
- RealMatrix uHatrm= evd2.getV();
- m_uHat = new double[dim][];
- for ( int i = 0; i < dim; i++ ) m_uHat [i]=uHatrm.getRow(i);
- }
-
- public double[][] getUHat() { return m_uHat; }
- public double[] getEigenValues() { return m_eigenvalues; }
-
-
-
+ private double[] eigenvalues;
+ private double[][] uHat;
+
+ public EigenSolverWrapper(double[][] bbt) {
+ super();
+ int dim = bbt.length;
+ EigenDecompositionImpl evd2 = new EigenDecompositionImpl(
+ new Array2DRowRealMatrix(bbt), 0);
+ eigenvalues = evd2.getRealEigenvalues();
+ RealMatrix uHatrm = evd2.getV();
+ uHat = new double[dim][];
+ for (int i = 0; i < dim; i++)
+ uHat[i] = uHatrm.getRow(i);
+ }
+
+ public double[][] getUHat() {
+ return uHat;
+ }
+
+ public double[] getEigenValues() {
+ return eigenvalues;
+ }
+
}