@@ -8,7 +8,7 @@ Matrix type for storing symmetric sparse matrices in the
88Compressed Sparse Row format with `Bi`-based indexing (typically 0 or 1).
99Only the upper triangle is stored (including the non zero diagonal entries),
1010which is represented by a `SparseMatrixCSR`.
11- The standard way of constructing a `SymSparseMatrixCSR` is through the
11+ The standard way of constructing a `SymSparseMatrixCSR` is through the
1212[`symsparsecsr`](@ref) function.
1313"""
1414struct SymSparseMatrixCSR{Bi,T,Ti<: Integer } <: AbstractSparseMatrix{T,Ti}
@@ -90,10 +90,10 @@ nnz(S::SymSparseMatrixCSR) = nnz(S.uppertrian)
9090"""
9191 nonzeros(S::SymSparseMatrixCSR)
9292
93- Return a vector (1-based) of the structural nonzero values in sparse array S.
93+ Return a vector (1-based) of the structural nonzero values in sparse array S.
9494This includes zeros that are explicitly stored in the sparse array,
9595which correspond to the nonzero entries in the upper triangle and diagonal.
96- The returned vector points directly to the internal nonzero storage of S,
96+ The returned vector points directly to the internal nonzero storage of S,
9797and any modifications to the returned vector will mutate S as well.
9898"""
9999nonzeros (S:: SymSparseMatrixCSR ) = nonzeros (S. uppertrian)
@@ -104,17 +104,17 @@ nonzeros(S::SymSparseMatrixCSR) = nonzeros(S.uppertrian)
104104Return a vector of the col indices of `S`. The stored values are indexes to arrays
105105with `Bi`-based indexing, but the `colvals(S)` array itself is a standard 1-based
106106Julia `Vector`.
107- Any modifications to the returned vector will mutate S as well.
108- Providing access to how the col indices are stored internally
109- can be useful in conjunction with iterating over structural
107+ Any modifications to the returned vector will mutate S as well.
108+ Providing access to how the col indices are stored internally
109+ can be useful in conjunction with iterating over structural
110110nonzero values. See also [`nonzeros`](@ref) and [`nzrange`](@ref).
111111"""
112112colvals (S:: SymSparseMatrixCSR ) = colvals (S. uppertrian)
113113
114114"""
115115 nzrange(S::SymSparseMatrixCSR, row::Integer)
116116
117- Return the range of indices to the structural nonzero values of a
117+ Return the range of indices to the structural nonzero values of a
118118sparse matrix row section being in the diagonal or upper triangle.
119119The returned range of indices is always 1-based even for `Bi != 1`.
120120"""
@@ -123,8 +123,8 @@ nzrange(S::SymSparseMatrixCSR, row::Integer) = nzrange(S.uppertrian, row)
123123"""
124124 findnz(S::SymSparseMatrixCSR)
125125
126- Return a tuple `(I, J, V)` where `I` and `J` are the row and column 1-based indices
127- of the stored ("structurally non-zero in diagonal + upper trianle") values in sparse matrix A,
126+ Return a tuple `(I, J, V)` where `I` and `J` are the row and column 1-based indices
127+ of the stored ("structurally non-zero in diagonal + upper trianle") values in sparse matrix A,
128128and V is a vector of the values. The returned vectors are newly allocated
129129and are unrelated to the internal storage of matrix `S`.
130130"""
@@ -134,12 +134,16 @@ findnz(S::SymSparseMatrixCSR) = findnz(S.uppertrian)
134134 count(pred, S::SymSparseMatrixCSR)
135135 count(S::SymSparseMatrixCSR)
136136
137- Count the number of elements in `nonzeros(S)` for which predicate `pred` returns `true`.
137+ Count the number of elements in `nonzeros(S)` for which predicate `pred` returns `true`.
138138If `pred` not given, it counts the number of `true` values.
139139"""
140140count (pred, S:: SymSparseMatrixCSR ) = count (pred, S. uppertrian)
141141count (S:: SymSparseMatrixCSR ) = count (i-> true , S)
142142
143+ function LinearAlgebra. fillstored! (a:: SymSparseMatrixCSR ,v)
144+ LinearAlgebra. fillstored! (a. uppertrian,v)
145+ end
146+
143147function mul! (y:: AbstractVector ,A:: SymSparseMatrixCSR ,v:: AbstractVector , α:: Number , β:: Number )
144148 A. uppertrian. n == size (v, 1 ) || throw (DimensionMismatch ())
145149 A. uppertrian. m == size (y, 1 ) || throw (DimensionMismatch ())
177181
178182function show (io:: IO , :: MIME"text/plain" , S:: SymSparseMatrixCSR )
179183 xnnz = nnz (S)
180- print (io, S. uppertrian. m, " ×" , S. uppertrian. n, " " ,
184+ print (io, S. uppertrian. m, " ×" , S. uppertrian. n, " " ,
181185 typeof (S), " with " , xnnz, " stored " ,
182186 xnnz == 1 ? " entry" : " entries" )
183187 if xnnz != 0
0 commit comments