File tree Expand file tree Collapse file tree 2 files changed +21
-3
lines changed Expand file tree Collapse file tree 2 files changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -22,12 +22,14 @@ using BlockSparseArrays:
22
22
BlockSparseMatrix,
23
23
BlockSparseVector,
24
24
BlockView,
25
- blockstoredlength ,
25
+ blockrange ,
26
26
blockreshape,
27
- eachblockstoredindex,
28
- eachstoredblock,
27
+ blockstoredlength,
29
28
blockstype,
30
29
blocktype,
30
+ eachblockaxis,
31
+ eachblockstoredindex,
32
+ eachstoredblock,
31
33
sparsemortar,
32
34
view!
33
35
using GPUArraysCore: @allowscalar
Original file line number Diff line number Diff line change
1
+ using BlockArrays: Block, blocklength
2
+ using BlockSparseArrays: blockrange, eachblockaxis
3
+ using Test: @test , @testset
4
+
5
+ @testset " blockrange" begin
6
+ r = blockrange (AbstractUnitRange{Int}[Base. OneTo (3 ), 1 : 4 ])
7
+ @test eachblockaxis (r) == [Base. OneTo (3 ), 1 : 4 ]
8
+ @test eachblockaxis (r)[1 ] === Base. OneTo (3 )
9
+ @test eachblockaxis (r)[2 ] === 1 : 4
10
+ @test r[Block (1 )] == 1 : 3
11
+ @test r[Block (2 )] == 4 : 7
12
+ @test first (r) == 1
13
+ @test last (r) == 7
14
+ @test blocklength (r) == 2
15
+ @test r == 1 : 7
16
+ end
You can’t perform that action at this time.
0 commit comments