# 1 "<stdin>"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "<stdin>"
! dot product test
program zyxabc
implicit none
real, allocatable, dimension (:) :: xtilda
real, allocatable, dimension (:) :: ytilda
real, allocatable, dimension (:) :: x
real, allocatable, dimension (:) :: y
real, allocatable, dimension (:) :: array
real, allocatable, dimension (:) :: ya
integer n1,n2

n1=101;n2=101

allocate (xtilda(2*n1),ytilda(2*n1),x(n1),y(n1),array(n1),ya(2*n1))
!
!
!
call Dottest00 (n1,xtilda,ytilda,x,y)
!
end program zyxabc
subroutine Dottest00(n1,xtilda,ytilda,x,y)
  use hesang
  use sep

!
integer n1,i1, iseed,n2,stat
real xscalar, yscalar 
real xtilda(n1),ytilda(n1),x(n1),y(n1),aa(n1)

!
x=0.;y=0.
!
! fill x and y with random numbers:
iseed=1993
call random_number(x)
call random_number(y) 
call random_number(aa) 
call hesang_init(n1,1,aa)

!################################################################
stat = hesang_lop( .false.,.false.,x, ytilda) 
stat = hesang_lop( .true.,.false., xtilda, y) 
! calculate the inner product:
xscalar=0.
yscalar=0.
write(0,*) sum(xtilda),sum(ytilda)
do i1=1,n1
  xscalar=xscalar+xtilda(i1)*x(i1)
  yscalar=yscalar+ytilda(i1)*y(i1)
end do
write(0,*) '############################################################'
write(0,*) 'x_hesang_lop=',xscalar,'        y_hesang_lop=',yscalar
write(0,*) '############################################################'

return
end
