Changeset 4079 for branches/kendallscore/yat/utility/ranking/Impl.cc
 Timestamp:
 Aug 26, 2021, 10:38:04 AM (5 months ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

branches/kendallscore/yat/utility/ranking/Impl.cc
r4077 r4079 77 77 head_.left_>parent_ = &head_; 78 78 head_.right_ = from.head_.right_; 79 } 80 else 79 right_most_ = root_node()>right_most(); 80 } 81 else { 81 82 head_.right_ = &head_; 83 right_most() = &head_; 84 } 82 85 head_.height_ = from.head_.height_; 83 86 head_.size_ = from.head_.size_; … … 120 123 121 124 // update pointer to left_most node 122 if (head_.left_ == node) { 123 head_.left_ = child ? child : node>parent_; 124 } 125 if (left_most() == node) 126 left_most() = child ? child : node>parent_; 127 if (right_most() == node) 128 right_most() = child ? child : node>parent_; 125 129 assert(child==nullptr  child>is_left_node()  child>is_right_node()); 126 130 } … … 150 154 head_.left_ = nullptr; 151 155 head_.right_ = &head_; // most left node 156 right_most_ = &head_; 152 157 head_.update_height(); 153 158 head_.update_size(); … … 201 206 parent.right_ = element.release(); 202 207 child = parent.right_; 208 if (&parent == right_most()) 209 right_most() = child; 203 210 } 204 211 … … 426 433 } 427 434 435 if (root_node()) { 436 if (left_most() != root_node()>left_most()) { 437 std::cerr << "leftmost incorrect\n"; 438 return false; 439 } 440 if (right_most() != root_node()>right_most()) { 441 std::cerr << "rightmost incorrect\n"; 442 return false; 443 } 444 } 445 428 446 429 447 /* … … 467 485 468 486 469 NodeBase* Impl::right_most(void) 470 { 471 // FIXME this scaled logN, make it constant time 472 return root_node()>right_most(); 487 NodeBase*& Impl::right_most(void) 488 { 489 return right_most_; 473 490 } 474 491 … … 476 493 const NodeBase* Impl::right_most(void) const 477 494 { 478 // FIXME this scaled logN, make it constant time 479 return root_node()>right_most(); 495 return right_most_; 480 496 } 481 497
Note: See TracChangeset
for help on using the changeset viewer.