{"action":"created","issue":{"url":"https://api.github.com/repos/scipy/scipy/issues/6693","repository_url":"https://api.github.com/repos/scipy/scipy","labels_url":"https://api.github.com/repos/scipy/scipy/issues/6693/labels{/name}","comments_url":"https://api.github.com/repos/scipy/scipy/issues/6693/comments","events_url":"https://api.github.com/repos/scipy/scipy/issues/6693/events","html_url":"https://github.com/scipy/scipy/pull/6693","id":183465788,"number":6693,"title":"WIP: ENH: Integrating LAPACK \"expert\" routines with conditioning warnings for linalg.solve_ family","user":{"login":"ilayn","id":1303842,"avatar_url":"https://avatars.githubusercontent.com/u/1303842?v=3","gravatar_id":"","url":"https://api.github.com/users/ilayn","html_url":"https://github.com/ilayn","followers_url":"https://api.github.com/users/ilayn/followers","following_url":"https://api.github.com/users/ilayn/following{/other_user}","gists_url":"https://api.github.com/users/ilayn/gists{/gist_id}","starred_url":"https://api.github.com/users/ilayn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ilayn/subscriptions","organizations_url":"https://api.github.com/users/ilayn/orgs","repos_url":"https://api.github.com/users/ilayn/repos","events_url":"https://api.github.com/users/ilayn/events{/privacy}","received_events_url":"https://api.github.com/users/ilayn/received_events","type":"User","site_admin":false},"labels":[{"id":37340735,"url":"https://api.github.com/repos/scipy/scipy/labels/enhancement","name":"enhancement","color":"bfe5bf","default":true},{"id":37340991,"url":"https://api.github.com/repos/scipy/scipy/labels/scipy.linalg","name":"scipy.linalg","color":"207de5","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":19,"created_at":"2016-10-17T16:35:41Z","updated_at":"2016-11-04T21:30:54Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/scipy/scipy/pulls/6693","html_url":"https://github.com/scipy/scipy/pull/6693","diff_url":"https://github.com/scipy/scipy/pull/6693.diff","patch_url":"https://github.com/scipy/scipy/pull/6693.patch"},"body":"As briefly discussed in #6634, in this PR the ?GESVX routine of LAPACK is exposed for generic use. They are the so-called eXpert versions of the already existing ?GESV routine family which are used in `sp.linalg.solve` \n\nThe use case for these routines are many-fold \n- The most important case is to finally change the silent singular matrix handling. With the condition number and error estimates, a warning/error/msg can be emitted (needs-decision).\n- Ill-conditioned matrices can be checked before inversion steps and nonsensical results can be avoided\n- cond and rcond functions can now use estimates for comparison\n- the lu factorization comes with a bonus (as is with ?GESV too but the API throws it away currently)\n- The numerical accuracy is improved thanks to the balancing and iterative refinement (Lapack prefers the term `equilibration` for this particular instance). \n\nThe API requirements for such routine is a bit tedious to satisfy. One of the main reasons for that is the variety of options to choose from. To give an example, here is an example from LAPACK documentation: \n\n> ```\n>      EQUED is CHARACTER*1\n>       Specifies the form of equilibration that was done.\n>       = 'N':  No equilibration (always true if FACT = 'N').\n>       = 'R':  Row equilibration, i.e., A has been premultiplied by\n>               diag(R).\n>       = 'C':  Column equilibration, i.e., A has been postmultiplied\n>               by diag(C).\n>       = 'B':  Both row and column equilibration, i.e., A has been\n>               replaced by diag(R) * A * diag(C).\n>       EQUED is an input argument if FACT = 'F'; otherwise, it is an\n>       output argument.\n> ```\n\nor an even more joyful one is the following \n\n> ```\n>       AF is DOUBLE PRECISION array, dimension (LDAF,N)\n>       If FACT = 'F', then AF is an input argument and on entry\n>       contains the factors L and U from the factorization\n>       A = P*L*U as computed by DGETRF.  If EQUED .ne. 'N', then\n>       AF is the factored form of the equilibrated matrix A.\n> \n>      If FACT = 'N', then AF is an output argument and on exit\n>       returns the factors L and U from the factorization A = P*L*U\n>       of the original matrix A.\n> \n>      If FACT = 'E', then AF is an output argument and on exit\n>       returns the factors L and U from the factorization A = P*L*U\n>       of the equilibrated matrix A (see the description of A for\n>       the form of the equilibrated matrix).\n> ```\n\nThere will be a a few phases for this PR to come to fruition and I would really appreciate all the feedback from the wizards.\n- [x] Make sure the f2py interface is correct. \n- [x] Make sure that the input-output arguments are handled correctly.\n- [ ] Make sure that the varying number of I/O arguments are not exposed to the user and the decision tree should not lead to confusion. In other words, if out of inexperience a user selects two conflicting keyword arguments (as it is extremely easy to fall into those traps) the behavior should be unambiguous override or err out directly. \n- [ ] Make sure that the tests cover sufficient examples\n- [ ] Decide on the numerical bound formula to accept numerical singularity\n- [ ]  Decide on where this functionality goes into, existing `sp.linalg.solve` as an addition or a standalone solver and so on.\n"},"comment":{"url":"https://api.github.com/repos/scipy/scipy/issues/comments/258552635","html_url":"https://github.com/scipy/scipy/pull/6693#issuecomment-258552635","issue_url":"https://api.github.com/repos/scipy/scipy/issues/6693","id":258552635,"user":{"login":"ilayn","id":1303842,"avatar_url":"https://avatars.githubusercontent.com/u/1303842?v=3","gravatar_id":"","url":"https://api.github.com/users/ilayn","html_url":"https://github.com/ilayn","followers_url":"https://api.github.com/users/ilayn/followers","following_url":"https://api.github.com/users/ilayn/following{/other_user}","gists_url":"https://api.github.com/users/ilayn/gists{/gist_id}","starred_url":"https://api.github.com/users/ilayn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ilayn/subscriptions","organizations_url":"https://api.github.com/users/ilayn/orgs","repos_url":"https://api.github.com/users/ilayn/repos","events_url":"https://api.github.com/users/ilayn/events{/privacy}","received_events_url":"https://api.github.com/users/ilayn/received_events","type":"User","site_admin":false},"created_at":"2016-11-04T21:30:54Z","updated_at":"2016-11-04T21:30:54Z","body":"What I would like to consult you guys is whether this is somewhat along the correct direction. Otherwise we can just leave the f2py updates and people can write their own solvers using `get_lapack_funcs`. \r\n\r\nI'm also very interested in what NumPy guys are doing with ufuncs but I don't have any knowledge of those kind of manipulations. (frankly, getting f2py part working was crazy enough 😃) It looks so juicy though in terms of speed. "}}
{"actor":{"display_login":"ilayn"}}