-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtable.sh
More file actions
53 lines (47 loc) · 1.52 KB
/
table.sh
File metadata and controls
53 lines (47 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/usr/bin/env sh
echo " | Dimension | Status | Number | # polar | # simplicial | # stab | # cs | Size | Download |"
echo " | --------- | ------ | ------ | ------- | ------------ | ------ | ---- | ---- | -------- |"
function known {
d="$1"
all="db/src/$d"
n="$(wc -l < "$all")"
size="$(wc -c < "$all" | human)"
>&2 echo "Generating line for dimension $d ~ $n items"
gz="db/gz/$d"
xz="db/xz/$d"
if [ ! -e "$gz" ] ; then
>&2 echo "Gzipping dimension $d to $gz"
gzip -cn -9 "$all" > "$gz"
fi
if [ ! -e "$xz" ] ; then
>&2 echo "Xzipping dimension $d to $xz"
xz -c -9 "$all" > "$xz"
fi
>&2 echo "Adding $gz to ipfs"
igz="$(ipfs add -q "$gz")"
sgz="$(wc -c < "$gz" | human)"
>&2 echo "$gz hash is $igz"
>&2 echo "Adding $xz to ipfs"
ixz="$(ipfs add -q "$xz")"
sxz="$(wc -c < "$xz" | human)"
>&2 echo "$xz hash is $ixz"
>&2 echo "Counting simplicial for dimension $d"
npolar="$(./run/count_polar < "$all" 2>/dev/null)"
>&2 echo "Counting stab for dimension $d"
nsimplicial="$(./run/count_has_simplicial < "$all" 2>/dev/null)"
>&2 echo "Counting polar for dimension $d"
nstab="$(./run/count_stab < "$all" 2>/dev/null)"
>&2 echo "Counting cs for dimension $d"
ncs="$(./run/count_cs < "$all" 2>/dev/null)"
echo " | $d | Done | $n | $npolar | $nsimplicial | $nstab | $ncs | $size | [gzip ($sgz)](https://ipfs.io/ipfs/$igz), [xz ($sxz)](https://ipfs.io/ipfs/$ixz) |"
}
function unknown {
d="$1"
echo " | $d | ? | ? | ? | ? | ? | ? | ? | ? |"
}
mkdir -p db/gz
mkdir -p db/xz
for d in $(seq 0 8); do
known "$d"
done
unknown 9