Cargo update.

This commit is contained in:
2019-05-28 09:31:28 +02:00
parent a1d3861a76
commit f7958c47bc
4 changed files with 9 additions and 9 deletions

View File

@@ -10,4 +10,3 @@ statrs = "0.10"
[dev-dependencies] [dev-dependencies]
approx = "0.3" approx = "0.3"
env_logger = "0.6"

View File

@@ -8,7 +8,7 @@ pub struct Gaussian {
} }
impl fmt::Debug for Gaussian { impl fmt::Debug for Gaussian {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!( write!(
f, f,
"N(mu={:.03}, sigma={:.03}, pi={:.03}, tau={:.03})", "N(mu={:.03}, sigma={:.03}, pi={:.03}, tau={:.03})",

View File

@@ -1,4 +1,5 @@
#![allow(clippy::unreadable_literal, clippy::excessive_precision)] #![allow(clippy::unreadable_literal, clippy::excessive_precision)]
#![warn(rust_2018_idioms)]
mod factor_graph; mod factor_graph;
mod gaussian; mod gaussian;
@@ -108,12 +109,12 @@ fn draw_margin(p: f64, beta: f64, total_players: f64) -> f64 {
} }
pub struct TrueSkill { pub struct TrueSkill {
mu: f64, // mu: f64,
sigma: f64, // sigma: f64,
pub beta: f64, pub beta: f64,
pub tau: f64, pub tau: f64,
pub draw_probability: f64, pub draw_probability: f64,
delta: f64, // delta: f64,
} }
impl TrueSkill { impl TrueSkill {
@@ -357,12 +358,12 @@ impl TrueSkill {
impl Default for TrueSkill { impl Default for TrueSkill {
fn default() -> TrueSkill { fn default() -> TrueSkill {
TrueSkill { TrueSkill {
mu: MU, // mu: MU,
sigma: SIGMA, // sigma: SIGMA,
beta: BETA, beta: BETA,
tau: TAU, tau: TAU,
draw_probability: DRAW_PROBABILITY, draw_probability: DRAW_PROBABILITY,
delta: DELTA, // delta: DELTA,
} }
} }
} }
@@ -370,7 +371,6 @@ impl Default for TrueSkill {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use approx::*; use approx::*;
use env_logger;
use super::*; use super::*;

View File

@@ -115,6 +115,7 @@ impl Matrix {
if self.height == self.width && self.height == 1 { if self.height == self.width && self.height == 1 {
matrix[(0, 0)] = 1.0 / self[(0, 0)]; matrix[(0, 0)] = 1.0 / self[(0, 0)];
} else { } else {
} }
matrix matrix