Skip to content

Commit

Permalink
test kron
Browse files Browse the repository at this point in the history
  • Loading branch information
johnczito committed Jul 23, 2019
1 parent c1eb233 commit b7c30fd
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
22 changes: 22 additions & 0 deletions test/kron.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using PDMats
using Test

n = 4
m = 7

for T in [Float64, Float32]
X = randn(T, n, n)
Y = randn(T, m, m)
A = X * X'
B = Y * Y'
AkB = kron(A, B)
PDA = PDMat(A)
PDB = PDMat(B)
PDAkB1 = PDMat(AkB)
PDAkB2 = kron(PDA, PDB)
@test PDAkB1.dim == PDAkB2.dim
@test PDAkB1.mat PDAkB2.mat
@test PDAkB1.chol.L PDAkB2.chol.L
@test PDAkB1.chol.U PDAkB2.chol.U
@test Matrix(PDAkB2.chol) PDAkB2.mat
end
2 changes: 1 addition & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
tests = ["pdmtypes", "addition", "generics"]
tests = ["pdmtypes", "addition", "generics", "kron"]
println("Running tests ...")

for t in tests
Expand Down

0 comments on commit b7c30fd

Please sign in to comment.