Program x04cffe

!     X04CFF Example Program Text

!     Mark 25 Release. NAG Copyright 2014.

!     .. Use Statements ..
      Use nag_library, Only: nag_wp, x04cff
!     .. Implicit None Statement ..
      Implicit None
!     .. Parameters ..
      Integer, Parameter               :: nmax = 5, nout = 6
      Integer, Parameter               :: lda = nmax
      Character (7), Parameter         :: clabs(nmax) = (/                     &
                                          'Un     ','Deux   ',                 &
                                          'Trois  ','Quatre ','Cinq   ' /)
      Character (7), Parameter         :: rlabs(nmax) = (/                     &
                                          'Uno    ','Due    ',                 &
                                          'Tre    ','Quattro','Cinque ' /)
!     .. Local Scalars ..
      Integer                          :: i, ifail, indent, j, ncols
!     .. Local Arrays ..
      Real (Kind=nag_wp)               :: a(lda,lda)
!     .. Intrinsic Procedures ..
      Intrinsic                        :: real
!     .. Executable Statements ..
      Write (nout,*) 'X04CFF Example Program Results'

      Write (nout,*)
      Flush (nout)

!     Generate an array of data

      Do j = 1, nmax

        Do i = 1, lda
          a(i,j) = real(10*i+j,kind=nag_wp)
        End Do

      End Do

      ncols = 80
      indent = 0

!     Print nmax by nmax band matrix with 1 sub-diagonal, 1 super-diagonal,
!     default format and integer row and column labels

      ifail = 0
      Call x04cff(nmax,nmax,1,1,a,lda,' ','Example 1:','Integer',rlabs, &
        'Integer',clabs,ncols,indent,ifail)

      Write (nout,*)
      Flush (nout)

!     Print nmax by nmax band matrix with 1 sub-diagonal, 2 super-diagonals,
!     user-supplied format and row and column labels

      ifail = 0
      Call x04cff(nmax,nmax,1,2,a,lda,'F8.2','Example 2:','Character',rlabs, &
        'Character',clabs,ncols,indent,ifail)

      Write (nout,*)
      Flush (nout)

!     Print nmax by nmax band matrix with 1 sub-diagonal, 2 super-diagonals,
!     in MATLAB format
!     Row and column labelling is ignored

      ifail = 0
      Call x04cff(nmax,nmax,1,2,a,lda,'MATLABF8.2','A',' ',rlabs,' ',clabs, &
        ncols,indent,ifail)

    End Program x04cffe