SRC: use LSAME for NORM checks in condition routines#1242
Conversation
Replace direct UPLO character comparisons in the LATSP and LATSY test helpers with LSAME. This keeps option handling consistent with the LAPACK convention for case-insensitive checks.
Replace direct NORM character comparisons for the one-norm option with LSAME in the condition estimation routines. This keeps the '1' checks consistent with the existing LSAME handling for the equivalent 'O' option.
|
Any reason to do so? LSAME is used for case-insensitize checks which is not necessary for digits. |
One reason is that it could be considered good software engineering to isolate the comparison in a specific routine (i.e. 'LSAME') "just in case". For example, this could be convenient for automatic Fortran-to-C tools, etc. This would be akin to a library having its own "print", its own "malloc/free", its own etc., that way you can replace these with machine-specific / compiler-specific versions as needed. So adding an 'LSAME' here could be a good idea. I do not find this argument very strong. I am trying to answer the question! |
The merge-base changed after approval.
|
I just didn’t know that Fortran does so. I thought that we have to use lsame for every string comparison. iPhoneから送信2026/04/19 16:06、toxtran ***@***.***>のメール:toxtran left a comment (Reference-LAPACK/lapack#1242)
Any reason to do so? LSAME is used for case-insensitize checks which is not necessary for digits.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
This PR updates the condition estimation routines to use LSAME for checking
the one-norm NORM option.
The affected routines already use LSAME to accept the equivalent 'O' option:
This PR makes the handling consistent by replacing the direct character
comparison with LSAME:
This is a cleanup-only change. It does not change the accepted NORM options
or the numerical behavior of the routines.