pub struct DeltaCheckpoint {
pub base_step: u64,
pub target_step: u64,
pub changed_indices: Vec<usize>,
pub positions: Vec<[f64; 3]>,
pub velocities: Vec<[f64; 3]>,
}Expand description
Delta checkpoint that records only particles that changed since a base state.
Fields§
§base_step: u64Step number of the base state.
target_step: u64Step number of this delta.
changed_indices: Vec<usize>Indices of changed particles.
positions: Vec<[f64; 3]>New positions for changed particles.
velocities: Vec<[f64; 3]>New velocities for changed particles.
Implementations§
Source§impl DeltaCheckpoint
impl DeltaCheckpoint
Sourcepub fn compute(
base_step: u64,
target_step: u64,
base: &SimulationState,
target: &SimulationState,
tol: f64,
) -> Self
pub fn compute( base_step: u64, target_step: u64, base: &SimulationState, target: &SimulationState, tol: f64, ) -> Self
Compute a delta between base and target states.
A particle is considered changed if any position or velocity component
differs by more than tol.
Sourcepub fn num_changed(&self) -> usize
pub fn num_changed(&self) -> usize
Number of changed particles.
Sourcepub fn apply(&self, base: &SimulationState) -> SimulationState
pub fn apply(&self, base: &SimulationState) -> SimulationState
Apply this delta to base, returning a new reconstructed state.
Trait Implementations§
Source§impl Clone for DeltaCheckpoint
impl Clone for DeltaCheckpoint
Source§fn clone(&self) -> DeltaCheckpoint
fn clone(&self) -> DeltaCheckpoint
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for DeltaCheckpoint
impl RefUnwindSafe for DeltaCheckpoint
impl Send for DeltaCheckpoint
impl Sync for DeltaCheckpoint
impl Unpin for DeltaCheckpoint
impl UnsafeUnpin for DeltaCheckpoint
impl UnwindSafe for DeltaCheckpoint
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.