Skip to content

Commit

Permalink
no longer track or update the results of minpack tests to a file (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
KristofferC committed Jul 25, 2016
1 parent bc5bbed commit 7961352
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 94 deletions.
28 changes: 18 additions & 10 deletions test/minpack.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
# MINPACK would test also other initial points which are 10 or 100 times the
# original point.


# If the results should be printed to a
const PRINT_FILE = false

@testset "minpack" begin

function rosenbrock()
Expand Down Expand Up @@ -494,16 +498,17 @@ alltests = [ rosenbrock(); powell_singular(); powell_badly_scaled(); wood();

TESTS_FAIL_NEWTON = ["Trigonometric"]

f_out = open("minpack_results.dat", "w")
if PRINT_FILE; f_out = open("minpack_results.dat", "w"); end

@printf("%-45s %5s %5s %5s %14s %10s\n", "Function", "Dim", "NFEV",
"NJEV", "Final inf-norm", "total time")
println("-"^86)

@printf(f_out, "%-45s %5s %5s %5s %14s\n", "Function", "Dim", "NFEV",
"NJEV", "Final inf-norm")
println(f_out, "-"^86)

if PRINT_FILE
@printf(f_out, "%-45s %5s %5s %5s %14s\n", "Function", "Dim", "NFEV",
"NJEV", "Final inf-norm")
println(f_out, "-"^86)
end


for (df, initial, name) in alltests
Expand All @@ -515,17 +520,20 @@ for (df, initial, name) in alltests
@printf("%-45s %5d %5d %5d %14e %10e\n", name*"-"*string(method), length(initial),
r.f_calls, r.g_calls, r.residual_norm, tot_time)
@test converged(r)
@printf(f_out, "%-45s %5d %5d %5d %14e\n", name*"-"*string(method), length(initial),
r.f_calls, r.g_calls, r.residual_norm)
# with autodiff
tot_time = @elapsed r_AD = nlsolve(df.f!, initial, method = method, autodiff = true, linesearch! = Optim.backtracking_linesearch!)
@printf("%-45s %5d %5d %5d %14e %10e\n", name*"-"*string(method)*"-AD",
length(initial), r_AD.f_calls, r_AD.g_calls, r_AD.residual_norm, tot_time)
@printf(f_out, "%-45s %5d %5d %5d %14e\n", name*"-"*string(method)*"-AD", length(initial),
r_AD.f_calls, r_AD.g_calls, r_AD.residual_norm)
if PRINT_FILE
@printf(f_out, "%-45s %5d %5d %5d %14e\n", name*"-"*string(method)*"-AD", length(initial),
r_AD.f_calls, r_AD.g_calls, r_AD.residual_norm)
@printf(f_out, "%-45s %5d %5d %5d %14e\n", name*"-"*string(method), length(initial),
r.f_calls, r.g_calls, r.residual_norm)
end
@test converged(r_AD)
end
end
close(f_out)

if PRINT_FILE; close(f_out); end

end
84 changes: 0 additions & 84 deletions test/minpack_results.dat

This file was deleted.

0 comments on commit 7961352

Please sign in to comment.