Skip to content

Commit

Permalink
Add test for squeeze on sparse matrices.
Browse files Browse the repository at this point in the history
  • Loading branch information
martinholters committed Feb 26, 2016
1 parent 4563526 commit 7c54abd
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/sparsedir/sparse.jl
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,18 @@ a116[p, p] = reshape(1:9, 3, 3)
s116[p, p] = reshape(1:9, 3, 3)
@test a116 == s116

# squeeze
for i = 1:5
am = sprand(20, 1, 0.2)
av = squeeze(am, 2)
@test ndims(av) == 1
@test all(av.==am)
am = sprand(1, 20, 0.2)
av = squeeze(am, 1)
@test ndims(av) == 1
@test all(av.'.==am)
end

# matrix-vector multiplication (non-square)
for i = 1:5
a = sprand(10, 5, 0.5)
Expand Down

0 comments on commit 7c54abd

Please sign in to comment.