Skip to main content

WorkBuffers

Struct WorkBuffers 

Source
pub struct WorkBuffers {
Show 15 fields pub gxcar: Vec<[F; 3]>, pub mol_descs: Vec<(usize, usize, usize, usize)>, pub radiuswork: Vec<F>, pub fmol: Vec<F>, pub flash_ind: Vec<usize>, pub flash_l: Vec<usize>, pub cached_x: Vec<F>, pub cached_comptype: Vec<bool>, pub cached_init1: bool, pub cached_ncells: [usize; 3], pub cached_cell_length: [F; 3], pub cached_pbc_min: [F; 3], pub cached_pbc_length: [F; 3], pub cached_pbc_periodic: [bool; 3], pub cached_geometry_valid: bool,
}
Expand description

Reusable mutable buffers shared across packing iterations.

Fields§

§gxcar: Vec<[F; 3]>

Cartesian gradient accumulator used by objective gradient evaluation.

§mol_descs: Vec<(usize, usize, usize, usize)>

Reused per-active-molecule descriptor list (itype, icart0, ilubar, ilugan) for the phase-structured expand_molecules / project_cartesian_gradient passes. Both rebuild it from the current comptype each call (cheap index arithmetic, no trig); persisting the Vec keeps that hot rebuild allocation-free.

§radiuswork: Vec<F>

Temporary radius backup used by movebad/radius scaling paths.

§fmol: Vec<F>

Per-molecule score buffer used by flashsort/movebad ranking.

§flash_ind: Vec<usize>

Index permutation buffer reused by flashsort in movebad.

§flash_l: Vec<usize>

Histogram bucket buffer reused by flashsort.

§cached_x: Vec<F>

Last x-vector whose expanded Cartesian geometry is still resident in PackContext.

§cached_comptype: Vec<bool>

Active-type mask associated with cached_x.

§cached_init1: bool

Whether the cached geometry was built in init1 mode.

§cached_ncells: [usize; 3]

Cell grid signature for the cached geometry.

§cached_cell_length: [F; 3]§cached_pbc_min: [F; 3]§cached_pbc_length: [F; 3]§cached_pbc_periodic: [bool; 3]§cached_geometry_valid: bool

Whether the cached geometry metadata is valid.

Implementations§

Source§

impl WorkBuffers

Source

pub fn new(ntotat: usize) -> Self

Source

pub fn ensure_atom_capacity(&mut self, ntotat: usize)

Source

pub fn matches_cached_geometry( &self, x: &[F], comptype: &[bool], init1: bool, ncells: [usize; 3], cell_length: [F; 3], pbc_min: [F; 3], pbc_length: [F; 3], pbc_periodic: [bool; 3], ) -> bool

Source

pub fn update_cached_geometry( &mut self, x: &[F], comptype: &[bool], init1: bool, ncells: [usize; 3], cell_length: [F; 3], pbc_min: [F; 3], pbc_length: [F; 3], pbc_periodic: [bool; 3], )

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V