-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Add wrapper for ?geqrfp #11169
Comments
When variable declaration has the option
Calling the same routine twice (one with lwork=-1) is a decades old trick. The main reason is that a variable, The user could call with
It is probably the absolute minimum value allowed. |
Thanks @ilayn that's really helpful. I've noticed that for the other Also, it looks like there is no |
That would be indeed nice. Often you can look at which arguments are passed to the lwork computation in the routine (ilaenv) and make them visible. For modern personal computers most of the times it shouldn't make any difference but better safe than sorry. |
Finally, I'm curious - I played with |
That is the reason we wrap WORK as a scalar when we wrap TL;DR the value you see is often the intermediate value used for computing something except when |
I suppose I would have expected the documentation to say something like: |
@mdhaber FYI I've pushed the A few (minor) points:
|
Minimum is defined in LAPACK docs. There are architectures that don't do blocked operations hence mininmum should be followed. |
See NumFOCUS Small Development Grant Proposal 2019 Round 3 proposal for background.
Add wrapper for ?geqrfp.
Existing wrapper for ?geqrf provides some guidance.
Suggested signature:
We will also want to create a routine to compute the optimal
lwork
value:I'm a bit confused about how
overwrite_a
works - is that optional argument added automatically by F2PY? It is an optional argument for?geqrf
but there's no "code" for it in the wrapper.Update: See @ilayn's response below.
If the user provides
lwork=-1
, it seems that?geqrfp
is supposed to determine the optimallwork
rather than actually solving the problem. I suppose the idea is that if you don't know what to choose forlwork
, you call?geqrfp
once withlwork=-1
just to get the optimal value oflwork
, then call it again with that value oflwork
to actually solve the problem. Is that right? Should the wrapper go through that process if nolwork
is provided by the user? The wrapper for?geqrf
doesn't use this approach, it seems; it just defaults to 3n. Where does 3n come from? In the NAG manual, it looks like 64*n is used.Update: See @ilayn's response below.
As for tests, the NAG manual provides an example for
?geqrf
, so these could be adapted for?geqrfp
. Alternatively, we could follow the approach used byscipy.linalg.qr
to convert the output into matricesQ
andR
and write tests based on those, e.g.A
Q
andR
using approach inscipy.linalg.qr
R
is upper triangular and has all non-negative diagonalQ
is orthogonalA
=Q @ R
etc.
Probably should do this for an example where regular QR gives negative entries on diagonal of
R
. We should also check for empty matrix and both tall and wide matrices as input.The text was updated successfully, but these errors were encountered: