-
Notifications
You must be signed in to change notification settings - Fork 94
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
Reduce memory required for Fourier transform. #95
Conversation
@@ -171,7 +171,7 @@ def compute_fourier_basis(self, n_eigenvectors=None): | |||
|
|||
# TODO: handle non-symmetric Laplacians. Test lap_type? | |||
if n_eigenvectors == self.n_vertices: | |||
self._e, self._U = np.linalg.eigh(self.L.toarray()) | |||
self._e, self._U = linalg.eigh(self.L.toarray(order='F'), overwrite_a=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
order='F' as lapack is fortran ordered, and re-use space for eigenvectors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Does the Fortran order make the EVD faster?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should avoid the matrix being transposed from C order to F order when it is pushed out to lapack.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, thanks. At some point we should do a proper benchmark and find the best settings for the partial and full EVDs.
Rebased to fix CI. |
Thanks for the improvement! |
Fixes #94 .