#[cfg(test)] mod process { use df_maths::process; use df_maths::stats::stddev; #[test] fn cpk() { let list = vec![ // 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.1, 2.2, 2.2, 2.0 ]; let cpk = process::Cpk::new(2.5, 1.5, list); let (state, msg) = cpk.cpk_rating_criteria().clone(); println!("工序能力指标 cpk: {} {} {}", cpk.cpk.clone(), state, msg); let (state, msg) = cpk.ca_rating_criteria().clone(); println!("制程准确度 ca: {} {} {}", cpk.ca.clone(), state, msg); let (state, msg) = cpk.cp_rating_criteria().clone(); println!("制程精密度 cp: {} {} {}", cpk.cp.clone(), state, msg); } #[test] fn spc() { let list = vec![ 107.25, 107.08, 107.14, 107.05, 107.1, 107.14, 107.16, 107.22, 107.07, 107.1 ]; let data = stddev(list); println!(" stddev: {} ", data); } }