Mercurial > hg > medcouple
diff talk/code/showalgo.m @ 67:1aa38f4846e0
showalgo: show the rank
author | Jordi GutiƩrrez Hermoso <jordigh@octave.org> |
---|---|
date | Wed, 18 May 2016 17:43:45 -0400 (2016-05-18) |
parents | 916349600c4b |
children | 5510ac95a3d3 |
line wrap: on
line diff
--- a/talk/code/showalgo.m +++ b/talk/code/showalgo.m @@ -9,6 +9,7 @@ mc = load("mc"); jackpot = load("jackpot"); Am = load("Am"); +medc_idx = load("medc_idx"); Am(end+1) = mc; colidx = 1:columns(H); @@ -18,7 +19,7 @@ for iter = 1:length(Am) ## Reset the image imgH = origH; - + ## Make greater-than red red = imgH(:,:,1); red(colidx < L(iter, :)') = 1; @@ -29,6 +30,7 @@ blue(colidx > R(iter, :)') = 1; imgH(:, :, 3) = blue; + printf("Remaining: %d\n", remaining(iter)) imshow(imgH); pause @@ -54,7 +56,7 @@ ## Brighten blue blue(idx) = 1; - + ## Dim red and green red(idx) .*= 0.5; green(idx) .*= 0.5; @@ -66,7 +68,7 @@ [i,j] = find(Am(iter) == H); imgH(i,j,1) = imgH(i,j,2) = 1; imgH(i,j,3) = 0; - + imshow(imgLeft); pause @@ -80,7 +82,7 @@ ## Brighten red blue(idx) = 1; - + ## Dim blue and green blue(idx) .*= 0.5; green(idx) .*= 0.5; @@ -92,7 +94,9 @@ [i,j] = find(Am(iter) == H); imgH(i,j,1) = imgH(i,j,2) = 1; imgH(i,j,3) = 0; - + + printf("rank is between %d and %d (target: %d)\n", + Ptot(iter), Qtot(iter), medc_idx) imshow(imgRight); pause