Skip to content

Commit 535d78c

Browse files
committed
add test of issues
1 parent d7911bc commit 535d78c

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

test/test_issues.jl

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
using BlockArrays
2+
using BlockSparseArrays
3+
using BlockSparseArrays: blocksparse
4+
using MatrixAlgebraKit
5+
using LinearAlgebra: LinearAlgebra
6+
using Test: @test, @testset
7+
8+
@testset "Issue 162" begin
9+
ax = (blockedrange([2, 2]), blockedrange([2, 2, 2]))
10+
bs = Dict(Block(1, 1) => randn(2, 2), Block(2, 3) => randn(2, 2))
11+
a = blocksparse(bs, ax)
12+
U, S, Vᴴ = svd_compact(a)
13+
14+
@test U * S * Vᴴ a
15+
@test U' * U LinearAlgebra.I
16+
@test Vᴴ * Vᴴ' LinearAlgebra.I
17+
18+
U, S, Vᴴ = svd_full(a);
19+
20+
@test U * S * Vᴴ a
21+
@test U' * U LinearAlgebra.I
22+
@test U * U' LinearAlgebra.I
23+
@test Vᴴ * Vᴴ' LinearAlgebra.I
24+
@test Vᴴ' * Vᴴ LinearAlgebra.I
25+
end
26+

0 commit comments

Comments
 (0)