Struct VecMutView

Source
pub struct VecMutView<'a, T: Debug + Display + Copy + Sized> { /* private fields */ }
Expand description

Provide mutable window on array

Trait Implementations§

Source§

impl<T: Debug + Display + Copy + Sized> Array<T, usize> for VecMutView<'_, T>

Source§

fn get(&self, i: usize) -> &T

retrieve a reference to a value at position
Source§

fn shape(&self) -> usize

return shape of the array
Source§

fn is_empty(&self) -> bool

return true if array is empty
Source§

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

iterate over array’s values
Source§

impl<T: Debug + Display + Copy + Sized> ArrayView1<T> for VecMutView<'_, T>

Source§

fn dot(&self, other: &dyn ArrayView1<T>) -> T
where T: Number,

return dot product with another array
Source§

fn sum(&self) -> T
where T: Number,

return sum of all value of the view
Source§

fn max(&self) -> T
where T: Number + PartialOrd,

return max value from the view
Source§

fn min(&self) -> T
where T: Number + PartialOrd,

return min value from the view
Source§

fn argmax(&self) -> usize
where T: Number + PartialOrd,

return the position of the max value of the view
Source§

fn unique(&self) -> Vec<T>
where T: Number + Ord,

sort the elements and remove duplicates
Source§

fn unique_with_indices(&self) -> (Vec<T>, Vec<usize>)
where T: Number + Ord,

return sorted unique elements
Source§

fn norm2(&self) -> f64
where T: Number,

return norm2
Source§

fn norm(&self, p: f64) -> f64
where T: Number,

return norm
Source§

fn max_diff(&self, other: &dyn ArrayView1<T>) -> T
where T: Number + Signed + PartialOrd,

return max differences in array
Source§

fn variance(&self) -> f64
where T: Number,

return array variance
Source§

fn std_dev(&self) -> f64
where T: Number,

return variance
Source§

fn mean_by(&self) -> f64
where T: Number,

return mean of the array
Source§

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

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

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

Source§

fn set(&mut self, i: usize, 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
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
Source§

impl<T: Debug + Display + Copy + Sized> MutArrayView1<T> for VecMutView<'_, T>

Source§

fn copy_from(&mut self, other: &dyn Array<T, usize>)

copy a mutable view from array
Source§

fn abs_mut(&mut self)
where T: Number + Signed,

return a mutable view of absolute values
Source§

fn neg_mut(&mut self)
where T: Number + Neg<Output = T>,

return a mutable view of values with opposite sign
Source§

fn pow_mut(&mut self, p: T)
where T: RealNumber,

return a mutable view of values at power p
Source§

fn argsort_mut(&mut self) -> Vec<usize>
where T: Number + PartialOrd,

return vector of indices for sorted elements
Source§

fn softmax_mut(&mut self)
where T: RealNumber,

return softmax values

Auto Trait Implementations§

§

impl<'a, T> Freeze for VecMutView<'a, T>

§

impl<'a, T> RefUnwindSafe for VecMutView<'a, T>
where T: RefUnwindSafe,

§

impl<'a, T> Send for VecMutView<'a, T>
where T: Send,

§

impl<'a, T> Sync for VecMutView<'a, T>
where T: Sync,

§

impl<'a, T> Unpin for VecMutView<'a, T>

§

impl<'a, T> !UnwindSafe for VecMutView<'a, T>

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<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, 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.