TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
BIH::BuildStats Class Reference

#include <BoundingIntervalHierarchy.h>

Public Member Functions

 BuildStats ()
 
void updateInner ()
 
void updateBVH2 ()
 
void updateLeaf (int depth, int n)
 
void printStats ()
 

Private Attributes

int numNodes
 
int numLeaves
 
int sumObjects
 
int minObjects
 
int maxObjects
 
int sumDepth
 
int minDepth
 
int maxDepth
 
int numLeavesN [6]
 
int numBVH2
 

Constructor & Destructor Documentation

BIH::BuildStats::BuildStats ( )
inline
374  :
375  numNodes(0), numLeaves(0), sumObjects(0), minObjects(0x0FFFFFFF),
376  maxObjects(0xFFFFFFFF), sumDepth(0), minDepth(0x0FFFFFFF),
377  maxDepth(0xFFFFFFFF), numBVH2(0)
378  {
379  for (int i=0; i<6; ++i) numLeavesN[i] = 0;
380  }
int maxObjects
Definition: BoundingIntervalHierarchy.h:366
int minObjects
Definition: BoundingIntervalHierarchy.h:365
int sumDepth
Definition: BoundingIntervalHierarchy.h:367
int numLeaves
Definition: BoundingIntervalHierarchy.h:363
int numBVH2
Definition: BoundingIntervalHierarchy.h:371
int minDepth
Definition: BoundingIntervalHierarchy.h:368
int numNodes
Definition: BoundingIntervalHierarchy.h:362
int numLeavesN[6]
Definition: BoundingIntervalHierarchy.h:370
int maxDepth
Definition: BoundingIntervalHierarchy.h:369
int sumObjects
Definition: BoundingIntervalHierarchy.h:364

Member Function Documentation

void BIH::BuildStats::printStats ( )
292 {
293  printf("Tree stats:\n");
294  printf(" * Nodes: %d\n", numNodes);
295  printf(" * Leaves: %d\n", numLeaves);
296  printf(" * Objects: min %d\n", minObjects);
297  printf(" avg %.2f\n", (float) sumObjects / numLeaves);
298  printf(" avg(n>0) %.2f\n", (float) sumObjects / (numLeaves - numLeavesN[0]));
299  printf(" max %d\n", maxObjects);
300  printf(" * Depth: min %d\n", minDepth);
301  printf(" avg %.2f\n", (float) sumDepth / numLeaves);
302  printf(" max %d\n", maxDepth);
303  printf(" * Leaves w/: N=0 %3d%%\n", 100 * numLeavesN[0] / numLeaves);
304  printf(" N=1 %3d%%\n", 100 * numLeavesN[1] / numLeaves);
305  printf(" N=2 %3d%%\n", 100 * numLeavesN[2] / numLeaves);
306  printf(" N=3 %3d%%\n", 100 * numLeavesN[3] / numLeaves);
307  printf(" N=4 %3d%%\n", 100 * numLeavesN[4] / numLeaves);
308  printf(" N>4 %3d%%\n", 100 * numLeavesN[5] / numLeaves);
309  printf(" * BVH2 nodes: %d (%3d%%)\n", numBVH2, 100 * numBVH2 / (numNodes + numLeaves - 2 * numBVH2));
310 }
int maxObjects
Definition: BoundingIntervalHierarchy.h:366
int minObjects
Definition: BoundingIntervalHierarchy.h:365
int sumDepth
Definition: BoundingIntervalHierarchy.h:367
int numLeaves
Definition: BoundingIntervalHierarchy.h:363
int numBVH2
Definition: BoundingIntervalHierarchy.h:371
int minDepth
Definition: BoundingIntervalHierarchy.h:368
int numNodes
Definition: BoundingIntervalHierarchy.h:362
int numLeavesN[6]
Definition: BoundingIntervalHierarchy.h:370
int maxDepth
Definition: BoundingIntervalHierarchy.h:369
void printf(BasicWriter< Char > &w, BasicCStringRef< Char > format, ArgList args)
Definition: format.h:3083
int sumObjects
Definition: BoundingIntervalHierarchy.h:364

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void BIH::BuildStats::updateBVH2 ( )
inline
383 { numBVH2++; }
int numBVH2
Definition: BoundingIntervalHierarchy.h:371

+ Here is the caller graph for this function:

void BIH::BuildStats::updateInner ( )
inline
382 { numNodes++; }
int numNodes
Definition: BoundingIntervalHierarchy.h:362

+ Here is the caller graph for this function:

void BIH::BuildStats::updateLeaf ( int  depth,
int  n 
)
279 {
280  numLeaves++;
281  minDepth = std::min(depth, minDepth);
282  maxDepth = std::max(depth, maxDepth);
283  sumDepth += depth;
286  sumObjects += n;
287  int nl = std::min(n, 5);
288  ++numLeavesN[nl];
289 }
int maxObjects
Definition: BoundingIntervalHierarchy.h:366
int minObjects
Definition: BoundingIntervalHierarchy.h:365
int sumDepth
Definition: BoundingIntervalHierarchy.h:367
int numLeaves
Definition: BoundingIntervalHierarchy.h:363
T max(const T &x, const T &y)
Definition: g3dmath.h:320
T min(const T &x, const T &y)
Definition: g3dmath.h:305
int minDepth
Definition: BoundingIntervalHierarchy.h:368
int numLeavesN[6]
Definition: BoundingIntervalHierarchy.h:370
int maxDepth
Definition: BoundingIntervalHierarchy.h:369
int sumObjects
Definition: BoundingIntervalHierarchy.h:364

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

int BIH::BuildStats::maxDepth
private
int BIH::BuildStats::maxObjects
private
int BIH::BuildStats::minDepth
private
int BIH::BuildStats::minObjects
private
int BIH::BuildStats::numBVH2
private
int BIH::BuildStats::numLeaves
private
int BIH::BuildStats::numLeavesN[6]
private
int BIH::BuildStats::numNodes
private
int BIH::BuildStats::sumDepth
private
int BIH::BuildStats::sumObjects
private

The documentation for this class was generated from the following files: