diff --git a/Project.toml b/Project.toml index b89bf38..f9b1cd4 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "SparseArraysBase" uuid = "0d5efcca-f356-4864-8770-e1ed8d78f208" authors = ["ITensor developers and contributors"] -version = "0.7.2" +version = "0.7.3" [deps] Accessors = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697" diff --git a/src/abstractsparsearrayinterface.jl b/src/abstractsparsearrayinterface.jl index ff6e3e4..6e6c588 100644 --- a/src/abstractsparsearrayinterface.jl +++ b/src/abstractsparsearrayinterface.jl @@ -20,6 +20,8 @@ struct Unstored{T,N,P<:AbstractArray{T,N}} <: AbstractArray{T,N} parent::P end Base.parent(a::Unstored) = a.parent +Base.size(a::Unstored) = size(parent(a)) +Base.axes(a::Unstored) = axes(parent(a)) unstored(a::AbstractArray) = Zeros{eltype(a)}(axes(a)) diff --git a/test/test_unstored.jl b/test/test_unstored.jl new file mode 100644 index 0000000..12a83eb --- /dev/null +++ b/test/test_unstored.jl @@ -0,0 +1,11 @@ +using SparseArraysBase: Unstored +using FillArrays: Zeros +using Test: @test, @testset + +@testset "Unstored" begin + a = Zeros(2, 2) + u = Unstored(a) + @test parent(u) ≡ a + @test size(u) ≡ size(a) + @test axes(u) ≡ axes(a) +end