We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4c38a99 commit fd5b611Copy full SHA for fd5b611
test/test_blockarraysext.jl
@@ -5,6 +5,7 @@ using Test: @test, @testset
5
6
@testset "NamedDimsArraysBlockArraysExt" begin
7
elt = Float64
8
+
9
a = BlockSparseArray{elt}([2, 3], [2, 3])
10
a[Block(2, 1)] = randn(elt, 3, 2)
11
a[Block(1, 2)] = randn(elt, 2, 3)
@@ -18,4 +19,16 @@ using Test: @test, @testset
18
19
@test dename(n[i[Block.(1:2)], j[Block(1)]]) == a[Block.(1:2), Block(1)]
20
@test dename(n[Block.(1:2), Block(1)]) == a[Block.(1:2), Block(1)]
21
@test dename(n[Block.(1:2), Block.(1:2)]) == a[Block.(1:2), Block.(1:2)]
22
23
+ a = BlockSparseArray{elt}([2, 3], [2, 3])
24
+ a[Block(2, 1)] = randn(elt, 3, 2)
25
+ a[Block(1, 2)] = randn(elt, 2, 3)
26
+ b = BlockSparseArray{elt}([2, 3], [2, 3])
27
+ b[Block(2, 1)] = randn(elt, 3, 2)
28
+ b[Block(1, 2)] = randn(elt, 2, 3)
29
+ na = nameddimsarray(a, ("i", "j"))
30
+ nb = nameddimsarray(b, ("j", "i"))
31
+ nc = na .+ 2 .* nb
32
+ c = a + 2 * permutedims(b, (2, 1))
33
+ @test dename(nc, ("i", "j")) ≈ c
34
end
0 commit comments