[][src]Struct arrayfire::Dim4

pub struct Dim4 { /* fields omitted */ }

Dim4 is used to store Array dimensions

Methods

impl Dim4[src]

pub fn new(dims: &[u64; 4]) -> Self[src]

Create Dim4 object

Examples

use arrayfire::Dim4;
let dims = Dim4::new(&[4, 4, 2, 1]);

pub fn elements(&self) -> u64[src]

Get the number of elements represented by Dim4 object

pub fn ndims(&self) -> usize[src]

Get the number of dimensions of Dim4

pub fn get(&self) -> &[u64; 4][src]

Get the dimensions as a slice of 4 values

Trait Implementations

impl Clone for Dim4[src]

impl Copy for Dim4[src]

impl Debug for Dim4[src]

impl Default for Dim4[src]

Default trait for Dim4 returns an Array of dimensions [1, 1, 1, 1]

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

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.

impl PartialEq<Dim4> for Dim4[src]

impl StructuralPartialEq for Dim4[src]

Auto Trait Implementations

impl RefUnwindSafe for Dim4

impl Send for Dim4

impl Sync for Dim4

impl Unpin for Dim4

impl UnwindSafe for Dim4

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.