pub struct Array<N: Numeric> { /* private fields */ }Expand description
Array structure definition
Trait Implementations§
source§impl<N: NumericOps> Add<N> for Array<N>
impl<N: NumericOps> Add<N> for Array<N>
source§impl<N: NumericOps> AddAssign<Array<N>> for Array<N>
impl<N: NumericOps> AddAssign<Array<N>> for Array<N>
source§fn add_assign(&mut self, other: Self)
fn add_assign(&mut self, other: Self)
Performs the
+= operation. Read moresource§impl<N: NumericOps> AddAssign<N> for Array<N>
impl<N: NumericOps> AddAssign<N> for Array<N>
source§fn add_assign(&mut self, other: N)
fn add_assign(&mut self, other: N)
Performs the
+= operation. Read moresource§impl<N: Numeric> ArrayAxis<N> for Array<N>
impl<N: Numeric> ArrayAxis<N> for Array<N>
source§fn transpose(&self, axes: Option<Vec<isize>>) -> Result<Self, ArrayError>
fn transpose(&self, axes: Option<Vec<isize>>) -> Result<Self, ArrayError>
Returns an array with axes transposed Read more
source§fn moveaxis(
&self,
source: Vec<isize>,
destination: Vec<isize>
) -> Result<Self, ArrayError>
fn moveaxis( &self, source: Vec<isize>, destination: Vec<isize> ) -> Result<Self, ArrayError>
Move axes of an array to new positions Read more
source§fn rollaxis(
&self,
axis: isize,
start: Option<isize>
) -> Result<Self, ArrayError>
fn rollaxis( &self, axis: isize, start: Option<isize> ) -> Result<Self, ArrayError>
Roll the specified axis backwards, until it lies in a given position Read more
source§fn swapaxes(&self, axis_1: isize, axis_2: isize) -> Result<Self, ArrayError>
fn swapaxes(&self, axis_1: isize, axis_2: isize) -> Result<Self, ArrayError>
Interchange two axes of an array Read more
source§fn expand_dims(&self, axes: Vec<isize>) -> Result<Self, ArrayError>
fn expand_dims(&self, axes: Vec<isize>) -> Result<Self, ArrayError>
Expand the shape of an array Read more
source§impl<N: Numeric> ArrayBroadcast<N> for Array<N>
impl<N: Numeric> ArrayBroadcast<N> for Array<N>
source§fn broadcast(&self, other: &Array<N>) -> Result<Array<Tuple2<N>>, ArrayError>
fn broadcast(&self, other: &Array<N>) -> Result<Array<Tuple2<N>>, ArrayError>
Broadcast an array to a new shape Read more
source§fn broadcast_to(&self, shape: Vec<usize>) -> Result<Array<N>, ArrayError>
fn broadcast_to(&self, shape: Vec<usize>) -> Result<Array<N>, ArrayError>
Broadcast an array to a new shape Read more
source§fn broadcast_arrays(arrays: Vec<Array<N>>) -> Result<Vec<Array<N>>, ArrayError>
fn broadcast_arrays(arrays: Vec<Array<N>>) -> Result<Vec<Array<N>>, ArrayError>
Broadcast a list of arrays to a common shape Read more
source§impl<N: Numeric> ArrayCreate<N> for Array<N>
impl<N: Numeric> ArrayCreate<N> for Array<N>
source§fn new(elements: Vec<N>, shape: Vec<usize>) -> Result<Array<N>, ArrayError>
fn new(elements: Vec<N>, shape: Vec<usize>) -> Result<Array<N>, ArrayError>
Creates new array Read more
source§fn single(element: N) -> Result<Self, ArrayError>
fn single(element: N) -> Result<Self, ArrayError>
Creates new array with single element Read more
source§fn rand(shape: Vec<usize>) -> Result<Self, ArrayError>
fn rand(shape: Vec<usize>) -> Result<Self, ArrayError>
Creates new array with random elements from (0 ..= 1) range Read more
source§fn eye(n: usize, m: Option<usize>, k: Option<usize>) -> Result<Self, ArrayError>
fn eye(n: usize, m: Option<usize>, k: Option<usize>) -> Result<Self, ArrayError>
Creates new 2d array with ones on the diagonal and zeros elsewhere Read more
source§fn zeros_like(other: &Self) -> Result<Self, ArrayError>
fn zeros_like(other: &Self) -> Result<Self, ArrayError>
Creates new array of zeros like other array Read more
source§fn ones_like(other: &Self) -> Result<Self, ArrayError>
fn ones_like(other: &Self) -> Result<Self, ArrayError>
Creates new array of ones like other array Read more
source§fn full(shape: Vec<usize>, fill_value: N) -> Result<Self, ArrayError>
fn full(shape: Vec<usize>, fill_value: N) -> Result<Self, ArrayError>
Creates new array of fill_value Read more
source§fn full_like(other: &Self, fill_value: N) -> Result<Self, ArrayError>
fn full_like(other: &Self, fill_value: N) -> Result<Self, ArrayError>
Creates new array of fill_value like other array Read more
source§fn arange(start: N, stop: N, step: Option<N>) -> Result<Self, ArrayError>
fn arange(start: N, stop: N, step: Option<N>) -> Result<Self, ArrayError>
Creates new array from range Read more
source§fn linspace(
start: N,
stop: N,
num: Option<usize>,
endpoint: Option<bool>
) -> Result<Self, ArrayError>
fn linspace( start: N, stop: N, num: Option<usize>, endpoint: Option<bool> ) -> Result<Self, ArrayError>
Creates new array of numbers evenly spaced over a specified interval Read more
source§fn linspace_a(
start: &Self,
stop: &Self,
num: Option<usize>,
endpoint: Option<bool>
) -> Result<Array<N>, ArrayError>
fn linspace_a( start: &Self, stop: &Self, num: Option<usize>, endpoint: Option<bool> ) -> Result<Array<N>, ArrayError>
Creates new array of numbers evenly spaced over a specified interval Read more
source§fn logspace(
start: N,
stop: N,
num: Option<usize>,
endpoint: Option<bool>,
base: Option<usize>
) -> Result<Self, ArrayError>
fn logspace( start: N, stop: N, num: Option<usize>, endpoint: Option<bool>, base: Option<usize> ) -> Result<Self, ArrayError>
Creates new array of numbers evenly spaced on a log scale over a specified interval Read more
source§fn logspace_a(
start: &Self,
stop: &Self,
num: Option<usize>,
endpoint: Option<bool>,
base: Option<&Array<usize>>
) -> Result<Array<N>, ArrayError>
fn logspace_a( start: &Self, stop: &Self, num: Option<usize>, endpoint: Option<bool>, base: Option<&Array<usize>> ) -> Result<Array<N>, ArrayError>
Creates new array of numbers evenly spaced on a log scale over a specified interval Read more
source§fn geomspace(
start: N,
stop: N,
num: Option<usize>,
endpoint: Option<bool>
) -> Result<Array<N>, ArrayError>
fn geomspace( start: N, stop: N, num: Option<usize>, endpoint: Option<bool> ) -> Result<Array<N>, ArrayError>
Creates new array of numbers evenly spaced on a log scale (a geometric progression) over a specified interval Read more
source§impl<N: Numeric> ArrayCreateFrom<N> for Array<N>
impl<N: Numeric> ArrayCreateFrom<N> for Array<N>
source§fn diag(&self, k: Option<isize>) -> Result<Array<N>, ArrayError>
fn diag(&self, k: Option<isize>) -> Result<Array<N>, ArrayError>
Extract a diagonal or construct a diagonal array Read more
source§fn diagflat(&self, k: Option<isize>) -> Result<Array<N>, ArrayError>
fn diagflat(&self, k: Option<isize>) -> Result<Array<N>, ArrayError>
Construct a diagonal array for flattened input Read more
source§fn tril(&self, k: Option<isize>) -> Result<Array<N>, ArrayError>
fn tril(&self, k: Option<isize>) -> Result<Array<N>, ArrayError>
Return a copy of an array with elements above the k-th diagonal zeroed.
For arrays with ndim exceeding 2, tril will apply to the final two axes. Read more
source§impl<N: Numeric> ArrayIndexing<N> for Array<N>
impl<N: Numeric> ArrayIndexing<N> for Array<N>
source§fn index_at(&self, coords: &[usize]) -> Result<usize, ArrayError>
fn index_at(&self, coords: &[usize]) -> Result<usize, ArrayError>
Return an index of element at the given coordinates Read more
source§fn index_to_coord(&self, idx: usize) -> Result<Vec<usize>, ArrayError>
fn index_to_coord(&self, idx: usize) -> Result<Vec<usize>, ArrayError>
Return coordinates at the given index of element Read more
source§impl<N: Numeric> ArrayIter<N> for Array<N>
impl<N: Numeric> ArrayIter<N> for Array<N>
source§fn for_each<F: FnMut(&N)>(&self, f: F) -> Result<(), ArrayError>
fn for_each<F: FnMut(&N)>(&self, f: F) -> Result<(), ArrayError>
Loop over array elements Read more
source§fn for_each_e<F: FnMut(usize, &N)>(&self, f: F) -> Result<(), ArrayError>
fn for_each_e<F: FnMut(usize, &N)>(&self, f: F) -> Result<(), ArrayError>
Loop over enumerated array elements Read more
source§fn map<F: FnMut(&N) -> N>(&self, f: F) -> Result<Array<N>, ArrayError>
fn map<F: FnMut(&N) -> N>(&self, f: F) -> Result<Array<N>, ArrayError>
Map over array elements Read more
source§fn map_e<F: FnMut(usize, &N) -> N>(&self, f: F) -> Result<Array<N>, ArrayError>
fn map_e<F: FnMut(usize, &N) -> N>(&self, f: F) -> Result<Array<N>, ArrayError>
Map over enumerated array elements Read more
source§fn filter<F: FnMut(&N) -> bool>(&self, f: F) -> Result<Array<N>, ArrayError>
fn filter<F: FnMut(&N) -> bool>(&self, f: F) -> Result<Array<N>, ArrayError>
Filter over array elements
Returns a flat filtered array Read more
source§fn filter_e<F: FnMut(usize, &N) -> bool>(
&self,
f: F
) -> Result<Array<N>, ArrayError>
fn filter_e<F: FnMut(usize, &N) -> bool>( &self, f: F ) -> Result<Array<N>, ArrayError>
Filter over enumerated array elements
Returns a flat filtered array Read more
source§fn filter_map<F: FnMut(&N) -> Option<N>>(
&self,
f: F
) -> Result<Array<N>, ArrayError>
fn filter_map<F: FnMut(&N) -> Option<N>>( &self, f: F ) -> Result<Array<N>, ArrayError>
Filter and map over array elements
Returns a flat filtered array Read more
source§impl<N: Numeric> ArrayManipulate<N> for Array<N>
impl<N: Numeric> ArrayManipulate<N> for Array<N>
source§fn insert(
&self,
indices: Vec<usize>,
values: &Self,
axis: Option<usize>
) -> Result<Array<N>, ArrayError>
fn insert( &self, indices: Vec<usize>, values: &Self, axis: Option<usize> ) -> Result<Array<N>, ArrayError>
Insert values along the given axis for the given indices Read more
source§fn delete(
&self,
indices: Vec<usize>,
axis: Option<usize>
) -> Result<Array<N>, ArrayError>
fn delete( &self, indices: Vec<usize>, axis: Option<usize> ) -> Result<Array<N>, ArrayError>
Delete values along the given axis Read more
source§fn append(
&self,
values: &Self,
axis: Option<usize>
) -> Result<Array<N>, ArrayError>
fn append( &self, values: &Self, axis: Option<usize> ) -> Result<Array<N>, ArrayError>
Append values to the end of an array Read more
source§fn reshape(&self, shape: Vec<usize>) -> Result<Array<N>, ArrayError>
fn reshape(&self, shape: Vec<usize>) -> Result<Array<N>, ArrayError>
Reshapes an array Read more
source§fn resize(&self, shape: Vec<usize>) -> Result<Array<N>, ArrayError>
fn resize(&self, shape: Vec<usize>) -> Result<Array<N>, ArrayError>
Resizes an array, Read more
source§fn unique(&self, axis: Option<usize>) -> Result<Array<N>, ArrayError>
fn unique(&self, axis: Option<usize>) -> Result<Array<N>, ArrayError>
Find the unique elements of an array, Read more
source§fn atleast(&self, n: usize) -> Result<Array<N>, ArrayError>
fn atleast(&self, n: usize) -> Result<Array<N>, ArrayError>
Convert array to at least n dimension Read more
source§fn trim_zeros(&self) -> Result<Array<N>, ArrayError>
fn trim_zeros(&self) -> Result<Array<N>, ArrayError>
Trim the leading and/or trailing zeros from a 1D array Read more
source§impl<N: Numeric> ArrayMath<N> for Array<N>
impl<N: Numeric> ArrayMath<N> for Array<N>
source§impl<N: Numeric> ArrayMeta<N> for Array<N>
impl<N: Numeric> ArrayMeta<N> for Array<N>
source§fn get_elements(&self) -> Result<Vec<N>, ArrayError>
fn get_elements(&self) -> Result<Vec<N>, ArrayError>
Obtain the vector containing array elements Read more
source§impl<N: Numeric> ArrayReorder<N> for Array<N>
impl<N: Numeric> ArrayReorder<N> for Array<N>
source§fn flip(&self, axes: Option<Vec<isize>>) -> Result<Array<N>, ArrayError>
fn flip(&self, axes: Option<Vec<isize>>) -> Result<Array<N>, ArrayError>
Reverse the order of elements in an array along the given axis Read more
source§fn flipud(&self) -> Result<Array<N>, ArrayError>
fn flipud(&self) -> Result<Array<N>, ArrayError>
Reverse the order of elements along axis 0 (up/down) Read more
source§fn fliplr(&self) -> Result<Array<N>, ArrayError>
fn fliplr(&self) -> Result<Array<N>, ArrayError>
Reverse the order of elements along axis 1 (left/right) Read more
source§impl<N: Numeric> ArraySplit<N> for Array<N>
impl<N: Numeric> ArraySplit<N> for Array<N>
source§fn array_split(
&self,
parts: usize,
axis: Option<usize>
) -> Result<Vec<Array<N>>, ArrayError>
fn array_split( &self, parts: usize, axis: Option<usize> ) -> Result<Vec<Array<N>>, ArrayError>
Split an array into multiple sub-arrays Read more
source§fn split(
&self,
parts: usize,
axis: Option<usize>
) -> Result<Vec<Array<N>>, ArrayError>
fn split( &self, parts: usize, axis: Option<usize> ) -> Result<Vec<Array<N>>, ArrayError>
Split an array into multiple sub-arrays of equal size Read more
source§fn hsplit(&self, parts: usize) -> Result<Vec<Array<N>>, ArrayError>
fn hsplit(&self, parts: usize) -> Result<Vec<Array<N>>, ArrayError>
Split an array into multiple sub-arrays horizontally (column-wise) Read more
source§impl<N: Numeric> ArrayStack<N> for Array<N>
impl<N: Numeric> ArrayStack<N> for Array<N>
source§fn concatenate(arrs: Vec<Self>, axis: Option<usize>) -> Result<Self, ArrayError>
fn concatenate(arrs: Vec<Self>, axis: Option<usize>) -> Result<Self, ArrayError>
Join a sequence of arrays along an existing axis Read more
source§fn stack(arrs: Vec<Self>, axis: Option<usize>) -> Result<Self, ArrayError>
fn stack(arrs: Vec<Self>, axis: Option<usize>) -> Result<Self, ArrayError>
Join a sequence of arrays along a new axis Read more
source§fn vstack(arrs: Vec<Self>) -> Result<Self, ArrayError>
fn vstack(arrs: Vec<Self>) -> Result<Self, ArrayError>
Stack arrays in sequence vertically (row wise) Read more
source§fn hstack(arrs: Vec<Self>) -> Result<Self, ArrayError>
fn hstack(arrs: Vec<Self>) -> Result<Self, ArrayError>
Stack arrays in sequence horizontally (column wise) Read more
source§fn dstack(arrs: Vec<Self>) -> Result<Self, ArrayError>
fn dstack(arrs: Vec<Self>) -> Result<Self, ArrayError>
Stack arrays in sequence depth wise (along third axis) Read more
source§fn column_stack(arrs: Vec<Self>) -> Result<Self, ArrayError>
fn column_stack(arrs: Vec<Self>) -> Result<Self, ArrayError>
Stack 1d or 2d arrays as columns into a 2d array
row_stack is an alias for vstack Read more
source§impl<N: Numeric + BitAnd<Output = N>> BitAndAssign<Array<N>> for Array<N>
impl<N: Numeric + BitAnd<Output = N>> BitAndAssign<Array<N>> for Array<N>
source§fn bitand_assign(&mut self, other: Array<N>)
fn bitand_assign(&mut self, other: Array<N>)
Performs the
&= operation. Read moresource§impl<N: Numeric + BitAnd<Output = N>> BitAndAssign<N> for Array<N>
impl<N: Numeric + BitAnd<Output = N>> BitAndAssign<N> for Array<N>
source§fn bitand_assign(&mut self, other: N)
fn bitand_assign(&mut self, other: N)
Performs the
&= operation. Read moresource§impl<N: Numeric + BitOr<Output = N>> BitOrAssign<Array<N>> for Array<N>
impl<N: Numeric + BitOr<Output = N>> BitOrAssign<Array<N>> for Array<N>
source§fn bitor_assign(&mut self, other: Array<N>)
fn bitor_assign(&mut self, other: Array<N>)
Performs the
|= operation. Read moresource§impl<N: Numeric + BitOr<Output = N>> BitOrAssign<N> for Array<N>
impl<N: Numeric + BitOr<Output = N>> BitOrAssign<N> for Array<N>
source§fn bitor_assign(&mut self, other: N)
fn bitor_assign(&mut self, other: N)
Performs the
|= operation. Read moresource§impl<N: Numeric + BitXor<Output = N>> BitXorAssign<Array<N>> for Array<N>
impl<N: Numeric + BitXor<Output = N>> BitXorAssign<Array<N>> for Array<N>
source§fn bitxor_assign(&mut self, other: Array<N>)
fn bitxor_assign(&mut self, other: Array<N>)
Performs the
^= operation. Read moresource§impl<N: Numeric + BitXor<Output = N>> BitXorAssign<N> for Array<N>
impl<N: Numeric + BitXor<Output = N>> BitXorAssign<N> for Array<N>
source§fn bitxor_assign(&mut self, other: N)
fn bitxor_assign(&mut self, other: N)
Performs the
^= operation. Read moresource§impl<N: NumericOps> Div<N> for Array<N>
impl<N: NumericOps> Div<N> for Array<N>
source§impl<N: NumericOps> DivAssign<Array<N>> for Array<N>
impl<N: NumericOps> DivAssign<Array<N>> for Array<N>
source§fn div_assign(&mut self, other: Self)
fn div_assign(&mut self, other: Self)
Performs the
/= operation. Read moresource§impl<N: NumericOps> DivAssign<N> for Array<N>
impl<N: NumericOps> DivAssign<N> for Array<N>
source§fn div_assign(&mut self, other: N)
fn div_assign(&mut self, other: N)
Performs the
/= operation. Read moresource§impl<N: Numeric> FromIterator<N> for Array<N>
impl<N: Numeric> FromIterator<N> for Array<N>
source§fn from_iter<T: IntoIterator<Item = N>>(iter: T) -> Self
fn from_iter<T: IntoIterator<Item = N>>(iter: T) -> Self
Creates a value from an iterator. Read more
source§impl<'a, N: Numeric> IntoIterator for &'a Array<N>
impl<'a, N: Numeric> IntoIterator for &'a Array<N>
source§impl<N: Numeric> IntoIterator for Array<N>
impl<N: Numeric> IntoIterator for Array<N>
source§impl<N: NumericOps> Mul<N> for Array<N>
impl<N: NumericOps> Mul<N> for Array<N>
source§impl<N: NumericOps> MulAssign<Array<N>> for Array<N>
impl<N: NumericOps> MulAssign<Array<N>> for Array<N>
source§fn mul_assign(&mut self, other: Self)
fn mul_assign(&mut self, other: Self)
Performs the
*= operation. Read moresource§impl<N: NumericOps> MulAssign<N> for Array<N>
impl<N: NumericOps> MulAssign<N> for Array<N>
source§fn mul_assign(&mut self, other: N)
fn mul_assign(&mut self, other: N)
Performs the
*= operation. Read moresource§impl<N: SignedNumeric> Neg for Array<N>
impl<N: SignedNumeric> Neg for Array<N>
source§impl<N: Numeric> PartialEq<Array<N>> for Array<N>
impl<N: Numeric> PartialEq<Array<N>> for Array<N>
source§impl<N: Numeric> PartialOrd<Array<N>> for Array<N>
impl<N: Numeric> PartialOrd<Array<N>> for Array<N>
source§impl<N: NumericOps> Rem<N> for Array<N>
impl<N: NumericOps> Rem<N> for Array<N>
source§impl<N: NumericOps> RemAssign<Array<N>> for Array<N>
impl<N: NumericOps> RemAssign<Array<N>> for Array<N>
source§fn rem_assign(&mut self, other: Self)
fn rem_assign(&mut self, other: Self)
Performs the
%= operation. Read moresource§impl<N: NumericOps> RemAssign<N> for Array<N>
impl<N: NumericOps> RemAssign<N> for Array<N>
source§fn rem_assign(&mut self, other: N)
fn rem_assign(&mut self, other: N)
Performs the
%= operation. Read moresource§impl<N: NumericOps> Sub<N> for Array<N>
impl<N: NumericOps> Sub<N> for Array<N>
source§impl<N: NumericOps> SubAssign<Array<N>> for Array<N>
impl<N: NumericOps> SubAssign<Array<N>> for Array<N>
source§fn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
Performs the
-= operation. Read moresource§impl<N: NumericOps> SubAssign<N> for Array<N>
impl<N: NumericOps> SubAssign<N> for Array<N>
source§fn sub_assign(&mut self, other: N)
fn sub_assign(&mut self, other: N)
Performs the
-= operation. Read moreAuto 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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more