Skip to content

Commit

Permalink
Merge pull request #142 from JuliaDiffEq/add_!_after_some_functions
Browse files Browse the repository at this point in the history
Add ! after function names
  • Loading branch information
ChrisRackauckas committed Jul 30, 2019
2 parents 8a426a2 + 71e6d41 commit 3a726dd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/DiffEqBiological.jl
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export ODEProblem, SDEProblem, DiscreteProblem, JumpProblem, SteadyStateProblem

# tolls for finding equilibrium solutions and bifurcation diagrams.
export EquilibrateContent
export @add_constraint, @add_constraints, internal___add___constraint!, fix_parameters, @make_hc_template, make_hc_template, @add_hc_template, add_hc_template
export @add_constraint, @add_constraints, internal___add___constraint!, fix_parameters, @make_hc_template, make_hc_template!, @add_hc_template, add_hc_template!
export steady_states, stability
export bifurcations, bifurcation_grid, bifurcation_grid_2d, bifurcation_grid_diagram, SimpleHCBifurcationSolver, HCBifurcationSolver, HCSteadyStateSolver

Expand Down
10 changes: 5 additions & 5 deletions src/equilibrate_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ end
## args
- reaction_network: a reaction network.
"""
function make_hc_template(rn::DiffEqBase.AbstractReactionNetwork)
function make_hc_template!(rn::DiffEqBase.AbstractReactionNetwork)
check_is_polynomial(rn)
check_has_polynomial(rn)
p_template = randn(ComplexF64, length(rn.params))
Expand All @@ -210,7 +210,7 @@ end
## args
- reaction_network: a reaction network.
"""
function add_hc_template(rn::DiffEqBase.AbstractReactionNetwork)
function add_hc_template!(rn::DiffEqBase.AbstractReactionNetwork)
p_template = randn(ComplexF64, length(rn.params))
f_template = DynamicPolynomials.subs.(get_equi_poly(rn), Ref(get_polyvars(rn).p => p_template))
solution_template = solutions(HomotopyContinuation.solve(f_template, show_progress=false))
Expand All @@ -234,7 +234,7 @@ end
- reaction_network: a reaction network.
"""
macro make_hc_template(rn::Symbol)
return Expr(:escape,:(make_hc_template($rn)))
return Expr(:escape,:(make_hc_template!($rn)))
end
#Macro running the HC template function.
"""
Expand All @@ -246,7 +246,7 @@ end
- reaction_network: a reaction network.
"""
macro add_hc_template(rn::Symbol)
return Expr(:escape,:(add_hc_template($rn)))
return Expr(:escape,:(add_hc_template!($rn)))
end


Expand Down Expand Up @@ -297,7 +297,7 @@ function initialise_solver!(rn::DiffEqBase.AbstractReactionNetwork, p::Vector{Fl
check_is_polynomial(rn)
using_temp_poly = !has_equi_poly(rn)
using_temp_poly && fix_parameters(rn, p, full_vector_exemption=bifurcation_exception_parameter)
!has_hc_templates(rn) && make_hc_template(rn)
!has_hc_templates(rn) && make_hc_template!(rn)
return using_temp_poly
end
# In case a temporary equilibrium polynomial were used, this one resets it.
Expand Down
6 changes: 3 additions & 3 deletions test/equilibrate_test_4.jl
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ bif_brusselator = bifurcations(brusselator_network,brusselator_p,:B,(1.,4.))
end v0 v K n kD kB kC deg S;
fix_parameters(σ_network,n=4)
σ_p = [0.005, 0.1, 2.8, 4, 10, 100, 0.1, 0.01, 0.5]
make_hc_template(σ_network)
add_hc_template(σ_network)
make_hc_template!(σ_network)
add_hc_template!(σ_network)
ss_σ = steady_states(σ_network,σ_p)
@test(length(ss_σ)==3)
stabs_σ = stability(ss_σ,σ_network,σ_p)
Expand All @@ -58,7 +58,7 @@ cc_network = @reaction_network begin
end k1 k2p k2pp k3p k3pp A J3 k4 m J4
cc_p = [0.04,0.04,1.,1.,10.0,0.,0.04,35.,.3,.04]
@add_constraint cc_network P+Po=1
add_hc_template(cc_network)
add_hc_template!(cc_network)
@add_hc_template cc_network
ss_cc = steady_states(cc_network,cc_p)
@test(length(ss_cc)==3)
Expand Down

0 comments on commit 3a726dd

Please sign in to comment.