- Main Page
- Tutorials
- Functions
- Release Notes
- Examples

statistics.h
Go to the documentation of this file.
1 /*******************************************************
2 * Copyright (c) 2014, ArrayFire
3 * All rights reserved.
4 *
5 * This file is distributed under 3-clause BSD license.
6 * The complete license agreement can be obtained at:
7 * http://arrayfire.com/licenses/BSD-3-Clause
8 ********************************************************/
9
10 #pragma once
11 #include <af/defines.h>
12
13 #ifdef __cplusplus
14 namespace af
15 {
16 class array;
17
29 AFAPI array mean(const array& in, const dim_t dim=-1);
30
43 AFAPI array mean(const array& in, const array& weights, const dim_t dim=-1);
44
57 AFAPI array var(const array& in, const bool isbiased=false, const dim_t dim=-1);
58
71 AFAPI array var(const array& in, const array &weights, const dim_t dim=-1);
72
84 AFAPI array stdev(const array& in, const dim_t dim=-1);
85
86
97 AFAPI array cov(const array& X, const array& Y, const bool isbiased=false);
98
110 AFAPI array median(const array& in, const dim_t dim=-1);
111
120 template<typename T>
121 AFAPI T mean(const array& in);
122
132 template<typename T>
133 AFAPI T mean(const array& in, const array& weights);
134
144 template<typename T>
145 AFAPI T var(const array& in, const bool isbiased=false);
146
156 template<typename T>
157 AFAPI T var(const array& in, const array& weights);
158
167 template<typename T>
168 AFAPI T stdev(const array& in);
169
178 template<typename T>
179 AFAPI T median(const array& in);
180
192 template<typename T>
193 AFAPI T corrcoef(const array& X, const array& Y);
194
195 }
196 #endif
197
198 #ifdef __cplusplus
199 extern "C" {
200 #endif
201
213 AFAPI af_err af_mean(af_array *out, const af_array in, const dim_t dim);
214
227 AFAPI af_err af_mean_weighted(af_array *out, const af_array in, const af_array weights, const dim_t dim);
228
242 AFAPI af_err af_var(af_array *out, const af_array in, const bool isbiased, const dim_t dim);
243
257 AFAPI af_err af_var_weighted(af_array *out, const af_array in, const af_array weights, const dim_t dim);
258
271 AFAPI af_err af_stdev(af_array *out, const af_array in, const dim_t dim);
272
285 AFAPI af_err af_cov(af_array* out, const af_array X, const af_array Y, const bool isbiased);
286
298 AFAPI af_err af_median(af_array* out, const af_array in, const dim_t dim);
299
311 AFAPI af_err af_mean_all(double *real, double *imag, const af_array in);
312
325 AFAPI af_err af_mean_all_weighted(double *real, double *imag, const af_array in, const af_array weights);
326
327
340 AFAPI af_err af_var_all(double *realVal, double *imagVal, const af_array in, const bool isbiased);
341
354 AFAPI af_err af_var_all_weighted(double *realVal, double *imagVal, const af_array in, const af_array weights);
355
367 AFAPI af_err af_stdev_all(double *real, double *imag, const af_array in);
368
380 AFAPI af_err af_median_all(double *realVal, double *imagVal, const af_array in);
381
397 AFAPI af_err af_corrcoef(double *realVal, double *imagVal, const af_array X, const af_array Y);
398
399 #ifdef __cplusplus
400 }
401 #endif
af
Definition: algorithm.h:14
af::stdev
AFAPI array stdev(const array &in, const dim_t dim=-1)
C++ Interface for standard deviation.
af_var_weighted
AFAPI af_err af_var_weighted(af_array *out, const af_array in, const af_array weights, const dim_t dim)
C Interface for variance of weighted input array.
af_median_all
AFAPI af_err af_median_all(double *realVal, double *imagVal, const af_array in)
C Interface for median.
af::median
AFAPI array median(const array &in, const dim_t dim=-1)
C++ Interface for median.
af_var_all_weighted
AFAPI af_err af_var_all_weighted(double *realVal, double *imagVal, const af_array in, const af_array weights)
C Interface for variance of all elements in weighted input.
af_var_all
AFAPI af_err af_var_all(double *realVal, double *imagVal, const af_array in, const bool isbiased)
C Interface for variance of all elements.
af::mean
AFAPI array mean(const array &in, const dim_t dim=-1)
C++ Interface for mean.
af_err
af_err
Definition: defines.h:67
defines.h
dim_t
long long dim_t
Definition: defines.h:50
af::imag
AFAPI array imag(const array &in)
C++ Interface for getting imaginary part from complex array.
af::real
AFAPI array real(const array &in)
C++ Interface for getting real part from complex array.
AFAPI
#define AFAPI
Definition: defines.h:31
afcl::array
static af::array array(af::dim4 idims, cl_mem buf, af::dtype type, bool retain=false)
Create an af::array object from an OpenCL cl_mem buffer.
Definition: opencl.h:136
af_median
AFAPI af_err af_median(af_array *out, const af_array in, const dim_t dim)
C Interface for median.
af_stdev
AFAPI af_err af_stdev(af_array *out, const af_array in, const dim_t dim)
C Interface for standard deviation.
af::corrcoef
AFAPI T corrcoef(const array &X, const array &Y)
C++ Interface for correlation coefficient.
af_cov
AFAPI af_err af_cov(af_array *out, const af_array X, const af_array Y, const bool isbiased)
C Interface for covariance.
af_mean_weighted
AFAPI af_err af_mean_weighted(af_array *out, const af_array in, const af_array weights, const dim_t dim)
C Interface for mean of weighted input array.
af_array
void * af_array
Definition: defines.h:187
af::cov
AFAPI array cov(const array &X, const array &Y, const bool isbiased=false)
C++ Interface for covariance.
af_stdev_all
AFAPI af_err af_stdev_all(double *real, double *imag, const af_array in)
C Interface for standard deviation of all elements.
af_corrcoef
AFAPI af_err af_corrcoef(double *realVal, double *imagVal, const af_array X, const af_array Y)
C Interface for correlation coefficient.
af::var
AFAPI array var(const array &in, const bool isbiased=false, const dim_t dim=-1)
C++ Interface for variance.
af_var
AFAPI af_err af_var(af_array *out, const af_array in, const bool isbiased, const dim_t dim)
C Interface for variance.
af_mean_all_weighted
AFAPI af_err af_mean_all_weighted(double *real, double *imag, const af_array in, const af_array weights)
C Interface for mean of all elements in weighted input.
af_mean_all
AFAPI af_err af_mean_all(double *real, double *imag, const af_array in)
C Interface for mean of all elements.
af_mean
AFAPI af_err af_mean(af_array *out, const af_array in, const dim_t dim)
C Interface for mean.