Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/cache_module.f90
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ subroutine initialize_cache(me,isize,n,m,chunk_size)

class(function_cache),intent(inout) :: me
integer,intent(in) :: isize !! the size of the hash table
integer,intent(in) :: n !! number of independant variables (x)
integer,intent(in) :: n !! number of independent variables (x)
integer,intent(in) :: m !! number of functions (f)
integer,intent(in),optional :: chunk_size !! chunk size to speed up reallocation
!! of arrays. A good value is a guess for
Expand Down Expand Up @@ -127,7 +127,7 @@ subroutine get_from_cache(me,x,ifs,i,f,xfound,ffound)
implicit none

class(function_cache),intent(inout) :: me
real(wp),dimension(:),intent(in) :: x !! independant variable vector
real(wp),dimension(:),intent(in) :: x !! independent variable vector
integer,dimension(:),intent(in) :: ifs !! elements of `f` needed
integer,intent(out) :: i !! index in the hash table
real(wp),dimension(:),intent(out) :: f !! `f(x)` from the cache (if it was found)
Expand Down Expand Up @@ -178,7 +178,7 @@ subroutine put_in_cache(me,i,x,f,ifs)

class(function_cache),intent(inout) :: me
integer,intent(in) :: i !! index in the hash table
real(wp),dimension(:),intent(in) :: x !! independant variable vector (dimension `n`)
real(wp),dimension(:),intent(in) :: x !! independent variable vector (dimension `n`)
real(wp),dimension(:),intent(in) :: f !! function vector `f(x)` (dimension `m`)
integer,dimension(:),intent(in) :: ifs !! elements of `f` to add (should all be `>0, <=m`)

Expand Down
10 changes: 5 additions & 5 deletions src/diff_module.f90
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
!## Authors
! * J. Oliver, "An algorithm for numerical differentiation of a function
! of one real variable", Journal of Computational and Applied Mathematics
! 6 (2) (1980) 145160. [Algol 60 source in original paper]
! 6 (2) (1980) 145-160. [Algol 60 source in original paper]
! * David Kahaner, Fortran 77 code from
! [NIST](ftp://math.nist.gov/pub/repository/diff/src/DIFF)
! * Jacob Williams : 2/17/2013 : Converted to modern Fortran.
Expand Down Expand Up @@ -834,7 +834,7 @@ subroutine faccur(me,h0,h1,facc,x0,twoinf,f0,f1,ifail)
end if
end if
if (abs(h1) >= 32.0_wp*twoinf) h1 = h1/8.0_wp
if (16.0_wp*abs(h1) > abs(h0)) h1 = sign(h1,1.0_wp)*abs(h0)/16.0_wp
if (16.0_wp*abs(h1) > abs(h0)) h1 = sign(1.0_wp,h1)*abs(h0)/16.0_wp
f001 = me%f(x0+h0-h1)
if (me%stop) then
ifail = -1
Expand All @@ -854,7 +854,7 @@ subroutine faccur(me,h0,h1,facc,x0,twoinf,f0,f1,ifail)
end do
h1 = 8.0_wp*h1
else
h1 = sign(h1,1.0_wp)*abs(h0)/16.0_wp
h1 = sign(1.0_wp,h1)*abs(h0)/16.0_wp
end if
else
if (256.0_wp*twoinf <= abs(h0)) then
Expand All @@ -868,9 +868,9 @@ subroutine faccur(me,h0,h1,facc,x0,twoinf,f0,f1,ifail)
h1 = h1/2.0_wp
end do
h1 = 8.0_wp*h1
if (16.0_wp*abs(h1) > abs(h0)) h1 = sign(h1,1.0_wp)*abs(h0)/16.0_wp
if (16.0_wp*abs(h1) > abs(h0)) h1 = sign(1.0_wp,h1)*abs(h0)/16.0_wp
else
h1 = sign(h1,1.0_wp)*abs(h0)/16.0_wp
h1 = sign(1.0_wp,h1)*abs(h0)/16.0_wp
end if
end if
else
Expand Down
2 changes: 1 addition & 1 deletion src/utilities_module.f90
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ function unique_real(vec,chunk_size) result(ivec_unique)

implicit none

real(wp),dimension(:),intent(in) :: vec !! a vector of integers
real(wp),dimension(:),intent(in) :: vec !! a vector of reals
integer,intent(in) :: chunk_size !! chunk size for adding to arrays
real(wp),dimension(:),allocatable :: ivec_unique !! unique elements of `ivec`

Expand Down
2 changes: 1 addition & 1 deletion tests/test2.f90
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ program test2
font_size = 30, &
xlabel = 'Finite Difference Perturbation Step Size $h$',&
ylabel = 'Finite Difference Derivative Error',&
title = 'Derivative of $x + \sin(x)$ at $x=1$ '//real_kind_str,&
title = 'Derivative of $x + \\sin(x)$ at $x=1$ '//real_kind_str,&
legend = .true., &
legend_fontsize = 10,&
usetex = .true.)
Expand Down
Loading