File tree

13 files changed

+331
-75
lines changed

13 files changed

+331
-75
lines changed
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ module ArrayFire
5757
, module Data.Int
5858
, module Data.Word
5959
, module Data.Complex
60+
, module Foreign.Storable
6061
) where
6162

6263
import ArrayFire.Algorithm
@@ -79,6 +80,7 @@ import ArrayFire.Types
7980
import ArrayFire.Util
8081
import ArrayFire.Vision
8182
import ArrayFire.Orphans ()
83+
import Foreign.Storable
8284
import Foreign.C.Types
8385
import Data.Int
8486
import Data.Complex
@@ -189,7 +191,7 @@ import Data.Word
189191
-- 2.0000 2.0000
190192
-- @
191193
--
192-
-- Array construction can use Haskell's lazy lists, since 'take' is called on each dimension before sending to the 'C' API.
194+
-- Array construction can use Haskell's lazy lists, since 'take' is called on each dimension before sending to the C API.
193195
--
194196
-- >>> mkArray @Double [2,2] [ [1..], [1..] ]
195197
-- ArrayFire Array
@@ -254,7 +256,7 @@ import Data.Word
254256
--
255257

256258
-- $conversion
257-
-- 'Array' can be exported into 'Haskell' using `toVector'. This will create a 'Storable' vector suitable for use in other C programs.
259+
-- 'Array' can be exported into Haskell using `toVector'. This will create a Storable vector suitable for use in other C programs.
258260
--
259261
-- >>> vector :: Vector Double <- toVector <$> randu @Double [10,10]
260262
--
@@ -271,7 +273,7 @@ import Data.Word
271273
-- let arr = A.'constant' [1,1,1,1] 10
272274
-- idx <- A.'saveArray' "key" arr "file.array" False
273275
-- foundIndex <- A.'readArrayKeyCheck' "file.array" "key"
274-
-- 'when' (idx == foundIndex) $ do
276+
-- when (idx == foundIndex) $ do
275277
-- array <- A.'readArrayKey' "file.array" "key"
276278
-- 'print' array
277279
--
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
-- import ArrayFire
2525
--
2626
-- main :: 'IO' ()
27-
-- main = 'print' ('matrix' \@'Double' (2,2) [ [1..], [1..] ])
27+
-- main = 'print' (matrix \@'Double' (2,2) [ [1..], [1..] ])
2828
-- @
2929
--
3030
-- @
@@ -361,7 +361,7 @@ isVector
361361
-> Bool
362362
isVector a = toEnum . fromIntegral $ (a `infoFromArray` af_is_vector)
363363

364-
-- | Checks if an 'Array' is a 'Complex'
364+
-- | Checks if an 'Array' is a Complex
365365
--
366366
-- >>> isComplex (scalar (1.0 :+ 1.0) :: Array (Complex Double))
367367
-- True
@@ -372,7 +372,7 @@ isComplex
372372
-> Bool
373373
isComplex a = toEnum . fromIntegral $ (a `infoFromArray` af_is_complex)
374374

375-
-- | Checks if an 'Array' is 'Real'
375+
-- | Checks if an 'Array' is Real
376376
--
377377
-- >>> isReal (scalar 1.0 :: Array Double)
378378
-- True
@@ -405,7 +405,7 @@ isSingle
405405
-> Bool
406406
isSingle a = toEnum . fromIntegral $ (a `infoFromArray` af_is_single)
407407

408-
-- | Checks if an 'Array' is 'Double', 'Float', 'Complex Double', or 'Complex Float'
408+
-- | Checks if an 'Array' is 'Double', 'Float', Complex 'Double', or Complex 'Float'
409409
--
410410
-- >>> isRealFloating (scalar 1.0 :: Array Double)
411411
-- True
@@ -426,7 +426,7 @@ isFloating
426426
-> Bool
427427
isFloating a = toEnum . fromIntegral $ (a `infoFromArray` af_is_floating)
428428

429-
-- | Checks if an 'Array' is of type 'Int16', 'Int32', or 'Int64'
429+
-- | Checks if an 'Array' is of type Int16, Int32, or Int64
430430
--
431431
-- >>> isInteger (scalar 1 :: Array Int16)
432432
-- True
@@ -436,7 +436,7 @@ isInteger
436436
-> Bool
437437
isInteger a = toEnum . fromIntegral $ (a `infoFromArray` af_is_integer)
438438

439-
-- | Checks if an 'Array' is of type 'CBool'
439+
-- | Checks if an 'Array' is of type CBool
440440
--
441441
-- >>> isBool (scalar 1 :: Array CBool)
442442
-- True
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ dot
8080
-> Array a
8181
-- ^ Right-hand side input
8282
-> MatProp
83-
-- ^ Options for left-hand side. Currently only 'AF_MAT_NONE' and 'AF_MAT_CONJ' are supported.
83+
-- ^ Options for left-hand side. Currently only AF_MAT_NONE and AF_MAT_CONJ are supported.
8484
-> MatProp
85-
-- ^ Options for right-hand side. Currently only 'AF_MAT_NONE' and 'AF_MAT_CONJ' are supported.
85+
-- ^ Options for right-hand side. Currently only AF_MAT_NONE and AF_MAT_CONJ are supported.
8686
-> Array a
8787
-- ^ Output of 'dot'
8888
dot arr1 arr2 prop1 prop2 =
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ lower
481481
:: Array a
482482
-- ^ is the input matrix
483483
-> Bool
484-
-- ^ 'is_unit_diag' is a boolean parameter specifying if the diagonal elements should be 1
484+
-- ^ boolean parameter specifying if the diagonal elements should be 1
485485
-> Array a
486486
lower a (fromIntegral . fromEnum -> b) =
487487
a `op1` (\p k -> af_lower p k b)
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import ArrayFire.FFI
3232
info :: IO ()
3333
info = afCall af_info
3434

35-
-- | Calls 'af_init' C function from ArrayFire API
35+
-- | Calls /af_init/ C function from ArrayFire API
3636
--
3737
-- >>> afInit
3838
-- ()
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import ArrayFire.Internal.Types
2121
import ArrayFire.FFI
2222
import ArrayFire.Exception
2323

24-
-- | Construct 'Features'
24+
-- | Construct Features
2525
--
2626
-- >>> features = createFeatures (createFeatures 10)
2727
--
@@ -37,7 +37,7 @@ createFeatures (fromIntegral -> n) =
3737
fptr <- newForeignPtr af_release_features ptr
3838
pure (Features fptr)
3939

40-
-- | Retain 'Features'
40+
-- | Retain Features
4141
--
4242
-- >>> features = retainFeatures (createFeatures 10)
4343
--
@@ -46,7 +46,7 @@ retainFeatures
4646
-> Features
4747
retainFeatures = (`op1f` af_retain_features)
4848

49-
-- | Get number of 'Feature's
49+
-- | Get number of Features
5050
--
5151
-- link
5252
--
@@ -58,7 +58,7 @@ getFeaturesNum
5858
-> Int
5959
getFeaturesNum = fromIntegral . (`infoFromFeatures` af_get_features_num)
6060

61-
-- | Get 'Feature' X-position
61+
-- | Get Feature X-position
6262
--
6363
-- >>> getFeaturesXPos (createFeatures 10)
6464
-- ArrayFire Array
@@ -70,7 +70,7 @@ getFeaturesXPos
7070
-> Array a
7171
getFeaturesXPos = (`featuresToArray` af_get_features_xpos)
7272

73-
-- | Get 'Feature' Y-position
73+
-- | Get Feature Y-position
7474
--
7575
-- >>> getFeaturesYPos (createFeatures 10)
7676
-- ArrayFire Array
@@ -82,7 +82,7 @@ getFeaturesYPos
8282
-> Array a
8383
getFeaturesYPos = (`featuresToArray` af_get_features_ypos)
8484

85-
-- | Get 'Feature' Score
85+
-- | Get Feature Score
8686
--
8787
-- >>> getFeaturesScore (createFeatures 10)
8888
-- ArrayFire Array
@@ -94,7 +94,7 @@ getFeaturesScore
9494
-> Array a
9595
getFeaturesScore = (`featuresToArray` af_get_features_score)
9696

97-
-- | Get 'Feature' orientation
97+
-- | Get Feature orientation
9898
--
9999
-- >>> getFeaturesOrientation (createFeatures 10)
100100
-- ArrayFire Array
@@ -106,7 +106,7 @@ getFeaturesOrientation
106106
-> Array a
107107
getFeaturesOrientation = (`featuresToArray` af_get_features_orientation)
108108

109-
-- | Get 'Feature' size
109+
-- | Get Feature size
110110
--
111111
-- >>> getFeaturesSize (createFeatures 10)
112112
-- ArrayFire Array

0 commit comments

Comments
 (0)