pub fn load(
        cover_proto: &CoreProto,
        point_cloud: PointCloud<M>,
    ) -> MalwareBrotResult<CoverTreeWriter<M>> {
        let parameters = Arc::new(CoverTreeParameters {
            total_nodes: atomic::AtomicUsize::new(0),
            use_singletons: cover_proto.use_singletons,
            scale_base: cover_proto.scale_base as f32,
            cutoff: cover_proto.cutoff as usize,
            resolution: cover_proto.resolution as i32,
            cluster_min: 5,
            point_cloud,
            verbosity: 2,
        });
        let root_address = (cover_proto.get_root_scale(), cover_proto.get_root_index());
        let layers = cover_proto
            .get_layers()
            .par_iter()
            .map(|l| CoverLayerWriter::load(l))
            .collect();

        Ok(CoverTreeWriter {
            parameters,
            layers,
            root_address,
        })
    }
/// Loads a tree from a protobuf. There's a `load_tree` in `utils` that handles loading from a path to a protobuf file.
Loads a tree from a protobuf. There's a `load_tree` in `utils` that handles loading from a path to a protobuf file.
Loads a tree from a protobuf . There ' s a ` load_tree ` in ` utils ` that handles loading from a path to a protobuf file .
pub fn load(
        cover_proto: &CoreProto,
        point_cloud: PointCloud<M>,
    ) -> MalwareBrotResult<CoverTreeWriter<M>> {
        let parameters = Arc::new(CoverTreeParameters {
            total_nodes: atomic::AtomicUsize::new(0),
            use_singletons: cover_proto.use_singletons,
            scale_base: cover_proto.scale_base as f32,
            cutoff: cover_proto.cutoff as usize,
            resolution: cover_proto.resolution as i32,
            cluster_min: 5,
            point_cloud,
            verbosity: 2,
        });
        let root_address = (cover_proto.get_root_scale(), cover_proto.get_root_index());
        let layers = cover_proto
            .get_layers()
            .par_iter()
            .map(|l| CoverLayerWriter::load(l))
            .collect();
        Ok(CoverTreeWriter {
            parameters,
            layers,
            root_address,
        })
    }
pub fn load ( cover_proto : & CoreProto , point_cloud : PointCloud < M > , ) -> MalwareBrotResult < CoverTreeWriter < M > > { let parameters = Arc :: new ( CoverTreeParameters { total_nodes : atomic :: AtomicUsize :: new ( 0 ) , use_singletons : cover_proto . use_singletons , scale_base : cover_proto . scale_base as f32 , cutoff : cover_proto . cutoff as usize , resolution : cover_proto . resolution as i32 , cluster_min : 5 , point_cloud , verbosity : 2 , } ) ; let root_address = ( cover_proto . get_root_scale ( ) , cover_proto . get_root_index ( ) ) ; let layers = cover_proto . get_layers ( ) . par_iter ( ) . map ( | l | CoverLayerWriter :: load ( l ) ) . collect ( ) ; Ok ( CoverTreeWriter { parameters , layers , root_address , } ) }
Loads a tree from a protobuf.
Loads a tree from a protobuf .
cover_proto
&CoreProto
point_cloud
PointCloud<M>
cover_proto
&CoreProto
point_cloud
PointCloud<M>