{"action":"created","comment":{"url":"https://api.github.com/repos/SciRuby/nmatrix/pulls/comments/27404830","id":27404830,"diff_hunk":"@@ -434,7 +490,7 @@ def complex_conjugate(new_stype = self.stype)\n   # == Options\n   # \n   # * +:for_sample_data+ - Default true. If set to false will consider the denominator for\n-  #   population data (i.e. N-1).\n+  #   population data (i.e. N, as opposed to N-1 for sample data).","path":"lib/nmatrix/math.rb","position":94,"original_position":94,"commit_id":"3b6cde0c3b82f08535fb5a6de96ac56057f2ab16","original_commit_id":"3b6cde0c3b82f08535fb5a6de96ac56057f2ab16","user":{"login":"cjfuller","id":812847,"avatar_url":"https://avatars.githubusercontent.com/u/812847?v=3","gravatar_id":"","url":"https://api.github.com/users/cjfuller","html_url":"https://github.com/cjfuller","followers_url":"https://api.github.com/users/cjfuller/followers","following_url":"https://api.github.com/users/cjfuller/following{/other_user}","gists_url":"https://api.github.com/users/cjfuller/gists{/gist_id}","starred_url":"https://api.github.com/users/cjfuller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cjfuller/subscriptions","organizations_url":"https://api.github.com/users/cjfuller/orgs","repos_url":"https://api.github.com/users/cjfuller/repos","events_url":"https://api.github.com/users/cjfuller/events{/privacy}","received_events_url":"https://api.github.com/users/cjfuller/received_events","type":"User","site_admin":false},"body":"Don't worry about this for the current PR, but for the future, please don't include changes (even to docs or whitespace) unrelated to the topic of the PR; it makes it harder to review the diff.","created_at":"2015-03-30T16:13:45Z","updated_at":"2015-03-30T16:13:45Z","html_url":"https://github.com/SciRuby/nmatrix/pull/346#discussion_r27404830","pull_request_url":"https://api.github.com/repos/SciRuby/nmatrix/pulls/346","_links":{"self":{"href":"https://api.github.com/repos/SciRuby/nmatrix/pulls/comments/27404830"},"html":{"href":"https://github.com/SciRuby/nmatrix/pull/346#discussion_r27404830"},"pull_request":{"href":"https://api.github.com/repos/SciRuby/nmatrix/pulls/346"}}},"pull_request":{"url":"https://api.github.com/repos/SciRuby/nmatrix/pulls/346","id":32192603,"html_url":"https://github.com/SciRuby/nmatrix/pull/346","diff_url":"https://github.com/SciRuby/nmatrix/pull/346.diff","patch_url":"https://github.com/SciRuby/nmatrix/pull/346.patch","issue_url":"https://api.github.com/repos/SciRuby/nmatrix/issues/346","number":346,"state":"open","locked":false,"title":"make #permute_columns more intuitive to use","user":{"login":"agisga","id":11449372,"avatar_url":"https://avatars.githubusercontent.com/u/11449372?v=3","gravatar_id":"","url":"https://api.github.com/users/agisga","html_url":"https://github.com/agisga","followers_url":"https://api.github.com/users/agisga/followers","following_url":"https://api.github.com/users/agisga/following{/other_user}","gists_url":"https://api.github.com/users/agisga/gists{/gist_id}","starred_url":"https://api.github.com/users/agisga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agisga/subscriptions","organizations_url":"https://api.github.com/users/agisga/orgs","repos_url":"https://api.github.com/users/agisga/repos","events_url":"https://api.github.com/users/agisga/events{/privacy}","received_events_url":"https://api.github.com/users/agisga/received_events","type":"User","site_admin":false},"body":"While discussing my pull request https://github.com/SciRuby/nmatrix/pull/336 with @cjfuller, I got surprised by the behaviour of `#permute_columns`, which is very inconvenient for everybody who is used to Matlab or R (and I think that this surprising behaviour is also not explicitly documented).\r\n\r\nAssume we have a matrix consisting of five columns *a0, a1, a2, a3, a4*, and assume that we want to reorder them as *a2, a0, a3, a4, a1*.\r\nIn *Matlab* or *R* we could easily supply the new column order *(3, 1, 4, 5, 2)* as the column index in order to get the desired column permutation.\r\nWith the current version of *NMatrix* however, we have to supply the array `[2, 2, 3, 4, 4]` as input to the method `#permute_columns` (additionally, the permutation array is not unique), because the permutation array represents a sequence of pair-wise permutations which are performed successively.\r\n\r\nA lot of times in scientific computation, one needs to reorder the columns of a matrix in a specific order. It seems very inconvenient having to sit down with a pen and a piece of paper in order to figure out the sequence of successive pair-wise permutations. \r\n\r\nAs suggested by @cjfuller I added an option `:convention` to the method which can either be set to `:lapack` or `:intuitive` (`:lapack` is the default for back compatibility). \r\n\r\nThat is, in the example from above we would use the permutation vector `[2, 0, 3, 4, 1]` and set `:convention` to `:intuitive` in order to get the desired reordering *a2, a0, a3, a4, a1*.\r\n\r\nI explain my implementation of the `:intuitive` option in more detail in a blog post http://agisga.github.io/Permute-Columns-Of-An-NMatrix/\r\n","created_at":"2015-03-30T01:23:03Z","updated_at":"2015-03-30T16:13:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2fef2ac3cd4a1900be1ca28280ce65c584bb2eb4","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/SciRuby/nmatrix/pulls/346/commits","review_comments_url":"https://api.github.com/repos/SciRuby/nmatrix/pulls/346/comments","review_comment_url":"https://api.github.com/repos/SciRuby/nmatrix/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SciRuby/nmatrix/issues/346/comments","statuses_url":"https://api.github.com/repos/SciRuby/nmatrix/statuses/3b6cde0c3b82f08535fb5a6de96ac56057f2ab16","head":{"label":"agisga:permute_columns","ref":"permute_columns","sha":"3b6cde0c3b82f08535fb5a6de96ac56057f2ab16","user":{"login":"agisga","id":11449372,"avatar_url":"https://avatars.githubusercontent.com/u/11449372?v=3","gravatar_id":"","url":"https://api.github.com/users/agisga","html_url":"https://github.com/agisga","followers_url":"https://api.github.com/users/agisga/followers","following_url":"https://api.github.com/users/agisga/following{/other_user}","gists_url":"https://api.github.com/users/agisga/gists{/gist_id}","starred_url":"https://api.github.com/users/agisga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agisga/subscriptions","organizations_url":"https://api.github.com/users/agisga/orgs","repos_url":"https://api.github.com/users/agisga/repos","events_url":"https://api.github.com/users/agisga/events{/privacy}","received_events_url":"https://api.github.com/users/agisga/received_events","type":"User","site_admin":false},"repo":{"id":32416692,"name":"nmatrix","full_name":"agisga/nmatrix","owner":{"login":"agisga","id":11449372,"avatar_url":"https://avatars.githubusercontent.com/u/11449372?v=3","gravatar_id":"","url":"https://api.github.com/users/agisga","html_url":"https://github.com/agisga","followers_url":"https://api.github.com/users/agisga/followers","following_url":"https://api.github.com/users/agisga/following{/other_user}","gists_url":"https://api.github.com/users/agisga/gists{/gist_id}","starred_url":"https://api.github.com/users/agisga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agisga/subscriptions","organizations_url":"https://api.github.com/users/agisga/orgs","repos_url":"https://api.github.com/users/agisga/repos","events_url":"https://api.github.com/users/agisga/events{/privacy}","received_events_url":"https://api.github.com/users/agisga/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/agisga/nmatrix","description":"Dense and sparse linear algebra library for Ruby via SciRuby","fork":true,"url":"https://api.github.com/repos/agisga/nmatrix","forks_url":"https://api.github.com/repos/agisga/nmatrix/forks","keys_url":"https://api.github.com/repos/agisga/nmatrix/keys{/key_id}","collaborators_url":"https://api.github.com/repos/agisga/nmatrix/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/agisga/nmatrix/teams","hooks_url":"https://api.github.com/repos/agisga/nmatrix/hooks","issue_events_url":"https://api.github.com/repos/agisga/nmatrix/issues/events{/number}","events_url":"https://api.github.com/repos/agisga/nmatrix/events","assignees_url":"https://api.github.com/repos/agisga/nmatrix/assignees{/user}","branches_url":"https://api.github.com/repos/agisga/nmatrix/branches{/branch}","tags_url":"https://api.github.com/repos/agisga/nmatrix/tags","blobs_url":"https://api.github.com/repos/agisga/nmatrix/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/agisga/nmatrix/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/agisga/nmatrix/git/refs{/sha}","trees_url":"https://api.github.com/repos/agisga/nmatrix/git/trees{/sha}","statuses_url":"https://api.github.com/repos/agisga/nmatrix/statuses/{sha}","languages_url":"https://api.github.com/repos/agisga/nmatrix/languages","stargazers_url":"https://api.github.com/repos/agisga/nmatrix/stargazers","contributors_url":"https://api.github.com/repos/agisga/nmatrix/contributors","subscribers_url":"https://api.github.com/repos/agisga/nmatrix/subscribers","subscription_url":"https://api.github.com/repos/agisga/nmatrix/subscription","commits_url":"https://api.github.com/repos/agisga/nmatrix/commits{/sha}","git_commits_url":"https://api.github.com/repos/agisga/nmatrix/git/commits{/sha}","comments_url":"https://api.github.com/repos/agisga/nmatrix/comments{/number}","issue_comment_url":"https://api.github.com/repos/agisga/nmatrix/issues/comments{/number}","contents_url":"https://api.github.com/repos/agisga/nmatrix/contents/{+path}","compare_url":"https://api.github.com/repos/agisga/nmatrix/compare/{base}...{head}","merges_url":"https://api.github.com/repos/agisga/nmatrix/merges","archive_url":"https://api.github.com/repos/agisga/nmatrix/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/agisga/nmatrix/downloads","issues_url":"https://api.github.com/repos/agisga/nmatrix/issues{/number}","pulls_url":"https://api.github.com/repos/agisga/nmatrix/pulls{/number}","milestones_url":"https://api.github.com/repos/agisga/nmatrix/milestones{/number}","notifications_url":"https://api.github.com/repos/agisga/nmatrix/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/agisga/nmatrix/labels{/name}","releases_url":"https://api.github.com/repos/agisga/nmatrix/releases{/id}","created_at":"2015-03-17T19:56:39Z","updated_at":"2015-03-25T03:57:24Z","pushed_at":"2015-03-30T00:42:24Z","git_url":"git://github.com/agisga/nmatrix.git","ssh_url":"git@github.com:agisga/nmatrix.git","clone_url":"https://github.com/agisga/nmatrix.git","svn_url":"https://github.com/agisga/nmatrix","homepage":"","size":6898,"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":"SciRuby:master","ref":"master","sha":"76848ab3e34be57f40c8b18d48961d2e0f817969","user":{"login":"SciRuby","id":550805,"avatar_url":"https://avatars.githubusercontent.com/u/550805?v=3","gravatar_id":"","url":"https://api.github.com/users/SciRuby","html_url":"https://github.com/SciRuby","followers_url":"https://api.github.com/users/SciRuby/followers","following_url":"https://api.github.com/users/SciRuby/following{/other_user}","gists_url":"https://api.github.com/users/SciRuby/gists{/gist_id}","starred_url":"https://api.github.com/users/SciRuby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SciRuby/subscriptions","organizations_url":"https://api.github.com/users/SciRuby/orgs","repos_url":"https://api.github.com/users/SciRuby/repos","events_url":"https://api.github.com/users/SciRuby/events{/privacy}","received_events_url":"https://api.github.com/users/SciRuby/received_events","type":"Organization","site_admin":false},"repo":{"id":3988087,"name":"nmatrix","full_name":"SciRuby/nmatrix","owner":{"login":"SciRuby","id":550805,"avatar_url":"https://avatars.githubusercontent.com/u/550805?v=3","gravatar_id":"","url":"https://api.github.com/users/SciRuby","html_url":"https://github.com/SciRuby","followers_url":"https://api.github.com/users/SciRuby/followers","following_url":"https://api.github.com/users/SciRuby/following{/other_user}","gists_url":"https://api.github.com/users/SciRuby/gists{/gist_id}","starred_url":"https://api.github.com/users/SciRuby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SciRuby/subscriptions","organizations_url":"https://api.github.com/users/SciRuby/orgs","repos_url":"https://api.github.com/users/SciRuby/repos","events_url":"https://api.github.com/users/SciRuby/events{/privacy}","received_events_url":"https://api.github.com/users/SciRuby/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SciRuby/nmatrix","description":"Dense and sparse linear algebra library for Ruby via SciRuby","fork":true,"url":"https://api.github.com/repos/SciRuby/nmatrix","forks_url":"https://api.github.com/repos/SciRuby/nmatrix/forks","keys_url":"https://api.github.com/repos/SciRuby/nmatrix/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SciRuby/nmatrix/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SciRuby/nmatrix/teams","hooks_url":"https://api.github.com/repos/SciRuby/nmatrix/hooks","issue_events_url":"https://api.github.com/repos/SciRuby/nmatrix/issues/events{/number}","events_url":"https://api.github.com/repos/SciRuby/nmatrix/events","assignees_url":"https://api.github.com/repos/SciRuby/nmatrix/assignees{/user}","branches_url":"https://api.github.com/repos/SciRuby/nmatrix/branches{/branch}","tags_url":"https://api.github.com/repos/SciRuby/nmatrix/tags","blobs_url":"https://api.github.com/repos/SciRuby/nmatrix/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SciRuby/nmatrix/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SciRuby/nmatrix/git/refs{/sha}","trees_url":"https://api.github.com/repos/SciRuby/nmatrix/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SciRuby/nmatrix/statuses/{sha}","languages_url":"https://api.github.com/repos/SciRuby/nmatrix/languages","stargazers_url":"https://api.github.com/repos/SciRuby/nmatrix/stargazers","contributors_url":"https://api.github.com/repos/SciRuby/nmatrix/contributors","subscribers_url":"https://api.github.com/repos/SciRuby/nmatrix/subscribers","subscription_url":"https://api.github.com/repos/SciRuby/nmatrix/subscription","commits_url":"https://api.github.com/repos/SciRuby/nmatrix/commits{/sha}","git_commits_url":"https://api.github.com/repos/SciRuby/nmatrix/git/commits{/sha}","comments_url":"https://api.github.com/repos/SciRuby/nmatrix/comments{/number}","issue_comment_url":"https://api.github.com/repos/SciRuby/nmatrix/issues/comments{/number}","contents_url":"https://api.github.com/repos/SciRuby/nmatrix/contents/{+path}","compare_url":"https://api.github.com/repos/SciRuby/nmatrix/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SciRuby/nmatrix/merges","archive_url":"https://api.github.com/repos/SciRuby/nmatrix/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SciRuby/nmatrix/downloads","issues_url":"https://api.github.com/repos/SciRuby/nmatrix/issues{/number}","pulls_url":"https://api.github.com/repos/SciRuby/nmatrix/pulls{/number}","milestones_url":"https://api.github.com/repos/SciRuby/nmatrix/milestones{/number}","notifications_url":"https://api.github.com/repos/SciRuby/nmatrix/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SciRuby/nmatrix/labels{/name}","releases_url":"https://api.github.com/repos/SciRuby/nmatrix/releases{/id}","created_at":"2012-04-10T23:05:34Z","updated_at":"2015-03-30T15:58:43Z","pushed_at":"2015-03-30T15:58:42Z","git_url":"git://github.com/SciRuby/nmatrix.git","ssh_url":"git@github.com:SciRuby/nmatrix.git","clone_url":"https://github.com/SciRuby/nmatrix.git","svn_url":"https://github.com/SciRuby/nmatrix","homepage":"","size":10355,"stargazers_count":239,"watchers_count":239,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":74,"mirror_url":null,"open_issues_count":43,"forks":74,"open_issues":43,"watchers":239,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SciRuby/nmatrix/pulls/346"},"html":{"href":"https://github.com/SciRuby/nmatrix/pull/346"},"issue":{"href":"https://api.github.com/repos/SciRuby/nmatrix/issues/346"},"comments":{"href":"https://api.github.com/repos/SciRuby/nmatrix/issues/346/comments"},"review_comments":{"href":"https://api.github.com/repos/SciRuby/nmatrix/pulls/346/comments"},"review_comment":{"href":"https://api.github.com/repos/SciRuby/nmatrix/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SciRuby/nmatrix/pulls/346/commits"},"statuses":{"href":"https://api.github.com/repos/SciRuby/nmatrix/statuses/3b6cde0c3b82f08535fb5a6de96ac56057f2ab16"}}}}