[MOAB-dev] r5661 - MOAB/trunk/src/moab/point_locater
rhl6856 at mcs.anl.gov
rhl6856 at mcs.anl.gov
Fri Aug 3 13:37:19 CDT 2012
Author: rhl6856
Date: 2012-08-03 13:37:19 -0500 (Fri, 03 Aug 2012)
New Revision: 5661
Modified:
MOAB/trunk/src/moab/point_locater/element_tree.hpp
Log:
debugging tree
Modified: MOAB/trunk/src/moab/point_locater/element_tree.hpp
===================================================================
--- MOAB/trunk/src/moab/point_locater/element_tree.hpp 2012-08-03 18:37:18 UTC (rev 5660)
+++ MOAB/trunk/src/moab/point_locater/element_tree.hpp 2012-08-03 18:37:19 UTC (rev 5661)
@@ -12,19 +12,36 @@
#include <iostream>
#include <map>
#include <algorithm>
+#include <deque>
+#include <bitset>
#ifndef ELEMENT_TREE_HPP
#define ELEMENT_TREE_HPP
-
namespace moab {
//forward declarations
+template< typename T>
+void print_vector( const T & v){
+ typedef typename T::const_iterator Iterator;
+ std::cout << "[ ";
+ for(Iterator i = v.begin(); i != v.end(); ++i){
+ std::cout << *i;
+ if( i+1 != v.end()){
+ std::cout << ", ";
+ }
+ }
+ std::cout << " ]" << std::endl;
+}
struct Box{
typedef typename std::vector< double> Vector;
Box(): max(3,0.0), min(3,0.0){}
- Box( const Vector & max_, const Vector & min_): max(max_), min(min_){}
Box( const Box & from): max( from.max), min( from.min){}
+ Box& operator=( const Box & from){
+ max = from.max;
+ min = from.min;
+ return *this;
+ }
Vector max;
Vector min;
}; //Box
@@ -38,10 +55,13 @@
template< typename Data>
struct Split_comparator {
+ //max - min for correctness. it *might* be slightly slower
+ //but that is unlikely. compiler should optimize this.
const std::size_t split_objective( const Data & a) const {
- return std::abs( a.left - a.right) + a.middle*a.middle;
More information about the moab-dev
mailing list