{"action":"created","comment":{"url":"https://api.github.com/repos/scipy/scipy/pulls/comments/34609302","id":34609302,"diff_hunk":"@@ -1946,22 +1946,181 @@ def test_qz_double_sort(self):\n \n     def test_check_finite(self):\n         n = 5\n-        A = random([n,n])\n-        B = random([n,n])\n-        AA,BB,Q,Z = qz(A,B,check_finite=False)\n-        assert_array_almost_equal(dot(dot(Q,AA),Z.T), A)\n-        assert_array_almost_equal(dot(dot(Q,BB),Z.T), B)\n-        assert_array_almost_equal(dot(Q,Q.T), eye(n))\n-        assert_array_almost_equal(dot(Z,Z.T), eye(n))\n+        A = random([n, n])\n+        B = random([n, n])\n+        AA, BB, Q, Z = qz(A, B, check_finite=False)\n+        assert_array_almost_equal(dot(dot(Q, AA), Z.T), A)\n+        assert_array_almost_equal(dot(dot(Q, BB), Z.T), B)\n+        assert_array_almost_equal(dot(Q, Q.T), eye(n))\n+        assert_array_almost_equal(dot(Z, Z.T), eye(n))\n         assert_(all(diag(BB) >= 0))\n \n \n+def _make_pos(X):\n+    # the decompositions can have different signs than verified results\n+    return np.sign(X)*X\n+\n+\n+class TestOrdQZ(TestCase):\n+    @classmethod\n+    def setupClass(cls):","path":"scipy/linalg/tests/test_decomp.py","position":null,"original_position":2097,"commit_id":"2163f5678ba5fd8b935c61f9be4d89afb0c0aec4","original_commit_id":"9c0407ce8abc0aaa0963380b1775656551cddf5c","user":{"login":"jseabold","id":296164,"avatar_url":"https://avatars.githubusercontent.com/u/296164?v=3","gravatar_id":"","url":"https://api.github.com/users/jseabold","html_url":"https://github.com/jseabold","followers_url":"https://api.github.com/users/jseabold/followers","following_url":"https://api.github.com/users/jseabold/following{/other_user}","gists_url":"https://api.github.com/users/jseabold/gists{/gist_id}","starred_url":"https://api.github.com/users/jseabold/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jseabold/subscriptions","organizations_url":"https://api.github.com/users/jseabold/orgs","repos_url":"https://api.github.com/users/jseabold/repos","events_url":"https://api.github.com/users/jseabold/events{/privacy}","received_events_url":"https://api.github.com/users/jseabold/received_events","type":"User","site_admin":false},"body":"Just saves some time so they aren't instantiated before each test method is run.","created_at":"2015-07-14T19:33:21Z","updated_at":"2015-07-14T19:33:21Z","html_url":"https://github.com/scipy/scipy/pull/3107#discussion_r34609302","pull_request_url":"https://api.github.com/repos/scipy/scipy/pulls/3107","_links":{"self":{"href":"https://api.github.com/repos/scipy/scipy/pulls/comments/34609302"},"html":{"href":"https://github.com/scipy/scipy/pull/3107#discussion_r34609302"},"pull_request":{"href":"https://api.github.com/repos/scipy/scipy/pulls/3107"}}},"pull_request":{"url":"https://api.github.com/repos/scipy/scipy/pulls/3107","id":10441047,"html_url":"https://github.com/scipy/scipy/pull/3107","diff_url":"https://github.com/scipy/scipy/pull/3107.diff","patch_url":"https://github.com/scipy/scipy/pull/3107.patch","issue_url":"https://api.github.com/repos/scipy/scipy/issues/3107","number":3107,"state":"open","locked":false,"title":"ENH: Add ordered QZ decomposition","user":{"login":"jseabold","id":296164,"avatar_url":"https://avatars.githubusercontent.com/u/296164?v=3","gravatar_id":"","url":"https://api.github.com/users/jseabold","html_url":"https://github.com/jseabold","followers_url":"https://api.github.com/users/jseabold/followers","following_url":"https://api.github.com/users/jseabold/following{/other_user}","gists_url":"https://api.github.com/users/jseabold/gists{/gist_id}","starred_url":"https://api.github.com/users/jseabold/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jseabold/subscriptions","organizations_url":"https://api.github.com/users/jseabold/orgs","repos_url":"https://api.github.com/users/jseabold/repos","events_url":"https://api.github.com/users/jseabold/events{/privacy}","received_events_url":"https://api.github.com/users/jseabold/received_events","type":"User","site_admin":false},"body":"This currently segfaults. I don't know why. I spent some time checking the wrapper definitions and stepping through with gdb. I didn't notice anything that was obvious to me. If someone else wants to give it a go, this was the working script I was using. If someone can figure out the segfault, I'll take it the rest of the way, but I just don't have time to mess with this.\r\n\r\n```\r\nA = [[-21.10-22.50j, 53.5-50.5j, -34.5+127.5j,   7.5+ 0.5j],\r\n[ -0.46- 7.78j, -3.5-37.5j, -15.5+ 58.5j, -10.5- 1.5j],\r\n[  4.30- 5.50j, 39.7-17.1j, -68.5+ 12.5j,  -7.5- 3.5j],\r\n[  5.50+ 4.40j, 14.4+43.3j, -32.5- 46.0j, -19.0-32.5j]]\r\nB = [[1.0-5.0j,  1.6+1.2j, -3+0j,  0.0-1.0j],\r\n[0.8-0.6j,  3.0-5.0j, -4+3j, -2.4-3.2j],\r\n[1.0+0.0j,  2.4+1.8j, -4-5j,  0.0-3.0j],\r\n[0.0+1.0j, -1.8+2.4j,  0-4j,  4.0-5.0j]]\r\n\r\nA = [[3.9, 12.5, -34.5, -0.5],\r\n[4.3, 21.5, -47.5,  7.5],\r\n[4.3, 21.5, -43.5,  3.5],\r\n[4.4, 26.0, -46.0,  6.0]]\r\n\r\nB = [[  1,    2,   -3,    1],\r\n[  1,    3,   -5,    4],\r\n[  1,    3,   -4,    3],\r\n[  1,    3,   -4,    4]]\r\n\r\n\r\nfrom scipy.linalg._decomp_qz import ordqz, _qz, _select_function, get_lapack_funcs\r\noutput = 'real'\r\nlwork = None\r\noverwrite_a = False\r\noverwrite_b = False\r\ncheck_finite = True\r\nsort = 'lhp'\r\nresult, typ = _qz(A, B, output=output, lwork=lwork, sort=None,\r\n                 overwrite_a=overwrite_a, overwrite_b=overwrite_b,\r\n                 check_finite=check_finite)\r\nAA, BB, Q, Z = result[0], result[1], result[-4], result[-3]\r\nalpha, beta = result[3], result[4]\r\nsfunction = _select_function(sort, typ)\r\nselect = sfunction(alpha, beta)\r\ntgsen, = get_lapack_funcs(('tgsen',), (AA,BB))\r\n\r\nn = len(A)\r\nm = 0.\r\nlwork = 2*m*(n-m)\r\nliwork = n+2\r\n#result = tgsen(select, AA, BB, Q, Z, lwork=-1, liwork=AA.shape[1]*2)\r\nresult = tgsen(select, AA, BB, Q, Z)\r\n```","created_at":"2013-12-02T17:33:48Z","updated_at":"2015-07-14T19:33:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"34f40c3442124b4ab39e83b621f900fe30cf70c3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/scipy/scipy/pulls/3107/commits","review_comments_url":"https://api.github.com/repos/scipy/scipy/pulls/3107/comments","review_comment_url":"https://api.github.com/repos/scipy/scipy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/scipy/scipy/issues/3107/comments","statuses_url":"https://api.github.com/repos/scipy/scipy/statuses/2163f5678ba5fd8b935c61f9be4d89afb0c0aec4","head":{"label":"jseabold:add-ordqz","ref":"add-ordqz","sha":"2163f5678ba5fd8b935c61f9be4d89afb0c0aec4","user":{"login":"jseabold","id":296164,"avatar_url":"https://avatars.githubusercontent.com/u/296164?v=3","gravatar_id":"","url":"https://api.github.com/users/jseabold","html_url":"https://github.com/jseabold","followers_url":"https://api.github.com/users/jseabold/followers","following_url":"https://api.github.com/users/jseabold/following{/other_user}","gists_url":"https://api.github.com/users/jseabold/gists{/gist_id}","starred_url":"https://api.github.com/users/jseabold/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jseabold/subscriptions","organizations_url":"https://api.github.com/users/jseabold/orgs","repos_url":"https://api.github.com/users/jseabold/repos","events_url":"https://api.github.com/users/jseabold/events{/privacy}","received_events_url":"https://api.github.com/users/jseabold/received_events","type":"User","site_admin":false},"repo":{"id":1799187,"name":"scipy","full_name":"jseabold/scipy","owner":{"login":"jseabold","id":296164,"avatar_url":"https://avatars.githubusercontent.com/u/296164?v=3","gravatar_id":"","url":"https://api.github.com/users/jseabold","html_url":"https://github.com/jseabold","followers_url":"https://api.github.com/users/jseabold/followers","following_url":"https://api.github.com/users/jseabold/following{/other_user}","gists_url":"https://api.github.com/users/jseabold/gists{/gist_id}","starred_url":"https://api.github.com/users/jseabold/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jseabold/subscriptions","organizations_url":"https://api.github.com/users/jseabold/orgs","repos_url":"https://api.github.com/users/jseabold/repos","events_url":"https://api.github.com/users/jseabold/events{/privacy}","received_events_url":"https://api.github.com/users/jseabold/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jseabold/scipy","description":"Scipy main repository","fork":true,"url":"https://api.github.com/repos/jseabold/scipy","forks_url":"https://api.github.com/repos/jseabold/scipy/forks","keys_url":"https://api.github.com/repos/jseabold/scipy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jseabold/scipy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jseabold/scipy/teams","hooks_url":"https://api.github.com/repos/jseabold/scipy/hooks","issue_events_url":"https://api.github.com/repos/jseabold/scipy/issues/events{/number}","events_url":"https://api.github.com/repos/jseabold/scipy/events","assignees_url":"https://api.github.com/repos/jseabold/scipy/assignees{/user}","branches_url":"https://api.github.com/repos/jseabold/scipy/branches{/branch}","tags_url":"https://api.github.com/repos/jseabold/scipy/tags","blobs_url":"https://api.github.com/repos/jseabold/scipy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jseabold/scipy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jseabold/scipy/git/refs{/sha}","trees_url":"https://api.github.com/repos/jseabold/scipy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jseabold/scipy/statuses/{sha}","languages_url":"https://api.github.com/repos/jseabold/scipy/languages","stargazers_url":"https://api.github.com/repos/jseabold/scipy/stargazers","contributors_url":"https://api.github.com/repos/jseabold/scipy/contributors","subscribers_url":"https://api.github.com/repos/jseabold/scipy/subscribers","subscription_url":"https://api.github.com/repos/jseabold/scipy/subscription","commits_url":"https://api.github.com/repos/jseabold/scipy/commits{/sha}","git_commits_url":"https://api.github.com/repos/jseabold/scipy/git/commits{/sha}","comments_url":"https://api.github.com/repos/jseabold/scipy/comments{/number}","issue_comment_url":"https://api.github.com/repos/jseabold/scipy/issues/comments{/number}","contents_url":"https://api.github.com/repos/jseabold/scipy/contents/{+path}","compare_url":"https://api.github.com/repos/jseabold/scipy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jseabold/scipy/merges","archive_url":"https://api.github.com/repos/jseabold/scipy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jseabold/scipy/downloads","issues_url":"https://api.github.com/repos/jseabold/scipy/issues{/number}","pulls_url":"https://api.github.com/repos/jseabold/scipy/pulls{/number}","milestones_url":"https://api.github.com/repos/jseabold/scipy/milestones{/number}","notifications_url":"https://api.github.com/repos/jseabold/scipy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jseabold/scipy/labels{/name}","releases_url":"https://api.github.com/repos/jseabold/scipy/releases{/id}","created_at":"2011-05-25T14:17:08Z","updated_at":"2015-05-01T19:13:45Z","pushed_at":"2015-07-14T19:27:33Z","git_url":"git://github.com/jseabold/scipy.git","ssh_url":"git@github.com:jseabold/scipy.git","clone_url":"https://github.com/jseabold/scipy.git","svn_url":"https://github.com/jseabold/scipy","homepage":"http://scipy.org/","size":55319,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"scipy:master","ref":"master","sha":"4d59b1e72e0d7449f356413d57c4e286b87b0e30","user":{"login":"scipy","id":288277,"avatar_url":"https://avatars.githubusercontent.com/u/288277?v=3","gravatar_id":"","url":"https://api.github.com/users/scipy","html_url":"https://github.com/scipy","followers_url":"https://api.github.com/users/scipy/followers","following_url":"https://api.github.com/users/scipy/following{/other_user}","gists_url":"https://api.github.com/users/scipy/gists{/gist_id}","starred_url":"https://api.github.com/users/scipy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scipy/subscriptions","organizations_url":"https://api.github.com/users/scipy/orgs","repos_url":"https://api.github.com/users/scipy/repos","events_url":"https://api.github.com/users/scipy/events{/privacy}","received_events_url":"https://api.github.com/users/scipy/received_events","type":"Organization","site_admin":false},"repo":{"id":1460385,"name":"scipy","full_name":"scipy/scipy","owner":{"login":"scipy","id":288277,"avatar_url":"https://avatars.githubusercontent.com/u/288277?v=3","gravatar_id":"","url":"https://api.github.com/users/scipy","html_url":"https://github.com/scipy","followers_url":"https://api.github.com/users/scipy/followers","following_url":"https://api.github.com/users/scipy/following{/other_user}","gists_url":"https://api.github.com/users/scipy/gists{/gist_id}","starred_url":"https://api.github.com/users/scipy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scipy/subscriptions","organizations_url":"https://api.github.com/users/scipy/orgs","repos_url":"https://api.github.com/users/scipy/repos","events_url":"https://api.github.com/users/scipy/events{/privacy}","received_events_url":"https://api.github.com/users/scipy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/scipy/scipy","description":"Scipy library main repository","fork":false,"url":"https://api.github.com/repos/scipy/scipy","forks_url":"https://api.github.com/repos/scipy/scipy/forks","keys_url":"https://api.github.com/repos/scipy/scipy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scipy/scipy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scipy/scipy/teams","hooks_url":"https://api.github.com/repos/scipy/scipy/hooks","issue_events_url":"https://api.github.com/repos/scipy/scipy/issues/events{/number}","events_url":"https://api.github.com/repos/scipy/scipy/events","assignees_url":"https://api.github.com/repos/scipy/scipy/assignees{/user}","branches_url":"https://api.github.com/repos/scipy/scipy/branches{/branch}","tags_url":"https://api.github.com/repos/scipy/scipy/tags","blobs_url":"https://api.github.com/repos/scipy/scipy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scipy/scipy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scipy/scipy/git/refs{/sha}","trees_url":"https://api.github.com/repos/scipy/scipy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scipy/scipy/statuses/{sha}","languages_url":"https://api.github.com/repos/scipy/scipy/languages","stargazers_url":"https://api.github.com/repos/scipy/scipy/stargazers","contributors_url":"https://api.github.com/repos/scipy/scipy/contributors","subscribers_url":"https://api.github.com/repos/scipy/scipy/subscribers","subscription_url":"https://api.github.com/repos/scipy/scipy/subscription","commits_url":"https://api.github.com/repos/scipy/scipy/commits{/sha}","git_commits_url":"https://api.github.com/repos/scipy/scipy/git/commits{/sha}","comments_url":"https://api.github.com/repos/scipy/scipy/comments{/number}","issue_comment_url":"https://api.github.com/repos/scipy/scipy/issues/comments{/number}","contents_url":"https://api.github.com/repos/scipy/scipy/contents/{+path}","compare_url":"https://api.github.com/repos/scipy/scipy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scipy/scipy/merges","archive_url":"https://api.github.com/repos/scipy/scipy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scipy/scipy/downloads","issues_url":"https://api.github.com/repos/scipy/scipy/issues{/number}","pulls_url":"https://api.github.com/repos/scipy/scipy/pulls{/number}","milestones_url":"https://api.github.com/repos/scipy/scipy/milestones{/number}","notifications_url":"https://api.github.com/repos/scipy/scipy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scipy/scipy/labels{/name}","releases_url":"https://api.github.com/repos/scipy/scipy/releases{/id}","created_at":"2011-03-09T18:52:03Z","updated_at":"2015-07-14T06:36:23Z","pushed_at":"2015-07-14T19:27:34Z","git_url":"git://github.com/scipy/scipy.git","ssh_url":"git@github.com:scipy/scipy.git","clone_url":"https://github.com/scipy/scipy.git","svn_url":"https://github.com/scipy/scipy","homepage":"http://scipy.org/scipylib/","size":89019,"stargazers_count":1725,"watchers_count":1725,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":954,"mirror_url":null,"open_issues_count":854,"forks":954,"open_issues":854,"watchers":1725,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/scipy/scipy/pulls/3107"},"html":{"href":"https://github.com/scipy/scipy/pull/3107"},"issue":{"href":"https://api.github.com/repos/scipy/scipy/issues/3107"},"comments":{"href":"https://api.github.com/repos/scipy/scipy/issues/3107/comments"},"review_comments":{"href":"https://api.github.com/repos/scipy/scipy/pulls/3107/comments"},"review_comment":{"href":"https://api.github.com/repos/scipy/scipy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/scipy/scipy/pulls/3107/commits"},"statuses":{"href":"https://api.github.com/repos/scipy/scipy/statuses/2163f5678ba5fd8b935c61f9be4d89afb0c0aec4"}}}}