recommend_algorithm

Function recommend_algorithm 

Source
pub fn recommend_algorithm(
    num_points: usize,
    dimension: usize,
    expected_hull_size: Option<usize>,
) -> ConvexHullAlgorithm
Expand description

Recommend the best algorithm for given constraints

§Arguments

  • num_points - Number of input points
  • dimension - Dimension of the points
  • expected_hull_size - Expected number of hull vertices (None if unknown)

§Returns

  • Recommended algorithm

§Examples

use scirs2_spatial::convex_hull::algorithms::recommend_algorithm;
use scirs2_spatial::convex_hull::ConvexHullAlgorithm;

// Large 2D dataset with small expected hull
let algo = recommend_algorithm(10000, 2, Some(8));
assert_eq!(algo, ConvexHullAlgorithm::JarvisMarch);

// 3D dataset
let algo = recommend_algorithm(1000, 3, None);
assert_eq!(algo, ConvexHullAlgorithm::QHull);