NAG Library Manual, Mark 29
Interfaces:  FL   CL   CPP   AD 

NAG FL Interface Introduction
Example description
    Program f08jffe

!     F08JFF Example Program Text

!     Mark 29.0 Release. NAG Copyright 2023.

!     .. Use Statements ..
      Use nag_library, Only: dsterf, nag_wp
!     .. Implicit None Statement ..
      Implicit None
!     .. Parameters ..
      Integer, Parameter               :: nin = 5, nout = 6
!     .. Local Scalars ..
      Integer                          :: info, n
!     .. Local Arrays ..
      Real (Kind=nag_wp), Allocatable  :: d(:), e(:)
!     .. Executable Statements ..
      Write (nout,*) 'F08JFF Example Program Results'
!     Skip heading in data file
      Read (nin,*)
      Read (nin,*) n

      Allocate (d(n),e(n-1))

!     Read T from data file

      Read (nin,*) d(1:n)
      Read (nin,*) e(1:n-1)

!     Calculate the eigenvalues of T
!     The NAG name equivalent of dsterf is f08jff
      Call dsterf(n,d,e,info)

      Write (nout,*)
      If (info>0) Then
        Write (nout,*) 'Failure to converge.'
      Else
        Write (nout,*) 'Eigenvalues'
        Write (nout,99999) d(1:n)
      End If

99999 Format (3X,(9F8.4))
    End Program f08jffe