Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mtfishman opened this issue Dec 14, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@mtfishman
Copy link
Member

mtfishman commented Dec 14, 2024

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
@mtfishman mtfishman added the enhancement New feature or request label Dec 14, 2024
@mtfishman mtfishman changed the title [ENHANCEMENT] Define an issparse trait function and associated trait [ENHANCEMENT] Define an SparseArraysBase.issparse trait function and associated trait Dec 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant