forked from arrayfire/arrayfire
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcorrcoef.cpp
More file actions
37 lines (31 loc) · 1.16 KB
/
corrcoef.cpp
File metadata and controls
37 lines (31 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*******************************************************
* Copyright (c) 2014, ArrayFire
* All rights reserved.
*
* This file is distributed under 3-clause BSD license.
* The complete license agreement can be obtained at:
* http://arrayfire.com/licenses/BSD-3-Clause
********************************************************/
#include <af/array.h>
#include <af/statistics.h>
#include "error.hpp"
namespace af {
#define INSTANTIATE_CORRCOEF(T) \
template<> \
AFAPI T corrcoef(const array& X, const array& Y) { \
double real; \
AF_THROW(af_corrcoef(&real, NULL, X.get(), Y.get())); \
return (T)real; \
}
INSTANTIATE_CORRCOEF(float);
INSTANTIATE_CORRCOEF(double);
INSTANTIATE_CORRCOEF(int);
INSTANTIATE_CORRCOEF(unsigned int);
INSTANTIATE_CORRCOEF(char);
INSTANTIATE_CORRCOEF(unsigned char);
INSTANTIATE_CORRCOEF(long long);
INSTANTIATE_CORRCOEF(unsigned long long);
INSTANTIATE_CORRCOEF(short);
INSTANTIATE_CORRCOEF(unsigned short);
#undef INSTANTIATE_CORRCOEF
} // namespace af