Skip to content

Is the type parameter <: intentional? #306

Open
@jishnub

Description

@jishnub

function convert(::Type{BandedMatrix{<:, C}}, M::BandedMatrix) where C
M.data isa C && return M
_BandedMatrix(convert(C, M.data), M.raxis, M.l, M.u)
end

And

function convert(::Type{BandedMatrix{<:,C,OneTo{Int}}}, M::AbstractMatrix) where {C}
Container = typeof(convert(C, similar(M, 0, 0)))
T = eltype(Container)
copyto!(BandedMatrix{T, Container}(undef, size(M), bandwidths(M)), M)
end

Or is this supposed to be <:Any?

julia> B = BandedMatrix{<:,Matrix{<:},Base.OneTo{Int}}
BandedMatrix{<:, Matrix{<:}, Base.OneTo{Int64}}

julia> Base.isconcretetype(B)
true

julia> eltype(B)
<: (built-in function)

Is this for a banded matrix of the subtype function?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions