Skip to content

Commit b93fd0e

Browse files
committed
update README
1 parent c47ef44 commit b93fd0e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ using SparseArraysBase:
4848
zero!
4949
using Test: @test, @test_throws
5050

51-
a = SparseArrayDOK{Float64}(2, 2)
51+
a = SparseArrayDOK{Float64}(undef, 2, 2)
5252
````
5353

5454
AbstractArray interface:
@@ -122,32 +122,32 @@ b = a[1:2, 2]
122122
@test b == [12, 0]
123123
@test storedlength(b) == 1
124124

125-
a = SparseArrayDOK{Float64}(2, 2)
125+
a = SparseArrayDOK{Float64}(undef, 2, 2)
126126
a .= 2
127127
for I in eachindex(a)
128128
@test a[I] == 2
129129
end
130130
@test storedlength(a) == length(a)
131131

132-
a = SparseArrayDOK{Float64}(2, 2)
132+
a = SparseArrayDOK{Float64}(undef, 2, 2)
133133
fill!(a, 2)
134134
for I in eachindex(a)
135135
@test a[I] == 2
136136
end
137137
@test storedlength(a) == length(a)
138138

139-
a = SparseArrayDOK{Float64}(2, 2)
139+
a = SparseArrayDOK{Float64}(undef, 2, 2)
140140
fill!(a, 0)
141141
@test iszero(a)
142142
@test iszero(storedlength(a))
143143

144-
a = SparseArrayDOK{Float64}(2, 2)
144+
a = SparseArrayDOK{Float64}(undef, 2, 2)
145145
a[1, 2] = 12
146146
zero!(a)
147147
@test iszero(a)
148148
@test iszero(storedlength(a))
149149

150-
a = SparseArrayDOK{Float64}(2, 2)
150+
a = SparseArrayDOK{Float64}(undef, 2, 2)
151151
a[1, 2] = 12
152152
b = zero(a)
153153
@test iszero(b)

0 commit comments

Comments
 (0)