Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
GiggleLiu committed May 24, 2024
1 parent 2177165 commit e38c265
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/DitStr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,8 @@ One can specify the value of the nonzero entry by inputing a pair.
onehot(::Type{T}, n::DitStr{D,N,T1}; nbatch=nothing) where {D,T, N,T1} = _onehot(T, D^N, buffer(n)+1; nbatch)
onehot(n::DitStr; nbatch=nothing) = onehot(ComplexF64, n; nbatch)

readbit(x::DitStr{D, N, LongLongUInt{C}}, loc::Int) where {D, N, C} = readbit(x.buf, loc)

########## @dit_str macro ##############
"""
@dit_str -> DitStr64
Expand Down
1 change: 0 additions & 1 deletion src/longlonguint.jl
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ function readbit(x::LongLongUInt{C}, loc::Int) where {C}
k = (loc-1) ÷ bsizeof(UInt)
return readbit(x.content[C-k], loc - k*bsizeof(UInt))
end
readbit(x::DitStr{D, N, LongLongUInt{C}}, loc::Int) where {D, N, C} = readbit(x.buf, loc)
function indicator(::Type{LongLongUInt{C}}, i::Int) where C
k = (i-1) ÷ bsizeof(UInt)
LongLongUInt{C}(ntuple(j->j==C-k ? indicator(UInt, i-k*bsizeof(UInt)) : zero(UInt), Val{C}()))
Expand Down

0 comments on commit e38c265

Please sign in to comment.