Closed yiyezhiqiu233 closed 3 years ago
The behaviors of DenseVector.slice and new DenseVector seems different: slice an array (0,15) into 4 slices
val array=Array.range(0,16) val dv = new DenseVector[Int](array)
1.slice using new DenseVector
for (i <- 0 until 4) { System.out.println(new DenseVector[Int](array, i, 4, 4)) }
and got
DenseVector(0, 4, 8, 12) DenseVector(1, 5, 9, 13) DenseVector(2, 6, 10, 14) DenseVector(3, 7, 11, 15)
2.slice using DenseVector.slice
for (i <- 0 until 4) { System.out.println(dv.slice(i, dv.length, 4)) }
but got
DenseVector(0, 4, 8, 12) DenseVector(1, 5, 9) DenseVector(2, 6, 10) DenseVector(3, 7, 11)
The behaviors of DenseVector.slice and new DenseVector seems different: slice an array (0,15) into 4 slices
1.slice using new DenseVector
and got
2.slice using DenseVector.slice
but got