pub struct AuditBuilder { /* private fields */ }Expand description
Convenience builder for SolverAuditEntry.
Start a timer at the beginning of a solve, then call [finish] with the
result to produce a complete audit record.
§Example
ⓘ
let audit = AuditBuilder::start("req-42", &matrix, &rhs);
let result = solver.solve(&matrix, &rhs)?;
let entry = audit.finish(&result, tolerance);
tracing::info!(?entry, "solve completed");Implementations§
Source§impl AuditBuilder
impl AuditBuilder
Sourcepub fn start(
request_id: impl Into<String>,
matrix: &CsrMatrix<f32>,
rhs: &[f32],
) -> Self
pub fn start( request_id: impl Into<String>, matrix: &CsrMatrix<f32>, rhs: &[f32], ) -> Self
Begin an audit trace for a new solve request.
Records the wall-clock start time and computes the input hash eagerly so that the hash is taken before any mutation.
Sourcepub fn finish(self, result: &SolverResult, tolerance: f64) -> SolverAuditEntry
pub fn finish(self, result: &SolverResult, tolerance: f64) -> SolverAuditEntry
Finalize the audit entry after the solver returns.
tolerance is the target tolerance that was requested so that
converged can be computed from the residual.
Auto Trait Implementations§
impl Freeze for AuditBuilder
impl RefUnwindSafe for AuditBuilder
impl Send for AuditBuilder
impl Sync for AuditBuilder
impl Unpin for AuditBuilder
impl UnsafeUnpin for AuditBuilder
impl UnwindSafe for AuditBuilder
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