{"action":"created","comment":{"url":"https://api.github.com/repos/boostorg/compute/pulls/comments/60956201","id":60956201,"diff_hunk":"@@ -40,7 +43,60 @@ distribution.generate(vec.begin(), vec.end(), engine, queue);\n \n     BOOST_CHECK_EQUAL(\n         boost::compute::count_if(\n-            vec.begin(), vec.end(), _1 < 1.0f || _1 > 100.0f, queue\n+            vec.begin(), vec.end(), _1 < 1.0f || _1 >= 100.0f, queue\n+        ),\n+        size_t(0)\n+    );\n+}\n+\n+template<class T>\n+class range_test_engine\n+{\n+public:\n+    explicit range_test_engine(boost::compute::command_queue &queue) {\n+        (void) queue;\n+    }\n+\n+    template<class OutputIterator, class Function>\n+    void generate(OutputIterator first, OutputIterator last, Function op, boost::compute::command_queue &queue)\n+    {\n+        boost::compute::vector<T> tmp(std::distance(first, last), queue.get_context());\n+\n+        BOOST_COMPUTE_FUNCTION(T, max_random, (const T x),\n+        {\n+            if(get_global_id(0) < 1)\n+                return (ValueType) MAX_RANDOM;\n+            else\n+                return (ValueType) 0;\n+        });\n+\n+        max_random.define(\"MAX_RANDOM\", \"UINT_MAX\");\n+        max_random.define(\"ValueType\", boost::compute::type_name<T>());\n+\n+        boost::compute::transform(tmp.begin(), tmp.end(), tmp.begin(), max_random, queue);\n+        boost::compute::transform(tmp.begin(), tmp.end(), first, op, queue);\n+    }\n+};\n+\n+// For checking if result is in the correct range [low, hi)\n+BOOST_AUTO_TEST_CASE(uniform_real_distribution_range)\n+{\n+    using boost::compute::lambda::_1;\n+\n+    boost::compute::vector<float> vec(32, context);\n+\n+    // initialize the range_test_engine\n+    range_test_engine<boost::compute::uint_> engine(queue);\n+\n+    // setup the uniform distribution to produce floats between 1 and 100","path":"test/test_uniform_real_distribution.cpp","position":null,"original_position":64,"commit_id":"8aea29032044072080668898ac46bc4393e13cd7","original_commit_id":"5a987feea8080e82a84bedf99944aca625c20386","user":{"login":"haahh","id":2720260,"avatar_url":"https://avatars.githubusercontent.com/u/2720260?v=3","gravatar_id":"","url":"https://api.github.com/users/haahh","html_url":"https://github.com/haahh","followers_url":"https://api.github.com/users/haahh/followers","following_url":"https://api.github.com/users/haahh/following{/other_user}","gists_url":"https://api.github.com/users/haahh/gists{/gist_id}","starred_url":"https://api.github.com/users/haahh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haahh/subscriptions","organizations_url":"https://api.github.com/users/haahh/orgs","repos_url":"https://api.github.com/users/haahh/repos","events_url":"https://api.github.com/users/haahh/events{/privacy}","received_events_url":"https://api.github.com/users/haahh/received_events","type":"User","site_admin":false},"body":"Fixed.","created_at":"2016-04-25T17:47:58Z","updated_at":"2016-04-25T17:47:58Z","html_url":"https://github.com/boostorg/compute/pull/595#discussion_r60956201","pull_request_url":"https://api.github.com/repos/boostorg/compute/pulls/595","_links":{"self":{"href":"https://api.github.com/repos/boostorg/compute/pulls/comments/60956201"},"html":{"href":"https://github.com/boostorg/compute/pull/595#discussion_r60956201"},"pull_request":{"href":"https://api.github.com/repos/boostorg/compute/pulls/595"}}},"pull_request":{"url":"https://api.github.com/repos/boostorg/compute/pulls/595","id":67646578,"html_url":"https://github.com/boostorg/compute/pull/595","diff_url":"https://github.com/boostorg/compute/pull/595.diff","patch_url":"https://github.com/boostorg/compute/pull/595.patch","issue_url":"https://api.github.com/repos/boostorg/compute/issues/595","number":595,"state":"open","locked":false,"title":"Fix uniform real distribution ","user":{"login":"haahh","id":2720260,"avatar_url":"https://avatars.githubusercontent.com/u/2720260?v=3","gravatar_id":"","url":"https://api.github.com/users/haahh","html_url":"https://github.com/haahh","followers_url":"https://api.github.com/users/haahh/followers","following_url":"https://api.github.com/users/haahh/following{/other_user}","gists_url":"https://api.github.com/users/haahh/gists{/gist_id}","starred_url":"https://api.github.com/users/haahh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haahh/subscriptions","organizations_url":"https://api.github.com/users/haahh/orgs","repos_url":"https://api.github.com/users/haahh/repos","events_url":"https://api.github.com/users/haahh/events{/privacy}","received_events_url":"https://api.github.com/users/haahh/received_events","type":"User","site_admin":false},"body":"Related to https://github.com/boostorg/compute/issues/587. \r\n\r\nNow generated floating-point values are uniformly distributed on the interval `[a, b)` and no value is greater or equal to `b`.\r\n\r\nI also added test that checks if results are in fact in `[a,b)` range (by using `range_test_engine` class that generates max random value or zeroes).","created_at":"2016-04-24T19:08:08Z","updated_at":"2016-04-25T17:47:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0843e961db5f0f01913325e782c909d5e43b8bf8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/boostorg/compute/pulls/595/commits","review_comments_url":"https://api.github.com/repos/boostorg/compute/pulls/595/comments","review_comment_url":"https://api.github.com/repos/boostorg/compute/pulls/comments{/number}","comments_url":"https://api.github.com/repos/boostorg/compute/issues/595/comments","statuses_url":"https://api.github.com/repos/boostorg/compute/statuses/8aea29032044072080668898ac46bc4393e13cd7","head":{"label":"haahh:pr_fix_uni_real_dist","ref":"pr_fix_uni_real_dist","sha":"8aea29032044072080668898ac46bc4393e13cd7","user":{"login":"haahh","id":2720260,"avatar_url":"https://avatars.githubusercontent.com/u/2720260?v=3","gravatar_id":"","url":"https://api.github.com/users/haahh","html_url":"https://github.com/haahh","followers_url":"https://api.github.com/users/haahh/followers","following_url":"https://api.github.com/users/haahh/following{/other_user}","gists_url":"https://api.github.com/users/haahh/gists{/gist_id}","starred_url":"https://api.github.com/users/haahh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haahh/subscriptions","organizations_url":"https://api.github.com/users/haahh/orgs","repos_url":"https://api.github.com/users/haahh/repos","events_url":"https://api.github.com/users/haahh/events{/privacy}","received_events_url":"https://api.github.com/users/haahh/received_events","type":"User","site_admin":false},"repo":{"id":31648019,"name":"compute","full_name":"haahh/compute","owner":{"login":"haahh","id":2720260,"avatar_url":"https://avatars.githubusercontent.com/u/2720260?v=3","gravatar_id":"","url":"https://api.github.com/users/haahh","html_url":"https://github.com/haahh","followers_url":"https://api.github.com/users/haahh/followers","following_url":"https://api.github.com/users/haahh/following{/other_user}","gists_url":"https://api.github.com/users/haahh/gists{/gist_id}","starred_url":"https://api.github.com/users/haahh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haahh/subscriptions","organizations_url":"https://api.github.com/users/haahh/orgs","repos_url":"https://api.github.com/users/haahh/repos","events_url":"https://api.github.com/users/haahh/events{/privacy}","received_events_url":"https://api.github.com/users/haahh/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/haahh/compute","description":"A C++ GPU Computing Library for OpenCL","fork":true,"url":"https://api.github.com/repos/haahh/compute","forks_url":"https://api.github.com/repos/haahh/compute/forks","keys_url":"https://api.github.com/repos/haahh/compute/keys{/key_id}","collaborators_url":"https://api.github.com/repos/haahh/compute/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/haahh/compute/teams","hooks_url":"https://api.github.com/repos/haahh/compute/hooks","issue_events_url":"https://api.github.com/repos/haahh/compute/issues/events{/number}","events_url":"https://api.github.com/repos/haahh/compute/events","assignees_url":"https://api.github.com/repos/haahh/compute/assignees{/user}","branches_url":"https://api.github.com/repos/haahh/compute/branches{/branch}","tags_url":"https://api.github.com/repos/haahh/compute/tags","blobs_url":"https://api.github.com/repos/haahh/compute/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/haahh/compute/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/haahh/compute/git/refs{/sha}","trees_url":"https://api.github.com/repos/haahh/compute/git/trees{/sha}","statuses_url":"https://api.github.com/repos/haahh/compute/statuses/{sha}","languages_url":"https://api.github.com/repos/haahh/compute/languages","stargazers_url":"https://api.github.com/repos/haahh/compute/stargazers","contributors_url":"https://api.github.com/repos/haahh/compute/contributors","subscribers_url":"https://api.github.com/repos/haahh/compute/subscribers","subscription_url":"https://api.github.com/repos/haahh/compute/subscription","commits_url":"https://api.github.com/repos/haahh/compute/commits{/sha}","git_commits_url":"https://api.github.com/repos/haahh/compute/git/commits{/sha}","comments_url":"https://api.github.com/repos/haahh/compute/comments{/number}","issue_comment_url":"https://api.github.com/repos/haahh/compute/issues/comments{/number}","contents_url":"https://api.github.com/repos/haahh/compute/contents/{+path}","compare_url":"https://api.github.com/repos/haahh/compute/compare/{base}...{head}","merges_url":"https://api.github.com/repos/haahh/compute/merges","archive_url":"https://api.github.com/repos/haahh/compute/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/haahh/compute/downloads","issues_url":"https://api.github.com/repos/haahh/compute/issues{/number}","pulls_url":"https://api.github.com/repos/haahh/compute/pulls{/number}","milestones_url":"https://api.github.com/repos/haahh/compute/milestones{/number}","notifications_url":"https://api.github.com/repos/haahh/compute/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/haahh/compute/labels{/name}","releases_url":"https://api.github.com/repos/haahh/compute/releases{/id}","deployments_url":"https://api.github.com/repos/haahh/compute/deployments","created_at":"2015-03-04T09:11:05Z","updated_at":"2016-03-09T14:14:39Z","pushed_at":"2016-04-25T17:46:55Z","git_url":"git://github.com/haahh/compute.git","ssh_url":"git@github.com:haahh/compute.git","clone_url":"https://github.com/haahh/compute.git","svn_url":"https://github.com/haahh/compute","homepage":"http://kylelutz.github.io/compute/","size":8336,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"boostorg:develop","ref":"develop","sha":"8e5151aec82e6061a58abf600edfb56c1077db5e","user":{"login":"boostorg","id":3170529,"avatar_url":"https://avatars.githubusercontent.com/u/3170529?v=3","gravatar_id":"","url":"https://api.github.com/users/boostorg","html_url":"https://github.com/boostorg","followers_url":"https://api.github.com/users/boostorg/followers","following_url":"https://api.github.com/users/boostorg/following{/other_user}","gists_url":"https://api.github.com/users/boostorg/gists{/gist_id}","starred_url":"https://api.github.com/users/boostorg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boostorg/subscriptions","organizations_url":"https://api.github.com/users/boostorg/orgs","repos_url":"https://api.github.com/users/boostorg/repos","events_url":"https://api.github.com/users/boostorg/events{/privacy}","received_events_url":"https://api.github.com/users/boostorg/received_events","type":"Organization","site_admin":false},"repo":{"id":8526347,"name":"compute","full_name":"boostorg/compute","owner":{"login":"boostorg","id":3170529,"avatar_url":"https://avatars.githubusercontent.com/u/3170529?v=3","gravatar_id":"","url":"https://api.github.com/users/boostorg","html_url":"https://github.com/boostorg","followers_url":"https://api.github.com/users/boostorg/followers","following_url":"https://api.github.com/users/boostorg/following{/other_user}","gists_url":"https://api.github.com/users/boostorg/gists{/gist_id}","starred_url":"https://api.github.com/users/boostorg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boostorg/subscriptions","organizations_url":"https://api.github.com/users/boostorg/orgs","repos_url":"https://api.github.com/users/boostorg/repos","events_url":"https://api.github.com/users/boostorg/events{/privacy}","received_events_url":"https://api.github.com/users/boostorg/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/boostorg/compute","description":"A C++ GPU Computing Library for OpenCL","fork":false,"url":"https://api.github.com/repos/boostorg/compute","forks_url":"https://api.github.com/repos/boostorg/compute/forks","keys_url":"https://api.github.com/repos/boostorg/compute/keys{/key_id}","collaborators_url":"https://api.github.com/repos/boostorg/compute/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/boostorg/compute/teams","hooks_url":"https://api.github.com/repos/boostorg/compute/hooks","issue_events_url":"https://api.github.com/repos/boostorg/compute/issues/events{/number}","events_url":"https://api.github.com/repos/boostorg/compute/events","assignees_url":"https://api.github.com/repos/boostorg/compute/assignees{/user}","branches_url":"https://api.github.com/repos/boostorg/compute/branches{/branch}","tags_url":"https://api.github.com/repos/boostorg/compute/tags","blobs_url":"https://api.github.com/repos/boostorg/compute/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/boostorg/compute/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/boostorg/compute/git/refs{/sha}","trees_url":"https://api.github.com/repos/boostorg/compute/git/trees{/sha}","statuses_url":"https://api.github.com/repos/boostorg/compute/statuses/{sha}","languages_url":"https://api.github.com/repos/boostorg/compute/languages","stargazers_url":"https://api.github.com/repos/boostorg/compute/stargazers","contributors_url":"https://api.github.com/repos/boostorg/compute/contributors","subscribers_url":"https://api.github.com/repos/boostorg/compute/subscribers","subscription_url":"https://api.github.com/repos/boostorg/compute/subscription","commits_url":"https://api.github.com/repos/boostorg/compute/commits{/sha}","git_commits_url":"https://api.github.com/repos/boostorg/compute/git/commits{/sha}","comments_url":"https://api.github.com/repos/boostorg/compute/comments{/number}","issue_comment_url":"https://api.github.com/repos/boostorg/compute/issues/comments{/number}","contents_url":"https://api.github.com/repos/boostorg/compute/contents/{+path}","compare_url":"https://api.github.com/repos/boostorg/compute/compare/{base}...{head}","merges_url":"https://api.github.com/repos/boostorg/compute/merges","archive_url":"https://api.github.com/repos/boostorg/compute/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/boostorg/compute/downloads","issues_url":"https://api.github.com/repos/boostorg/compute/issues{/number}","pulls_url":"https://api.github.com/repos/boostorg/compute/pulls{/number}","milestones_url":"https://api.github.com/repos/boostorg/compute/milestones{/number}","notifications_url":"https://api.github.com/repos/boostorg/compute/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/boostorg/compute/labels{/name}","releases_url":"https://api.github.com/repos/boostorg/compute/releases{/id}","deployments_url":"https://api.github.com/repos/boostorg/compute/deployments","created_at":"2013-03-02T20:15:58Z","updated_at":"2016-04-25T07:41:10Z","pushed_at":"2016-04-25T17:46:56Z","git_url":"git://github.com/boostorg/compute.git","ssh_url":"git@github.com:boostorg/compute.git","clone_url":"https://github.com/boostorg/compute.git","svn_url":"https://github.com/boostorg/compute","homepage":"http://boostorg.github.io/compute/","size":9343,"stargazers_count":518,"watchers_count":518,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":118,"mirror_url":null,"open_issues_count":110,"forks":118,"open_issues":110,"watchers":518,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/boostorg/compute/pulls/595"},"html":{"href":"https://github.com/boostorg/compute/pull/595"},"issue":{"href":"https://api.github.com/repos/boostorg/compute/issues/595"},"comments":{"href":"https://api.github.com/repos/boostorg/compute/issues/595/comments"},"review_comments":{"href":"https://api.github.com/repos/boostorg/compute/pulls/595/comments"},"review_comment":{"href":"https://api.github.com/repos/boostorg/compute/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/boostorg/compute/pulls/595/commits"},"statuses":{"href":"https://api.github.com/repos/boostorg/compute/statuses/8aea29032044072080668898ac46bc4393e13cd7"}}}}