@@ -324,6 +324,7 @@ join (fromIntegral -> n) arr1 arr2 = op2 arr1 arr2 (\p a b -> af_join p n a b)
324324-- | Join many Arrays together along a specified dimension
325325--
326326-- *FIX ME*
327+ --
327328-- >>> joinMany 0 [1,2,3]
328329-- ArrayFire Array
329330-- [3 1 1 1]
@@ -370,6 +371,7 @@ tile _ _ = error "impossible"
370371-- | Reorders an Array according to newly specified dimensions
371372--
372373-- *FIX ME*
374+ --
373375-- >>> reorder @Double (scalar 22.0) [5,5]
374376-- ArrayFire Array
375377-- [5 5 1 1]
@@ -511,23 +513,59 @@ upper a (fromIntegral . fromEnum -> b) =
511513--
512514select
513515 :: Array CBool
516+ -- ^ is the conditional array
514517 -> Array a
518+ -- ^ is the array containing elements from the true part of the condition
515519 -> Array a
520+ -- ^ is the array containing elements from the false part of the condition
516521 -> Array a
522+ -- ^ is the output containing elements of a when cond is true else elements from b
517523select a b c = op3 a b c af_select
518524
525+ -- | Selects elements from two arrays based on the values of a binary conditional array.
526+ --
527+ -- <http://arrayfire.org/docs/group__data__func__select.htm#gab6886120d0bac4717276910e468bbe88>
528+ --
529+ -- >>> cond = vector @CBool 5 [1,0,1,0,1]
530+ -- >>> arr1 = vector @Double 5 (repeat 1)
531+ -- >>> x = 99
532+ -- >>> selectScalarR cond x arr1
533+ -- ArrayFire Array
534+ -- [5 1 1 1]
535+ -- 1.0000 99.0000 1.0000 99.0000 1.0000
536+ --
519537selectScalarR
520- :: Array a
538+ :: Array CBool
539+ -- ^ is the conditional array
521540 -> Array a
541+ -- ^ is the array containing elements from the true part of the condition
522542 -> Double
543+ -- ^ is a scalar assigned to out when cond is false
523544 -> Array a
545+ -- ^ the output containing elements of a when cond is true else elements from b
524546selectScalarR a b c = op2 a b (\ p w x -> af_select_scalar_r p w x c)
525547
548+ -- | Selects elements from two arrays based on the values of a binary conditional array.
549+ --
550+ -- [ArrayFire Docs](http://arrayfire.org/docs/group__data__func__select.htm#ga0ccdc05779f88cab5095bce987c2da9d)
551+ --
552+ -- >>> cond = vector @CBool 5 [1,0,1,0,1]
553+ -- >>> arr1 = vector @Double 5 (repeat 1)
554+ -- >>> x = 99
555+ -- >>> selectScalarL cond x arr1
556+ -- ArrayFire Array
557+ -- [5 1 1 1]
558+ -- 99.0000 1.0000 99.0000 1.0000 99.0000
559+ --
526560selectScalarL
527- :: Array a
561+ :: Array CBool
562+ -- ^ the conditional array
528563 -> Double
564+ -- ^ a scalar assigned to out when cond is true
529565 -> Array a
566+ -- ^ the array containing elements from the false part of the condition
530567 -> Array a
568+ -- ^ is the output containing elements of a when cond is true else elements from b
531569selectScalarL a n b = op2 a b (\ p w x -> af_select_scalar_l p w n x)
532570
533571-- af_err af_replace(af_array a, const af_array cond, const af_array b);
0 commit comments