Changeset 2149
- Timestamp:
- 02/22/07 10:26:50 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/TraversalTree.cpp
r2130 r2149 314 314 if (axis == -1) { 315 315 cout << "terminate on cost ratio" << endl; 316 ++ mStat.costRatioNodes; 316 317 return leaf; 317 318 } … … 421 422 minCostNodes * 100 / (double)Leaves() << endl; 422 423 424 app << "#N_COSTRATIOLEAVES ( Percentage of leaves with cost ratio termination )\n"<< 425 costRatioNodes * 100 / (double)Leaves() << endl; 426 423 427 // app << setprecision(4); 424 428 // app << "#N_CTIME ( Construction time [s] )\n" … … 434 438 TraversalLeaf *leaf = (TraversalLeaf *)data.mNode; 435 439 436 if (data.mDepth > mTermMaxDepth)440 if (data.mDepth >= mTermMaxDepth) 437 441 ++ mStat.maxDepthNodes; 438 442 439 if ((int)(leaf->mViewCells.size()) < mTermMinCost)443 if ((int)(leaf->mViewCells.size()) <= mTermMinCost) 440 444 ++ mStat.minCostNodes; 441 445 … … 474 478 AxisAlignedBox3 box = (*mi)->GetBox(); 475 479 480 //cout << "box: " << box << endl; 476 481 splitCandidates->push_back(new SortableEntry(SortableEntry::BOX_MAX, 477 482 box.Max(axis), … … 511 516 { 512 517 513 #define DEBUG_COST 0518 #define DEBUG_COST 1 514 519 515 520 #if DEBUG_COST … … 518 523 519 524 static int lastAxis = 100; 525 520 526 if (axis <= lastAxis) 521 nodeId++;527 ++ nodeId; 522 528 523 529 lastAxis = axis; … … 552 558 float minSum = 1e20f; 553 559 560 int openBoxes = 0; 561 554 562 for(ci = splitCandidates->begin(); ci < splitCandidates->end(); ++ ci) 555 563 { … … 558 566 case SortableEntry::BOX_MIN: 559 567 ++ objectsLeft; 568 ++ openBoxes; 560 569 break; 561 570 case SortableEntry::BOX_MAX: 562 571 -- objectsRight; 572 -- openBoxes; 563 573 break; 564 574 } … … 581 591 { 582 592 float oldCost = (float)node->mViewCells.size(); 583 float newCost = mCt_div_ci + sum /boxArea;593 float newCost = mCt_div_ci + sum / boxArea; 584 594 float ratio = newCost / oldCost; 585 costStream<<(*ci)->value<<" "<<ratio<<endl; 595 596 costStream << (*ci)->value << " " << ratio << " open: " << openBoxes; 597 598 if ((*ci)->type == SortableEntry::BOX_MAX) 599 costStream << " max event" << endl; 600 else 601 costStream << " min event" << endl; 586 602 } 587 603 #endif -
GTP/trunk/Lib/Vis/Preprocessing/src/TraversalTree.h
r2124 r2149 56 56 // number of dynamically removed ray refs 57 57 int removedRayRefs; 58 58 // number of nodes terminated on cost ratio 59 int costRatioNodes; 60 59 61 // Constructor 60 62 TraversalTreeStatistics() … … 71 73 nodes = 0; 72 74 73 for (int i =0; i<7; i++)75 for (int i = 0; i < 7; ++ i) 74 76 splits[i] = 0; 75 77 … … 82 84 totalObjectRefs = 0; 83 85 addedRayRefs = removedRayRefs = 0; 86 costRatioNodes = 0; 84 87 } 85 88
Note: See TracChangeset
for help on using the changeset viewer.