Closed dievsky closed 5 years ago
And an inverted issue:
val a = DoubleArray(4) { it.toDouble() }.asF64Array().reshape(2, 2) // a 2x2 matrix
check(a.isDense) // passes
val aT = a.T // transposed matrix
check(aT.isDense) // fails
(Even though aT
is a view of the same exact 4-element array.)
We also have a wonderful reversed
method which creates an array with negative strides. It could very well be dense, but it won't occupy the range [offset, offset + size)
, as all vector operations expect.
It required a thorough rewrite (as well as killing transpose
and reversed
), but once issue-17
branch is merged, this issue will be history.
Fixed by 1efb244c0f11dccf93ff3588709735485151a957.
It says so right in the comment:
It's not the best practice to rely on such assumptions. In fact, they can be easily violated using the provided API only.
Uncommenting the
expInPlace
line causes the test to fail, even thoughaView0
andaView1
don't intersect! This happens becauseviktor
incorrectly assumes thataView0
is dense and appliesexpInPlace
to elements0..3
of the originala
array.We should fix this issue and add tests.