[MOAB-dev] r5665 - MOAB/trunk/src/moab/point_locater

rhl6856 at mcs.anl.gov rhl6856 at mcs.anl.gov
Fri Aug 3 13:37:22 CDT 2012


Author: rhl6856
Date: 2012-08-03 13:37:22 -0500 (Fri, 03 Aug 2012)
New Revision: 5665

Modified:
   MOAB/trunk/src/moab/point_locater/element_tree.hpp
Log:
linear sort working

Modified: MOAB/trunk/src/moab/point_locater/element_tree.hpp
===================================================================
--- MOAB/trunk/src/moab/point_locater/element_tree.hpp	2012-08-03 18:37:21 UTC (rev 5664)
+++ MOAB/trunk/src/moab/point_locater/element_tree.hpp	2012-08-03 18:37:22 UTC (rev 5665)
@@ -9,10 +9,10 @@
  * the diving line. We build a tree on the mesh with this property.
  */
 #include <vector>
+#include <set>
 #include <iostream>
 #include <map>
 #include <algorithm>
-#include <deque>
 #include <bitset>
 #include <numeric>
 #include <cmath>
@@ -329,26 +329,21 @@
 		const bool on_left = (box.max[ dim] < split);
 		const bool on_right = (box.min[ dim] > split);
 		const bool in_middle = !on_left && !on_right;
-		//TODO: remove branch
-		int side;
-		if(in_middle){
-			side=1;
+		//set the corresponding bits in the bit vector
+		// looks like: [x_1 = 00 | x_2 = 00 | .. | z_1 = 00 | z_2 = 00]
+		// two bits, left = 00, middle = 01, right = 10
+		const int index = 4*dim + 2*iteration;
+		if( on_left){ split_data.sizes[ 0]++; }
+		else if(in_middle){
+			split_data.sizes[ 1]++;
+			bits.set( index, 1);
 			left_line  = std::min( left_line,  box.min[ dim]);
 			right_line = std::max( right_line, box.max[ dim]);
-		}else if( on_left){
-			side=0;
 		}else if( on_right){
-			side=2;
+			bits.set( index+1, 1);
+			split_data.sizes[ 2]++;
 		}
-		//keep track of partition data,
-		split_data.sizes[ side]++;
-		//set the corresponding bits in the bit vector
-		// looks like: [x_1 = 00 | x_2 = 00 | .. | z_1 = 00 | z_2 = 00]
-		// two bits, but we encode 2 as 11 _not_ 10
-		const int index = 4*dim + 2*iteration;
-		bits.set( index, side>0);
-		bits.set( index+1, side==2);
-	}	
+	}


More information about the moab-dev mailing list