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

Similar SparseMatrixCOO #39

Closed
MaxenceGollier opened this issue Apr 24, 2024 · 3 comments
Closed

Similar SparseMatrixCOO #39

MaxenceGollier opened this issue Apr 24, 2024 · 3 comments

Comments

@MaxenceGollier
Copy link
Contributor

There is a problem when trying to allocate memory for a similar SparseMatrixCOO type.
For any matrix,

A = SparseMatrixCOO(matrix)
B = similar(A)

and typeof(B) returns Matrix type. I guess this is due to the fact that SparseMatrixCOO <: Matrix and that similar( A :: SparseMatrixCOO) is not implemented ? I can add a PR with this method if this makes sense.

@dpo
Copy link
Member

dpo commented Apr 24, 2024

A PR would make sense.

@dpo
Copy link
Member

dpo commented Apr 24, 2024

Implemented in #40.

@MaxenceGollier
Copy link
Contributor Author

MaxenceGollier commented Jul 1, 2024

With #40, when calling

B = similar(A)

on a matrix A of type SparseMatrixCOO, we don't copy the sparsity pattern of A into B (this obviously leads to errors and is not what SparseArrays.jl does for example).
I solved this issue in a new PR #46.

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

No branches or pull requests

2 participants