Package org.apache.spark.mllib.linalg
Class EigenValueDecomposition
Object
org.apache.spark.mllib.linalg.EigenValueDecomposition
Compute eigen-decomposition.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionsymmetricEigs
(scala.Function1<breeze.linalg.DenseVector<Object>, breeze.linalg.DenseVector<Object>> mul, int n, int k, double tol, int maxIterations) Compute the leading k eigenvalues and eigenvectors on a symmetric square matrix using ARPACK.
-
Constructor Details
-
EigenValueDecomposition
public EigenValueDecomposition()
-
-
Method Details
-
symmetricEigs
public static scala.Tuple2<breeze.linalg.DenseVector<Object>,breeze.linalg.DenseMatrix<Object>> symmetricEigs(scala.Function1<breeze.linalg.DenseVector<Object>, breeze.linalg.DenseVector<Object>> mul, int n, int k, double tol, int maxIterations) Compute the leading k eigenvalues and eigenvectors on a symmetric square matrix using ARPACK. The caller needs to ensure that the input matrix is real symmetric. This function requires memory forn*(4*k+4)
doubles.- Parameters:
mul
- a function that multiplies the symmetric matrix with a DenseVector.n
- dimension of the square matrix (maximum Int.MaxValue).k
- number of leading eigenvalues required, where k must be positive and less than n.tol
- tolerance of the eigs computation.maxIterations
- the maximum number of Arnoldi update iterations.- Returns:
- a dense vector of eigenvalues in descending order and a dense matrix of eigenvectors (columns of the matrix).
- Note:
- The number of computed eigenvalues might be smaller than k when some Ritz values do not satisfy the convergence criterion specified by tol (see ARPACK Users Guide, Chapter 4.6 for more details). The maximum number of Arnoldi update iterations is set to 300 in this function.
-