{"action":"created","comment":{"url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/pulls/comments/185679942","pull_request_review_id":117117375,"id":185679942,"diff_hunk":"@@ -0,0 +1,357 @@\n+export ECOSOptimizer\n+\n+using MathOptInterface\n+const MOI = MathOptInterface\n+const CI = MOI.ConstraintIndex\n+const VI = MOI.VariableIndex\n+\n+const MOIU = MOI.Utilities\n+\n+const SF = Union{MOI.SingleVariable, MOI.ScalarAffineFunction{Float64}, MOI.VectorOfVariables, MOI.VectorAffineFunction{Float64}}\n+const SS = Union{MOI.EqualTo{Float64}, MOI.GreaterThan{Float64}, MOI.LessThan{Float64}, MOI.Zeros, MOI.Nonnegatives, MOI.Nonpositives, MOI.SecondOrderCone, MOI.ExponentialCone}\n+\n+struct Solution\n+    ret_val::Int\n+    primal::Vector{Float64}\n+    dual_eq::Vector{Float64}\n+    dual_ineq::Vector{Float64}\n+    slack::Vector{Float64}\n+    objval::Float64\n+end\n+Solution() = Solution(0, Float64[], Float64[], Float64[], Float64[], NaN)\n+\n+mutable struct Data\n+    m::Int\n+    n::Int\n+    IA::Vector{Int}\n+    JA::Vector{Int}\n+    VA::Vector{Float64}\n+    b::Vector{Float64}\n+    IG::Vector{Int}\n+    JG::Vector{Int}\n+    VG::Vector{Float64}\n+    h::Vector{Float64}\n+    objconstant::Float64\n+    c::Vector{Float64}\n+end\n+\n+mutable struct Cone\n+    f::Int # number of linear equality constraints\n+    l::Int # length of LP cone\n+    q::Int # length of SOC cone\n+    qa::Vector{Int} # array of second-order cone constraints\n+    ep::Int # number of primal exponential cone triples\n+    eqsetconstant::Dict{Int, Float64} # For the constant of EqualTo\n+    eqnrows::Dict{Int, Int} # The number of rows of Zeros\n+    ineqsetconstant::Dict{Int, Float64} # For the constant of LessThan and GreaterThan\n+    ineqnrows::Dict{Int, Int} # The number of rows of each vector sets except Zeros\n+    function Cone()\n+        new(0, 0, 0, Int[], 0,\n+            Dict{Int, Float64}(),\n+            Dict{Int, UnitRange{Int}}(),\n+            Dict{Int, Float64}(),\n+            Dict{Int, UnitRange{Int}}())\n+    end\n+end\n+\n+mutable struct ECOSOptimizer <: MOI.AbstractOptimizer\n+    cone::Cone\n+    maxsense::Bool\n+    data::Union{Void, Data} # only non-Void between MOI.copy! and MOI.optimize!\n+    sol::Solution\n+    function ECOSOptimizer()\n+        new(Cone(), false, nothing, Solution())\n+    end\n+end\n+\n+function MOI.isempty(instance::ECOSOptimizer)\n+    !instance.maxsense && instance.data === nothing\n+end\n+\n+function MOI.empty!(instance::ECOSOptimizer)\n+    instance.maxsense = false\n+    instance.data = nothing # It should already be nothing except if an error is thrown inside copy!\n+end\n+\n+MOI.canaddvariable(instance::ECOSOptimizer) = false\n+MOIU.needsallocateload(instance::ECOSOptimizer) = true\n+MOI.supports(::ECOSOptimizer, ::MOI.ObjectiveFunction{MOI.ScalarAffineFunction{Float64}}) = true\n+MOI.supportsconstraint(::ECOSOptimizer, ::Type{<:SF}, ::Type{<:SS}) = true\n+MOI.copy!(dest::ECOSOptimizer, src::MOI.ModelLike; copynames=true) = MOIU.allocateload!(dest, src, copynames)\n+\n+# Implements optimize! : translate data to ECOSData and call ECOS_solve","path":"src/MOIWrapper.jl","position":82,"original_position":82,"commit_id":"821bcc6d5ace79866b26f1ea934420f61b930466","original_commit_id":"821bcc6d5ace79866b26f1ea934420f61b930466","user":{"login":"mlubin","id":1733683,"avatar_url":"https://avatars3.githubusercontent.com/u/1733683?v=4","gravatar_id":"","url":"https://api.github.com/users/mlubin","html_url":"https://github.com/mlubin","followers_url":"https://api.github.com/users/mlubin/followers","following_url":"https://api.github.com/users/mlubin/following{/other_user}","gists_url":"https://api.github.com/users/mlubin/gists{/gist_id}","starred_url":"https://api.github.com/users/mlubin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mlubin/subscriptions","organizations_url":"https://api.github.com/users/mlubin/orgs","repos_url":"https://api.github.com/users/mlubin/repos","events_url":"https://api.github.com/users/mlubin/events{/privacy}","received_events_url":"https://api.github.com/users/mlubin/received_events","type":"User","site_admin":false},"body":"Same comment about the location of this comment","created_at":"2018-05-03T01:10:05Z","updated_at":"2018-05-03T01:30:27Z","html_url":"https://github.com/JuliaOpt/ECOS.jl/pull/65#discussion_r185679942","pull_request_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/pulls/65","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/JuliaOpt/ECOS.jl/pulls/comments/185679942"},"html":{"href":"https://github.com/JuliaOpt/ECOS.jl/pull/65#discussion_r185679942"},"pull_request":{"href":"https://api.github.com/repos/JuliaOpt/ECOS.jl/pulls/65"}}},"pull_request":{"url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/pulls/65","id":184826472,"html_url":"https://github.com/JuliaOpt/ECOS.jl/pull/65","diff_url":"https://github.com/JuliaOpt/ECOS.jl/pull/65.diff","patch_url":"https://github.com/JuliaOpt/ECOS.jl/pull/65.patch","issue_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/issues/65","number":65,"state":"open","locked":false,"title":"Add MOI wrapper","user":{"login":"blegat","id":1048205,"avatar_url":"https://avatars3.githubusercontent.com/u/1048205?v=4","gravatar_id":"","url":"https://api.github.com/users/blegat","html_url":"https://github.com/blegat","followers_url":"https://api.github.com/users/blegat/followers","following_url":"https://api.github.com/users/blegat/following{/other_user}","gists_url":"https://api.github.com/users/blegat/gists{/gist_id}","starred_url":"https://api.github.com/users/blegat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blegat/subscriptions","organizations_url":"https://api.github.com/users/blegat/orgs","repos_url":"https://api.github.com/users/blegat/repos","events_url":"https://api.github.com/users/blegat/events{/privacy}","received_events_url":"https://api.github.com/users/blegat/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-04-29T09:42:31Z","updated_at":"2018-05-03T01:30:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"03d0e6123d4e7a6366cd96e9d57453db2c476d9c","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/pulls/65/commits","review_comments_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/pulls/65/comments","review_comment_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/pulls/comments{/number}","comments_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/issues/65/comments","statuses_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/statuses/821bcc6d5ace79866b26f1ea934420f61b930466","head":{"label":"JuliaOpt:bl/moi","ref":"bl/moi","sha":"821bcc6d5ace79866b26f1ea934420f61b930466","user":{"login":"JuliaOpt","id":5667382,"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":17038770,"name":"ECOS.jl","full_name":"JuliaOpt/ECOS.jl","owner":{"login":"JuliaOpt","id":5667382,"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/ECOS.jl","description":"Julia wrapper for the ECOS conic optimization solver","fork":false,"url":"https://api.github.com/repos/JuliaOpt/ECOS.jl","forks_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/forks","keys_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/teams","hooks_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/hooks","issue_events_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/issues/events{/number}","events_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/events","assignees_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/assignees{/user}","branches_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/branches{/branch}","tags_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/tags","blobs_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/git/refs{/sha}","trees_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/statuses/{sha}","languages_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/languages","stargazers_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/stargazers","contributors_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/contributors","subscribers_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/subscribers","subscription_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/subscription","commits_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/commits{/sha}","git_commits_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/git/commits{/sha}","comments_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/comments{/number}","issue_comment_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/issues/comments{/number}","contents_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/contents/{+path}","compare_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/merges","archive_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/downloads","issues_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/issues{/number}","pulls_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/pulls{/number}","milestones_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/milestones{/number}","notifications_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/labels{/name}","releases_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/releases{/id}","deployments_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/deployments","created_at":"2014-02-20T23:05:12Z","updated_at":"2018-04-27T21:52:32Z","pushed_at":"2018-04-30T13:20:39Z","git_url":"git://github.com/JuliaOpt/ECOS.jl.git","ssh_url":"git@github.com:JuliaOpt/ECOS.jl.git","clone_url":"https://github.com/JuliaOpt/ECOS.jl.git","svn_url":"https://github.com/JuliaOpt/ECOS.jl","homepage":"","size":172,"stargazers_count":16,"watchers_count":16,"language":"Julia","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"archived":false,"open_issues_count":5,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":11,"open_issues":5,"watchers":16,"default_branch":"master"}},"base":{"label":"JuliaOpt:master","ref":"master","sha":"9cd2e351a38318dc479850e44e1504609a8ef8a0","user":{"login":"JuliaOpt","id":5667382,"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":17038770,"name":"ECOS.jl","full_name":"JuliaOpt/ECOS.jl","owner":{"login":"JuliaOpt","id":5667382,"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/ECOS.jl","description":"Julia wrapper for the ECOS conic optimization solver","fork":false,"url":"https://api.github.com/repos/JuliaOpt/ECOS.jl","forks_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/forks","keys_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/teams","hooks_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/hooks","issue_events_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/issues/events{/number}","events_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/events","assignees_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/assignees{/user}","branches_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/branches{/branch}","tags_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/tags","blobs_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/git/refs{/sha}","trees_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/statuses/{sha}","languages_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/languages","stargazers_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/stargazers","contributors_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/contributors","subscribers_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/subscribers","subscription_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/subscription","commits_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/commits{/sha}","git_commits_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/git/commits{/sha}","comments_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/comments{/number}","issue_comment_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/issues/comments{/number}","contents_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/contents/{+path}","compare_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/merges","archive_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/downloads","issues_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/issues{/number}","pulls_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/pulls{/number}","milestones_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/milestones{/number}","notifications_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/labels{/name}","releases_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/releases{/id}","deployments_url":"https://api.github.com/repos/JuliaOpt/ECOS.jl/deployments","created_at":"2014-02-20T23:05:12Z","updated_at":"2018-04-27T21:52:32Z","pushed_at":"2018-04-30T13:20:39Z","git_url":"git://github.com/JuliaOpt/ECOS.jl.git","ssh_url":"git@github.com:JuliaOpt/ECOS.jl.git","clone_url":"https://github.com/JuliaOpt/ECOS.jl.git","svn_url":"https://github.com/JuliaOpt/ECOS.jl","homepage":"","size":172,"stargazers_count":16,"watchers_count":16,"language":"Julia","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"archived":false,"open_issues_count":5,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":11,"open_issues":5,"watchers":16,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/JuliaOpt/ECOS.jl/pulls/65"},"html":{"href":"https://github.com/JuliaOpt/ECOS.jl/pull/65"},"issue":{"href":"https://api.github.com/repos/JuliaOpt/ECOS.jl/issues/65"},"comments":{"href":"https://api.github.com/repos/JuliaOpt/ECOS.jl/issues/65/comments"},"review_comments":{"href":"https://api.github.com/repos/JuliaOpt/ECOS.jl/pulls/65/comments"},"review_comment":{"href":"https://api.github.com/repos/JuliaOpt/ECOS.jl/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/JuliaOpt/ECOS.jl/pulls/65/commits"},"statuses":{"href":"https://api.github.com/repos/JuliaOpt/ECOS.jl/statuses/821bcc6d5ace79866b26f1ea934420f61b930466"}},"author_association":"OWNER"}}
{"actor":{"display_login":"mlubin"}}