Skip to content

Commit 16671a0

Browse files
committed
Update README
1 parent acef25f commit 16671a0

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ julia> Pkg.add("BlockSparseArrays")
3535

3636
````julia
3737
using BlockArrays: BlockArrays, BlockedVector, Block, blockedrange
38-
using BlockSparseArrays: BlockSparseArray, blockstoredlength
38+
using BlockSparseArrays: BlockSparseArray, blockstoredlength, sparsemortar
3939
using Test: @test, @test_broken
4040

4141
function main()
@@ -60,13 +60,13 @@ function main()
6060
reshape(@view(d_data[Block(i)]), block_size(i_axes, nz_blocks[i])) for
6161
i in 1:length(nz_blocks)
6262
]
63-
b = BlockSparseArray(nz_blocks, d_blocks, i_axes)
63+
b = sparsemortar(nz_blocks, d_blocks, i_axes)
6464

6565
@test blockstoredlength(b) == 2
6666

6767
# Blocks with discontiguous underlying data
6868
d_blocks = randn.(nz_block_sizes)
69-
b = BlockSparseArray(nz_blocks, d_blocks, i_axes)
69+
b = sparsemortar(nz_blocks, d_blocks, i_axes)
7070

7171
@test blockstoredlength(b) == 2
7272

@@ -114,7 +114,7 @@ using BlockSparseArrays: BlockSparseArray
114114

115115
i1 = [2, 3]
116116
i2 = [2, 3]
117-
B = BlockSparseArray{Float64}(i1, i2)
117+
B = BlockSparseArray{Float64}(undef, i1, i2)
118118
B[Block(1, 1)] = randn(2, 2)
119119
B[Block(2, 2)] = randn(3, 3)
120120

examples/README.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ julia> Pkg.add("BlockSparseArrays")
4040
# ## Examples
4141

4242
using BlockArrays: BlockArrays, BlockedVector, Block, blockedrange
43-
using BlockSparseArrays: BlockSparseArray, blockstoredlength
43+
using BlockSparseArrays: BlockSparseArray, blockstoredlength, sparsemortar
4444
using Test: @test, @test_broken
4545

4646
function main()
@@ -65,13 +65,13 @@ function main()
6565
reshape(@view(d_data[Block(i)]), block_size(i_axes, nz_blocks[i])) for
6666
i in 1:length(nz_blocks)
6767
]
68-
b = BlockSparseArray(nz_blocks, d_blocks, i_axes)
68+
b = sparsemortar(nz_blocks, d_blocks, i_axes)
6969

7070
@test blockstoredlength(b) == 2
7171

7272
## Blocks with discontiguous underlying data
7373
d_blocks = randn.(nz_block_sizes)
74-
b = BlockSparseArray(nz_blocks, d_blocks, i_axes)
74+
b = sparsemortar(nz_blocks, d_blocks, i_axes)
7575

7676
@test blockstoredlength(b) == 2
7777

@@ -117,7 +117,7 @@ using BlockSparseArrays: BlockSparseArray
117117

118118
i1 = [2, 3]
119119
i2 = [2, 3]
120-
B = BlockSparseArray{Float64}(i1, i2)
120+
B = BlockSparseArray{Float64}(undef, i1, i2)
121121
B[Block(1, 1)] = randn(2, 2)
122122
B[Block(2, 2)] = randn(3, 3)
123123

0 commit comments

Comments
 (0)