{"action":"created","comment":{"url":"https://api.github.com/repos/JuliaLang/julia/pulls/comments/92903233","pull_request_review_id":13429043,"id":92903233,"diff_hunk":"@@ -945,886 +1004,951 @@ function test_getindex_algs{Tv,Ti}(A::SparseMatrixCSC{Tv,Ti}, I::AbstractVector,\n     Base.SparseArrays.getindex_I_sorted_linear(A, I, J)\n end\n \n-let M=2^14, N=2^4\n-    Irand = randperm(M)\n-    Jrand = randperm(N)\n-    SA = [sprand(M, N, d) for d in [1., 0.1, 0.01, 0.001, 0.0001, 0.]]\n-    IA = [sort(Irand[1:round(Int,n)]) for n in [M, M*0.1, M*0.01, M*0.001, M*0.0001, 0.]]\n-    debug = false\n+@testset \"test_getindex_algs\" begin\n+    let M=2^14, N=2^4\n+        Irand = randperm(M)\n+        Jrand = randperm(N)\n+        SA = [sprand(M, N, d) for d in [1., 0.1, 0.01, 0.001, 0.0001, 0.]]\n+        IA = [sort(Irand[1:round(Int,n)]) for n in [M, M*0.1, M*0.01, M*0.001, M*0.0001, 0.]]\n+        debug = false\n+\n+        if debug\n+            println(\"row sizes: $([round(Int,nnz(S)/S.n) for S in SA])\")\n+            println(\"I sizes: $([length(I) for I in IA])\")\n+            @printf(\"    S    |    I    | binary S | binary I |  linear  | best\\n\")\n+        end\n \n-    if debug\n-        println(\"row sizes: $([round(Int,nnz(S)/S.n) for S in SA])\")\n-        println(\"I sizes: $([length(I) for I in IA])\")\n-        @printf(\"    S    |    I    | binary S | binary I |  linear  | best\\n\")\n+        J = Jrand\n+        for I in IA\n+            for S in SA\n+                res = Any[1,2,3]\n+                times = Float64[0,0,0]\n+                best = [typemax(Float64), 0]\n+                for searchtype in [0, 1, 2]\n+                    gc()\n+                    tres = @timed test_getindex_algs(S, I, J, searchtype)\n+                    res[searchtype+1] = tres[1]\n+                    times[searchtype+1] = tres[2]\n+                    if best[1] > tres[2]\n+                        best[1] = tres[2]\n+                        best[2] = searchtype\n+                    end\n+                end\n+\n+                if debug\n+                    @printf(\" %7d | %7d | %4.2e | %4.2e | %4.2e | %s\\n\", round(Int,nnz(S)/S.n), length(I), times[1], times[2], times[3],\n+                                (0 == best[2]) ? \"binary S\" : (1 == best[2]) ? \"binary I\" : \"linear\")\n+                end\n+                if res[1] != res[2]\n+                    println(\"1 and 2\")\n+                elseif res[2] != res[3]\n+                    println(\"2, 3\")\n+                end\n+                @test res[1] == res[2] == res[3]\n+            end\n+        end\n     end\n \n-    J = Jrand\n-    for I in IA\n+    let M = 2^8, N=2^3\n+        Irand = randperm(M)\n+        Jrand = randperm(N)\n+        I = sort([Irand; Irand; Irand])\n+        J = [Jrand; Jrand]\n+\n+        SA = [sprand(M, N, d) for d in [1., 0.1, 0.01, 0.001, 0.0001, 0.]]\n         for S in SA\n             res = Any[1,2,3]\n-            times = Float64[0,0,0]\n-            best = [typemax(Float64), 0]\n             for searchtype in [0, 1, 2]\n-                gc()\n-                tres = @timed test_getindex_algs(S, I, J, searchtype)\n-                res[searchtype+1] = tres[1]\n-                times[searchtype+1] = tres[2]\n-                if best[1] > tres[2]\n-                    best[1] = tres[2]\n-                    best[2] = searchtype\n-                end\n+                res[searchtype+1] = test_getindex_algs(S, I, J, searchtype)\n             end\n \n-            if debug\n-                @printf(\" %7d | %7d | %4.2e | %4.2e | %4.2e | %s\\n\", round(Int,nnz(S)/S.n), length(I), times[1], times[2], times[3],\n-                            (0 == best[2]) ? \"binary S\" : (1 == best[2]) ? \"binary I\" : \"linear\")\n-            end\n-            if res[1] != res[2]\n-                println(\"1 and 2\")\n-            elseif res[2] != res[3]\n-                println(\"2, 3\")\n-            end\n             @test res[1] == res[2] == res[3]\n         end\n     end\n+\n+    let M = 2^14, N=2^4\n+        I = randperm(M)\n+        J = randperm(N)\n+        Jsorted = sort(J)\n+\n+        SA = [sprand(M, N, d) for d in [1., 0.1, 0.01, 0.001, 0.0001, 0.]]\n+        IA = [I[1:round(Int,n)] for n in [M, M*0.1, M*0.01, M*0.001, M*0.0001, 0.]]\n+        debug = false\n+        if debug\n+            @printf(\"         |         |         |        times        |        memory       |\\n\")\n+            @printf(\"    S    |    I    |    J    |  sorted  | unsorted |  sorted  | unsorted |\\n\")\n+        end\n+        for I in IA\n+            Isorted = sort(I)\n+            for S in SA\n+                gc()\n+                ru = @timed S[I, J]\n+                gc()\n+                rs = @timed S[Isorted, Jsorted]\n+                if debug\n+                    @printf(\" %7d | %7d | %7d | %4.2e | %4.2e | %4.2e | %4.2e |\\n\", round(Int,nnz(S)/S.n), length(I), length(J), rs[2], ru[2], rs[3], ru[3])\n+                end\n+            end\n+        end\n+    end\n end\n \n-let M = 2^8, N=2^3\n-    Irand = randperm(M)\n-    Jrand = randperm(N)\n-    I = sort([Irand; Irand; Irand])\n-    J = [Jrand; Jrand]\n+@testset \"Random sparse bounds checking\" begin\n+    let S = sprand(10, 10, 0.1)\n+        @test_throws BoundsError S[[0,1,2], [1,2]]\n+        @test_throws BoundsError S[[1,2], [0,1,2]]\n+        @test_throws BoundsError S[[0,2,1], [1,2]]\n+        @test_throws BoundsError S[[2,1], [0,1,2]]\n+    end\n+end\n \n-    SA = [sprand(M, N, d) for d in [1., 0.1, 0.01, 0.001, 0.0001, 0.]]\n-    for S in SA\n-        res = Any[1,2,3]\n-        for searchtype in [0, 1, 2]\n-            res[searchtype+1] = test_getindex_algs(S, I, J, searchtype)\n-        end\n+# Test that sparse / sparsevec constructors work for AbstractMatrix subtypes\n+@testset \"sparse / sparsevec AbstractMatrix constructors\" begin\n+    let D = Diagonal(ones(10,10)),","path":"test/sparse/sparse.jl","position":1947,"original_position":1947,"commit_id":"734f786adf6d40eaffc3edbbc3b20e5110171e72","original_commit_id":"734f786adf6d40eaffc3edbbc3b20e5110171e72","user":{"login":"lbollar","id":6322326,"avatar_url":"https://avatars.githubusercontent.com/u/6322326?v=3","gravatar_id":"","url":"https://api.github.com/users/lbollar","html_url":"https://github.com/lbollar","followers_url":"https://api.github.com/users/lbollar/followers","following_url":"https://api.github.com/users/lbollar/following{/other_user}","gists_url":"https://api.github.com/users/lbollar/gists{/gist_id}","starred_url":"https://api.github.com/users/lbollar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lbollar/subscriptions","organizations_url":"https://api.github.com/users/lbollar/orgs","repos_url":"https://api.github.com/users/lbollar/repos","events_url":"https://api.github.com/users/lbollar/events{/privacy}","received_events_url":"https://api.github.com/users/lbollar/received_events","type":"User","site_admin":false},"body":"agreed, new scope does make that redundant.","created_at":"2016-12-16T23:26:11Z","updated_at":"2016-12-16T23:26:11Z","html_url":"https://github.com/JuliaLang/julia/pull/19568#discussion_r92903233","pull_request_url":"https://api.github.com/repos/JuliaLang/julia/pulls/19568","_links":{"self":{"href":"https://api.github.com/repos/JuliaLang/julia/pulls/comments/92903233"},"html":{"href":"https://github.com/JuliaLang/julia/pull/19568#discussion_r92903233"},"pull_request":{"href":"https://api.github.com/repos/JuliaLang/julia/pulls/19568"}}},"pull_request":{"url":"https://api.github.com/repos/JuliaLang/julia/pulls/19568","id":97638466,"html_url":"https://github.com/JuliaLang/julia/pull/19568","diff_url":"https://github.com/JuliaLang/julia/pull/19568.diff","patch_url":"https://github.com/JuliaLang/julia/pull/19568.patch","issue_url":"https://api.github.com/repos/JuliaLang/julia/issues/19568","number":19568,"state":"open","locked":false,"title":"Sparse testsets","user":{"login":"lbollar","id":6322326,"avatar_url":"https://avatars.githubusercontent.com/u/6322326?v=3","gravatar_id":"","url":"https://api.github.com/users/lbollar","html_url":"https://github.com/lbollar","followers_url":"https://api.github.com/users/lbollar/followers","following_url":"https://api.github.com/users/lbollar/following{/other_user}","gists_url":"https://api.github.com/users/lbollar/gists{/gist_id}","starred_url":"https://api.github.com/users/lbollar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lbollar/subscriptions","organizations_url":"https://api.github.com/users/lbollar/orgs","repos_url":"https://api.github.com/users/lbollar/repos","events_url":"https://api.github.com/users/lbollar/events{/privacy}","received_events_url":"https://api.github.com/users/lbollar/received_events","type":"User","site_admin":false},"body":"@kshyatt \r\n\r\nReferencing #18801\r\n\r\nThis is revision of pull request [#18844](https://github.com/JuliaLang/julia/pull/18844) that I decided to redo based upon the complicated merge conflicts that occurred over time due to the reorganization of this file. I have not squashed all the commits, as last time this prevented the diff from showing online in github, hopefully these four commits are small enough to see changes. \r\n\r\nAlso I hope that most of the hard work was done in the pull request process last time, and it should be easier this time around.\r\n\r\nThanks","created_at":"2016-12-12T21:36:47Z","updated_at":"2016-12-16T23:26:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6b61fcd5897a3f04a8808774490fda76900f3e5b","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/JuliaLang/julia/pulls/19568/commits","review_comments_url":"https://api.github.com/repos/JuliaLang/julia/pulls/19568/comments","review_comment_url":"https://api.github.com/repos/JuliaLang/julia/pulls/comments{/number}","comments_url":"https://api.github.com/repos/JuliaLang/julia/issues/19568/comments","statuses_url":"https://api.github.com/repos/JuliaLang/julia/statuses/734f786adf6d40eaffc3edbbc3b20e5110171e72","head":{"label":"lbollar:sparse-testsets","ref":"sparse-testsets","sha":"734f786adf6d40eaffc3edbbc3b20e5110171e72","user":{"login":"lbollar","id":6322326,"avatar_url":"https://avatars.githubusercontent.com/u/6322326?v=3","gravatar_id":"","url":"https://api.github.com/users/lbollar","html_url":"https://github.com/lbollar","followers_url":"https://api.github.com/users/lbollar/followers","following_url":"https://api.github.com/users/lbollar/following{/other_user}","gists_url":"https://api.github.com/users/lbollar/gists{/gist_id}","starred_url":"https://api.github.com/users/lbollar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lbollar/subscriptions","organizations_url":"https://api.github.com/users/lbollar/orgs","repos_url":"https://api.github.com/users/lbollar/repos","events_url":"https://api.github.com/users/lbollar/events{/privacy}","received_events_url":"https://api.github.com/users/lbollar/received_events","type":"User","site_admin":false},"repo":{"id":54613307,"name":"julia","full_name":"lbollar/julia","owner":{"login":"lbollar","id":6322326,"avatar_url":"https://avatars.githubusercontent.com/u/6322326?v=3","gravatar_id":"","url":"https://api.github.com/users/lbollar","html_url":"https://github.com/lbollar","followers_url":"https://api.github.com/users/lbollar/followers","following_url":"https://api.github.com/users/lbollar/following{/other_user}","gists_url":"https://api.github.com/users/lbollar/gists{/gist_id}","starred_url":"https://api.github.com/users/lbollar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lbollar/subscriptions","organizations_url":"https://api.github.com/users/lbollar/orgs","repos_url":"https://api.github.com/users/lbollar/repos","events_url":"https://api.github.com/users/lbollar/events{/privacy}","received_events_url":"https://api.github.com/users/lbollar/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lbollar/julia","description":"The Julia Language: A fresh approach to technical computing.","fork":true,"url":"https://api.github.com/repos/lbollar/julia","forks_url":"https://api.github.com/repos/lbollar/julia/forks","keys_url":"https://api.github.com/repos/lbollar/julia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lbollar/julia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lbollar/julia/teams","hooks_url":"https://api.github.com/repos/lbollar/julia/hooks","issue_events_url":"https://api.github.com/repos/lbollar/julia/issues/events{/number}","events_url":"https://api.github.com/repos/lbollar/julia/events","assignees_url":"https://api.github.com/repos/lbollar/julia/assignees{/user}","branches_url":"https://api.github.com/repos/lbollar/julia/branches{/branch}","tags_url":"https://api.github.com/repos/lbollar/julia/tags","blobs_url":"https://api.github.com/repos/lbollar/julia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lbollar/julia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lbollar/julia/git/refs{/sha}","trees_url":"https://api.github.com/repos/lbollar/julia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lbollar/julia/statuses/{sha}","languages_url":"https://api.github.com/repos/lbollar/julia/languages","stargazers_url":"https://api.github.com/repos/lbollar/julia/stargazers","contributors_url":"https://api.github.com/repos/lbollar/julia/contributors","subscribers_url":"https://api.github.com/repos/lbollar/julia/subscribers","subscription_url":"https://api.github.com/repos/lbollar/julia/subscription","commits_url":"https://api.github.com/repos/lbollar/julia/commits{/sha}","git_commits_url":"https://api.github.com/repos/lbollar/julia/git/commits{/sha}","comments_url":"https://api.github.com/repos/lbollar/julia/comments{/number}","issue_comment_url":"https://api.github.com/repos/lbollar/julia/issues/comments{/number}","contents_url":"https://api.github.com/repos/lbollar/julia/contents/{+path}","compare_url":"https://api.github.com/repos/lbollar/julia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lbollar/julia/merges","archive_url":"https://api.github.com/repos/lbollar/julia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lbollar/julia/downloads","issues_url":"https://api.github.com/repos/lbollar/julia/issues{/number}","pulls_url":"https://api.github.com/repos/lbollar/julia/pulls{/number}","milestones_url":"https://api.github.com/repos/lbollar/julia/milestones{/number}","notifications_url":"https://api.github.com/repos/lbollar/julia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lbollar/julia/labels{/name}","releases_url":"https://api.github.com/repos/lbollar/julia/releases{/id}","deployments_url":"https://api.github.com/repos/lbollar/julia/deployments","created_at":"2016-03-24T03:57:20Z","updated_at":"2016-03-24T03:57:26Z","pushed_at":"2016-12-14T17:31:20Z","git_url":"git://github.com/lbollar/julia.git","ssh_url":"git@github.com:lbollar/julia.git","clone_url":"https://github.com/lbollar/julia.git","svn_url":"https://github.com/lbollar/julia","homepage":"http://julialang.org/","size":102070,"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":"bfc72b6fe913236ccb2bdd1ef254bceccb0cc31a","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}","deployments_url":"https://api.github.com/repos/JuliaLang/julia/deployments","created_at":"2011-04-21T07:01:50Z","updated_at":"2016-12-16T14:26:10Z","pushed_at":"2016-12-16T23:17:07Z","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":115171,"stargazers_count":7914,"watchers_count":7914,"language":"Julia","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":1855,"mirror_url":null,"open_issues_count":2241,"forks":1855,"open_issues":2241,"watchers":7914,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/JuliaLang/julia/pulls/19568"},"html":{"href":"https://github.com/JuliaLang/julia/pull/19568"},"issue":{"href":"https://api.github.com/repos/JuliaLang/julia/issues/19568"},"comments":{"href":"https://api.github.com/repos/JuliaLang/julia/issues/19568/comments"},"review_comments":{"href":"https://api.github.com/repos/JuliaLang/julia/pulls/19568/comments"},"review_comment":{"href":"https://api.github.com/repos/JuliaLang/julia/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/JuliaLang/julia/pulls/19568/commits"},"statuses":{"href":"https://api.github.com/repos/JuliaLang/julia/statuses/734f786adf6d40eaffc3edbbc3b20e5110171e72"}}}}
{"actor":{"display_login":"lbollar"}}