Skip to content

SRC: use LSAME for NORM checks in condition routines#1242

Merged
langou merged 2 commits into
Reference-LAPACK:masterfrom
nakatamaho:cleanup/con-lsame-norm
May 11, 2026
Merged

SRC: use LSAME for NORM checks in condition routines#1242
langou merged 2 commits into
Reference-LAPACK:masterfrom
nakatamaho:cleanup/con-lsame-norm

Conversation

@nakatamaho
Copy link
Copy Markdown
Contributor

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:

  ONENRM = NORM.EQ.'1' .OR. LSAME( NORM, 'O' )

This PR makes the handling consistent by replacing the direct character
comparison with LSAME:

  ONENRM = LSAME( NORM, '1' ) .OR. LSAME( NORM, 'O' )

This is a cleanup-only change. It does not change the accepted NORM options
or the numerical behavior of the routines.

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.
@toxtran
Copy link
Copy Markdown

toxtran commented Apr 19, 2026

Any reason to do so? LSAME is used for case-insensitize checks which is not necessary for digits.

@langou
Copy link
Copy Markdown
Contributor

langou commented May 11, 2026

Any reason to do so? LSAME is used for case-insensitive 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!

langou
langou previously approved these changes May 11, 2026
@nakatamaho nakatamaho dismissed langou’s stale review May 11, 2026 10:44

The merge-base changed after approval.

@langou langou closed this May 11, 2026
@langou langou reopened this May 11, 2026
@langou langou merged commit 5da5348 into Reference-LAPACK:master May 11, 2026
22 of 23 checks passed
@nakatamaho
Copy link
Copy Markdown
Contributor Author

nakatamaho commented May 11, 2026 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants