nyx_space/od/process/solution/
display.rs1use crate::linalg::allocator::Allocator;
20use crate::linalg::{DefaultAllocator, DimName};
21use crate::md::trajectory::Interpolatable;
22pub use crate::od::estimate::*;
23pub use crate::od::*;
24use msr::sensitivity::TrackerSensitivity;
25use std::fmt;
26use std::ops::Add;
27
28use super::ODSolution;
29
30impl<StateType, EstType, MsrSize, Trk> fmt::Display for ODSolution<StateType, EstType, MsrSize, Trk>
31where
32 StateType: Interpolatable + Add<OVector<f64, <StateType as State>::Size>, Output = StateType>,
33 EstType: Estimate<StateType>,
34 MsrSize: DimName,
35 Trk: TrackerSensitivity<StateType, StateType>,
36 <DefaultAllocator as Allocator<<StateType as State>::VecLength>>::Buffer<f64>: Send,
37 DefaultAllocator: Allocator<<StateType as State>::Size>
38 + Allocator<<StateType as State>::VecLength>
39 + Allocator<MsrSize>
40 + Allocator<MsrSize, <StateType as State>::Size>
41 + Allocator<MsrSize, MsrSize>
42 + Allocator<<StateType as State>::Size, <StateType as State>::Size>
43 + Allocator<<StateType as State>::Size, MsrSize>,
44{
45 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
46 if self.results().count() == 0 {
47 writeln!(f, "Empty OD solution")
48 } else {
49 let kind = if self.is_filter_run() {
50 "Filter"
51 } else {
52 "Smoother"
53 };
54 writeln!(
55 f,
56 "{kind} OD solution from {:?}, spanning {}-{}, with {} estimates, including {} accepted residuals",
57 self.unique(),
58 self.estimates.first().unwrap().epoch(),
59 self.estimates.last().unwrap().epoch(),
60 self.estimates.len(),
61 self.accepted_residuals().len()
62 )
63 }
64 }
65}