| Modifier and Type | Field and Description |
|---|---|
private PointCloud |
N |
| Constructor and Description |
|---|
MedianWithSorting(PointCloud points) |
| Modifier and Type | Method and Description |
|---|---|
Jcg.geometry.Point_d |
findMedian(int cutDim)
Compute the median of a set of point cloud (after sorting)
cutDim = {0,1,2} => {x,y,z}
Warning: input points should not be sorted (perform a copy of input points)
|
private Jcg.geometry.Point_d |
selectWithSorting(Jcg.geometry.Point_d[] buffer,
int index,
int cutDim)
Sort the input array and select the i-th element
Remark: it takes O(nlog n) time
|
private final PointCloud N
public MedianWithSorting(PointCloud points)
private Jcg.geometry.Point_d selectWithSorting(Jcg.geometry.Point_d[] buffer,
int index,
int cutDim)
buffer - array of input pointsindex - rank of the element to returncutDim - indicates which are the coordinates to comparepublic Jcg.geometry.Point_d findMedian(int cutDim)
findMedian in interface MediancutDim - defines the cut direction, {0,1,2} => {x,y,z}