{"action":"created","comment":{"url":"https://api.github.com/repos/JuliaOpt/Gurobi.jl/pulls/comments/204968810","pull_request_review_id":140146373,"id":204968810,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNDk2ODgxMA==","diff_hunk":"@@ -314,11 +314,23 @@ function del_constrs!(model::Model, idx::Vector{Cint})\n     end\n end\n \n+function chg_coeffs!(model::Model, cidx::Real, vidx::Real, val::Real)","path":"src/grb_constrs.jl","position":13,"original_position":13,"commit_id":"b05e1108aa796f0fb40c9a9d0c93fede4fee7a7a","original_commit_id":"b05e1108aa796f0fb40c9a9d0c93fede4fee7a7a","user":{"login":"rdeits","id":591886,"node_id":"MDQ6VXNlcjU5MTg4Ng==","avatar_url":"https://avatars0.githubusercontent.com/u/591886?v=4","gravatar_id":"","url":"https://api.github.com/users/rdeits","html_url":"https://github.com/rdeits","followers_url":"https://api.github.com/users/rdeits/followers","following_url":"https://api.github.com/users/rdeits/following{/other_user}","gists_url":"https://api.github.com/users/rdeits/gists{/gist_id}","starred_url":"https://api.github.com/users/rdeits/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rdeits/subscriptions","organizations_url":"https://api.github.com/users/rdeits/orgs","repos_url":"https://api.github.com/users/rdeits/repos","events_url":"https://api.github.com/users/rdeits/events{/privacy}","received_events_url":"https://api.github.com/users/rdeits/received_events","type":"User","site_admin":false},"body":"The types specified in the `ccall` call are `Ref{Cint}` and `Ref{Float64}`, so Julia will automatically [insert a call to Base.cconvert](https://docs.julialang.org/en/stable/manual/calling-c-and-fortran-code/index.html#Auto-conversion:-1) which will do the correct conversion (or fail with a MethodError). For example: \r\n\r\n```julia\r\njulia> Base.cconvert(Ref{Cint}, 1)\r\nBase.RefValue{Int32}(1)\r\n\r\njulia> Base.cconvert(Ref{Cint}, Int8(1))\r\nBase.RefValue{Int32}(1)\r\n\r\njulia> Base.cconvert(Ref{Cint}, 1.0)\r\nBase.RefValue{Int32}(1)\r\n```","created_at":"2018-07-25T02:56:05Z","updated_at":"2018-07-25T02:56:06Z","html_url":"https://github.com/JuliaOpt/Gurobi.jl/pull/135#discussion_r204968810","pull_request_url":"https://api.github.com/repos/JuliaOpt/Gurobi.jl/pulls/135","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/JuliaOpt/Gurobi.jl/pulls/comments/204968810"},"html":{"href":"https://github.com/JuliaOpt/Gurobi.jl/pull/135#discussion_r204968810"},"pull_request":{"href":"https://api.github.com/repos/JuliaOpt/Gurobi.jl/pulls/135"}},"in_reply_to_id":204942461},"pull_request":{"url":"https://api.github.com/repos/JuliaOpt/Gurobi.jl/pulls/135","id":203666611,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAzNjY2NjEx","html_url":"https://github.com/JuliaOpt/Gurobi.jl/pull/135","diff_url":"https://github.com/JuliaOpt/Gurobi.jl/pull/135.diff","patch_url":"https://github.com/JuliaOpt/Gurobi.jl/pull/135.patch","issue_url":"https://api.github.com/repos/JuliaOpt/Gurobi.jl/issues/135","number":135,"state":"open","locked":false,"title":"Improve performance of coefficient modification","user":{"login":"rdeits","id":591886,"node_id":"MDQ6VXNlcjU5MTg4Ng==","avatar_url":"https://avatars0.githubusercontent.com/u/591886?v=4","gravatar_id":"","url":"https://api.github.com/users/rdeits","html_url":"https://github.com/rdeits","followers_url":"https://api.github.com/users/rdeits/followers","following_url":"https://api.github.com/users/rdeits/following{/other_user}","gists_url":"https://api.github.com/users/rdeits/gists{/gist_id}","starred_url":"https://api.github.com/users/rdeits/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rdeits/subscriptions","organizations_url":"https://api.github.com/users/rdeits/orgs","repos_url":"https://api.github.com/users/rdeits/repos","events_url":"https://api.github.com/users/rdeits/events{/privacy}","received_events_url":"https://api.github.com/users/rdeits/received_events","type":"User","site_admin":false},"body":"`chg_coeffs` when called with scalar indices was previously allocating a length-1 vector of indices and values, which is pretty inefficient. This PR changes that to using Refs, which are quite a bit cheaper. `getcoeff` was also unnecessarily allocating a vector for its return type, so I changed that as well. I deprecated the `getcoeff!` method which operated on that unnecessary vector. \r\n\r\nI also added some unit tests to verify the basics of getting and setting coefficients. \r\n\r\nSetting a single coefficient goes from `214.000 ns (5 allocations: 480 bytes)` to `89.000 ns (3 allocations: 48 bytes)` after this PR. Performance should improve even more in v0.7, since the Refs won't need to be heap-allocated. \r\n\r\nI also fixed some remaining deprecation warnings in the MPB tests. \r\n\r\n@odow this is a PR against your branch in #125 . Let me know if I should open it against `master` instead. \r\n","created_at":"2018-07-24T21:57:03Z","updated_at":"2018-07-25T02:56:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"389928ea7c783e6ff7f3637458e5b25619c08704","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/JuliaOpt/Gurobi.jl/pulls/135/commits","review_comments_url":"https://api.github.com/repos/JuliaOpt/Gurobi.jl/pulls/135/comments","review_comment_url":"https://api.github.com/repos/JuliaOpt/Gurobi.jl/pulls/comments{/number}","comments_url":"https://api.github.com/repos/JuliaOpt/Gurobi.jl/issues/135/comments","statuses_url":"https://api.github.com/repos/JuliaOpt/Gurobi.jl/statuses/b05e1108aa796f0fb40c9a9d0c93fede4fee7a7a","head":{"label":"rdeits:rd/coef-performance","ref":"rd/coef-performance","sha":"b05e1108aa796f0fb40c9a9d0c93fede4fee7a7a","user":{"login":"rdeits","id":591886,"node_id":"MDQ6VXNlcjU5MTg4Ng==","avatar_url":"https://avatars0.githubusercontent.com/u/591886?v=4","gravatar_id":"","url":"https://api.github.com/users/rdeits","html_url":"https://github.com/rdeits","followers_url":"https://api.github.com/users/rdeits/followers","following_url":"https://api.github.com/users/rdeits/following{/other_user}","gists_url":"https://api.github.com/users/rdeits/gists{/gist_id}","starred_url":"https://api.github.com/users/rdeits/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rdeits/subscriptions","organizations_url":"https://api.github.com/users/rdeits/orgs","repos_url":"https://api.github.com/users/rdeits/repos","events_url":"https://api.github.com/users/rdeits/events{/privacy}","received_events_url":"https://api.github.com/users/rdeits/received_events","type":"User","site_admin":false},"repo":{"id":88077476,"node_id":"MDEwOlJlcG9zaXRvcnk4ODA3NzQ3Ng==","name":"Gurobi.jl","full_name":"rdeits/Gurobi.jl","owner":{"login":"rdeits","id":591886,"node_id":"MDQ6VXNlcjU5MTg4Ng==","avatar_url":"https://avatars0.githubusercontent.com/u/591886?v=4","gravatar_id":"","url":"https://api.github.com/users/rdeits","html_url":"https://github.com/rdeits","followers_url":"https://api.github.com/users/rdeits/followers","following_url":"https://api.github.com/users/rdeits/following{/other_user}","gists_url":"https://api.github.com/users/rdeits/gists{/gist_id}","starred_url":"https://api.github.com/users/rdeits/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rdeits/subscriptions","organizations_url":"https://api.github.com/users/rdeits/orgs","repos_url":"https://api.github.com/users/rdeits/repos","events_url":"https://api.github.com/users/rdeits/events{/privacy}","received_events_url":"https://api.github.com/users/rdeits/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rdeits/Gurobi.jl","description":"Julia interface for Gurobi Optimizer","fork":true,"url":"https://api.github.com/repos/rdeits/Gurobi.jl","forks_url":"https://api.github.com/repos/rdeits/Gurobi.jl/forks","keys_url":"https://api.github.com/repos/rdeits/Gurobi.jl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rdeits/Gurobi.jl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rdeits/Gurobi.jl/teams","hooks_url":"https://api.github.com/repos/rdeits/Gurobi.jl/hooks","issue_events_url":"https://api.github.com/repos/rdeits/Gurobi.jl/issues/events{/number}","events_url":"https://api.github.com/repos/rdeits/Gurobi.jl/events","assignees_url":"https://api.github.com/repos/rdeits/Gurobi.jl/assignees{/user}","branches_url":"https://api.github.com/repos/rdeits/Gurobi.jl/branches{/branch}","tags_url":"https://api.github.com/repos/rdeits/Gurobi.jl/tags","blobs_url":"https://api.github.com/repos/rdeits/Gurobi.jl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rdeits/Gurobi.jl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rdeits/Gurobi.jl/git/refs{/sha}","trees_url":"https://api.github.com/repos/rdeits/Gurobi.jl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rdeits/Gurobi.jl/statuses/{sha}","languages_url":"https://api.github.com/repos/rdeits/Gurobi.jl/languages","stargazers_url":"https://api.github.com/repos/rdeits/Gurobi.jl/stargazers","contributors_url":"https://api.github.com/repos/rdeits/Gurobi.jl/contributors","subscribers_url":"https://api.github.com/repos/rdeits/Gurobi.jl/subscribers","subscription_url":"https://api.github.com/repos/rdeits/Gurobi.jl/subscription","commits_url":"https://api.github.com/repos/rdeits/Gurobi.jl/commits{/sha}","git_commits_url":"https://api.github.com/repos/rdeits/Gurobi.jl/git/commits{/sha}","comments_url":"https://api.github.com/repos/rdeits/Gurobi.jl/comments{/number}","issue_comment_url":"https://api.github.com/repos/rdeits/Gurobi.jl/issues/comments{/number}","contents_url":"https://api.github.com/repos/rdeits/Gurobi.jl/contents/{+path}","compare_url":"https://api.github.com/repos/rdeits/Gurobi.jl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rdeits/Gurobi.jl/merges","archive_url":"https://api.github.com/repos/rdeits/Gurobi.jl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rdeits/Gurobi.jl/downloads","issues_url":"https://api.github.com/repos/rdeits/Gurobi.jl/issues{/number}","pulls_url":"https://api.github.com/repos/rdeits/Gurobi.jl/pulls{/number}","milestones_url":"https://api.github.com/repos/rdeits/Gurobi.jl/milestones{/number}","notifications_url":"https://api.github.com/repos/rdeits/Gurobi.jl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rdeits/Gurobi.jl/labels{/name}","releases_url":"https://api.github.com/repos/rdeits/Gurobi.jl/releases{/id}","deployments_url":"https://api.github.com/repos/rdeits/Gurobi.jl/deployments","created_at":"2017-04-12T17:14:43Z","updated_at":"2017-04-12T17:14:44Z","pushed_at":"2018-07-24T23:06:11Z","git_url":"git://github.com/rdeits/Gurobi.jl.git","ssh_url":"git@github.com:rdeits/Gurobi.jl.git","clone_url":"https://github.com/rdeits/Gurobi.jl.git","svn_url":"https://github.com/rdeits/Gurobi.jl","homepage":"http://www.gurobi.com/","size":347,"stargazers_count":0,"watchers_count":0,"language":"Julia","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":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"JuliaOpt:master","ref":"master","sha":"1b454c8bf3219404fb17c9fd6832b9c155495297","user":{"login":"JuliaOpt","id":5667382,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU2NjczODI=","avatar_url":"https://avatars1.githubusercontent.com/u/5667382?v=4","gravatar_id":"","url":"https://api.github.com/users/JuliaOpt","html_url":"https://github.com/JuliaOpt","followers_url":"https://api.github.com/users/JuliaOpt/followers","following_url":"https://api.github.com/users/JuliaOpt/following{/other_user}","gists_url":"https://api.github.com/users/JuliaOpt/gists{/gist_id}","starred_url":"https://api.github.com/users/JuliaOpt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JuliaOpt/subscriptions","organizations_url":"https://api.github.com/users/JuliaOpt/orgs","repos_url":"https://api.github.com/users/JuliaOpt/repos","events_url":"https://api.github.com/users/JuliaOpt/events{/privacy}","received_events_url":"https://api.github.com/users/JuliaOpt/received_events","type":"Organization","site_admin":false},"repo":{"id":8544701,"node_id":"MDEwOlJlcG9zaXRvcnk4NTQ0NzAx","name":"Gurobi.jl","full_name":"JuliaOpt/Gurobi.jl","owner":{"login":"JuliaOpt","id":5667382,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU2NjczODI=","avatar_url":"https://avatars1.githubusercontent.com/u/5667382?v=4","gravatar_id":"","url":"https://api.github.com/users/JuliaOpt","html_url":"https://github.com/JuliaOpt","followers_url":"https://api.github.com/users/JuliaOpt/followers","following_url":"https://api.github.com/users/JuliaOpt/following{/other_user}","gists_url":"https://api.github.com/users/JuliaOpt/gists{/gist_id}","starred_url":"https://api.github.com/users/JuliaOpt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JuliaOpt/subscriptions","organizations_url":"https://api.github.com/users/JuliaOpt/orgs","repos_url":"https://api.github.com/users/JuliaOpt/repos","events_url":"https://api.github.com/users/JuliaOpt/events{/privacy}","received_events_url":"https://api.github.com/users/JuliaOpt/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/JuliaOpt/Gurobi.jl","description":"Julia interface for Gurobi Optimizer","fork":false,"url":"https://api.github.com/repos/JuliaOpt/Gurobi.jl","forks_url":"https://api.github.com/repos/JuliaOpt/Gurobi.jl/forks","keys_url":"https://api.github.com/repos/JuliaOpt/Gurobi.jl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JuliaOpt/Gurobi.jl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JuliaOpt/Gurobi.jl/teams","hooks_url":"https://api.github.com/repos/JuliaOpt/Gurobi.jl/hooks","issue_events_url":"https://api.github.com/repos/JuliaOpt/Gurobi.jl/issues/events{/number}","events_url":"https://api.github.com/repos/JuliaOpt/Gurobi.jl/events","assignees_url":"https://api.github.com/repos/JuliaOpt/Gurobi.jl/assignees{/user}","branches_url":"https://api.github.com/repos/JuliaOpt/Gurobi.jl/branches{/branch}","tags_url":"https://api.github.com/repos/JuliaOpt/Gurobi.jl/tags","blobs_url":"https://api.github.com/repos/JuliaOpt/Gurobi.jl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JuliaOpt/Gurobi.jl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JuliaOpt/Gurobi.jl/git/refs{/sha}","trees_url":"https://api.github.com/repos/JuliaOpt/Gurobi.jl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JuliaOpt/Gurobi.jl/statuses/{sha}","languages_url":"https://api.github.com/repos/JuliaOpt/Gurobi.jl/languages","stargazers_url":"https://api.github.com/repos/JuliaOpt/Gurobi.jl/stargazers","contributors_url":"https://api.github.com/repos/JuliaOpt/Gurobi.jl/contributors","subscribers_url":"https://api.github.com/repos/JuliaOpt/Gurobi.jl/subscribers","subscription_url":"https://api.github.com/repos/JuliaOpt/Gurobi.jl/subscription","commits_url":"https://api.github.com/repos/JuliaOpt/Gurobi.jl/commits{/sha}","git_commits_url":"https://api.github.com/repos/JuliaOpt/Gurobi.jl/git/commits{/sha}","comments_url":"https://api.github.com/repos/JuliaOpt/Gurobi.jl/comments{/number}","issue_comment_url":"https://api.github.com/repos/JuliaOpt/Gurobi.jl/issues/comments{/number}","contents_url":"https://api.github.com/repos/JuliaOpt/Gurobi.jl/contents/{+path}","compare_url":"https://api.github.com/repos/JuliaOpt/Gurobi.jl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JuliaOpt/Gurobi.jl/merges","archive_url":"https://api.github.com/repos/JuliaOpt/Gurobi.jl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JuliaOpt/Gurobi.jl/downloads","issues_url":"https://api.github.com/repos/JuliaOpt/Gurobi.jl/issues{/number}","pulls_url":"https://api.github.com/repos/JuliaOpt/Gurobi.jl/pulls{/number}","milestones_url":"https://api.github.com/repos/JuliaOpt/Gurobi.jl/milestones{/number}","notifications_url":"https://api.github.com/repos/JuliaOpt/Gurobi.jl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JuliaOpt/Gurobi.jl/labels{/name}","releases_url":"https://api.github.com/repos/JuliaOpt/Gurobi.jl/releases{/id}","deployments_url":"https://api.github.com/repos/JuliaOpt/Gurobi.jl/deployments","created_at":"2013-03-03T23:51:39Z","updated_at":"2018-07-24T23:02:23Z","pushed_at":"2018-07-24T23:35:45Z","git_url":"git://github.com/JuliaOpt/Gurobi.jl.git","ssh_url":"git@github.com:JuliaOpt/Gurobi.jl.git","clone_url":"https://github.com/JuliaOpt/Gurobi.jl.git","svn_url":"https://github.com/JuliaOpt/Gurobi.jl","homepage":"http://www.gurobi.com/","size":317,"stargazers_count":44,"watchers_count":44,"language":"Julia","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":36,"mirror_url":null,"archived":false,"open_issues_count":22,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":36,"open_issues":22,"watchers":44,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/JuliaOpt/Gurobi.jl/pulls/135"},"html":{"href":"https://github.com/JuliaOpt/Gurobi.jl/pull/135"},"issue":{"href":"https://api.github.com/repos/JuliaOpt/Gurobi.jl/issues/135"},"comments":{"href":"https://api.github.com/repos/JuliaOpt/Gurobi.jl/issues/135/comments"},"review_comments":{"href":"https://api.github.com/repos/JuliaOpt/Gurobi.jl/pulls/135/comments"},"review_comment":{"href":"https://api.github.com/repos/JuliaOpt/Gurobi.jl/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/JuliaOpt/Gurobi.jl/pulls/135/commits"},"statuses":{"href":"https://api.github.com/repos/JuliaOpt/Gurobi.jl/statuses/b05e1108aa796f0fb40c9a9d0c93fede4fee7a7a"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"rdeits"}}