Ignore:
Timestamp:
04/30/08 13:24:45 (16 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/Preprocessing/src/KdTree.h

    r2643 r2670  
    6969  int Leaves() const { return (nodes / 2) + 1; } 
    7070 
    71   void Reset() { 
    72     nodes = 0; 
    73     for (int i=0; i<7; i++) 
    74       splits[i] = 0; 
    75     rays = queryDomains = 0; 
    76     rayRefs = rayRefsNonZeroQuery = objectRefs = 0; 
    77     zeroQueryNodes = 0; 
    78     maxDepthNodes = 0; 
    79     minCostNodes = 0; 
    80     maxObjectRefs = 0; 
    81     addedRayRefs = removedRayRefs = 0; 
     71  void Reset()  
     72  { 
     73          nodes = 0; 
     74          for (int i=0; i<7; i++) 
     75                  splits[i] = 0; 
     76          rays = queryDomains = 0; 
     77          rayRefs = rayRefsNonZeroQuery = objectRefs = 0; 
     78          zeroQueryNodes = 0; 
     79          maxDepthNodes = 0; 
     80          minCostNodes = 0; 
     81          maxObjectRefs = 0; 
     82          addedRayRefs = removedRayRefs = 0; 
    8283  } 
    8384 
     
    9495   
    9596class KdInterior; 
    96 /** Abstract class for kd-tree node */ 
    97 class KdNode { 
     97 
     98/** Abstract class for kd-tree node  
     99*/ 
     100class KdNode  
     101{ 
    98102 
    99103public:   
     
    112116  bool Mailed() const { return mMailbox == sMailId; } 
    113117  
    114   static void NewMail(const int reserve = 1) { 
    115     sMailId += sReservedMailboxes; 
    116     sReservedMailboxes = reserve; 
    117   } 
     118  static void NewMail(const int reserve = 1)  
     119  { 
     120          sMailId += sReservedMailboxes; 
     121          sReservedMailboxes = reserve; 
     122  } 
     123 
    118124  void Mail(const int mailbox) { mMailbox = sMailId + mailbox; } 
    119125  bool Mailed(const int mailbox) const { return mMailbox == sMailId + mailbox; } 
    120126 
    121127 
    122   static void NewMail2(const int reserve = 1) { 
    123     sMailId2 += sReservedMailboxes; 
    124     sReservedMailboxes2 = reserve; 
     128  //////////// 
     129  //-- hack!!: second mail for a machine with 2 cores 
     130 
     131  static void NewMail2(const int reserve = 1)  
     132  { 
     133          sMailId2 += sReservedMailboxes; 
     134          sReservedMailboxes2 = reserve; 
    125135  } 
    126136 
     
    130140  void Mail2(const int mailbox) { mMailbox2 = sMailId2 + mailbox; } 
    131141  bool Mailed2(const int mailbox) const { return mMailbox2 == sMailId2 + mailbox; } 
     142 
     143  ///////////////////////////////////// 
    132144 
    133145 
     
    154166}; 
    155167 
    156 /** Implementation of the kd-tree interior node */ 
     168 
     169/** Implementation of the kd-tree interior node.  
     170*/ 
    157171class KdInterior : public KdNode { 
    158172 
Note: See TracChangeset for help on using the changeset viewer.