pub struct SwapState { /* private fields */ }Expand description
Saved state for swaptype operations (mirrors swaptypemod.f90).
Implementations§
Source§impl SwapState
impl SwapState
Sourcepub fn init(x: &[F], sys: &PackContext) -> Self
pub fn init(x: &[F], sys: &PackContext) -> Self
action=0: save full x.
Sourcepub fn set_type(&self, itype: usize, sys: &mut PackContext) -> Vec<F> ⓘ
pub fn set_type(&self, itype: usize, sys: &mut PackContext) -> Vec<F> ⓘ
action=1: set up reduced x for itype only.
Returns the compact x vector (length = nmols[itype] * 6).
Also updates sys.ntotmol and sys.comptype.
Sourcepub fn save_type(&mut self, itype: usize, xtype: &[F], sys: &PackContext)
pub fn save_type(&mut self, itype: usize, xtype: &[F], sys: &PackContext)
action=2: save per-type results back into xfull.
Sourcepub fn restore(&self, x: &mut [F], sys: &mut PackContext)
pub fn restore(&self, x: &mut [F], sys: &mut PackContext)
action=3: restore full x and ntotmol.
Auto Trait Implementations§
impl Freeze for SwapState
impl RefUnwindSafe for SwapState
impl Send for SwapState
impl Sync for SwapState
impl Unpin for SwapState
impl UnsafeUnpin for SwapState
impl UnwindSafe for SwapState
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