{"action":"opened","number":27,"pull_request":{"url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/pulls/27","id":40150618,"html_url":"https://github.com/JuliaDiff/ForwardDiff.jl/pull/27","diff_url":"https://github.com/JuliaDiff/ForwardDiff.jl/pull/27.diff","patch_url":"https://github.com/JuliaDiff/ForwardDiff.jl/pull/27.patch","issue_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/issues/27","number":27,"state":"open","locked":false,"title":"WIP: Refactor ForwardDiff to utilize NDuals and replace API","user":{"login":"jrevels","id":3277443,"avatar_url":"https://avatars.githubusercontent.com/u/3277443?v=3","gravatar_id":"","url":"https://api.github.com/users/jrevels","html_url":"https://github.com/jrevels","followers_url":"https://api.github.com/users/jrevels/followers","following_url":"https://api.github.com/users/jrevels/following{/other_user}","gists_url":"https://api.github.com/users/jrevels/gists{/gist_id}","starred_url":"https://api.github.com/users/jrevels/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jrevels/subscriptions","organizations_url":"https://api.github.com/users/jrevels/orgs","repos_url":"https://api.github.com/users/jrevels/repos","events_url":"https://api.github.com/users/jrevels/events{/privacy}","received_events_url":"https://api.github.com/users/jrevels/received_events","type":"User","site_admin":false},"body":"This PR does a lot of stuff...likely *way* more than should fit in one PR, but I got a bit carried away with my refactor.\r\n\r\n### Changes \r\n\r\n- Removes the old, non-implemented `matrix_fad`, `powerseries_fad`, and `dual_fad` folders, and moved the contents of `typed_fad` to `src`.\r\n\r\n- Now that all the other methods (`matrix_fad`, `powerseries_fad`) are gone, the API can be simplified, so I took a crack at it. I'll be working on documentation soon, but the [exported functions list](https://github.com/JuliaDiff/ForwardDiff.jl/blob/nduals-refactor/src/ForwardDiff.jl) and [autodiff_funcs.jl](https://github.com/JuliaDiff/ForwardDiff.jl/blob/nduals-refactor/src/autodiff_funcs.jl) contain the relevant code necessary to understand my attempt.\r\n\r\n- [autodiff_funcs.jl](https://github.com/JuliaDiff/ForwardDiff.jl/blob/nduals-refactor/src/autodiff_funcs.jl) is essentially a port and extension of the work from [AutoDiffJSoC.jl](https://github.com/jrevels/AutoDiffJSoC.jl), sans testing and benchmarks, and with some other optimizations. Notably, it makes more use of my \"generated function closure caching trick (TM)\" in order to speed up/reuse memory when repeatedly using the same NDuals type to take the gradient/Hessian/etc. This technique has the potential to dangerously behave like a memory leak in a specific edge case (read the code comments), but I can't imagine a user ever reaching that case in a real world situation.\r\n\r\n- Refactors `FADHessian` and `FADTensor` to utilize NDuals.jl, thereby allowing the removal of `GraDual` and dependence on DualNumbers.jl.\r\n\r\n- Bumps up the required Julia version from v0.3 to v0.4, which is required for NDuals.jl.\r\n\r\n- Major refactor of FADHessian.jl and FADTensor.jl:\r\n    - Improved readability by lengthening some single-character variable names\r\n    - Drastically reduced duplicate code by utilizing code generation (the [relevant commit](https://github.com/JuliaDiff/ForwardDiff.jl/commit/b65a0f02d0a593a5ebce35f169b21797a85677e2) gets rid of almost 1000 lines of code)\r\n    - Unified the code/behavior shared between the `FADTensor` and `FADHessian` types under a new supertype, `FADNumber <: Number`.\r\n    - Replaced all the `.`-based accesses that plagued the old implementation with consistent calls to proper accessor methods .\r\n    - Removed temporary array usage where possible, cut down on repetitive array accesses, and rewrote loops to be more concise.\r\n\r\n- On top of flipping everything else on its head, I switched to using 4 spaces for indents instead of 2. This is just my preference - I think it reads better and it fits Julia’s contributing guidelines for Base (which we obviously don’t have to follow, but it’s nice to fit in).\r\n\r\n### Still in progress\r\n\r\n- [ ] Tests for `F<:FADNumber` types\r\n- [ ] Tests for new API (`gradient`/`gradient!`/`gradient_func`, `hessian`/`hessian!`/`hessian_func`, etc.)\r\n- [ ] Documentation to correspond to new API\r\n- [ ] Add Coveralls.io support\r\n\r\n\r\n","created_at":"2015-07-16T16:49:27Z","updated_at":"2015-07-16T16:49:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/pulls/27/commits","review_comments_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/pulls/27/comments","review_comment_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/pulls/comments{/number}","comments_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/issues/27/comments","statuses_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/statuses/77684845d8bb17674f98d15b813db014d564a1a2","head":{"label":"JuliaDiff:nduals-refactor","ref":"nduals-refactor","sha":"77684845d8bb17674f98d15b813db014d564a1a2","user":{"login":"JuliaDiff","id":7750915,"avatar_url":"https://avatars.githubusercontent.com/u/7750915?v=3","gravatar_id":"","url":"https://api.github.com/users/JuliaDiff","html_url":"https://github.com/JuliaDiff","followers_url":"https://api.github.com/users/JuliaDiff/followers","following_url":"https://api.github.com/users/JuliaDiff/following{/other_user}","gists_url":"https://api.github.com/users/JuliaDiff/gists{/gist_id}","starred_url":"https://api.github.com/users/JuliaDiff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JuliaDiff/subscriptions","organizations_url":"https://api.github.com/users/JuliaDiff/orgs","repos_url":"https://api.github.com/users/JuliaDiff/repos","events_url":"https://api.github.com/users/JuliaDiff/events{/privacy}","received_events_url":"https://api.github.com/users/JuliaDiff/received_events","type":"Organization","site_admin":false},"repo":{"id":9411959,"name":"ForwardDiff.jl","full_name":"JuliaDiff/ForwardDiff.jl","owner":{"login":"JuliaDiff","id":7750915,"avatar_url":"https://avatars.githubusercontent.com/u/7750915?v=3","gravatar_id":"","url":"https://api.github.com/users/JuliaDiff","html_url":"https://github.com/JuliaDiff","followers_url":"https://api.github.com/users/JuliaDiff/followers","following_url":"https://api.github.com/users/JuliaDiff/following{/other_user}","gists_url":"https://api.github.com/users/JuliaDiff/gists{/gist_id}","starred_url":"https://api.github.com/users/JuliaDiff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JuliaDiff/subscriptions","organizations_url":"https://api.github.com/users/JuliaDiff/orgs","repos_url":"https://api.github.com/users/JuliaDiff/repos","events_url":"https://api.github.com/users/JuliaDiff/events{/privacy}","received_events_url":"https://api.github.com/users/JuliaDiff/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/JuliaDiff/ForwardDiff.jl","description":"Julia package for performing forward mode automatic differentiation","fork":false,"url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl","forks_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/forks","keys_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/teams","hooks_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/hooks","issue_events_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/issues/events{/number}","events_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/events","assignees_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/assignees{/user}","branches_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/branches{/branch}","tags_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/tags","blobs_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/git/refs{/sha}","trees_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/statuses/{sha}","languages_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/languages","stargazers_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/stargazers","contributors_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/contributors","subscribers_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/subscribers","subscription_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/subscription","commits_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/commits{/sha}","git_commits_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/git/commits{/sha}","comments_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/comments{/number}","issue_comment_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/issues/comments{/number}","contents_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/contents/{+path}","compare_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/merges","archive_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/downloads","issues_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/issues{/number}","pulls_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/pulls{/number}","milestones_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/milestones{/number}","notifications_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/labels{/name}","releases_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/releases{/id}","created_at":"2013-04-13T10:19:04Z","updated_at":"2015-07-16T00:54:24Z","pushed_at":"2015-07-16T15:44:38Z","git_url":"git://github.com/JuliaDiff/ForwardDiff.jl.git","ssh_url":"git@github.com:JuliaDiff/ForwardDiff.jl.git","clone_url":"https://github.com/JuliaDiff/ForwardDiff.jl.git","svn_url":"https://github.com/JuliaDiff/ForwardDiff.jl","homepage":"","size":783,"stargazers_count":23,"watchers_count":23,"language":"Julia","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":3,"forks":4,"open_issues":3,"watchers":23,"default_branch":"master"}},"base":{"label":"JuliaDiff:master","ref":"master","sha":"524a2f139e87848156c273f1a56910d2d0175d35","user":{"login":"JuliaDiff","id":7750915,"avatar_url":"https://avatars.githubusercontent.com/u/7750915?v=3","gravatar_id":"","url":"https://api.github.com/users/JuliaDiff","html_url":"https://github.com/JuliaDiff","followers_url":"https://api.github.com/users/JuliaDiff/followers","following_url":"https://api.github.com/users/JuliaDiff/following{/other_user}","gists_url":"https://api.github.com/users/JuliaDiff/gists{/gist_id}","starred_url":"https://api.github.com/users/JuliaDiff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JuliaDiff/subscriptions","organizations_url":"https://api.github.com/users/JuliaDiff/orgs","repos_url":"https://api.github.com/users/JuliaDiff/repos","events_url":"https://api.github.com/users/JuliaDiff/events{/privacy}","received_events_url":"https://api.github.com/users/JuliaDiff/received_events","type":"Organization","site_admin":false},"repo":{"id":9411959,"name":"ForwardDiff.jl","full_name":"JuliaDiff/ForwardDiff.jl","owner":{"login":"JuliaDiff","id":7750915,"avatar_url":"https://avatars.githubusercontent.com/u/7750915?v=3","gravatar_id":"","url":"https://api.github.com/users/JuliaDiff","html_url":"https://github.com/JuliaDiff","followers_url":"https://api.github.com/users/JuliaDiff/followers","following_url":"https://api.github.com/users/JuliaDiff/following{/other_user}","gists_url":"https://api.github.com/users/JuliaDiff/gists{/gist_id}","starred_url":"https://api.github.com/users/JuliaDiff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JuliaDiff/subscriptions","organizations_url":"https://api.github.com/users/JuliaDiff/orgs","repos_url":"https://api.github.com/users/JuliaDiff/repos","events_url":"https://api.github.com/users/JuliaDiff/events{/privacy}","received_events_url":"https://api.github.com/users/JuliaDiff/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/JuliaDiff/ForwardDiff.jl","description":"Julia package for performing forward mode automatic differentiation","fork":false,"url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl","forks_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/forks","keys_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/teams","hooks_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/hooks","issue_events_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/issues/events{/number}","events_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/events","assignees_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/assignees{/user}","branches_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/branches{/branch}","tags_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/tags","blobs_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/git/refs{/sha}","trees_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/statuses/{sha}","languages_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/languages","stargazers_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/stargazers","contributors_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/contributors","subscribers_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/subscribers","subscription_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/subscription","commits_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/commits{/sha}","git_commits_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/git/commits{/sha}","comments_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/comments{/number}","issue_comment_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/issues/comments{/number}","contents_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/contents/{+path}","compare_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/merges","archive_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/downloads","issues_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/issues{/number}","pulls_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/pulls{/number}","milestones_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/milestones{/number}","notifications_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/labels{/name}","releases_url":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/releases{/id}","created_at":"2013-04-13T10:19:04Z","updated_at":"2015-07-16T00:54:24Z","pushed_at":"2015-07-16T15:44:38Z","git_url":"git://github.com/JuliaDiff/ForwardDiff.jl.git","ssh_url":"git@github.com:JuliaDiff/ForwardDiff.jl.git","clone_url":"https://github.com/JuliaDiff/ForwardDiff.jl.git","svn_url":"https://github.com/JuliaDiff/ForwardDiff.jl","homepage":"","size":783,"stargazers_count":23,"watchers_count":23,"language":"Julia","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":3,"forks":4,"open_issues":3,"watchers":23,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/pulls/27"},"html":{"href":"https://github.com/JuliaDiff/ForwardDiff.jl/pull/27"},"issue":{"href":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/issues/27"},"comments":{"href":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/issues/27/comments"},"review_comments":{"href":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/pulls/27/comments"},"review_comment":{"href":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/pulls/27/commits"},"statuses":{"href":"https://api.github.com/repos/JuliaDiff/ForwardDiff.jl/statuses/77684845d8bb17674f98d15b813db014d564a1a2"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":8,"additions":845,"deletions":1451,"changed_files":15}}