From cebe2dbaab5ba99e28ad91556d13fb00120fffdc Mon Sep 17 00:00:00 2001 From: Luca Date: Tue, 14 May 2019 10:34:41 +0200 Subject: [PATCH] minor --- gpl_module.f90 | 7 ------- {random => other_stuff}/shuffle_algebra.f90 | 7 +++++-- shuffle.f90 | 20 ++++++++++---------- test.f90 | 4 ++-- utils.f90 | 3 ++- 5 files changed, 19 insertions(+), 22 deletions(-) rename {random => other_stuff}/shuffle_algebra.f90 (92%) diff --git a/gpl_module.f90 b/gpl_module.f90 index f959bae..4f5d0cc 100644 --- a/gpl_module.f90 +++ b/gpl_module.f90 @@ -7,12 +7,6 @@ MODULE gpl_module CONTAINS - RECURSIVE FUNCTION factorial(n) result(res) - integer, intent(in) :: n - integer :: res - res = merge(1,n*factorial(n-1),n==0) - END FUNCTION factorial - FUNCTION zeta(n) real(kind=prec) :: values(9), zeta integer :: n @@ -58,7 +52,6 @@ CONTAINS 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) diff --git a/random/shuffle_algebra.f90 b/other_stuff/shuffle_algebra.f90 similarity index 92% rename from random/shuffle_algebra.f90 rename to other_stuff/shuffle_algebra.f90 index 42962a0..1b2190f 100644 --- a/random/shuffle_algebra.f90 +++ b/other_stuff/shuffle_algebra.f90 @@ -1,6 +1,9 @@ -! This is currently a stand alone program which will merely be used as a -! guide for the implementation of the shuffle algebra for GPL functions +! An implementation of the shuffle algebra +! in accordance with 1904.07279v1, polylogs for the masses, p.7-8 + +! This implementation defines words as strings of characters and shuffles them +! into sums of words. PROGRAM shuffle_algebra implicit none diff --git a/shuffle.f90 b/shuffle.f90 index ca61c9f..4aebce9 100644 --- a/shuffle.f90 +++ b/shuffle.f90 @@ -60,18 +60,18 @@ CONTAINS END MODULE shuffle -PROGRAM test - use utils - use shuffle - implicit none +! PROGRAM test +! use utils +! use shuffle +! implicit none - complex(kind=prec) :: v1(3), v2(2) - integer :: amount_shuffles +! complex(kind=prec) :: v1(3), v2(2) +! integer :: amount_shuffles - v1 = cmplx((/1,2,3/)) - v2 = cmplx((/4,5/)) +! v1 = cmplx((/1,2,3/)) +! v2 = cmplx((/4,5/)) - call print_matrix(shuffle_product(v1,v2)) +! call print_matrix(shuffle_product(v1,v2)) -END PROGRAM test +! END PROGRAM test diff --git a/test.f90 b/test.f90 index e9515ed..7d80108 100644 --- a/test.f90 +++ b/test.f90 @@ -102,8 +102,8 @@ CONTAINS end subroutine do_GPL_tests subroutine do_shuffle_tests() - integer :: v(3) = (/1,2,3/) - integer :: w(2) = (/-1,-2/) + complex(kind=prec) :: v(3) = cmplx((/1,2/)) + complex(kind=prec) :: w(2) = cmplx((/3,4/)) call print_matrix(shuffle_product(v,w)) end subroutine do_shuffle_tests diff --git a/utils.f90 b/utils.f90 index 96eb8c6..1e02818 100644 --- a/utils.f90 +++ b/utils.f90 @@ -87,7 +87,7 @@ CONTAINS complex(kind=prec) :: res(n) res = 0 END FUNCTION zero_array - + RECURSIVE FUNCTION factorial(n) result(res) integer, intent(in) :: n integer :: res @@ -137,6 +137,7 @@ END MODULE utils ! PROGRAM test +! use globals ! use utils ! implicit none -- GitLab