Skip to content

SparseArrays.SparseMatrixCSC fix#7

Open
Matthewphysics wants to merge 4 commits into
FuzzifiED:mainfrom
Matthewphysics:sparse-fix
Open

SparseArrays.SparseMatrixCSC fix#7
Matthewphysics wants to merge 4 commits into
FuzzifiED:mainfrom
Matthewphysics:sparse-fix

Conversation

@Matthewphysics

Copy link
Copy Markdown

I found a bug in the SparseArrays.SparseMatrixCSC wrapper that created the incorrect sparse matrix from the opmat because the opmat does not store the row indices within each column in ascending order, which is required by the SparseMatrixCSC constructor. I created a function that orders these indices then feeds this into the existing FuzzifiED SparseArrays.SparseMatrixCSC function.

Matthewphysics and others added 4 commits May 22, 2026 11:08
SparseArrays.jl SparseMatrixCSC constructor assumes that row indices are
sorted however FuzzifiED OpMat does not return sorted row indices,
leading to an incorrect sparse matrix construction.
replaced generating all row, column and value coordinates with sorting
the row indices in each column in place.
Refactored the canonicalize_csc! function to remove unnecessary line breaks and improve readability.
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.

1 participant