pub fn wr_median<T>(set:&[T]) -> f64
    where T: Copy,f64:From<T> {
    let n = set.len();
    match n {
        0 => panic!("{} empty vector!",here!()),
        1 => return f64::from(set[0]),
        2 => return f64::from(set[0])+f64::from(set[1])/2.0,
        _ => {}
    };
    let s = tof64(set); // makes an f64 copy
    // arithmetic mean as a starting iterative median 
    let sumx:f64 = s.iter().sum();
    let mean = sumx/(n as f64); 
    if (n & 1) == 0 { even_wr_median(&s,0,n,mean) } 
    else { odd_wr_median(&s,0,n,mean) }
}
/// Iterative median based on the heavily modified 1D case
/// of the modified nD Weiszfeld algorithm.
/// Reducing the target set.
Iterative median based on the heavily modified 1D case
of the modified nD Weiszfeld algorithm.
Reducing the target set.
Iterative median based on the heavily modified 1D case of the modified nD Weiszfeld algorithm . Reducing the target set .
pub fn wr_median<T>(set:&[T]) -> f64
    where T: Copy,f64:From<T> {
    let n = set.len();
    match n {
        0 => panic!("{} empty vector!",here!()),
        1 => return f64::from(set[0]),
        2 => return f64::from(set[0])+f64::from(set[1])/2.0,
        _ => {}
    };
    let s = tof64(set); // makes an f64 copy
    // arithmetic mean as a starting iterative median 
    let sumx:f64 = s.iter().sum();
    let mean = sumx/(n as f64); 
    if (n & 1) == 0 { even_wr_median(&s,0,n,mean) } 
    else { odd_wr_median(&s,0,n,mean) }
}
pub fn wr_median < T > ( set : & [ T ] ) -> f64 where T : Copy , f64 : From < T > { let n = set . len ( ) ; match n { 0 => panic ! ( " " here ( ) ) , 1 => return f64 :: from ( set [ 0 ] ) , 2 => return f64 :: from ( set [ 0 ] ) + f64 :: from ( set [ 1 ] ) / 2.0 , _ => { } } ; let s = tof64 ( set ) ; // makes an f64 copy // arithmetic mean as a starting iterative median  let sumx : f64 = s . iter ( ) . sum ( ) ; let mean = sumx / ( n as f64 ) ; if ( n & 1 ) == 0 { even_wr_median ( & s , 0 , n , mean ) } else { odd_wr_median ( & s , 0 , n , mean ) } }
Iterative median based on the heavily modified 1D case
of the modified nD Weiszfeld algorithm.
Iterative median based on the heavily modified 1D case of the modified nD Weiszfeld algorithm .
set
&[T]
set
&[T]