-
Notifications
You must be signed in to change notification settings - Fork 441
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
NaN check in LAPACKE_?lantr isn't correct for m != n #737
Comments
Hi, This is a good topic of conversation. I am not sure what a nonsquare triangular matrix is. If we think about a rectangular m-by-n matrix and we say it is triangular, I feel it is not obvious where the triangle is. Is it above or below the rectangle, left or right of the rectangle? I feel different people will give different answers. I think if we look at LQ, QL, RQ and QR, we will have all these shapes naturally appearing. I do not think we have nonsquare triangular matrices in LAPACK or in BLAS. I think triangular matrices are always square in LAPACK and BLAS. Although I think that I see what you mean with xLARFB. Yes the householder reflector vector matrix is m-by-n (m>=n) lower triangular unit. So to check NaN in it we need to check NaN in the strictly lower triangular and then the rectangle below (if it exists, case m>n+1). For now my preference would be to keep LAPACKE_ztr_nancheck as it is, and then to append a zge check. I can be convinced otherwise though. Happy to change my current opinion. Julien |
You're right, that the term triangular matrix always refers to a square matrix. I wasn't aware of that. The term I meant to use is trapezoidal matrix. This kind of matrix is also mentioned in the LAPACK documentation of some routines, e.g. We could also introduce a new NaN check for trapezoidal matrices (e.g. |
Hi @ACSimon33, Thanks for bringing up There is a difference between a norm computation and a NaN check. For the 1-norm computation, you cannot reduce the two output of I liked the A trapezoidal NaN check would be useful. Thanks for bringing this up. My preference is (second strategy) introduce a new That being said, (1) I am thankful that you are considering doing a PR with trapezoidal NaN check, (2), as you pointed, there is a precedent with Thanks! |
Description
The NaN check in
LAPACKE_?lantr
isn't checking the entire matrix for non-square matrices. The check is implemented like this:There are two solutions to this. Either we add another check for the part which isn't checked - that could look like this for example:
The cleaner solution in my opinion would be to change
LAPACKE_?tr_nancheck
to accept non-square matrices. That should be fairly simple by just adding a second size parameter and adjusting the loops. The NaN check inLAPACKE_zlarfb
would benefit from this as well since there we have the same problem (which is already addressed via the first strategy).The only downside of changing
LAPACKE_?tr_nancheck
is that there would be a lot of files that need fixes due to the interface change (64 files).I'd like to know which strategy you would prefer.
Checklist
The text was updated successfully, but these errors were encountered: