{"action":"created","issue":{"url":"https://api.github.com/repos/sqlp/sedumi/issues/42","repository_url":"https://api.github.com/repos/sqlp/sedumi","labels_url":"https://api.github.com/repos/sqlp/sedumi/issues/42/labels{/name}","comments_url":"https://api.github.com/repos/sqlp/sedumi/issues/42/comments","events_url":"https://api.github.com/repos/sqlp/sedumi/issues/42/events","html_url":"https://github.com/sqlp/sedumi/issues/42","id":395090081,"node_id":"MDU6SXNzdWUzOTUwOTAwODE=","number":42,"title":"Incorrect solution for LP","user":{"login":"blegat","id":1048205,"node_id":"MDQ6VXNlcjEwNDgyMDU=","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},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2019-01-01T14:57:50Z","updated_at":"2019-01-03T09:48:40Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"Consider the problem\r\n```\r\nmin -x2\r\n- x1 -  x2 = 0\r\n  x1 - 3x2 = 0\r\nx1 free\r\nx2 >= 0\r\n```\r\nwith dual\r\n```\r\nmax 0\r\n-y1 +  y2 = 0\r\n2y1 + 3y2 >= 1\r\n```\r\nThe only feasible solution of the primal is `(0, 0)` and for the dual, the feasible solution is the ray `(1, 1)` starting at `(1/5, 1/5)`.\r\nSeDuMi returns the correct `x` `(0, 0)` but an incorrect `ỳ` `(-1.2, 0.6)`.\r\n\r\nThe problem is the [13th test problem of MOI](https://github.com/JuliaOpt/MathOptInterface.jl/blob/999247c5e548c2235e49bec196809dc679c1948e/src/Test/contlinear.jl#L1276) and it is used to verify the correctness of the [Julia SeDuMi wrapper](https://github.com/blegat/SeDuMi.jl).\r\nHere is what I get when using `sedumi` directly:\r\n```julia\r\njulia> A = [-1.0 -2.0; 1.0 -3.0]\r\n2×2 Array{Float64,2}:\r\n -1.0  -2.0\r\n  1.0  -3.0\r\n\r\njulia> b = [0.0, 0.0]\r\n2-element Array{Float64,1}:\r\n 0.0\r\n 0.0\r\n\r\njulia> c = [0.0; -1.0]\r\n2-element Array{Float64,1}:\r\n  0.0\r\n -1.0\r\n\r\njulia> using SeDuMi\r\n\r\njulia> sedumi(A, b, c, SeDuMi.Cone(1, 1))\r\n>> SeDuMi 1.32 by AdvOL, 2005-2008 and Jos F. Sturm, 1998-2003.\r\nAlg = 2: xz-corrector, Adaptive Step-Differentiation, theta = 0.250, beta = 0.500\r\nPut 1 free variables in a quadratic cone\r\neqs m = 2, order n = 4, dim = 4, blocks = 2\r\nnnz(A) = 4 + 0, nnz(ADA) = 4, nnz(L) = 3\r\n it :     b*y       gap    delta  rate   t/tP*  t/tD*   feas cg cg  prec\r\n  0 :            1.25E+01 0.000\r\n  1 :   0.00E+00 1.44E-06 0.000 0.0000 1.0000 1.0000   1.00  1  1  1.0E-06\r\n  2 :   0.00E+00 5.75E-10 0.000 0.0004 0.9999 0.9999   1.00  1  2  3.5E-10\r\n\r\niter seconds digits       c*x               b*y\r\n  2      0.4   Inf -3.2329888893e-11  0.0000000000e+00\r\n|Ax-b| =   9.8e-10, [Ay-c]_+ =   1.6E-16, |x|=  1.4e+00, |y|=  1.3e+00\r\n\r\nDetailed timing (sec)\r\n   Pre          IPM          Post\r\n3.601E-01    2.107E-01    2.660E-02    \r\nMax-norms: ||b||=0, ||c|| = 1,\r\nCholesky |add|=0, |skip| = 1, ||L.L|| = 2.\r\n([-4.67511e-10, 3.23299e-11], [-1.2, 0.6], Dict{String,Any}(\"timing\"=>[0.360066 0.210701 0.0266042],\"dinf\"=>0.0,\"pinf\"=>0.0,\"cpusec\"=>1.66,\"wallsec\"=>0.597372,\"feasratio\"=>1.0,\"r0\"=>9.75092e-10,\"iter\"=>2.0,\"numerr\"=>0.0))\r\n```\r\n\r\nAny idea what's the issue ?"},"comment":{"url":"https://api.github.com/repos/sqlp/sedumi/issues/comments/451096329","html_url":"https://github.com/sqlp/sedumi/issues/42#issuecomment-451096329","issue_url":"https://api.github.com/repos/sqlp/sedumi/issues/42","id":451096329,"node_id":"MDEyOklzc3VlQ29tbWVudDQ1MTA5NjMyOQ==","user":{"login":"siko1056","id":8133832,"node_id":"MDQ6VXNlcjgxMzM4MzI=","avatar_url":"https://avatars3.githubusercontent.com/u/8133832?v=4","gravatar_id":"","url":"https://api.github.com/users/siko1056","html_url":"https://github.com/siko1056","followers_url":"https://api.github.com/users/siko1056/followers","following_url":"https://api.github.com/users/siko1056/following{/other_user}","gists_url":"https://api.github.com/users/siko1056/gists{/gist_id}","starred_url":"https://api.github.com/users/siko1056/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/siko1056/subscriptions","organizations_url":"https://api.github.com/users/siko1056/orgs","repos_url":"https://api.github.com/users/siko1056/repos","events_url":"https://api.github.com/users/siko1056/events{/privacy}","received_events_url":"https://api.github.com/users/siko1056/received_events","type":"User","site_admin":false},"created_at":"2019-01-03T09:48:40Z","updated_at":"2019-01-03T09:48:40Z","author_association":"NONE","body":"Does your input data match your theoretical computation?  Your first constraint is `- x1 -  x2 = 0` whereas your first data row is `A = [-1.0 -2.0;` and not `A = [-1.0 -1.0;`\r\n\r\nWhen looking at the [13th test problem of MOI](https://github.com/JuliaOpt/MathOptInterface.jl/blob/999247c5e548c2235e49bec196809dc679c1948e/src/Test/contlinear.jl#L1276) there your dual version is given to check feasibility. Thus what is the purpose of your derived primal LP?\r\n\r\nMaybe you not dualize it. Just reformulate the given problem for SeDuMi by introducing a slack variable for the inequality constraint:\r\n\r\n```\r\nmin              x3\r\ns.t. -x1 +  x2       = 0\r\n     2x1 + 3x2 + x3  = 1\r\n                 x3 >= 0\r\n```\r\n\r\nFor Octave 4.4.1 and SeDuMi, I get a result much closer to your desired values (note that `x` and `y` are swapped compared to your example):\r\n\r\n```\r\nc = [0 0 1];\r\nb = [0 1];\r\nA = [1 -1 0; 2 3 1];\r\nK.f = 2;\r\nK.l = 1;\r\n\r\n[x, y] = sedumi (A, b, c, K)\r\n\r\nSeDuMi 1.32 by AdvOL, 2005-2008 and Jos F. Sturm, 1998-2003.\r\nAlg = 2: xz-corrector, Adaptive Step-Differentiation, theta = 0.250, beta = 0.500\r\nPut 2 free variables in a quadratic cone\r\neqs m = 2, order n = 4, dim = 5, blocks = 2\r\nnnz(A) = 5 + 0, nnz(ADA) = 4, nnz(L) = 3\r\n it :     b*y       gap    delta  rate   t/tP*  t/tD*   feas cg cg  prec\r\n  0 :            6.04E+00 0.000\r\n  1 :   3.81E-02 4.27E-01 0.000 0.0707 0.9900 0.9900   1.40  1  1  9.0E-01\r\n  2 :  -9.07E-06 1.68E-04 0.000 0.0004 0.9999 0.9999   1.03  1  1  4.8E-02\r\n  3 :  -1.02E-12 1.90E-11 0.000 0.0000 1.0000 1.0000   1.00  1  1  5.4E-09\r\n\r\niter seconds digits       c*x               b*y\r\n  3      0.1   6.3  5.9391019751e-12 -1.0242923753e-12\r\n|Ax-b| =   2.4e-12, [Ay-c]_+ =   2.6E-12, |x|=  2.3e+00, |y|=  1.1e-12\r\n\r\nDetailed timing (sec)\r\n   Pre          IPM          Post\r\n2.242E-02    7.471E-02    5.411E-03\r\nMax-norms: ||b||=1, ||c|| = 1,\r\nCholesky |add|=0, |skip| = 0, ||L.L|| = 1.\r\nx =\r\n   2.0000e-01\r\n   2.0000e-01\r\n   5.9391e-12\r\n\r\ny =\r\n  -5.1214e-13\r\n  -1.0243e-12\r\n```"}}
{"actor":{"display_login":"siko1056"}}