Struct multiarray::MultiArray
[−]
[src]
pub struct MultiArray<T, A> where
A: LayoutHelper, { /* fields omitted */ }
Type for multi-dimensional arrays that are organized linearly in memory much like a C array but with dynamically determined sizes.
Example
use multiarray::*; let mut matrix = Array2D::new([3, 2], 0); matrix[[0,0]] = 1; matrix[[0,1]] = 2; matrix[[1,0]] = 3; matrix[[1,1]] = 4; matrix[[2,0]] = 5; matrix[[2,1]] = 6;
Methods
impl<T, A> MultiArray<T, A> where
T: Clone,
A: LayoutHelper,
[src]
T: Clone,
A: LayoutHelper,
fn new<X>(extents: X, fill: T) -> Self where
X: Into<A::U>,
X: Into<A::U>,
Create new multi-dimensiopnal array with the given extents (one per dimension)
impl<T, A> MultiArray<T, A> where
A: LayoutHelper,
[src]
A: LayoutHelper,
fn extents(&self) -> &[usize]
get the array's extents (one item per dimension)
fn borrow(&self) -> MultiArrayRef<T, A>
create a shared view that allows further manipulations of the view
fn borrow_mut(&mut self) -> MultiArrayRefMut<T, A>
create a mutable view that allows further manipulations of the view
fn reversed_dim(&self, dim: usize) -> MultiArrayRef<T, A>
Create a shared view where one given dimension is reversed
fn reversed_dim_mut(&mut self, dim: usize) -> MultiArrayRefMut<T, A>
Create a mutable view where one given dimension is reversed
fn subsampled_dim(&self, dim: usize, factor: usize) -> MultiArrayRef<T, A>
Create a shared view where one given dimension is subsampled by a given factor
fn subsampled_dim_mut(
&mut self,
dim: usize,
factor: usize
) -> MultiArrayRefMut<T, A>
&mut self,
dim: usize,
factor: usize
) -> MultiArrayRefMut<T, A>
Create a shared view where one given dimension is subsampled by a given factor
fn sliced_dim<R>(&self, dim: usize, range: R) -> MultiArrayRef<T, A> where
R: AnyRange<usize>,
R: AnyRange<usize>,
Create a shared view where one given dimension is sliced
fn sliced_dim_mut<R>(&mut self, dim: usize, range: R) -> MultiArrayRefMut<T, A> where
R: AnyRange<usize>,
R: AnyRange<usize>,
Create a mutable view where one given dimension is sliced
fn swapped_dims(&self, d1: usize, d2: usize) -> MultiArrayRef<T, A>
Create a shared view where the order of two dimensions are swapped
fn swapped_dims_mut(&mut self, d1: usize, d2: usize) -> MultiArrayRefMut<T, A>
Create a mutable view where the order of two dimensions are swapped
impl<T, A> MultiArray<T, A> where
A: LayoutHelperExt,
[src]
A: LayoutHelperExt,
fn eliminated_dim(
&self,
dim: usize,
coord: usize
) -> MultiArrayRef<T, A::OneLess>
&self,
dim: usize,
coord: usize
) -> MultiArrayRef<T, A::OneLess>
Create a lower-dimensional shared view where one dimension is fixed at the given coordinate.
fn eliminated_dim_mut(
&mut self,
dim: usize,
coord: usize
) -> MultiArrayRefMut<T, A::OneLess>
&mut self,
dim: usize,
coord: usize
) -> MultiArrayRefMut<T, A::OneLess>
Create a lower-dimensional mutable view where one dimension is fixed at the given coordinate.
Trait Implementations
impl<T, A, I> Index<I> for MultiArray<T, A> where
A: LayoutHelper,
I: Into<A::U>,
[src]
A: LayoutHelper,
I: Into<A::U>,
type Output = T
The returned type after indexing
fn index(&self, index: I) -> &T
The method for the indexing (container[index]
) operation
impl<T, A, I> IndexMut<I> for MultiArray<T, A> where
A: LayoutHelper,
I: Into<A::U>,
[src]
A: LayoutHelper,
I: Into<A::U>,
fn index_mut(&mut self, index: I) -> &mut T
The method for the mutable indexing (container[index]
) operation