Skip to content

Commit

Permalink
Fix InitialConstantChange (#122)
Browse files Browse the repository at this point in the history
  • Loading branch information
pkofod authored and anriseth committed Jun 6, 2018
1 parent c3d0763 commit 0757cd2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/initialguess.jl
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ function (is::InitialConstantChange{T})(ls, state, phi_0, dphi_0, df) where T
αguess = one(state.alpha)
end
end
is.dϕ_0_previous[] = dphi_0
state.alpha = αguess
end

Expand Down
4 changes: 4 additions & 0 deletions test/initial.jl
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@
is = InitialConstantChange(snap2one=(0.25,1.0))
is.dϕ_0_previous[] = 0.1*dphi_0
is(ls, state, phi_0, dphi_0, df)
@test is.dϕ_0_previous[] == dphi_0
@test state.alpha == 1.0
@test ls.mayterminate[] == false
dϕ_0_rand = rand()
is(ls, state, phi_0, dϕ_0_rand, df)
@test is.dϕ_0_previous[] == dϕ_0_rand
end

0 comments on commit 0757cd2

Please sign in to comment.