{"action":"created","issue":{"url":"https://api.github.com/repos/sqlp/sedumi/issues/15","labels_url":"https://api.github.com/repos/sqlp/sedumi/issues/15/labels{/name}","comments_url":"https://api.github.com/repos/sqlp/sedumi/issues/15/comments","events_url":"https://api.github.com/repos/sqlp/sedumi/issues/15/events","html_url":"https://github.com/sqlp/sedumi/issues/15","id":52768702,"number":15,"title":"results are not apparently deterministic?","user":{"login":"shabbychef","id":1456159,"avatar_url":"https://avatars.githubusercontent.com/u/1456159?v=3","gravatar_id":"","url":"https://api.github.com/users/shabbychef","html_url":"https://github.com/shabbychef","followers_url":"https://api.github.com/users/shabbychef/followers","following_url":"https://api.github.com/users/shabbychef/following{/other_user}","gists_url":"https://api.github.com/users/shabbychef/gists{/gist_id}","starred_url":"https://api.github.com/users/shabbychef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shabbychef/subscriptions","organizations_url":"https://api.github.com/users/shabbychef/orgs","repos_url":"https://api.github.com/users/shabbychef/repos","events_url":"https://api.github.com/users/shabbychef/events{/privacy}","received_events_url":"https://api.github.com/users/shabbychef/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2014-12-23T19:38:47Z","updated_at":"2015-11-20T23:15:15Z","closed_at":null,"body":"I am hunting down a bug that we have traced back to ```sedumi``` not being deterministic. I have a MWE:\r\n```\r\nsed_A = sparse([1e-06 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0.000374569348444187 0 -0.000143510377232224 0 -0.000107308290246781 0 -0.00023475302385101 0 -0.000222588804655496 0 -0.00039621568504792 0 -0.000175372571085547 0 0 0 0 0 0 0 0;0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;0 0 0 1 0 0 0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0 0 0 0 0 0 0 0 0 0 0 0 0 0.00182361766281337 0 0.000300035708922513 0 5.25148072155411e-05 0 0.000172937546376846 0 0.000368772505991557 0 0.000258802261860665 0 9.13124417751099e-05 0 -1 0 0 0 0 0 0;0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.00166011586827782 0 5.08618097827969e-05 0 0.000550274603301129 0 -1.24577387791141e-05 0 2.80912803114481e-05 0 0.000787997869564677 0 0 -1 0 0 0 0 0;0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.00131496023553193 0 -2.85427725918689e-05 0 -6.40917512673142e-05 0 -6.48347565119609e-05 0 -9.88411732133345e-05 0 0 0 -1 0 0 0 0;0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.00116855302122233 0 -1.40653733430151e-05 0 1.38084332511408e-05 0 0.00052463330628182 0 0 0 0 -1 0 0 0;0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.00177126319840008 0 0.000136498835240328 0 -0.000139615027512656 0 0 0 0 0 -1 0 0;0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.00218208935736517 0 -0.000117739846758266 0 0 0 0 0 0 -1 0;0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.00170708755797057 0 0 0 0 0 0 0 -1;-1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0]);\r\nsed_b = [-5e-08;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0];\r\nsed_c = [0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;1;0;0;0;0;0;0;0];\r\nsed_K = struct(sprintf('f'), {0}, sprintf('l'), {17}, sprintf('q'), {[2 2 2 2 2 2 2 8]}, sprintf('r'), {0});\r\npars = struct(sprintf('fid'), {0}, sprintf('maxiter'), {100});\r\n\r\n% run sedumi 200 times, and hash the output:\r\nfor i=1:200\r\n\t[x,y,info] \t= sedumi(sed_A,sed_b,sed_c,sed_K,pars);\r\n\t% get the md5 hash of x:\r\n\tmyhash = java.security.MessageDigest.getInstance('MD5');\r\n\tmyhash.update(typecast(x,'uint8'));\r\n\thstr = lower(sprintf('%02X',typecast(myhash.digest,'uint8')));\r\n\tdisp(hstr);\r\nend\r\n```\r\nIn any one Matlab instance, I tend to get the same results. In different Matlab instances, I can get different output. I have gotten all the following output hashes:\r\n```\r\n1347dafee66c8ff3680ff91ec51cc8bc\r\n01b524f80080f1de14e910d6878ea380\r\n1a8829b52cdf4e970f48ce4c2c0d5003\r\n79f20e7f39ea5e1fba8c06f45d401960\r\n```\r\nand a few more. I have confirmed that the different hashes correspond to different output. Typically the variation is on the order of 1e-7, indicating some kind of single to double conversion might be at fault. \r\n\r\nThis is in Matlab r2007b on a linux machine. I have confirmed the results on a few diffferent linux machines all running r2007b. I have code which sets the random seed used by Matlab, and it does not appear to fix the issue. I have also tried setting ```maxNumCompThreads(1)``` to see if multithreading causes the problem. It does not appear to. \r\n\r\nedit: I am using SeDuMi 1.21\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/sqlp/sedumi/issues/comments/158553719","html_url":"https://github.com/sqlp/sedumi/issues/15#issuecomment-158553719","issue_url":"https://api.github.com/repos/sqlp/sedumi/issues/15","id":158553719,"user":{"login":"robertgj","id":15907883,"avatar_url":"https://avatars.githubusercontent.com/u/15907883?v=3","gravatar_id":"","url":"https://api.github.com/users/robertgj","html_url":"https://github.com/robertgj","followers_url":"https://api.github.com/users/robertgj/followers","following_url":"https://api.github.com/users/robertgj/following{/other_user}","gists_url":"https://api.github.com/users/robertgj/gists{/gist_id}","starred_url":"https://api.github.com/users/robertgj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robertgj/subscriptions","organizations_url":"https://api.github.com/users/robertgj/orgs","repos_url":"https://api.github.com/users/robertgj/repos","events_url":"https://api.github.com/users/robertgj/events{/privacy}","received_events_url":"https://api.github.com/users/robertgj/received_events","type":"User","site_admin":false},"created_at":"2015-11-20T23:15:15Z","updated_at":"2015-11-20T23:15:15Z","body":"The following, copied from the original post, works for me in Octave (built on my machine under Fedora 23 from the octave-4.0.0.tar.xz source without native graphics using \"./configure --without-fltk --disable-gui --disable-java\"):\r\n```\r\nmore off\r\naddpath('SeDuMi_1_3');\r\nsed_A = sparse([1e-06 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0.000374569348444187 0 -0.000143510377232224 0 -0.000107308290246781 0 -0.00023475302385101 0 -0.000222588804655496 0 -0.00039621568504792 0 -0.000175372571085547 0 0 0 0 0 0 0 0;0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0;0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 0 0 0 0 0;0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 0 0 0;0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 0;-2 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;-2 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;-2 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;-2 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0;-2 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0;-2 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0;-2 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0;-2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 0 0 0 0 0 0 0 0;0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.00182361766281337 0 0.000300035708922513 0 5.25148072155411e-05 0 0.000172937546376846 0 0.000368772505991557 0 0.000258802261860665 0 9.13124417751099e-05 0 -1 0 0 0 0 0 0;0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.00166011586827782 0 5.08618097827969e-05 0 0.000550274603301129 0 -1.24577387791141e-05 0 2.80912803114481e-05 0 0.000787997869564677 0 0 -1 0 0 0 0 0;0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.00131496023553193 0 -2.85427725918689e-05 0 -6.40917512673142e-05 0 -6.48347565119609e-05 0 -9.88411732133345e-05 0 0 0 -1 0 0 0 0;0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.00116855302122233 0 -1.40653733430151e-05 0 1.38084332511408e-05 0 0.00052463330628182 0 0 0 0 -1 0 0 0;0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.00177126319840008 0 0.000136498835240328 0 -0.000139615027512656 0 0 0 0 0 -1 0 0;0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.00218208935736517 0 -0.000117739846758266 0 0 0 0 0 0 -1 0;0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.00170708755797057 0 0 0 0 0 0 0 -1;-1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0]);\r\nsed_b = [-5e-08;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0];\r\nsed_c = [0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;1;0;0;0;0;0;0;0];\r\nsed_K = struct(sprintf('f'), {0}, sprintf('l'), {17}, sprintf('q'), {[2 2 2 2 2 2 2 8]}, sprintf('r'), {0});\r\npars = struct(sprintf('fid'), {0}, sprintf('maxiter'), {100});\r\n\r\n% run sedumi 200 times, and hash the output:\r\nfor i=1:200\r\n  [x,y,info]  = sedumi(sed_A,sed_b,sed_c,sed_K,pars);\r\n  myhash=md5sum(x,true);\r\n  disp(myhash);\r\n  if strcmp(myhash,'93b885adfe0da089cdf634904fd59f71')==false\r\n    error('Expected myhash to be 93b885adfe0da089cdf634904fd59f71');\r\n  endif\r\nend\r\n```"}}