Re: [julia-users] constructing ArrayViews with indexers that are not representable as a range

2014-11-21 Thread Ján Dolinský
Thanks for this tip.

I am OK at the moment on 0.3 with e.g. X[:, 2,7,8,10] or X[:, 2,7,7,10]. It 
creates a copy but it is good enough at the moment.

Thanks,
Jan  



Re: [julia-users] constructing ArrayViews with indexers that are not representable as a range

2014-11-21 Thread Tim Holy
As of yesterday you can do this on julia 0.4 (using `sub` or `slice`). I don't 
know of an alternative way to do it on 0.3.

--Tim

On Friday, November 21, 2014 01:40:50 AM Ján Dolinský wrote:
> Hello,
> 
> I am trying to create an ArrayView with column indexer like [2,7,8,10] or
> even a repeating example like [2,7,7,10].  E.g.
> 
> X = rand(10,10)
> 
> view(X, :, [2,7,8,10])
> 
> Is this possible at the moment ? The documentation of ArrayViews says that
> four types of indexers are supported: integer, range (*e.g.* a:b), stepped
> range (*e.g.* a:b:c), and colon (*i.e.*, :).
> 
> Thanks,
> Jan



[julia-users] constructing ArrayViews with indexers that are not representable as a range

2014-11-21 Thread Ján Dolinský
Hello,

I am trying to create an ArrayView with column indexer like [2,7,8,10] or 
even a repeating example like [2,7,7,10].  E.g.

X = rand(10,10)

view(X, :, [2,7,8,10])

Is this possible at the moment ? The documentation of ArrayViews says that 
four types of indexers are supported: integer, range (*e.g.* a:b), stepped 
range (*e.g.* a:b:c), and colon (*i.e.*, :).

Thanks,
Jan