You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
immutable IndicesFast1D <:IndicesPerformanceend# indices(A, d) is fast
@@ -178,6 +179,8 @@ start at something different from 1), it is equivalent to `indices(A,
178
179
d)`.
179
180
"""
180
181
shape(a, d) =shape(indicesbehavior(a), a, d)
182
+
shape(::NoIndices, a) = (1,)
183
+
shape(::NoIndices, a, d) = (1,)
181
184
shape(::IndicesStartAt1, a) =size(a)
182
185
shape(::IndicesStartAt1, a, d) =size(a, d)
183
186
shape(::IndicesBehavior, a) =indices(a)
@@ -412,8 +415,9 @@ end
412
415
promote_indices(a::AbstractArray, b::AbstractArray) =_promote_indices(indicesbehavior(a), indicesbehavior(b), a, b)
413
416
_promote_indices(::IndicesStartAt1, ::IndicesStartAt1, a, b) = a
414
417
_promote_indices(::IndicesBehavior, ::IndicesBehavior, a, b) =throw(ArgumentError("types $(typeof(a)) and $(typeof(b)) do not have promote_indices defined"))
415
-
promote_indices(a::Number, b::AbstractArray) = b
416
-
promote_indices(a::AbstractArray, b::Number) = a
418
+
promote_indices(a, b::AbstractArray) = b
419
+
promote_indices(a::AbstractArray, b) = a
420
+
promote_indices(a, b) = a
417
421
418
422
# Strip off the index-changing container---this assumes that `parent`
419
423
# performs such an operation. TODO: since few things in Base need this, it
0 commit comments