pub struct PerfCalc { /* private fields */ }Expand description
Builder for configuring and running the performance calculation algorithm This builder is used to configure the number of iterations and the convergence threshold. The default settings are:
- Maximum iterations: 100
- Convergence threshold: 1e-6
§Example
use nypc_perf::{BattleResult, PerfCalc, Rating};
let mut perf = vec![Rating::new(0.0); 2];
let battles = vec![
BattleResult {
i: 0,
j: 1,
wij: 2.0,
wji: 1.0,
}
];
let calc = PerfCalc::new().max_iters(100).epsilon(1e-6);
calc.run(&mut perf, &battles);Implementations§
Source§impl PerfCalc
impl PerfCalc
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new PerfCalc with default settings.
The default settings are:
- Maximum iterations: 100
- Convergence threshold: 1e-6
Sourcepub fn epsilon(self, epsilon: f64) -> Self
pub fn epsilon(self, epsilon: f64) -> Self
Sets the convergence threshold.
use nypc_perf::PerfCalc;
let calc = PerfCalc::new().epsilon(1e-6);Trait Implementations§
impl Copy for PerfCalc
Auto Trait Implementations§
impl Freeze for PerfCalc
impl RefUnwindSafe for PerfCalc
impl Send for PerfCalc
impl Sync for PerfCalc
impl Unpin for PerfCalc
impl UnwindSafe for PerfCalc
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more