pub struct DistributedVector {
pub local_values: Vec<f64>,
pub ghost_values: Vec<f64>,
pub partition: RowPartition,
pub ghost_rows: Vec<usize>,
}Expand description
A vector distributed across workers with separate local and ghost storage.
Fields§
§local_values: Vec<f64>Values for owned rows (length = partition.n_local()).
ghost_values: Vec<f64>Values for ghost rows (length = ghost_rows.len()).
partition: RowPartitionRow ownership metadata.
ghost_rows: Vec<usize>Global indices of the ghost rows (parallel to ghost_values).
Implementations§
Source§impl DistributedVector
impl DistributedVector
Sourcepub fn from_global(
global: &[f64],
partition: &RowPartition,
ghost_rows: &[usize],
) -> SparseResult<Self>
pub fn from_global( global: &[f64], partition: &RowPartition, ghost_rows: &[usize], ) -> SparseResult<Self>
Construct a distributed vector by slicing the global vector.
§Arguments
global— The full global vector of lengthn_global_rows.partition— Which rows this worker owns.ghost_rows— Global indices of ghost rows needed by this worker.
Sourcepub fn to_global(&self, n_global: usize) -> Vec<f64>
pub fn to_global(&self, n_global: usize) -> Vec<f64>
Assemble the full global vector (owned rows only; other entries are 0).
Sourcepub fn get_global(&self, global_row: usize) -> Option<f64>
pub fn get_global(&self, global_row: usize) -> Option<f64>
Look up a value by global row index (searches local then ghost storage).
Trait Implementations§
Source§impl Clone for DistributedVector
impl Clone for DistributedVector
Source§fn clone(&self) -> DistributedVector
fn clone(&self) -> DistributedVector
Returns a duplicate of the value. Read more
1.0.0 · 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 DistributedVector
impl RefUnwindSafe for DistributedVector
impl Send for DistributedVector
impl Sync for DistributedVector
impl Unpin for DistributedVector
impl UnsafeUnpin for DistributedVector
impl UnwindSafe for DistributedVector
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<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more