[][src]Function arrayfire::sum_all

pub fn sum_all<T>(
    input: &Array<T>
) -> (<<T as HasAfEnum>::AggregateOutType as HasAfEnum>::BaseType, <<T as HasAfEnum>::AggregateOutType as HasAfEnum>::BaseType) where
    T: HasAfEnum,
    <T as HasAfEnum>::AggregateOutType: HasAfEnum,
    <<T as HasAfEnum>::AggregateOutType as HasAfEnum>::BaseType: HasAfEnum + Fromf64

Sum all values of the Array


Return Values

A tuple containing the summation result.

Note: For non-complex data type Arrays, second value of tuple is zero.


use arrayfire::{Dim4, print, randu, sum_all};
let dims = Dim4::new(&[5, 5, 1, 1]);
let a = randu::<f32>(dims);
println!("Result : {:?}", sum_all(&a));