Skip to content

Commit 0e798ff

Browse files
committed
Merge branch 'norms' of github.com:perazz/stdlib into norms
2 parents 9e020a8 + 1a79128 commit 0e798ff

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

example/linalg/example_get_norm.f90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ program example_get_norm
33
use stdlib_linalg, only: get_norm, linalg_state_type
44
implicit none
55

6-
real :: a(3,3),nrm,nrmd(3)
6+
real :: a(3,3), nrm, nrmd(3)
77
integer :: j
88
type(linalg_state_type) :: err
99

@@ -44,7 +44,7 @@ program example_get_norm
4444
print *, 'minval(||a(:,i)||) = ',nrmd ! 1.00000000 0.00000000 3.00000000
4545

4646
! Catch Error:
47-
! [norm] returned Value Error: dimension 4 is out of rank for shape(a)= [3 3]
47+
! [norm] returned Value Error: dimension 4 is out of rank for shape(a)= [3, 3]
4848
call get_norm(a, nrmd, 'inf', dim=4, err=err)
4949
print *, 'invalid: ',err%print()
5050

example/linalg/example_norm.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ program example_norm
3333
print *, 'minval(||a(:,i)||) = ',norm(a, '-inf', dim=1) ! 1.00000000 0.00000000 3.00000000
3434

3535
! Catch Error:
36-
! [norm] returned Value Error: dimension 4 is out of rank for shape(a)= [3 3]
36+
! [norm] returned Value Error: dimension 4 is out of rank for shape(a)= [3, 3]
3737
print *, 'invalid: ',norm(a,'inf', dim=4, err=err)
3838
print *, 'error = ',err%print()
3939

src/stdlib_linalg_norms.fypp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ submodule(stdlib_linalg) stdlib_linalg_norms
5353
norm_type = NORM_ONE
5454
case (2_ilp)
5555
norm_type = NORM_TWO
56-
case (3_ilp:huge(0_ilp)-1_ilp)
56+
case (3_ilp:NORM_POW_LAST)
5757
norm_type = order
58-
case (huge(0_ilp):)
58+
case (NORM_INF:)
5959
norm_type = NORM_INF
60-
case (:-huge(0_ilp))
60+
case (:NORM_MINUSINF)
6161
norm_type = NORM_MINUSINF
6262

6363
case default
@@ -209,7 +209,7 @@ submodule(stdlib_linalg) stdlib_linalg_norms
209209
#:endif
210210
case(NORM_INF)
211211
nrm = maxval( abs(a) )
212-
case(-NORM_INF)
212+
case(NORM_MINUSINF)
213213
nrm = minval( abs(a) )
214214
case (NORM_POW_FIRST:NORM_POW_LAST)
215215
rorder = 1.0_${rk}$ / norm_request
@@ -317,7 +317,7 @@ submodule(stdlib_linalg) stdlib_linalg_norms
317317
#:endif
318318
case(NORM_INF)
319319
nrm = maxval( abs(a) , dim = dim )
320-
case(-NORM_INF)
320+
case(NORM_MINUSINF)
321321
nrm = minval( abs(a) , dim = dim )
322322
case (NORM_POW_FIRST:NORM_POW_LAST)
323323
rorder = 1.0_${rk}$ / norm_request

0 commit comments

Comments
 (0)