Skip to content

Commit 0fdc387

Browse files
committed
same for lmdiff
1 parent ecb91cd commit 0fdc387

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

test/test_lmder.f90

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,9 @@ program test_lmder
9797
factor = ten*factor
9898

9999
! compare with previously generated solutions:
100-
if ( info_original(ic)<5 .and. & ! ignore any where the original minpack failed
101-
any(abs( solution(ic) - x)>tol .and. &
102-
abs((solution(ic) - x)/(solution(ic))) > solution_reltol)) then
100+
if (info_original(ic)<5 .and. & ! ignore any where the original minpack failed
101+
any(abs( solution(ic) - x)>tol .and. &
102+
abs((solution(ic) - x)/(solution(ic))) > solution_reltol)) then
103103
write(nwrite,'(A)') 'Failed case'
104104
write(nwrite, '(//5x, a//(5x, 5d15.7))') 'Expected x: ', solution(ic)
105105
write(nwrite, '(/5x, a//(5x, 5d15.7))') 'Computed x: ', x

test/test_lmdif.f90

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ program test_lmdif
2424
integer,dimension(ncases),parameter :: ms = [10,50,10,50,10,50,2,3,4,2,15,11,16,31,31,31,10,10,20,8,8,9,10,10,30,40,33,65]
2525
integer,dimension(ncases),parameter :: ntriess = [1,1,1,1,1,1,3,3,3,3,3,3,2,3,3,3,1,1,3,3,1,1,1,3,1,1,1,1]
2626

27+
integer,dimension(*),parameter :: info_original = [1,1,1,1,1,1,2,2,2,2,2,2,5,5,5,1,1,1,1,1,1,1,1,5,1,4,&
28+
1,1,1,1,2,2,2,2,2,2,1,5,1,5,1,1,1,1,2,1,1,2,1,2,2,1,1]
29+
!! original `info` from the original minpack
30+
2731
integer :: i, ic, info, k, m, n, NFEv, NJEv, NPRob, ntries, icase, lwa
2832
real(wp) :: factor, fnorm1, fnorm2
2933
integer :: ma(60), na(60), nf(60), nj(60), np(60), nx(60)
@@ -86,8 +90,9 @@ program test_lmdif
8690
factor = ten*factor
8791

8892
! compare with previously generated solutions:
89-
if (any(abs( solution(ic) - x)>tol .and. &
90-
abs((solution(ic) - x)/(solution(ic))) > solution_reltol)) then
93+
if (info_original(ic)<5 .and. & ! ignore any where the original minpack failed
94+
any(abs( solution(ic) - x)>tol .and. &
95+
abs((solution(ic) - x)/(solution(ic))) > solution_reltol)) then
9196
write(nwrite,'(A)') 'Failed case'
9297
write(nwrite, '(//5x, a//(5x, 5d15.7))') 'Expected x: ', solution(ic)
9398
write(nwrite, '(/5x, a//(5x, 5d15.7))') 'Computed x: ', x

0 commit comments

Comments
 (0)