-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add brent, deckkers-aarts fns, refactor
- Loading branch information
Showing
30 changed files
with
523,063 additions
and
101 deletions.
There are no files selected for viewing
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
using BenchmarkFunctions | ||
using Plots | ||
pyplot() | ||
|
||
## plot 1D functions | ||
plot("gramacy_lee", -0.5:0.001:2.5) | ||
savefig("./plots/1d_gramacy_lee.svg") | ||
|
||
## plot 2D functions | ||
plot("adjiman", -4:0.1:4, -4:0.1:4) | ||
savefig("./plots/2d_adjiman.svg") | ||
plot("ackley_2", -4:0.1:4, -4:0.1:4) | ||
savefig("./plots/2d_ackley_2.svg") | ||
plot("ackley_3", -4:0.1:4, -4:0.1:4) | ||
savefig("./plots/2d_ackley_3.svg") | ||
plot("bartels_conn", -4:0.1:4, -4:0.1:4) | ||
savefig("./plots/2d_bartels_conn.svg") | ||
plot("beale", -4:0.1:4, -4:0.1:4) | ||
savefig("./plots/2d_beale.svg") | ||
plot("bird", -2π:0.1:2π, -2π:0.1:2π) | ||
savefig("./plots/2d_bird.svg") | ||
plot("bohachevsky_1", -100:1:100, -100:1:100) | ||
savefig("./plots/2d_bohachevsky_1.svg") | ||
plot("bohachevsky_2", -2:0.1:2, -2:0.1:2) | ||
savefig("./plots/2d_bohachevsky_2.svg") | ||
plot("bohachevsky_3", -2:0.1:2, -2:0.1:2) | ||
savefig("./plots/2d_bohachevsky_3.svg") | ||
plot("brent", -15:0.1:-5, -15:0.1:-5) | ||
savefig("./plots/2d_brent.svg") | ||
plot("deckkers_aarts",-20:0.2:20, -20:0.2:20) | ||
savefig("./plots/2d_deckkers_aarts.svg") | ||
plot("himmelblau", -5:0.1:5, -5:0.1:5) | ||
savefig("./plots/2d_himmelblau.svg") | ||
plot("mccormick", -1.5:0.1:4, -3:0.1:3) | ||
savefig("./plots/2d_mccormick.svg") | ||
|
||
## plot nD functions | ||
plot("ackley_1", -10:0.01:10) | ||
savefig("./plots/nd_ackley_1_1d.svg") | ||
plot("ackley_1", -10:0.1:10, -10:0.1:10) | ||
savefig("./plots/nd_ackley_1_2d.svg") | ||
plot("ackley_4", -5:0.1:5, -5:0.1:5) | ||
savefig("./plots/nd_ackley_4_2d.svg") | ||
plot("alpine_1", -10:0.01:10) | ||
savefig("./plots/nd_alpine_1_1d.svg") | ||
plot("alpine_1", -10:0.1:10, -10:0.1:10) | ||
savefig("./plots/nd_alpine_1_2d.svg") | ||
plot("alpine_2", 0:0.01:10) | ||
savefig("./plots/nd_alpine_2_1d.svg") | ||
plot("alpine_2", 0:0.1:10, 0:0.1:10) | ||
savefig("./plots/nd_alpine_2_2d.svg") | ||
plot("rosenbrock", -2:0.1:2, -2:0.1:2) | ||
savefig("./plots/nd_rosenbrock_2d.svg") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
""" | ||
brent(X) | ||
Compute the 2-dimensional Brent function on sample vector `X`. | ||
The function is usually evaluated on `xᵢ` ∈ [-10, 10] for i = 1, 2. | ||
""" | ||
function brent(X) | ||
|
||
@assert all(length.(X) .== 2) "Sample vector tuples must be length 2." | ||
|
||
y = [Tuple( (x[1]+10)^2 + (x[2]+10)^2 + exp(-x[1]^2 - x[2]^2) ) for x in X] | ||
|
||
return y | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
""" | ||
deckkers_aarts(X) | ||
Compute the 2-dimensional Deckkers-Aarts function on sample vector `X`. | ||
The function is usually evaluated on `xᵢ` ∈ [-20, 20] for i = 1, 2. | ||
""" | ||
function deckkers_aarts(X) | ||
|
||
@assert all(length.(X) .== 2) "Sample vector tuples must be length 2." | ||
|
||
y = [Tuple( 1e5*x[1]^2 + x[2]^2 - (x[1]^2+x[2]^2)^2 + | ||
1e-5*(x[1]^2+x[2]^2)^4 ) for x in X] | ||
|
||
return y | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# 1-dimensional | ||
include("gramacy_lee.jl") | ||
export gramacy_lee | ||
|
||
# 2-dimensional | ||
include("adjiman.jl") | ||
include("ackley_2.jl") | ||
include("ackley_3.jl") | ||
include("bartels_conn.jl") | ||
include("beale.jl") | ||
include("bird.jl") | ||
include("bohachevsky_1.jl") | ||
include("bohachevsky_2.jl") | ||
include("bohachevsky_3.jl") | ||
include("brent.jl") | ||
include("deckkers_aarts.jl") | ||
include("himmelblau.jl") | ||
include("mccormick.jl") | ||
export adjiman, ackley_2, ackley_3, bartels_conn, beale, bird, bohachevsky_1, | ||
bohachevsky_2, bohachevsky_3, brent, deckkers_aarts, himmelblau, | ||
mccormick | ||
|
||
# n-dimensional | ||
include("ackley_1.jl") | ||
include("ackley_4.jl") | ||
include("alpine_1.jl") | ||
include("alpine_2.jl") | ||
include("rosenbrock.jl") | ||
export ackley_1, ackley_4, alpine_1, alpine_2, rosenbrock |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
include("attributes.jl") | ||
include("ndgrid.jl") | ||
include("plot.jl") | ||
export attributes, ndgrid, plot |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters