{"action":"created","comment":{"url":"https://api.github.com/repos/scipy/scipy/pulls/comments/172783401","pull_request_review_id":101857252,"id":172783401,"diff_hunk":"@@ -461,3 +461,30 @@ cdef _fill_dtype_map2(map):\n \n _fill_dtype_map(_LIL_FANCY_GET_DISPATCH, np.typecodes['Integer'])\n _fill_dtype_map2(_LIL_FANCY_SET_DISPATCH)\n+\n+\n+def lil_matvec(int M, int N,\n+               object[:] rows,\n+               object[:] data,\n+               cnp.ndarray vec,\n+               cnp.ndarray result):\n+    \"\"\"\n+    Compute y = A * x for LIL matrix A and dense vectors x and y.\n+\n+    Parameters\n+    ----------\n+    M, N, rows, data\n+        The data from the LIL matrix A.\n+    vec\n+        The vector x as array.\n+    res\n+        The vector y as array.\n+        Must be preallocated to shape `N`!\n+\n+    \"\"\"\n+\n+    for i in range(M):\n+        result_i = 0\n+        for (j, A_ij) in zip(rows[i], data[i]):","path":"scipy/sparse/_csparsetools.pyx.in","position":28,"original_position":28,"commit_id":"1b5ebe2835d93c3111b7f52958ca7d55feb940c7","original_commit_id":"1b5ebe2835d93c3111b7f52958ca7d55feb940c7","user":{"login":"jor-","id":2393560,"avatar_url":"https://avatars3.githubusercontent.com/u/2393560?v=4","gravatar_id":"","url":"https://api.github.com/users/jor-","html_url":"https://github.com/jor-","followers_url":"https://api.github.com/users/jor-/followers","following_url":"https://api.github.com/users/jor-/following{/other_user}","gists_url":"https://api.github.com/users/jor-/gists{/gist_id}","starred_url":"https://api.github.com/users/jor-/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jor-/subscriptions","organizations_url":"https://api.github.com/users/jor-/orgs","repos_url":"https://api.github.com/users/jor-/repos","events_url":"https://api.github.com/users/jor-/events{/privacy}","received_events_url":"https://api.github.com/users/jor-/received_events","type":"User","site_admin":false},"body":"So should I change it to something like this?\r\n```\r\nfor k in range(len(rows)):\r\n    result_i += data[k] * vec[rows[k]]","created_at":"2018-03-07T09:31:13Z","updated_at":"2018-03-07T09:31:13Z","html_url":"https://github.com/scipy/scipy/pull/8525#discussion_r172783401","pull_request_url":"https://api.github.com/repos/scipy/scipy/pulls/8525","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/scipy/scipy/pulls/comments/172783401"},"html":{"href":"https://github.com/scipy/scipy/pull/8525#discussion_r172783401"},"pull_request":{"href":"https://api.github.com/repos/scipy/scipy/pulls/8525"}},"in_reply_to_id":172617112},"pull_request":{"url":"https://api.github.com/repos/scipy/scipy/pulls/8525","id":173191158,"html_url":"https://github.com/scipy/scipy/pull/8525","diff_url":"https://github.com/scipy/scipy/pull/8525.diff","patch_url":"https://github.com/scipy/scipy/pull/8525.patch","issue_url":"https://api.github.com/repos/scipy/scipy/issues/8525","number":8525,"state":"open","locked":false,"title":"ENH: scipy.sparse: add method for (faster) lil matrix vector multiplication","user":{"login":"jor-","id":2393560,"avatar_url":"https://avatars3.githubusercontent.com/u/2393560?v=4","gravatar_id":"","url":"https://api.github.com/users/jor-","html_url":"https://github.com/jor-","followers_url":"https://api.github.com/users/jor-/followers","following_url":"https://api.github.com/users/jor-/following{/other_user}","gists_url":"https://api.github.com/users/jor-/gists{/gist_id}","starred_url":"https://api.github.com/users/jor-/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jor-/subscriptions","organizations_url":"https://api.github.com/users/jor-/orgs","repos_url":"https://api.github.com/users/jor-/repos","events_url":"https://api.github.com/users/jor-/events{/privacy}","received_events_url":"https://api.github.com/users/jor-/received_events","type":"User","site_admin":false},"body":"The `_mul_vector` method of the `lil_matrix` class was implemented using Cython to allow fast matrix vector multiplications with lil matrices. A test for sparse matrix vector multiplication was also added.","created_at":"2018-03-06T15:26:37Z","updated_at":"2018-03-07T09:31:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b1983cdbf4a62856a006e6cc8e71b72a117a889e","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":37340735,"url":"https://api.github.com/repos/scipy/scipy/labels/enhancement","name":"enhancement","color":"bfe5bf","default":true},{"id":37341004,"url":"https://api.github.com/repos/scipy/scipy/labels/scipy.sparse","name":"scipy.sparse","color":"207de5","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/scipy/scipy/pulls/8525/commits","review_comments_url":"https://api.github.com/repos/scipy/scipy/pulls/8525/comments","review_comment_url":"https://api.github.com/repos/scipy/scipy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/scipy/scipy/issues/8525/comments","statuses_url":"https://api.github.com/repos/scipy/scipy/statuses/1b5ebe2835d93c3111b7f52958ca7d55feb940c7","head":{"label":"jor-:ENH-scipy.sparse-lil_mul_vec","ref":"ENH-scipy.sparse-lil_mul_vec","sha":"1b5ebe2835d93c3111b7f52958ca7d55feb940c7","user":{"login":"jor-","id":2393560,"avatar_url":"https://avatars3.githubusercontent.com/u/2393560?v=4","gravatar_id":"","url":"https://api.github.com/users/jor-","html_url":"https://github.com/jor-","followers_url":"https://api.github.com/users/jor-/followers","following_url":"https://api.github.com/users/jor-/following{/other_user}","gists_url":"https://api.github.com/users/jor-/gists{/gist_id}","starred_url":"https://api.github.com/users/jor-/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jor-/subscriptions","organizations_url":"https://api.github.com/users/jor-/orgs","repos_url":"https://api.github.com/users/jor-/repos","events_url":"https://api.github.com/users/jor-/events{/privacy}","received_events_url":"https://api.github.com/users/jor-/received_events","type":"User","site_admin":false},"repo":{"id":80020050,"name":"scipy","full_name":"jor-/scipy","owner":{"login":"jor-","id":2393560,"avatar_url":"https://avatars3.githubusercontent.com/u/2393560?v=4","gravatar_id":"","url":"https://api.github.com/users/jor-","html_url":"https://github.com/jor-","followers_url":"https://api.github.com/users/jor-/followers","following_url":"https://api.github.com/users/jor-/following{/other_user}","gists_url":"https://api.github.com/users/jor-/gists{/gist_id}","starred_url":"https://api.github.com/users/jor-/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jor-/subscriptions","organizations_url":"https://api.github.com/users/jor-/orgs","repos_url":"https://api.github.com/users/jor-/repos","events_url":"https://api.github.com/users/jor-/events{/privacy}","received_events_url":"https://api.github.com/users/jor-/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jor-/scipy","description":"Scipy library main repository","fork":true,"url":"https://api.github.com/repos/jor-/scipy","forks_url":"https://api.github.com/repos/jor-/scipy/forks","keys_url":"https://api.github.com/repos/jor-/scipy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jor-/scipy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jor-/scipy/teams","hooks_url":"https://api.github.com/repos/jor-/scipy/hooks","issue_events_url":"https://api.github.com/repos/jor-/scipy/issues/events{/number}","events_url":"https://api.github.com/repos/jor-/scipy/events","assignees_url":"https://api.github.com/repos/jor-/scipy/assignees{/user}","branches_url":"https://api.github.com/repos/jor-/scipy/branches{/branch}","tags_url":"https://api.github.com/repos/jor-/scipy/tags","blobs_url":"https://api.github.com/repos/jor-/scipy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jor-/scipy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jor-/scipy/git/refs{/sha}","trees_url":"https://api.github.com/repos/jor-/scipy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jor-/scipy/statuses/{sha}","languages_url":"https://api.github.com/repos/jor-/scipy/languages","stargazers_url":"https://api.github.com/repos/jor-/scipy/stargazers","contributors_url":"https://api.github.com/repos/jor-/scipy/contributors","subscribers_url":"https://api.github.com/repos/jor-/scipy/subscribers","subscription_url":"https://api.github.com/repos/jor-/scipy/subscription","commits_url":"https://api.github.com/repos/jor-/scipy/commits{/sha}","git_commits_url":"https://api.github.com/repos/jor-/scipy/git/commits{/sha}","comments_url":"https://api.github.com/repos/jor-/scipy/comments{/number}","issue_comment_url":"https://api.github.com/repos/jor-/scipy/issues/comments{/number}","contents_url":"https://api.github.com/repos/jor-/scipy/contents/{+path}","compare_url":"https://api.github.com/repos/jor-/scipy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jor-/scipy/merges","archive_url":"https://api.github.com/repos/jor-/scipy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jor-/scipy/downloads","issues_url":"https://api.github.com/repos/jor-/scipy/issues{/number}","pulls_url":"https://api.github.com/repos/jor-/scipy/pulls{/number}","milestones_url":"https://api.github.com/repos/jor-/scipy/milestones{/number}","notifications_url":"https://api.github.com/repos/jor-/scipy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jor-/scipy/labels{/name}","releases_url":"https://api.github.com/repos/jor-/scipy/releases{/id}","deployments_url":"https://api.github.com/repos/jor-/scipy/deployments","created_at":"2017-01-25T14:07:12Z","updated_at":"2017-01-25T14:07:23Z","pushed_at":"2018-03-06T15:22:46Z","git_url":"git://github.com/jor-/scipy.git","ssh_url":"git@github.com:jor-/scipy.git","clone_url":"https://github.com/jor-/scipy.git","svn_url":"https://github.com/jor-/scipy","homepage":"http://scipy.org/scipylib/","size":76606,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"scipy:master","ref":"master","sha":"b3ddb2c8a21c8c89bd7474ec40bdb045977a311a","user":{"login":"scipy","id":288277,"avatar_url":"https://avatars2.githubusercontent.com/u/288277?v=4","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://avatars2.githubusercontent.com/u/288277?v=4","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}","deployments_url":"https://api.github.com/repos/scipy/scipy/deployments","created_at":"2011-03-09T18:52:03Z","updated_at":"2018-03-07T07:40:45Z","pushed_at":"2018-03-07T07:34:30Z","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":78745,"stargazers_count":4180,"watchers_count":4180,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2207,"mirror_url":null,"archived":false,"open_issues_count":1206,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":2207,"open_issues":1206,"watchers":4180,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/scipy/scipy/pulls/8525"},"html":{"href":"https://github.com/scipy/scipy/pull/8525"},"issue":{"href":"https://api.github.com/repos/scipy/scipy/issues/8525"},"comments":{"href":"https://api.github.com/repos/scipy/scipy/issues/8525/comments"},"review_comments":{"href":"https://api.github.com/repos/scipy/scipy/pulls/8525/comments"},"review_comment":{"href":"https://api.github.com/repos/scipy/scipy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/scipy/scipy/pulls/8525/commits"},"statuses":{"href":"https://api.github.com/repos/scipy/scipy/statuses/1b5ebe2835d93c3111b7f52958ca7d55feb940c7"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"jor-"}}