FWIW, I came up with the following snippet to get the behavior that I want:
const nchans = size(userData.samples, 2)
const samples = sub(userData.samples, tuple(rng, ntuple(nchans - 1, _
-:)...))
It appears to work.
On Sunday, February 1, 2015 at 8:38:09 PM UTC-5, Tim Holy wrote:
SubArrays
A subtle difference for Julia v0.3:
const nchans = size(userData.samples, 2)
const samples = sub(userData.samples, tuple(rng, ntuple(nchans - 1, _
-:)...)...)
because (I think) of https://github.com/JuliaLang/julia/issues/4869
On Saturday, February 7, 2015 at 1:44:28 PM UTC-5, Daniel Casimiro
Hi,
I noticed that the sub function behaves differently in master and version
0.3.5, when handling data of type Array{Float64, 1}. I am not sure if the
change is intentional.
The following works as expected on Julia master:
*julia* *sub([1.0; 2; 3; 4], 1:3, :)*
but, fails in version 0.3.5
SubArrays have been entirely rewritten in 0.4, and can do quite a few tricks
that the old ones can't. Changing the dimensionality of the view compared to
the parent, as in your example, is one of them. Here's another example of
something you simply can't do on 0.3:
julia A = reshape(1:15, 3,