|
2 | 2 |
|
3 | 3 | public class Algorithm extends ArrayFire { |
4 | 4 |
|
5 | | - // Scalar return operations |
6 | | - private native static double sumAll(long a); |
7 | | - private native static double maxAll(long a); |
8 | | - private native static double minAll(long a); |
9 | | - |
10 | | - private native static long sum(long a, int dim); |
11 | | - private native static long max(long a, int dim); |
12 | | - private native static long min(long a, int dim); |
13 | | - |
14 | | - // Scalar return operations |
15 | | - public static double sumAll(Array a) throws Exception { return sumAll(a.ref); } |
16 | | - public static double maxAll(Array a) throws Exception { return maxAll(a.ref); } |
17 | | - public static double minAll(Array a) throws Exception { return minAll(a.ref); } |
18 | | - |
19 | | - public static void sum(Array res, Array a, int dim) throws Exception { |
20 | | - long ref = sum(a.ref, dim); |
21 | | - res.set(ref); |
22 | | - } |
23 | | - |
24 | | - public static void max(Array res, Array a, int dim) throws Exception { |
25 | | - long ref = max(a.ref, dim); |
26 | | - res.set(ref); |
27 | | - } |
28 | | - |
29 | | - public static void min(Array res, Array a, int dim) throws Exception { |
30 | | - long ref = min(a.ref, dim); |
31 | | - res.set(ref); |
32 | | - } |
33 | | - |
34 | | - public static void sum(Array res, Array a) throws Exception { |
35 | | - sum(res, a, 0); |
36 | | - } |
37 | | - |
38 | | - public static void max(Array res, Array a) throws Exception { |
39 | | - max(res, a, 0); |
40 | | - } |
41 | | - |
42 | | - public static void min(Array res, Array a) throws Exception { |
43 | | - min(res, a, 0); |
44 | | - } |
| 5 | + // Scalar return operations |
| 6 | + private native static double sumAll(long a); |
| 7 | + |
| 8 | + private native static double maxAll(long a); |
| 9 | + |
| 10 | + private native static double minAll(long a); |
| 11 | + |
| 12 | + private native static long sum(long a, int dim); |
| 13 | + |
| 14 | + private native static long max(long a, int dim); |
| 15 | + |
| 16 | + private native static long min(long a, int dim); |
| 17 | + |
| 18 | + // Scalar return operations |
| 19 | + public static double sumAll(Array a) throws Exception { |
| 20 | + return sumAll(a.ref); |
| 21 | + } |
| 22 | + |
| 23 | + public static double maxAll(Array a) throws Exception { |
| 24 | + return maxAll(a.ref); |
| 25 | + } |
| 26 | + |
| 27 | + public static double minAll(Array a) throws Exception { |
| 28 | + return minAll(a.ref); |
| 29 | + } |
| 30 | + |
| 31 | + public static void sum(Array res, Array a, int dim) throws Exception { |
| 32 | + long ref = sum(a.ref, dim); |
| 33 | + res.set(ref); |
| 34 | + } |
| 35 | + |
| 36 | + public static void max(Array res, Array a, int dim) throws Exception { |
| 37 | + long ref = max(a.ref, dim); |
| 38 | + res.set(ref); |
| 39 | + } |
| 40 | + |
| 41 | + public static void min(Array res, Array a, int dim) throws Exception { |
| 42 | + long ref = min(a.ref, dim); |
| 43 | + res.set(ref); |
| 44 | + } |
| 45 | + |
| 46 | + public static void sum(Array res, Array a) throws Exception { |
| 47 | + sum(res, a, 0); |
| 48 | + } |
| 49 | + |
| 50 | + public static void max(Array res, Array a) throws Exception { |
| 51 | + max(res, a, 0); |
| 52 | + } |
| 53 | + |
| 54 | + public static void min(Array res, Array a) throws Exception { |
| 55 | + min(res, a, 0); |
| 56 | + } |
45 | 57 | } |
0 commit comments