Skip to content

[ENHANCEMENT] Define an SparseArraysBase.issparse trait function and associated trait #7

@mtfishman

Description

@mtfishman

Define an SparseArraysBase.issparse trait function with an associated type trait SparseArraysBase.IsSparse, in the style of SimpleTraits.jl.

We could use SparseArraysBase.issparse(a) = interface(a) isa AbstractSparseArrayInterface as a default definition.

Possibly we can overload/repurpose Base.issparse for this but I don't know how general that is meant to be, for example:

julia> using SparseArrays: issparse

julia> using LinearAlgebra: Diagonal

julia> issparse(Diagonal(randn(4)))
false

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions