test_utils Program

Uses

  • program~~test_utils~~UsesGraph program~test_utils test_utils module~cholesky cholesky program~test_utils->module~cholesky module~data_arch data_arch program~test_utils->module~data_arch module~cholesky->module~data_arch iso_fortran_env iso_fortran_env module~data_arch->iso_fortran_env

Calls

program~~test_utils~~CallsGraph program~test_utils test_utils proc~choldc choldc program~test_utils->proc~choldc proc~cholsl cholsl program~test_utils->proc~cholsl

Variables

Type Attributes Name Initial
real(kind=R8), dimension(tai, tai) :: a
real(kind=R8), dimension(tai, tai) :: aa
real(kind=R8), dimension(tai) :: b
integer(kind=I4) :: i
integer(kind=I4) :: info
real(kind=R8), dimension(tai) :: p
integer(kind=I4), parameter :: tai = 100
real(kind=R8), dimension(tai) :: x

Source Code

program test_utils
use data_arch, only : I4, R8
use cholesky,  only : choldc, cholsl
implicit none
integer(kind = I4), parameter :: tai = 100
real(kind=R8), dimension(tai, tai) :: a, aa
real(kind=R8), dimension(tai)      :: b, x, p
integer(kind = I4) :: i, info

   call random_number(a(1:tai,1:tai))
   call random_number(b(1:tai))

   a = matmul(a, transpose(a))

   forall(i = 1:tai) a(i, i) = 100*abs(a(i, i))

   aa(1:tai, 1:tai) = a(1:tai, 1:tai)

   call choldc( a    = a(1:tai,1:tai), &  !
                n    = tai,            &  !
                np   = tai,            &  !
                p    = p(1:tai),       &  !
                info = info )             !

   call cholsl( a    = a(1:tai,1:tai), &  !
                n    = tai,            &  !
                np   = tai,            &  !
                p    = p(1:tai),       &  !
                b    = b(1:tai),       &  !
                x    = x(1:tai),       &  !
                info = info )             !

   write(*,*) sum( abs(matmul(aa, x)-b) ), info

stop
endprogram test_utils