Created
April 12, 2014 19:44
-
-
Save bartosz-witkowski/10553147 to your computer and use it in GitHub Desktop.
This file contains 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
val _10 = Stream.from(1).take(10) | |
val data = Stream.continually(_10).take(10).flatten.toArray | |
// Exiting paste mode, now interpreting. | |
_10: scala.collection.immutable.Stream[Int] = Stream(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) | |
data: Array[Int] = Array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10) | |
scala> :paste | |
// Entering paste mode (ctrl-D to finish) | |
val mat = new DenseMatrix(rows = 10, data, offset = 0).t | |
// Exiting paste mode, now interpreting. | |
mat: breeze.linalg.DenseMatrix[Int] = | |
1 2 3 4 5 6 7 8 9 10 | |
1 2 3 4 5 6 7 8 9 10 | |
1 2 3 4 5 6 7 8 9 10 | |
1 2 3 4 5 6 7 8 9 10 | |
1 2 3 4 5 6 7 8 9 10 | |
1 2 3 4 5 6 7 8 9 10 | |
1 2 3 4 5 6 7 8 9 10 | |
1 2 3 4 5 6 7 8 9 10 | |
1 2 3 4 5 6 7 8 9 10 | |
1 2 3 4 5 6 7 8 9 10 | |
scala> :paste | |
// Entering paste mode (ctrl-D to finish) | |
val area = mat(3 until 6, 2 until 7) | |
// Exiting paste mode, now interpreting. | |
area: breeze.linalg.DenseMatrix[Int] = | |
3 4 5 6 7 | |
3 4 5 6 7 | |
3 4 5 6 7 | |
scala> :paste | |
// Entering paste mode (ctrl-D to finish) | |
area(1 until area.rows, 0 until area.cols) | |
// Exiting paste mode, now interpreting. | |
res17: breeze.linalg.DenseMatrix[Int] = | |
8 9 10 1 2 | |
8 9 10 1 2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
bug, sorry, we'll get it fixed.