26
26
-- ^ Dimension along which to perform sum
27
27
-> a
28
28
-- ^ Will return the sum of all values in the input array along the specified dimension
29
- sum x n = getScalar (x `op1` (\ p a -> af_sum p a n))
29
+ sum x ( fromIntegral -> n) = getScalar (x `op1` (\ p a -> af_sum p a n))
30
30
31
31
sumNaN
32
32
:: (Fractional a , AFType a )
38
38
-- ^ Default value to use in the case of NaN
39
39
-> a
40
40
-- ^ Will return the sum of all values in the input array along the specified dimension, substituted with the default value
41
- sumNaN n i d = getScalar (n `op1` (\ p a -> af_sum_nan p a i d))
41
+ sumNaN n ( fromIntegral -> i) d = getScalar (n `op1` (\ p a -> af_sum_nan p a i d))
42
42
43
43
product
44
44
:: AFType a
@@ -48,7 +48,7 @@ product
48
48
-- ^ Dimension along which to perform product
49
49
-> a
50
50
-- ^ Will return the product of all values in the input array along the specified dimension
51
- product x n = getScalar (x `op1` (\ p a -> af_product p a n))
51
+ product x ( fromIntegral -> n) = getScalar (x `op1` (\ p a -> af_product p a n))
52
52
53
53
productNaN
54
54
:: (AFType a , Fractional a )
@@ -60,7 +60,7 @@ productNaN
60
60
-- ^ Default value to use in the case of NaN
61
61
-> a
62
62
-- ^ Will return the product of all values in the input array along the specified dimension, substituted with the default value
63
- productNaN n i d = getScalar (n `op1` (\ p a -> af_product_nan p a i d))
63
+ productNaN n ( fromIntegral -> i) d = getScalar (n `op1` (\ p a -> af_product_nan p a i d))
64
64
65
65
min
66
66
:: AFType a
70
70
-- ^ Dimension along which to retrieve the min element
71
71
-> a
72
72
-- ^ Will contain the minimum of all values in the input array along dim
73
- min x n = getScalar (x `op1` (\ p a -> af_min p a n))
73
+ min x ( fromIntegral -> n) = getScalar (x `op1` (\ p a -> af_min p a n))
74
74
75
75
max
76
76
:: AFType a
80
80
-- ^ Dimension along which to retrieve the max element
81
81
-> a
82
82
-- ^ Will contain the maximum of all values in the input array along dim
83
- max x n = getScalar (x `op1` (\ p a -> af_max p a n))
83
+ max x ( fromIntegral -> n) = getScalar (x `op1` (\ p a -> af_max p a n))
84
84
85
85
allTrue
86
86
:: forall a . AFType a
@@ -90,7 +90,7 @@ allTrue
90
90
-- ^ Dimension along which to see if all elements are True
91
91
-> Bool
92
92
-- ^ Will contain the maximum of all values in the input array along dim
93
- allTrue x n = getScalar @ Bool @ a (x `op1` (\ p a -> af_all_true p a n))
93
+ allTrue x ( fromIntegral -> n) = getScalar @ Bool @ a (x `op1` (\ p a -> af_all_true p a n))
94
94
95
95
anyTrue
96
96
:: forall a . AFType a
@@ -100,7 +100,7 @@ anyTrue
100
100
-- ^ Dimension along which to see if all elements are True
101
101
-> Bool
102
102
-- ^ Returns if all elements are true
103
- anyTrue x n = getScalar @ Bool @ a (x `op1` (\ p a -> af_any_true p a n))
103
+ anyTrue x ( fromIntegral -> n) = getScalar @ Bool @ a (x `op1` (\ p a -> af_any_true p a n))
104
104
105
105
count
106
106
:: forall a . AFType a
@@ -110,7 +110,7 @@ count
110
110
-- ^ Dimension along which to count
111
111
-> Int
112
112
-- ^ Count of all elements along dimension
113
- count x n = getScalar @ Int @ a (x `op1` (\ p a -> af_count p a n))
113
+ count x ( fromIntegral -> n) = getScalar @ Int @ a (x `op1` (\ p a -> af_count p a n))
114
114
115
115
-- | Note: imag is always set to 0 when in is real
116
116
sumAll
197
197
-- ^ The dimension along which the minimum value is extracted
198
198
-> (Array a , Array a )
199
199
-- ^ will contain the minimum of all values in in along dim, will also contain the location of minimum of all values in in along dim
200
- imin a n = op2p a (\ x y z -> af_imin x y z n)
200
+ imin a ( fromIntegral -> n) = op2p a (\ x y z -> af_imin x y z n)
201
201
202
202
imax
203
203
:: AFType a
207
207
-- ^ The dimension along which the minimum value is extracted
208
208
-> (Array a , Array a )
209
209
-- ^ will contain the maximum of all values in in along dim, will also contain the location of maximum of all values in in along dim
210
- imax a n = op2p a (\ x y z -> af_imax x y z n)
210
+ imax a ( fromIntegral -> n) = op2p a (\ x y z -> af_imax x y z n)
211
211
212
212
iminAll
213
213
:: AFType a
@@ -237,7 +237,7 @@ accum
237
237
-- ^ Dimension along which to calculate the sum
238
238
-> Array a
239
239
-- ^ Contains inclusive sum
240
- accum a n = a `op1` (\ x y -> af_accum x y n)
240
+ accum a ( fromIntegral -> n) = a `op1` (\ x y -> af_accum x y n)
241
241
242
242
scan
243
243
:: AFType a
251
251
-- ^ Should the scan be inclusive or not
252
252
-> Array a
253
253
-- ^ The scan of the input
254
- scan a d op batch =
254
+ scan a ( fromIntegral -> d) op ( fromIntegral . fromEnum -> batch) =
255
255
a `op1` (\ x y -> af_scan x y d (toBinaryOp op) batch)
256
256
257
257
scanByKey
@@ -267,7 +267,7 @@ scanByKey
267
267
-> Bool
268
268
-- ^ Is the scan incluside or not
269
269
-> Array a
270
- scanByKey a b d op batch =
270
+ scanByKey a b ( fromIntegral -> d) op ( fromIntegral . fromEnum -> batch) =
271
271
op2 a b (\ x y z -> af_scan_by_key x y z d (toBinaryOp op) batch)
272
272
273
273
where'
@@ -286,7 +286,7 @@ diff1
286
286
-- ^ Dimension along which numerical difference is performed
287
287
-> Array a
288
288
-- ^ Will contain first order numerical difference
289
- diff1 a n = a `op1` (\ p x -> af_diff1 p x n)
289
+ diff1 a ( fromIntegral -> n) = a `op1` (\ p x -> af_diff1 p x n)
290
290
291
291
diff2
292
292
:: AFType a
@@ -296,7 +296,7 @@ diff2
296
296
-- ^ Dimension along which numerical difference is performed
297
297
-> Array a
298
298
-- ^ Will contain second order numerical difference
299
- diff2 a n = a `op1` (\ p x -> af_diff2 p x n)
299
+ diff2 a ( fromIntegral -> n) = a `op1` (\ p x -> af_diff2 p x n)
300
300
301
301
sort
302
302
:: AFType a
308
308
-- ^ Return results in ascending order
309
309
-> Array a
310
310
-- ^ Will contain sorted input
311
- sort a (fromIntegral -> n) b =
311
+ sort a (fromIntegral -> n) ( fromIntegral . fromEnum -> b) =
312
312
a `op1` (\ p x -> af_sort p x n b)
313
313
314
314
sortIndex
@@ -321,7 +321,7 @@ sortIndex
321
321
-- ^ Return results in ascending order
322
322
-> (Array a , Array a )
323
323
-- ^ Contains the sorted, contains indices for original input
324
- sortIndex a (fromIntegral -> n) b =
324
+ sortIndex a (fromIntegral -> n) ( fromIntegral . fromEnum -> b) =
325
325
a `op2p` (\ p1 p2 p3 -> af_sort_index p1 p2 p3 n b)
326
326
327
327
sortByKey
@@ -335,7 +335,7 @@ sortByKey
335
335
-> Bool
336
336
-- ^ Return results in ascending order
337
337
-> (Array a , Array a )
338
- sortByKey a1 a2 (fromIntegral -> n) b =
338
+ sortByKey a1 a2 (fromIntegral -> n) ( fromIntegral . fromEnum -> b) =
339
339
op2p2 a1 a2 (\ w x y z -> af_sort_by_key w x y z n b)
340
340
341
341
setUnique
@@ -346,7 +346,7 @@ setUnique
346
346
-- ^ if true, skips the sorting steps internally
347
347
-> Array a
348
348
-- ^ Will contain the unique values from in
349
- setUnique a b =
349
+ setUnique a ( fromIntegral . fromEnum -> b) =
350
350
op1 a (\ x y -> af_set_unique x y b)
351
351
352
352
setUnion
@@ -358,7 +358,7 @@ setUnion
358
358
-> Bool
359
359
-- ^ If true, skips calling unique internally
360
360
-> Array a
361
- setUnion a1 a2 b =
361
+ setUnion a1 a2 ( fromIntegral . fromEnum -> b) =
362
362
op2 a1 a2 (\ x y z -> af_set_union x y z b)
363
363
364
364
setIntersect
@@ -371,5 +371,5 @@ setIntersect
371
371
-- ^ If true, skips calling unique internally
372
372
-> Array a
373
373
-- ^ Intersection of first and second array
374
- setIntersect a1 a2 b =
374
+ setIntersect a1 a2 ( fromIntegral . fromEnum -> b) =
375
375
op2 a1 a2 (\ x y z -> af_set_intersect x y z b)
0 commit comments