Changeset 29
- Timestamp:
- Dec 13, 2009, 2:14:22 PM (15 years ago)
- Location:
- liacs/nc/low-correlation
- Files:
-
- 1 edited
- 4 moved
Legend:
- Unmodified
- Added
- Removed
-
liacs/nc/low-correlation/Makefile
r27 r29 2 2 CFLAGS=-lm 3 3 4 all: $(BIN) 5 6 run: $(BIN) 7 ./$(BIN) 4 mcs.out: mcs.m 5 @octave -q mcs.m -
liacs/nc/low-correlation/brute-force-fitness.c
r27 r29 12 12 int main(int argc, char *argv[]) { 13 13 14 const int SIZE = 50;14 const int SIZE = 20; 15 15 int * signal = malloc(SIZE * sizeof(int)); 16 16 int e_total, e_sub; -
liacs/nc/low-correlation/mcs.m
r28 r29 9 9 s = rand(n,1); 10 10 s = round(s); 11 s = (s == 0) .- 1 11 s = (s == 0) .- 1; 12 12 13 13 % Find whether we are better than everything else 14 fitness = SHG(s) 14 fitness = SHG(s); 15 15 if (fitness > best_fitness) 16 16 best_array = s; 17 best_fitness = fitness ;17 best_fitness = fitness 18 18 % Little hack to display output nicely 19 printf("%f", fitness);20 19 disp(rot90(s,-1)); 21 20 endif
Note:
See TracChangeset
for help on using the changeset viewer.