changeset 68:5510ac95a3d3

last minute fixes
author Jordi Gutiérrez Hermoso <jordigh@octave.org>
date Wed, 18 May 2016 18:06:22 -0400
parents 1aa38f4846e0
children 456e3f722147
files talk/code/show_mc.py talk/code/showalgo.m
diffstat 2 files changed, 20 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/talk/code/show_mc.py
+++ b/talk/code/show_mc.py
@@ -19,7 +19,7 @@
 
 # You should have received a copy of the GNU General Public License
 # along with this program. If not, see <http://www.gnu.org/licenses/>.
-
+import sys
 
 import numpy as np
 
@@ -261,7 +261,11 @@
 
 
 def main():
-    data = np.random.uniform(size=26)
+    if len(sys.argv) < 2:
+        print "Need a size"
+        exit(1)
+    
+    data = np.random.uniform(size=int(sys.argv[1]))
 
     mc = medcouple_1d(data)
     with open("mc", "w") as f:
--- a/talk/code/showalgo.m
+++ b/talk/code/showalgo.m
@@ -16,6 +16,10 @@
 
 origH = repmat((H+1)/2, 1, 1, 3);
 
+graphics_toolkit fltk;
+figure
+pause
+
 for iter = 1:length(Am)
   ## Reset the image
   imgH = origH;
@@ -94,10 +98,17 @@
   [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
 
+  imshow(imgH);
+  printf("rank is between %d and %d (target: %d)\n",
+         Ptot(iter), Qtot(iter), medc_idx)
+  pause
+
 endfor
+
+if (jackpot)
+  printf("Jackpot!\n")
+endif
+pause