[][src]Trait pointcloud::PointCloud

pub trait PointCloud: Send + Sync + 'static {
    type Point: ?Sized;
    type PointRef: Deref<Target = Self::Point> + PointRef;
    type Metric: Metric<Self::Point>;
    pub fn len(&self) -> usize;
pub fn is_empty(&self) -> bool;
pub fn dim(&self) -> usize;
pub fn reference_indexes(&self) -> Vec<usize>;
pub fn point<'a, 'b: 'a>(
        &'b self,
        i: usize
    ) -> PointCloudResult<Self::PointRef>; pub fn point_dense_array(
        &self,
        index: usize
    ) -> PointCloudResult<Array1<f32>> { ... }
pub fn points_dense_matrix(
        &self,
        indexes: &[usize]
    ) -> PointCloudResult<Array2<f32>> { ... }
pub fn distances_to_point_index(
        &self,
        i: usize,
        indexes: &[usize]
    ) -> PointCloudResult<Vec<f32>> { ... }
pub fn distances_to_point<'a, 'b: 'a>(
        &self,
        x: &Self::PointRef,
        indexes: &[usize]
    ) -> PointCloudResult<Vec<f32>> { ... }
pub fn moment_1(&self, indexes: &[usize]) -> PointCloudResult<Vec<f32>>
    where
        f32: AddAssign
, { ... }
pub fn moment_2(&self, indexes: &[usize]) -> PointCloudResult<Vec<f32>>
    where
        f32: Mul<Output = f32> + AddAssign
, { ... } }

Base trait for a point cloud

Associated Types

type Point: ?Sized[src]

The derefrenced, raw point. Think f32

type PointRef: Deref<Target = Self::Point> + PointRef[src]

A reference to a point. Think &'a f32

It might be better to move this to the point function, but this way we can rely on it for other things.

type Metric: Metric<Self::Point>[src]

The metric this pointcloud is bound to. Think L2

Loading content...

Required methods

pub fn len(&self) -> usize[src]

The number of samples this cloud covers

pub fn is_empty(&self) -> bool[src]

If this is empty

pub fn dim(&self) -> usize[src]

The dimension of the underlying data

pub fn reference_indexes(&self) -> Vec<usize>[src]

Indexes used for access

pub fn point<'a, 'b: 'a>(&'b self, i: usize) -> PointCloudResult<Self::PointRef>[src]

Gets a point from this dataset

Loading content...

Provided methods

pub fn point_dense_array(&self, index: usize) -> PointCloudResult<Array1<f32>>[src]

Returns a dense array

pub fn points_dense_matrix(
    &self,
    indexes: &[usize]
) -> PointCloudResult<Array2<f32>>
[src]

Returns a dense array

pub fn distances_to_point_index(
    &self,
    i: usize,
    indexes: &[usize]
) -> PointCloudResult<Vec<f32>>
[src]

The main distance function. This paralizes if there are more than 100 points.

pub fn distances_to_point<'a, 'b: 'a>(
    &self,
    x: &Self::PointRef,
    indexes: &[usize]
) -> PointCloudResult<Vec<f32>>
[src]

The main distance function. This paralizes if there are more than 100 points.

pub fn moment_1(&self, indexes: &[usize]) -> PointCloudResult<Vec<f32>> where
    f32: AddAssign
[src]

The first moment of the specified vectors. See wikipedia.

pub fn moment_2(&self, indexes: &[usize]) -> PointCloudResult<Vec<f32>> where
    f32: Mul<Output = f32> + AddAssign
[src]

The second moment of the specified vectors. See wikipedia.

Loading content...

Implementors

impl<D: PointCloud> PointCloud for HashGluedCloud<D>[src]

type Metric = D::Metric

type Point = D::Point

type PointRef = D::PointRef

pub fn point<'a, 'b: 'a>(
    &'b self,
    pi: usize
) -> PointCloudResult<Self::PointRef>
[src]

Returns a slice corresponding to the point in question. Used for rarely referenced points, like outliers or leaves.

pub fn len(&self) -> usize[src]

Total number of points in the point cloud

pub fn is_empty(&self) -> bool[src]

Total number of points in the point cloud

pub fn reference_indexes(&self) -> Vec<usize>[src]

The names of the data are currently a shallow wrapper around a usize.

pub fn dim(&self) -> usize[src]

Dimension of the data in the point cloud

impl<D: PointCloud, L: LabelSet> PointCloud for SimpleLabeledCloud<D, L>[src]

type Metric = D::Metric

Underlying metric this point cloud uses

type Point = D::Point

type PointRef = D::PointRef

Loading content...