{"action":"closed","issue":{"url":"https://api.github.com/repos/JuliaOpt/Gurobi.jl/issues/40","repository_url":"https://api.github.com/repos/JuliaOpt/Gurobi.jl","labels_url":"https://api.github.com/repos/JuliaOpt/Gurobi.jl/issues/40/labels{/name}","comments_url":"https://api.github.com/repos/JuliaOpt/Gurobi.jl/issues/40/comments","events_url":"https://api.github.com/repos/JuliaOpt/Gurobi.jl/issues/40/events","html_url":"https://github.com/JuliaOpt/Gurobi.jl/issues/40","id":96896231,"number":40,"title":"Bug in GurobiSolverInterface.jl/getconstrsolution","user":{"login":"adelarue","id":7780501,"avatar_url":"https://avatars.githubusercontent.com/u/7780501?v=3","gravatar_id":"","url":"https://api.github.com/users/adelarue","html_url":"https://github.com/adelarue","followers_url":"https://api.github.com/users/adelarue/followers","following_url":"https://api.github.com/users/adelarue/following{/other_user}","gists_url":"https://api.github.com/users/adelarue/gists{/gist_id}","starred_url":"https://api.github.com/users/adelarue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adelarue/subscriptions","organizations_url":"https://api.github.com/users/adelarue/orgs","repos_url":"https://api.github.com/users/adelarue/repos","events_url":"https://api.github.com/users/adelarue/events{/privacy}","received_events_url":"https://api.github.com/users/adelarue/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2015-07-23T20:14:44Z","updated_at":"2016-09-19T21:16:02Z","closed_at":"2016-09-19T21:16:02Z","body":"I've been using your wonderful Gurobi wrapper with JuMP and MathProgBase for a few months now and it's been an absolute joy, and today I think I found a small bug in getconstrsolution. When a constraint is not tight, getconstrsolution returns a value that is not within constraint bounds.\r\nFor instance, the first half of the following code fails, while the second does not:\r\n```julia\r\n# getconstrsolutionTest.jl\r\n\r\nusing JuMP, MathProgBase, Gurobi\r\n\r\n# Slack GEQ constraint\r\nm = Model(solver=GurobiSolver())\r\n@defVar(m, x)\r\n@addConstraint(m, x >= 0)\r\n@addConstraint(m, x >= 3)\r\n@setObjective(m, Min, x)\r\n\r\nbuildInternalModel(m)\r\nim = getInternalModel(m)\r\n\r\nMathProgBase.optimize!(im)\r\n\r\nfor i = 1:length(MathProgBase.getconstrLB(im))\r\n\tprintln(\"Checking constraint $i\")\r\n\t@assert MathProgBase.getconstrLB(im)[i] <= MathProgBase.getconstrsolution(im)[i] <= MathProgBase.getconstrUB(im)[i]\r\nend\r\n\r\n# Slack LEQ constraint\r\nm = Model(solver=GurobiSolver())\r\n@defVar(m, x)\r\n@addConstraint(m, x <= 3)\r\n@addConstraint(m, x <= 0)\r\n@setObjective(m, Max, x)\r\n\r\nbuildInternalModel(m)\r\nim = getInternalModel(m)\r\n\r\nMathProgBase.optimize!(im)\r\n\r\nfor i = 1:length(MathProgBase.getconstrLB(im))\r\n\tprintln(\"Checking constraint $i\")\r\n\t@assert MathProgBase.getconstrLB(im)[i] <= MathProgBase.getconstrsolution(im)[i] <= MathProgBase.getconstrUB(im)[i]\r\nend\r\n```\r\nI think this is because the variables that represent slackness of a constraint might have an overall sign, which leads to a sign error on line 264 of GurobiSolverInterface.jl. Is this correct ?\r\n\r\nThanks for your help !"}}
{"actor":{"display_login":"mlubin"}}