[][src]Function arrayfire::diff1

pub fn diff1<T>(input: &Array<T>, dim: i32) -> Array<T::InType> where
    T: HasAfEnum,
    T::InType: HasAfEnum

Calculate first order numerical difference along a given dimension

Parameters

Return Values

Result Array with first order difference values

Examples

use arrayfire::{Dim4, print, randu, diff1};
let dims = Dim4::new(&[5, 3, 1, 1]);
let a = randu::<f32>(dims);
print(&a);
let b = diff1(&a, 0);
print(&b);
let c = diff1(&a, 1);
print(&c);