@@ -16,11 +16,12 @@ julia> ev[2]
16160x0000000000000002
1717```
1818"""
19- struct StaticElementVector{N,S,C}
19+ struct StaticElementVector{N,S,C} <: AbstractVector{UInt64}
2020 data:: NTuple{C,UInt64}
2121end
2222
2323Base. length (:: StaticElementVector{N,S,C} ) where {N,S,C} = N
24+ Base. size (:: StaticElementVector{N,S,C} ) where {N,S,C} = (N,)
2425Base.:(== )(x:: StaticElementVector , y:: AbstractVector ) = [x... ] == [y... ]
2526Base.:(== )(x:: AbstractVector , y:: StaticElementVector ) = [x... ] == [y... ]
2627Base.:(== )(x:: StaticElementVector{N,S,C} , y:: StaticElementVector{N,S,C} ) where {N,S,C} = x. data == y. data
@@ -137,6 +138,7 @@ function Base.iterate(x::StaticElementVector{N,S,C}, state=1) where {N,S,C}
137138end
138139
139140Base. show (io:: IO , t:: StaticElementVector ) = Base. print (io, " $(join (Int .(t), " " )) " )
141+ Base. show (io:: IO , :: MIME"text/plain" , t:: StaticElementVector ) = Base. show (io, t)
140142
141143function Base. count_ones (x:: StaticBitVector )
142144 sum (v-> count_ones (v),x. data)
@@ -166,4 +168,4 @@ function parse_vector(nflavor::Int, str::String)
166168 end
167169 end
168170 return StaticElementVector (nflavor, val)
169- end
171+ end
0 commit comments