-
Notifications
You must be signed in to change notification settings - Fork 106
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
Reducing memory allocation #16
Comments
Yes, |
This should certainly be the case for |
You could certainly write a fallback |
My recent refactoring of the API to perform mutating updates on an initial guess was motivated substantially by this concern. That patch, while large, didn't begin to touch the internal temporaries. But at least the way is clearer now. I suspect we're not far from the day where |
Orthogonalization doesn't copy anymore, so we can close this issue. See |
I completed a first browsing through the code of this package. I would like to comment that, if speed/efficiency is going to be high on the focus list, excessive memory allocation should be avoided. One example is the orthogonalize routine, which will be the backbone of many solvers and will be called many times:
I strongly believe the
v=-cs[i]*e
line should call Base.LinAlg.BLAS.axpy!This will of course modify v in place, such that
orthogonalize
should becomeorthogonalize!
, which I think is fine. I would be happy to change this if everybody agrees.On a side note, even though ModifiedGramSchmidt is numerically equivalent to some form of HouseHolder orthogonalization on matrix stacked with zeros on top of it (which is useful to get good error bounds and get better insights in how to modify existing algorithms), this doesn't imply that it is equivalent to HouseHolder applied to the original matrix, nor that things like a second reorthogonalization round in MGS is useless. (Although I certainly agree that MGS is sufficient for many algorithms which only use small Krylov subspaces).
The text was updated successfully, but these errors were encountered: