summaryrefslogtreecommitdiffstats
path: root/01-knapsack/each
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2013-07-03 14:29:47 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2013-07-03 14:29:47 +0200
commita4a6f22f3fd665f224d9f199d2326d3be43141ba (patch)
tree2a9dab5347085f772b624fa56f91e547a3e594b6 /01-knapsack/each
parent1a1515b5eb60e4dc049256d0498f4fb0f0c29b23 (diff)
downloadcoursera-a4a6f22f3fd665f224d9f199d2326d3be43141ba.zip
coursera-a4a6f22f3fd665f224d9f199d2326d3be43141ba.tar.gz
Discrete : 01-knapsack: dynamic programming solver + malloc error when to many values
Diffstat (limited to '01-knapsack/each')
-rwxr-xr-x01-knapsack/each28
1 files changed, 28 insertions, 0 deletions
diff --git a/01-knapsack/each b/01-knapsack/each
new file mode 100755
index 0000000..ba6940a
--- /dev/null
+++ b/01-knapsack/each
@@ -0,0 +1,28 @@
+#! /bin/bash
+
+BIN=${BIN:-ks_dp}
+${CC:-clang} -O2 -pedantic -Wall -o $BIN $BIN.c || exit 1
+
+DATA="ks_4_0
+ks_19_0
+ks_30_0
+ks_40_0
+ks_45_0
+ks_50_0
+ks_50_1
+ks_60_0
+ks_100_0
+ks_100_1
+ks_100_2
+ks_200_0
+ks_200_1
+ks_300_0
+ks_400_0
+ks_500_0
+ks_1000_0
+ks_10000_0
+"
+for I in $DATA; do
+ echo " *** $I $@"
+ ./$BIN ./data/$I $@
+done