Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
H
handyG
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
McMule
handyG
Commits
412ce699
Commit
412ce699
authored
May 06, 2019
by
Luca
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test convergence in flat notation
parent
210fe796
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
10 deletions
+20
-10
gpl_module.f90
gpl_module.f90
+14
-1
test.f90
test.f90
+6
-9
No files found.
gpl_module.f90
View file @
412ce699
...
@@ -46,6 +46,20 @@ CONTAINS
...
@@ -46,6 +46,20 @@ CONTAINS
GPL_zero_zi
=
1.0d0
/
factorial
(
l
)
*
log
(
y
)
**
l
GPL_zero_zi
=
1.0d0
/
factorial
(
l
)
*
log
(
y
)
**
l
END
FUNCTION
GPL_zero_zi
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
)
RECURSIVE
FUNCTION
G_flat
(
z_flat
,
y
)
result
(
res
)
! Calls G function with flat arguments, that is, zeroes not passed through the m's.
! Calls G function with flat arguments, that is, zeroes not passed through the m's.
complex
(
kind
=
prec
)
::
z_flat
(:),
y
,
res
complex
(
kind
=
prec
)
::
z_flat
(:),
y
,
res
...
@@ -87,7 +101,6 @@ CONTAINS
...
@@ -87,7 +101,6 @@ CONTAINS
allocate
(
z
(
condensed_size
))
allocate
(
z
(
condensed_size
))
m
=
m_prime
(
1
:
condensed_size
)
m
=
m_prime
(
1
:
condensed_size
)
z
=
get_condensed_z
(
m
,
z_flat
)
z
=
get_condensed_z
(
m
,
z_flat
)
res
=
G_condensed
(
m
,
z
,
y
,
size
(
m
))
res
=
G_condensed
(
m
,
z
,
y
,
size
(
m
))
deallocate
(
m
)
deallocate
(
m
)
deallocate
(
z
)
deallocate
(
z
)
...
...
test.f90
View file @
412ce699
...
@@ -76,19 +76,16 @@ CONTAINS
...
@@ -76,19 +76,16 @@ CONTAINS
complex
(
kind
=
prec
),
parameter
::
epsilon
=
1E-14
complex
(
kind
=
prec
),
parameter
::
epsilon
=
1E-14
print
*
,
'doing GPL tests...'
print
*
,
'doing GPL tests...'
!
ref = dcmplx(0.0819393734128676)
ref
=
dcmplx
(
0.0819393734128676
)
!
call test_one_GPL((/ 1,1 /),cmplx((/ 1.3d0, 1.1d0 /)),cmplx(0.4),2,ref,'2.1')
call
test_one_GPL
((/
1
,
1
/),
cmplx
((/
1.3d0
,
1.1d0
/)),
cmplx
(
0.4
),
2
,
ref
,
'2.1'
)
! ref = dcmplx(0.01592795952537145)
ref
=
dcmplx
(
0.01592795952537145
)
! call test_one_GPL((/ 3,2 /),cmplx((/ 1.3d0, 1.1d0 /)),cmplx(0.4),2,ref,'2.2')
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.0020332632172573974
)
ref
=
dcmplx
(
0.0020332632172573974
)
ref
=
G_flat
(
cmplx
((/
1.7
,
0.0
,
0.0
/)),
cmplx
(
1.1
))
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')
! 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
subroutine
do_GPL_tests
END
PROGRAM
TEST
END
PROGRAM
TEST
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment