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

How to we set/remove a value to is suppose to be set to 0.0 #15

Open
sergecpelletier opened this issue Feb 3, 2020 · 3 comments
Open

Comments

@sergecpelletier
Copy link

When assigning a value to a CSR (might be others too, but I know that one), how do we set the value back to 0.0?

From https://github.com/james-bowman/sparse/blob/master/blas/matrix.go#L39, we can see that the value of 0.0 will not be set.

@james-bowman
Copy link
Owner

Thanks, good point. I have added a fix that sets the non-zero element to zero. It should be noted that this doesn't update the sparsity pattern and actually stores the zero value. We could remove the element if the value is zero but that would mean regenerating the indices which would have a definite performance overhead.

@jonreiter
Copy link
Contributor

Coincidentally I am looking at something quite similar. I've pushed an approach built around Culling the blas.SparseMatrix object to my fork here.

I've tried to keep this separate from, but composable with, the sparse Cholesky stuff.

@james-bowman
Copy link
Owner

Apologies for the delay Jon, that is a nice way to clean up and remove the zero values do you want to create a PR and I will merge?

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

3 participants