Program x04defe ! X04DEF Example Program Text ! Mark 24 Release. NAG Copyright 2012. ! .. Use Statements .. Use nag_library, Only: nag_wp, x04def ! .. Implicit None Statement .. Implicit None ! .. Parameters .. Integer, Parameter :: nmax = 5, nout = 6 Integer, Parameter :: lda = nmax ! .. Local Scalars .. Real (Kind=nag_wp) :: aa Integer :: i, ifail, j ! .. Local Arrays .. Complex (Kind=nag_wp) :: a(lda,nmax) ! .. Intrinsic Procedures .. Intrinsic :: cmplx, real ! .. Executable Statements .. Write (nout,*) 'X04DEF Example Program Results' Write (nout,*) Flush (nout) ! Generate an array of data Do j = 1, nmax Do i = 1, lda aa = real(10*i+j,kind=nag_wp) a(i,j) = cmplx(aa,-aa,kind=nag_wp) End Do End Do ! Print nmax by nmax band matrix with 1 sub-diagonal and 1 super-diagonal ifail = 0 Call x04def(nmax,nmax,1,1,a,lda,'Band Matrix:',ifail) End Program x04defe