Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] View of /branches/vis15/src/tests/sqprnt/run.sh
ViewVC logotype

View of /branches/vis15/src/tests/sqprnt/run.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4525 - (download) (as text) (annotate)
Tue Sep 6 21:15:11 2016 UTC (3 years ago) by jhr
File size: 1529 byte(s)
  adding vector test
#!/bin/sh

eps=0.00002
vmin=$(echo 0 | unu 2op nrand - 3 | unu save -f text)
vmax=$(echo 10 | unu 2op nrand - 3 | unu save -f text)
voff=($(echo "0 0 0 0" | unu 2op nrand - 3 | unu save -f text))
vnum=$(echo 300 | unu 2op nrand - 30 | unu 2op max - 100 | unu convert -t int | unu save -f text)

echo "${voff[@]} ${voff[@]}" | unu reshape -s 4 2 -o base.txt;
echo "$vmin $vmax" | unu reshape -s 2 | unu axinsert -a 0 -s 4 | unu 2op + - base.txt |
unu resample -s = $vnum -k tent -c node -o vec4.nrrd
unu crop -i vec4.nrrd -min 0 0 -max M-1 M -o vec3.nrrd
unu crop -i vec4.nrrd -min 0 0 -max M-2 M -o vec2.nrrd
unu slice -i vec4.nrrd -a 0 -p 0 -o vec1.nrrd

rm -f sqp?

for TT in "" "--double"; do
    for II in 1 2 3 4; do  # I: expected vector size
        echo "====================== compiling $II $TT"
        ../../../bin/diderotc --check-all $TT --exec sqp${II}.diderot
        for JJ in 1 2 3 4; do # J: given vector size
            echo "======= running on vec${JJ}.nrrd"
            cp vec${JJ}.nrrd vec.nrrd
            #echo "./sqp${II} -vmm $vmin $vmax -voff ${voff[@]:0:$II}"
            if ! ./sqp${II} -vmm $vmin $vmax -voff ${voff[@]:0:$II}; then
                continue;
            fi
            # else program ran ok
            err=$(unu minmax err.nrrd | grep max: | cut -d' ' -f 2)
echo "err = $err"
            bad=$(echo $err | unu 1op abs | unu 2op gt - $eps | unu save -f text)
            if [[ $bad == 1 ]]; then
                echo "ERROR: |$err| > $eps"
            fi
        done
    done
done

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0