File tree 1 file changed +7
-5
lines changed
1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change 1
1
length (a:: SA ) where {SA <: StaticArray } = prod (Size (SA))
2
2
length (a:: Type{SA} ) where {SA <: StaticArray } = prod (Size (SA))
3
3
4
- size (:: StaticArray{S} ) where {S} = get (Size (S))
5
- @pure size (:: Type{<:StaticArray{S}} ) where {S} = get (Size (S))
6
-
7
- size (:: SA , d:: Int ) where {SA <: StaticArray } = Size (SA)[d]
8
- @pure size (:: Type{SA} , d:: Int ) where {SA <: StaticArray } = Size (SA)[d]
4
+ @pure size (:: Type{<:StaticArray{S}} ) where S = tuple (S. parameters... )
5
+ @inline function size (t:: Type{<:StaticArray} , d:: Int )
6
+ S = size (t)
7
+ d > length (S) ? 1 : S[d]
8
+ end
9
+ @inline size (a:: StaticArray ) = size (typeof (a))
10
+ @inline size (a:: StaticArray , d:: Int ) = size (typeof (a), d)
9
11
10
12
# This seems to confuse Julia a bit in certain circumstances (specifically for trailing 1's)
11
13
@inline function Base. isassigned (a:: StaticArray , i:: Int... )
You can’t perform that action at this time.
0 commit comments