{"action":"created","comment":{"url":"https://api.github.com/repos/JuliaLang/julia/pulls/comments/47034148","id":47034148,"diff_hunk":"@@ -134,14 +144,16 @@ for elty1 in (Float32, Float64, Complex64, Complex128, BigFloat, Int)\n         # Unary operations\n         @test full(-A1) == -full(A1)\n \n-        # copy\n-        B = similar(A1)\n-        copy!(B,A1)\n-        @test B == A1\n-        B = similar(A1.')\n-        copy!(B, A1.')\n-        @test B == A1.'\n-\n+        # copy and copy! (test views as well, see issue #14317)\n+        let vrange = 1:n-1, viewA1 = t1(sub(A1.data, vrange, vrange))\n+            # copy\n+            @test copy(A1) == copy(full(A1))\n+            @test copy(viewA1) == copy(full(viewA1))\n+            # copy!\n+            B = similar(A1); copy!(B, A1); @test B == A1","path":"test/linalg/triangular.jl","position":null,"original_position":45,"commit_id":"59c5f6a1c43811a0538c6d59ce94598ad77f227d","original_commit_id":"16056803d8eec35145775e155a3f4168f3b594b3","user":{"login":"tkelman","id":5934628,"avatar_url":"https://avatars.githubusercontent.com/u/5934628?v=3","gravatar_id":"","url":"https://api.github.com/users/tkelman","html_url":"https://github.com/tkelman","followers_url":"https://api.github.com/users/tkelman/followers","following_url":"https://api.github.com/users/tkelman/following{/other_user}","gists_url":"https://api.github.com/users/tkelman/gists{/gist_id}","starred_url":"https://api.github.com/users/tkelman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tkelman/subscriptions","organizations_url":"https://api.github.com/users/tkelman/orgs","repos_url":"https://api.github.com/users/tkelman/repos","events_url":"https://api.github.com/users/tkelman/events{/privacy}","received_events_url":"https://api.github.com/users/tkelman/received_events","type":"User","site_admin":false},"body":"Looks good. I think it should leave in place the\r\n```\r\nB = similar(A1.')\r\ncopy!(B, A1.')\r\n@test B == A1.'\r\n```\r\npart though, the view isn't obviously identical to me?","created_at":"2015-12-09T00:00:15Z","updated_at":"2015-12-09T00:00:15Z","html_url":"https://github.com/JuliaLang/julia/pull/14330#discussion_r47034148","pull_request_url":"https://api.github.com/repos/JuliaLang/julia/pulls/14330","_links":{"self":{"href":"https://api.github.com/repos/JuliaLang/julia/pulls/comments/47034148"},"html":{"href":"https://github.com/JuliaLang/julia/pull/14330#discussion_r47034148"},"pull_request":{"href":"https://api.github.com/repos/JuliaLang/julia/pulls/14330"}}},"pull_request":{"url":"https://api.github.com/repos/JuliaLang/julia/pulls/14330","id":53051352,"html_url":"https://github.com/JuliaLang/julia/pull/14330","diff_url":"https://github.com/JuliaLang/julia/pull/14330.diff","patch_url":"https://github.com/JuliaLang/julia/pull/14330.patch","issue_url":"https://api.github.com/repos/JuliaLang/julia/issues/14330","number":14330,"state":"open","locked":false,"title":"fix copy and transpose on triangular views (#14317)","user":{"login":"Sacha0","id":5799177,"avatar_url":"https://avatars.githubusercontent.com/u/5799177?v=3","gravatar_id":"","url":"https://api.github.com/users/Sacha0","html_url":"https://github.com/Sacha0","followers_url":"https://api.github.com/users/Sacha0/followers","following_url":"https://api.github.com/users/Sacha0/following{/other_user}","gists_url":"https://api.github.com/users/Sacha0/gists{/gist_id}","starred_url":"https://api.github.com/users/Sacha0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sacha0/subscriptions","organizations_url":"https://api.github.com/users/Sacha0/orgs","repos_url":"https://api.github.com/users/Sacha0/repos","events_url":"https://api.github.com/users/Sacha0/events{/privacy}","received_events_url":"https://api.github.com/users/Sacha0/received_events","type":"User","site_admin":false},"body":"This pull request implements @andreasnoack's elegant solution to #14317 (specifically https://github.com/JuliaLang/julia/issues/14317#issuecomment-162750348 .) The present version mimics the existing code's style; alternatively, in place of the repeated explicit `[c]transpose[!]` method definitions\r\n```julia\r\n# Generate [c]transpose[!] methods for triangular types\r\nfor isunit in (true, false), islower in (true, false), conj in (true, false)\r\n    origt = symbol(string((isunit ? \"Unit\" : \"\"), (islower ? \"Lower\" : \"Upper\"), \"Triangular\"))\r\n    transt = symbol(string((isunit ? \"Unit\" : \"\"), (islower ? \"Upper\" : \"Lower\"), \"Triangular\"))\r\n    opop = symbol(string((conj ? \"c\" : \"\"), \"transpose\")) # opop = out-of-place op\r\n    ipop = symbol(string((conj ? \"c\" : \"\"), \"transpose!\")) # ipop = in-place op\r\n    @eval ($opop)(A::$origt) = ($transt)(($opop)(A.data))\r\n    @eval ($ipop)(A::$origt) = ($transt)(copytri!(A.data, $(islower ? :('L') : :('U')), $(conj ? :(true) : :(false))))\r\nend\r\n```\r\nalso works. The code reduction is minor though, and which form is simpler/clearer is arguable/a matter of taste, so I would be happy with either form; let me know which you prefer. (Any thoughts on a better name than `islower` in that snippet? Though the shadowing in the loop is harmless, I would prefer to avoid it given a better name. Or is that sort of shadowing acceptable in Julia?) Thanks, and best!","created_at":"2015-12-08T22:51:27Z","updated_at":"2015-12-09T00:00:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0164c5fd639b2ab13a005ee9523aff5a2d86f9a3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/JuliaLang/julia/pulls/14330/commits","review_comments_url":"https://api.github.com/repos/JuliaLang/julia/pulls/14330/comments","review_comment_url":"https://api.github.com/repos/JuliaLang/julia/pulls/comments{/number}","comments_url":"https://api.github.com/repos/JuliaLang/julia/issues/14330/comments","statuses_url":"https://api.github.com/repos/JuliaLang/julia/statuses/59c5f6a1c43811a0538c6d59ce94598ad77f227d","head":{"label":"Sacha0:triviewtransfix","ref":"triviewtransfix","sha":"59c5f6a1c43811a0538c6d59ce94598ad77f227d","user":{"login":"Sacha0","id":5799177,"avatar_url":"https://avatars.githubusercontent.com/u/5799177?v=3","gravatar_id":"","url":"https://api.github.com/users/Sacha0","html_url":"https://github.com/Sacha0","followers_url":"https://api.github.com/users/Sacha0/followers","following_url":"https://api.github.com/users/Sacha0/following{/other_user}","gists_url":"https://api.github.com/users/Sacha0/gists{/gist_id}","starred_url":"https://api.github.com/users/Sacha0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sacha0/subscriptions","organizations_url":"https://api.github.com/users/Sacha0/orgs","repos_url":"https://api.github.com/users/Sacha0/repos","events_url":"https://api.github.com/users/Sacha0/events{/privacy}","received_events_url":"https://api.github.com/users/Sacha0/received_events","type":"User","site_admin":false},"repo":{"id":46197044,"name":"julia","full_name":"Sacha0/julia","owner":{"login":"Sacha0","id":5799177,"avatar_url":"https://avatars.githubusercontent.com/u/5799177?v=3","gravatar_id":"","url":"https://api.github.com/users/Sacha0","html_url":"https://github.com/Sacha0","followers_url":"https://api.github.com/users/Sacha0/followers","following_url":"https://api.github.com/users/Sacha0/following{/other_user}","gists_url":"https://api.github.com/users/Sacha0/gists{/gist_id}","starred_url":"https://api.github.com/users/Sacha0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sacha0/subscriptions","organizations_url":"https://api.github.com/users/Sacha0/orgs","repos_url":"https://api.github.com/users/Sacha0/repos","events_url":"https://api.github.com/users/Sacha0/events{/privacy}","received_events_url":"https://api.github.com/users/Sacha0/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Sacha0/julia","description":"The Julia Language: A fresh approach to technical computing.","fork":true,"url":"https://api.github.com/repos/Sacha0/julia","forks_url":"https://api.github.com/repos/Sacha0/julia/forks","keys_url":"https://api.github.com/repos/Sacha0/julia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Sacha0/julia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Sacha0/julia/teams","hooks_url":"https://api.github.com/repos/Sacha0/julia/hooks","issue_events_url":"https://api.github.com/repos/Sacha0/julia/issues/events{/number}","events_url":"https://api.github.com/repos/Sacha0/julia/events","assignees_url":"https://api.github.com/repos/Sacha0/julia/assignees{/user}","branches_url":"https://api.github.com/repos/Sacha0/julia/branches{/branch}","tags_url":"https://api.github.com/repos/Sacha0/julia/tags","blobs_url":"https://api.github.com/repos/Sacha0/julia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Sacha0/julia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Sacha0/julia/git/refs{/sha}","trees_url":"https://api.github.com/repos/Sacha0/julia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Sacha0/julia/statuses/{sha}","languages_url":"https://api.github.com/repos/Sacha0/julia/languages","stargazers_url":"https://api.github.com/repos/Sacha0/julia/stargazers","contributors_url":"https://api.github.com/repos/Sacha0/julia/contributors","subscribers_url":"https://api.github.com/repos/Sacha0/julia/subscribers","subscription_url":"https://api.github.com/repos/Sacha0/julia/subscription","commits_url":"https://api.github.com/repos/Sacha0/julia/commits{/sha}","git_commits_url":"https://api.github.com/repos/Sacha0/julia/git/commits{/sha}","comments_url":"https://api.github.com/repos/Sacha0/julia/comments{/number}","issue_comment_url":"https://api.github.com/repos/Sacha0/julia/issues/comments{/number}","contents_url":"https://api.github.com/repos/Sacha0/julia/contents/{+path}","compare_url":"https://api.github.com/repos/Sacha0/julia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Sacha0/julia/merges","archive_url":"https://api.github.com/repos/Sacha0/julia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Sacha0/julia/downloads","issues_url":"https://api.github.com/repos/Sacha0/julia/issues{/number}","pulls_url":"https://api.github.com/repos/Sacha0/julia/pulls{/number}","milestones_url":"https://api.github.com/repos/Sacha0/julia/milestones{/number}","notifications_url":"https://api.github.com/repos/Sacha0/julia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Sacha0/julia/labels{/name}","releases_url":"https://api.github.com/repos/Sacha0/julia/releases{/id}","created_at":"2015-11-14T23:50:27Z","updated_at":"2015-11-14T23:50:41Z","pushed_at":"2015-12-08T23:43:11Z","git_url":"git://github.com/Sacha0/julia.git","ssh_url":"git@github.com:Sacha0/julia.git","clone_url":"https://github.com/Sacha0/julia.git","svn_url":"https://github.com/Sacha0/julia","homepage":"http://julialang.org/","size":92820,"stargazers_count":0,"watchers_count":0,"language":"Julia","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"JuliaLang:master","ref":"master","sha":"0ea14f8f433e562a99a3da28487c5b887ea9f4e3","user":{"login":"JuliaLang","id":743164,"avatar_url":"https://avatars.githubusercontent.com/u/743164?v=3","gravatar_id":"","url":"https://api.github.com/users/JuliaLang","html_url":"https://github.com/JuliaLang","followers_url":"https://api.github.com/users/JuliaLang/followers","following_url":"https://api.github.com/users/JuliaLang/following{/other_user}","gists_url":"https://api.github.com/users/JuliaLang/gists{/gist_id}","starred_url":"https://api.github.com/users/JuliaLang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JuliaLang/subscriptions","organizations_url":"https://api.github.com/users/JuliaLang/orgs","repos_url":"https://api.github.com/users/JuliaLang/repos","events_url":"https://api.github.com/users/JuliaLang/events{/privacy}","received_events_url":"https://api.github.com/users/JuliaLang/received_events","type":"Organization","site_admin":false},"repo":{"id":1644196,"name":"julia","full_name":"JuliaLang/julia","owner":{"login":"JuliaLang","id":743164,"avatar_url":"https://avatars.githubusercontent.com/u/743164?v=3","gravatar_id":"","url":"https://api.github.com/users/JuliaLang","html_url":"https://github.com/JuliaLang","followers_url":"https://api.github.com/users/JuliaLang/followers","following_url":"https://api.github.com/users/JuliaLang/following{/other_user}","gists_url":"https://api.github.com/users/JuliaLang/gists{/gist_id}","starred_url":"https://api.github.com/users/JuliaLang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JuliaLang/subscriptions","organizations_url":"https://api.github.com/users/JuliaLang/orgs","repos_url":"https://api.github.com/users/JuliaLang/repos","events_url":"https://api.github.com/users/JuliaLang/events{/privacy}","received_events_url":"https://api.github.com/users/JuliaLang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/JuliaLang/julia","description":"The Julia Language: A fresh approach to technical computing.","fork":false,"url":"https://api.github.com/repos/JuliaLang/julia","forks_url":"https://api.github.com/repos/JuliaLang/julia/forks","keys_url":"https://api.github.com/repos/JuliaLang/julia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JuliaLang/julia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JuliaLang/julia/teams","hooks_url":"https://api.github.com/repos/JuliaLang/julia/hooks","issue_events_url":"https://api.github.com/repos/JuliaLang/julia/issues/events{/number}","events_url":"https://api.github.com/repos/JuliaLang/julia/events","assignees_url":"https://api.github.com/repos/JuliaLang/julia/assignees{/user}","branches_url":"https://api.github.com/repos/JuliaLang/julia/branches{/branch}","tags_url":"https://api.github.com/repos/JuliaLang/julia/tags","blobs_url":"https://api.github.com/repos/JuliaLang/julia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JuliaLang/julia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JuliaLang/julia/git/refs{/sha}","trees_url":"https://api.github.com/repos/JuliaLang/julia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JuliaLang/julia/statuses/{sha}","languages_url":"https://api.github.com/repos/JuliaLang/julia/languages","stargazers_url":"https://api.github.com/repos/JuliaLang/julia/stargazers","contributors_url":"https://api.github.com/repos/JuliaLang/julia/contributors","subscribers_url":"https://api.github.com/repos/JuliaLang/julia/subscribers","subscription_url":"https://api.github.com/repos/JuliaLang/julia/subscription","commits_url":"https://api.github.com/repos/JuliaLang/julia/commits{/sha}","git_commits_url":"https://api.github.com/repos/JuliaLang/julia/git/commits{/sha}","comments_url":"https://api.github.com/repos/JuliaLang/julia/comments{/number}","issue_comment_url":"https://api.github.com/repos/JuliaLang/julia/issues/comments{/number}","contents_url":"https://api.github.com/repos/JuliaLang/julia/contents/{+path}","compare_url":"https://api.github.com/repos/JuliaLang/julia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JuliaLang/julia/merges","archive_url":"https://api.github.com/repos/JuliaLang/julia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JuliaLang/julia/downloads","issues_url":"https://api.github.com/repos/JuliaLang/julia/issues{/number}","pulls_url":"https://api.github.com/repos/JuliaLang/julia/pulls{/number}","milestones_url":"https://api.github.com/repos/JuliaLang/julia/milestones{/number}","notifications_url":"https://api.github.com/repos/JuliaLang/julia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JuliaLang/julia/labels{/name}","releases_url":"https://api.github.com/repos/JuliaLang/julia/releases{/id}","created_at":"2011-04-21T07:01:50Z","updated_at":"2015-12-08T21:29:18Z","pushed_at":"2015-12-08T23:43:12Z","git_url":"git://github.com/JuliaLang/julia.git","ssh_url":"git@github.com:JuliaLang/julia.git","clone_url":"https://github.com/JuliaLang/julia.git","svn_url":"https://github.com/JuliaLang/julia","homepage":"http://julialang.org/","size":116290,"stargazers_count":6438,"watchers_count":6438,"language":"Julia","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1435,"mirror_url":null,"open_issues_count":1533,"forks":1435,"open_issues":1533,"watchers":6438,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/JuliaLang/julia/pulls/14330"},"html":{"href":"https://github.com/JuliaLang/julia/pull/14330"},"issue":{"href":"https://api.github.com/repos/JuliaLang/julia/issues/14330"},"comments":{"href":"https://api.github.com/repos/JuliaLang/julia/issues/14330/comments"},"review_comments":{"href":"https://api.github.com/repos/JuliaLang/julia/pulls/14330/comments"},"review_comment":{"href":"https://api.github.com/repos/JuliaLang/julia/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/JuliaLang/julia/pulls/14330/commits"},"statuses":{"href":"https://api.github.com/repos/JuliaLang/julia/statuses/59c5f6a1c43811a0538c6d59ce94598ad77f227d"}}}}