Skip to content

feat: Autogenerate SPARSEMAT functions#2530

Closed
Copilot wants to merge 5 commits intomainfrom
copilot/autogenerate-sparsemat-functions
Closed

feat: Autogenerate SPARSEMAT functions#2530
Copilot wants to merge 5 commits intomainfrom
copilot/autogenerate-sparsemat-functions

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 24, 2026

Description

Implements SPARSEMAT conversion to enable Stimulus autogeneration of sparse matrix functions. Functions with callbacks (igraph_eigen_matrix, igraph_eigen_matrix_symmetric) intentionally excluded per issue requirements.

Changes

C Converter Implementation

  • Added Rz_SEXP_to_sparsemat() to convert R's dgCMatrix (column-compressed) to igraph's triplet format sparse matrix
  • Extracts i/p/x/Dim slots from S4 object, iterates columns to populate entries

Interface Generation

  • Removed IGNORE statements for igraph_sparse_adjacency, igraph_sparse_weighted_adjacency, igraph_weighted_sparsemat in tools/stimulus/functions-R.yaml
  • Regenerated R/aaa-auto.R and src/rinterface.c via Stimulus

New Autogenerated Functions

  1. sparse_adjacency_impl / sparse_weighted_adjacency_impl - graph from sparse adjacency matrix
  2. weighted_sparsemat_impl - graph from weighted sparse matrix with edge attributes
  3. get_laplacian_sparse_impl / get_adjacency_sparse_impl / get_stochastic_sparse_impl - sparse matrix extraction from graphs

Tests

  • Added coverage for all 5 functions in test-aaa-auto.R

  • By submitting this pull request, I assign the copyright of my contribution to The igraph development team.
Original prompt

This section details on the original issue you should resolve

<issue_title>Autogenerate all SPARSEMAT functions</issue_title>
<issue_description>Need to implement SPARSEMAT conversion. If the functions use a callback, ignore for now.</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 4 commits January 24, 2026 10:10
Co-authored-by: krlmlr <1741643+krlmlr@users.noreply.github.com>
Co-authored-by: krlmlr <1741643+krlmlr@users.noreply.github.com>
Co-authored-by: krlmlr <1741643+krlmlr@users.noreply.github.com>
Co-authored-by: krlmlr <1741643+krlmlr@users.noreply.github.com>
Copilot AI changed the title [WIP] Implement SPARSEMAT conversion functions feat: Autogenerate SPARSEMAT functions Jan 24, 2026
Copilot AI requested a review from krlmlr January 24, 2026 10:16
@krlmlr
Copy link
Copy Markdown
Contributor

krlmlr commented Jan 24, 2026

Closing in favor of #2532.

@krlmlr krlmlr closed this Jan 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Autogenerate all SPARSEMAT functions

2 participants