refactor: rename ABS1 statement function to CABS1 for consistency#1219
Merged
langou merged 1 commit intoReference-LAPACK:masterfrom Mar 28, 2026
Merged
Conversation
Several LAPACK, BLAS, and CBLAS source files defined a local statement
function named ABS1 for the complex 1-norm approximation:
ABS1( X ) = ABS( REAL( X ) ) + ABS( AIMAG( X ) )
ABS1( X ) = ABS( DBLE( X ) ) + ABS( DIMAG( X ) )
The majority of the codebase already uses CABS1 for this identical
purpose. This commit renames ABS1 to CABS1 in all remaining files
(definition line, declaration line, and all call sites within the
same file) to make the naming consistent across the repository.
A small number of fixed-form lines required continuation-line splits
to stay within the 72-column limit after the rename.
No numerical change. Statement functions are file-local in Fortran,
so there is no ABI or interface impact.
This is a preparatory cleanup before inlining these statement
functions (see issue Reference-LAPACK#1200).
nakatamaho
added a commit
to nakatamaho/mplapack
that referenced
this pull request
Mar 28, 2026
…k#1219, #1220) Upstream lapack#1219 renames the local ABS1 statement function to CABS1 in BLAS/LAPACK/CBLAS sources where it computes |Re(z)| + |Im(z)|. Upstream lapack#1220 further handles Clargv/Zlargv, whose local ABS1 helper actually computes max(|Re(z)|, |Im(z)|) and must not be renamed to CABS1; rename it to CABSMAX instead. Apply both to the MPLAPACK C++ codebase: - Add patch-cabs1_unification and patch-cabsmax to external/lapack/Makefile.am. - Update mplapack/reference/Clargv.cpp: add inline cabsmax(), replace the two cabs1() call sites with cabsmax(). - Regenerate fable/3.12.1/lapack/patch-Clargv.cpp: introduce cabsmax inline helper and drop the erroneous lvalue ABS1 statement removal. - Remove now-superfluous patches from fable/patch_lapack_3.12.1.sh: Cggev, Cggev3, Cggevx, Ctgevc, Clags2, Chgeqz were previously patched for ABS1->CABS1 and are subsumed by lapack#1219. - Remove from fable/patch_lapack_test_3.12.1.sh: Cdrges, Cdrges3, Cget52 for the same reason. - Simplify patch-Cdrgsx.cpp: the abs1->cabs1 hunks are no longer needed after lapack#1219. No numerical change. cf. Reference-LAPACK/lapack#1220 Reference-LAPACK/lapack#1219
langou
approved these changes
Mar 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1217
Summary
Several LAPACK, BLAS, and CBLAS source files defined a local statement function named
ABS1for the complex 1-norm approximation:The majority of the codebase already uses
CABS1for this identical purpose. This PR renamesABS1toCABS1in all remaining files — definition line, declaration line, and all call sites within the same file — to make the naming consistent across the repository.Details
A small number of fixed-form lines required continuation-line splits to stay within the 72-column limit after the rename.
No numerical change. Statement functions are file-local in Fortran, so there is no ABI or interface impact.
Motivation
This is a preparatory cleanup before inlining these statement functions, as discussed in #1200.