#include <disjoint_set.h>
|
| | Universe (int elements) |
| |
| | ~Universe () |
| |
| int | find (int x) |
| | Find parent of x
|
| |
| void | join (int x, int y) |
| | Join set x and set y
|
| |
| int | size (int x) const |
| | Get size of set x
|
| |
| int | num_sets () const |
| | Get set number
|
| |
◆ Universe()
| apollo::perception::lidar::Universe::Universe |
( |
int |
elements | ) |
|
|
explicit |
在文件 disjoint_set.h 第 90 行定义.
90 {
91 _elts = new uni_elt[elements];
92 _num = elements;
93 for (int i = 0; i < elements; i++) {
97 }
98}
◆ ~Universe()
| apollo::perception::lidar::Universe::~Universe |
( |
| ) |
|
◆ find()
| int apollo::perception::lidar::Universe::find |
( |
int |
x | ) |
|
Find parent of x
- 参数
-
- 返回
- int
在文件 disjoint_set.h 第 104 行定义.
104 {
105 int y = x;
106 while (y != _elts[y].p) {
108 }
110 return y;
111}
◆ join()
| void apollo::perception::lidar::Universe::join |
( |
int |
x, |
|
|
int |
y |
|
) |
| |
Join set x and set y
- 参数
-
在文件 disjoint_set.h 第 113 行定义.
113 {
114 if (_elts[x].rank > _elts[y].rank) {
117 } else {
120 if (_elts[x].rank == _elts[y].rank) {
122 }
123 }
124 _num--;
125}
◆ num_sets()
| int apollo::perception::lidar::Universe::num_sets |
( |
| ) |
const |
|
inline |
◆ size()
| int apollo::perception::lidar::Universe::size |
( |
int |
x | ) |
const |
|
inline |
该类的文档由以下文件生成:
- modules/perception/lidar_segmentation/segmentor/ncut_segmentation/common/graph_felzenszwalb/disjoint_set.h