cleanup: first batch of named-constant normalization in LAPACK sources#1226
Open
nakatamaho wants to merge 2 commits intoReference-LAPACK:masterfrom
Open
cleanup: first batch of named-constant normalization in LAPACK sources#1226nakatamaho wants to merge 2 commits intoReference-LAPACK:masterfrom
nakatamaho wants to merge 2 commits intoReference-LAPACK:masterfrom
Conversation
Replace the literal `1.0` in the `SQRT(1 - NU**2)` path of
{c,d,s,z}bbcsd with the existing typed constant `ONE` for
consistency with the surrounding code.
This keeps the real and complex variants aligned and avoids
mixing a literal constant with the routine's named parameters.
No intended functional change.
langou
reviewed
Apr 10, 2026
SRC/cbbcsd.f
Outdated
| PARAMETER ( HUNDRED = 100.0E0, MEIGHTH = -0.125E0, | ||
| $ ONE = 1.0E0, TEN = 10.0E0, ZERO = 0.0E0 ) | ||
| $ ONE = 1.0E0, TEN = 10.0E0, TWO = 2.0E0, | ||
| $ ZERO = 0.0E0 ) |
Contributor
There was a problem hiding this comment.
Did you mean to commit this change? (So declaring TWO and defining TWO as a parameter = 2.0e0?)
I do not think you meant this.
Contributor
Author
There was a problem hiding this comment.
You're right — this change was unnecessary. It came from an MPLAPACK-side change where
PIOVER2 was replaced with pi(zero) / two:
- const REAL piover2 = 1.5707963267948966192313216916397514421;
+ const REAL two = 2.0;
+ const REAL piover2 = pi(zero) / two;So introducing TWO here did not serve any real purpose. I'll fix it.
Contributor
Author
There was a problem hiding this comment.
Fixed, please check my newer commit, thank you very much.
langou
reviewed
Apr 10, 2026
| ELSE | ||
| NU = SIGMA21 | ||
| MU = SQRT( 1.0 - NU**2 ) | ||
| MU = SQRT( ONE - NU**2 ) |
Contributor
There was a problem hiding this comment.
This change is all good with me.
Contributor
Author
There was a problem hiding this comment.
thank you very much!
Drop the unused TWO parameter from the BBCSD routines and reorder the remaining named constants for consistency between the type declaration and PARAMETER statement. No functional change intended.
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.
Summary
This PR collects a small first batch of no-functional-change cleanup
in LAPACK sources by normalizing scalar constant spelling.
In particular, it replaces typed literal
1values with the existingroutine-local named constant
ONEin the{s,d,c,z}bbcsdfamily.Rationale
These routines already define named scalar parameters such as
ZERO,ONE, andTEN. Using those names consistently improves readability,keeps the precision variants aligned, and avoids mixing routine-local
named constants with ad hoc typed literals.
Scope
This PR is intentionally limited to mechanical consistency changes:
Non-goals
This PR does not:
Notes
This is intended as a small cleanup-first PR rather than a broad
refactor. If this direction is acceptable, similar purely mechanical
normalizations can be submitted in follow-up PRs.