Struct arrayfire::Dim4
[−]
[src]
pub struct Dim4 { /* fields omitted */ }
Dim4 is used to store Array dimensions
Methods
impl Dim4
[src]
fn new(dims: &[u64; 4]) -> Dim4
fn elements(&self) -> u64
Get the number of elements represented by Dim4 object
fn ndims(&self) -> usize
Get the number of dimensions of Dim4
fn get(&self) -> &[u64; 4]
Trait Implementations
impl Copy for Dim4
[src]
impl Clone for Dim4
[src]
fn clone(&self) -> Dim4
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl PartialEq for Dim4
[src]
fn eq(&self, __arg_0: &Dim4) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Dim4) -> bool
This method tests for !=
.
impl Debug for Dim4
[src]
impl Default for Dim4
[src]
Default trait for Dim4 returns an Array of dimensions [1, 1, 1, 1]
impl Index<usize> for Dim4
[src]
Enables index operation for Dim4
Examples
use arrayfire::Dim4; let dims = Dim4::new(&[4, 4, 2, 1]); println!("0th Dimension length is {}", dims[0]); // -> 4 println!("1th Dimension length is {}", dims[1]); // -> 4 println!("2th Dimension length is {}", dims[2]); // -> 2 println!("3th Dimension length is {}", dims[3]); // -> 1
type Output = u64
The returned type after indexing
fn index<'a>(&'a self, _index: usize) -> &'a u64
The method for the indexing (container[index]
) operation
impl Display for Dim4
[src]
Enables use of Dim4 objects for printing it to display
Examples
use arrayfire::Dim4; let dims = Dim4::new(&[4, 4, 2, 1]); println!("0th Dimension length is {}", dims[0]); // -> 4