1 /* Apache 2.0 INS-AMU 2015 */
10 #include "randomkit.h"
12 /* sk_restrict should be used anywhere a function takes two or more
13 * pointer arguments with same type:
14 * http://cellperformance.beyond3d.com/articles/2006/05/demystifying-the-restrict-keyword.html
15 * http://stackoverflow.com/a/5948101/5536371
17 #if defined(__GNUC__) && ((__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))
18 # define sk_restrict __restrict
19 #elif defined(_MSC_VER) && _MSC_VER >= 1400
20 # define sk_restrict __restrict
25 int sk_util_uniqi(const int n
,
26 const int * sk_restrict ints
,
27 int * sk_restrict nuniq
,
28 int ** sk_restrict uints
);
30 int sk_util_fill_gauss(rk_state
*rng
, int nx
, double *x
);
33 #define SK_MALLOCHECK(ptr) \
35 fprintf(stderr, "[sk_util] NULL malloc at %s:%d `%s'\n", __FILE__, __LINE__, #ptr);
37 #define SK_MALLOCHECK(ptr) ptr