MCPcopy Index your code
hub / github.com/arrayfire/arrayfire-rust / median

Function median

src/statistics/mod.rs:77–87  ·  view source on GitHub ↗

Find the median along a given dimension Parameters - `input` is the input Array - `dim` is dimension along which median has to be found Return Values An Array whose size is equal to input except along the dimension which median needs to be found. Array size along `dim` will be reduced to one.

(input: &Array<T>, dim: i64)

Source from the content-addressed store, hash-verified

75/// An Array whose size is equal to input except along the dimension which
76/// median needs to be found. Array size along `dim` will be reduced to one.
77pub fn median<T>(input: &Array<T>, dim: i64) -> Array<T>
78where
79 T: HasAfEnum + MedianComputable,
80{
81 unsafe {
82 let mut temp: af_array = std::ptr::null_mut();
83 let err_val = af_median(&mut temp as *mut af_array, input.get(), dim);
84 HANDLE_ERROR(AfError::from(err_val));
85 temp.into()
86 }
87}
88
89macro_rules! stat_func_def {
90 ($doc_str: expr, $fn_name: ident, $ffi_fn: ident) => {

Callers

nothing calls this directly

Calls 3

HANDLE_ERRORFunction · 0.85
intoMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected