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
13945806
Commit
13945806
authored
Aug 22, 2019
by
ulrich_y
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added ikin for integers prone to roll over
parent
991385d2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
4 deletions
+11
-4
src/globals.f90
src/globals.f90
+1
-0
src/maths_functions.f90
src/maths_functions.f90
+1
-1
src/mpl_module.f90
src/mpl_module.f90
+9
-3
No files found.
src/globals.f90
View file @
13945806
...
...
@@ -4,6 +4,7 @@ MODULE globals
integer
,
parameter
::
prec
=
selected_real_kind
(
15
,
32
)
integer
,
parameter
::
ikin
=
4
real
(
kind
=
prec
),
parameter
::
zero
=
10._prec
**
(
-
precision
(
1._prec
))
! values smaller than this count as zero
real
(
kind
=
prec
),
parameter
::
pi
=
3.1415926535897932384626433832795028841971693993751_prec
...
...
src/maths_functions.f90
View file @
13945806
...
...
@@ -26,7 +26,7 @@ CONTAINS
! Computes the classical polylogarithm Li_m(x) using series representation up to order n
integer
::
m
complex
(
kind
=
prec
)
::
x
,
res
integer
::
i
integer
(
kind
=
ikin
)
::
i
res
=
0._prec
do
i
=
1
,
PolylogInfinity
if
(
i
**
m
.lt.
0
)
return
! roll over
...
...
src/mpl_module.f90
View file @
13945806
...
...
@@ -62,7 +62,7 @@ CONTAINS
complex
(
kind
=
prec
)
::
x
(:)
complex
(
kind
=
prec
)
::
res
complex
(
kind
=
prec
)
::
t
(
size
(
x
))
integer
::
q
,
j
,
k
integer
(
kind
=
ikin
)
::
q
,
j
,
k
#ifdef MPL_CACHE
if
(
check_cache
(
m
,
x
,
res
))
return
#endif
...
...
@@ -70,6 +70,9 @@ CONTAINS
j
=
size
(
x
)
#ifdef DEBUG
if
(
verb
>=
70
)
print
*
,
'called MPL('
,
m
,
','
,
x
,
')'
#endif
if
(
size
(
m
)
/
=
size
(
x
))
then
print
*
,
'Error: m and x must have the same length'
end
if
...
...
@@ -79,13 +82,16 @@ CONTAINS
do
while
(
.true.
)
res
=
t
(
1
)
q
=
q
+1
if
(
q
<
0
)
exit
if
(
q
**
m
(
j
)
.eq.
0
)
exit
t
(
j
)
=
t
(
j
)
+
x
(
j
)
**
q
/
q
**
m
(
j
)
do
k
=
1
,
j
-1
if
((
k
+
q
)
**
m
(
j
-
k
)
.eq.
0
)
exit
t
(
j
-
k
)
=
t
(
j
-
k
)
+
t
(
j
-
k
+1
)
*
x
(
j
-
k
)
**
(
k
+
q
)/(
k
+
q
)
**
m
(
j
-
k
)
enddo
if
(
mod
(
q
,
2
)
.eq.
1
)
then
if
(
abs
(
t
(
1
)
-
res
)
.lt.
MPLdel
)
exit
if
(
mod
(
q
,
2
_ikin
)
.eq.
1
)
then
if
(
abs
(
t
(
1
)
-
res
)
.lt.
MPLdel
/
100.
)
exit
endif
enddo
res
=
t
(
1
)
...
...
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