[][src]Function arrayfire::diff2

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

Calculate second order numerical difference along a given dimension

Parameters

Return Values

Result Array with second order difference values

Examples

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