Index: liacs/nc/laser-pulse-shaping/SHG.m
===================================================================
--- liacs/nc/laser-pulse-shaping/SHG.m	(revision 28)
+++ 	(revision )
@@ -1,44 +1,0 @@
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% This function calculates the Second Harmonic Generation
-% of a Gaussian of frequencies with a given phase function.
-%
-%    phi - an input COLUMN vector, containing the phase function.
-%    SHG - the output of the calculation; scalar.
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-function [SHG] = SHG(phi);
-
-%constant for consistency with the Fortran Calculation...
-c_fortran = 153.7687;
-
-% Generate the Gaussian and the phase function consistently.
-Np = length(phi(:,1));
-Nv = 4000;
-v = linspace(-300,300,Nv); %Linearly Spaced Vector
-G = 40;
-Ain = exp(-(v/G).^2); %The Gaussian of Frequencies
-
-%Distribute the phase function according to the desired resolution
-step = round((2600-1400)/Np);
-step = step + (step==1);
-phase = zeros(1,Nv);
-k = 1;
-for j = 1400:step:2600-step+1,
-    phase([j:j+step-1]) = phi(k);
-    if (k < Np)
-        k = k+1;
-    else
-        k = Np;
-    end
-end
-    % *** The Core: SHG *** %
-
-%Fourier Transform with phase shift (phi) on the Gaussian *Ain*
-E_t = fftshift(ifft(fftshift(exp(i*phase).*Ain)));
-
-%plot(abs(E_t));
-%Integrate the result to yield the SHG
-SHG = sum(abs(E_t).^4)/c_fortran;
-
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%% E O F %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Index: liacs/nc/laser-pulse-shaping/debug.sh
===================================================================
--- liacs/nc/laser-pulse-shaping/debug.sh	(revision 28)
+++ 	(revision )
@@ -1,6 +1,0 @@
-#!/bin/sh
-while true; do 
-    date
-    make
-    sleep 5
-done
Index: liacs/nc/laser-pulse-shaping/mcs.m
===================================================================
--- liacs/nc/laser-pulse-shaping/mcs.m	(revision 28)
+++ 	(revision )
@@ -1,23 +1,0 @@
-% Monte-Carlo Search Algoritm on low-autocorrelation program
-% BSDLicence
-% Rick van der Zwet - 0433373 - <hvdzwet@liacs.nl>
-
-best_fitness = 0;
-while (1)
-    % Generate a column s={-1,1}^n
-    n = 20;
-    s = rand(n,1);
-    s = round(s);
-    s = (s == 0) .- 1
-
-    % Find whether we are better than everything else
-    fitness = SHG(s)
-    if (fitness > best_fitness)
-        best_array = s;
-        best_fitness = fitness;
-        % Little hack to display output nicely
-        printf("%f", fitness);
-        disp(rot90(s,-1));
-    endif
-endwhile
-
Index: liacs/nc/low-correlation/Makefile
===================================================================
--- liacs/nc/low-correlation/Makefile	(revision 28)
+++ liacs/nc/low-correlation/Makefile	(revision 29)
@@ -2,6 +2,4 @@
 CFLAGS=-lm
 
-all: $(BIN)
-
-run: $(BIN)
-	./$(BIN)
+mcs.out: mcs.m
+	@octave -q mcs.m
Index: liacs/nc/low-correlation/SHG.m
===================================================================
--- liacs/nc/low-correlation/SHG.m	(revision 29)
+++ liacs/nc/low-correlation/SHG.m	(revision 29)
@@ -0,0 +1,44 @@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% This function calculates the Second Harmonic Generation
+% of a Gaussian of frequencies with a given phase function.
+%
+%    phi - an input COLUMN vector, containing the phase function.
+%    SHG - the output of the calculation; scalar.
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+function [SHG] = SHG(phi);
+
+%constant for consistency with the Fortran Calculation...
+c_fortran = 153.7687;
+
+% Generate the Gaussian and the phase function consistently.
+Np = length(phi(:,1));
+Nv = 4000;
+v = linspace(-300,300,Nv); %Linearly Spaced Vector
+G = 40;
+Ain = exp(-(v/G).^2); %The Gaussian of Frequencies
+
+%Distribute the phase function according to the desired resolution
+step = round((2600-1400)/Np);
+step = step + (step==1);
+phase = zeros(1,Nv);
+k = 1;
+for j = 1400:step:2600-step+1,
+    phase([j:j+step-1]) = phi(k);
+    if (k < Np)
+        k = k+1;
+    else
+        k = Np;
+    end
+end
+    % *** The Core: SHG *** %
+
+%Fourier Transform with phase shift (phi) on the Gaussian *Ain*
+E_t = fftshift(ifft(fftshift(exp(i*phase).*Ain)));
+
+%plot(abs(E_t));
+%Integrate the result to yield the SHG
+SHG = sum(abs(E_t).^4)/c_fortran;
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%% E O F %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Index: liacs/nc/low-correlation/brute-force-fitness.c
===================================================================
--- liacs/nc/low-correlation/brute-force-fitness.c	(revision 29)
+++ liacs/nc/low-correlation/brute-force-fitness.c	(revision 29)
@@ -0,0 +1,68 @@
+/* 
+ * Low-autocorrelation problem of binary sequences
+ * 'Brute-force' method
+ * Rick van der Zwet, Oct 2009
+ * Licence: BSD
+ */
+#include <sysexits.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+
+int main(int argc, char *argv[]) {
+
+const int SIZE = 20;
+int * signal = malloc(SIZE * sizeof(int));
+int e_total, e_sub;
+// Temp counters
+int i,k;
+long int n;
+float f_y;
+
+long int best_number = 0;
+float best_value = 0;
+
+void print_array(long int number, float result) {
+    for(i = 0; i < SIZE; i++) {
+        if (number & (1 << i)) {
+            printf("+");
+        } else {
+            printf("-");
+        }
+    }
+    printf(" = %f\n", result);
+}
+
+// All values to be determined
+for (n = 0; n < pow(2,SIZE); n++) {
+    // Make array ready
+    for (i = 0; i < SIZE; i++) {
+        signal[i] =  (n & (1 << i)) ? 1 : -1;
+    }
+
+    // Calculate E(y)
+    e_total = 0;
+    for(k = 1; k < SIZE; k++) {
+        e_sub = 0;
+        for(i = 0; i < SIZE - k; i++) {
+            e_sub += signal[i] * signal[i+k];
+        //printf("[k:%i i:%i] %i\n", k, i, signal[i] * signal[i+k]);
+        }
+        // Power of two
+        e_total += pow(e_sub,2);
+    }
+    f_y = pow((float)SIZE,2)/(2 * e_total);
+
+    // Save best value
+    if (f_y >= best_value) {
+        print_array(n,f_y);
+        best_value = f_y;
+        best_number = n;
+    }
+
+}
+
+// Clean up mess
+free(signal);
+return EX_OK;
+}
Index: liacs/nc/low-correlation/debug.sh
===================================================================
--- liacs/nc/low-correlation/debug.sh	(revision 29)
+++ liacs/nc/low-correlation/debug.sh	(revision 29)
@@ -0,0 +1,6 @@
+#!/bin/sh
+while true; do 
+    date
+    make
+    sleep 5
+done
Index: liacs/nc/low-correlation/main.c
===================================================================
--- liacs/nc/low-correlation/main.c	(revision 28)
+++ 	(revision )
@@ -1,68 +1,0 @@
-/* 
- * Low-autocorrelation problem of binary sequences
- * 'Brute-force' method
- * Rick van der Zwet, Oct 2009
- * Licence: BSD
- */
-#include <sysexits.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-
-int main(int argc, char *argv[]) {
-
-const int SIZE = 50;
-int * signal = malloc(SIZE * sizeof(int));
-int e_total, e_sub;
-// Temp counters
-int i,k;
-long int n;
-float f_y;
-
-long int best_number = 0;
-float best_value = 0;
-
-void print_array(long int number, float result) {
-    for(i = 0; i < SIZE; i++) {
-        if (number & (1 << i)) {
-            printf("+");
-        } else {
-            printf("-");
-        }
-    }
-    printf(" = %f\n", result);
-}
-
-// All values to be determined
-for (n = 0; n < pow(2,SIZE); n++) {
-    // Make array ready
-    for (i = 0; i < SIZE; i++) {
-        signal[i] =  (n & (1 << i)) ? 1 : -1;
-    }
-
-    // Calculate E(y)
-    e_total = 0;
-    for(k = 1; k < SIZE; k++) {
-        e_sub = 0;
-        for(i = 0; i < SIZE - k; i++) {
-            e_sub += signal[i] * signal[i+k];
-        //printf("[k:%i i:%i] %i\n", k, i, signal[i] * signal[i+k]);
-        }
-        // Power of two
-        e_total += pow(e_sub,2);
-    }
-    f_y = pow((float)SIZE,2)/(2 * e_total);
-
-    // Save best value
-    if (f_y >= best_value) {
-        print_array(n,f_y);
-        best_value = f_y;
-        best_number = n;
-    }
-
-}
-
-// Clean up mess
-free(signal);
-return EX_OK;
-}
Index: liacs/nc/low-correlation/mcs.m
===================================================================
--- liacs/nc/low-correlation/mcs.m	(revision 29)
+++ liacs/nc/low-correlation/mcs.m	(revision 29)
@@ -0,0 +1,22 @@
+% Monte-Carlo Search Algoritm on low-autocorrelation program
+% BSDLicence
+% Rick van der Zwet - 0433373 - <hvdzwet@liacs.nl>
+
+best_fitness = 0;
+while (1)
+    % Generate a column s={-1,1}^n
+    n = 20;
+    s = rand(n,1);
+    s = round(s);
+    s = (s == 0) .- 1;
+
+    % Find whether we are better than everything else
+    fitness = SHG(s);
+    if (fitness > best_fitness)
+        best_array = s;
+        best_fitness = fitness
+        % Little hack to display output nicely
+        disp(rot90(s,-1));
+    endif
+endwhile
+
