Skip to content

Commit

Permalink
Merge branch 'NDTensors_smallset_bugs' of github.com:ITensor/ITensors…
Browse files Browse the repository at this point in the history
….jl into NDTensors_smallset_bugs
  • Loading branch information
mtfishman committed Oct 6, 2023
2 parents ef53e47 + 997221a commit b2573d9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 6 additions & 2 deletions NDTensors/src/BlockSparseArrays/src/blocksparsearray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,16 @@ struct BlockZero{Axes}
axes::Axes
end

function (f::BlockZero)(arraytype::Type{<:AbstractArray{T,N}}, I::CartesianIndex{N}) where {T,N}
function (f::BlockZero)(
arraytype::Type{<:AbstractArray{T,N}}, I::CartesianIndex{N}
) where {T,N}
return fill!(arraytype(undef, block_size(f.axes, Block(Tuple(I)))), false)
end

# Fallback to Array if it is abstract
function (f::BlockZero)(arraytype::Type{AbstractArray{T,N}}, I::CartesianIndex{N}) where {T,N}
function (f::BlockZero)(
arraytype::Type{AbstractArray{T,N}}, I::CartesianIndex{N}
) where {T,N}
return fill!(Array{T,N}(undef, block_size(f.axes, Block(Tuple(I)))), false)
end

Expand Down
4 changes: 3 additions & 1 deletion NDTensors/src/SmallVectors/src/BaseExt/sort.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ function sort!(
if VERSION < v"1.8.4"
Base.sort!(v, alg, order)
else
Base.Sort._sort!(v, Base.Sort.maybe_apply_initial_optimizations(alg), order, (; scratch))
Base.Sort._sort!(
v, Base.Sort.maybe_apply_initial_optimizations(alg), order, (; scratch)
)
end
return v
end

0 comments on commit b2573d9

Please sign in to comment.