quinngroup / ornet

Organellar segmentation, tracking, and network modeling.
MIT License
3 stars 4 forks source link

Replace numpy linalg with scipy linalg #15

Open magsol opened 4 years ago

magsol commented 4 years ago

NumPy's linear algebra library is subpar. SciPy's uses LAPACK which is well-verified and excellent.

It works the same way. Just import scipy.linalg instead.

https://github.com/quinngroup/ornet/blob/eigenspectrum/src/analysis/util.py#L51

magsol commented 4 years ago

Also, use the eigh function instead of the generic eig, because you are indeed using a Hermitian/symmetric matrix. As a result--and as you can see from the documentation--the eigenvalues and eigenvectors will already be ordered for you.

https://docs.scipy.org/doc/scipy/reference/generated/scipy.linalg.eigh.html#scipy.linalg.eigh

magsol commented 4 years ago

Don't even need sort_eigens anymore.