Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "BlockSparseArrays"
uuid = "2c9a651f-6452-4ace-a6ac-809f4280fbb4"
authors = ["ITensor developers <[email protected]> and contributors"]
version = "0.4.3"
version = "0.4.4"

[deps]
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
Expand Down
7 changes: 2 additions & 5 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@ using BlockSparseArrays: BlockSparseArrays
using Documenter: Documenter, DocMeta, deploydocs, makedocs

DocMeta.setdocmeta!(
BlockSparseArrays,
:DocTestSetup,
quote
BlockSparseArrays, :DocTestSetup, quote
using BlockSparseArrays
using LinearAlgebra: Diagonal
end;
recursive=true,
end; recursive=true
)

include("make_index.jl")
Expand Down
15 changes: 9 additions & 6 deletions src/blocksparsearrayinterface/blocksparsearrayinterface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,9 @@ end

struct BlockSparseArrayInterface <: AbstractBlockSparseArrayInterface end

@interface ::AbstractBlockSparseArrayInterface BlockArrays.blocks(a::AbstractArray) =
error("Not implemented")
@interface ::AbstractBlockSparseArrayInterface BlockArrays.blocks(a::AbstractArray) = error(
"Not implemented"
)

@interface ::AbstractBlockSparseArrayInterface function SparseArraysBase.isstored(
a::AbstractArray{<:Any,N}, I::Vararg{Int,N}
Expand Down Expand Up @@ -336,10 +337,12 @@ end
reverse_index(index) = reverse(index)
reverse_index(index::CartesianIndex) = CartesianIndex(reverse(Tuple(index)))

@interface ::AbstractBlockSparseArrayInterface BlockArrays.blocks(a::Transpose) =
transpose(blocks(parent(a)))
@interface ::AbstractBlockSparseArrayInterface BlockArrays.blocks(a::Adjoint) =
adjoint(blocks(parent(a)))
@interface ::AbstractBlockSparseArrayInterface BlockArrays.blocks(a::Transpose) = transpose(
blocks(parent(a))
)
@interface ::AbstractBlockSparseArrayInterface BlockArrays.blocks(a::Adjoint) = adjoint(
blocks(parent(a))
)

# Represents the array of arrays of a `SubArray`
# wrapping a block spare array, i.e. `blocks(array)` where `a` is a `SubArray`.
Expand Down
3 changes: 2 additions & 1 deletion src/factorizations/svd.jl
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,9 @@ julia> Uonly == U
true
```
"""
svd(A; kwargs...) =
function svd(A; kwargs...)
SVD(svd!(eigencopy_oftype(A, LinearAlgebra.eigtype(eltype(A))); kwargs...))
end

LinearAlgebra.svdvals(usv::SVD{<:Any,T}) where {T} = (usv.S)::AbstractVector{T}

Expand Down
6 changes: 4 additions & 2 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ const GROUP = uppercase(
)

"match files of the form `test_*.jl`, but exclude `*setup*.jl`"
istestfile(fn) =
function istestfile(fn)
endswith(fn, ".jl") && startswith(basename(fn), "test_") && !contains(fn, "setup")
end
"match files of the form `*.jl`, but exclude `*_notest.jl` and `*setup*.jl`"
isexamplefile(fn) =
function isexamplefile(fn)
endswith(fn, ".jl") && !endswith(fn, "_notest.jl") && !contains(fn, "setup")
end

@time begin
# tests in groups based on folder structure
Expand Down
8 changes: 4 additions & 4 deletions test/test_basics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -242,11 +242,11 @@ arrayts = (Array, JLArray)
@test Array(a) isa Array{elt,0}
@test Array(a) == fill(0)
for b in (
(b = copy(a); @allowscalar(b[] = 2); b),
(b = copy(a); @allowscalar(b[CartesianIndex()] = 2); b),
(b = copy(a); @allowscalar(b[Block()[]] = 2); b),
(b=copy(a); @allowscalar(b[] = 2); b),
(b=copy(a); @allowscalar(b[CartesianIndex()] = 2); b),
(b=copy(a); @allowscalar(b[Block()[]] = 2); b),
# Regression test for https://github.com/ITensor/BlockSparseArrays.jl/issues/27.
(b = copy(a); b[Block()] = dev(fill(2)); b),
(b=copy(a); b[Block()]=dev(fill(2)); b),
)
@test size(b) == ()
@test isone(length(b))
Expand Down