It works!

This commit is contained in:
2018-10-25 21:40:38 +02:00
parent e8aa60fcdd
commit 4fc27841e9
4 changed files with 44 additions and 4 deletions

View File

@@ -1,9 +1,14 @@
#[macro_use]
extern crate log;
extern crate statrs;
#[cfg(test)]
#[macro_use]
extern crate approx;
#[cfg(test)]
extern crate env_logger;
mod factor_graph;
mod gaussian;
mod math;
@@ -224,7 +229,7 @@ where
}
for factor in &team_perf_layer {
factor.update_term(&mut variable_arena, 0);
factor.update_all_terms(&mut variable_arena);
}
for factor in &perf_layer {
@@ -307,6 +312,7 @@ where
#[cfg(test)]
mod tests {
use approx::{AbsDiffEq, RelativeEq};
use env_logger;
use super::*;
@@ -392,6 +398,8 @@ mod tests {
#[test]
fn test_rate_2vs2() {
let _ = env_logger::try_init();
let alice = Rating::new(MU, SIGMA);
let bob = Rating::new(MU, SIGMA);
let chris = Rating::new(MU, SIGMA);
@@ -410,6 +418,4 @@ mod tests {
assert_relative_eq!(rating, expected, epsilon = EPSILON);
}
}
}