Re: [julia-users] Arrays with custom indices examples?

2016-10-24 Thread Angel de Vicente
Hi, Tim Holy writes: > That document is aimed at developers to tell them how to make their package > ready for arrays that have custom indices. As a user, the key line is: > >> Such array types are expected to be supplied through packages. > > I recommend the OffsetArrays

Re: [julia-users] Arrays with custom indices examples?

2016-10-24 Thread Tim Holy
That document is aimed at developers to tell them how to make their package ready for arrays that have custom indices. As a user, the key line is: > Such array types are expected to be supplied through packages. I recommend the OffsetArrays package. Great to see someone interested in trying

Re: [julia-users] Arrays with custom indices examples?

2016-10-24 Thread Mauro
I think you have to make your own type. You can't just request that ordinary arrays use different indexing. On Mon, 2016-10-24 at 20:34, Angel de Vicente wrote: > Hi, > > Isaiah Norton writes: >> mg = zeros(Int,(0:4,0:4)) >> >>

Re: [julia-users] Arrays with custom indices examples?

2016-10-24 Thread Angel de Vicente
Hi, Isaiah Norton writes: > mg = zeros(Int,(0:4,0:4)) > > This isn't related to indexing -- it doesn't work with `1:4` > either. But it doesn't complain if I do: , | julia> mg=zeros(Int,(0:4)) | 5-element Array{Int64,1}: | 0 | 0 | 0 | 0 | 0 ` (though

Re: [julia-users] Arrays with custom indices examples?

2016-10-24 Thread Isaiah Norton
> > mg = zeros(Int,(0:4,0:4)) This isn't related to indexing -- it doesn't work with `1:4` either. Use: zeros(Int, 4, 4) (See also the help entry: `?zeros`) That said, be aware of the warnings in the referenced document: this feature is still considered experimental, so if you hit other

[julia-users] Arrays with custom indices examples?

2016-10-24 Thread Angel de Vicente
Hi, I'm trying to figure out how to use arrays with custom indices, and I've read http://docs.julialang.org/en/release-0.5/devdocs/offset-arrays/, but I don't seem to see how I could actually access array positions using arbitrary indices. A basic example of what I'd like to do would be