Function arrayfire::diff2 [] [src]

pub fn diff2(input: &Array, dim: i32) -> Array

Calculate second order numerical difference along a given dimension

Parameters

  • input - Input Array
  • dim - Dimension along which second order difference is calculated

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);