Skip to main content

VectorViewMut

Trait VectorViewMut 

Source
pub trait VectorViewMut<'a>:
    VectorMutOpsByValue<Self::View>
    + VectorMutOpsByValue<Self::Owned>
    + for<'b> VectorMutOpsByValue<&'b Self::View>
    + for<'b> VectorMutOpsByValue<&'b Self::Owned>
    + MulAssign<Scale<Self::T>> {
    type Owned;
    type View;
    type Index: VectorIndex;

    // Required methods
    fn copy_from(&mut self, other: &Self::Owned);
    fn copy_from_view(&mut self, other: &Self::View);
    fn axpy(&mut self, alpha: Self::T, x: &Self::Owned, beta: Self::T);
    fn set_index(&mut self, index: IndexType, value: Self::T);
}
Expand description

A mutable view into a vector, supporting in-place operations and modifications.

This trait represents a temporary mutable reference to a vector’s data, allowing in-place arithmetic operations (+=, -=, *=) and other modifications. Mutable views can be created via the as_view_mut() method on a Vector.

Required Associated Types§

Required Methods§

Source

fn copy_from(&mut self, other: &Self::Owned)

Copy values from an owned vector into this view.

Source

fn copy_from_view(&mut self, other: &Self::View)

Copy values from another vector view into this view.

Source

fn axpy(&mut self, alpha: Self::T, x: &Self::Owned, beta: Self::T)

Compute the AXPY operation: self = alpha * x + beta * self

Source

fn set_index(&mut self, index: IndexType, value: Self::T)

Set the value at the specified index (sets across all batches when nbatch > 1).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§