Skip to content

add output format option to adjacency_matrix arguments #606

@CarloLucibello

Description

@CarloLucibello

We should add a keyword argument adjacency_matrix(g, fmt=...) allowing to choose among dense and sparse matrix formats:

  • :coo:
    • on cpu return a sparse matrix from SparseMatricesCOO.jl
      if the package is loaded (otherwise error out)
    • on cuda return a CUSPARSE. CuSparseMatrixCOO
    • on metal and amdgpu: ?
  • :csc
    • on cpu return SparseArrays. SparseMatrixCSC
    • on cuda return CUSPARSE. CuSparseMatrixCSC
  • :dense: return a dense array
  • :nothing: maintain the current behavior (which ideally should be to choose the most sensible output format based on the graph format).

Other options (e.g. :csr could be considered in the future).

cc @dferre97

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions