From e4cc2a6a0359c5f6d43504b7a2e52b7749d26d1c Mon Sep 17 00:00:00 2001 From: Jukka Aho Date: Thu, 15 Dec 2016 12:41:22 +0200 Subject: [PATCH] possibility to slice DVTI field, i.e. f[1:3] works now --- src/fields.jl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/fields.jl b/src/fields.jl index 2ff82bf..158ef8f 100644 --- a/src/fields.jl +++ b/src/fields.jl @@ -174,6 +174,10 @@ function getindex(field::DVTI, i::Int64) return field.data[i] end +function getindex(field::DVTI, I::Array{Int64, 1}) + return [field.data[i] for i in I] +end + function getindex(field::DCTV, i::Int64) return field.data[i] end