Skip to content

Document which operations are required for a SparseArray eltype #308

Description

@LilithHafner

getindex on structural zeros uses zero(T).
setindex!, dropzeros!, and == use iszero(T).

It would be nice to know which operations are required for full functionality for SparseArrays, and what subset of that functionality is available if some or all of those operations are missing. For example, do I need to define zero or iszero on my custom type T to support sparse matrix multiplication wth eltype T?

Activity

  1. ViralBShah commented on Dec 1, 2022

    @ViralBShah
    Member

    This has mostly evolved over time. So it would be great to document what we need.

  2. ViralBShah commented on Sep 20, 2026

    @ViralBShah
    Member

    Related but not the same: #538

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions