diff --git a/benchmark/benchmarks.jl b/benchmark/benchmarks.jl new file mode 100644 index 0000000..3e8ff54 --- /dev/null +++ b/benchmark/benchmarks.jl @@ -0,0 +1,21 @@ +include("examples.jl") +using .OneDimExamples, .TwoDimExamples +using BenchmarkTools +using IntervalArithmetic +using IntervalOptimisation + +const SUITE = BenchmarkGroup() + + +S = SUITE["One dimentional function"] = BenchmarkGroup() + +for func in (OneDimExamples.func1, OneDimExamples.func2, OneDimExamples.func3) + S[func.title] = @benchmarkable minimise($(func.func), $(func.region)) +end + + +S = SUITE["Two dimentional function"] = BenchmarkGroup() + +for func in (TwoDimExamples.Rosenbrock) + s = S[func.title] = @benchmarkable minimise($(func.func), $(func.region)) +end \ No newline at end of file diff --git a/benchmark/examples.jl b/benchmark/examples.jl new file mode 100644 index 0000000..e288b6a --- /dev/null +++ b/benchmark/examples.jl @@ -0,0 +1,31 @@ +module OneDimExamples + +using IntervalArithmetic, IntervalOptimisation + +struct working_function{string, F<:Function, reg<:Interval} + func::F + region::reg + title::string +end + +func1 = working_function("Quadrtic equation", Interval(-1,2), x->x*(x-1) ) +func2 = working_function("Cubic equation", Interval(-1,4), x->(x-2)^3-5x ) +func3 = working_function("quadritic equation", Interval(-4,6), x->(x-6)*(x+4)*(7x^2+10x+24) ) + +end + + +module TwoDimExamples + +using IntervalArithmetic, IntervalOptimisation + +struct working_function{string, F<:Function, reg<:Union{Interval, IntervalBox}} + func::F + region::reg + title::string +end + +rosenbrock(xx) = ( (x, y) = xx; 100*(y - x)^2 + (x - 1)^2 ) +Rosenbrock = working_function(rosenbrock, IntervalBox(-5..5, 2), "Rosenbrock function") + +end \ No newline at end of file