Closed Ali-Tehrani closed 3 years ago
This seems like a sensible strategy to me. The alternative would be to use scipy in both cases, with pinv2 and pinv. I would have a slight preference for that as the scipy error tolerance is more sensible/refined.
After attempting your suggestion, I realized I made a mistake. pinv from SciPy uses least-squares approach to computing Morse-Penrose inverse and pinv2 uses singular value decomposition. I changed the lapack_driver argument to use_svd, and if it is True, then use pinv2 else use pinv. The default value is False, because it is more robust choice.
This pull request is about adding the lapack driver option whenever singular value decomposition is used. See issue #78.
I added it to rotational, orthogonal, symmetric, permutation and generic. I also added tests to these. The doc string of "lapack_driver" for permutation and generic are different from the other modules.
For generic, I instead used NumPy's Morse Penrose inverse if "lapack_driver="gessd"" and SciPy's Morse Penrose inverse if "lapack_driver="gesvd"".