29 int main(
int argc,
char** argv )
31 int num_queries = 1000000;
35 cout <<
"Usage: " << argv[0] <<
" <filename> [num_queries]" << endl;
41 num_queries = atoi( argv[2] );
77 for(
int i = 0; i < num_queries; i++ )
79 pos = box.
bMin +
CartVect( box_extents[0] * .01 * ( rand() % 100 ), box_extents[1] * .01 * ( rand() % 100 ),
80 box_extents[2] * .01 * ( rand() % 100 ) );
82 if( is_inside ) num_inside++;
85 cout <<
"Mesh contains " << elems.
size() <<
" elements of type "
87 cout <<
"Bounding box min-max = (" << box.
bMin[0] <<
"," << box.
bMin[1] <<
"," << box.
bMin[2] <<
")-("
88 << box.
bMax[0] <<
"," << box.
bMax[1] <<
"," << box.
bMax[2] <<
")" << endl;
89 cout <<
"Queries inside box = " << num_inside <<
"/" << num_queries <<
" = "
90 << 100.0 * ( (double)num_inside ) / num_queries <<
"%" << endl;