Program e01aafe
! E01AAF Example Program Text
! Mark 27.3 Release. NAG Copyright 2021.
! .. Use Statements ..
Use nag_library, Only: e01aaf, nag_wp
! .. Implicit None Statement ..
Implicit None
! .. Parameters ..
Integer, Parameter :: nin = 5, nout = 6
! .. Local Scalars ..
Real (Kind=nag_wp) :: x
Integer :: i, j, k, n, n1, n2
! .. Local Arrays ..
Real (Kind=nag_wp), Allocatable :: a(:), b(:), c(:)
! .. Executable Statements ..
Write (nout,*) 'E01AAF Example Program Results'
! Skip heading in data file
Read (nin,*)
Read (nin,*) n, x
n1 = n + 1
n2 = n*(n+1)/2
Allocate (a(n1),b(n1),c(n2))
Read (nin,*)(a(i),i=1,n1)
Read (nin,*)(b(i),i=1,n1)
Call e01aaf(a,b,c,n1,n2,n,x)
Write (nout,*)
Write (nout,*) 'Interpolated values'
k = 1
Do i = 1, n - 1
Write (nout,99999)(c(j),j=k,k+n-i)
k = k + n - i + 1
End Do
Write (nout,*)
Write (nout,99998) 'Interpolation point = ', x
Write (nout,*)
Write (nout,99998) 'Function value at interpolation point = ', c(n2)
99999 Format (1X,6F12.5)
99998 Format (1X,A,F12.5)
End Program e01aafe