{"action":"created","comment":{"url":"https://api.github.com/repos/gonum/lapack/pulls/comments/49024886","id":49024886,"diff_hunk":"@@ -0,0 +1,1317 @@\n+// Copyright ©2015 The gonum Authors. All rights reserved.\n+// Use of this source code is governed by a BSD-style\n+// license that can be found in the LICENSE file.\n+\n+package native\n+\n+import (\n+\t\"math\"\n+\n+\t\"github.com/gonum/blas\"\n+\t\"github.com/gonum/blas/blas64\"\n+\t\"github.com/gonum/lapack\"\n+)\n+\n+const noSVDO = \"dgesvd: not coded for overwrite\"\n+\n+// Dgesvd computes the singular value decomposition of the input matrix A.\n+//\n+// The singular value decomposition is\n+//  A = U * Sigma * V^T\n+// where Sigma is an m×n diagonal matrix containing the singular values of A,\n+// U is an m×m orthogonal matrix and V is an n×n orthogonal matrix. The first\n+// min(m,n) columns of U and V are the left and right singular vectors of A\n+// respectively.\n+//\n+// jobU and jobVT are options for computing the singular vectors. The behavior\n+// is as follows\n+//  jobU == lapack.SVDAll       All M columns of U are returned in u\n+//  jobU == lapack.SVDInPlace   The first min(m,n) columns are returned in u\n+//  jobU == lapack.SVDOverwrite The first min(m,n) columns of U are written into a\n+//  jobU == lapack.SVDNone      The columns of U are not computed.\n+// The behavior is the same for jobVT and the rows of V^T. At most one of jobU\n+// and jobVT can equal lapack.SVDOverwrite, and Dgesvd will panic otherwise.\n+//\n+// On entry, a contains the data for the m×n matrix A. During the call to Dgesvd\n+// the data is overwritten. On exit, A contains the appropriate singular vectors\n+// if either job is lapack.SVDOverwrite.\n+//\n+// s is a slice of length at least min(m,n) and on exit contains the singular\n+// values in decreasing order.\n+//\n+// u contains the left singular vectors on exit, stored columnwise. If\n+// jobU == lapack.SVDAll, u is of size m×m. If jobU == lapack.SVDInPlace u is\n+// of size m×min(m,n). If jobU == lapack.SVDOverwrite or lapack.SVDNone, u is\n+// not used.\n+//\n+// vt contains the left singular vectors on exit, stored rowwise. If\n+// jobV == lapack.SVDAll, vt is of size n×m. If jobVT == lapack.SVDInPlace vt is\n+// of size min(m,n)×n. If jobVT == lapack.SVDOverwrite or lapack.SVDNone, vt is\n+// not used.\n+//\n+// work is a slice for storing temporary memory, and lwork is the usable size of\n+// the slice. lwork must be at least max(5*min(m,n), 3*min(m,n)+max(m,n)).\n+// If lwork == -1, instead of performing Dgesvd, the optimal work length will be\n+// stored into work[0]. Dgesvd will panic if the working memory has insufficient\n+// storage.\n+//\n+// Dgesvd returns whether the decomposition successfully completed.\n+func (impl Implementation) Dgesvd(jobU, jobVT lapack.SVDJob, m, n int, a []float64, lda int, s, u []float64, ldu int, vt []float64, ldvt int, work []float64, lwork int) (ok bool) {\n+\tminmn := min(m, n)\n+\tcheckMatrix(m, n, a, lda)\n+\tif jobU == lapack.SVDAll {\n+\t\tcheckMatrix(m, m, u, ldu)\n+\t} else if jobU == lapack.SVDInPlace {\n+\t\tcheckMatrix(m, minmn, u, ldu)\n+\t}\n+\tif jobVT == lapack.SVDAll {\n+\t\tcheckMatrix(n, n, vt, ldvt)\n+\t} else if jobVT == lapack.SVDInPlace {\n+\t\tcheckMatrix(minmn, n, vt, ldvt)\n+\t}\n+\tif jobU == lapack.SVDOverwrite && jobVT == lapack.SVDOverwrite {\n+\t\tpanic(\"lapack: both jobU and jobVT are lapack.SVDOverwrite\")\n+\t}\n+\tif len(s) < minmn {\n+\t\tpanic(badS)\n+\t}\n+\tif jobU == lapack.SVDOverwrite || jobVT == lapack.SVDOverwrite {\n+\t\tpanic(noSVDO)\n+\t}\n+\tminWork := max(5*minmn, 3*minmn+max(m, n))","path":"native/dgesvd.go","position":null,"original_position":81,"commit_id":"e4a3d54c235c907e3a41ce18a8b3107913c4b3b4","original_commit_id":"d93df79a8f0899312e32d378abbaa933efc3c9f6","user":{"login":"kortschak","id":275221,"avatar_url":"https://avatars.githubusercontent.com/u/275221?v=3","gravatar_id":"","url":"https://api.github.com/users/kortschak","html_url":"https://github.com/kortschak","followers_url":"https://api.github.com/users/kortschak/followers","following_url":"https://api.github.com/users/kortschak/following{/other_user}","gists_url":"https://api.github.com/users/kortschak/gists{/gist_id}","starred_url":"https://api.github.com/users/kortschak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kortschak/subscriptions","organizations_url":"https://api.github.com/users/kortschak/orgs","repos_url":"https://api.github.com/users/kortschak/repos","events_url":"https://api.github.com/users/kortschak/events{/privacy}","received_events_url":"https://api.github.com/users/kortschak/received_events","type":"User","site_admin":false},"body":"I added in the path-specific minwrk calculations and compared. They are not different for any of the test cases that the tests run.","created_at":"2016-01-06T23:32:36Z","updated_at":"2016-01-06T23:32:36Z","html_url":"https://github.com/gonum/lapack/pull/79#discussion_r49024886","pull_request_url":"https://api.github.com/repos/gonum/lapack/pulls/79","_links":{"self":{"href":"https://api.github.com/repos/gonum/lapack/pulls/comments/49024886"},"html":{"href":"https://github.com/gonum/lapack/pull/79#discussion_r49024886"},"pull_request":{"href":"https://api.github.com/repos/gonum/lapack/pulls/79"}}},"pull_request":{"url":"https://api.github.com/repos/gonum/lapack/pulls/79","id":53875568,"html_url":"https://github.com/gonum/lapack/pull/79","diff_url":"https://github.com/gonum/lapack/pull/79.diff","patch_url":"https://github.com/gonum/lapack/pull/79.patch","issue_url":"https://api.github.com/repos/gonum/lapack/issues/79","number":79,"state":"open","locked":false,"title":"Adddgesvd","user":{"login":"btracey","id":3680859,"avatar_url":"https://avatars.githubusercontent.com/u/3680859?v=3","gravatar_id":"","url":"https://api.github.com/users/btracey","html_url":"https://github.com/btracey","followers_url":"https://api.github.com/users/btracey/followers","following_url":"https://api.github.com/users/btracey/following{/other_user}","gists_url":"https://api.github.com/users/btracey/gists{/gist_id}","starred_url":"https://api.github.com/users/btracey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/btracey/subscriptions","organizations_url":"https://api.github.com/users/btracey/orgs","repos_url":"https://api.github.com/users/btracey/repos","events_url":"https://api.github.com/users/btracey/events{/privacy}","received_events_url":"https://api.github.com/users/btracey/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-12-16T17:55:37Z","updated_at":"2016-01-06T23:32:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"812c09133264b5967de2cd141f430c0a85c973d6","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/gonum/lapack/pulls/79/commits","review_comments_url":"https://api.github.com/repos/gonum/lapack/pulls/79/comments","review_comment_url":"https://api.github.com/repos/gonum/lapack/pulls/comments{/number}","comments_url":"https://api.github.com/repos/gonum/lapack/issues/79/comments","statuses_url":"https://api.github.com/repos/gonum/lapack/statuses/e4a3d54c235c907e3a41ce18a8b3107913c4b3b4","head":{"label":"gonum:adddgesvd","ref":"adddgesvd","sha":"e4a3d54c235c907e3a41ce18a8b3107913c4b3b4","user":{"login":"gonum","id":3771091,"avatar_url":"https://avatars.githubusercontent.com/u/3771091?v=3","gravatar_id":"","url":"https://api.github.com/users/gonum","html_url":"https://github.com/gonum","followers_url":"https://api.github.com/users/gonum/followers","following_url":"https://api.github.com/users/gonum/following{/other_user}","gists_url":"https://api.github.com/users/gonum/gists{/gist_id}","starred_url":"https://api.github.com/users/gonum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gonum/subscriptions","organizations_url":"https://api.github.com/users/gonum/orgs","repos_url":"https://api.github.com/users/gonum/repos","events_url":"https://api.github.com/users/gonum/events{/privacy}","received_events_url":"https://api.github.com/users/gonum/received_events","type":"Organization","site_admin":false},"repo":{"id":20473913,"name":"lapack","full_name":"gonum/lapack","owner":{"login":"gonum","id":3771091,"avatar_url":"https://avatars.githubusercontent.com/u/3771091?v=3","gravatar_id":"","url":"https://api.github.com/users/gonum","html_url":"https://github.com/gonum","followers_url":"https://api.github.com/users/gonum/followers","following_url":"https://api.github.com/users/gonum/following{/other_user}","gists_url":"https://api.github.com/users/gonum/gists{/gist_id}","starred_url":"https://api.github.com/users/gonum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gonum/subscriptions","organizations_url":"https://api.github.com/users/gonum/orgs","repos_url":"https://api.github.com/users/gonum/repos","events_url":"https://api.github.com/users/gonum/events{/privacy}","received_events_url":"https://api.github.com/users/gonum/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gonum/lapack","description":"A lapack implementation for go","fork":false,"url":"https://api.github.com/repos/gonum/lapack","forks_url":"https://api.github.com/repos/gonum/lapack/forks","keys_url":"https://api.github.com/repos/gonum/lapack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gonum/lapack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gonum/lapack/teams","hooks_url":"https://api.github.com/repos/gonum/lapack/hooks","issue_events_url":"https://api.github.com/repos/gonum/lapack/issues/events{/number}","events_url":"https://api.github.com/repos/gonum/lapack/events","assignees_url":"https://api.github.com/repos/gonum/lapack/assignees{/user}","branches_url":"https://api.github.com/repos/gonum/lapack/branches{/branch}","tags_url":"https://api.github.com/repos/gonum/lapack/tags","blobs_url":"https://api.github.com/repos/gonum/lapack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gonum/lapack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gonum/lapack/git/refs{/sha}","trees_url":"https://api.github.com/repos/gonum/lapack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gonum/lapack/statuses/{sha}","languages_url":"https://api.github.com/repos/gonum/lapack/languages","stargazers_url":"https://api.github.com/repos/gonum/lapack/stargazers","contributors_url":"https://api.github.com/repos/gonum/lapack/contributors","subscribers_url":"https://api.github.com/repos/gonum/lapack/subscribers","subscription_url":"https://api.github.com/repos/gonum/lapack/subscription","commits_url":"https://api.github.com/repos/gonum/lapack/commits{/sha}","git_commits_url":"https://api.github.com/repos/gonum/lapack/git/commits{/sha}","comments_url":"https://api.github.com/repos/gonum/lapack/comments{/number}","issue_comment_url":"https://api.github.com/repos/gonum/lapack/issues/comments{/number}","contents_url":"https://api.github.com/repos/gonum/lapack/contents/{+path}","compare_url":"https://api.github.com/repos/gonum/lapack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gonum/lapack/merges","archive_url":"https://api.github.com/repos/gonum/lapack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gonum/lapack/downloads","issues_url":"https://api.github.com/repos/gonum/lapack/issues{/number}","pulls_url":"https://api.github.com/repos/gonum/lapack/pulls{/number}","milestones_url":"https://api.github.com/repos/gonum/lapack/milestones{/number}","notifications_url":"https://api.github.com/repos/gonum/lapack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gonum/lapack/labels{/name}","releases_url":"https://api.github.com/repos/gonum/lapack/releases{/id}","created_at":"2014-06-04T07:18:07Z","updated_at":"2015-12-09T04:35:08Z","pushed_at":"2016-01-06T17:39:15Z","git_url":"git://github.com/gonum/lapack.git","ssh_url":"git@github.com:gonum/lapack.git","clone_url":"https://github.com/gonum/lapack.git","svn_url":"https://github.com/gonum/lapack","homepage":null,"size":934,"stargazers_count":22,"watchers_count":22,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":5,"forks":4,"open_issues":5,"watchers":22,"default_branch":"master"}},"base":{"label":"gonum:master","ref":"master","sha":"4b15612a83c200f655c965134ad13a292587c60b","user":{"login":"gonum","id":3771091,"avatar_url":"https://avatars.githubusercontent.com/u/3771091?v=3","gravatar_id":"","url":"https://api.github.com/users/gonum","html_url":"https://github.com/gonum","followers_url":"https://api.github.com/users/gonum/followers","following_url":"https://api.github.com/users/gonum/following{/other_user}","gists_url":"https://api.github.com/users/gonum/gists{/gist_id}","starred_url":"https://api.github.com/users/gonum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gonum/subscriptions","organizations_url":"https://api.github.com/users/gonum/orgs","repos_url":"https://api.github.com/users/gonum/repos","events_url":"https://api.github.com/users/gonum/events{/privacy}","received_events_url":"https://api.github.com/users/gonum/received_events","type":"Organization","site_admin":false},"repo":{"id":20473913,"name":"lapack","full_name":"gonum/lapack","owner":{"login":"gonum","id":3771091,"avatar_url":"https://avatars.githubusercontent.com/u/3771091?v=3","gravatar_id":"","url":"https://api.github.com/users/gonum","html_url":"https://github.com/gonum","followers_url":"https://api.github.com/users/gonum/followers","following_url":"https://api.github.com/users/gonum/following{/other_user}","gists_url":"https://api.github.com/users/gonum/gists{/gist_id}","starred_url":"https://api.github.com/users/gonum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gonum/subscriptions","organizations_url":"https://api.github.com/users/gonum/orgs","repos_url":"https://api.github.com/users/gonum/repos","events_url":"https://api.github.com/users/gonum/events{/privacy}","received_events_url":"https://api.github.com/users/gonum/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gonum/lapack","description":"A lapack implementation for go","fork":false,"url":"https://api.github.com/repos/gonum/lapack","forks_url":"https://api.github.com/repos/gonum/lapack/forks","keys_url":"https://api.github.com/repos/gonum/lapack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gonum/lapack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gonum/lapack/teams","hooks_url":"https://api.github.com/repos/gonum/lapack/hooks","issue_events_url":"https://api.github.com/repos/gonum/lapack/issues/events{/number}","events_url":"https://api.github.com/repos/gonum/lapack/events","assignees_url":"https://api.github.com/repos/gonum/lapack/assignees{/user}","branches_url":"https://api.github.com/repos/gonum/lapack/branches{/branch}","tags_url":"https://api.github.com/repos/gonum/lapack/tags","blobs_url":"https://api.github.com/repos/gonum/lapack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gonum/lapack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gonum/lapack/git/refs{/sha}","trees_url":"https://api.github.com/repos/gonum/lapack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gonum/lapack/statuses/{sha}","languages_url":"https://api.github.com/repos/gonum/lapack/languages","stargazers_url":"https://api.github.com/repos/gonum/lapack/stargazers","contributors_url":"https://api.github.com/repos/gonum/lapack/contributors","subscribers_url":"https://api.github.com/repos/gonum/lapack/subscribers","subscription_url":"https://api.github.com/repos/gonum/lapack/subscription","commits_url":"https://api.github.com/repos/gonum/lapack/commits{/sha}","git_commits_url":"https://api.github.com/repos/gonum/lapack/git/commits{/sha}","comments_url":"https://api.github.com/repos/gonum/lapack/comments{/number}","issue_comment_url":"https://api.github.com/repos/gonum/lapack/issues/comments{/number}","contents_url":"https://api.github.com/repos/gonum/lapack/contents/{+path}","compare_url":"https://api.github.com/repos/gonum/lapack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gonum/lapack/merges","archive_url":"https://api.github.com/repos/gonum/lapack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gonum/lapack/downloads","issues_url":"https://api.github.com/repos/gonum/lapack/issues{/number}","pulls_url":"https://api.github.com/repos/gonum/lapack/pulls{/number}","milestones_url":"https://api.github.com/repos/gonum/lapack/milestones{/number}","notifications_url":"https://api.github.com/repos/gonum/lapack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gonum/lapack/labels{/name}","releases_url":"https://api.github.com/repos/gonum/lapack/releases{/id}","created_at":"2014-06-04T07:18:07Z","updated_at":"2015-12-09T04:35:08Z","pushed_at":"2016-01-06T17:39:15Z","git_url":"git://github.com/gonum/lapack.git","ssh_url":"git@github.com:gonum/lapack.git","clone_url":"https://github.com/gonum/lapack.git","svn_url":"https://github.com/gonum/lapack","homepage":null,"size":934,"stargazers_count":22,"watchers_count":22,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":5,"forks":4,"open_issues":5,"watchers":22,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/gonum/lapack/pulls/79"},"html":{"href":"https://github.com/gonum/lapack/pull/79"},"issue":{"href":"https://api.github.com/repos/gonum/lapack/issues/79"},"comments":{"href":"https://api.github.com/repos/gonum/lapack/issues/79/comments"},"review_comments":{"href":"https://api.github.com/repos/gonum/lapack/pulls/79/comments"},"review_comment":{"href":"https://api.github.com/repos/gonum/lapack/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/gonum/lapack/pulls/79/commits"},"statuses":{"href":"https://api.github.com/repos/gonum/lapack/statuses/e4a3d54c235c907e3a41ce18a8b3107913c4b3b4"}}}}