{"action":"created","comment":{"url":"https://api.github.com/repos/JuliaIntervals/IntervalOptimisation.jl/pulls/comments/206021128","pull_request_review_id":141399309,"id":206021128,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNjAyMTEyOA==","diff_hunk":"@@ -0,0 +1,248 @@\n+using IntervalRootFinding, IntervalArithmetic, StaticArrays, ForwardDiff, BenchmarkTools, Compat, IntervalOptimisation, DataStructures, IntervalConstraintProgramming\n+\n+import Base.isless\n+\n+struct IntervalMinima{T<:Real}\n+    intval::Interval{T}\n+    global_minimum::T\n+end\n+\n+function isless(a::IntervalMinima{T}, b::IntervalMinima{T}) where {T<:Real}\n+    return isless(a.global_minimum, b.global_minimum)\n+end\n+\n+function minimise1d(f::Function, x::Interval{T}; reltol=1e-3, abstol=1e-3) where {T<:Real}\n+\n+    Q = binary_minheap(IntervalMinima{T})\n+\n+    global_minimum = f(interval(mid(x))).hi\n+\n+    arg_minima = Interval{T}[]\n+\n+    push!(Q, IntervalMinima(x, global_minimum))\n+\n+    while !isempty(Q)\n+\n+        p = pop!(Q)\n+\n+        if isempty(p.intval)\n+            continue\n+        end\n+\n+        if p.global_minimum > global_minimum\n+            continue\n+        end\n+\n+        current_minimum = f(interval(mid(p.intval))).hi\n+\n+        if current_minimum < global_minimum\n+            global_minimum = current_minimum\n+        end\n+\n+        if diam(p.intval) < abstol\n+            push!(arg_minima, p.intval)\n+        else\n+            x1, x2 = bisect(p.intval)\n+            push!(Q, IntervalMinima(x1, f(x1).lo), IntervalMinima(x2, f(x2).lo))\n+        end\n+    end\n+    lb = minimum(inf.(f.(arg_minima)))\n+\n+    return lb..global_minimum, arg_minima\n+end\n+\n+function minimise1d_deriv(f::Function, x::Interval{T}; reltol=1e-3, abstol=1e-3) where {T<:Real}","path":"src/optimise1.jl","position":54,"original_position":54,"commit_id":"ae5554199709243e30b7a07efd9690b2e3b281ea","original_commit_id":"ae5554199709243e30b7a07efd9690b2e3b281ea","user":{"login":"eeshan9815","id":26198993,"node_id":"MDQ6VXNlcjI2MTk4OTkz","avatar_url":"https://avatars3.githubusercontent.com/u/26198993?v=4","gravatar_id":"","url":"https://api.github.com/users/eeshan9815","html_url":"https://github.com/eeshan9815","followers_url":"https://api.github.com/users/eeshan9815/followers","following_url":"https://api.github.com/users/eeshan9815/following{/other_user}","gists_url":"https://api.github.com/users/eeshan9815/gists{/gist_id}","starred_url":"https://api.github.com/users/eeshan9815/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eeshan9815/subscriptions","organizations_url":"https://api.github.com/users/eeshan9815/orgs","repos_url":"https://api.github.com/users/eeshan9815/repos","events_url":"https://api.github.com/users/eeshan9815/events{/privacy}","received_events_url":"https://api.github.com/users/eeshan9815/received_events","type":"User","site_admin":false},"body":"I'll add `deriv` as a kwarg and combine the functions\r\n","created_at":"2018-07-30T05:55:41Z","updated_at":"2018-07-30T05:55:41Z","html_url":"https://github.com/JuliaIntervals/IntervalOptimisation.jl/pull/9#discussion_r206021128","pull_request_url":"https://api.github.com/repos/JuliaIntervals/IntervalOptimisation.jl/pulls/9","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/JuliaIntervals/IntervalOptimisation.jl/pulls/comments/206021128"},"html":{"href":"https://github.com/JuliaIntervals/IntervalOptimisation.jl/pull/9#discussion_r206021128"},"pull_request":{"href":"https://api.github.com/repos/JuliaIntervals/IntervalOptimisation.jl/pulls/9"}},"in_reply_to_id":204611719},"pull_request":{"url":"https://api.github.com/repos/JuliaIntervals/IntervalOptimisation.jl/pulls/9","id":195888010,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk1ODg4MDEw","html_url":"https://github.com/JuliaIntervals/IntervalOptimisation.jl/pull/9","diff_url":"https://github.com/JuliaIntervals/IntervalOptimisation.jl/pull/9.diff","patch_url":"https://github.com/JuliaIntervals/IntervalOptimisation.jl/pull/9.patch","issue_url":"https://api.github.com/repos/JuliaIntervals/IntervalOptimisation.jl/issues/9","number":9,"state":"open","locked":false,"title":"Global Optimisation","user":{"login":"eeshan9815","id":26198993,"node_id":"MDQ6VXNlcjI2MTk4OTkz","avatar_url":"https://avatars3.githubusercontent.com/u/26198993?v=4","gravatar_id":"","url":"https://api.github.com/users/eeshan9815","html_url":"https://github.com/eeshan9815","followers_url":"https://api.github.com/users/eeshan9815/followers","following_url":"https://api.github.com/users/eeshan9815/following{/other_user}","gists_url":"https://api.github.com/users/eeshan9815/gists{/gist_id}","starred_url":"https://api.github.com/users/eeshan9815/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eeshan9815/subscriptions","organizations_url":"https://api.github.com/users/eeshan9815/orgs","repos_url":"https://api.github.com/users/eeshan9815/repos","events_url":"https://api.github.com/users/eeshan9815/events{/privacy}","received_events_url":"https://api.github.com/users/eeshan9815/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-06-19T16:33:24Z","updated_at":"2018-07-30T05:55:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"02a566c2a96378109033c178d9305cd1ffc0cead","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/JuliaIntervals/IntervalOptimisation.jl/pulls/9/commits","review_comments_url":"https://api.github.com/repos/JuliaIntervals/IntervalOptimisation.jl/pulls/9/comments","review_comment_url":"https://api.github.com/repos/JuliaIntervals/IntervalOptimisation.jl/pulls/comments{/number}","comments_url":"https://api.github.com/repos/JuliaIntervals/IntervalOptimisation.jl/issues/9/comments","statuses_url":"https://api.github.com/repos/JuliaIntervals/IntervalOptimisation.jl/statuses/ae5554199709243e30b7a07efd9690b2e3b281ea","head":{"label":"eeshan9815:global_min","ref":"global_min","sha":"ae5554199709243e30b7a07efd9690b2e3b281ea","user":{"login":"eeshan9815","id":26198993,"node_id":"MDQ6VXNlcjI2MTk4OTkz","avatar_url":"https://avatars3.githubusercontent.com/u/26198993?v=4","gravatar_id":"","url":"https://api.github.com/users/eeshan9815","html_url":"https://github.com/eeshan9815","followers_url":"https://api.github.com/users/eeshan9815/followers","following_url":"https://api.github.com/users/eeshan9815/following{/other_user}","gists_url":"https://api.github.com/users/eeshan9815/gists{/gist_id}","starred_url":"https://api.github.com/users/eeshan9815/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eeshan9815/subscriptions","organizations_url":"https://api.github.com/users/eeshan9815/orgs","repos_url":"https://api.github.com/users/eeshan9815/repos","events_url":"https://api.github.com/users/eeshan9815/events{/privacy}","received_events_url":"https://api.github.com/users/eeshan9815/received_events","type":"User","site_admin":false},"repo":{"id":137786808,"node_id":"MDEwOlJlcG9zaXRvcnkxMzc3ODY4MDg=","name":"IntervalOptimisation.jl","full_name":"eeshan9815/IntervalOptimisation.jl","owner":{"login":"eeshan9815","id":26198993,"node_id":"MDQ6VXNlcjI2MTk4OTkz","avatar_url":"https://avatars3.githubusercontent.com/u/26198993?v=4","gravatar_id":"","url":"https://api.github.com/users/eeshan9815","html_url":"https://github.com/eeshan9815","followers_url":"https://api.github.com/users/eeshan9815/followers","following_url":"https://api.github.com/users/eeshan9815/following{/other_user}","gists_url":"https://api.github.com/users/eeshan9815/gists{/gist_id}","starred_url":"https://api.github.com/users/eeshan9815/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eeshan9815/subscriptions","organizations_url":"https://api.github.com/users/eeshan9815/orgs","repos_url":"https://api.github.com/users/eeshan9815/repos","events_url":"https://api.github.com/users/eeshan9815/events{/privacy}","received_events_url":"https://api.github.com/users/eeshan9815/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/eeshan9815/IntervalOptimisation.jl","description":"Rigorous global optimisation in pure Julia","fork":true,"url":"https://api.github.com/repos/eeshan9815/IntervalOptimisation.jl","forks_url":"https://api.github.com/repos/eeshan9815/IntervalOptimisation.jl/forks","keys_url":"https://api.github.com/repos/eeshan9815/IntervalOptimisation.jl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/eeshan9815/IntervalOptimisation.jl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/eeshan9815/IntervalOptimisation.jl/teams","hooks_url":"https://api.github.com/repos/eeshan9815/IntervalOptimisation.jl/hooks","issue_events_url":"https://api.github.com/repos/eeshan9815/IntervalOptimisation.jl/issues/events{/number}","events_url":"https://api.github.com/repos/eeshan9815/IntervalOptimisation.jl/events","assignees_url":"https://api.github.com/repos/eeshan9815/IntervalOptimisation.jl/assignees{/user}","branches_url":"https://api.github.com/repos/eeshan9815/IntervalOptimisation.jl/branches{/branch}","tags_url":"https://api.github.com/repos/eeshan9815/IntervalOptimisation.jl/tags","blobs_url":"https://api.github.com/repos/eeshan9815/IntervalOptimisation.jl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/eeshan9815/IntervalOptimisation.jl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/eeshan9815/IntervalOptimisation.jl/git/refs{/sha}","trees_url":"https://api.github.com/repos/eeshan9815/IntervalOptimisation.jl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/eeshan9815/IntervalOptimisation.jl/statuses/{sha}","languages_url":"https://api.github.com/repos/eeshan9815/IntervalOptimisation.jl/languages","stargazers_url":"https://api.github.com/repos/eeshan9815/IntervalOptimisation.jl/stargazers","contributors_url":"https://api.github.com/repos/eeshan9815/IntervalOptimisation.jl/contributors","subscribers_url":"https://api.github.com/repos/eeshan9815/IntervalOptimisation.jl/subscribers","subscription_url":"https://api.github.com/repos/eeshan9815/IntervalOptimisation.jl/subscription","commits_url":"https://api.github.com/repos/eeshan9815/IntervalOptimisation.jl/commits{/sha}","git_commits_url":"https://api.github.com/repos/eeshan9815/IntervalOptimisation.jl/git/commits{/sha}","comments_url":"https://api.github.com/repos/eeshan9815/IntervalOptimisation.jl/comments{/number}","issue_comment_url":"https://api.github.com/repos/eeshan9815/IntervalOptimisation.jl/issues/comments{/number}","contents_url":"https://api.github.com/repos/eeshan9815/IntervalOptimisation.jl/contents/{+path}","compare_url":"https://api.github.com/repos/eeshan9815/IntervalOptimisation.jl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/eeshan9815/IntervalOptimisation.jl/merges","archive_url":"https://api.github.com/repos/eeshan9815/IntervalOptimisation.jl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/eeshan9815/IntervalOptimisation.jl/downloads","issues_url":"https://api.github.com/repos/eeshan9815/IntervalOptimisation.jl/issues{/number}","pulls_url":"https://api.github.com/repos/eeshan9815/IntervalOptimisation.jl/pulls{/number}","milestones_url":"https://api.github.com/repos/eeshan9815/IntervalOptimisation.jl/milestones{/number}","notifications_url":"https://api.github.com/repos/eeshan9815/IntervalOptimisation.jl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/eeshan9815/IntervalOptimisation.jl/labels{/name}","releases_url":"https://api.github.com/repos/eeshan9815/IntervalOptimisation.jl/releases{/id}","deployments_url":"https://api.github.com/repos/eeshan9815/IntervalOptimisation.jl/deployments","created_at":"2018-06-18T17:50:26Z","updated_at":"2018-06-18T17:50:28Z","pushed_at":"2018-07-23T15:59:11Z","git_url":"git://github.com/eeshan9815/IntervalOptimisation.jl.git","ssh_url":"git@github.com:eeshan9815/IntervalOptimisation.jl.git","clone_url":"https://github.com/eeshan9815/IntervalOptimisation.jl.git","svn_url":"https://github.com/eeshan9815/IntervalOptimisation.jl","homepage":"","size":20,"stargazers_count":0,"watchers_count":0,"language":"Julia","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"JuliaIntervals:master","ref":"master","sha":"7fc13ad9a57aa8eb1a674338f531d569c1bb2dd7","user":{"login":"JuliaIntervals","id":26843058,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI2ODQzMDU4","avatar_url":"https://avatars1.githubusercontent.com/u/26843058?v=4","gravatar_id":"","url":"https://api.github.com/users/JuliaIntervals","html_url":"https://github.com/JuliaIntervals","followers_url":"https://api.github.com/users/JuliaIntervals/followers","following_url":"https://api.github.com/users/JuliaIntervals/following{/other_user}","gists_url":"https://api.github.com/users/JuliaIntervals/gists{/gist_id}","starred_url":"https://api.github.com/users/JuliaIntervals/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JuliaIntervals/subscriptions","organizations_url":"https://api.github.com/users/JuliaIntervals/orgs","repos_url":"https://api.github.com/users/JuliaIntervals/repos","events_url":"https://api.github.com/users/JuliaIntervals/events{/privacy}","received_events_url":"https://api.github.com/users/JuliaIntervals/received_events","type":"Organization","site_admin":false},"repo":{"id":94378344,"node_id":"MDEwOlJlcG9zaXRvcnk5NDM3ODM0NA==","name":"IntervalOptimisation.jl","full_name":"JuliaIntervals/IntervalOptimisation.jl","owner":{"login":"JuliaIntervals","id":26843058,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI2ODQzMDU4","avatar_url":"https://avatars1.githubusercontent.com/u/26843058?v=4","gravatar_id":"","url":"https://api.github.com/users/JuliaIntervals","html_url":"https://github.com/JuliaIntervals","followers_url":"https://api.github.com/users/JuliaIntervals/followers","following_url":"https://api.github.com/users/JuliaIntervals/following{/other_user}","gists_url":"https://api.github.com/users/JuliaIntervals/gists{/gist_id}","starred_url":"https://api.github.com/users/JuliaIntervals/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JuliaIntervals/subscriptions","organizations_url":"https://api.github.com/users/JuliaIntervals/orgs","repos_url":"https://api.github.com/users/JuliaIntervals/repos","events_url":"https://api.github.com/users/JuliaIntervals/events{/privacy}","received_events_url":"https://api.github.com/users/JuliaIntervals/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/JuliaIntervals/IntervalOptimisation.jl","description":"Rigorous global optimisation in pure Julia","fork":false,"url":"https://api.github.com/repos/JuliaIntervals/IntervalOptimisation.jl","forks_url":"https://api.github.com/repos/JuliaIntervals/IntervalOptimisation.jl/forks","keys_url":"https://api.github.com/repos/JuliaIntervals/IntervalOptimisation.jl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JuliaIntervals/IntervalOptimisation.jl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JuliaIntervals/IntervalOptimisation.jl/teams","hooks_url":"https://api.github.com/repos/JuliaIntervals/IntervalOptimisation.jl/hooks","issue_events_url":"https://api.github.com/repos/JuliaIntervals/IntervalOptimisation.jl/issues/events{/number}","events_url":"https://api.github.com/repos/JuliaIntervals/IntervalOptimisation.jl/events","assignees_url":"https://api.github.com/repos/JuliaIntervals/IntervalOptimisation.jl/assignees{/user}","branches_url":"https://api.github.com/repos/JuliaIntervals/IntervalOptimisation.jl/branches{/branch}","tags_url":"https://api.github.com/repos/JuliaIntervals/IntervalOptimisation.jl/tags","blobs_url":"https://api.github.com/repos/JuliaIntervals/IntervalOptimisation.jl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JuliaIntervals/IntervalOptimisation.jl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JuliaIntervals/IntervalOptimisation.jl/git/refs{/sha}","trees_url":"https://api.github.com/repos/JuliaIntervals/IntervalOptimisation.jl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JuliaIntervals/IntervalOptimisation.jl/statuses/{sha}","languages_url":"https://api.github.com/repos/JuliaIntervals/IntervalOptimisation.jl/languages","stargazers_url":"https://api.github.com/repos/JuliaIntervals/IntervalOptimisation.jl/stargazers","contributors_url":"https://api.github.com/repos/JuliaIntervals/IntervalOptimisation.jl/contributors","subscribers_url":"https://api.github.com/repos/JuliaIntervals/IntervalOptimisation.jl/subscribers","subscription_url":"https://api.github.com/repos/JuliaIntervals/IntervalOptimisation.jl/subscription","commits_url":"https://api.github.com/repos/JuliaIntervals/IntervalOptimisation.jl/commits{/sha}","git_commits_url":"https://api.github.com/repos/JuliaIntervals/IntervalOptimisation.jl/git/commits{/sha}","comments_url":"https://api.github.com/repos/JuliaIntervals/IntervalOptimisation.jl/comments{/number}","issue_comment_url":"https://api.github.com/repos/JuliaIntervals/IntervalOptimisation.jl/issues/comments{/number}","contents_url":"https://api.github.com/repos/JuliaIntervals/IntervalOptimisation.jl/contents/{+path}","compare_url":"https://api.github.com/repos/JuliaIntervals/IntervalOptimisation.jl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JuliaIntervals/IntervalOptimisation.jl/merges","archive_url":"https://api.github.com/repos/JuliaIntervals/IntervalOptimisation.jl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JuliaIntervals/IntervalOptimisation.jl/downloads","issues_url":"https://api.github.com/repos/JuliaIntervals/IntervalOptimisation.jl/issues{/number}","pulls_url":"https://api.github.com/repos/JuliaIntervals/IntervalOptimisation.jl/pulls{/number}","milestones_url":"https://api.github.com/repos/JuliaIntervals/IntervalOptimisation.jl/milestones{/number}","notifications_url":"https://api.github.com/repos/JuliaIntervals/IntervalOptimisation.jl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JuliaIntervals/IntervalOptimisation.jl/labels{/name}","releases_url":"https://api.github.com/repos/JuliaIntervals/IntervalOptimisation.jl/releases{/id}","deployments_url":"https://api.github.com/repos/JuliaIntervals/IntervalOptimisation.jl/deployments","created_at":"2017-06-14T22:35:09Z","updated_at":"2018-05-11T02:01:10Z","pushed_at":"2018-07-23T15:59:12Z","git_url":"git://github.com/JuliaIntervals/IntervalOptimisation.jl.git","ssh_url":"git@github.com:JuliaIntervals/IntervalOptimisation.jl.git","clone_url":"https://github.com/JuliaIntervals/IntervalOptimisation.jl.git","svn_url":"https://github.com/JuliaIntervals/IntervalOptimisation.jl","homepage":"","size":16,"stargazers_count":5,"watchers_count":5,"language":"Julia","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":5,"mirror_url":null,"archived":false,"open_issues_count":9,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":5,"open_issues":9,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/JuliaIntervals/IntervalOptimisation.jl/pulls/9"},"html":{"href":"https://github.com/JuliaIntervals/IntervalOptimisation.jl/pull/9"},"issue":{"href":"https://api.github.com/repos/JuliaIntervals/IntervalOptimisation.jl/issues/9"},"comments":{"href":"https://api.github.com/repos/JuliaIntervals/IntervalOptimisation.jl/issues/9/comments"},"review_comments":{"href":"https://api.github.com/repos/JuliaIntervals/IntervalOptimisation.jl/pulls/9/comments"},"review_comment":{"href":"https://api.github.com/repos/JuliaIntervals/IntervalOptimisation.jl/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/JuliaIntervals/IntervalOptimisation.jl/pulls/9/commits"},"statuses":{"href":"https://api.github.com/repos/JuliaIntervals/IntervalOptimisation.jl/statuses/ae5554199709243e30b7a07efd9690b2e3b281ea"}},"author_association":"NONE"}}
{"actor":{"display_login":"eeshan9815"}}