Skip to content

Commit

Permalink
Test that x_df and DF haven't changed
Browse files Browse the repository at this point in the history
  • Loading branch information
Asbjørn Nilsen Riseth committed Apr 6, 2018
1 parent 4eea001 commit 46fe8b6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions test/objective_types.jl
Expand Up @@ -15,8 +15,13 @@
@test value(od) == 0.0
@test od.f_calls == [0]
@test od.df_calls == [0]
gx = gradient(od, x_seed)
@test gradient(od, x_seed) == gx
od.x_df .= x_seed
gold = copy(od.DF)
xnew = rand(size(x_seed))
gnew = gradient(od, xnew)
@test od.x_df == x_seed
@test od.DF == gold
@test gnew == gradient(od, xnew)

td = TwiceDifferentiable(exponential, exponential_gradient!, nothing, exponential_hessian!, x_seed, 0.0, g_seed, h_seed)
@test td.f == exponential
Expand Down

0 comments on commit 46fe8b6

Please sign in to comment.