2d tie contact working.

This commit is contained in:
Jukka Aho
2015-11-24 03:06:56 +02:00
parent b7af1ebcaa
commit fe55cb0faa
19 changed files with 1531 additions and 199 deletions
+15
View File
@@ -36,6 +36,21 @@ function Base.append!(A::SparseMatrixIJV, I::Vector{Int}, J::Vector{Int}, V::Vec
append!(A.V, V)
end
function Base.isempty(A::SparseMatrixIJV)
return isempty(A.I) && isempty(A.J) && isempty(A.V)
end
function Base.(:+)(A::SparseMatrixIJV, B::SparseMatrixIJV)
if isempty(A)
return B
end
if isempty(B)
return A
end
C = SparseMatrixIJV([A.I;B.I], [A.J;B.J], [A.V;B.V])
return C
end
function Base.full(A::SparseMatrixIJV, args...)
return full(sparse(A.I, A.J, A.V, args...))
end