()
| 12 | } |
| 13 | |
| 14 | fn load_series() -> (Vec<f64>, Vec<f64>, Vec<f64>) { |
| 15 | let fixture_path = std::path::Path::new(env!("CARGO_MANIFEST_DIR")) |
| 16 | .join("../../tests/fixtures/codependence/random_state_42.csv"); |
| 17 | let mut reader = csv::Reader::from_path(fixture_path).expect("fixture csv"); |
| 18 | let mut x = Vec::new(); |
| 19 | let mut y_1 = Vec::new(); |
| 20 | let mut y_2 = Vec::new(); |
| 21 | |
| 22 | for result in reader.deserialize::<CodependenceRow>() { |
| 23 | let row = result.expect("valid row"); |
| 24 | x.push(row.x); |
| 25 | y_1.push(row.y_1); |
| 26 | y_2.push(row.y_2); |
| 27 | } |
| 28 | |
| 29 | (x, y_1, y_2) |
| 30 | } |
| 31 | |
| 32 | fn corrcoef(x: &[f64], y: &[f64]) -> f64 { |
| 33 | let n = x.len() as f64; |
no outgoing calls
no test coverage detected