Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix InitialConstantChange #122

Merged
merged 1 commit into from
Jun 6, 2018
Merged
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
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