@@ -32,7 +32,7 @@ type DArray{T,N,A} <: AbstractArray{T,N}
32
32
33
33
release:: Bool
34
34
35
- function DArray (id, dims, pids, indexes, cuts, lp)
35
+ function DArray {T,N,A} (id, dims, pids, indexes, cuts, lp) where {T,N,A}
36
36
# check invariants
37
37
if dims != map (last, last (indexes))
38
38
throw (ArgumentError (" dimension of DArray (dim) and indexes do not match" ))
@@ -52,14 +52,14 @@ type DArray{T,N,A} <: AbstractArray{T,N}
52
52
d
53
53
end
54
54
55
- DArray () = new ()
55
+ DArray {T,N,A} () where {T,N,A} = new ()
56
56
end
57
57
58
58
eltype {T} (:: Type{DArray{T}} ) = T
59
59
empty_localpart (T,N,A) = convert (A, Array {T} (ntuple (zero, N)))
60
60
61
- typealias SubDArray{T,N,D<: DArray } SubArray{T,N,D}
62
- typealias SubOrDArray{T,N} Union{DArray{T,N}, SubDArray{T,N}}
61
+ const SubDArray{T,N,D<: DArray } = SubArray{T,N,D}
62
+ const SubOrDArray{T,N} = Union{DArray{T,N}, SubDArray{T,N}}
63
63
64
64
localtype {T,N,S} (:: Type{DArray{T,N,S}} ) = S
65
65
localtype {T,N,D} (:: Type{SubDArray{T,N,D}} ) = localtype (D)
@@ -639,9 +639,9 @@ Base.@propagate_inbounds Base.getindex{_,N}(M::MergedIndices{_,N}, I::Vararg{Int
639
639
# farther and say that even restricted views of MergedIndices must be valid
640
640
# over the entire array. This is overly strict in general, but in this
641
641
# use-case all the merged indices must be valid at some point, so it's ok.
642
- typealias ReshapedMergedIndices{T,N,M<: MergedIndices } Base. ReshapedArray{T,N,M}
643
- typealias SubMergedIndices{T,N,M<: Union{MergedIndices, ReshapedMergedIndices} } SubArray{T,N,M}
644
- typealias MergedIndicesOrSub Union{MergedIndices, ReshapedMergedIndices, SubMergedIndices}
642
+ const ReshapedMergedIndices{T,N,M<: MergedIndices } = Base. ReshapedArray{T,N,M}
643
+ const SubMergedIndices{T,N,M<: Union{MergedIndices, ReshapedMergedIndices} } = SubArray{T,N,M}
644
+ const MergedIndicesOrSub = Union{MergedIndices, ReshapedMergedIndices, SubMergedIndices}
645
645
import Base: checkbounds_indices
646
646
@inline checkbounds_indices (:: Type{Bool} , inds:: Tuple{} , I:: Tuple{MergedIndicesOrSub,Vararg{Any}} ) =
647
647
checkbounds_indices (Bool, inds, (parent (parent (I[1 ])). indices... , tail (I)... ))
0 commit comments