Skip to content

Commit 821111a

Browse files
committed
260212.173057.CET revise norma/fortran/linalg.f90 to include the change to the scaling in norm
1 parent 399df3a commit 821111a

File tree

4 files changed

+15
-5
lines changed

4 files changed

+15
-5
lines changed

.development

.github/actions/spelling/allow.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2546,3 +2546,10 @@ xcrun
25462546
dsrc
25472547
ncall
25482548
ccc
2549+
AMOP
2550+
ATf
2551+
emax
2552+
emin
2553+
scalmax
2554+
scalmin
2555+
sumx

fortran/common/linalg.f90

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ module linalg_mod
3939
!
4040
! Started: July 2020
4141
!
42-
! Last Modified: Thu 12 Feb 2026 04:02:55 PM CET
42+
! Last Modified: Thu 12 Feb 2026 05:30:33 PM CET
4343
!--------------------------------------------------------------------------------------------------!
4444

4545
implicit none
@@ -2032,6 +2032,8 @@ function named_norm_mat(x, nname) result(y)
20322032
! Calculation starts !
20332033
!====================!
20342034

2035+
! N.B.: Ideally, we should also do a scaling similar to that in P_NORM to avoid over/underflow.
2036+
20352037
if (size(x, 1) * size(x, 2) == 0) then
20362038
y = ZERO
20372039
elseif (.not. all(is_finite(x))) then

fortran/tests/tools/flsrc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,10 @@ if [[ -f "$LINALG" ]] ; then
2323
STR="Y is NaN if and only if X contains NaN"
2424
$SEDI "/$STR/d" "$LINALG"
2525

26-
# See https://github.com/llvm/llvm-project/issues/180957
27-
STR="Y >= 0 unless X contains NaN"
28-
$SEDI "/$STR/d" "$LINALG"
26+
# The following should have been fixed by commit 399df3ae055566c3f6133118ebab6fdcc16cebb5
27+
# # See https://github.com/llvm/llvm-project/issues/180957
28+
# STR="Y >= 0 unless X contains NaN"
29+
# $SEDI "/$STR/d" "$LINALG"
2930

3031
# # With flang 20.1.8, matprod in linalg.f90 often fails to compute matrix multiplications
3132
# # correctly, generating garbage values (NaN or numbers that are nearly zero). No idea why.

0 commit comments

Comments
 (0)