pub fn benchmark_algorithm(algorithm: Algorithm, shape: Shape, presort: bool) {
    use self::Number::*;
    let sample_sizes: Vec<Number> = vec![
        Hundred,
        Thousand,
        TenThousand,
        HundredThousand,
        HundredThousand.times(2),
        HundredThousand.times(5),
        HundredThousand.times(7),
        Million,
        Million.times(2),
        Million.times(5),
        Million.times(7),
        TenMillion,
    ];

    let mut output: Vec<(u64, f64)> = Vec::new();
    for sample_size in sample_sizes {
        let mut input_set: Vec<Point2D> = generate(shape, sample_size);
        let result = (
            sample_size.val(),
            execution_time(algorithm, &mut input_set, presort).milli_seconds(),
        );
        output.push(result);
    }
    println!("{:?}_{:?} : {:?}", algorithm, shape, output);
}
/// One another convenient function to print the results
/// The output is printed in console
One another convenient function to print the results
The output is printed in console
One another convenient function to print the results The output is printed in console
pub fn benchmark_algorithm(algorithm: Algorithm, shape: Shape, presort: bool) {
    use self::Number::*;
    let sample_sizes: Vec<Number> = vec![
        Hundred,
        Thousand,
        TenThousand,
        HundredThousand,
        HundredThousand.times(2),
        HundredThousand.times(5),
        HundredThousand.times(7),
        Million,
        Million.times(2),
        Million.times(5),
        Million.times(7),
        TenMillion,
    ];
    let mut output: Vec<(u64, f64)> = Vec::new();
    for sample_size in sample_sizes {
        let mut input_set: Vec<Point2D> = generate(shape, sample_size);
        let result = (
            sample_size.val(),
            execution_time(algorithm, &mut input_set, presort).milli_seconds(),
        );
        output.push(result);
    }
    println!("{:?}_{:?} : {:?}", algorithm, shape, output);
}
pub fn benchmark_algorithm ( algorithm : Algorithm , shape : Shape , presort : bool ) { use self :: Number :: * ; let sample_sizes : Vec < Number > = vec ! [ Hundred Thousand TenThousand HundredThousand HundredThousand times ( 2 ) HundredThousand times ( 5 ) HundredThousand times ( 7 ) Million Million times ( 2 ) Million times ( 5 ) Million times ( 7 ) TenMillion ] ; let mut output : Vec < ( u64 , f64 ) > = Vec :: new ( ) ; for sample_size in sample_sizes { let mut input_set : Vec < Point2D > = generate ( shape , sample_size ) ; let result = ( sample_size . val ( ) , execution_time ( algorithm , & mut input_set , presort ) . milli_seconds ( ) , ) ; output . push ( result ) ; } println ! ( " " algorithm shape output ) ; }
One another convenient function to print the results
The output is printed in console
One another convenient function to print the results The output is printed in console
algorithm
Algorithm
shape
Shape
presort
bool
algorithm
Algorithm
shape
Shape
presort
bool