{"action":"created","comment":{"url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/pulls/comments/208097287","pull_request_review_id":143837860,"id":208097287,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwODA5NzI4Nw==","diff_hunk":"@@ -45,18 +48,41 @@ double velocity_verlet(double pos, double acc, double dt) {\n     vel += acc * dt;\n   }\n \n-  return time;\n+  return std::make_pair(time, vel);\n }\n \n int main() {\n+  double time, vel;\n+  vpair time_vel_pair;\n+\n+  std::cout << std::fixed << std::setprecision(8);\n+\n+  // Note that depending on the simulation, you might want to have the\n+  // Verlet loop outside.\n+\n+  // For example, if your acceleration chages as a function of time,\n+  // you might need to also change the acceleration to be read into\n+  // each of these functions.\n+\n+  time = verlet(5.0, -10, 0.01);\n+  std::cout << \"Time for Verlet integration is: \" \\\n+            << time << std::endl;\n+\n+  time_vel_pair = stormer_verlet(5.0, -10, 0.01);\n+  time = time_vel_pair.first;\n+  vel = time_vel_pair.second;\n+  std::cout << \"Time for Stormer Verlet integration is: \" \\\n+            << time << std::endl;\n+  std::cout << \"Velocity for Stormer Verlet integration is: \" \\\n+            << vel << std::endl;\n \n-  // Note that depending on the simulation, you might want to have the verlet\n-  // loop outside.\n+  time_vel_pair = velocity_verlet(5.0, -10, 0.01);","path":"contents/verlet_integration/code/c++/verlet.cpp","position":75,"original_position":75,"commit_id":"10ebadfe7a1500b79b9f320dec9f4b00bd769e73","original_commit_id":"10ebadfe7a1500b79b9f320dec9f4b00bd769e73","user":{"login":"antonte","id":1877406,"node_id":"MDQ6VXNlcjE4Nzc0MDY=","avatar_url":"https://avatars0.githubusercontent.com/u/1877406?v=4","gravatar_id":"","url":"https://api.github.com/users/antonte","html_url":"https://github.com/antonte","followers_url":"https://api.github.com/users/antonte/followers","following_url":"https://api.github.com/users/antonte/following{/other_user}","gists_url":"https://api.github.com/users/antonte/gists{/gist_id}","starred_url":"https://api.github.com/users/antonte/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/antonte/subscriptions","organizations_url":"https://api.github.com/users/antonte/orgs","repos_url":"https://api.github.com/users/antonte/repos","events_url":"https://api.github.com/users/antonte/events{/privacy}","received_events_url":"https://api.github.com/users/antonte/received_events","type":"User","site_admin":false},"body":"you can use [```std::tie```](https://en.cppreference.com/w/cpp/utility/tuple/tie)","created_at":"2018-08-07T04:43:49Z","updated_at":"2018-08-07T04:47:47Z","html_url":"https://github.com/algorithm-archivists/algorithm-archive/pull/299#discussion_r208097287","pull_request_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/pulls/299","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/pulls/comments/208097287"},"html":{"href":"https://github.com/algorithm-archivists/algorithm-archive/pull/299#discussion_r208097287"},"pull_request":{"href":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/pulls/299"}}},"pull_request":{"url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/pulls/299","id":203623276,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAzNjIzMjc2","html_url":"https://github.com/algorithm-archivists/algorithm-archive/pull/299","diff_url":"https://github.com/algorithm-archivists/algorithm-archive/pull/299.diff","patch_url":"https://github.com/algorithm-archivists/algorithm-archive/pull/299.patch","issue_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/issues/299","number":299,"state":"open","locked":false,"title":"Update C++ implementations for Verlet algorithms","user":{"login":"berquist","id":727571,"node_id":"MDQ6VXNlcjcyNzU3MQ==","avatar_url":"https://avatars2.githubusercontent.com/u/727571?v=4","gravatar_id":"","url":"https://api.github.com/users/berquist","html_url":"https://github.com/berquist","followers_url":"https://api.github.com/users/berquist/followers","following_url":"https://api.github.com/users/berquist/following{/other_user}","gists_url":"https://api.github.com/users/berquist/gists{/gist_id}","starred_url":"https://api.github.com/users/berquist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/berquist/subscriptions","organizations_url":"https://api.github.com/users/berquist/orgs","repos_url":"https://api.github.com/users/berquist/repos","events_url":"https://api.github.com/users/berquist/events{/privacy}","received_events_url":"https://api.github.com/users/berquist/received_events","type":"User","site_admin":false},"body":"Done according to https://github.com/algorithm-archivists/algorithm-archive/issues/257.","created_at":"2018-07-24T18:58:52Z","updated_at":"2018-08-07T04:47:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8c37cc92f29be82df31b7caca40c3d4d348fefb7","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":917135413,"node_id":"MDU6TGFiZWw5MTcxMzU0MTM=","url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/labels/Implementation%20Edit","name":"Implementation Edit","color":"09b0e2","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/pulls/299/commits","review_comments_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/pulls/299/comments","review_comment_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/pulls/comments{/number}","comments_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/issues/299/comments","statuses_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/statuses/10ebadfe7a1500b79b9f320dec9f4b00bd769e73","head":{"label":"berquist:verlet-cpp","ref":"verlet-cpp","sha":"10ebadfe7a1500b79b9f320dec9f4b00bd769e73","user":{"login":"berquist","id":727571,"node_id":"MDQ6VXNlcjcyNzU3MQ==","avatar_url":"https://avatars2.githubusercontent.com/u/727571?v=4","gravatar_id":"","url":"https://api.github.com/users/berquist","html_url":"https://github.com/berquist","followers_url":"https://api.github.com/users/berquist/followers","following_url":"https://api.github.com/users/berquist/following{/other_user}","gists_url":"https://api.github.com/users/berquist/gists{/gist_id}","starred_url":"https://api.github.com/users/berquist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/berquist/subscriptions","organizations_url":"https://api.github.com/users/berquist/orgs","repos_url":"https://api.github.com/users/berquist/repos","events_url":"https://api.github.com/users/berquist/events{/privacy}","received_events_url":"https://api.github.com/users/berquist/received_events","type":"User","site_admin":false},"repo":{"id":141437864,"node_id":"MDEwOlJlcG9zaXRvcnkxNDE0Mzc4NjQ=","name":"algorithm-archive","full_name":"berquist/algorithm-archive","owner":{"login":"berquist","id":727571,"node_id":"MDQ6VXNlcjcyNzU3MQ==","avatar_url":"https://avatars2.githubusercontent.com/u/727571?v=4","gravatar_id":"","url":"https://api.github.com/users/berquist","html_url":"https://github.com/berquist","followers_url":"https://api.github.com/users/berquist/followers","following_url":"https://api.github.com/users/berquist/following{/other_user}","gists_url":"https://api.github.com/users/berquist/gists{/gist_id}","starred_url":"https://api.github.com/users/berquist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/berquist/subscriptions","organizations_url":"https://api.github.com/users/berquist/orgs","repos_url":"https://api.github.com/users/berquist/repos","events_url":"https://api.github.com/users/berquist/events{/privacy}","received_events_url":"https://api.github.com/users/berquist/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/berquist/algorithm-archive","description":"A collaborative book on algorithms","fork":true,"url":"https://api.github.com/repos/berquist/algorithm-archive","forks_url":"https://api.github.com/repos/berquist/algorithm-archive/forks","keys_url":"https://api.github.com/repos/berquist/algorithm-archive/keys{/key_id}","collaborators_url":"https://api.github.com/repos/berquist/algorithm-archive/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/berquist/algorithm-archive/teams","hooks_url":"https://api.github.com/repos/berquist/algorithm-archive/hooks","issue_events_url":"https://api.github.com/repos/berquist/algorithm-archive/issues/events{/number}","events_url":"https://api.github.com/repos/berquist/algorithm-archive/events","assignees_url":"https://api.github.com/repos/berquist/algorithm-archive/assignees{/user}","branches_url":"https://api.github.com/repos/berquist/algorithm-archive/branches{/branch}","tags_url":"https://api.github.com/repos/berquist/algorithm-archive/tags","blobs_url":"https://api.github.com/repos/berquist/algorithm-archive/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/berquist/algorithm-archive/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/berquist/algorithm-archive/git/refs{/sha}","trees_url":"https://api.github.com/repos/berquist/algorithm-archive/git/trees{/sha}","statuses_url":"https://api.github.com/repos/berquist/algorithm-archive/statuses/{sha}","languages_url":"https://api.github.com/repos/berquist/algorithm-archive/languages","stargazers_url":"https://api.github.com/repos/berquist/algorithm-archive/stargazers","contributors_url":"https://api.github.com/repos/berquist/algorithm-archive/contributors","subscribers_url":"https://api.github.com/repos/berquist/algorithm-archive/subscribers","subscription_url":"https://api.github.com/repos/berquist/algorithm-archive/subscription","commits_url":"https://api.github.com/repos/berquist/algorithm-archive/commits{/sha}","git_commits_url":"https://api.github.com/repos/berquist/algorithm-archive/git/commits{/sha}","comments_url":"https://api.github.com/repos/berquist/algorithm-archive/comments{/number}","issue_comment_url":"https://api.github.com/repos/berquist/algorithm-archive/issues/comments{/number}","contents_url":"https://api.github.com/repos/berquist/algorithm-archive/contents/{+path}","compare_url":"https://api.github.com/repos/berquist/algorithm-archive/compare/{base}...{head}","merges_url":"https://api.github.com/repos/berquist/algorithm-archive/merges","archive_url":"https://api.github.com/repos/berquist/algorithm-archive/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/berquist/algorithm-archive/downloads","issues_url":"https://api.github.com/repos/berquist/algorithm-archive/issues{/number}","pulls_url":"https://api.github.com/repos/berquist/algorithm-archive/pulls{/number}","milestones_url":"https://api.github.com/repos/berquist/algorithm-archive/milestones{/number}","notifications_url":"https://api.github.com/repos/berquist/algorithm-archive/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/berquist/algorithm-archive/labels{/name}","releases_url":"https://api.github.com/repos/berquist/algorithm-archive/releases{/id}","deployments_url":"https://api.github.com/repos/berquist/algorithm-archive/deployments","created_at":"2018-07-18T13:22:29Z","updated_at":"2018-08-06T21:59:14Z","pushed_at":"2018-08-06T21:59:12Z","git_url":"git://github.com/berquist/algorithm-archive.git","ssh_url":"git@github.com:berquist/algorithm-archive.git","clone_url":"https://github.com/berquist/algorithm-archive.git","svn_url":"https://github.com/berquist/algorithm-archive","homepage":"https://www.algorithm-archive.org","size":8617,"stargazers_count":0,"watchers_count":0,"language":"C","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":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"algorithm-archivists:master","ref":"master","sha":"f5060a3bbf4b34249099466c4d4aa4040378e154","user":{"login":"algorithm-archivists","id":38796691,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM4Nzk2Njkx","avatar_url":"https://avatars2.githubusercontent.com/u/38796691?v=4","gravatar_id":"","url":"https://api.github.com/users/algorithm-archivists","html_url":"https://github.com/algorithm-archivists","followers_url":"https://api.github.com/users/algorithm-archivists/followers","following_url":"https://api.github.com/users/algorithm-archivists/following{/other_user}","gists_url":"https://api.github.com/users/algorithm-archivists/gists{/gist_id}","starred_url":"https://api.github.com/users/algorithm-archivists/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/algorithm-archivists/subscriptions","organizations_url":"https://api.github.com/users/algorithm-archivists/orgs","repos_url":"https://api.github.com/users/algorithm-archivists/repos","events_url":"https://api.github.com/users/algorithm-archivists/events{/privacy}","received_events_url":"https://api.github.com/users/algorithm-archivists/received_events","type":"Organization","site_admin":false},"repo":{"id":81649789,"node_id":"MDEwOlJlcG9zaXRvcnk4MTY0OTc4OQ==","name":"algorithm-archive","full_name":"algorithm-archivists/algorithm-archive","owner":{"login":"algorithm-archivists","id":38796691,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM4Nzk2Njkx","avatar_url":"https://avatars2.githubusercontent.com/u/38796691?v=4","gravatar_id":"","url":"https://api.github.com/users/algorithm-archivists","html_url":"https://github.com/algorithm-archivists","followers_url":"https://api.github.com/users/algorithm-archivists/followers","following_url":"https://api.github.com/users/algorithm-archivists/following{/other_user}","gists_url":"https://api.github.com/users/algorithm-archivists/gists{/gist_id}","starred_url":"https://api.github.com/users/algorithm-archivists/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/algorithm-archivists/subscriptions","organizations_url":"https://api.github.com/users/algorithm-archivists/orgs","repos_url":"https://api.github.com/users/algorithm-archivists/repos","events_url":"https://api.github.com/users/algorithm-archivists/events{/privacy}","received_events_url":"https://api.github.com/users/algorithm-archivists/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/algorithm-archivists/algorithm-archive","description":"A collaborative book on algorithms","fork":false,"url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive","forks_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/forks","keys_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/keys{/key_id}","collaborators_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/teams","hooks_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/hooks","issue_events_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/issues/events{/number}","events_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/events","assignees_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/assignees{/user}","branches_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/branches{/branch}","tags_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/tags","blobs_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/git/refs{/sha}","trees_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/git/trees{/sha}","statuses_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/statuses/{sha}","languages_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/languages","stargazers_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/stargazers","contributors_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/contributors","subscribers_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/subscribers","subscription_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/subscription","commits_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/commits{/sha}","git_commits_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/git/commits{/sha}","comments_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/comments{/number}","issue_comment_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/issues/comments{/number}","contents_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/contents/{+path}","compare_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/compare/{base}...{head}","merges_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/merges","archive_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/downloads","issues_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/issues{/number}","pulls_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/pulls{/number}","milestones_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/milestones{/number}","notifications_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/labels{/name}","releases_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/releases{/id}","deployments_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/deployments","created_at":"2017-02-11T11:52:40Z","updated_at":"2018-08-07T04:33:55Z","pushed_at":"2018-08-07T04:31:39Z","git_url":"git://github.com/algorithm-archivists/algorithm-archive.git","ssh_url":"git@github.com:algorithm-archivists/algorithm-archive.git","clone_url":"https://github.com/algorithm-archivists/algorithm-archive.git","svn_url":"https://github.com/algorithm-archivists/algorithm-archive","homepage":"https://www.algorithm-archive.org","size":8611,"stargazers_count":454,"watchers_count":454,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":117,"mirror_url":null,"archived":false,"open_issues_count":38,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":117,"open_issues":38,"watchers":454,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/pulls/299"},"html":{"href":"https://github.com/algorithm-archivists/algorithm-archive/pull/299"},"issue":{"href":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/issues/299"},"comments":{"href":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/issues/299/comments"},"review_comments":{"href":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/pulls/299/comments"},"review_comment":{"href":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/pulls/299/commits"},"statuses":{"href":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/statuses/10ebadfe7a1500b79b9f320dec9f4b00bd769e73"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"antonte"}}