MutArray

Trait MutArray 

Source
pub trait MutArray<T: Debug + Display + Copy + Sized, S>: Array<T, S> {
Show 15 methods // Required methods fn set(&mut self, pos: S, x: T); fn iterator_mut<'b>( &'b mut self, axis: u8, ) -> Box<dyn Iterator<Item = &'b mut T> + 'b>; // Provided methods fn swap(&mut self, a: S, b: S) where S: Copy { ... } fn div_element_mut(&mut self, pos: S, x: T) where T: Number, S: Copy { ... } fn mul_element_mut(&mut self, pos: S, x: T) where T: Number, S: Copy { ... } fn add_element_mut(&mut self, pos: S, x: T) where T: Number, S: Copy { ... } fn sub_element_mut(&mut self, pos: S, x: T) where T: Number, S: Copy { ... } fn sub_scalar_mut(&mut self, x: T) where T: Number { ... } fn add_scalar_mut(&mut self, x: T) where T: Number { ... } fn mul_scalar_mut(&mut self, x: T) where T: Number { ... } fn div_scalar_mut(&mut self, x: T) where T: Number { ... } fn add_mut(&mut self, other: &dyn Array<T, S>) where T: Number, S: Eq { ... } fn sub_mut(&mut self, other: &dyn Array<T, S>) where T: Number, S: Eq { ... } fn mul_mut(&mut self, other: &dyn Array<T, S>) where T: Number, S: Eq { ... } fn div_mut(&mut self, other: &dyn Array<T, S>) where T: Number, S: Eq { ... }
}
Expand description

Abstract methods for mutable Array

Required Methods§

Source

fn set(&mut self, pos: S, x: T)

assign value to a position

Source

fn iterator_mut<'b>( &'b mut self, axis: u8, ) -> Box<dyn Iterator<Item = &'b mut T> + 'b>

iterate over mutable values

Provided Methods§

Source

fn swap(&mut self, a: S, b: S)
where S: Copy,

swap values between positions

Source

fn div_element_mut(&mut self, pos: S, x: T)
where T: Number, S: Copy,

divide element by a given value

Source

fn mul_element_mut(&mut self, pos: S, x: T)
where T: Number, S: Copy,

multiply element for a given value

Source

fn add_element_mut(&mut self, pos: S, x: T)
where T: Number, S: Copy,

add a given value to an element

Source

fn sub_element_mut(&mut self, pos: S, x: T)
where T: Number, S: Copy,

subtract a given value to an element

Source

fn sub_scalar_mut(&mut self, x: T)
where T: Number,

subtract a given value to all the elements

Source

fn add_scalar_mut(&mut self, x: T)
where T: Number,

add a given value to all the elements

Source

fn mul_scalar_mut(&mut self, x: T)
where T: Number,

multiply a given value to all the elements

Source

fn div_scalar_mut(&mut self, x: T)
where T: Number,

divide a given value to all the elements

Source

fn add_mut(&mut self, other: &dyn Array<T, S>)
where T: Number, S: Eq,

add values from another array to the values of initial array

Source

fn sub_mut(&mut self, other: &dyn Array<T, S>)
where T: Number, S: Eq,

subtract values from another array to the values of initial array

Source

fn mul_mut(&mut self, other: &dyn Array<T, S>)
where T: Number, S: Eq,

multiply values from another array to the values of initial array

Source

fn div_mut(&mut self, other: &dyn Array<T, S>)
where T: Number, S: Eq,

divide values from another array to the values of initial array

Implementations on Foreign Types§

Source§

impl<T: Debug + Display + Copy + Sized> MutArray<T, usize> for Vec<T>

Source§

fn set(&mut self, i: usize, x: T)

Source§

fn iterator_mut<'b>( &'b mut self, axis: u8, ) -> Box<dyn Iterator<Item = &'b mut T> + 'b>

Implementors§

Source§

impl<'a, T: Debug + Display + Copy + Sized> MutArray<T, (usize, usize)> for DenseMatrixMutView<'a, T>

Source§

impl<'a, T: Debug + Display + Copy + Sized> MutArray<T, usize> for VecMutView<'a, T>

Source§

impl<T: Debug + Display + Copy + Sized> MutArray<T, (usize, usize)> for DenseMatrix<T>