@@ -245,6 +245,23 @@ class RowMatrix(
245245 RowMatrix .triuToFull(n, GU .data)
246246 }
247247
248+ /**
249+ * Computes the singular value decomposition of this matrix, using default tolerance (1e-9).
250+ *
251+ * @param k number of singular values to keep. We might return less than k if there are
252+ * numerically zero singular values. See rCond.
253+ * @param computeU whether to compute U
254+ * @param rCond the reciprocal condition number. All singular values smaller than rCond * sigma(0)
255+ * are treated as zero, where sigma(0) is the largest singular value.
256+ * @return SingularValueDecomposition(U, s, V)
257+ */
258+ def computeSVD (
259+ k : Int ,
260+ computeU : Boolean = false ,
261+ rCond : Double = 1e-9 ): SingularValueDecomposition [RowMatrix , Matrix ] = {
262+ computeSVD(k, computeU, rCond, 1e-9 )
263+ }
264+
248265 /**
249266 * Computes the singular value decomposition of this matrix.
250267 * Denote this matrix by A (m x n), this will compute matrices U, S, V such that A ~= U * S * V',
@@ -281,9 +298,9 @@ class RowMatrix(
281298 */
282299 def computeSVD (
283300 k : Int ,
284- computeU : Boolean = false ,
285- rCond : Double = 1e-9 ,
286- tol : Double = 1e-6 ): SingularValueDecomposition [RowMatrix , Matrix ] = {
301+ computeU : Boolean ,
302+ rCond : Double ,
303+ tol : Double ): SingularValueDecomposition [RowMatrix , Matrix ] = {
287304 val n = numCols().toInt
288305 require(k > 0 && k <= n, s " Request up to n singular values k= $k n= $n. " )
289306
0 commit comments