|
5 | 5 | @test Base.SparseArrays.indtype(sparse(ones(Int8,2),ones(Int8,2),rand(2))) == Int8
|
6 | 6 |
|
7 | 7 | # check sparse matrix construction
|
| 8 | +let sz = (3, 4) |
| 9 | + X = SparseMatrixCSC(sz) |
| 10 | + @test isa(X, SparseMatrixCSC{Float64,Int}) |
| 11 | + @test size(X) == sz |
| 12 | + X = SparseMatrixCSC(sz...) |
| 13 | + @test isa(X, SparseMatrixCSC{Float64,Int}) |
| 14 | + @test size(X) == sz |
| 15 | + X = SparseMatrixCSC{Int16}(sz) |
| 16 | + @test isa(X, SparseMatrixCSC{Int16,Int}) |
| 17 | + @test size(X) == sz |
| 18 | + X = SparseMatrixCSC{Int16}(sz...) |
| 19 | + @test isa(X, SparseMatrixCSC{Int16,Int}) |
| 20 | + @test size(X) == sz |
| 21 | + X = SparseMatrixCSC{Int16,Int8}(sz) |
| 22 | + @test isa(X, SparseMatrixCSC{Int16,Int8}) |
| 23 | + @test size(X) == sz |
| 24 | + X = SparseMatrixCSC{Int16,Int8}(sz...) |
| 25 | + @test isa(X, SparseMatrixCSC{Int16,Int8}) |
| 26 | + @test size(X) == sz |
| 27 | +end |
8 | 28 | @test isequal(Array(sparse(complex(ones(5,5),ones(5,5)))), complex(ones(5,5),ones(5,5)))
|
9 | 29 | @test_throws ArgumentError sparse([1,2,3], [1,2], [1,2,3], 3, 3)
|
10 | 30 | @test_throws ArgumentError sparse([1,2,3], [1,2,3], [1,2], 3, 3)
|
|
0 commit comments