Struct Array

Source
pub struct Array<'a, T: Clone, const D: usize> { /* private fields */ }

Implementations§

Source§

impl<'a, T: Clone, const D: usize> Array<'a, T, D>

Source

pub fn slice(&'a self, slice: &[Range<usize>; D]) -> Array<'a, T, D>

Source

pub fn get(&self, indices: [usize; D]) -> Option<&T>

Source§

impl<'a, T: Clone + Ord, const D: usize> Array<'a, T, D>

Source

pub fn max(&self) -> Option<T>

Source

pub fn arg_max(&self) -> Vec<usize>

Source

pub fn max_across(&self, axis: usize) -> Vec<Option<T>>

Source

pub fn arg_max_across(&self, axis: usize) -> Vec<Option<usize>>

Source

pub fn min(&self) -> Option<T>

Source

pub fn arg_min(&self) -> Vec<usize>

Source

pub fn min_across(&self, axis: usize) -> Vec<Option<T>>

Source

pub fn arg_min_across(&self, axis: usize) -> Vec<Option<usize>>

Source

pub fn clip(&self, min: &T, max: &T) -> Array<'a, T, D>

Source§

impl<'a, T, const D: usize> Array<'a, T, D>
where T: Clone + Ord + Sub<Output = T>,

Source

pub fn ptp(&self) -> Option<T>

Source

pub fn ptp_across(&self, axis: usize) -> Vec<Option<T>>

Source§

impl<'a, T, const D: usize> Array<'a, T, D>
where T: Clone + Add<Output = T> + Zero,

Source

pub fn sum(&self) -> T

Source

pub fn sum_across(&self, axis: usize) -> Vec<T>

Source§

impl<'a, T, const D: usize> Array<'a, T, D>
where T: Clone + Mul<Output = T> + One,

Source

pub fn prod(&self) -> T

Source

pub fn prod_across(&self, axis: usize) -> Vec<T>

Source§

impl<'a, T, const D: usize> Array<'a, T, D>
where T: Clone + Add<Output = T> + FromPrimitive + Div<T, Output = T> + Zero,

Source

pub fn mean(&self) -> T

Source

pub fn mean_across(&self, axis: usize) -> Vec<T>

Source§

impl<'a, T, const D: usize> Array<'a, T, D>
where T: Clone + Sub<Output = T> + FromPrimitive + Div<T, Output = T> + Mul<Output = T> + Zero,

Source

pub fn var(&self) -> T

Source

pub fn var_across(&self, axis: usize) -> Vec<T>

Source§

impl<'a, T: Clone, const D: usize> Array<'a, T, D>

Source

pub fn flat(&self) -> Iter<'_, T, D>

Source

pub fn axes(&self) -> Axes<'_, D>

Source

pub fn axis_view(&self, axis: usize) -> AxisView<'_, T, D>

Source§

impl<'a, T: Clone, const D: usize> Array<'a, T, D>

Source

pub fn transpose(self) -> Array<'a, T, D>

Source

pub fn t(&'a self) -> Array<'a, T, D>

Source

pub fn flip(&'a self, axis: usize) -> Array<'a, T, D>

Source

pub fn swap_axes(&'a self, axis0: usize, axis1: usize) -> Array<'a, T, D>

Source

pub fn reshape<const S: usize>(&self, shape: [usize; S]) -> Array<'a, T, S>

Source

pub fn flatten(&self) -> Array<'a, T, 1>

Source

pub fn ravel(&self) -> Array<'a, T, 1>

Source§

impl<'a, T: Clone + Default, const D: usize> Array<'a, T, D>

Source

pub fn resize<const S: usize>(self, shape: [usize; S]) -> Array<'a, T, S>

Source§

impl<'a, T: Clone, const D: usize> Array<'a, T, D>

Source

pub fn init(vec: Vec<T>, shape: [usize; D]) -> Self

Source

pub fn shape(&self) -> &[usize; D]

Source

pub fn strides(&self) -> &[usize; D]

Source

pub fn full(val: T, shape: [usize; D]) -> Array<'a, T, D>

Source

pub fn full_like<'b, U: Clone>( val: T, array: &Array<'b, U, D>, ) -> Array<'a, T, D>

Source§

impl<'a, T: Clone> Array<'a, T, 1>

Source

pub fn arange<I: Iterator<Item = T>>(range: I) -> Array<'a, T, 1>

Source§

impl<'a, T: Clone + Zero, const D: usize> Array<'a, T, D>

Source

pub fn zeros(shape: [usize; D]) -> Self

Source

pub fn zeros_like<'b, U: Clone>(array: &Array<'b, U, D>) -> Array<'a, T, D>

Source§

impl<'a, T: Clone + One, const D: usize> Array<'a, T, D>

Source

pub fn ones(shape: [usize; D]) -> Self

Source

pub fn ones_like<'b, U: Clone>(array: &Array<'b, U, D>) -> Array<'a, T, D>

Trait Implementations§

Source§

impl<'a, 'b, T: Clone + Add<Output = T>, const D: usize> Add<&Array<'b, T, D>> for &Array<'a, T, D>

Source§

type Output = Array<'a, T, D>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &Array<'b, T, D>) -> Self::Output

Performs the + operation. Read more
Source§

impl<'a, 'b, T: Clone + Add<Output = T>, const D: usize> Add<Array<'b, T, D>> for Array<'a, T, D>

Source§

type Output = Array<'a, T, D>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Array<'b, T, D>) -> Self::Output

Performs the + operation. Read more
Source§

impl<'a, U: Clone, O: 'a + Clone, T: Clone + Div<U, Output = O>, const D: usize> Div<U> for &Array<'a, T, D>

Source§

type Output = Array<'a, O, D>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: U) -> Self::Output

Performs the / operation. Read more
Source§

impl<'a, U: Clone, O: 'a + Clone, T: Clone + Div<U, Output = O>, const D: usize> Div<U> for Array<'a, T, D>

Source§

type Output = Array<'a, O, D>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: U) -> Self::Output

Performs the / operation. Read more
Source§

impl<'a, T: Clone, const D: usize> Index<[usize; D]> for Array<'a, T, D>

Source§

type Output = T

The returned type after indexing.
Source§

fn index(&self, indices: [usize; D]) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl<'a, U: Clone, O: 'a + Clone, T: Clone + Mul<U, Output = O>, const D: usize> Mul<U> for &Array<'a, T, D>

Source§

type Output = Array<'a, O, D>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: U) -> Self::Output

Performs the * operation. Read more
Source§

impl<'a, U: Clone, O: 'a + Clone, T: Clone + Mul<U, Output = O>, const D: usize> Mul<U> for Array<'a, T, D>

Source§

type Output = Array<'a, O, D>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: U) -> Self::Output

Performs the * operation. Read more
Source§

impl<'a, T: Clone + Neg<Output = T>, const D: usize> Neg for Array<'a, T, D>

Source§

type Output = Array<'a, T, D>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl<'a, 'b, T: Clone + Sub<Output = T>, const D: usize> Sub<&Array<'b, T, D>> for &Array<'a, T, D>

Source§

type Output = Array<'a, T, D>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &Array<'b, T, D>) -> Self::Output

Performs the - operation. Read more
Source§

impl<'a, 'b, T: Clone + Sub<Output = T>, const D: usize> Sub<Array<'b, T, D>> for Array<'a, T, D>

Source§

type Output = Array<'a, T, D>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Array<'b, T, D>) -> Self::Output

Performs the - operation. Read more

Auto Trait Implementations§

§

impl<'a, T, const D: usize> Freeze for Array<'a, T, D>

§

impl<'a, T, const D: usize> RefUnwindSafe for Array<'a, T, D>
where T: RefUnwindSafe,

§

impl<'a, T, const D: usize> Send for Array<'a, T, D>
where T: Sync + Send,

§

impl<'a, T, const D: usize> Sync for Array<'a, T, D>
where T: Sync,

§

impl<'a, T, const D: usize> Unpin for Array<'a, T, D>
where T: Unpin,

§

impl<'a, T, const D: usize> UnwindSafe for Array<'a, T, D>

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.