Commit 5deef6d1 authored by Célestin Marot's avatar Célestin Marot
Browse files

uniform distribution instead of worst case scenario

parent f77edb6f
......@@ -112,37 +112,38 @@ status_t create_nodes(bbox_t* bbox, vertex_t** vertices_p, uint32_t npts)
{
HXT_CHECK( HXT_malloc(vertices_p, sizeof(vertex_t)*npts) );
// for (uint32_t i=0; i<npts; i++) {
// (*vertices_p)[i].coord[0] = (double) rand()/RAND_MAX;
// (*vertices_p)[i].coord[1] = (double) rand()/RAND_MAX;
// (*vertices_p)[i].coord[2] = (double) rand()/RAND_MAX;
// }
// bbox->min[0] = 0.0;
// bbox->min[1] = 0.0;
// bbox->min[2] = 0.0;
// bbox->max[0] = 1.0;
// bbox->max[1] = 1.0;
// bbox->max[2] = 1.0;
for(uint32_t i=0; i<npts/2; i++) {
(*vertices_p)[i].coord[0] = 0.0;
(*vertices_p)[i].coord[1] = 2.0*i/npts;
(*vertices_p)[i].coord[2] = 0.5;
}
for(uint32_t i=npts/2; i<npts; i++) {
(*vertices_p)[i].coord[0] = 1.0;
(*vertices_p)[i].coord[1] = 0.5;
(*vertices_p)[i].coord[2] = 2.0*(i - npts/2)/npts;
for (uint32_t i=0; i<npts; i++) {
(*vertices_p)[i].coord[0] = (double) rand()/RAND_MAX;
(*vertices_p)[i].coord[1] = (double) rand()/RAND_MAX;
(*vertices_p)[i].coord[2] = (double) rand()/RAND_MAX;
}
bbox->min[0] = 0.0;
bbox->min[1] = 0.0;
bbox->min[2] = 0.0;
bbox->max[0] = 1.0;
bbox->max[1] = 2.0*(npts-1)/npts;
bbox->max[2] = 2.0*(npts - 1 - npts/2)/npts;
bbox->max[1] = 1.0;
bbox->max[2] = 1.0;
// // worst case scenario
// for(uint32_t i=0; i<npts/2; i++) {
// (*vertices_p)[i].coord[0] = 0.0;
// (*vertices_p)[i].coord[1] = 2.0*i/npts;
// (*vertices_p)[i].coord[2] = 0.5;
// }
// for(uint32_t i=npts/2; i<npts; i++) {
// (*vertices_p)[i].coord[0] = 1.0;
// (*vertices_p)[i].coord[1] = 0.5;
// (*vertices_p)[i].coord[2] = 2.0*(i - npts/2)/npts;
// }
// bbox->min[0] = 0.0;
// bbox->min[1] = 0.0;
// bbox->min[2] = 0.0;
// bbox->max[0] = 1.0;
// bbox->max[1] = 2.0*(npts-1)/npts;
// bbox->max[2] = 2.0*(npts - 1 - npts/2)/npts;
return HXT_STATUS_OK;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment