Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace enorm with intrinsic norm2 #45

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/example_hybrd.f90
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
!> -x(8) + (3-2*x(9))*x(9) = -1
program example_hybrd

use minpack_module, only: hybrd, enorm, dpmpar
use minpack_module, only: hybrd, dpmpar
implicit none
integer j, n, maxfev, ml, mu, mode, nprint, info, nfev, ldfjac, lr, nwrite
double precision xtol, epsfcn, factor, fnorm
Expand Down Expand Up @@ -44,7 +44,7 @@ program example_hybrd
call hybrd(fcn, n, x, fvec, xtol, maxfev, ml, mu, epsfcn, diag, &
mode, factor, nprint, info, nfev, fjac, ldfjac, &
r, lr, qtf, wa1, wa2, wa3, wa4)
fnorm = enorm(n, fvec)
fnorm = norm2(fvec)
write (nwrite, 1000) fnorm, nfev, info, (x(j), j=1, n)

1000 format(5x, "FINAL L2 NORM OF THE RESIDUALS", d15.7// &
Expand Down
4 changes: 2 additions & 2 deletions examples/example_hybrd1.f90
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
!> -x(8) + (3-2*x(9))*x(9) = -1
program example_hybrd1

use minpack_module, only: hybrd1, dpmpar, enorm
use minpack_module, only: hybrd1, dpmpar
implicit none
integer j, n, info, lwa, nwrite
double precision tol, fnorm
Expand All @@ -30,7 +30,7 @@ program example_hybrd1
tol = dsqrt(dpmpar(1))

call hybrd1(fcn, n, x, fvec, tol, info, wa, lwa)
fnorm = enorm(n, fvec)
fnorm = norm2(fvec)
write (nwrite, 1000) fnorm, info, (x(j), j=1, n)

1000 format(5x, "FINAL L2 NORM OF THE RESIDUALS", d15.7// &
Expand Down
4 changes: 2 additions & 2 deletions examples/example_lmder1.f90
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ subroutine fcn(m, n, x, fvec, fjac, ldfjac, iflag)


program example_lmder1
use minpack_module, only: enorm, lmder1, chkder
use minpack_module, only: lmder1, chkder
use testmod_der1, only: dp, fcn
implicit none

Expand All @@ -65,7 +65,7 @@ program example_lmder1
allocate(wa(5*size(x) + size(fvec)))
call lmder1(fcn, size(fvec), size(x), x, fvec, fjac, size(fjac, 1), tol, &
info, ipvt, wa, size(wa))
print 1000, enorm(size(fvec), fvec), info, x
print 1000, norm2(fvec), info, x
1000 format(5x, 'FINAL L2 NORM OF THE RESIDUALS', d15.7 // &
5x, 'EXIT PARAMETER', 16x, i10 // &
5x, 'FINAL APPROXIMATE SOLUTION' // &
Expand Down
4 changes: 2 additions & 2 deletions examples/example_lmdif1.f90
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ subroutine fcn(m, n, x, fvec, iflag)


program example_lmdif1
use minpack_module, only: enorm, lmdif1
use minpack_module, only: lmdif1
use testmod_dif1, only: dp, fcn
implicit none

Expand All @@ -53,7 +53,7 @@ program example_lmdif1
n = size(x)
allocate(wa(m*n + 5*n + m))
call lmdif1(fcn, size(fvec), size(x), x, fvec, tol, info, iwa, wa, size(wa))
print 1000, enorm(size(fvec), fvec), info, x
print 1000, norm2(fvec), info, x
1000 format(5x, 'FINAL L2 NORM OF THE RESIDUALS', d15.7 // &
5x, 'EXIT PARAMETER', 16x, i10 // &
5x, 'FINAL APPROXIMATE SOLUTION' // &
Expand Down
Loading