-
Notifications
You must be signed in to change notification settings - Fork 4
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
Why is the SparseMatrixCOO mutable? #44
Comments
It’s useful to keep it mutable because in optimization, a Hessian or Jacobian often retains the same sparsity pattern; only the nonzero values change from one iteration to the next. That is what happens in NLPModels.jl. |
But than one can still change the |
Well, yes, I suppose you're right. Do you need the struct to be immutable for a special reason? Or just for uniformity with SparseMatrixCSC? |
Yes, for sure because of uniformity. But also because immutable structs would be also faster AFAIK. |
Sounds good. Would you like to submit a PR? |
Yes, why not. When I will have some free time I will do it. |
Done in #54. |
Hello,
looking at the code I noticed that the
SparseMatrixCOO
constructor is mutable, while theSparseMatrixCSC
one is not.I think that it can be safely converted into immutable. Am I wrong?
The text was updated successfully, but these errors were encountered: