{"action":"created","issue":{"url":"https://api.github.com/repos/stan-dev/math/issues/605","repository_url":"https://api.github.com/repos/stan-dev/math","labels_url":"https://api.github.com/repos/stan-dev/math/issues/605/labels{/name}","comments_url":"https://api.github.com/repos/stan-dev/math/issues/605/comments","events_url":"https://api.github.com/repos/stan-dev/math/issues/605/events","html_url":"https://github.com/stan-dev/math/pull/605","id":251528646,"number":605,"title":"Vectorize rngs (Issue 45)","user":{"login":"bbbales2","id":4742424,"avatar_url":"https://avatars1.githubusercontent.com/u/4742424?v=4","gravatar_id":"","url":"https://api.github.com/users/bbbales2","html_url":"https://github.com/bbbales2","followers_url":"https://api.github.com/users/bbbales2/followers","following_url":"https://api.github.com/users/bbbales2/following{/other_user}","gists_url":"https://api.github.com/users/bbbales2/gists{/gist_id}","starred_url":"https://api.github.com/users/bbbales2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bbbales2/subscriptions","organizations_url":"https://api.github.com/users/bbbales2/orgs","repos_url":"https://api.github.com/users/bbbales2/repos","events_url":"https://api.github.com/users/bbbales2/events{/privacy}","received_events_url":"https://api.github.com/users/bbbales2/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":30,"created_at":"2017-08-21T01:19:42Z","updated_at":"2017-09-06T22:51:17Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/stan-dev/math/pulls/605","html_url":"https://github.com/stan-dev/math/pull/605","diff_url":"https://github.com/stan-dev/math/pull/605.diff","patch_url":"https://github.com/stan-dev/math/pull/605.patch"},"body":"#### Submission Checklist\r\n\r\n- [x] Run unit tests: `./runTests.py test/unit`\r\n- [x] Run cpplint: `make cpplint`\r\n- [x] Declare copyright holder and open-source license: see below\r\n\r\n#### Summary:\r\n\r\nThis picks up from where #578 (now closed) left off. Made a new pull to simplify the code.\r\n\r\nThis attempts to address: #45 (Vectorize rngs)\r\n\r\nI used a tiny amount of C++11. I noticed it's in the makefiles. I can work around that if necessary.\r\n\r\nI added a bunch of code to generalize the vectorized tests so it'll be easy to expand this to the other distributions. Check https://github.com/bbbales2/math/blob/cf77cba6221e8cd2db701a5563383623daa103b0/test/unit/math/prim/mat/prob/normal_test.cpp for the use.\r\n\r\n```twoParamDistCheckThrowsAllTypes``` and ```chiSquareTestAllTypes``` are the two big entry points. Maybe not named the best but oh well for now I guess.\r\n\r\nThe new testing functions automatically generate simple sets of parameters that satisfy the necessary constraints (Positive, NonNegative, or None) and validate these with the _rngs and combinations of all the different vector types.\r\n\r\nWhat has to be provided is a callable that wraps the _rng function and a callable that generates quantiles that will be used to validate sets of randomly generated numbers. I'd have to add stuff for 1 and 3 argument functions, and it'd have to change to discrete things as well, but it's a start.\r\n\r\nNow that I think about it, it might be better to make it where the parameters are generated by parameter generating callables that are passed in. But this way is simpler.\r\n\r\n#### How to Verify:\r\n\r\n```\r\n./runTests.py test/unit/math/prim/scal/prob/normal_test.cpp\r\n./runTests.py test/unit/math/prim/mat/prob/normal_test.cpp\r\n```\r\n\r\n#### Side Effects:\r\n\r\nHopefully none\r\n\r\n#### Documentation:\r\n\r\nDocs are inline in Doxygen (though I'm not sure Doxygen actually generates docs from test headers)\r\n\r\n#### Copyright and Licensing\r\n\r\nPlease list the copyright holder for the work you are submitting (this will be you or your assignee, such as a university or company): University of California, Santa Barbara\r\n\r\nBy submitting this pull request, the copyright holder is agreeing to license the submitted work under the following licenses:\r\n- Code: BSD 3-clause (https://opensource.org/licenses/BSD-3-Clause)\r\n- Documentation: CC-BY 4.0 (https://creativecommons.org/licenses/by/4.0/)\r\n"},"comment":{"url":"https://api.github.com/repos/stan-dev/math/issues/comments/327633502","html_url":"https://github.com/stan-dev/math/pull/605#issuecomment-327633502","issue_url":"https://api.github.com/repos/stan-dev/math/issues/605","id":327633502,"user":{"login":"seantalts","id":805356,"avatar_url":"https://avatars1.githubusercontent.com/u/805356?v=4","gravatar_id":"","url":"https://api.github.com/users/seantalts","html_url":"https://github.com/seantalts","followers_url":"https://api.github.com/users/seantalts/followers","following_url":"https://api.github.com/users/seantalts/following{/other_user}","gists_url":"https://api.github.com/users/seantalts/gists{/gist_id}","starred_url":"https://api.github.com/users/seantalts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seantalts/subscriptions","organizations_url":"https://api.github.com/users/seantalts/orgs","repos_url":"https://api.github.com/users/seantalts/repos","events_url":"https://api.github.com/users/seantalts/events{/privacy}","received_events_url":"https://api.github.com/users/seantalts/received_events","type":"User","site_admin":false},"created_at":"2017-09-06T22:51:17Z","updated_at":"2017-09-06T22:51:17Z","author_association":"OWNER","body":"Are you signed into travis through github? Should show a cancel build button near the top right of the page you get when you click \"Details\" below."}}
{"actor":{"display_login":"seantalts"}}