Guest User

Untitled

a guest
Oct 18th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.90 KB | None | 0 0
  1.     for (int i = 1; i < box_count; i++) {
  2.  
  3.         int box_morton = flat_tree->at(i)->morton_box();
  4.        
  5.         float adaptive_str_sum = 0.0f;
  6.         float regular_str_sum = 0.0f;
  7.  
  8.         int mortoncount = boxes[box_morton-1].y - boxes[box_morton-1].x;
  9.         int adaptivecount = flat_tree->at(i)->recv_end - flat_tree->at(i)->recv_start;
  10.  
  11.         for (int j = flat_tree->at(i)->recv_start; j < flat_tree->at(i)->recv_end; j++) {
  12.             adaptive_str_sum += adaptive_sort_particles[j].particle.w;
  13.         }
  14.  
  15.         for (int j = boxes[box_morton-1].x; j < boxes[box_morton-1].y; j++) {
  16.             regular_str_sum += sort_particles[j].data.w;
  17.         }
  18.  
  19.         if (mortoncount!=adaptivecount) {
  20.             sorting_passed = false;
  21.             break;
  22.         }
  23.  
  24.         if (fabs(adaptive_str_sum-regular_str_sum) > 0.1) {
  25.             sorting_passed = false;
  26.             break;
  27.         }
  28.            
  29.     }
  30.  
  31.     if (sorting_passed) printf("sorting passed, carrying on!\n"); else {printf("sorting failed, shutting down!\n"); exit(0);}
Add Comment
Please, Sign In to add comment