Skip to content

Commit

Permalink
Merge branch 'main' into jishnub/sparseCSCview
Browse files Browse the repository at this point in the history
  • Loading branch information
jishnub authored Oct 14, 2023
2 parents 38befed + bb86364 commit 7559e31
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/sparsematrix.jl
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Creates an empty sparse matrix with element type `Tv` and integer type `Ti` of s
SparseMatrixCSC{Tv,Ti}(::UndefInitializer, m::Integer, n::Integer) where {Tv, Ti} = spzeros(Tv, Ti, m, n)

"""
`FixedSparseCSC{Tv,Ti<:Integer} <: AbstractSparseMatrixCSC{Tv,Ti}`
FixedSparseCSC{Tv,Ti<:Integer} <: AbstractSparseMatrixCSC{Tv,Ti}
Experimental AbstractSparseMatrixCSC whose non-zero index are fixed.
"""
Expand Down Expand Up @@ -94,21 +94,21 @@ FixedSparseCSC{Tv,Ti}(x::AbstractSparseMatrixCSC) where {Tv,Ti} =
getcolptr(x), rowvals(x), nonzeros(x))

"""
`fixed(x...)`
fixed(x...)
Experimental. Like `sparse` but returns a sparse array whose `_is_fixed` is `true`.
"""
fixed(x...) = move_fixed(sparse(x...))
fixed(x::AbstractSparseMatrixCSC) = FixedSparseCSC(x)

"""
`move_fixed(x::AbstractSparseMatrixCSC)`
move_fixed(x::AbstractSparseMatrixCSC)
Experimental, unsafe. Make a `FixedSparseCSC` by reusing the colptr, rowvals and nonzeros of `x`.
"""
move_fixed(x::AbstractSparseMatrixCSC) = FixedSparseCSC(size(x)..., getcolptr(x), rowvals(x), nonzeros(x))
"""
`_unsafe_unfix(x)`
_unsafe_unfix(x)
Experimental, unsafe. Returns a modifiable version of `x` for compatibility with this codebase.
"""
Expand All @@ -118,7 +118,7 @@ _unsafe_unfix(x::SparseMatrixCSC) = x
const SorF = Union{<:SparseMatrixCSC, <:FixedSparseCSC}

"""
`SparseMatrixCSC(x::FixedSparseCSC)`
SparseMatrixCSC(x::FixedSparseCSC)
Get a writable copy of x. See `_unsafe_unfix(x)`
"""
Expand Down
2 changes: 1 addition & 1 deletion src/sparsevector.jl
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ SparseVector(n::Integer, nzind::Vector{Ti}, nzval::Vector{Tv}) where {Tv,Ti} =
SparseVector{Tv, Ti}(::UndefInitializer, n::Integer) where {Tv, Ti} = SparseVector{Tv, Ti}(n, Ti[], Tv[])

"""
`FixedSparseVector{Tv,Ti<:Integer} <: AbstractCompressedVector{Tv,Ti}`
FixedSparseVector{Tv,Ti<:Integer} <: AbstractCompressedVector{Tv,Ti}
Experimental AbstractCompressedVector whose non-zero index are fixed.
"""
Expand Down

0 comments on commit 7559e31

Please sign in to comment.