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 99a3a7a commit 987e77bCopy full SHA for 987e77b
src/sparse_utils.jl
@@ -370,7 +370,7 @@ function sparse_matrix(f,I,J,V,m,n;reuse=Val(false),skip_out_of_bounds=true)
370
V2 = V
371
elseif m*n == 0
372
Ti = eltype(I)
373
- T = eltype(V)
+ Tv = eltype(V)
374
I2 = Ti[]
375
J2 = Ti[]
376
V2 = Tv[]
test/sparse_utils_tests.jl
@@ -54,6 +54,42 @@ function test_mat(T)
54
@test y ≈ A[rows,cols]*x
55
@test C*x ≈ A[rows,cols]*x
56
57
+ I = Ti[1,2,5,4,1]
58
+ J = Ti[3,6,1,1,3]
59
+ V = Tv[4,5,3,2,5]
60
+ m = 7
61
+ n = 6
62
+ A = sparse_matrix(I,J,V,m,n)
63
+ A,Acache = sparse_matrix(I,J,V,m,n;reuse=true)
64
+ sparse_matrix!(A,V,Acache)
65
+
66
+ I = Ti[-1]
67
+ J = Ti[-1]
68
+ V = Tv[-1]
69
70
71
72
73
74
75
76
77
78
+ m = 0
79
+ n = 0
80
81
82
83
84
+ I = Ti[]
85
+ J = Ti[]
86
+ V = Tv[]
87
88
89
90
91
92
93
end
94
95
test_mat(SparseMatrixCSC{Float64,Int})
0 commit comments