Struct arr_rs::arrays::array::Array

source ·
pub struct Array<N: Numeric> { /* private fields */ }
Expand description

default Array implementation

Trait Implementations§

source§

impl<N: Numeric> Add<Array<N>> for Array<N>

§

type Output = Array<N>

The resulting type after applying the + operator.
source§

fn add(self, other: Self) -> Self::Output

Performs the + operation. Read more
source§

impl<N: Numeric> Add<N> for Array<N>

§

type Output = Array<N>

The resulting type after applying the + operator.
source§

fn add(self, other: N) -> Self::Output

Performs the + operation. Read more
source§

impl<N: Numeric> ArrayBase<N> for Array<N>

source§

fn new(elements: Vec<N>, shape: Vec<usize>) -> Self

Creates new array Read more
source§

fn flat(elements: Vec<N>) -> Self

Creates new flat array Read more
source§

fn rand(shape: Vec<usize>) -> Self

Creates new array with random elements from (0 ..= 1) range Read more
source§

fn empty() -> Self

Creates new empty array Read more
source§

fn zeros(shape: Vec<usize>) -> Self

Creates new array of zeros Read more
source§

fn ones(shape: Vec<usize>) -> Self

Creates new array of ones Read more
source§

fn reshape(&self, shape: Vec<usize>) -> Self

Reshapes an array Read more
source§

fn product(&self) -> N

Multiplication of array elements Read more
source§

fn sum(&self) -> N

Sum of array elements Read more
source§

fn ndim(&self) -> usize

Count of array dimensions Read more
source§

fn len(&self) -> usize

Count of array elements Read more
source§

fn is_empty(&self) -> bool

Check if array element count equals zero Read more
source§

fn get_elements(&self) -> Vec<N>

Obtain the vector containing array elements Read more
source§

fn get_shape(&self) -> Vec<usize>

Obtain the vector containing array shape Read more
source§

fn index(&self, coords: &[usize]) -> usize

Return an index of element at the given coordinates Read more
source§

fn at(&self, coords: &[usize]) -> N

Return an index of element at the given coordinates Read more
source§

fn slice(&self, range: Range<usize>) -> Self

Return a subarray of provided range Read more
source§

fn ravel(&self) -> Self

Return a contiguous flattened array Read more
source§

fn for_each<F: FnMut(&N)>(&self, f: F)

Loop over array elements Read more
source§

fn for_each_e<F: FnMut(usize, &N)>(&self, f: F)

Loop over enumerated array elements Read more
source§

fn map<F: FnMut(&N) -> N>(&self, f: F) -> Self

Map over array elements Read more
source§

fn map_e<F: FnMut(usize, &N) -> N>(&self, f: F) -> Self

Map over enumerated array elements Read more
source§

fn filter<F: FnMut(&N) -> bool>(&self, f: F) -> Self

Filter over array elements Returns a flat filtered array Read more
source§

fn filter_e<F: FnMut(usize, &N) -> bool>(&self, f: F) -> Self

Filter over enumerated array elements Returns a flat filtered array Read more
source§

fn filter_map<F: FnMut(&N) -> Option<N>>(&self, f: F) -> Self

Filter and map over array elements Returns a flat filtered array Read more
source§

fn filter_map_e<F: FnMut(usize, &N) -> Option<N>>(&self, f: F) -> Self

Filter and map over enumerated array elements Returns a flat filtered array Read more
source§

fn fold<F: FnMut(&N, &N) -> N>(&self, init: N, f: F) -> N

Fold elements of array elements Read more
source§

impl<N: Clone + Numeric> Clone for Array<N>

source§

fn clone(&self) -> Array<N>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<N: Debug + Numeric> Debug for Array<N>

source§

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

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

impl<N: Numeric> Display for Array<N>

source§

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

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

impl<N: Numeric> Div<Array<N>> for Array<N>

§

type Output = Array<N>

The resulting type after applying the / operator.
source§

fn div(self, other: Self) -> Self::Output

Performs the / operation. Read more
source§

impl<N: Numeric> Div<N> for Array<N>

§

type Output = Array<N>

The resulting type after applying the / operator.
source§

fn div(self, other: N) -> Self::Output

Performs the / operation. Read more
source§

impl<N: Numeric> FromIterator<N> for Array<N>

source§

fn from_iter<T: IntoIterator<Item = N>>(iter: T) -> Self

Creates a value from an iterator. Read more
source§

impl<N: Numeric> IntoIterator for Array<N>

§

type Item = N

The type of the elements being iterated over.
§

type IntoIter = IntoIter<<Array<N> as IntoIterator>::Item, Global>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl<N: Numeric> Mul<Array<N>> for Array<N>

§

type Output = Array<N>

The resulting type after applying the * operator.
source§

fn mul(self, other: Self) -> Self::Output

Performs the * operation. Read more
source§

impl<N: Numeric> Mul<N> for Array<N>

§

type Output = Array<N>

The resulting type after applying the * operator.
source§

fn mul(self, other: N) -> Self::Output

Performs the * operation. Read more
source§

impl<N: Numeric> PartialEq<Array<N>> for Array<N>

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<N: Numeric> PartialOrd<Array<N>> for Array<N>

source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
source§

fn lt(&self, other: &Self) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
source§

fn le(&self, other: &Self) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
source§

fn gt(&self, other: &Self) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
source§

fn ge(&self, other: &Self) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<N: Numeric> Sub<Array<N>> for Array<N>

§

type Output = Array<N>

The resulting type after applying the - operator.
source§

fn sub(self, other: Self) -> Self::Output

Performs the - operation. Read more
source§

impl<N: Numeric> Sub<N> for Array<N>

§

type Output = Array<N>

The resulting type after applying the - operator.
source§

fn sub(self, other: N) -> Self::Output

Performs the - operation. Read more
source§

impl<N: Numeric> ArrayDisplay<N> for Array<N>

Auto Trait Implementations§

§

impl<N> RefUnwindSafe for Array<N>where N: RefUnwindSafe,

§

impl<N> Send for Array<N>where N: Send,

§

impl<N> Sync for Array<N>where N: Sync,

§

impl<N> Unpin for Array<N>where N: Unpin,

§

impl<N> UnwindSafe for Array<N>where N: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · 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> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V