{"action":"created","comment":{"url":"https://api.github.com/repos/libmir/mir/pulls/comments/68909321","id":68909321,"diff_hunk":"@@ -0,0 +1,650 @@\n+module mir.random.tinflex.internal.area;\n+\n+import mir.random.tinflex.internal.types : Interval;\n+import std.traits : ReturnType;\n+\n+/**\n+Determines the hat and squeeze function of an interval.\n+Based on Theorem 1\n+*/\n+void determineSqueezeAndHat(S)(ref Interval!S iv)\n+in\n+{\n+    assert(iv.lx < iv.rx, \"invalid interval\");\n+}\n+body\n+{\n+    import mir.random.tinflex.internal.linearfun : emptyFun, secant, tangent;\n+    import mir.random.tinflex.internal.types : determineType, FunType;\n+\n+    enum sec = \"secant(iv.lx, iv.rx, iv.ltx, iv.rtx)\";\n+    enum t_l = \"tangent(iv.lx, iv.ltx, iv.lt1x)\";\n+    enum t_r = \"tangent(iv.rx, iv.rtx, iv.rt1x)\";\n+\n+    // could potentially be saved for subsequent calls\n+    FunType type = determineType(iv);\n+    with(FunType) with(iv)\n+    switch(type)\n+    {\n+        case T1a:\n+            squeeze = mixin(t_r);\n+            hat = mixin(t_l);\n+            break;\n+        case T1b:\n+            squeeze = mixin(t_l);\n+            hat = mixin(t_r);\n+            break;\n+        case T2a:\n+            squeeze = mixin(sec);\n+            hat = mixin(t_l);\n+            break;\n+        case T2b:\n+            squeeze = mixin(sec);\n+            hat = mixin(t_r);\n+            break;\n+        case T3a:\n+            squeeze = mixin(t_r);\n+            hat = mixin(sec);\n+            break;\n+        case T3b:\n+            squeeze = mixin(t_l);\n+            hat = mixin(sec);\n+            break;\n+        case T4a:\n+            if (iv.lx == -S.infinity)\n+            {\n+                squeeze = squeeze.init;\n+                hat = mixin(t_r);\n+                break;\n+            }\n+            if (iv.rx == +S.infinity)\n+            {\n+                squeeze = squeeze.init;\n+                hat = mixin(t_l);\n+                break;\n+            }\n+            squeeze = mixin(sec);\n+            hat = iv.ltx > iv.rtx ? mixin(t_l) : mixin(t_r);\n+            break;\n+        case T4b:\n+            squeeze = iv.ltx < iv.rtx ? mixin(t_l) : mixin(t_r);\n+            hat = mixin(sec);\n+            break;\n+        default:\n+            squeeze = emptyFun!S;\n+            hat = emptyFun!S;","path":"source/mir/random/tinflex/internal/area.d","position":75,"original_position":75,"commit_id":"b7edb973aa6f091e604476d8dd3120e72907648e","original_commit_id":"b7edb973aa6f091e604476d8dd3120e72907648e","user":{"login":"joseph-wakeling-sociomantic","id":6409224,"avatar_url":"https://avatars.githubusercontent.com/u/6409224?v=3","gravatar_id":"","url":"https://api.github.com/users/joseph-wakeling-sociomantic","html_url":"https://github.com/joseph-wakeling-sociomantic","followers_url":"https://api.github.com/users/joseph-wakeling-sociomantic/followers","following_url":"https://api.github.com/users/joseph-wakeling-sociomantic/following{/other_user}","gists_url":"https://api.github.com/users/joseph-wakeling-sociomantic/gists{/gist_id}","starred_url":"https://api.github.com/users/joseph-wakeling-sociomantic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joseph-wakeling-sociomantic/subscriptions","organizations_url":"https://api.github.com/users/joseph-wakeling-sociomantic/orgs","repos_url":"https://api.github.com/users/joseph-wakeling-sociomantic/repos","events_url":"https://api.github.com/users/joseph-wakeling-sociomantic/events{/privacy}","received_events_url":"https://api.github.com/users/joseph-wakeling-sociomantic/received_events","type":"User","site_admin":false},"body":"Is this `default:` a legitimate case in any circumstances?  If not, it might be better just to `assert(false)`.","created_at":"2016-06-29T09:02:21Z","updated_at":"2016-06-29T09:02:21Z","html_url":"https://github.com/libmir/mir/pull/240#discussion_r68909321","pull_request_url":"https://api.github.com/repos/libmir/mir/pulls/240","_links":{"self":{"href":"https://api.github.com/repos/libmir/mir/pulls/comments/68909321"},"html":{"href":"https://github.com/libmir/mir/pull/240#discussion_r68909321"},"pull_request":{"href":"https://api.github.com/repos/libmir/mir/pulls/240"}}},"pull_request":{"url":"https://api.github.com/repos/libmir/mir/pulls/240","id":75363986,"html_url":"https://github.com/libmir/mir/pull/240","diff_url":"https://github.com/libmir/mir/pull/240.diff","patch_url":"https://github.com/libmir/mir/pull/240.patch","issue_url":"https://api.github.com/repos/libmir/mir/issues/240","number":240,"state":"open","locked":false,"title":"Tinflex","user":{"login":"wilzbach","id":4370550,"avatar_url":"https://avatars.githubusercontent.com/u/4370550?v=3","gravatar_id":"","url":"https://api.github.com/users/wilzbach","html_url":"https://github.com/wilzbach","followers_url":"https://api.github.com/users/wilzbach/followers","following_url":"https://api.github.com/users/wilzbach/following{/other_user}","gists_url":"https://api.github.com/users/wilzbach/gists{/gist_id}","starred_url":"https://api.github.com/users/wilzbach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wilzbach/subscriptions","organizations_url":"https://api.github.com/users/wilzbach/orgs","repos_url":"https://api.github.com/users/wilzbach/repos","events_url":"https://api.github.com/users/wilzbach/events{/privacy}","received_events_url":"https://api.github.com/users/wilzbach/received_events","type":"User","site_admin":false},"body":"(reboot of #222 with an upstream branch)","created_at":"2016-06-27T19:13:52Z","updated_at":"2016-06-29T09:02:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8a06110f2cf481aa222a2e5f23f0582a34e31e46","assignee":{"login":"wilzbach","id":4370550,"avatar_url":"https://avatars.githubusercontent.com/u/4370550?v=3","gravatar_id":"","url":"https://api.github.com/users/wilzbach","html_url":"https://github.com/wilzbach","followers_url":"https://api.github.com/users/wilzbach/followers","following_url":"https://api.github.com/users/wilzbach/following{/other_user}","gists_url":"https://api.github.com/users/wilzbach/gists{/gist_id}","starred_url":"https://api.github.com/users/wilzbach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wilzbach/subscriptions","organizations_url":"https://api.github.com/users/wilzbach/orgs","repos_url":"https://api.github.com/users/wilzbach/repos","events_url":"https://api.github.com/users/wilzbach/events{/privacy}","received_events_url":"https://api.github.com/users/wilzbach/received_events","type":"User","site_admin":false},"assignees":[{"login":"wilzbach","id":4370550,"avatar_url":"https://avatars.githubusercontent.com/u/4370550?v=3","gravatar_id":"","url":"https://api.github.com/users/wilzbach","html_url":"https://github.com/wilzbach","followers_url":"https://api.github.com/users/wilzbach/followers","following_url":"https://api.github.com/users/wilzbach/following{/other_user}","gists_url":"https://api.github.com/users/wilzbach/gists{/gist_id}","starred_url":"https://api.github.com/users/wilzbach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wilzbach/subscriptions","organizations_url":"https://api.github.com/users/wilzbach/orgs","repos_url":"https://api.github.com/users/wilzbach/repos","events_url":"https://api.github.com/users/wilzbach/events{/privacy}","received_events_url":"https://api.github.com/users/wilzbach/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/libmir/mir/pulls/240/commits","review_comments_url":"https://api.github.com/repos/libmir/mir/pulls/240/comments","review_comment_url":"https://api.github.com/repos/libmir/mir/pulls/comments{/number}","comments_url":"https://api.github.com/repos/libmir/mir/issues/240/comments","statuses_url":"https://api.github.com/repos/libmir/mir/statuses/b7edb973aa6f091e604476d8dd3120e72907648e","head":{"label":"libmir:tinflex","ref":"tinflex","sha":"b7edb973aa6f091e604476d8dd3120e72907648e","user":{"login":"libmir","id":18573637,"avatar_url":"https://avatars.githubusercontent.com/u/18573637?v=3","gravatar_id":"","url":"https://api.github.com/users/libmir","html_url":"https://github.com/libmir","followers_url":"https://api.github.com/users/libmir/followers","following_url":"https://api.github.com/users/libmir/following{/other_user}","gists_url":"https://api.github.com/users/libmir/gists{/gist_id}","starred_url":"https://api.github.com/users/libmir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/libmir/subscriptions","organizations_url":"https://api.github.com/users/libmir/orgs","repos_url":"https://api.github.com/users/libmir/repos","events_url":"https://api.github.com/users/libmir/events{/privacy}","received_events_url":"https://api.github.com/users/libmir/received_events","type":"Organization","site_admin":false},"repo":{"id":37379986,"name":"mir","full_name":"libmir/mir","owner":{"login":"libmir","id":18573637,"avatar_url":"https://avatars.githubusercontent.com/u/18573637?v=3","gravatar_id":"","url":"https://api.github.com/users/libmir","html_url":"https://github.com/libmir","followers_url":"https://api.github.com/users/libmir/followers","following_url":"https://api.github.com/users/libmir/following{/other_user}","gists_url":"https://api.github.com/users/libmir/gists{/gist_id}","starred_url":"https://api.github.com/users/libmir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/libmir/subscriptions","organizations_url":"https://api.github.com/users/libmir/orgs","repos_url":"https://api.github.com/users/libmir/repos","events_url":"https://api.github.com/users/libmir/events{/privacy}","received_events_url":"https://api.github.com/users/libmir/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/libmir/mir","description":"Generic Numerical Library","fork":false,"url":"https://api.github.com/repos/libmir/mir","forks_url":"https://api.github.com/repos/libmir/mir/forks","keys_url":"https://api.github.com/repos/libmir/mir/keys{/key_id}","collaborators_url":"https://api.github.com/repos/libmir/mir/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/libmir/mir/teams","hooks_url":"https://api.github.com/repos/libmir/mir/hooks","issue_events_url":"https://api.github.com/repos/libmir/mir/issues/events{/number}","events_url":"https://api.github.com/repos/libmir/mir/events","assignees_url":"https://api.github.com/repos/libmir/mir/assignees{/user}","branches_url":"https://api.github.com/repos/libmir/mir/branches{/branch}","tags_url":"https://api.github.com/repos/libmir/mir/tags","blobs_url":"https://api.github.com/repos/libmir/mir/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/libmir/mir/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/libmir/mir/git/refs{/sha}","trees_url":"https://api.github.com/repos/libmir/mir/git/trees{/sha}","statuses_url":"https://api.github.com/repos/libmir/mir/statuses/{sha}","languages_url":"https://api.github.com/repos/libmir/mir/languages","stargazers_url":"https://api.github.com/repos/libmir/mir/stargazers","contributors_url":"https://api.github.com/repos/libmir/mir/contributors","subscribers_url":"https://api.github.com/repos/libmir/mir/subscribers","subscription_url":"https://api.github.com/repos/libmir/mir/subscription","commits_url":"https://api.github.com/repos/libmir/mir/commits{/sha}","git_commits_url":"https://api.github.com/repos/libmir/mir/git/commits{/sha}","comments_url":"https://api.github.com/repos/libmir/mir/comments{/number}","issue_comment_url":"https://api.github.com/repos/libmir/mir/issues/comments{/number}","contents_url":"https://api.github.com/repos/libmir/mir/contents/{+path}","compare_url":"https://api.github.com/repos/libmir/mir/compare/{base}...{head}","merges_url":"https://api.github.com/repos/libmir/mir/merges","archive_url":"https://api.github.com/repos/libmir/mir/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/libmir/mir/downloads","issues_url":"https://api.github.com/repos/libmir/mir/issues{/number}","pulls_url":"https://api.github.com/repos/libmir/mir/pulls{/number}","milestones_url":"https://api.github.com/repos/libmir/mir/milestones{/number}","notifications_url":"https://api.github.com/repos/libmir/mir/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/libmir/mir/labels{/name}","releases_url":"https://api.github.com/repos/libmir/mir/releases{/id}","deployments_url":"https://api.github.com/repos/libmir/mir/deployments","created_at":"2015-06-13T16:59:39Z","updated_at":"2016-06-27T18:38:27Z","pushed_at":"2016-06-29T00:40:40Z","git_url":"git://github.com/libmir/mir.git","ssh_url":"git@github.com:libmir/mir.git","clone_url":"https://github.com/libmir/mir.git","svn_url":"https://github.com/libmir/mir","homepage":"http://mir.dlang.io","size":1861,"stargazers_count":34,"watchers_count":34,"language":"D","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"open_issues_count":58,"forks":9,"open_issues":58,"watchers":34,"default_branch":"master"}},"base":{"label":"libmir:master","ref":"master","sha":"819ea032898a17af2d1bf4e439d106d89625a9c5","user":{"login":"libmir","id":18573637,"avatar_url":"https://avatars.githubusercontent.com/u/18573637?v=3","gravatar_id":"","url":"https://api.github.com/users/libmir","html_url":"https://github.com/libmir","followers_url":"https://api.github.com/users/libmir/followers","following_url":"https://api.github.com/users/libmir/following{/other_user}","gists_url":"https://api.github.com/users/libmir/gists{/gist_id}","starred_url":"https://api.github.com/users/libmir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/libmir/subscriptions","organizations_url":"https://api.github.com/users/libmir/orgs","repos_url":"https://api.github.com/users/libmir/repos","events_url":"https://api.github.com/users/libmir/events{/privacy}","received_events_url":"https://api.github.com/users/libmir/received_events","type":"Organization","site_admin":false},"repo":{"id":37379986,"name":"mir","full_name":"libmir/mir","owner":{"login":"libmir","id":18573637,"avatar_url":"https://avatars.githubusercontent.com/u/18573637?v=3","gravatar_id":"","url":"https://api.github.com/users/libmir","html_url":"https://github.com/libmir","followers_url":"https://api.github.com/users/libmir/followers","following_url":"https://api.github.com/users/libmir/following{/other_user}","gists_url":"https://api.github.com/users/libmir/gists{/gist_id}","starred_url":"https://api.github.com/users/libmir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/libmir/subscriptions","organizations_url":"https://api.github.com/users/libmir/orgs","repos_url":"https://api.github.com/users/libmir/repos","events_url":"https://api.github.com/users/libmir/events{/privacy}","received_events_url":"https://api.github.com/users/libmir/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/libmir/mir","description":"Generic Numerical Library","fork":false,"url":"https://api.github.com/repos/libmir/mir","forks_url":"https://api.github.com/repos/libmir/mir/forks","keys_url":"https://api.github.com/repos/libmir/mir/keys{/key_id}","collaborators_url":"https://api.github.com/repos/libmir/mir/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/libmir/mir/teams","hooks_url":"https://api.github.com/repos/libmir/mir/hooks","issue_events_url":"https://api.github.com/repos/libmir/mir/issues/events{/number}","events_url":"https://api.github.com/repos/libmir/mir/events","assignees_url":"https://api.github.com/repos/libmir/mir/assignees{/user}","branches_url":"https://api.github.com/repos/libmir/mir/branches{/branch}","tags_url":"https://api.github.com/repos/libmir/mir/tags","blobs_url":"https://api.github.com/repos/libmir/mir/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/libmir/mir/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/libmir/mir/git/refs{/sha}","trees_url":"https://api.github.com/repos/libmir/mir/git/trees{/sha}","statuses_url":"https://api.github.com/repos/libmir/mir/statuses/{sha}","languages_url":"https://api.github.com/repos/libmir/mir/languages","stargazers_url":"https://api.github.com/repos/libmir/mir/stargazers","contributors_url":"https://api.github.com/repos/libmir/mir/contributors","subscribers_url":"https://api.github.com/repos/libmir/mir/subscribers","subscription_url":"https://api.github.com/repos/libmir/mir/subscription","commits_url":"https://api.github.com/repos/libmir/mir/commits{/sha}","git_commits_url":"https://api.github.com/repos/libmir/mir/git/commits{/sha}","comments_url":"https://api.github.com/repos/libmir/mir/comments{/number}","issue_comment_url":"https://api.github.com/repos/libmir/mir/issues/comments{/number}","contents_url":"https://api.github.com/repos/libmir/mir/contents/{+path}","compare_url":"https://api.github.com/repos/libmir/mir/compare/{base}...{head}","merges_url":"https://api.github.com/repos/libmir/mir/merges","archive_url":"https://api.github.com/repos/libmir/mir/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/libmir/mir/downloads","issues_url":"https://api.github.com/repos/libmir/mir/issues{/number}","pulls_url":"https://api.github.com/repos/libmir/mir/pulls{/number}","milestones_url":"https://api.github.com/repos/libmir/mir/milestones{/number}","notifications_url":"https://api.github.com/repos/libmir/mir/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/libmir/mir/labels{/name}","releases_url":"https://api.github.com/repos/libmir/mir/releases{/id}","deployments_url":"https://api.github.com/repos/libmir/mir/deployments","created_at":"2015-06-13T16:59:39Z","updated_at":"2016-06-27T18:38:27Z","pushed_at":"2016-06-29T00:40:40Z","git_url":"git://github.com/libmir/mir.git","ssh_url":"git@github.com:libmir/mir.git","clone_url":"https://github.com/libmir/mir.git","svn_url":"https://github.com/libmir/mir","homepage":"http://mir.dlang.io","size":1861,"stargazers_count":34,"watchers_count":34,"language":"D","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"open_issues_count":58,"forks":9,"open_issues":58,"watchers":34,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/libmir/mir/pulls/240"},"html":{"href":"https://github.com/libmir/mir/pull/240"},"issue":{"href":"https://api.github.com/repos/libmir/mir/issues/240"},"comments":{"href":"https://api.github.com/repos/libmir/mir/issues/240/comments"},"review_comments":{"href":"https://api.github.com/repos/libmir/mir/pulls/240/comments"},"review_comment":{"href":"https://api.github.com/repos/libmir/mir/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/libmir/mir/pulls/240/commits"},"statuses":{"href":"https://api.github.com/repos/libmir/mir/statuses/b7edb973aa6f091e604476d8dd3120e72907648e"}}}}
{"actor":{"display_login":"joseph-wakeling-sociomantic"}}