Triu and tril on Matrix

The current codes are

# dense.jl
triu(M::Matrix, k::Integer) = triu!(copy(M), k)
tril(M::Matrix, k::Integer) = tril!(copy(M), k)

# generic.jl
triu(M::AbstractMatrix,k::Integer) = triu!(copy(M),k)
tril(M::AbstractMatrix,k::Integer) = tril!(copy(M),k)

Is there a reason for the dense codes to exist?

Quite possibly not.

1 Like