Skip to content
This repository has been archived by the owner on Sep 9, 2024. It is now read-only.

Commit

Permalink
Remove magic constants.
Browse files Browse the repository at this point in the history
  • Loading branch information
helgee committed Jun 27, 2014
1 parent d8374cc commit 86832b0
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/odedop.jl
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,10 @@ function dopcore(c::DOP853, n::Int64, p, x::Float64, y::Vector, h::Float64, k1::
deno = 1.0
end
err = abs(h)*err*sqrt(1.0/(n*deno))
return y1, maximum(abs(err)), 11

# Number of function evaluations
neval = 11
return y1, maximum(abs(err)), neval
end

function dopcore(c::DOPRI5, n::Int64, p, x::Float64, y::Vector, h::Float64, k1::Vector, k2::Vector, k3::Vector, k4::Vector, k5::Vector, k6::Vector, k7::Vector, k8::Vector, k9::Vector, k10::Vector, abstol::Vector, reltol::Vector)
Expand Down Expand Up @@ -748,5 +751,8 @@ function dopcore(c::DOPRI5, n::Int64, p, x::Float64, y::Vector, h::Float64, k1::
err += (k4[i]/sk)*(k4[i]/sk)
end
err = sqrt(err/n)
return y1, maximum(abs(err)), 6

# Number of function evaluations
neval = 6
return y1, maximum(abs(err)), neval
end

0 comments on commit 86832b0

Please sign in to comment.