1#! /bin/bash
2
3echo Generating dataset
4../Generator 1000 > d
5awk '{if ($2 != 2) print $0}' < d > data
6awk '{if ($2 == 2) print $0}' < d > queries
7rm -rf d
8
9echo Creating new MVR-Tree
10../MVRTreeLoad data tree 20 intersection
11
12echo Querying MVR-Tree
13../MVRTreeQuery queries tree intersection > res
14cat data queries > .t
15
16echo Running exhaustive search
17../Exhaustive .t intersection > res2
18
19echo Comparing results
20sort -n res > a
21sort -n res2 > b
22if diff a b
23then
24echo "Same results with exhaustive search. Everything seems fine."
25echo Results: `wc -l a`
26rm -rf a b res res2 .t tree.*
27else
28echo "PROBLEM! We got different results from exhaustive search!"
29fi
30