[MOAB-dev] r4249 - in MOAB/trunk/src: . moab parallel
tautges at mcs.anl.gov
tautges at mcs.anl.gov
Wed Nov 3 20:02:37 CDT 2010
Author: tautges
Date: 2010-11-03 20:02:37 -0500 (Wed, 03 Nov 2010)
New Revision: 4249
Modified:
MOAB/trunk/src/Range.cpp
MOAB/trunk/src/moab/Range.hpp
MOAB/trunk/src/parallel/ParallelComm.cpp
Log:
- Added double Range::compactness(), which returns get_memory_use()/size()*sizeof(EntityHandle).
- Made Range::index inlined.
- Report range compactness in a few places in ParallelComm (commented out by default)
Modified: MOAB/trunk/src/Range.cpp
===================================================================
--- MOAB/trunk/src/Range.cpp 2010-11-03 20:59:53 UTC (rev 4248)
+++ MOAB/trunk/src/Range.cpp 2010-11-04 01:02:37 UTC (rev 4249)
@@ -971,21 +971,6 @@
}
-int Range::index(EntityHandle handle) const
-{
- if (handle < *begin() || handle > *rbegin()) return -1;
-
- unsigned int i = 0;
- Range::const_pair_iterator pit = const_pair_begin();
- while (handle > (*pit).second && pit != const_pair_end()) {
- i += (*pit).second - (*pit).first + 1;
- pit++;
- }
- if (handle < (*pit).first || pit == const_pair_end()) return -1;
-
- return i + handle - (*pit).first;
-}
-
//! return a subset of this range, by type
Range Range::subset_by_type(EntityType t) const
{
Modified: MOAB/trunk/src/moab/Range.hpp
===================================================================
--- MOAB/trunk/src/moab/Range.hpp 2010-11-03 20:59:53 UTC (rev 4248)
+++ MOAB/trunk/src/moab/Range.hpp 2010-11-04 01:02:37 UTC (rev 4249)
@@ -325,6 +325,8 @@
unsigned long get_memory_use() const;
+ double compactness() const;
+
void insert( Range::const_iterator begin,
Range::const_iterator end );
@@ -836,6 +838,27 @@
i += index;
return *i;
}
+
+inline int Range::index(EntityHandle handle) const
+{
+ if (handle < *begin() || handle > *rbegin()) return -1;
+
+ unsigned int i = 0;
+ Range::const_pair_iterator pit = const_pair_begin();
More information about the moab-dev
mailing list