Skip to content

Commit a64073a

Browse files
authored
More functionality for Unstored wrapper (#68)
1 parent d8d2b73 commit a64073a

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "SparseArraysBase"
22
uuid = "0d5efcca-f356-4864-8770-e1ed8d78f208"
33
authors = ["ITensor developers <[email protected]> and contributors"]
4-
version = "0.7.2"
4+
version = "0.7.3"
55

66
[deps]
77
Accessors = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697"

src/abstractsparsearrayinterface.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ struct Unstored{T,N,P<:AbstractArray{T,N}} <: AbstractArray{T,N}
2020
parent::P
2121
end
2222
Base.parent(a::Unstored) = a.parent
23+
Base.size(a::Unstored) = size(parent(a))
24+
Base.axes(a::Unstored) = axes(parent(a))
2325

2426
unstored(a::AbstractArray) = Zeros{eltype(a)}(axes(a))
2527

test/test_unstored.jl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
using SparseArraysBase: Unstored
2+
using FillArrays: Zeros
3+
using Test: @test, @testset
4+
5+
@testset "Unstored" begin
6+
a = Zeros(2, 2)
7+
u = Unstored(a)
8+
@test parent(u) a
9+
@test size(u) size(a)
10+
@test axes(u) axes(a)
11+
end

0 commit comments

Comments
 (0)