[][src]Trait pointcloud::Metric

pub trait Metric: 'static + Send + Sync + Debug {
    fn dense(x: &[f32], y: &[f32]) -> f32;
fn sparse(x_ind: &[u32], x_val: &[f32], y_ind: &[u32], y_val: &[f32]) -> f32;
fn norm(x: &[f32]) -> f32; }

The trait that enables a metric

Required methods

fn dense(x: &[f32], y: &[f32]) -> f32

Dense calculation

fn sparse(x_ind: &[u32], x_val: &[f32], y_ind: &[u32], y_val: &[f32]) -> f32

Sparse calculation, we assume that the index slices are in accending order and that the values correspond to the indexes

fn norm(x: &[f32]) -> f32

The norm, dense(x,x)

Loading content...

Implementors

impl Metric for CosineSim[src]

impl Metric for L1[src]

impl Metric for L2[src]

impl Metric for Linfty[src]

Loading content...