pub fn init_from_preset(points: Vec<Vec<f64>>) -> PointSet {
        // First compute the distance matrix, then move "points" to the
        // output structure
        let (distance_matrix, d_min, d_max) = PointSet::compute_distance_matrix(&points, None);

        let mut p = PointSet {
            distance_matrix,
            active: vec![true; points.len()],
            nb_active: points.len(),
            idx_sort: Vec::with_capacity(points.len()),
            // Start at 1 because closest is itself
            idx_active: vec![1; points.len()],
            visited: vec![false; points.len()],
            points,
            d_max,
            d_min,
        };
        p.compute_closest_idx();
        p
    }
/// Creates a 'PointSet' from an already initialised vector of points.
///
/// # Arguments
///
/// * `points` - The pre-initialised set of points.
///
/// # Example
///
/// ```
/// let points: Vec<Vec<f64>> = vec![vec![1.0, 0.0, 1.0], vec![0.5, 0.5, 0.5]];
/// let poinset = wsp::PointSet::init_from_preset(points); // Give ownership
/// ```
Creates a 'PointSet' from an already initialised vector of points.
Creates a ' PointSet ' from an already initialised vector of points .
pub fn init_from_preset(points: Vec<Vec<f64>>) -> PointSet {
        // First compute the distance matrix, then move "points" to the
        // output structure
        let (distance_matrix, d_min, d_max) = PointSet::compute_distance_matrix(&points, None);
        let mut p = PointSet {
            distance_matrix,
            active: vec![true; points.len()],
            nb_active: points.len(),
            idx_sort: Vec::with_capacity(points.len()),
            // Start at 1 because closest is itself
            idx_active: vec![1; points.len()],
            visited: vec![false; points.len()],
            points,
            d_max,
            d_min,
        };
        p.compute_closest_idx();
        p
    }
pub fn init_from_preset ( points : Vec < Vec < f64 > > ) -> PointSet { // First compute the distance matrix, then move "points" to the // output structure let ( distance_matrix , d_min , d_max ) = PointSet :: compute_distance_matrix ( & points , None ) ; let mut p = PointSet { distance_matrix , active : vec ! [ true points len ( ) ] , nb_active : points . len ( ) , idx_sort : Vec :: with_capacity ( points . len ( ) ) , // Start at 1 because closest is itself idx_active : vec ! [ 1 points len ( ) ] , visited : vec ! [ false points len ( ) ] , points , d_max , d_min , } ; p . compute_closest_idx ( ) ; p }
Creates a 'PointSet' from an already initialised vector of points.
Creates a ' PointSet ' from an already initialised vector of points .
points
Vec<Vec<f64>>
points
Vec<Vec<f64>>
example
None