Commit 412ce699 authored by Luca's avatar Luca
Browse files

test convergence in flat notation

parent 210fe796
......@@ -46,6 +46,20 @@ CONTAINS
GPL_zero_zi = 1.0d0/factorial(l) * log(y) ** l
END FUNCTION GPL_zero_zi
FUNCTION is_convergent(z,y)
! returns true if G(z,y) convergent, otherwise false
complex(kind=prec) :: z(:), y
logical :: is_convergent
integer :: i
is_convergent = .true.
do i = 1,size(z)
if(abs(z(i)) < zero) cycle ! skip zero values
if(abs(y) > abs(z(i))) is_convergent = .false.
end do
END FUNCTION is_convergent
RECURSIVE FUNCTION G_flat(z_flat,y) result(res)
! Calls G function with flat arguments, that is, zeroes not passed through the m's.
complex(kind=prec) :: z_flat(:), y, res
......@@ -87,7 +101,6 @@ CONTAINS
allocate(z(condensed_size))
m = m_prime(1:condensed_size)
z = get_condensed_z(m,z_flat)
res = G_condensed(m,z,y,size(m))
deallocate(m)
deallocate(z)
......
......@@ -76,19 +76,16 @@ CONTAINS
complex(kind=prec), parameter :: epsilon = 1E-14
print*, 'doing GPL tests...'
! ref = dcmplx(0.0819393734128676)
! call test_one_GPL((/ 1,1 /),cmplx((/ 1.3d0, 1.1d0 /)),cmplx(0.4),2,ref,'2.1')
ref = dcmplx(0.0819393734128676)
call test_one_GPL((/ 1,1 /),cmplx((/ 1.3d0, 1.1d0 /)),cmplx(0.4),2,ref,'2.1')
! ref = dcmplx(0.01592795952537145)
! call test_one_GPL((/ 3,2 /),cmplx((/ 1.3d0, 1.1d0 /)),cmplx(0.4),2,ref,'2.2')
! ref = dcmplx(0.0020332632172573974)
! call test_one_GPL((/ 4 /),cmplx((/ 0 /)),cmplx(1.6),1,ref,'2.3')
ref = dcmplx(0.01592795952537145)
call test_one_GPL((/ 3,2 /),cmplx((/ 1.3d0, 1.1d0 /)),cmplx(0.4),2,ref,'2.2')
ref = dcmplx(0.0020332632172573974)
ref = G_flat(cmplx((/1.7,0.0,0.0/)),cmplx(1.1))
! call test_one_GPL((/1,1,1/),cmplx((/ 0.0,1.7,0.0 /)),cmplx(1.1),3,ref,'2.4')
call test_one_GPL((/ 4 /),cmplx((/ 0 /)),cmplx(1.6),1,ref,'2.3')
! call test_one_GPL((/1,1,1/),cmplx((/ 0.0,1.7,0.0 /)),cmplx(1.1),3,ref,'2.4')
end subroutine do_GPL_tests
END PROGRAM TEST
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment