SparseVectorCOO

This commit is contained in:
Jukka Aho
2017-01-05 09:08:32 +02:00
parent f018fa564d
commit 858740cec7
4 changed files with 36 additions and 15 deletions
-12
View File
@@ -1,12 +0,0 @@
# This file is a part of JuliaFEM.
# License is MIT: see https://github.com/JuliaFEM/JuliaFEM.jl/blob/master/LICENSE.md
module InterfaceTests
using JuliaFEM.Testing
function test_foo()
@test 1+2 == 3
end
end
+19
View File
@@ -0,0 +1,19 @@
# This file is a part of JuliaFEM.
# License is MIT: see https://github.com/JuliaFEM/JuliaFEM.jl/blob/master/LICENSE.md
using JuliaFEM
using JuliaFEM.Testing
@testset "Add to SparseMatrixCOO" begin
A = SparseMatrixCOO()
A2 = reshape(collect(1:9), 3, 3)
add!(A, sparse(A2))
@test isapprox(full(A), full(A2))
end
@testset "Add to SparseVectorCOO" begin
b = SparseVectorCOO()
b2 = collect(1:3)
add!(b, sparse(b2))
@test isapprox(full(b), full(b2))
end