@@ -30,7 +30,7 @@ $(SIGNATURES)
3030
3131Create empty ExtendableSparseMatrix.
3232"""
33- function ExtendableSparseMatrix {Tv,Ti} (m:: Integer , n:: Integer ) where {Tv,Ti<: Integer }
33+ function ExtendableSparseMatrix {Tv,Ti} (m, n) where {Tv,Ti<: Integer }
3434 ExtendableSparseMatrix {Tv,Ti} (spzeros (Tv,Ti,m,n),nothing ,time ())
3535end
3636
@@ -39,7 +39,7 @@ $(SIGNATURES)
3939
4040Create empty ExtendableSparseMatrix.
4141"""
42- function ExtendableSparseMatrix (valuetype:: Type{Tv} ,indextype:: Type{Ti} ,m:: Integer , n:: Integer ) where {Tv,Ti<: Integer }
42+ function ExtendableSparseMatrix (valuetype:: Type{Tv} ,indextype:: Type{Ti} ,m, n) where {Tv,Ti<: Integer }
4343 ExtendableSparseMatrix {Tv,Ti} (m,n)
4444end
4545
@@ -49,7 +49,7 @@ $(SIGNATURES)
4949Create empty ExtendablSparseMatrix.
5050This is a pendant to spzeros.
5151"""
52- ExtendableSparseMatrix (valuetype:: Type{Tv} ,m:: Integer , n:: Integer ) where {Tv}= ExtendableSparseMatrix {Tv,Int} (m,n)
52+ ExtendableSparseMatrix (valuetype:: Type{Tv} ,m, n) where {Tv}= ExtendableSparseMatrix {Tv,Int} (m,n)
5353
5454
5555"""
@@ -58,7 +58,7 @@ $(SIGNATURES)
5858Create empty ExtendableSparseMatrix.
5959This is a pendant to spzeros.
6060"""
61- ExtendableSparseMatrix (m:: Integer , n:: Integer )= ExtendableSparseMatrix {Float64,Int} (m,n)
61+ ExtendableSparseMatrix (m, n)= ExtendableSparseMatrix {Float64,Int} (m,n)
6262
6363
6464"""
@@ -99,7 +99,7 @@ updateindex!(A,+,0.1,1,2)
9999A
100100```
101101"""
102- function updateindex! (ext:: ExtendableSparseMatrix{Tv,Ti} , op,v, i,j) where {Tv,Ti<: Integer }
102+ function updateindex! (ext:: ExtendableSparseMatrix{Tv,Ti} , op,v, i,j) where {Tv,Ti<: Integer }
103103 k= findindex (ext. cscmatrix,i,j)
104104 if k> 0
105105 ext. cscmatrix. nzval[k]= op (ext. cscmatrix. nzval[k],v)
@@ -120,7 +120,7 @@ Find index in CSC matrix and set value if it exists. Otherwise,
120120set index in extension.
121121"""
122122
123- function Base. setindex! (ext:: ExtendableSparseMatrix{Tv,Ti} , v, i,j) where {Tv,Ti<: Integer }
123+ function Base. setindex! (ext:: ExtendableSparseMatrix{Tv,Ti} , v, i,j) where {Tv,Ti}
124124 k= findindex (ext. cscmatrix,i,j)
125125 if k> 0
126126 ext. cscmatrix. nzval[k]= v
@@ -140,7 +140,7 @@ $(SIGNATURES)
140140Find index in CSC matrix and return value, if it exists.
141141Otherwise, return value from extension.
142142"""
143- function Base. getindex (ext:: ExtendableSparseMatrix{Tv,Ti} ,i:: Integer , j:: Integer ) where {Tv,Ti<: Integer }
143+ function Base. getindex (ext:: ExtendableSparseMatrix{Tv,Ti} ,i, j) where {Tv,Ti<: Integer }
144144 k= findindex (ext. cscmatrix,i,j)
145145 if k> 0
146146 return ext. cscmatrix. nzval[k]
@@ -185,7 +185,7 @@ $(SIGNATURES)
185185If there are new entries in extension, create new CSC matrix by adding the
186186cscmatrix and linked list matrix and reset the linked list based extension.
187187"""
188- function flush! (ext:: ExtendableSparseMatrix{Tv,Ti} ) where {Tv, Ti <: Integer }
188+ function flush! (ext:: ExtendableSparseMatrix )
189189 if ext. lnkmatrix!= nothing && nnz (ext. lnkmatrix)> 0
190190 ext. cscmatrix= ext. lnkmatrix+ ext. cscmatrix
191191 ext. lnkmatrix= nothing
@@ -261,35 +261,25 @@ function LinearAlgebra.lu(ext::ExtendableSparseMatrix)
261261 return LinearAlgebra. lu (ext. cscmatrix)
262262end
263263
264- """
265- $(SIGNATURES)
266-
267- [`flush!`](@ref) and multiply with ext.cscmatrix
268- """
269- function LinearAlgebra. mul! (r:: AbstractArray{T,1} where T, ext:: ExtendableSparse.ExtendableSparseMatrix , x:: AbstractArray{T,1} where T)
270- @inbounds flush! (ext)
271- return LinearAlgebra. mul! (r,ext. cscmatrix,x)
272- end
273-
274264
275265
276266"""
277267$(SIGNATURES)
278268
279269[`\\ `](@ref) for extmatrix
280270"""
281- function LinearAlgebra.:\ (ext:: ExtendableSparseMatrix ,X :: Union{AbstractArray{T,1}, AbstractArray{T,2} } where T)
271+ function LinearAlgebra.:\ (ext:: ExtendableSparseMatrix ,B :: AbstractVecOrMat{T } where T)
282272 flush! (ext)
283- ext. cscmatrix\ X
273+ ext. cscmatrix\ B
284274end
285275
286276
287277"""
288278$(SIGNATURES)
289279
290- [`\\ `](@ref) for Symmetric{ExtenableSparse }
280+ [`\\ `](@ref) for Symmetric{ExtendableSparse }
291281"""
292- function LinearAlgebra.:\ (symm_ext:: Symmetric{Tm, ExtendableSparseMatrix{Tm, Ti}} , B:: Union{AbstractArray{T,1}, AbstractArray{T,2} } where T) where {Tm,Ti}
282+ function LinearAlgebra.:\ (symm_ext:: Symmetric{Tm, ExtendableSparseMatrix{Tm, Ti}} , B:: AbstractVecOrMat{T } where T) where {Tm,Ti}
293283 flush! (symm_ext. data)
294284 symm_csc= Symmetric (symm_ext. data. cscmatrix,Symbol (symm_ext. uplo))
295285 symm_csc\ B
@@ -299,23 +289,21 @@ end
299289"""
300290$(SIGNATURES)
301291
302- [`\\ `](@ref) for Hermitian{ExtenableSparse }
292+ [`\\ `](@ref) for Hermitian{ExtendableSparse }
303293"""
304- function LinearAlgebra.:\ (symm_ext:: Hermitian{Tm, ExtendableSparseMatrix{Tm, Ti}} , B:: Union{AbstractArray{T,1}, AbstractArray{T,2} } where T) where {Tm,Ti}
294+ function LinearAlgebra.:\ (symm_ext:: Hermitian{Tm, ExtendableSparseMatrix{Tm, Ti}} , B:: AbstractVecOrMat{T } where T) where {Tm,Ti}
305295 flush! (symm_ext. data)
306296 symm_csc= Hermitian (symm_ext. data. cscmatrix,Symbol (symm_ext. uplo))
307297 symm_csc\ B
308298end
309299
310300
311-
312-
313301"""
314302$(SIGNATURES)
315303
316304[`flush!`](@ref) and ldiv with ext.cscmatrix
317305"""
318- function LinearAlgebra. ldiv! (r:: AbstractArray{T,1} where T, ext:: ExtendableSparse.ExtendableSparseMatrix , x:: AbstractArray{T,1} where T )
306+ function LinearAlgebra. ldiv! (r, ext:: ExtendableSparse.ExtendableSparseMatrix , x)
319307 @inbounds flush! (ext)
320308 return LinearAlgebra. ldiv! (r,ext. cscmatrix,x)
321309end
@@ -325,24 +313,12 @@ $(SIGNATURES)
325313
326314[`flush!`](@ref) and multiply with ext.cscmatrix
327315"""
328- function LinearAlgebra. mul! (r:: AbstractArray{T,2} where T, ext:: ExtendableSparse.ExtendableSparseMatrix , x:: AbstractArray{T,2} where T )
316+ function LinearAlgebra. mul! (r, ext:: ExtendableSparse.ExtendableSparseMatrix , x)
329317 @inbounds flush! (ext)
330318 return LinearAlgebra. mul! (r,ext. cscmatrix,x)
331319end
332320
333321
334- """
335- $(SIGNATURES)
336-
337- [`flush!`](@ref) and ldiv with ext.cscmatrix
338- """
339- function LinearAlgebra. ldiv! (r:: AbstractArray{T,2} where T, ext:: ExtendableSparse.ExtendableSparseMatrix , x:: AbstractArray{T,2} where T)
340- @inbounds flush! (ext)
341- return LinearAlgebra. ldiv! (r,ext. cscmatrix,x)
342- end
343-
344-
345-
346322"""
347323$(SIGNATURES)
348324
@@ -380,7 +356,7 @@ $(SIGNATURES)
380356
381357Add SparseMatrixCSC matrix and [`ExtendableSparseMatrix`](@ref) ext.
382358"""
383- function Base.:+ (ext:: ExtendableSparseMatrix{Tv,Ti} , csc:: SparseMatrixCSC{Tv,Ti} ) where {Tv,Ti <: Integer }
359+ function Base.:+ (ext:: ExtendableSparseMatrix , csc:: SparseMatrixCSC )
384360 @inbounds flush! (ext)
385361 return ext. cscmatrix+ csc
386362end
@@ -390,7 +366,7 @@ $(SIGNATURES)
390366
391367Subtract SparseMatrixCSC matrix from [`ExtendableSparseMatrix`](@ref) ext.
392368"""
393- function Base.:- (ext:: ExtendableSparseMatrix{Tv,Ti} , csc:: SparseMatrixCSC{Tv,Ti} ) where {Tv,Ti <: Integer }
369+ function Base.:- (ext:: ExtendableSparseMatrix , csc:: SparseMatrixCSC )
394370 @inbounds flush! (ext)
395371 return ext. cscmatrix- csc
396372end
@@ -400,7 +376,7 @@ $(SIGNATURES)
400376
401377Subtract [`ExtendableSparseMatrix`](@ref) ext from SparseMatrixCSC.
402378"""
403- function Base.:- (csc:: SparseMatrixCSC{Tv,Ti} , ext:: ExtendableSparseMatrix{Tv,Ti} ) where {Tv,Ti <: Integer }
379+ function Base.:- (csc:: SparseMatrixCSC , ext:: ExtendableSparseMatrix )
404380 @inbounds flush! (ext)
405381 return csc - ext. cscmatrix
406382end
0 commit comments