[−][src]Struct pointcloud::PointCloud
This abstracts away data access and the distance calculation. It handles both the labels and points.
Methods
impl<M: Metric> PointCloud<M>
[src]
pub fn from_memmap_files(
data_dim: usize,
labels_scheme: LabelScheme,
data_path: &[PathBuf],
labels_path: &[PathBuf],
ram: bool
) -> PointCloudResult<PointCloud<M>>
[src]
data_dim: usize,
labels_scheme: LabelScheme,
data_path: &[PathBuf],
labels_path: &[PathBuf],
ram: bool
) -> PointCloudResult<PointCloud<M>>
Builds the point cloud from a collection of memmaps. If you want it to load all the data into ram, pass a true for the ram.
pub fn from_ram(
data: Box<[f32]>,
data_dim: usize,
labels: MetadataList
) -> PointCloudResult<PointCloud<M>>
[src]
data: Box<[f32]>,
data_dim: usize,
labels: MetadataList
) -> PointCloudResult<PointCloud<M>>
Builds the point cloud from data in ram. This is for complex metadata
pub fn from_yaml(params: &Yaml) -> PointCloudResult<PointCloud<M>>
[src]
Given a yaml file on disk, it builds a point cloud. Minimal example below.
---
data_path: DATAMEMMAP
labels_path: LABELS_CSV_OR_MEMMAP
count: NUMBER_OF_DATA_POINTS
data_dim: 784
labels_dim: 10
in_ram: True
This assumes that your labels are either a CSV or a memmap file. If one specifies a schema then this is the minimal example
---
data_path: DATAMEMMAP
labels_path: LABELS_CSV_OR_MEMMAP
count: NUMBER_OF_DATA_POINTS
data_dim: 784
schema:
natural: u32
integer: i32
real: f32
string: String
boolean: bool
pub fn from_file<P: AsRef<Path>>(path: P) -> PointCloudResult<PointCloud<M>>
[src]
Runs from_yaml
on the file at a given path
pub fn simple_from_ram(
data: Box<[f32]>,
data_dim: usize,
labels: Box<[f32]>,
labels_dim: usize
) -> PointCloudResult<PointCloud<M>>
[src]
data: Box<[f32]>,
data_dim: usize,
labels: Box<[f32]>,
labels_dim: usize
) -> PointCloudResult<PointCloud<M>>
Builds the point cloud from data in ram. This is for quick things with simple metadata
pub fn len(&self) -> usize
[src]
Total number of points in the point cloud
pub fn dim(&self) -> usize
[src]
Dimension of the data in the point cloud
pub fn reference_indexes(&self) -> Vec<PointIndex>
[src]
The names of the data are currently a shallow wrapper around a usize.
pub fn get_center(&self, pn: PointIndex) -> PointCloudResult<Arc<Vec<f32>>>
[src]
Returns a arc that points to a AVX2 packed point. This also acts like a cache for these center points to ensure that we don't load multiple copies into memory. Used for heavily referenced points, like centers.
pub fn get_point(&self, pn: PointIndex) -> PointCloudResult<&[f32]>
[src]
Returns a slice corresponding to the point in question. Used for rarely referenced points, like outliers or leaves.
pub fn get_name(&self, pi: &PointIndex) -> Option<&PointName>
[src]
Gets the name from an index
pub fn get_index(&self, pn: &PointName) -> Option<&PointIndex>
[src]
Gets the index from the name
pub fn get_names(&self) -> Vec<PointName>
[src]
Gets all names in the point cloud
pub fn schema_json(&self) -> String
[src]
Gets a schema to use
pub fn get_metadata(&self, pn: PointIndex) -> PointCloudResult<Metadata>
[src]
Returns the label of a point.
This will be changed to return a label structure that can contain many different pieces of info.
pub fn get_metasummary(
&self,
pns: &[PointIndex]
) -> PointCloudResult<MetaSummary>
[src]
&self,
pns: &[PointIndex]
) -> PointCloudResult<MetaSummary>
Returns a complex summary of a collection of metadatas associated to a point
pub fn distances_to_point_indices(
&self,
is: &[PointIndex],
js: &[PointIndex]
) -> PointCloudResult<Vec<f32>>
[src]
&self,
is: &[PointIndex],
js: &[PointIndex]
) -> PointCloudResult<Vec<f32>>
The main distance function. This paralizes if there are more than 100 points.
pub fn distances_to_point_index(
&self,
i: PointIndex,
indexes: &[PointIndex]
) -> PointCloudResult<Vec<f32>>
[src]
&self,
i: PointIndex,
indexes: &[PointIndex]
) -> PointCloudResult<Vec<f32>>
The main distance function. This paralizes if there are more than 100 points.
pub fn adj(&self, indexes: &[PointIndex]) -> PointCloudResult<AdjMatrix>
[src]
Create and adjacency matrix
pub fn distances_to_point(
&self,
x: &[f32],
indexes: &[PointIndex]
) -> PointCloudResult<Vec<f32>>
[src]
&self,
x: &[f32],
indexes: &[PointIndex]
) -> PointCloudResult<Vec<f32>>
The main distance function. This paralizes if there are more than 100 points.
Trait Implementations
Auto Trait Implementations
impl<M> !RefUnwindSafe for PointCloud<M>
impl<M> Send for PointCloud<M>
impl<M> Sync for PointCloud<M>
impl<M> Unpin for PointCloud<M> where
M: Unpin,
M: Unpin,
impl<M> !UnwindSafe for PointCloud<M>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> Cast<U> for T where
U: FromCast<T>,
[src]
U: FromCast<T>,
impl<T> From<T> for T
[src]
impl<T> FromCast<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,