{"action":"created","comment":{"url":"https://api.github.com/repos/JuliaLang/julia/pulls/comments/37330838","id":37330838,"diff_hunk":"@@ -283,6 +283,155 @@ function -(A::UnitUpperTriangular)\n     UpperTriangular(Anew)\n end\n \n+# copy and scale\n+function copy!(A::UpperTriangular,B::UpperTriangular)\n+    copy!(A.data,B.data)\n+end\n+function copy!(A::UnitUpperTriangular,B::UnitUpperTriangular)\n+    copy!(A.data,B.data)\n+end\n+function copy!(A::LowerTriangular,B::LowerTriangular)\n+    copy!(A.data,B.data)\n+end\n+function copy!(A::UnitLowerTriangular,B::UnitLowerTriangular)\n+    copy!(A.data,B.data)\n+end\n+function copy(A::Union{UpperTriangular,UnitUpperTriangular,LowerTriangular,UnitLowerTriangular})\n+    D = similar(A)\n+    copy!(D, A)\n+    return D\n+end\n+\n+function scale!(A::UpperTriangular, B::UpperTriangular, c::Number)\n+    n = chksquare(B)\n+    for j = 1:n\n+        for i = 1:j\n+            @inbounds A[i,j] = c * B[i,j]\n+        end\n+    end\n+end\n+function scale!(A::UpperTriangular, B::UnitUpperTriangular, c::Number)\n+    n = chksquare(B)\n+    for j = 1:n\n+        A[j,j] = c","path":"base/linalg/triangular.jl","position":34,"original_position":34,"commit_id":"614b49415d2b3fb44cb5d04d0c8ba92c100f1ad2","original_commit_id":"614b49415d2b3fb44cb5d04d0c8ba92c100f1ad2","user":{"login":"stevengj","id":2913679,"avatar_url":"https://avatars.githubusercontent.com/u/2913679?v=3","gravatar_id":"","url":"https://api.github.com/users/stevengj","html_url":"https://github.com/stevengj","followers_url":"https://api.github.com/users/stevengj/followers","following_url":"https://api.github.com/users/stevengj/following{/other_user}","gists_url":"https://api.github.com/users/stevengj/gists{/gist_id}","starred_url":"https://api.github.com/users/stevengj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevengj/subscriptions","organizations_url":"https://api.github.com/users/stevengj/orgs","repos_url":"https://api.github.com/users/stevengj/repos","events_url":"https://api.github.com/users/stevengj/events{/privacy}","received_events_url":"https://api.github.com/users/stevengj/received_events","type":"User","site_admin":false},"body":"This function could probably be unified with the previous function by using `if isa(B, UnitUpperTriangular); A[j,j] = c; end`.  Note that `isa` is evaluated at compile-time, so the compiled function should be identical to what you have now.","created_at":"2015-08-18T17:55:54Z","updated_at":"2015-08-18T17:55:54Z","html_url":"https://github.com/JuliaLang/julia/pull/12683#discussion_r37330838","pull_request_url":"https://api.github.com/repos/JuliaLang/julia/pulls/12683","_links":{"self":{"href":"https://api.github.com/repos/JuliaLang/julia/pulls/comments/37330838"},"html":{"href":"https://github.com/JuliaLang/julia/pull/12683#discussion_r37330838"},"pull_request":{"href":"https://api.github.com/repos/JuliaLang/julia/pulls/12683"}}},"pull_request":{"url":"https://api.github.com/repos/JuliaLang/julia/pulls/12683","id":42726860,"html_url":"https://github.com/JuliaLang/julia/pull/12683","diff_url":"https://github.com/JuliaLang/julia/pull/12683.diff","patch_url":"https://github.com/JuliaLang/julia/pull/12683.patch","issue_url":"https://api.github.com/repos/JuliaLang/julia/issues/12683","number":12683,"state":"open","locked":false,"title":"Add scale and copy for triangular matrices","user":{"login":"mfasi","id":1710735,"avatar_url":"https://avatars.githubusercontent.com/u/1710735?v=3","gravatar_id":"","url":"https://api.github.com/users/mfasi","html_url":"https://github.com/mfasi","followers_url":"https://api.github.com/users/mfasi/followers","following_url":"https://api.github.com/users/mfasi/following{/other_user}","gists_url":"https://api.github.com/users/mfasi/gists{/gist_id}","starred_url":"https://api.github.com/users/mfasi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mfasi/subscriptions","organizations_url":"https://api.github.com/users/mfasi/orgs","repos_url":"https://api.github.com/users/mfasi/repos","events_url":"https://api.github.com/users/mfasi/events{/privacy}","received_events_url":"https://api.github.com/users/mfasi/received_events","type":"User","site_admin":false},"body":"Add the methods `scale!` and `copy!` for triangular matrices. This addition is motivated by a few improvements suggested by @stevengj in  #12584.\r\n\r\nI tried to add the `scale` and `copy` methods as well. Not sure I did something reasonable there, as somewhere along the line I started listening to the compilation warnings without really understanding what was going on.","created_at":"2015-08-18T17:41:30Z","updated_at":"2015-08-18T17:55:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9eda90b8960a034da07ba4e3a9e42b4ae9ffcb66","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/JuliaLang/julia/pulls/12683/commits","review_comments_url":"https://api.github.com/repos/JuliaLang/julia/pulls/12683/comments","review_comment_url":"https://api.github.com/repos/JuliaLang/julia/pulls/comments{/number}","comments_url":"https://api.github.com/repos/JuliaLang/julia/issues/12683/comments","statuses_url":"https://api.github.com/repos/JuliaLang/julia/statuses/614b49415d2b3fb44cb5d04d0c8ba92c100f1ad2","head":{"label":"mfasi:scale_copy_triangular","ref":"scale_copy_triangular","sha":"614b49415d2b3fb44cb5d04d0c8ba92c100f1ad2","user":{"login":"mfasi","id":1710735,"avatar_url":"https://avatars.githubusercontent.com/u/1710735?v=3","gravatar_id":"","url":"https://api.github.com/users/mfasi","html_url":"https://github.com/mfasi","followers_url":"https://api.github.com/users/mfasi/followers","following_url":"https://api.github.com/users/mfasi/following{/other_user}","gists_url":"https://api.github.com/users/mfasi/gists{/gist_id}","starred_url":"https://api.github.com/users/mfasi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mfasi/subscriptions","organizations_url":"https://api.github.com/users/mfasi/orgs","repos_url":"https://api.github.com/users/mfasi/repos","events_url":"https://api.github.com/users/mfasi/events{/privacy}","received_events_url":"https://api.github.com/users/mfasi/received_events","type":"User","site_admin":false},"repo":{"id":34784874,"name":"julia","full_name":"mfasi/julia","owner":{"login":"mfasi","id":1710735,"avatar_url":"https://avatars.githubusercontent.com/u/1710735?v=3","gravatar_id":"","url":"https://api.github.com/users/mfasi","html_url":"https://github.com/mfasi","followers_url":"https://api.github.com/users/mfasi/followers","following_url":"https://api.github.com/users/mfasi/following{/other_user}","gists_url":"https://api.github.com/users/mfasi/gists{/gist_id}","starred_url":"https://api.github.com/users/mfasi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mfasi/subscriptions","organizations_url":"https://api.github.com/users/mfasi/orgs","repos_url":"https://api.github.com/users/mfasi/repos","events_url":"https://api.github.com/users/mfasi/events{/privacy}","received_events_url":"https://api.github.com/users/mfasi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mfasi/julia","description":"The Julia Language: A fresh approach to technical computing.","fork":true,"url":"https://api.github.com/repos/mfasi/julia","forks_url":"https://api.github.com/repos/mfasi/julia/forks","keys_url":"https://api.github.com/repos/mfasi/julia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mfasi/julia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mfasi/julia/teams","hooks_url":"https://api.github.com/repos/mfasi/julia/hooks","issue_events_url":"https://api.github.com/repos/mfasi/julia/issues/events{/number}","events_url":"https://api.github.com/repos/mfasi/julia/events","assignees_url":"https://api.github.com/repos/mfasi/julia/assignees{/user}","branches_url":"https://api.github.com/repos/mfasi/julia/branches{/branch}","tags_url":"https://api.github.com/repos/mfasi/julia/tags","blobs_url":"https://api.github.com/repos/mfasi/julia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mfasi/julia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mfasi/julia/git/refs{/sha}","trees_url":"https://api.github.com/repos/mfasi/julia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mfasi/julia/statuses/{sha}","languages_url":"https://api.github.com/repos/mfasi/julia/languages","stargazers_url":"https://api.github.com/repos/mfasi/julia/stargazers","contributors_url":"https://api.github.com/repos/mfasi/julia/contributors","subscribers_url":"https://api.github.com/repos/mfasi/julia/subscribers","subscription_url":"https://api.github.com/repos/mfasi/julia/subscription","commits_url":"https://api.github.com/repos/mfasi/julia/commits{/sha}","git_commits_url":"https://api.github.com/repos/mfasi/julia/git/commits{/sha}","comments_url":"https://api.github.com/repos/mfasi/julia/comments{/number}","issue_comment_url":"https://api.github.com/repos/mfasi/julia/issues/comments{/number}","contents_url":"https://api.github.com/repos/mfasi/julia/contents/{+path}","compare_url":"https://api.github.com/repos/mfasi/julia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mfasi/julia/merges","archive_url":"https://api.github.com/repos/mfasi/julia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mfasi/julia/downloads","issues_url":"https://api.github.com/repos/mfasi/julia/issues{/number}","pulls_url":"https://api.github.com/repos/mfasi/julia/pulls{/number}","milestones_url":"https://api.github.com/repos/mfasi/julia/milestones{/number}","notifications_url":"https://api.github.com/repos/mfasi/julia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mfasi/julia/labels{/name}","releases_url":"https://api.github.com/repos/mfasi/julia/releases{/id}","created_at":"2015-04-29T09:28:23Z","updated_at":"2015-04-29T09:28:34Z","pushed_at":"2015-08-18T17:28:30Z","git_url":"git://github.com/mfasi/julia.git","ssh_url":"git@github.com:mfasi/julia.git","clone_url":"https://github.com/mfasi/julia.git","svn_url":"https://github.com/mfasi/julia","homepage":"http://julialang.org/","size":81338,"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":"77bef6e5ecdadc4f41f70b7a63209b8c6e212cd7","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-08-18T15:04:00Z","pushed_at":"2015-08-18T17:55:29Z","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":214465,"stargazers_count":5877,"watchers_count":5877,"language":"Julia","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1273,"mirror_url":null,"open_issues_count":1317,"forks":1273,"open_issues":1317,"watchers":5877,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/JuliaLang/julia/pulls/12683"},"html":{"href":"https://github.com/JuliaLang/julia/pull/12683"},"issue":{"href":"https://api.github.com/repos/JuliaLang/julia/issues/12683"},"comments":{"href":"https://api.github.com/repos/JuliaLang/julia/issues/12683/comments"},"review_comments":{"href":"https://api.github.com/repos/JuliaLang/julia/pulls/12683/comments"},"review_comment":{"href":"https://api.github.com/repos/JuliaLang/julia/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/JuliaLang/julia/pulls/12683/commits"},"statuses":{"href":"https://api.github.com/repos/JuliaLang/julia/statuses/614b49415d2b3fb44cb5d04d0c8ba92c100f1ad2"}}}}