Last active
September 13, 2017 15:29
-
-
Save fpopic/c54f9f943752f740474fc9597d45ec5d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| List<Vector> local = A.toRowMatrix().rows().toJavaRDD().collect(); | |
| int M = (int) A.numRows(); | |
| int N = (int) A.numCols(); | |
| double[] arr = new double[M * N]; | |
| for (int i = 0; i < M; i++) { | |
| for (int j = 0; j < N; j++) { | |
| arr[i * N + j] = local.get(i).apply(j); | |
| } | |
| } | |
| DenseMatrix localMatrix = new DenseMatrix(M, N, arr); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment