Program x04dcfe

!     X04DCF Example Program Text

!     Mark 25 Release. NAG Copyright 2014.

!     .. Use Statements ..
      Use nag_library, Only: nag_wp, x04dcf
!     .. Implicit None Statement ..
      Implicit None
!     .. Parameters ..
      Integer, Parameter               :: nmax = 4, nout = 6
      Integer, Parameter               :: la = (nmax*(nmax+1))/2
!     .. Local Scalars ..
      Real (Kind=nag_wp)               :: aa
      Integer                          :: i, ifail
!     .. Local Arrays ..
      Complex (Kind=nag_wp)            :: a(la)
!     .. Intrinsic Procedures ..
      Intrinsic                        :: cmplx, real
!     .. Executable Statements ..
      Write (nout,*) 'X04DCF Example Program Results'

      Write (nout,*)
      Flush (nout)

!     Generate an array of data

      Do i = 1, la
        aa = real(i,kind=nag_wp)
        a(i) = cmplx(aa,-aa,kind=nag_wp)
      End Do

!     Print order (nmax-1) lower triangular matrix

      ifail = 0
      Call x04dcf('Lower','Unit',nmax-1,a,'Example 1:',ifail)

      Write (nout,*)
      Flush (nout)

!     Print order nmax upper triangular matrix

      ifail = 0
      Call x04dcf('Upper','Non-unit',nmax,a,'Example 2:',ifail)

    End Program x04dcfe