Skip to content

Commit

Permalink
nits to snf for nonstandard AbstractArrays (e.g., StaticArrays, bu…
Browse files Browse the repository at this point in the history
…t still doesn't work for nonsquare StaticMatrices)
  • Loading branch information
thchr committed Oct 18, 2024
1 parent 528e958 commit 7909d95
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions .vendor/SmithNormalForm/src/snf.jl
Original file line number Diff line number Diff line change
Expand Up @@ -135,15 +135,14 @@ function init(M::AbstractSparseMatrix{R,Ti}; inverse=true) where {R, Ti}
U = sparse(R, Ti, I, rows, rows)
Uinv = inverse ? copy(U) : spzeros(R, Ti, 0, 0)


V = sparse(R, Ti, I, cols, cols)
Vinv = inverse ? copy(V) : spzeros(R, Ti, 0, 0)

return U, V, D, Uinv, Vinv
end

function init(M::AbstractMatrix{R}; inverse=true) where {R}
D = copy(M)
D = Matrix{R}(copy(M))
rows, cols = size(M)

U = Matrix{R}(I, rows, rows)
Expand Down

0 comments on commit 7909d95

Please sign in to comment.