Program f01hafe
! F01HAF Example Program Text
! Mark 30.0 Release. NAG Copyright 2024.
! .. Use Statements ..
Use nag_library, Only: f01haf, nag_wp, x04daf
! .. Implicit None Statement ..
Implicit None
! .. Parameters ..
Integer, Parameter :: nin = 5, nout = 6
! .. Local Scalars ..
Complex (Kind=nag_wp) :: t
Integer :: i, ifail, lda, ldb, m, n
! .. Local Arrays ..
Complex (Kind=nag_wp), Allocatable :: a(:,:), b(:,:)
! .. Executable Statements ..
Write (nout,*) 'F01HAF Example Program Results'
Write (nout,*)
Flush (nout)
! Skip heading in data file
Read (nin,*)
Read (nin,*) n, m, t
lda = n
ldb = n
Allocate (a(lda,n))
Allocate (b(ldb,m))
! Read A from data file
Read (nin,*)(a(i,1:n),i=1,n)
! Read B from data file
Read (nin,*)(b(i,1:m),i=1,n)
! Find exp(tA)B
ifail = 0
Call f01haf(n,m,a,lda,b,ldb,t,ifail)
If (ifail==0) Then
! Print solution
ifail = 0
Call x04daf('G','N',n,m,b,ldb,'exp(tA)B',ifail)
End If
End Program f01hafe