Skip to content

Commit c58ca70

Browse files
author
Nathan Shreve
committed
parent() is now static function
1 parent 9a5d3b1 commit c58ca70

File tree

5 files changed

+2
-7
lines changed

5 files changed

+2
-7
lines changed

vpr/src/route/binary_heap.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
// child indices of a heap
55
static inline size_t left(size_t i) { return i << 1; }
66
static inline size_t right(size_t i) { return (i << 1) + 1; }
7-
8-
inline size_t BinaryHeap::parent(size_t i) const { return i >> 1; }
7+
static inline size_t parent(size_t i) { return i >> 1; }
98

109
bool BinaryHeap::is_valid() const {
1110
if (heap_.empty()) {

vpr/src/route/binary_heap.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ class BinaryHeap : public KAryHeap {
1111

1212
private:
1313
void sift_down(size_t hole) final;
14-
size_t parent(size_t i) const final;
1514
};
1615

1716
#endif //VTR_BINARY_HEAP_H

vpr/src/route/four_ary_heap.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
#include "vtr_log.h"
33

44
static inline size_t first_child(size_t i) { return (i << 2) - 2; }
5-
6-
inline size_t FourAryHeap::parent(size_t i) const { return (i + 2) >> 2; }
5+
static inline size_t parent(size_t i) { return (i + 2) >> 2; }
76

87
inline size_t FourAryHeap::smallest_child(size_t i) const {
98
// Returns first_child(i) if i has no children

vpr/src/route/four_ary_heap.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ class FourAryHeap : public KAryHeap {
1111

1212
private:
1313
void sift_down(size_t hole) final;
14-
size_t parent(size_t i) const final;
1514
size_t smallest_child(size_t i) const;
1615
};
1716

vpr/src/route/k_ary_heap.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ class KAryHeap : public HeapInterface {
3737
void prune_heap();
3838

3939
virtual void sift_down(size_t hole) = 0;
40-
virtual size_t parent(size_t i) const = 0;
4140

4241
HeapStorage storage_;
4342

0 commit comments

Comments
 (0)