Skip to content

Commit f7ff758

Browse files
committed
Style fix: Proper indentation
1 parent f58a53e commit f7ff758

File tree

3 files changed

+181
-181
lines changed

3 files changed

+181
-181
lines changed

src/com/arrayfire/Array.java

Lines changed: 148 additions & 148 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,27 @@
44

55
public class Array implements AutoCloseable {
66

7-
static {
8-
System.loadLibrary("af_java");
9-
}
7+
static {
8+
System.loadLibrary("af_java");
9+
}
1010

11-
private native static long createArray(int[] dims);
11+
private native static long createArray(int[] dims);
1212
private native static long createArrayElems(int[] dims, float[] elems);
13-
private native static void destroyArray(long ref);
14-
private native static float[] host(long ref);
13+
private native static void destroyArray(long ref);
14+
private native static float[] host(long ref);
1515
private native static int[] getDims(long ref);
1616

1717
// Binary operations
18-
private native static long add(long a, long b);
19-
private native static long sub(long a, long b);
20-
private native static long mul(long a, long b);
21-
private native static long div(long a, long b);
22-
private native static long le (long a, long b);
23-
private native static long lt (long a, long b);
24-
private native static long ge (long a, long b);
25-
private native static long gt (long a, long b);
26-
private native static long eq (long a, long b);
27-
private native static long ne (long a, long b);
18+
private native static long add(long a, long b);
19+
private native static long sub(long a, long b);
20+
private native static long mul(long a, long b);
21+
private native static long div(long a, long b);
22+
private native static long le (long a, long b);
23+
private native static long lt (long a, long b);
24+
private native static long ge (long a, long b);
25+
private native static long gt (long a, long b);
26+
private native static long eq (long a, long b);
27+
private native static long ne (long a, long b);
2828

2929
// Unary operations
3030
private native static long sin (long a);
@@ -51,26 +51,26 @@ public class Array implements AutoCloseable {
5151

5252
// Scalar operations
5353
private native static long addf(long a, float b);
54-
private native static long subf(long a, float b);
55-
private native static long mulf(long a, float b);
56-
private native static long divf(long a, float b);
57-
private native static long lef (long a, float b);
58-
private native static long ltf (long a, float b);
59-
private native static long gef (long a, float b);
60-
private native static long gtf (long a, float b);
61-
private native static long eqf (long a, float b);
62-
private native static long nef (long a, float b);
63-
private native static long pow (long a, float b);
54+
private native static long subf(long a, float b);
55+
private native static long mulf(long a, float b);
56+
private native static long divf(long a, float b);
57+
private native static long lef (long a, float b);
58+
private native static long ltf (long a, float b);
59+
private native static long gef (long a, float b);
60+
private native static long gtf (long a, float b);
61+
private native static long eqf (long a, float b);
62+
private native static long nef (long a, float b);
63+
private native static long pow (long a, float b);
6464
private native static long fsub(float a, long b);
65-
private native static long fdiv(float a, long b);
66-
private native static long fle (float a, long b);
67-
private native static long flt (float a, long b);
68-
private native static long fge (float a, long b);
69-
private native static long fgt (float a, long b);
65+
private native static long fdiv(float a, long b);
66+
private native static long fle (float a, long b);
67+
private native static long flt (float a, long b);
68+
private native static long fge (float a, long b);
69+
private native static long fgt (float a, long b);
7070

7171
// Global reference to JVM object
7272
// to persist between JNI calls
73-
long ref;
73+
long ref;
7474

7575
public Array() {
7676
ref = 0;
@@ -85,8 +85,8 @@ public Array(int[] dims) throws Exception {
8585
} else if ( dims.length > 3 ) {
8686
throw new Exception("Upto 3 dimensions only supported for now.");
8787
}
88-
this.ref = createArray(dims);
89-
}
88+
this.ref = createArray(dims);
89+
}
9090

9191
public Array(int[] dims, float[] elems) throws Exception {
9292
if( dims == null || elems == null ) {
@@ -101,168 +101,168 @@ public Array(int[] dims, float[] elems) throws Exception {
101101
throw new Exception("Mismatching dims and array size");
102102
}
103103
Log.i("Array", "============ Array class =============== ");
104-
this.ref = createArrayElems(dims,elems);
105-
}
104+
this.ref = createArrayElems(dims,elems);
105+
}
106106

107-
public int[] dims() {
108-
return getDims(ref);
109-
}
107+
public int[] dims() {
108+
return getDims(ref);
109+
}
110110

111111
public float[] host() throws Exception {
112112
return host(ref);
113113
}
114114

115115
// Binary operations
116-
public static Array add(Array a, Array b) throws Exception {
117-
Array ret_val = new Array();
118-
ret_val.ref = add(a.ref,b.ref);
119-
return ret_val;
120-
}
116+
public static Array add(Array a, Array b) throws Exception {
117+
Array ret_val = new Array();
118+
ret_val.ref = add(a.ref,b.ref);
119+
return ret_val;
120+
}
121121

122122
public static Array sub(Array a, Array b) throws Exception {
123-
Array ret_val = new Array();
124-
ret_val.ref = sub(a.ref,b.ref);
125-
return ret_val;
126-
}
123+
Array ret_val = new Array();
124+
ret_val.ref = sub(a.ref,b.ref);
125+
return ret_val;
126+
}
127127

128128
public static Array mul(Array a, Array b) throws Exception {
129-
Array ret_val = new Array();
130-
ret_val.ref = mul(a.ref,b.ref);
131-
return ret_val;
132-
}
129+
Array ret_val = new Array();
130+
ret_val.ref = mul(a.ref,b.ref);
131+
return ret_val;
132+
}
133133

134134
public static Array div(Array a, Array b) throws Exception {
135-
Array ret_val = new Array();
136-
ret_val.ref = div(a.ref,b.ref);
137-
return ret_val;
138-
}
135+
Array ret_val = new Array();
136+
ret_val.ref = div(a.ref,b.ref);
137+
return ret_val;
138+
}
139139

140140
public static Array le(Array a, Array b) throws Exception {
141-
Array ret_val = new Array();
142-
ret_val.ref = le(a.ref,b.ref);
143-
return ret_val;
144-
}
141+
Array ret_val = new Array();
142+
ret_val.ref = le(a.ref,b.ref);
143+
return ret_val;
144+
}
145145

146146
public static Array lt(Array a, Array b) throws Exception {
147-
Array ret_val = new Array();
148-
ret_val.ref = lt(a.ref,b.ref);
149-
return ret_val;
150-
}
147+
Array ret_val = new Array();
148+
ret_val.ref = lt(a.ref,b.ref);
149+
return ret_val;
150+
}
151151

152152
public static Array ge(Array a, Array b) throws Exception {
153-
Array ret_val = new Array();
154-
ret_val.ref = ge(a.ref,b.ref);
155-
return ret_val;
156-
}
153+
Array ret_val = new Array();
154+
ret_val.ref = ge(a.ref,b.ref);
155+
return ret_val;
156+
}
157157

158158
public static Array gt(Array a, Array b) throws Exception {
159-
Array ret_val = new Array();
160-
ret_val.ref = gt(a.ref,b.ref);
161-
return ret_val;
162-
}
159+
Array ret_val = new Array();
160+
ret_val.ref = gt(a.ref,b.ref);
161+
return ret_val;
162+
}
163163

164164
public static Array eq(Array a, Array b) throws Exception {
165-
Array ret_val = new Array();
166-
ret_val.ref = eq(a.ref,b.ref);
167-
return ret_val;
168-
}
165+
Array ret_val = new Array();
166+
ret_val.ref = eq(a.ref,b.ref);
167+
return ret_val;
168+
}
169169

170170
public static Array ne(Array a, Array b) throws Exception {
171-
Array ret_val = new Array();
172-
ret_val.ref = ne(a.ref,b.ref);
173-
return ret_val;
174-
}
171+
Array ret_val = new Array();
172+
ret_val.ref = ne(a.ref,b.ref);
173+
return ret_val;
174+
}
175175

176176
// Unary operations
177177
public static Array sin(Array a) throws Exception {
178-
Array ret_val = new Array();
179-
ret_val.ref = sin(a.ref);
180-
return ret_val;
181-
}
178+
Array ret_val = new Array();
179+
ret_val.ref = sin(a.ref);
180+
return ret_val;
181+
}
182182

183183
public static Array cos(Array a) throws Exception {
184-
Array ret_val = new Array();
185-
ret_val.ref = cos(a.ref);
186-
return ret_val;
187-
}
184+
Array ret_val = new Array();
185+
ret_val.ref = cos(a.ref);
186+
return ret_val;
187+
}
188188

189189
public static Array tan(Array a) throws Exception {
190-
Array ret_val = new Array();
191-
ret_val.ref = tan(a.ref);
192-
return ret_val;
193-
}
190+
Array ret_val = new Array();
191+
ret_val.ref = tan(a.ref);
192+
return ret_val;
193+
}
194194

195195
public static Array asin(Array a) throws Exception {
196-
Array ret_val = new Array();
197-
ret_val.ref = asin(a.ref);
198-
return ret_val;
199-
}
196+
Array ret_val = new Array();
197+
ret_val.ref = asin(a.ref);
198+
return ret_val;
199+
}
200200

201201
public static Array acos(Array a) throws Exception {
202-
Array ret_val = new Array();
203-
ret_val.ref = acos(a.ref);
204-
return ret_val;
205-
}
202+
Array ret_val = new Array();
203+
ret_val.ref = acos(a.ref);
204+
return ret_val;
205+
}
206206

207207
public static Array atan(Array a) throws Exception {
208-
Array ret_val = new Array();
209-
ret_val.ref = atan(a.ref);
210-
return ret_val;
211-
}
208+
Array ret_val = new Array();
209+
ret_val.ref = atan(a.ref);
210+
return ret_val;
211+
}
212212

213213
public static Array sinh(Array a) throws Exception {
214-
Array ret_val = new Array();
215-
ret_val.ref = sinh(a.ref);
216-
return ret_val;
217-
}
214+
Array ret_val = new Array();
215+
ret_val.ref = sinh(a.ref);
216+
return ret_val;
217+
}
218218

219219
public static Array cosh(Array a) throws Exception {
220-
Array ret_val = new Array();
221-
ret_val.ref = cosh(a.ref);
222-
return ret_val;
223-
}
220+
Array ret_val = new Array();
221+
ret_val.ref = cosh(a.ref);
222+
return ret_val;
223+
}
224224

225225
public static Array tanh(Array a) throws Exception {
226-
Array ret_val = new Array();
227-
ret_val.ref = tanh(a.ref);
228-
return ret_val;
229-
}
226+
Array ret_val = new Array();
227+
ret_val.ref = tanh(a.ref);
228+
return ret_val;
229+
}
230230

231231
public static Array asinh(Array a) throws Exception {
232-
Array ret_val = new Array();
233-
ret_val.ref = asinh(a.ref);
234-
return ret_val;
235-
}
232+
Array ret_val = new Array();
233+
ret_val.ref = asinh(a.ref);
234+
return ret_val;
235+
}
236236
public static Array acosh(Array a) throws Exception {
237-
Array ret_val = new Array();
238-
ret_val.ref = acosh(a.ref);
239-
return ret_val;
240-
}
237+
Array ret_val = new Array();
238+
ret_val.ref = acosh(a.ref);
239+
return ret_val;
240+
}
241241
public static Array atanh(Array a) throws Exception {
242-
Array ret_val = new Array();
243-
ret_val.ref = atanh(a.ref);
244-
return ret_val;
245-
}
242+
Array ret_val = new Array();
243+
ret_val.ref = atanh(a.ref);
244+
return ret_val;
245+
}
246246
public static Array exp(Array a) throws Exception {
247-
Array ret_val = new Array();
248-
ret_val.ref = exp(a.ref);
249-
return ret_val;
250-
}
247+
Array ret_val = new Array();
248+
ret_val.ref = exp(a.ref);
249+
return ret_val;
250+
}
251251
public static Array log(Array a) throws Exception {
252-
Array ret_val = new Array();
253-
ret_val.ref = log(a.ref);
254-
return ret_val;
255-
}
252+
Array ret_val = new Array();
253+
ret_val.ref = log(a.ref);
254+
return ret_val;
255+
}
256256
public static Array abs(Array a) throws Exception {
257-
Array ret_val = new Array();
258-
ret_val.ref = abs(a.ref);
259-
return ret_val;
260-
}
257+
Array ret_val = new Array();
258+
ret_val.ref = abs(a.ref);
259+
return ret_val;
260+
}
261261
public static Array sqrt(Array a) throws Exception {
262-
Array ret_val = new Array();
263-
ret_val.ref = sqrt(a.ref);
264-
return ret_val;
265-
}
262+
Array ret_val = new Array();
263+
ret_val.ref = sqrt(a.ref);
264+
return ret_val;
265+
}
266266

267267
// Scalar return operations
268268
public static float sum(Array a) throws Exception { return sum(a.ref); }
@@ -374,9 +374,9 @@ public static Array gt(float a, Array b) throws Exception {
374374
return res;
375375
}
376376

377-
@Override
378-
public void close() throws Exception {
379-
if (ref != 0) destroyArray(ref);
380-
}
377+
@Override
378+
public void close() throws Exception {
379+
if (ref != 0) destroyArray(ref);
380+
}
381381

382382
}

0 commit comments

Comments
 (0)