program check implicit none save c..tests the gift generated routine integer n,nplus parameter (n = 10, nplus = n + 1) integer i,j double precision ab(n,nplus),ab2(n,nplus),resid(n) c..set the matrix ab(1,1) = 1.0d0 ab(1,2) = 2.0d0 do j=2,n-1 do i=j-1,j+1 ab(j,i) = i + j enddo enddo ab(n,n-1) = 2.0d0 ab(n,n) = 4.0d0 c..set the right hand size do i=1,n ab(i,nplus) = 1.0d0 enddo c..save a copy do j=1,nplus do i=1,n ab2(i,j) = ab(i,j) enddo enddo ! get the solution call gift_test(ab,n,nplus) c..write out the solution write(6,10) (ab(i,nplus), i=1,n) 10 format(1x,1p10e12.4) c..residuals of the solution do j=1,n resid(j) = 0.0d0 do i=1,n resid(j) = resid(j) + ab2(j,i) * ab(i,nplus) enddo resid(j) = resid(j) - ab2(j,nplus) enddo write(6,10) (resid(i), i=1,n) end include 'gift_test.f'