Skip to content

Commit

Permalink
Update src/Matrix.jl
Browse files Browse the repository at this point in the history
Co-authored-by: Max Horn <[email protected]>
  • Loading branch information
lgoettgens and fingolfin authored Feb 19, 2024
1 parent 7c4c5b8 commit de7a624
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Matrix.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6789,6 +6789,11 @@ function Base.hvcat(rows::Tuple{Vararg{Int}}, A::MatrixElem{T}...) where T <: NC
return M
end

#to bypass the vec(collect(M)) which copies twice
function Base.vec(M::Generic.Mat)
return vec(M.entries)
end

function Base.vec(M::MatElem)
r = elem_type(base_ring(M))[]
sizehint!(r, nrows(M) * ncols(M))
Expand Down

0 comments on commit de7a624

Please sign in to comment.